/** START DEFINE BLOCK for nglview-js-widgets@0.5.4-dev.1/src/labplugin.js **/
jupyter.define('nglview-js-widgets@0.5.4-dev.1/src/labplugin.js', function (module, exports, __jupyter_require__) {
	var nglview = __jupyter_require__('nglview-js-widgets@0.5.4-dev.1/src/index.js');
	
	var jupyterlab_widgets = __jupyter_require__('@jupyterlab/nbwidgets@^0.6.15/lib/index.js');
	
	/**
	 * The widget manager provider.
	 */
	module.exports = {
	  id: 'jupyter.extensions.nglview',
	  requires: [jupyterlab_widgets.INBWidgetExtension],
	  activate: function(app, widgets) {
	      widgets.registerWidget({
	          name: 'nglview-js-widgets',
	          version: nglview.version,
	          exports: nglview
	      });
	    },
	  autoStart: true
	};
	
})
/** END DEFINE BLOCK for nglview-js-widgets@0.5.4-dev.1/src/labplugin.js **/


/** START DEFINE BLOCK for nglview-js-widgets@0.5.4-dev.1/src/index.js **/
jupyter.define('nglview-js-widgets@0.5.4-dev.1/src/index.js', function (module, exports, __jupyter_require__) {
	module.exports = {};
	
	var loadedModules = [
	    __jupyter_require__('nglview-js-widgets@0.5.4-dev.1/src/widget_ngl.js'),
	    //require("./ngl.js"),
	]
	
	for (var i in loadedModules) {
	    if (loadedModules.hasOwnProperty(i)) {
	        var loadedModule = loadedModules[i];
	        for (var target_name in loadedModule) {
	            if (loadedModule.hasOwnProperty(target_name)) {
	                module.exports[target_name] = loadedModule[target_name];
	            }
	        }
	    }
	}
	
	module.exports['version'] = __jupyter_require__('nglview-js-widgets@0.5.4-dev.1/package.json').version;
	
})
/** END DEFINE BLOCK for nglview-js-widgets@0.5.4-dev.1/src/index.js **/


/** START DEFINE BLOCK for nglview-js-widgets@0.5.4-dev.1/src/widget_ngl.js **/
jupyter.define('nglview-js-widgets@0.5.4-dev.1/src/widget_ngl.js', function (module, exports, __jupyter_require__) {
	var widgets = __jupyter_require__('jupyter-js-widgets@~2.1.4/lib/index.js');
	var NGL = __jupyter_require__('ngl@0.10.0-dev.9/dist/ngl.js');
	var $ = __jupyter_require__('jquery@^2.1.4/dist/jquery.js');
	__jupyter_require__('jquery-ui@^1.12.1/ui/widgets/draggable.js');
	__jupyter_require__('jquery-ui@^1.12.1/ui/widgets/slider.js');
	__jupyter_require__('jquery-ui@^1.12.1/ui/widgets/dialog.js');
	
	var Jupyter;
	if (typeof window !== 'undefined') {
	  Jupyter = window['Jupyter'] = window['Jupyter'] || {};
	} else {
	  Jupyter = Jupyter || {};
	}
	
	var NGLView = widgets.DOMWidgetView.extend({
	
	    render: function() {
	
	        // init representations handling
	        this.model.on("change:_init_representations", this.representationsChanged, this);
	
	        // init setting of frame
	        this.model.on("change:frame", this.frameChanged, this);
	
	        // init setting of frame
	        this.model.on("change:count", this.countChanged, this);
	
	        // init _parameters handling
	        this.model.on("change:_parameters", this.parametersChanged, this);
	
	        // init orientation handling
	        this.model.on("change:orientation", this.orientationChanged, this);
	
	        // for player
	        this.delay = 100;
	        this.sync_frame = false;
	        this.sync_camera = false;
	
	        // get message from Python
	        this.model.on("msg:custom", function(msg) {
	            this.on_msg(msg);
	        }, this);
	
	        if (this.model.comm) {
	            // for embeding in website
	            this.model.comm.on_msg(function(msg) {
	                var buffers = msg.buffers;
	                var content = msg.content.data.content;
	                if (buffers.length && content) {
	                    content.buffers = buffers;
	                }
	                this.model._handle_comm_msg.call(this.model, msg);
	            }.bind(this));
	        }
	
	        // init NGL stage
	        NGL.useWorker = false;
	        this.stage = new NGL.Stage(undefined, {
	            backgroundColor: "white"
	        });
	        this.structureComponent = undefined;
	        this.$container = $(this.stage.viewer.container);
	        this.$el.append(this.$container);
	        this.$container.resizable({
	            resize: function(event, ui) {
	                this.setSize(ui.size.width + "px", ui.size.height + "px");
	            }.bind(this)
	        });
	        this.displayed.then(function() {
	            var width = this.$el.parent().width() + "px";
	            var height = "300px";
	
	            this.setSize(width, height);
	            this.$container.resizable(
	                "option", "maxWidth", this.$el.parent().width()
	            );
	            this.requestUpdateStageParameters();
	        }.bind(this));
	
	        this.stage.viewerControls.signals.changed.add(function() {
	            if (this.sync_camera) {
	                this.model.set('_scene_position', this.stage.viewerControls.position)
	                this.model.set('_scene_rotation', this.stage.viewerControls.rotation)
	                this.touch();
	            }
	        }.bind(this));
	
	        // init toggle fullscreen
	        $(this.stage.viewer.container).dblclick(function() {
	            this.stage.toggleFullscreen();
	        }.bind(this));
	
	        // init picking handling
	        this.$pickingInfo = $("<div></div>")
	            .css("position", "absolute")
	            .css("top", "5%")
	            .css("left", "3%")
	            .css("background-color", "white")
	            .css("padding", "2px 5px 2px 5px")
	            .css("opacity", "0.7")
	            .appendTo(this.$container);
	
	        var $inputNotebookCommand = $('<input id="input_notebook_command" type="text"></input>');
	        var that = this;
	
	        $inputNotebookCommand.keypress(function(e) {
	            var command = $("#input_notebook_command").val();
	            if (e.which == 13) {
	                $("#input_notebook_command").val("")
	                Jupyter.notebook.kernel.execute(command);
	            }
	        });
	
	        this.$notebook_text = $("<div></div>")
	            .css("position", "absolute")
	            .css("bottom", "5%")
	            .css("left", "3%")
	            .css("padding", "2px 5px 2px 5px")
	            .css("opacity", "0.7")
	            .append($inputNotebookCommand)
	            .appendTo(this.$container);
	        this.$notebook_text.hide();
	
	        this.stage.signals.clicked.add(function(pd) {
	            var pd2 = {};
	            if (pd.atom) pd2.atom = pd.atom.toObject();
	            if (pd.bond) pd2.bond = pd.bond.toObject();
	            if (pd.instance) pd2.instance = pd.instance;
	            this.model.set("picked", pd2);
	            this.touch();
	            var pickingText = "";
	            if (pd.atom) {
	                pickingText = "Atom: " + pd.atom.qualifiedName();
	            } else if (pd.bond) {
	                pickingText = "Bond: " + pd.bond.atom1.qualifiedName() + " - " + pd.bond.atom2.qualifiedName();
	            }
	            this.$pickingInfo.text(pickingText);
	        }, this);
	
	        this.initPlayer();
	
	        var container = this.stage.viewer.container;
	        that = this;
	        container.addEventListener('dragover', function(e) {
	            e.stopPropagation();
	            e.preventDefault();
	            e.dataTransfer.dropEffect = 'copy';
	        }, false);
	
	        container.addEventListener('drop', function(e) {
	            e.stopPropagation();
	            e.preventDefault();
	            var file = e.dataTransfer.files[0];
	
	            that.stage.loadFile(file).then(function(o){
	                that.makeDefaultRepr(o);
	                that._handle_loading_file_finished();
	            });
	            var numDroppedFiles = that.model.get("_n_dragged_files");
	            that.model.set("_n_dragged_files", numDroppedFiles + 1);
	            that.touch();
	        }, false);
	
	        that = this;
	        this.stage.signals.componentAdded.add(function() {
	            var len = this.stage.compList.length;
	            this.model.set("n_components", len);
	            this.touch();
	            var comp = this.stage.compList[len - 1];
	            comp.signals.representationRemoved.add(function() {
	                that.requestReprDict();
	            });
	            comp.signals.representationAdded.add(function() {
	                that.requestReprDict();
	            });
	        }, this);
	
	        this.stage.signals.componentRemoved.add(function() {
	            this.model.set("n_components", this.stage.compList.length);
	            this.touch();
	        }, this);
	
	        // for callbacks from Python
	        // must be after initializing NGL.Stage
	        this.model.send({
	            'type': 'request_loaded',
	            'data': true
	        })
	        var state_params = this.stage.getParameters();
	        this.model.set('_original_stage_parameters', state_params);
	        this.touch();
	    },
	
	    setSelector: function(selector_id) {
	        // id is uuid that will be set from Python
	        var selector = "<div class='" + selector_id + "'></div>";
	        this.$ngl_selector = $(selector)
	            .css("position", "absolute")
	            .css("bottom", "5%")
	            .css("left", "3%")
	            .css("padding", "2px 5px 2px 5px")
	            .css("opacity", "0.7")
	            .appendTo(this.$container);
	    },
	
	    setIPythonLikeCell: function() {
	        var cell = Jupyter.notebook.insert_cell_at_bottom();
	
	        var handler = function(event) {
	            var selected_cell = Jupyter.notebook.get_selected_cell();
	            if (selected_cell.cell_id === cell.cell_id) {
	                selected_cell.execute();
	                selected_cell.set_text('');
	            }
	            event; // to pass eslint
	            return false;
	        };
	
	        var action = {
	            help: 'run cell',
	            help_index: 'zz',
	            handler: handler
	        };
	
	        Jupyter.keyboard_manager.edit_shortcuts.add_shortcut('enter', action);
	    },
	
	    hideNotebookCommandBox: function() {
	        this.$notebook_text.hide();
	    },
	
	    showNotebookCommandBox: function() {
	        this.$notebook_text.show();
	    },
	
	    requestFrame: function() {
	        this.send({
	            'type': 'request_frame',
	            'data': 'frame'
	        });
	    },
	
	    requestUpdateStageParameters: function() {
	        var updated_params = this.stage.getParameters();
	        this.model.set('_full_stage_parameters', updated_params);
	        this.touch();
	    },
	
	    requestReprParameters: function(component_index, repr_index) {
	        var comp = this.stage.compList[component_index];
	        var repr = comp.reprList[repr_index];
	        var msg = repr.repr.getParameters();
	
	        if (msg) {
	            msg['name'] = repr.name;
	            this.send({
	                'type': 'repr_parameters',
	                'data': msg
	            });
	        }
	    },
	
	    requestReprDict: function() {
	        var n_components = this.stage.compList.length;
	        var msg = {};
	
	        for (var i = 0; i < n_components; i++) {
	            var comp = this.stage.compList[i];
	            msg['c' + i] = {};
	            var msgi = msg['c' + i];
	            for (var j = 0; j < comp.reprList.length; j++) {
	                var repr = comp.reprList[j];
	                msgi[j] = {};
	                msgi[j]['type'] = repr.name;
	                msgi[j]['params'] = repr.repr.getParameters();
	            }
	        }
	        this.send({
	            'type': 'repr_dict',
	            'data': msg
	        });
	    },
	
	    // setDraggable: function(params) {
	    //     if (params) {
	    //         this.$container.draggable(params);
	    //     } else {
	    //         this.$container.draggable();
	    //     }
	    // },
	    setDelay: function(delay) {
	        this.delay = delay;
	    },
	
	    setSyncFrame: function() {
	        this.sync_frame = true;
	    },
	
	    setUnSyncFrame: function() {
	        this.sync_frame = false;
	    },
	
	    setSyncCamera: function() {
	        this.sync_camera = true;
	    },
	
	    setUnSyncCamera: function() {
	        this.sync_camera = false;
	    },
	
	    viewXZPlane: function() {
	        var m = new NGL.Matrix4().makeRotationX( Math.PI / 2 );
	        var q = new NGL.Quaternion().setFromRotationMatrix( m );
	        this.stage.viewerControls.rotate( q );
	    },
	
	    makeDefaultRepr: function(o) {
	        var reprDefList = this.model.get("_init_representations");
	        reprDefList.forEach(function(reprDef) {
	            o.addRepresentation(reprDef.type, reprDef.params);
	        });
	
	        if (this.stage.compList.length < 2) {
	            o.autoView(100);
	        }
	    },
	
	
	    initPlayer: function() {
	        // init player
	        if (this.model.get("count")) {
	            var play = function() {
	                this.$playerButton.text("pause");
	                this.playerInterval = setInterval(function() {
	                    var frame = this.model.get("frame") + 1;
	                    var count = this.model.get("count");
	                    if (frame >= count) frame = 0;
	
	                    if (this.sync_frame) {
	                        this.model.set("frame", frame);
	                        this.touch();
	                    } else {
	                        this.requestFrame();
	                    }
	                }.bind(this), this.delay);
	            }.bind(this);
	            var pause = function() {
	                this.$playerButton.text("play");
	                if (this.playerInterval !== undefined) {
	                    clearInterval(this.playerInterval);
	                }
	            }.bind(this);
	            this.$playerButton = $("<button>play</button>")
	                .css("float", "left")
	                .css("width", "55px")
	                .css("opacity", "0.7")
	                .click(function(event) {
	                    if (this.$playerButton.text() === "play") {
	                        play();
	                    } else if (this.$playerButton.text() === "pause") {
	                        pause();
	                    }
	                    event; // to pass eslint
	                }.bind(this));
	            this.$playerSlider = $("<div></div>")
	                .css("margin-left", "70px")
	                .css("position", "relative")
	                .css("bottom", "-7px")
	                .slider({
	                    min: 0,
	                    max: this.model.get("count") - 1,
	                    slide: function(event, ui) {
	                        pause();
	                        this.model.set("frame", ui.value);
	                        this.touch();
	                    }.bind(this)
	                });
	            this.$player = $("<div></div>")
	                .css("position", "absolute")
	                .css("bottom", "5%")
	                .css("width", "94%")
	                .css("margin-left", "3%")
	                .css("opacity", "0.7")
	                .append(this.$playerButton)
	                .append(this.$playerSlider)
	                .appendTo(this.$container);
	            this.model.on("change:frame", function() {
	                this.$playerSlider.slider("value", this.model.get("frame"));
	            }, this);
	
	            if (this.model.get("count") < 2) {
	                this.$player.hide()
	            }
	        }
	    },
	
	    countChanged: function() {
	        var count = this.model.get("count");
	        this.$playerSlider.slider({
	            max: count - 1
	        });
	        if (this.model.get("count") > 1) {
	            this.$player.show()
	        }
	    },
	
	    representationsChanged: function() {
	        var representations = this.model.get("_init_representations");
	        var component;
	
	        for (var i = 0; i < this.stage.compList.length; i++) {
	            component = this.stage.compList[i];
	            if (representations && component) {
	                component.clearRepresentations();
	                representations.forEach(function(repr) {
	                    component.addRepresentation(repr.type, repr.params);
	                });
	            }
	        }
	    },
	
	    setVisibilityForRepr: function(component_index, repr_index, value) {
	        // value = True/False
	        var component = this.stage.compList[component_index];
	        var repr = component.reprList[repr_index];
	
	        if (repr) {
	            repr.setVisibility(value);
	        }
	    },
	
	    removeRepresentation: function(component_index, repr_index) {
	        var component = this.stage.compList[component_index];
	        var repr = component.reprList[repr_index]
	
	        if (repr) {
	            component.removeRepresentation(repr);
	            repr.dispose();
	        }
	    },
	
	    removeRepresentationsByName: function(repr_name, component_index) {
	        var component = this.stage.compList[component_index];
	
	        if (component) {
	            component.reprList.forEach(function(repr) {
	                if (repr.name == repr_name) {
	                    component.removeRepresentation(repr);
	                    repr.dispose();
	                }
	            })
	        }
	    },
	
	    updateRepresentationForComponent: function(repr_index, component_index, params) {
	        var component = this.stage.compList[component_index];
	        var repr = component.reprList[repr_index];
	        if (repr) {
	            repr.setParameters(params);
	        }
	    },
	
	    updateRepresentationsByName: function(repr_name, component_index, params) {
	        var component = this.stage.compList[component_index];
	
	        if (component) {
	            component.reprList.forEach(function(repr) {
	                if (repr.name == repr_name) {
	                    repr.setParameters(params);
	                }
	            })
	        }
	    },
	
	    setRepresentation: function(name, params, component_index, repr_index) {
	        var component = this.stage.compList[component_index];
	        var repr = component.reprList[repr_index];
	
	        if (repr) {
	            params['useWorker'] = false;
	            var new_repr = NGL.makeRepresentation(name, component.structure,
	                this.stage.viewer, params);
	            if (new_repr) {
	                repr.setRepresentation(new_repr);
	                repr.name = name;
	                component.reprList[repr_index] = repr;
	                this.requestReprDict();
	            }
	        }
	    },
	
	    setColorByResidue: function(colors, component_index, repr_index){
	        var repr = this.stage.compList[component_index].reprList[repr_index];
	        var schemeId = NGL.ColorMakerRegistry.addScheme(function(params){
	            this.atomColor = function(atom){
	                 var color = colors[atom.residueIndex];
	                 return color
	            };
	            params; // to pass eslint; ack;
	        });
	        repr.setColor(schemeId);
	    },
	
	    addShape: function(name, shapes) {
	        // shapes: list of tuple
	        // e.g: [('sphere', ...), ('cone', ...)]
	        var shape = new NGL.Shape(name);
	        var shape_dict = {
	            'sphere': shape.addSphere,
	            'ellipsoid': shape.addEllipsoid,
	            'cylinder': shape.addCylinder,
	            'cone': shape.addCone,
	            'mesh': shape.addMesh,
	            'arrow': shape.addArrow
	        };
	        for (var i = 0; i < shapes.length; i++) {
	            var shapes_i = shapes[i]
	            var shape_type = shapes_i[0];
	            var params = shapes_i.slice(1, shapes_i.length);
	            // e.g params = ('sphere', [ 0, 0, 9 ], [ 1, 0, 0 ], 1.5)
	
	            var func = shape_dict[shape_type];
	            func.apply(this, params);
	        }
	        var shapeComp = this.stage.addComponentFromObject(shape);
	        shapeComp.addRepresentation("buffer");
	    },
	
	    replaceStructure: function(structure){
	         var blob = new Blob([structure.data], {type: "text/plain"});
	         var params = structure.params || {};
	         params.ext = structure.ext;
	         params.defaultRepresentation = false;
	         var comp = this.stage.compList[0];
	         var representations = comp.reprList.slice();
	         var old_orientation = this.stage.viewerControls.getOrientation();
	         var that = this;
	         this.stage.loadFile(blob, params).then(function(component) {
	             that.stage.viewerControls.orient(old_orientation);
	             representations.forEach(function(repr) {
	                 var repr_name = repr.name;
	                 var repr_params = repr.repr.getParameters();
	                 // Note: not using repr.repr.type, repr.repr.params
	                 // since seems to me that repr.repr.params won't return correct "sele"
	                 component.addRepresentation(repr_name, repr_params);
	             });
	             that.stage.removeComponent(comp);
	             that._handle_loading_file_finished();
	         });
	    },
	
	    superpose: function(cindex0, cindex1, align, sele0, sele1) {
	        // superpose two components with given params
	        var component0 = this.stage.compList[cindex0];
	        var component1 = this.stage.compList[cindex1];
	        component1.superpose(component0, align, sele0, sele1);
	    },
	
	    decode_base64: function(base64) {
	        // lightly adapted from Niklas
	
	        /*
	         * base64-arraybuffer
	         * https://github.com/niklasvh/base64-arraybuffer
	         *
	         * Copyright (c) 2012 Niklas von Hertzen
	         * Licensed under the MIT license.
	         */
	        var chars =
	            "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
	        var bufferLength = base64.length * 0.75,
	            len = base64.length,
	            i, p = 0,
	            encoded1, encoded2, encoded3, encoded4;
	
	        if (base64[base64.length - 1] === "=") {
	            bufferLength--;
	            if (base64[base64.length - 2] === "=") {
	                bufferLength--;
	            }
	        }
	
	        var arraybuffer = new ArrayBuffer(bufferLength),
	            bytes = new Uint8Array(arraybuffer);
	
	        for (i = 0; i < len; i += 4) {
	            encoded1 = chars.indexOf(base64[i]);
	            encoded2 = chars.indexOf(base64[i + 1]);
	            encoded3 = chars.indexOf(base64[i + 2]);
	            encoded4 = chars.indexOf(base64[i + 3]);
	
	            bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
	            bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
	            bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
	        }
	
	        return arraybuffer;
	    },
	
	    updateCoordinates: function(coordinates, model) {
	        // coordinates must be ArrayBuffer (use this.decode_base64)
	        var component = this.stage.compList[model];
	        if (coordinates && component) {
	            var coords = new Float32Array(coordinates);
	            component.structure.updatePosition(coords);
	            component.updateRepresentations({
	                "position": true
	            });
	        }
	    },
	
	    handleResize: function() {
	        this.$container.resizable({
	            resize: function(event, ui) {
	                this.setSize(ui.size.width + "px", ui.size.height + "px");
	            }.bind(this)
	        })
	    },
	
	    setSize: function(width, height) {
	        this.stage.viewer.container.style.width = width;
	        this.stage.viewer.container.style.height = height;
	        this.stage.handleResize();
	    },
	
	    openNotebookCommandDialog: function() {
	        var that = this;
	        var dialog = this.$notebook_text.dialog({
	            draggable: true,
	            resizable: true,
	            modal: false,
	            show: {
	                effect: "blind",
	                duration: 150
	            },
	            close: function(event, ui) {
	                that.$container.append(that.$notebook_text);
	                that.$notebook_text.dialog('destroy');
	                event; ui; // to pass eslint; ack;
	            },
	        });
	        dialog.css({
	            overflow: 'hidden'
	        });
	        dialog.prev('.ui-dialog-titlebar')
	            .css({
	                'background': 'transparent',
	                'border': 'none'
	            });
	        Jupyter.keyboard_manager.register_events(dialog);
	    },
	
	    setDialog: function() {
	        var $nb_container = Jupyter.notebook.container;
	        var that = this;
	        var dialog = this.$container.dialog({
	            title: "NGLView",
	            draggable: true,
	            resizable: true,
	            modal: false,
	            width: window.innerWidth - $nb_container.width() - $nb_container.offset().left - 50,
	            height: 'auto',
	            position: {
	                my: 'right',
	                at: 'right',
	                of: window
	            },
	            show: {
	                effect: "blind",
	                duration: 150
	            },
	            close: function(event, ui) {
	                that.$el.append(that.$container);
	                that.$container.dialog('destroy');
	                that.handleResize();
	                event; ui; // to pass eslint; ack;
	            },
	            resize: function(event, ui) {
	                that.stage.handleResize();
	                that.setSize(ui.size.width + "px", ui.size.height + "px");
	            }.bind(that),
	        });
	        dialog.css({
	            overflow: 'hidden'
	        });
	        dialog.prev('.ui-dialog-titlebar')
	            .css({
	                'background': 'transparent',
	                'border': 'none'
	            });
	    },
	
	    resizeNotebook: function(width) {
	        var $nb_container = Jupyter.notebook.container;
	        $nb_container.width(width);
	
	        if (this.$container.dialog) {
	            this.$container.dialog({
	                width: $nb_container.offset().left
	            });
	        }
	    },
	
	    parametersChanged: function() {
	        var _parameters = this.model.get("_parameters");
	        this.setParameters(_parameters);
	    },
	
	    setParameters: function(parameters) {
	        this.stage.setParameters(parameters);
	
	        // do not set _full_stage_parameters here
	        // or parameters will be never updated (not sure why) 
	        // use observe in python side
	        var updated_params = this.stage.getParameters();
	        this.send({
	            'type': 'stage_parameters',
	            'data': updated_params
	        })
	    },
	
	    orientationChanged: function() {
	        var orientation_list = this.model.get("orientation");
	        var mat4 = this.stage.viewerControls.getOrientation();
	        mat4.set(orientation_list);
	        this.stage.viewerControls.orient(mat4);
	    },
	
	    _downloadImage: function(filename, params) {
	        this.stage.makeImage(params).then(function(blob) {
	            NGL.download(blob, filename);
	        })
	    },
	
	    _exportImage: function(params) {
	        this.stage.makeImage(params).then(function(blob) {
	            var reader = new FileReader();
	            var arr_str;
	            reader.onload = function() {
	                arr_str = reader.result.replace("data:image/png;base64,", "");
	                this.model.set("_image_data", arr_str);
	                this.touch();
	            }.bind(this);
	            reader.readAsDataURL(blob);
	        }.bind(this));
	    },
	
	    cleanOutput: function() {
	
	        var cells = Jupyter.notebook.get_cells();
	
	        for (var i = 0; i < cells.length; i++) {
	            var cell = cells[i];
	            if (cell.output_area.outputs.length > 0) {
	                var out = cell.output_area.outputs[0];
	                if (out.output_type == 'display_data') {
	                    cell.clear_output();
	                }
	            }
	        }
	    },
	
	    _handle_loading_file_finished: function() {
	        this.send({'type': 'async_message', 'data': 'ok'});
	    },
	    
	    _handle_stage_loadFile: function(msg){
	            // args = [{'type': ..., 'data': ...}]
	         var args0 = msg.args[0];
	         var that = this;
	         if (args0.type == 'blob') {
	             var blob;
	             if (args0.binary) {
	                 var decoded_data = this.decode_base64(args0.data);
	                 blob = new Blob([decoded_data], {
	                     type: "application/octet-binary"
	                 });
	             } else {
	                 blob = new Blob([args0.data], {
	                     type: "text/plain"
	                 });
	             }
	             this.stage.loadFile(blob, msg.kwargs).then(function(o){
	                  that._handle_loading_file_finished();
	                  o; // to pass eslint; ack;
	             });
	         } else {
	             this.stage.loadFile(msg.args[0].data, msg.kwargs).then(function(o){
	                  that._handle_loading_file_finished();
	                  o; // to pass eslint; ack;
	             });
	         }
	    },
	
	    on_msg: function(msg) {
	        // TODO: re-organize
	        if (msg.type == 'call_method') {
	            var index, component, func, stage;
	            var new_args = msg.args.slice();
	            new_args.push(msg.kwargs);
	
	            switch (msg.target) {
	                case 'Stage':
	                    var stage_func = this.stage[msg.methodName];
	                    stage = this.stage;
	                    if (msg.methodName == 'screenshot') {
	                        NGL.screenshot(this.stage.viewer, msg.kwargs);
	                    } else if (msg.methodName == 'removeComponent') {
	                        index = msg.args[0];
	                        component = this.stage.compList[index];
	                        this.stage.removeComponent(component);
	                    } else if (msg.methodName == 'loadFile') {
	                        this._handle_stage_loadFile(msg);
	                    } else {
	                            stage_func.apply(stage, new_args);
	                    }
	                    break;
	                case 'Viewer':
	                    var viewer = this.stage.viewer;
	                    func = this.stage.viewer[msg.methodName];
	                    func.apply(viewer, new_args);
	                    break;
	                case 'viewerControls':
	                    var controls = this.stage.viewerControls;
	                    func = controls[msg.methodName];
	                    func.apply(controls, new_args);
	                    break;
	                case 'compList':
	                    index = msg['component_index'];
	                    component = this.stage.compList[index];
	                    func = component[msg.methodName];
	                    func.apply(component, new_args);
	                    break;
	                case 'StructureComponent':
	                    component = this.structureComponent;
	                    func = component[msg.methodName];
	                    func.apply(component, new_args);
	                    break;
	                case 'Widget':
	                    func = this[msg.methodName];
	                    if (func) {
	                        func.apply(this, new_args);
	                    } else {
	                        // send error message to Python?
	                        console.log('can not create func for ' + msg.methodName);
	                    }
	                    break;
	                case 'Representation':
	                    var component_index = msg['component_index'];
	                    var repr_index = msg['repr_index'];
	                    var repr = component.reprList[repr_index];
	                    component = this.stage.compList[component_index];
	                    func = repr[msg.methodName];
	                    if (repr && func) {
	                        func.apply(repr, new_args);
	                    }
	                    break;
	                default:
	                    console.log('there is no method for ' + msg.target);
	                    break;
	            }
	        } else if (msg.type == 'base64_single') {
	            var coordinatesDict = msg.data;
	            var keys = Object.keys(coordinatesDict);
	
	            for (var i = 0; i < keys.length; i++) {
	                var traj_index = keys[i];
	                var coordinates = this.decode_base64(coordinatesDict[traj_index]);
	                if (coordinates.byteLength > 0) {
	                    this.updateCoordinates(coordinates, traj_index);
	                }
	            }
	        } else if (msg.type == 'binary_single') {
	            var coordinateMeta = msg.data;
	            keys = Object.keys(coordinateMeta);
	
	            for (i = 0; i < keys.length; i++) {
	                traj_index = keys[i];
	                coordinates = new Float32Array(msg.buffers[i].buffer);
	                if (coordinates.byteLength > 0) {
	                    this.updateCoordinates(coordinates, traj_index);
	                }
	            }
	        } else if (msg.type == 'get') {
	            if (msg.data == 'camera') {
	                this.send(JSON.stringify(this.stage.viewer.camera));
	            } else if (msg.data == 'parameters') {
	                this.send(JSON.stringify(this.stage.parameters));
	            } else {
	                for (i = 0; i < this.stage.compList.length; i++) {
	                    console.log(this.stage.compList[i]);
	                }
	            }
	        }
	    },
	});
	
	var NGLBox = widgets.BoxView.extend({
	    initialize: function(parameters) {
	        widgets.BoxView.prototype.initialize.call(this, parameters);
	        this.$dialog = undefined;
	    },
	
	    render: function() {
	        this.model.on('change:_dialog', this.dialogCommandChanged, this);
	        this.model.on('change:_ngl_command', this.commandChanged, this);
	        widgets.BoxView.prototype.render.call(this);
	    },
	
	    dialogCommandChanged: function() {
	        var _dialog = this.model.get('_dialog');
	        if (_dialog == 'on') {
	            this.setDialog();
	        }
	    },
	
	    merge: function() {
	        // TODO: rename and add doc
	        console.log('calling merge');
	        var v0 = this.children_views.views[0];
	        var v1 = this.children_views.views[1];
	
	        v0.then(function(v00) {
	            v1.then(function(v11) {
	                v11.$el.appendTo(v00.$container)
	                    .css("position", "absolute")
	                    .css("bottom", "5%")
	                    .css("left", "3%")
	                    .css("padding", "2px 5px 2px 5px")
	            });
	        });
	    },
	
	    commandChanged: function() {
	        var cm = this.model.get('_ngl_command');
	        if (cm == 'merge') {
	            this.merge();
	        } else {
	            console.log("place holder");
	        }
	    },
	
	    setDialog: function() {
	        //var $node = $(this.$el.parent()[0]);
	        var $node = $(this.$el);
	        $node.addClass('jupyter-widgets');
	        $node.addClass('widget-container');
	        $node.addClass('widget-box');
	        var dialog = $node.dialog({
	            draggable: true,
	            resizable: true,
	            modal: false,
	            height: 'auto',
	            show: {
	                effect: "blind",
	                duration: 150
	            },
	        });
	        dialog.css({
	            overflow: 'hidden'
	        });
	        dialog.prev('.ui-dialog-titlebar')
	            .css({
	                'background': 'transparent',
	                'border': 'none'
	            });
	    },
	});
	
	module.exports = {
	    'NGLView': NGLView,
	    'NGL': NGL,
	    'NGLBox': NGLBox
	};
	
})
/** END DEFINE BLOCK for nglview-js-widgets@0.5.4-dev.1/src/widget_ngl.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/index.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/index.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	function __export(m) {
	    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
	}
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/manager-base.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/utils.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_layout.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_style.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_link.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_bool.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_button.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_box.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_image.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_color.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_date.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/services-shim.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_int.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_float.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_controller.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_selection.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_selectioncontainer.js'));
	__export(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_string.js'));
	exports.version = __jupyter_require__('jupyter-js-widgets@2.1.4/package.json').version;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/index.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/manager-base.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/manager-base.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var utils = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/utils.js');
	var semver = __jupyter_require__('semver@^5.1.0/semver.js');
	var widget_string_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_string.js');
	/**
	 * Manager abstract base class
	 */
	var ManagerBase = (function () {
	    function ManagerBase() {
	        /**
	         * Dictionary of model ids and model instance promises
	         */
	        this._models = Object.create(null);
	    }
	    Object.defineProperty(ManagerBase.prototype, "comm_target_name", {
	        /**
	         * The comm target name to register.
	         */
	        get: function () {
	            return 'jupyter.widget';
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(ManagerBase.prototype, "version_comm_target_name", {
	        /**
	         * The version comm target name to register.
	         */
	        get: function () {
	            return 'jupyter.widget.version';
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Display a view for a particular model.
	     */
	    ManagerBase.prototype.display_model = function (msg, model, options) {
	        options = options || {};
	        return this.create_view(model, options).then(_.bind(function (view) {
	            return this.display_view(msg, view, options);
	        }, this)).catch(utils.reject('Could not create view', true));
	    };
	    ;
	    /**
	     * Modifies view options. Generally overloaded in custom widget manager
	     * implementations.
	     */
	    ManagerBase.prototype.setViewOptions = function (options) {
	        return options || {};
	    };
	    ;
	    /**
	     * Takes a requirejs success handler and returns a requirejs error handler.
	     * The default implementation just throws the original error.
	     */
	    ManagerBase.prototype.require_error = function (success_callback, failure_callback, version) {
	        return failure_callback;
	    };
	    ;
	    /**
	     * Creates a promise for a view of a given model
	     *
	     * Make sure the view creation is not out of order with
	     * any state updates.
	     */
	    ManagerBase.prototype.create_view = function (model, options) {
	        var _this = this;
	        model.state_change = model.state_change.then(function () {
	            return _this.loadClass(model.get('_view_name'), model.get('_view_module'), model.get('_view_module_version'), _this.require_error).then(function (ViewType) {
	                var view = new ViewType({
	                    model: model,
	                    options: _this.setViewOptions(options)
	                });
	                view.listenTo(model, 'destroy', view.remove);
	                return Promise.resolve(view.render()).then(function () { return view; });
	            }).catch(utils.reject('Could not create a view for model id ' + model.id, true));
	        });
	        var id = utils.uuid();
	        model.views[id] = model.state_change;
	        model.state_change.then(function (view) {
	            view.once('remove', function () { delete view.model.views[id]; }, _this);
	        });
	        return model.state_change;
	    };
	    ;
	    /**
	     * callback handlers specific to a view
	     */
	    ManagerBase.prototype.callbacks = function (view) {
	        return {};
	    };
	    ;
	    /**
	     * Get a promise for a model by model id.
	     */
	    ManagerBase.prototype.get_model = function (model_id) {
	        // Perhaps we should return a Promise.reject if the model is not found.
	        return this._models[model_id];
	    };
	    ;
	    /**
	     * Handle when a comm is opened.
	     */
	    ManagerBase.prototype.handle_comm_open = function (comm, msg) {
	        return this.new_model({
	            model_name: msg.content.data['_model_name'],
	            model_module: msg.content.data['_model_module'],
	            model_module_version: msg.content.data['_model_module_version'],
	            comm: comm
	        }, msg.content.data).catch(utils.reject('Could not create a model.', true));
	    };
	    ;
	    /**
	     * Create a comm and new widget model.
	     * @param  options - same options as new_model but, comm is not
	     *                          required and additional options are available.
	     * @param  serialized_state - serialized model attributes.
	     */
	    ManagerBase.prototype.new_widget = function (options, serialized_state) {
	        var _this = this;
	        var commPromise;
	        // If no comm is provided, a new comm is opened for the jupyter.widget
	        // target.
	        if (options.comm) {
	            commPromise = Promise.resolve(options.comm);
	        }
	        else {
	            commPromise = this._create_comm(this.comm_target_name, options.model_id, {
	                widget_class: options.widget_class,
	                target_name: 'jupyter.widget'
	            });
	        }
	        // The options dictionary is copied since data will be added to it.
	        var options_clone = _.clone(options);
	        // Create the model. In the case where the comm promise is rejected a
	        // comm-less model is still created with the required model id.
	        return commPromise.then(function (comm) {
	            // Comm Promise Resolved.
	            options_clone.comm = comm;
	            var widget_model = _this.new_model(options_clone, serialized_state);
	            return widget_model.then(function (model) {
	                model.sync('create', model);
	                return model;
	            });
	        }, function () {
	            // Comm Promise Rejected.
	            if (!options_clone.model_id) {
	                options_clone.model_id = utils.uuid();
	            }
	            return _this.new_model(options_clone, serialized_state);
	        });
	    };
	    ;
	    /**
	     * Validate the version of the Javascript against the version requested by
	     * the backend.
	     * @return Whether or not the versions are okay
	     */
	    ManagerBase.prototype.validateVersion = function () {
	        return this._create_comm(this.version_comm_target_name, undefined, {}).then((function (comm) {
	            return new Promise((function (resolve, reject) {
	                comm.on_msg((function (msg) {
	                    var version = __jupyter_require__('jupyter-js-widgets@2.1.4/package.json').version;
	                    var requirement = msg.content.data.version;
	                    var validated = semver.satisfies(version, requirement);
	                    comm.send({ 'validated': validated, 'frontend_version': version });
	                    if (validated) {
	                        console.info('Widget backend and frontend versions are compatible');
	                    }
	                    else {
	                        console.warn("Widget backend and frontend versions are not compatible. The backend wants a version in the range " + requirement + ", but the frontend is version " + version + ".");
	                    }
	                    resolve(validated);
	                }).bind(this));
	                setTimeout(function () {
	                    reject(new Error('Timeout while trying to cross validate the widget frontend and backend versions.'));
	                }, 3000);
	            }).bind(this));
	        }).bind(this));
	    };
	    ;
	    /**
	     * Create and return a promise for a new widget model
	     *
	     * Minimally, one must provide the model_name and widget_class
	     * parameters to create a model from Javascript.
	     *
	     * @param options - the options for creating the model.
	     * @param serialized_state - attribute values for the model.
	     *
	     * @example
	     * widget_manager.new_model({
	     *      model_name: 'WidgetModel',
	     *      widget_class: 'Jupyter.IntSlider'
	     *  })
	     *  .then((model) => { console.log('Create success!', model); },
	     *  (err) => {console.error(err)});
	     *
	     */
	    ManagerBase.prototype.new_model = function (options, serialized_state) {
	        if (serialized_state === void 0) { serialized_state = {}; }
	        var that = this;
	        var model_id;
	        if (options.model_id) {
	            model_id = options.model_id;
	        }
	        else if (options.comm) {
	            model_id = options.comm.comm_id;
	        }
	        else {
	            throw new Error('Neither comm nor model_id provided in options object. At least one must exist.');
	        }
	        var error_handler = function (error) {
	            var modelOptions = {
	                widget_manager: that,
	                model_id: model_id,
	                comm: options.comm,
	            };
	            var widget_model = new widget_string_1.HTMLModel({}, modelOptions);
	            widget_model.once('comm:close', function () {
	                delete that._models[model_id];
	            });
	            var placeholder = "<table style=\"width:100%\">\n                <thead>\n                    <tr>\n                        <th colspan=\"2\">\n                        Could not create model:\n                        </th>\n                    </tr>\n                </thead>\n                <tbody>\n                    <tr>\n                        <td>Model name</td>\n                        <td> " + options.model_name + " </td>\n                    </tr>\n                    <tr>\n                        <td>Model module</td>\n                        <td> " + options.model_module + " </td>\n                    </tr>\n                    <tr>\n                        <td>Model module version</td>\n                        <td> " + options.model_module_version + " </td>\n                    </tr>\n                <tbody>\n                <tfoot>\n                    <tr>\n                        <th colspan=\"2\">\n                        " + error.message + "\n                        </th>\n                    </tr>\n                </tfoot>\n                </table>";
	            widget_model.set('value', placeholder);
	            return widget_model;
	        };
	        var model_promise = this.loadClass(options.model_name, options.model_module, options.model_module_version, that.require_error)
	            .then(function (ModelType) {
	            try {
	                return ModelType._deserialize_state(serialized_state || {}, that)
	                    .then(function (attributes) {
	                    var modelOptions = {
	                        widget_manager: that,
	                        model_id: model_id,
	                        comm: options.comm,
	                    };
	                    var widget_model = new ModelType(attributes, modelOptions);
	                    widget_model.once('comm:close', function () {
	                        delete that._models[model_id];
	                    });
	                    widget_model.name = options.model_name;
	                    widget_model.module = options.model_module;
	                    return widget_model;
	                });
	            }
	            catch (error) {
	                error_handler(error); // error handler call if ModelType is undefined.
	            }
	        }, error_handler); // error handler call if module cannot be loaded.
	        this._models[model_id] = model_promise;
	        return model_promise;
	    };
	    ;
	    /**
	     * Close all widgets and empty the widget state.
	     * @param commlessOnly should only commless widgets be removed
	     * @return promise that resolves when the widget state is cleared.
	     */
	    ManagerBase.prototype.clear_state = function (commlessOnly) {
	        var _this = this;
	        return utils.resolvePromisesDict(this._models).then(function (models) {
	            Object.keys(models).forEach(function (id) {
	                if (!commlessOnly || models[id].comm) {
	                    models[id].close();
	                }
	            });
	            _this._models = {};
	        });
	    };
	    ;
	    /**
	     * Asynchronously get the state of the widget manager.
	     *
	     * This includes all of the widget models.
	     *
	     * @param options - The options for what state to return.
	     * @returns Promise for a state dictionary
	     */
	    ManagerBase.prototype.get_state = function (options) {
	        var that = this;
	        return utils.resolvePromisesDict(this._models).then(function (models) {
	            var state = {};
	            for (var model_id in models) {
	                if (models.hasOwnProperty(model_id)) {
	                    var model = models[model_id];
	                    state[model_id] = utils.resolvePromisesDict({
	                        model_name: model.name,
	                        model_module: model.module,
	                        model_module_version: model.get('_model_module_version'),
	                        state: model.constructor._serialize_state(model.get_state(options.drop_defaults), that)
	                    });
	                }
	            }
	            return utils.resolvePromisesDict(state);
	        }).catch(utils.reject('Could not get state of widget manager', true));
	    };
	    ;
	    /**
	     * Set the widget manager state.
	     *
	     * Reconstructs all of the widget models in the state, merges that with the
	     * current manager state, and then attempts to redisplay the widgets in the
	     * state.
	     */
	    ManagerBase.prototype.set_state = function (state, displayOptions) {
	        var that = this;
	        // Recreate all the widget models for the given widget manager state.
	        var all_models = that._get_comm_info().then(function (live_comms) {
	            return Promise.all(_.map(Object.keys(state), function (model_id) {
	                // If the model has already been created, set it's state and then
	                // return it.
	                if (that._models[model_id]) {
	                    return that._models[model_id].then(function (model) {
	                        return model.constructor._deserialize_state(state[model_id].state || {}, that).then(function (attributes) {
	                            model.set_state(attributes);
	                            return model;
	                        });
	                    });
	                }
	                if (live_comms.hasOwnProperty(model_id)) {
	                    return that._create_comm(that.comm_target_name, model_id).then(function (new_comm) {
	                        return that.new_model({
	                            comm: new_comm,
	                            model_name: state[model_id].model_name,
	                            model_module: state[model_id].model_module,
	                            model_module_version: state[model_id].model_module_version
	                        });
	                    });
	                }
	                else {
	                    return that.new_model({
	                        model_id: model_id,
	                        model_name: state[model_id].model_name,
	                        model_module: state[model_id].model_module,
	                        model_module_version: state[model_id].model_module_version
	                    }, state[model_id].state);
	                }
	            }));
	        });
	        return all_models;
	    };
	    ;
	    /**
	     * Load a class and return a promise to the loaded object.
	     */
	    ManagerBase.prototype.loadClass = function (className, moduleName, moduleVersion, error) {
	        return utils.loadClass(className, moduleName, moduleVersion, null, error);
	    };
	    return ManagerBase;
	}());
	exports.ManagerBase = ManagerBase;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/manager-base.js **/


/** START DEFINE BLOCK for underscore@1.8.3/underscore.js **/
jupyter.define('underscore@1.8.3/underscore.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;//     Underscore.js 1.8.3
	//     http://underscorejs.org
	//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
	//     Underscore may be freely distributed under the MIT license.
	
	(function() {
	
	  // Baseline setup
	  // --------------
	
	  // Establish the root object, `window` in the browser, or `exports` on the server.
	  var root = this;
	
	  // Save the previous value of the `_` variable.
	  var previousUnderscore = root._;
	
	  // Save bytes in the minified (but not gzipped) version:
	  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
	
	  // Create quick reference variables for speed access to core prototypes.
	  var
	    push             = ArrayProto.push,
	    slice            = ArrayProto.slice,
	    toString         = ObjProto.toString,
	    hasOwnProperty   = ObjProto.hasOwnProperty;
	
	  // All **ECMAScript 5** native function implementations that we hope to use
	  // are declared here.
	  var
	    nativeIsArray      = Array.isArray,
	    nativeKeys         = Object.keys,
	    nativeBind         = FuncProto.bind,
	    nativeCreate       = Object.create;
	
	  // Naked function reference for surrogate-prototype-swapping.
	  var Ctor = function(){};
	
	  // Create a safe reference to the Underscore object for use below.
	  var _ = function(obj) {
	    if (obj instanceof _) return obj;
	    if (!(this instanceof _)) return new _(obj);
	    this._wrapped = obj;
	  };
	
	  // Export the Underscore object for **Node.js**, with
	  // backwards-compatibility for the old `require()` API. If we're in
	  // the browser, add `_` as a global object.
	  if (true) {
	    if (typeof module !== 'undefined' && module.exports) {
	      exports = module.exports = _;
	    }
	    exports._ = _;
	  } else {
	    root._ = _;
	  }
	
	  // Current version.
	  _.VERSION = '1.8.3';
	
	  // Internal function that returns an efficient (for current engines) version
	  // of the passed-in callback, to be repeatedly applied in other Underscore
	  // functions.
	  var optimizeCb = function(func, context, argCount) {
	    if (context === void 0) return func;
	    switch (argCount == null ? 3 : argCount) {
	      case 1: return function(value) {
	        return func.call(context, value);
	      };
	      case 2: return function(value, other) {
	        return func.call(context, value, other);
	      };
	      case 3: return function(value, index, collection) {
	        return func.call(context, value, index, collection);
	      };
	      case 4: return function(accumulator, value, index, collection) {
	        return func.call(context, accumulator, value, index, collection);
	      };
	    }
	    return function() {
	      return func.apply(context, arguments);
	    };
	  };
	
	  // A mostly-internal function to generate callbacks that can be applied
	  // to each element in a collection, returning the desired result — either
	  // identity, an arbitrary callback, a property matcher, or a property accessor.
	  var cb = function(value, context, argCount) {
	    if (value == null) return _.identity;
	    if (_.isFunction(value)) return optimizeCb(value, context, argCount);
	    if (_.isObject(value)) return _.matcher(value);
	    return _.property(value);
	  };
	  _.iteratee = function(value, context) {
	    return cb(value, context, Infinity);
	  };
	
	  // An internal function for creating assigner functions.
	  var createAssigner = function(keysFunc, undefinedOnly) {
	    return function(obj) {
	      var length = arguments.length;
	      if (length < 2 || obj == null) return obj;
	      for (var index = 1; index < length; index++) {
	        var source = arguments[index],
	            keys = keysFunc(source),
	            l = keys.length;
	        for (var i = 0; i < l; i++) {
	          var key = keys[i];
	          if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
	        }
	      }
	      return obj;
	    };
	  };
	
	  // An internal function for creating a new object that inherits from another.
	  var baseCreate = function(prototype) {
	    if (!_.isObject(prototype)) return {};
	    if (nativeCreate) return nativeCreate(prototype);
	    Ctor.prototype = prototype;
	    var result = new Ctor;
	    Ctor.prototype = null;
	    return result;
	  };
	
	  var property = function(key) {
	    return function(obj) {
	      return obj == null ? void 0 : obj[key];
	    };
	  };
	
	  // Helper for collection methods to determine whether a collection
	  // should be iterated as an array or as an object
	  // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
	  // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
	  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
	  var getLength = property('length');
	  var isArrayLike = function(collection) {
	    var length = getLength(collection);
	    return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
	  };
	
	  // Collection Functions
	  // --------------------
	
	  // The cornerstone, an `each` implementation, aka `forEach`.
	  // Handles raw objects in addition to array-likes. Treats all
	  // sparse array-likes as if they were dense.
	  _.each = _.forEach = function(obj, iteratee, context) {
	    iteratee = optimizeCb(iteratee, context);
	    var i, length;
	    if (isArrayLike(obj)) {
	      for (i = 0, length = obj.length; i < length; i++) {
	        iteratee(obj[i], i, obj);
	      }
	    } else {
	      var keys = _.keys(obj);
	      for (i = 0, length = keys.length; i < length; i++) {
	        iteratee(obj[keys[i]], keys[i], obj);
	      }
	    }
	    return obj;
	  };
	
	  // Return the results of applying the iteratee to each element.
	  _.map = _.collect = function(obj, iteratee, context) {
	    iteratee = cb(iteratee, context);
	    var keys = !isArrayLike(obj) && _.keys(obj),
	        length = (keys || obj).length,
	        results = Array(length);
	    for (var index = 0; index < length; index++) {
	      var currentKey = keys ? keys[index] : index;
	      results[index] = iteratee(obj[currentKey], currentKey, obj);
	    }
	    return results;
	  };
	
	  // Create a reducing function iterating left or right.
	  function createReduce(dir) {
	    // Optimized iterator function as using arguments.length
	    // in the main function will deoptimize the, see #1991.
	    function iterator(obj, iteratee, memo, keys, index, length) {
	      for (; index >= 0 && index < length; index += dir) {
	        var currentKey = keys ? keys[index] : index;
	        memo = iteratee(memo, obj[currentKey], currentKey, obj);
	      }
	      return memo;
	    }
	
	    return function(obj, iteratee, memo, context) {
	      iteratee = optimizeCb(iteratee, context, 4);
	      var keys = !isArrayLike(obj) && _.keys(obj),
	          length = (keys || obj).length,
	          index = dir > 0 ? 0 : length - 1;
	      // Determine the initial value if none is provided.
	      if (arguments.length < 3) {
	        memo = obj[keys ? keys[index] : index];
	        index += dir;
	      }
	      return iterator(obj, iteratee, memo, keys, index, length);
	    };
	  }
	
	  // **Reduce** builds up a single result from a list of values, aka `inject`,
	  // or `foldl`.
	  _.reduce = _.foldl = _.inject = createReduce(1);
	
	  // The right-associative version of reduce, also known as `foldr`.
	  _.reduceRight = _.foldr = createReduce(-1);
	
	  // Return the first value which passes a truth test. Aliased as `detect`.
	  _.find = _.detect = function(obj, predicate, context) {
	    var key;
	    if (isArrayLike(obj)) {
	      key = _.findIndex(obj, predicate, context);
	    } else {
	      key = _.findKey(obj, predicate, context);
	    }
	    if (key !== void 0 && key !== -1) return obj[key];
	  };
	
	  // Return all the elements that pass a truth test.
	  // Aliased as `select`.
	  _.filter = _.select = function(obj, predicate, context) {
	    var results = [];
	    predicate = cb(predicate, context);
	    _.each(obj, function(value, index, list) {
	      if (predicate(value, index, list)) results.push(value);
	    });
	    return results;
	  };
	
	  // Return all the elements for which a truth test fails.
	  _.reject = function(obj, predicate, context) {
	    return _.filter(obj, _.negate(cb(predicate)), context);
	  };
	
	  // Determine whether all of the elements match a truth test.
	  // Aliased as `all`.
	  _.every = _.all = function(obj, predicate, context) {
	    predicate = cb(predicate, context);
	    var keys = !isArrayLike(obj) && _.keys(obj),
	        length = (keys || obj).length;
	    for (var index = 0; index < length; index++) {
	      var currentKey = keys ? keys[index] : index;
	      if (!predicate(obj[currentKey], currentKey, obj)) return false;
	    }
	    return true;
	  };
	
	  // Determine if at least one element in the object matches a truth test.
	  // Aliased as `any`.
	  _.some = _.any = function(obj, predicate, context) {
	    predicate = cb(predicate, context);
	    var keys = !isArrayLike(obj) && _.keys(obj),
	        length = (keys || obj).length;
	    for (var index = 0; index < length; index++) {
	      var currentKey = keys ? keys[index] : index;
	      if (predicate(obj[currentKey], currentKey, obj)) return true;
	    }
	    return false;
	  };
	
	  // Determine if the array or object contains a given item (using `===`).
	  // Aliased as `includes` and `include`.
	  _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {
	    if (!isArrayLike(obj)) obj = _.values(obj);
	    if (typeof fromIndex != 'number' || guard) fromIndex = 0;
	    return _.indexOf(obj, item, fromIndex) >= 0;
	  };
	
	  // Invoke a method (with arguments) on every item in a collection.
	  _.invoke = function(obj, method) {
	    var args = slice.call(arguments, 2);
	    var isFunc = _.isFunction(method);
	    return _.map(obj, function(value) {
	      var func = isFunc ? method : value[method];
	      return func == null ? func : func.apply(value, args);
	    });
	  };
	
	  // Convenience version of a common use case of `map`: fetching a property.
	  _.pluck = function(obj, key) {
	    return _.map(obj, _.property(key));
	  };
	
	  // Convenience version of a common use case of `filter`: selecting only objects
	  // containing specific `key:value` pairs.
	  _.where = function(obj, attrs) {
	    return _.filter(obj, _.matcher(attrs));
	  };
	
	  // Convenience version of a common use case of `find`: getting the first object
	  // containing specific `key:value` pairs.
	  _.findWhere = function(obj, attrs) {
	    return _.find(obj, _.matcher(attrs));
	  };
	
	  // Return the maximum element (or element-based computation).
	  _.max = function(obj, iteratee, context) {
	    var result = -Infinity, lastComputed = -Infinity,
	        value, computed;
	    if (iteratee == null && obj != null) {
	      obj = isArrayLike(obj) ? obj : _.values(obj);
	      for (var i = 0, length = obj.length; i < length; i++) {
	        value = obj[i];
	        if (value > result) {
	          result = value;
	        }
	      }
	    } else {
	      iteratee = cb(iteratee, context);
	      _.each(obj, function(value, index, list) {
	        computed = iteratee(value, index, list);
	        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
	          result = value;
	          lastComputed = computed;
	        }
	      });
	    }
	    return result;
	  };
	
	  // Return the minimum element (or element-based computation).
	  _.min = function(obj, iteratee, context) {
	    var result = Infinity, lastComputed = Infinity,
	        value, computed;
	    if (iteratee == null && obj != null) {
	      obj = isArrayLike(obj) ? obj : _.values(obj);
	      for (var i = 0, length = obj.length; i < length; i++) {
	        value = obj[i];
	        if (value < result) {
	          result = value;
	        }
	      }
	    } else {
	      iteratee = cb(iteratee, context);
	      _.each(obj, function(value, index, list) {
	        computed = iteratee(value, index, list);
	        if (computed < lastComputed || computed === Infinity && result === Infinity) {
	          result = value;
	          lastComputed = computed;
	        }
	      });
	    }
	    return result;
	  };
	
	  // Shuffle a collection, using the modern version of the
	  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
	  _.shuffle = function(obj) {
	    var set = isArrayLike(obj) ? obj : _.values(obj);
	    var length = set.length;
	    var shuffled = Array(length);
	    for (var index = 0, rand; index < length; index++) {
	      rand = _.random(0, index);
	      if (rand !== index) shuffled[index] = shuffled[rand];
	      shuffled[rand] = set[index];
	    }
	    return shuffled;
	  };
	
	  // Sample **n** random values from a collection.
	  // If **n** is not specified, returns a single random element.
	  // The internal `guard` argument allows it to work with `map`.
	  _.sample = function(obj, n, guard) {
	    if (n == null || guard) {
	      if (!isArrayLike(obj)) obj = _.values(obj);
	      return obj[_.random(obj.length - 1)];
	    }
	    return _.shuffle(obj).slice(0, Math.max(0, n));
	  };
	
	  // Sort the object's values by a criterion produced by an iteratee.
	  _.sortBy = function(obj, iteratee, context) {
	    iteratee = cb(iteratee, context);
	    return _.pluck(_.map(obj, function(value, index, list) {
	      return {
	        value: value,
	        index: index,
	        criteria: iteratee(value, index, list)
	      };
	    }).sort(function(left, right) {
	      var a = left.criteria;
	      var b = right.criteria;
	      if (a !== b) {
	        if (a > b || a === void 0) return 1;
	        if (a < b || b === void 0) return -1;
	      }
	      return left.index - right.index;
	    }), 'value');
	  };
	
	  // An internal function used for aggregate "group by" operations.
	  var group = function(behavior) {
	    return function(obj, iteratee, context) {
	      var result = {};
	      iteratee = cb(iteratee, context);
	      _.each(obj, function(value, index) {
	        var key = iteratee(value, index, obj);
	        behavior(result, value, key);
	      });
	      return result;
	    };
	  };
	
	  // Groups the object's values by a criterion. Pass either a string attribute
	  // to group by, or a function that returns the criterion.
	  _.groupBy = group(function(result, value, key) {
	    if (_.has(result, key)) result[key].push(value); else result[key] = [value];
	  });
	
	  // Indexes the object's values by a criterion, similar to `groupBy`, but for
	  // when you know that your index values will be unique.
	  _.indexBy = group(function(result, value, key) {
	    result[key] = value;
	  });
	
	  // Counts instances of an object that group by a certain criterion. Pass
	  // either a string attribute to count by, or a function that returns the
	  // criterion.
	  _.countBy = group(function(result, value, key) {
	    if (_.has(result, key)) result[key]++; else result[key] = 1;
	  });
	
	  // Safely create a real, live array from anything iterable.
	  _.toArray = function(obj) {
	    if (!obj) return [];
	    if (_.isArray(obj)) return slice.call(obj);
	    if (isArrayLike(obj)) return _.map(obj, _.identity);
	    return _.values(obj);
	  };
	
	  // Return the number of elements in an object.
	  _.size = function(obj) {
	    if (obj == null) return 0;
	    return isArrayLike(obj) ? obj.length : _.keys(obj).length;
	  };
	
	  // Split a collection into two arrays: one whose elements all satisfy the given
	  // predicate, and one whose elements all do not satisfy the predicate.
	  _.partition = function(obj, predicate, context) {
	    predicate = cb(predicate, context);
	    var pass = [], fail = [];
	    _.each(obj, function(value, key, obj) {
	      (predicate(value, key, obj) ? pass : fail).push(value);
	    });
	    return [pass, fail];
	  };
	
	  // Array Functions
	  // ---------------
	
	  // Get the first element of an array. Passing **n** will return the first N
	  // values in the array. Aliased as `head` and `take`. The **guard** check
	  // allows it to work with `_.map`.
	  _.first = _.head = _.take = function(array, n, guard) {
	    if (array == null) return void 0;
	    if (n == null || guard) return array[0];
	    return _.initial(array, array.length - n);
	  };
	
	  // Returns everything but the last entry of the array. Especially useful on
	  // the arguments object. Passing **n** will return all the values in
	  // the array, excluding the last N.
	  _.initial = function(array, n, guard) {
	    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
	  };
	
	  // Get the last element of an array. Passing **n** will return the last N
	  // values in the array.
	  _.last = function(array, n, guard) {
	    if (array == null) return void 0;
	    if (n == null || guard) return array[array.length - 1];
	    return _.rest(array, Math.max(0, array.length - n));
	  };
	
	  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
	  // Especially useful on the arguments object. Passing an **n** will return
	  // the rest N values in the array.
	  _.rest = _.tail = _.drop = function(array, n, guard) {
	    return slice.call(array, n == null || guard ? 1 : n);
	  };
	
	  // Trim out all falsy values from an array.
	  _.compact = function(array) {
	    return _.filter(array, _.identity);
	  };
	
	  // Internal implementation of a recursive `flatten` function.
	  var flatten = function(input, shallow, strict, startIndex) {
	    var output = [], idx = 0;
	    for (var i = startIndex || 0, length = getLength(input); i < length; i++) {
	      var value = input[i];
	      if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
	        //flatten current level of array or arguments object
	        if (!shallow) value = flatten(value, shallow, strict);
	        var j = 0, len = value.length;
	        output.length += len;
	        while (j < len) {
	          output[idx++] = value[j++];
	        }
	      } else if (!strict) {
	        output[idx++] = value;
	      }
	    }
	    return output;
	  };
	
	  // Flatten out an array, either recursively (by default), or just one level.
	  _.flatten = function(array, shallow) {
	    return flatten(array, shallow, false);
	  };
	
	  // Return a version of the array that does not contain the specified value(s).
	  _.without = function(array) {
	    return _.difference(array, slice.call(arguments, 1));
	  };
	
	  // Produce a duplicate-free version of the array. If the array has already
	  // been sorted, you have the option of using a faster algorithm.
	  // Aliased as `unique`.
	  _.uniq = _.unique = function(array, isSorted, iteratee, context) {
	    if (!_.isBoolean(isSorted)) {
	      context = iteratee;
	      iteratee = isSorted;
	      isSorted = false;
	    }
	    if (iteratee != null) iteratee = cb(iteratee, context);
	    var result = [];
	    var seen = [];
	    for (var i = 0, length = getLength(array); i < length; i++) {
	      var value = array[i],
	          computed = iteratee ? iteratee(value, i, array) : value;
	      if (isSorted) {
	        if (!i || seen !== computed) result.push(value);
	        seen = computed;
	      } else if (iteratee) {
	        if (!_.contains(seen, computed)) {
	          seen.push(computed);
	          result.push(value);
	        }
	      } else if (!_.contains(result, value)) {
	        result.push(value);
	      }
	    }
	    return result;
	  };
	
	  // Produce an array that contains the union: each distinct element from all of
	  // the passed-in arrays.
	  _.union = function() {
	    return _.uniq(flatten(arguments, true, true));
	  };
	
	  // Produce an array that contains every item shared between all the
	  // passed-in arrays.
	  _.intersection = function(array) {
	    var result = [];
	    var argsLength = arguments.length;
	    for (var i = 0, length = getLength(array); i < length; i++) {
	      var item = array[i];
	      if (_.contains(result, item)) continue;
	      for (var j = 1; j < argsLength; j++) {
	        if (!_.contains(arguments[j], item)) break;
	      }
	      if (j === argsLength) result.push(item);
	    }
	    return result;
	  };
	
	  // Take the difference between one array and a number of other arrays.
	  // Only the elements present in just the first array will remain.
	  _.difference = function(array) {
	    var rest = flatten(arguments, true, true, 1);
	    return _.filter(array, function(value){
	      return !_.contains(rest, value);
	    });
	  };
	
	  // Zip together multiple lists into a single array -- elements that share
	  // an index go together.
	  _.zip = function() {
	    return _.unzip(arguments);
	  };
	
	  // Complement of _.zip. Unzip accepts an array of arrays and groups
	  // each array's elements on shared indices
	  _.unzip = function(array) {
	    var length = array && _.max(array, getLength).length || 0;
	    var result = Array(length);
	
	    for (var index = 0; index < length; index++) {
	      result[index] = _.pluck(array, index);
	    }
	    return result;
	  };
	
	  // Converts lists into objects. Pass either a single array of `[key, value]`
	  // pairs, or two parallel arrays of the same length -- one of keys, and one of
	  // the corresponding values.
	  _.object = function(list, values) {
	    var result = {};
	    for (var i = 0, length = getLength(list); i < length; i++) {
	      if (values) {
	        result[list[i]] = values[i];
	      } else {
	        result[list[i][0]] = list[i][1];
	      }
	    }
	    return result;
	  };
	
	  // Generator function to create the findIndex and findLastIndex functions
	  function createPredicateIndexFinder(dir) {
	    return function(array, predicate, context) {
	      predicate = cb(predicate, context);
	      var length = getLength(array);
	      var index = dir > 0 ? 0 : length - 1;
	      for (; index >= 0 && index < length; index += dir) {
	        if (predicate(array[index], index, array)) return index;
	      }
	      return -1;
	    };
	  }
	
	  // Returns the first index on an array-like that passes a predicate test
	  _.findIndex = createPredicateIndexFinder(1);
	  _.findLastIndex = createPredicateIndexFinder(-1);
	
	  // Use a comparator function to figure out the smallest index at which
	  // an object should be inserted so as to maintain order. Uses binary search.
	  _.sortedIndex = function(array, obj, iteratee, context) {
	    iteratee = cb(iteratee, context, 1);
	    var value = iteratee(obj);
	    var low = 0, high = getLength(array);
	    while (low < high) {
	      var mid = Math.floor((low + high) / 2);
	      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
	    }
	    return low;
	  };
	
	  // Generator function to create the indexOf and lastIndexOf functions
	  function createIndexFinder(dir, predicateFind, sortedIndex) {
	    return function(array, item, idx) {
	      var i = 0, length = getLength(array);
	      if (typeof idx == 'number') {
	        if (dir > 0) {
	            i = idx >= 0 ? idx : Math.max(idx + length, i);
	        } else {
	            length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
	        }
	      } else if (sortedIndex && idx && length) {
	        idx = sortedIndex(array, item);
	        return array[idx] === item ? idx : -1;
	      }
	      if (item !== item) {
	        idx = predicateFind(slice.call(array, i, length), _.isNaN);
	        return idx >= 0 ? idx + i : -1;
	      }
	      for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
	        if (array[idx] === item) return idx;
	      }
	      return -1;
	    };
	  }
	
	  // Return the position of the first occurrence of an item in an array,
	  // or -1 if the item is not included in the array.
	  // If the array is large and already in sort order, pass `true`
	  // for **isSorted** to use binary search.
	  _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);
	  _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);
	
	  // Generate an integer Array containing an arithmetic progression. A port of
	  // the native Python `range()` function. See
	  // [the Python documentation](http://docs.python.org/library/functions.html#range).
	  _.range = function(start, stop, step) {
	    if (stop == null) {
	      stop = start || 0;
	      start = 0;
	    }
	    step = step || 1;
	
	    var length = Math.max(Math.ceil((stop - start) / step), 0);
	    var range = Array(length);
	
	    for (var idx = 0; idx < length; idx++, start += step) {
	      range[idx] = start;
	    }
	
	    return range;
	  };
	
	  // Function (ahem) Functions
	  // ------------------
	
	  // Determines whether to execute a function as a constructor
	  // or a normal function with the provided arguments
	  var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
	    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
	    var self = baseCreate(sourceFunc.prototype);
	    var result = sourceFunc.apply(self, args);
	    if (_.isObject(result)) return result;
	    return self;
	  };
	
	  // Create a function bound to a given object (assigning `this`, and arguments,
	  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
	  // available.
	  _.bind = function(func, context) {
	    if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
	    if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
	    var args = slice.call(arguments, 2);
	    var bound = function() {
	      return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));
	    };
	    return bound;
	  };
	
	  // Partially apply a function by creating a version that has had some of its
	  // arguments pre-filled, without changing its dynamic `this` context. _ acts
	  // as a placeholder, allowing any combination of arguments to be pre-filled.
	  _.partial = function(func) {
	    var boundArgs = slice.call(arguments, 1);
	    var bound = function() {
	      var position = 0, length = boundArgs.length;
	      var args = Array(length);
	      for (var i = 0; i < length; i++) {
	        args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];
	      }
	      while (position < arguments.length) args.push(arguments[position++]);
	      return executeBound(func, bound, this, this, args);
	    };
	    return bound;
	  };
	
	  // Bind a number of an object's methods to that object. Remaining arguments
	  // are the method names to be bound. Useful for ensuring that all callbacks
	  // defined on an object belong to it.
	  _.bindAll = function(obj) {
	    var i, length = arguments.length, key;
	    if (length <= 1) throw new Error('bindAll must be passed function names');
	    for (i = 1; i < length; i++) {
	      key = arguments[i];
	      obj[key] = _.bind(obj[key], obj);
	    }
	    return obj;
	  };
	
	  // Memoize an expensive function by storing its results.
	  _.memoize = function(func, hasher) {
	    var memoize = function(key) {
	      var cache = memoize.cache;
	      var address = '' + (hasher ? hasher.apply(this, arguments) : key);
	      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
	      return cache[address];
	    };
	    memoize.cache = {};
	    return memoize;
	  };
	
	  // Delays a function for the given number of milliseconds, and then calls
	  // it with the arguments supplied.
	  _.delay = function(func, wait) {
	    var args = slice.call(arguments, 2);
	    return setTimeout(function(){
	      return func.apply(null, args);
	    }, wait);
	  };
	
	  // Defers a function, scheduling it to run after the current call stack has
	  // cleared.
	  _.defer = _.partial(_.delay, _, 1);
	
	  // Returns a function, that, when invoked, will only be triggered at most once
	  // during a given window of time. Normally, the throttled function will run
	  // as much as it can, without ever going more than once per `wait` duration;
	  // but if you'd like to disable the execution on the leading edge, pass
	  // `{leading: false}`. To disable execution on the trailing edge, ditto.
	  _.throttle = function(func, wait, options) {
	    var context, args, result;
	    var timeout = null;
	    var previous = 0;
	    if (!options) options = {};
	    var later = function() {
	      previous = options.leading === false ? 0 : _.now();
	      timeout = null;
	      result = func.apply(context, args);
	      if (!timeout) context = args = null;
	    };
	    return function() {
	      var now = _.now();
	      if (!previous && options.leading === false) previous = now;
	      var remaining = wait - (now - previous);
	      context = this;
	      args = arguments;
	      if (remaining <= 0 || remaining > wait) {
	        if (timeout) {
	          clearTimeout(timeout);
	          timeout = null;
	        }
	        previous = now;
	        result = func.apply(context, args);
	        if (!timeout) context = args = null;
	      } else if (!timeout && options.trailing !== false) {
	        timeout = setTimeout(later, remaining);
	      }
	      return result;
	    };
	  };
	
	  // Returns a function, that, as long as it continues to be invoked, will not
	  // be triggered. The function will be called after it stops being called for
	  // N milliseconds. If `immediate` is passed, trigger the function on the
	  // leading edge, instead of the trailing.
	  _.debounce = function(func, wait, immediate) {
	    var timeout, args, context, timestamp, result;
	
	    var later = function() {
	      var last = _.now() - timestamp;
	
	      if (last < wait && last >= 0) {
	        timeout = setTimeout(later, wait - last);
	      } else {
	        timeout = null;
	        if (!immediate) {
	          result = func.apply(context, args);
	          if (!timeout) context = args = null;
	        }
	      }
	    };
	
	    return function() {
	      context = this;
	      args = arguments;
	      timestamp = _.now();
	      var callNow = immediate && !timeout;
	      if (!timeout) timeout = setTimeout(later, wait);
	      if (callNow) {
	        result = func.apply(context, args);
	        context = args = null;
	      }
	
	      return result;
	    };
	  };
	
	  // Returns the first function passed as an argument to the second,
	  // allowing you to adjust arguments, run code before and after, and
	  // conditionally execute the original function.
	  _.wrap = function(func, wrapper) {
	    return _.partial(wrapper, func);
	  };
	
	  // Returns a negated version of the passed-in predicate.
	  _.negate = function(predicate) {
	    return function() {
	      return !predicate.apply(this, arguments);
	    };
	  };
	
	  // Returns a function that is the composition of a list of functions, each
	  // consuming the return value of the function that follows.
	  _.compose = function() {
	    var args = arguments;
	    var start = args.length - 1;
	    return function() {
	      var i = start;
	      var result = args[start].apply(this, arguments);
	      while (i--) result = args[i].call(this, result);
	      return result;
	    };
	  };
	
	  // Returns a function that will only be executed on and after the Nth call.
	  _.after = function(times, func) {
	    return function() {
	      if (--times < 1) {
	        return func.apply(this, arguments);
	      }
	    };
	  };
	
	  // Returns a function that will only be executed up to (but not including) the Nth call.
	  _.before = function(times, func) {
	    var memo;
	    return function() {
	      if (--times > 0) {
	        memo = func.apply(this, arguments);
	      }
	      if (times <= 1) func = null;
	      return memo;
	    };
	  };
	
	  // Returns a function that will be executed at most one time, no matter how
	  // often you call it. Useful for lazy initialization.
	  _.once = _.partial(_.before, 2);
	
	  // Object Functions
	  // ----------------
	
	  // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
	  var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
	  var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
	                      'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
	
	  function collectNonEnumProps(obj, keys) {
	    var nonEnumIdx = nonEnumerableProps.length;
	    var constructor = obj.constructor;
	    var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;
	
	    // Constructor is a special case.
	    var prop = 'constructor';
	    if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);
	
	    while (nonEnumIdx--) {
	      prop = nonEnumerableProps[nonEnumIdx];
	      if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
	        keys.push(prop);
	      }
	    }
	  }
	
	  // Retrieve the names of an object's own properties.
	  // Delegates to **ECMAScript 5**'s native `Object.keys`
	  _.keys = function(obj) {
	    if (!_.isObject(obj)) return [];
	    if (nativeKeys) return nativeKeys(obj);
	    var keys = [];
	    for (var key in obj) if (_.has(obj, key)) keys.push(key);
	    // Ahem, IE < 9.
	    if (hasEnumBug) collectNonEnumProps(obj, keys);
	    return keys;
	  };
	
	  // Retrieve all the property names of an object.
	  _.allKeys = function(obj) {
	    if (!_.isObject(obj)) return [];
	    var keys = [];
	    for (var key in obj) keys.push(key);
	    // Ahem, IE < 9.
	    if (hasEnumBug) collectNonEnumProps(obj, keys);
	    return keys;
	  };
	
	  // Retrieve the values of an object's properties.
	  _.values = function(obj) {
	    var keys = _.keys(obj);
	    var length = keys.length;
	    var values = Array(length);
	    for (var i = 0; i < length; i++) {
	      values[i] = obj[keys[i]];
	    }
	    return values;
	  };
	
	  // Returns the results of applying the iteratee to each element of the object
	  // In contrast to _.map it returns an object
	  _.mapObject = function(obj, iteratee, context) {
	    iteratee = cb(iteratee, context);
	    var keys =  _.keys(obj),
	          length = keys.length,
	          results = {},
	          currentKey;
	      for (var index = 0; index < length; index++) {
	        currentKey = keys[index];
	        results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
	      }
	      return results;
	  };
	
	  // Convert an object into a list of `[key, value]` pairs.
	  _.pairs = function(obj) {
	    var keys = _.keys(obj);
	    var length = keys.length;
	    var pairs = Array(length);
	    for (var i = 0; i < length; i++) {
	      pairs[i] = [keys[i], obj[keys[i]]];
	    }
	    return pairs;
	  };
	
	  // Invert the keys and values of an object. The values must be serializable.
	  _.invert = function(obj) {
	    var result = {};
	    var keys = _.keys(obj);
	    for (var i = 0, length = keys.length; i < length; i++) {
	      result[obj[keys[i]]] = keys[i];
	    }
	    return result;
	  };
	
	  // Return a sorted list of the function names available on the object.
	  // Aliased as `methods`
	  _.functions = _.methods = function(obj) {
	    var names = [];
	    for (var key in obj) {
	      if (_.isFunction(obj[key])) names.push(key);
	    }
	    return names.sort();
	  };
	
	  // Extend a given object with all the properties in passed-in object(s).
	  _.extend = createAssigner(_.allKeys);
	
	  // Assigns a given object with all the own properties in the passed-in object(s)
	  // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
	  _.extendOwn = _.assign = createAssigner(_.keys);
	
	  // Returns the first key on an object that passes a predicate test
	  _.findKey = function(obj, predicate, context) {
	    predicate = cb(predicate, context);
	    var keys = _.keys(obj), key;
	    for (var i = 0, length = keys.length; i < length; i++) {
	      key = keys[i];
	      if (predicate(obj[key], key, obj)) return key;
	    }
	  };
	
	  // Return a copy of the object only containing the whitelisted properties.
	  _.pick = function(object, oiteratee, context) {
	    var result = {}, obj = object, iteratee, keys;
	    if (obj == null) return result;
	    if (_.isFunction(oiteratee)) {
	      keys = _.allKeys(obj);
	      iteratee = optimizeCb(oiteratee, context);
	    } else {
	      keys = flatten(arguments, false, false, 1);
	      iteratee = function(value, key, obj) { return key in obj; };
	      obj = Object(obj);
	    }
	    for (var i = 0, length = keys.length; i < length; i++) {
	      var key = keys[i];
	      var value = obj[key];
	      if (iteratee(value, key, obj)) result[key] = value;
	    }
	    return result;
	  };
	
	   // Return a copy of the object without the blacklisted properties.
	  _.omit = function(obj, iteratee, context) {
	    if (_.isFunction(iteratee)) {
	      iteratee = _.negate(iteratee);
	    } else {
	      var keys = _.map(flatten(arguments, false, false, 1), String);
	      iteratee = function(value, key) {
	        return !_.contains(keys, key);
	      };
	    }
	    return _.pick(obj, iteratee, context);
	  };
	
	  // Fill in a given object with default properties.
	  _.defaults = createAssigner(_.allKeys, true);
	
	  // Creates an object that inherits from the given prototype object.
	  // If additional properties are provided then they will be added to the
	  // created object.
	  _.create = function(prototype, props) {
	    var result = baseCreate(prototype);
	    if (props) _.extendOwn(result, props);
	    return result;
	  };
	
	  // Create a (shallow-cloned) duplicate of an object.
	  _.clone = function(obj) {
	    if (!_.isObject(obj)) return obj;
	    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
	  };
	
	  // Invokes interceptor with the obj, and then returns obj.
	  // The primary purpose of this method is to "tap into" a method chain, in
	  // order to perform operations on intermediate results within the chain.
	  _.tap = function(obj, interceptor) {
	    interceptor(obj);
	    return obj;
	  };
	
	  // Returns whether an object has a given set of `key:value` pairs.
	  _.isMatch = function(object, attrs) {
	    var keys = _.keys(attrs), length = keys.length;
	    if (object == null) return !length;
	    var obj = Object(object);
	    for (var i = 0; i < length; i++) {
	      var key = keys[i];
	      if (attrs[key] !== obj[key] || !(key in obj)) return false;
	    }
	    return true;
	  };
	
	
	  // Internal recursive comparison function for `isEqual`.
	  var eq = function(a, b, aStack, bStack) {
	    // Identical objects are equal. `0 === -0`, but they aren't identical.
	    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
	    if (a === b) return a !== 0 || 1 / a === 1 / b;
	    // A strict comparison is necessary because `null == undefined`.
	    if (a == null || b == null) return a === b;
	    // Unwrap any wrapped objects.
	    if (a instanceof _) a = a._wrapped;
	    if (b instanceof _) b = b._wrapped;
	    // Compare `[[Class]]` names.
	    var className = toString.call(a);
	    if (className !== toString.call(b)) return false;
	    switch (className) {
	      // Strings, numbers, regular expressions, dates, and booleans are compared by value.
	      case '[object RegExp]':
	      // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
	      case '[object String]':
	        // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
	        // equivalent to `new String("5")`.
	        return '' + a === '' + b;
	      case '[object Number]':
	        // `NaN`s are equivalent, but non-reflexive.
	        // Object(NaN) is equivalent to NaN
	        if (+a !== +a) return +b !== +b;
	        // An `egal` comparison is performed for other numeric values.
	        return +a === 0 ? 1 / +a === 1 / b : +a === +b;
	      case '[object Date]':
	      case '[object Boolean]':
	        // Coerce dates and booleans to numeric primitive values. Dates are compared by their
	        // millisecond representations. Note that invalid dates with millisecond representations
	        // of `NaN` are not equivalent.
	        return +a === +b;
	    }
	
	    var areArrays = className === '[object Array]';
	    if (!areArrays) {
	      if (typeof a != 'object' || typeof b != 'object') return false;
	
	      // Objects with different constructors are not equivalent, but `Object`s or `Array`s
	      // from different frames are.
	      var aCtor = a.constructor, bCtor = b.constructor;
	      if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
	                               _.isFunction(bCtor) && bCtor instanceof bCtor)
	                          && ('constructor' in a && 'constructor' in b)) {
	        return false;
	      }
	    }
	    // Assume equality for cyclic structures. The algorithm for detecting cyclic
	    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
	
	    // Initializing stack of traversed objects.
	    // It's done here since we only need them for objects and arrays comparison.
	    aStack = aStack || [];
	    bStack = bStack || [];
	    var length = aStack.length;
	    while (length--) {
	      // Linear search. Performance is inversely proportional to the number of
	      // unique nested structures.
	      if (aStack[length] === a) return bStack[length] === b;
	    }
	
	    // Add the first object to the stack of traversed objects.
	    aStack.push(a);
	    bStack.push(b);
	
	    // Recursively compare objects and arrays.
	    if (areArrays) {
	      // Compare array lengths to determine if a deep comparison is necessary.
	      length = a.length;
	      if (length !== b.length) return false;
	      // Deep compare the contents, ignoring non-numeric properties.
	      while (length--) {
	        if (!eq(a[length], b[length], aStack, bStack)) return false;
	      }
	    } else {
	      // Deep compare objects.
	      var keys = _.keys(a), key;
	      length = keys.length;
	      // Ensure that both objects contain the same number of properties before comparing deep equality.
	      if (_.keys(b).length !== length) return false;
	      while (length--) {
	        // Deep compare each member
	        key = keys[length];
	        if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
	      }
	    }
	    // Remove the first object from the stack of traversed objects.
	    aStack.pop();
	    bStack.pop();
	    return true;
	  };
	
	  // Perform a deep comparison to check if two objects are equal.
	  _.isEqual = function(a, b) {
	    return eq(a, b);
	  };
	
	  // Is a given array, string, or object empty?
	  // An "empty" object has no enumerable own-properties.
	  _.isEmpty = function(obj) {
	    if (obj == null) return true;
	    if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;
	    return _.keys(obj).length === 0;
	  };
	
	  // Is a given value a DOM element?
	  _.isElement = function(obj) {
	    return !!(obj && obj.nodeType === 1);
	  };
	
	  // Is a given value an array?
	  // Delegates to ECMA5's native Array.isArray
	  _.isArray = nativeIsArray || function(obj) {
	    return toString.call(obj) === '[object Array]';
	  };
	
	  // Is a given variable an object?
	  _.isObject = function(obj) {
	    var type = typeof obj;
	    return type === 'function' || type === 'object' && !!obj;
	  };
	
	  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
	  _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
	    _['is' + name] = function(obj) {
	      return toString.call(obj) === '[object ' + name + ']';
	    };
	  });
	
	  // Define a fallback version of the method in browsers (ahem, IE < 9), where
	  // there isn't any inspectable "Arguments" type.
	  if (!_.isArguments(arguments)) {
	    _.isArguments = function(obj) {
	      return _.has(obj, 'callee');
	    };
	  }
	
	  // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,
	  // IE 11 (#1621), and in Safari 8 (#1929).
	  if (typeof /./ != 'function' && typeof Int8Array != 'object') {
	    _.isFunction = function(obj) {
	      return typeof obj == 'function' || false;
	    };
	  }
	
	  // Is a given object a finite number?
	  _.isFinite = function(obj) {
	    return isFinite(obj) && !isNaN(parseFloat(obj));
	  };
	
	  // Is the given value `NaN`? (NaN is the only number which does not equal itself).
	  _.isNaN = function(obj) {
	    return _.isNumber(obj) && obj !== +obj;
	  };
	
	  // Is a given value a boolean?
	  _.isBoolean = function(obj) {
	    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
	  };
	
	  // Is a given value equal to null?
	  _.isNull = function(obj) {
	    return obj === null;
	  };
	
	  // Is a given variable undefined?
	  _.isUndefined = function(obj) {
	    return obj === void 0;
	  };
	
	  // Shortcut function for checking if an object has a given property directly
	  // on itself (in other words, not on a prototype).
	  _.has = function(obj, key) {
	    return obj != null && hasOwnProperty.call(obj, key);
	  };
	
	  // Utility Functions
	  // -----------------
	
	  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
	  // previous owner. Returns a reference to the Underscore object.
	  _.noConflict = function() {
	    root._ = previousUnderscore;
	    return this;
	  };
	
	  // Keep the identity function around for default iteratees.
	  _.identity = function(value) {
	    return value;
	  };
	
	  // Predicate-generating functions. Often useful outside of Underscore.
	  _.constant = function(value) {
	    return function() {
	      return value;
	    };
	  };
	
	  _.noop = function(){};
	
	  _.property = property;
	
	  // Generates a function for a given object that returns a given property.
	  _.propertyOf = function(obj) {
	    return obj == null ? function(){} : function(key) {
	      return obj[key];
	    };
	  };
	
	  // Returns a predicate for checking whether an object has a given set of
	  // `key:value` pairs.
	  _.matcher = _.matches = function(attrs) {
	    attrs = _.extendOwn({}, attrs);
	    return function(obj) {
	      return _.isMatch(obj, attrs);
	    };
	  };
	
	  // Run a function **n** times.
	  _.times = function(n, iteratee, context) {
	    var accum = Array(Math.max(0, n));
	    iteratee = optimizeCb(iteratee, context, 1);
	    for (var i = 0; i < n; i++) accum[i] = iteratee(i);
	    return accum;
	  };
	
	  // Return a random integer between min and max (inclusive).
	  _.random = function(min, max) {
	    if (max == null) {
	      max = min;
	      min = 0;
	    }
	    return min + Math.floor(Math.random() * (max - min + 1));
	  };
	
	  // A (possibly faster) way to get the current timestamp as an integer.
	  _.now = Date.now || function() {
	    return new Date().getTime();
	  };
	
	   // List of HTML entities for escaping.
	  var escapeMap = {
	    '&': '&amp;',
	    '<': '&lt;',
	    '>': '&gt;',
	    '"': '&quot;',
	    "'": '&#x27;',
	    '`': '&#x60;'
	  };
	  var unescapeMap = _.invert(escapeMap);
	
	  // Functions for escaping and unescaping strings to/from HTML interpolation.
	  var createEscaper = function(map) {
	    var escaper = function(match) {
	      return map[match];
	    };
	    // Regexes for identifying a key that needs to be escaped
	    var source = '(?:' + _.keys(map).join('|') + ')';
	    var testRegexp = RegExp(source);
	    var replaceRegexp = RegExp(source, 'g');
	    return function(string) {
	      string = string == null ? '' : '' + string;
	      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
	    };
	  };
	  _.escape = createEscaper(escapeMap);
	  _.unescape = createEscaper(unescapeMap);
	
	  // If the value of the named `property` is a function then invoke it with the
	  // `object` as context; otherwise, return it.
	  _.result = function(object, property, fallback) {
	    var value = object == null ? void 0 : object[property];
	    if (value === void 0) {
	      value = fallback;
	    }
	    return _.isFunction(value) ? value.call(object) : value;
	  };
	
	  // Generate a unique integer id (unique within the entire client session).
	  // Useful for temporary DOM ids.
	  var idCounter = 0;
	  _.uniqueId = function(prefix) {
	    var id = ++idCounter + '';
	    return prefix ? prefix + id : id;
	  };
	
	  // By default, Underscore uses ERB-style template delimiters, change the
	  // following template settings to use alternative delimiters.
	  _.templateSettings = {
	    evaluate    : /<%([\s\S]+?)%>/g,
	    interpolate : /<%=([\s\S]+?)%>/g,
	    escape      : /<%-([\s\S]+?)%>/g
	  };
	
	  // When customizing `templateSettings`, if you don't want to define an
	  // interpolation, evaluation or escaping regex, we need one that is
	  // guaranteed not to match.
	  var noMatch = /(.)^/;
	
	  // Certain characters need to be escaped so that they can be put into a
	  // string literal.
	  var escapes = {
	    "'":      "'",
	    '\\':     '\\',
	    '\r':     'r',
	    '\n':     'n',
	    '\u2028': 'u2028',
	    '\u2029': 'u2029'
	  };
	
	  var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
	
	  var escapeChar = function(match) {
	    return '\\' + escapes[match];
	  };
	
	  // JavaScript micro-templating, similar to John Resig's implementation.
	  // Underscore templating handles arbitrary delimiters, preserves whitespace,
	  // and correctly escapes quotes within interpolated code.
	  // NB: `oldSettings` only exists for backwards compatibility.
	  _.template = function(text, settings, oldSettings) {
	    if (!settings && oldSettings) settings = oldSettings;
	    settings = _.defaults({}, settings, _.templateSettings);
	
	    // Combine delimiters into one regular expression via alternation.
	    var matcher = RegExp([
	      (settings.escape || noMatch).source,
	      (settings.interpolate || noMatch).source,
	      (settings.evaluate || noMatch).source
	    ].join('|') + '|$', 'g');
	
	    // Compile the template source, escaping string literals appropriately.
	    var index = 0;
	    var source = "__p+='";
	    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
	      source += text.slice(index, offset).replace(escaper, escapeChar);
	      index = offset + match.length;
	
	      if (escape) {
	        source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
	      } else if (interpolate) {
	        source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
	      } else if (evaluate) {
	        source += "';\n" + evaluate + "\n__p+='";
	      }
	
	      // Adobe VMs need the match returned to produce the correct offest.
	      return match;
	    });
	    source += "';\n";
	
	    // If a variable is not specified, place data values in local scope.
	    if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
	
	    source = "var __t,__p='',__j=Array.prototype.join," +
	      "print=function(){__p+=__j.call(arguments,'');};\n" +
	      source + 'return __p;\n';
	
	    try {
	      var render = new Function(settings.variable || 'obj', '_', source);
	    } catch (e) {
	      e.source = source;
	      throw e;
	    }
	
	    var template = function(data) {
	      return render.call(this, data, _);
	    };
	
	    // Provide the compiled source as a convenience for precompilation.
	    var argument = settings.variable || 'obj';
	    template.source = 'function(' + argument + '){\n' + source + '}';
	
	    return template;
	  };
	
	  // Add a "chain" function. Start chaining a wrapped Underscore object.
	  _.chain = function(obj) {
	    var instance = _(obj);
	    instance._chain = true;
	    return instance;
	  };
	
	  // OOP
	  // ---------------
	  // If Underscore is called as a function, it returns a wrapped object that
	  // can be used OO-style. This wrapper holds altered versions of all the
	  // underscore functions. Wrapped objects may be chained.
	
	  // Helper function to continue chaining intermediate results.
	  var result = function(instance, obj) {
	    return instance._chain ? _(obj).chain() : obj;
	  };
	
	  // Add your own custom functions to the Underscore object.
	  _.mixin = function(obj) {
	    _.each(_.functions(obj), function(name) {
	      var func = _[name] = obj[name];
	      _.prototype[name] = function() {
	        var args = [this._wrapped];
	        push.apply(args, arguments);
	        return result(this, func.apply(_, args));
	      };
	    });
	  };
	
	  // Add all of the Underscore functions to the wrapper object.
	  _.mixin(_);
	
	  // Add all mutator Array functions to the wrapper.
	  _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
	    var method = ArrayProto[name];
	    _.prototype[name] = function() {
	      var obj = this._wrapped;
	      method.apply(obj, arguments);
	      if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
	      return result(this, obj);
	    };
	  });
	
	  // Add all accessor Array functions to the wrapper.
	  _.each(['concat', 'join', 'slice'], function(name) {
	    var method = ArrayProto[name];
	    _.prototype[name] = function() {
	      return result(this, method.apply(this._wrapped, arguments));
	    };
	  });
	
	  // Extracts the result from a wrapped and chained object.
	  _.prototype.value = function() {
	    return this._wrapped;
	  };
	
	  // Provide unwrapping proxy for some methods used in engine operations
	  // such as arithmetic and JSON stringification.
	  _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
	
	  _.prototype.toString = function() {
	    return '' + this._wrapped;
	  };
	
	  // AMD registration happens at the end for compatibility with AMD loaders
	  // that may not enforce next-turn semantics on modules. Even though general
	  // practice for AMD registration is to be anonymous, underscore registers
	  // as a named module because, like jQuery, it is a base library that is
	  // popular enough to be bundled in a third party lib, but not be part of
	  // an AMD load request. Those cases could generate an error when an
	  // anonymous define() is called outside of a loader request.
	  if (true) {
	    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
	      return _;
	    }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	  }
	}.call(this));
	
})
/** END DEFINE BLOCK for underscore@1.8.3/underscore.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/utils.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/utils.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	// TODO: ATTEMPT TO KILL THIS MODULE USING THIRD PARTY LIBRARIES WHEN IPYWIDGETS
	// IS CONVERTED TO NODE COMMONJS.
	/**
	 * http://www.ietf.org/rfc/rfc4122.txt
	 */
	function uuid() {
	    var s = [];
	    var hexDigits = '0123456789ABCDEF';
	    for (var i = 0; i < 32; i++) {
	        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
	    }
	    s[12] = '4'; // bits 12-15 of the time_hi_and_version field to 0010
	    s[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
	    return s.join('');
	}
	exports.uuid = uuid;
	/**
	 * Wrappable Error class
	 *
	 * The Error class doesn't actually act on `this`.  Instead it always
	 * returns a new instance of Error.  Here we capture that instance so we
	 * can apply it's properties to `this`.
	 */
	var WrappedError = (function (_super) {
	    __extends(WrappedError, _super);
	    function WrappedError(message, error) {
	        _super.call(this, message);
	        // Keep a stack of the original error messages.
	        if (error instanceof WrappedError) {
	            this.error_stack = error.error_stack;
	        }
	        else {
	            this.error_stack = [error];
	        }
	        this.error_stack.push(this);
	    }
	    return WrappedError;
	}(Error));
	exports.WrappedError = WrappedError;
	/**
	 * Tries to load a class
	 *
	 * Tries to load a class from a module using require.js, if a module
	 * is specified, otherwise tries to load a class from the global
	 * registry, if the global registry is provided.
	 *
	 * The optional require_error argument is a function that takes the success
	 * handler and returns a requirejs error handler, which may call the success
	 * handler with a fallback module.
	 *
	 */
	function loadClass(class_name, module_name, module_version, registry, require_error) {
	    return new Promise(function (resolve, reject) {
	        // Try loading the view module using require.js
	        if (module_name) {
	            // If the module is jupyter-js-widgets, we can just self import.
	            var modulePromise;
	            var requirejsDefined = typeof window !== 'undefined' && window.requirejs;
	            if (requirejsDefined) {
	                if (module_name !== 'jupyter-js-widgets' || window.requirejs.defined('jupyter-js-widgets')) {
	                    modulePromise = new Promise(function (innerResolve, innerReject) {
	                        var success_callback = function (module) {
	                            innerResolve(module);
	                        };
	                        var failure_callback = require_error ? require_error(success_callback, reject, module_version) : reject;
	                        window.require([module_name], success_callback, failure_callback);
	                    });
	                }
	                else if (module_name === 'jupyter-js-widgets') {
	                    modulePromise = Promise.resolve(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/index.js'));
	                }
	            }
	            else if (module_name === 'jupyter-js-widgets') {
	                modulePromise = Promise.resolve(__jupyter_require__('jupyter-js-widgets@2.1.4/lib/index.js'));
	            }
	            else {
	                // FUTURE: Investigate dynamic loading methods other than require.js.
	                throw new Error(['In order to use third party widgets, you ',
	                    'must have require.js loaded on the page.'].join(''));
	            }
	            modulePromise.then(function (module) {
	                if (module[class_name] === undefined) {
	                    reject(new Error('Class ' + class_name + ' not found in module ' + module_name));
	                }
	                else {
	                    resolve(module[class_name]);
	                }
	            });
	        }
	        else {
	            if (registry && registry[class_name]) {
	                resolve(registry[class_name]);
	            }
	            else {
	                reject(new Error('Class ' + class_name + ' not found in registry '));
	            }
	        }
	    });
	}
	exports.loadClass = loadClass;
	/**
	 * Resolve a promiseful dictionary.
	 * Returns a single Promise.
	 */
	function resolvePromisesDict(d) {
	    var keys = Object.keys(d);
	    var values = [];
	    keys.forEach(function (key) {
	        values.push(d[key]);
	    });
	    return Promise.all(values).then(function (v) {
	        d = {};
	        for (var i = 0; i < keys.length; i++) {
	            d[keys[i]] = v[i];
	        }
	        return d;
	    });
	}
	exports.resolvePromisesDict = resolvePromisesDict;
	/**
	 * Creates a wrappable Promise rejection function.
	 *
	 * Creates a function that returns a Promise.reject with a new WrappedError
	 * that has the provided message and wraps the original error that
	 * caused the promise to reject.
	 */
	function reject(message, log) {
	    return function promiseRejection(error) {
	        var wrapped_error = new WrappedError(message, error);
	        if (log)
	            console.error(wrapped_error);
	        return Promise.reject(wrapped_error);
	    };
	}
	exports.reject = reject;
	/**
	 * Apply MathJax rendering to an element, and optionally set its text.
	 *
	 * If MathJax is not available, make no changes.
	 *
	 * Parameters
	 * ----------
	 * element: Node
	 * text: optional string
	 */
	function typeset(element, text) {
	    if (text !== void 0) {
	        element.textContent = text;
	    }
	    if (window.MathJax !== void 0) {
	        MathJax.Hub.Queue(['Typeset', MathJax.Hub, element]);
	    }
	}
	exports.typeset = typeset;
	/**
	 * escape text to HTML
	 */
	function escape_html(text) {
	    var esc = document.createElement('div');
	    esc.textContent = text;
	    return esc.innerHTML;
	}
	exports.escape_html = escape_html;
	;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/utils.js **/


/** START DEFINE BLOCK for semver@5.3.0/semver.js **/
jupyter.define('semver@5.3.0/semver.js', function (module, exports, __jupyter_require__) {
	/* WEBPACK VAR INJECTION */(function(process) {exports = module.exports = SemVer;
	
	// The debug function is excluded entirely from the minified version.
	/* nomin */ var debug;
	/* nomin */ if (typeof process === 'object' &&
	    /* nomin */ process.env &&
	    /* nomin */ process.env.NODE_DEBUG &&
	    /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG))
	  /* nomin */ debug = function() {
	    /* nomin */ var args = Array.prototype.slice.call(arguments, 0);
	    /* nomin */ args.unshift('SEMVER');
	    /* nomin */ console.log.apply(console, args);
	    /* nomin */ };
	/* nomin */ else
	  /* nomin */ debug = function() {};
	
	// Note: this is the semver.org version of the spec that it implements
	// Not necessarily the package version of this code.
	exports.SEMVER_SPEC_VERSION = '2.0.0';
	
	var MAX_LENGTH = 256;
	var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
	
	// The actual regexps go on exports.re
	var re = exports.re = [];
	var src = exports.src = [];
	var R = 0;
	
	// The following Regular Expressions can be used for tokenizing,
	// validating, and parsing SemVer version strings.
	
	// ## Numeric Identifier
	// A single `0`, or a non-zero digit followed by zero or more digits.
	
	var NUMERICIDENTIFIER = R++;
	src[NUMERICIDENTIFIER] = '0|[1-9]\\d*';
	var NUMERICIDENTIFIERLOOSE = R++;
	src[NUMERICIDENTIFIERLOOSE] = '[0-9]+';
	
	
	// ## Non-numeric Identifier
	// Zero or more digits, followed by a letter or hyphen, and then zero or
	// more letters, digits, or hyphens.
	
	var NONNUMERICIDENTIFIER = R++;
	src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*';
	
	
	// ## Main Version
	// Three dot-separated numeric identifiers.
	
	var MAINVERSION = R++;
	src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
	                   '(' + src[NUMERICIDENTIFIER] + ')\\.' +
	                   '(' + src[NUMERICIDENTIFIER] + ')';
	
	var MAINVERSIONLOOSE = R++;
	src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
	                        '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
	                        '(' + src[NUMERICIDENTIFIERLOOSE] + ')';
	
	// ## Pre-release Version Identifier
	// A numeric identifier, or a non-numeric identifier.
	
	var PRERELEASEIDENTIFIER = R++;
	src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
	                            '|' + src[NONNUMERICIDENTIFIER] + ')';
	
	var PRERELEASEIDENTIFIERLOOSE = R++;
	src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
	                                 '|' + src[NONNUMERICIDENTIFIER] + ')';
	
	
	// ## Pre-release Version
	// Hyphen, followed by one or more dot-separated pre-release version
	// identifiers.
	
	var PRERELEASE = R++;
	src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
	                  '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))';
	
	var PRERELEASELOOSE = R++;
	src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
	                       '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))';
	
	// ## Build Metadata Identifier
	// Any combination of digits, letters, or hyphens.
	
	var BUILDIDENTIFIER = R++;
	src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+';
	
	// ## Build Metadata
	// Plus sign, followed by one or more period-separated build metadata
	// identifiers.
	
	var BUILD = R++;
	src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
	             '(?:\\.' + src[BUILDIDENTIFIER] + ')*))';
	
	
	// ## Full Version String
	// A main version, followed optionally by a pre-release version and
	// build metadata.
	
	// Note that the only major, minor, patch, and pre-release sections of
	// the version string are capturing groups.  The build metadata is not a
	// capturing group, because it should not ever be used in version
	// comparison.
	
	var FULL = R++;
	var FULLPLAIN = 'v?' + src[MAINVERSION] +
	                src[PRERELEASE] + '?' +
	                src[BUILD] + '?';
	
	src[FULL] = '^' + FULLPLAIN + '$';
	
	// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
	// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
	// common in the npm registry.
	var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
	                 src[PRERELEASELOOSE] + '?' +
	                 src[BUILD] + '?';
	
	var LOOSE = R++;
	src[LOOSE] = '^' + LOOSEPLAIN + '$';
	
	var GTLT = R++;
	src[GTLT] = '((?:<|>)?=?)';
	
	// Something like "2.*" or "1.2.x".
	// Note that "x.x" is a valid xRange identifer, meaning "any version"
	// Only the first item is strictly required.
	var XRANGEIDENTIFIERLOOSE = R++;
	src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*';
	var XRANGEIDENTIFIER = R++;
	src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*';
	
	var XRANGEPLAIN = R++;
	src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
	                   '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
	                   '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
	                   '(?:' + src[PRERELEASE] + ')?' +
	                   src[BUILD] + '?' +
	                   ')?)?';
	
	var XRANGEPLAINLOOSE = R++;
	src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
	                        '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
	                        '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
	                        '(?:' + src[PRERELEASELOOSE] + ')?' +
	                        src[BUILD] + '?' +
	                        ')?)?';
	
	var XRANGE = R++;
	src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$';
	var XRANGELOOSE = R++;
	src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$';
	
	// Tilde ranges.
	// Meaning is "reasonably at or greater than"
	var LONETILDE = R++;
	src[LONETILDE] = '(?:~>?)';
	
	var TILDETRIM = R++;
	src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+';
	re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');
	var tildeTrimReplace = '$1~';
	
	var TILDE = R++;
	src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
	var TILDELOOSE = R++;
	src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';
	
	// Caret ranges.
	// Meaning is "at least and backwards compatible with"
	var LONECARET = R++;
	src[LONECARET] = '(?:\\^)';
	
	var CARETTRIM = R++;
	src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+';
	re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');
	var caretTrimReplace = '$1^';
	
	var CARET = R++;
	src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';
	var CARETLOOSE = R++;
	src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';
	
	// A simple gt/lt/eq thing, or just "" to indicate "any version"
	var COMPARATORLOOSE = R++;
	src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$';
	var COMPARATOR = R++;
	src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$';
	
	
	// An expression to strip any whitespace between the gtlt and the thing
	// it modifies, so that `> 1.2.3` ==> `>1.2.3`
	var COMPARATORTRIM = R++;
	src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
	                      '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
	
	// this one has to use the /g flag
	re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
	var comparatorTrimReplace = '$1$2$3';
	
	
	// Something like `1.2.3 - 1.2.4`
	// Note that these all use the loose form, because they'll be
	// checked against either the strict or loose comparator form
	// later.
	var HYPHENRANGE = R++;
	src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
	                   '\\s+-\\s+' +
	                   '(' + src[XRANGEPLAIN] + ')' +
	                   '\\s*$';
	
	var HYPHENRANGELOOSE = R++;
	src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
	                        '\\s+-\\s+' +
	                        '(' + src[XRANGEPLAINLOOSE] + ')' +
	                        '\\s*$';
	
	// Star ranges basically just allow anything at all.
	var STAR = R++;
	src[STAR] = '(<|>)?=?\\s*\\*';
	
	// Compile to actual regexp objects.
	// All are flag-free, unless they were created above with a flag.
	for (var i = 0; i < R; i++) {
	  debug(i, src[i]);
	  if (!re[i])
	    re[i] = new RegExp(src[i]);
	}
	
	exports.parse = parse;
	function parse(version, loose) {
	  if (version instanceof SemVer)
	    return version;
	
	  if (typeof version !== 'string')
	    return null;
	
	  if (version.length > MAX_LENGTH)
	    return null;
	
	  var r = loose ? re[LOOSE] : re[FULL];
	  if (!r.test(version))
	    return null;
	
	  try {
	    return new SemVer(version, loose);
	  } catch (er) {
	    return null;
	  }
	}
	
	exports.valid = valid;
	function valid(version, loose) {
	  var v = parse(version, loose);
	  return v ? v.version : null;
	}
	
	
	exports.clean = clean;
	function clean(version, loose) {
	  var s = parse(version.trim().replace(/^[=v]+/, ''), loose);
	  return s ? s.version : null;
	}
	
	exports.SemVer = SemVer;
	
	function SemVer(version, loose) {
	  if (version instanceof SemVer) {
	    if (version.loose === loose)
	      return version;
	    else
	      version = version.version;
	  } else if (typeof version !== 'string') {
	    throw new TypeError('Invalid Version: ' + version);
	  }
	
	  if (version.length > MAX_LENGTH)
	    throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
	
	  if (!(this instanceof SemVer))
	    return new SemVer(version, loose);
	
	  debug('SemVer', version, loose);
	  this.loose = loose;
	  var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);
	
	  if (!m)
	    throw new TypeError('Invalid Version: ' + version);
	
	  this.raw = version;
	
	  // these are actually numbers
	  this.major = +m[1];
	  this.minor = +m[2];
	  this.patch = +m[3];
	
	  if (this.major > MAX_SAFE_INTEGER || this.major < 0)
	    throw new TypeError('Invalid major version')
	
	  if (this.minor > MAX_SAFE_INTEGER || this.minor < 0)
	    throw new TypeError('Invalid minor version')
	
	  if (this.patch > MAX_SAFE_INTEGER || this.patch < 0)
	    throw new TypeError('Invalid patch version')
	
	  // numberify any prerelease numeric ids
	  if (!m[4])
	    this.prerelease = [];
	  else
	    this.prerelease = m[4].split('.').map(function(id) {
	      if (/^[0-9]+$/.test(id)) {
	        var num = +id;
	        if (num >= 0 && num < MAX_SAFE_INTEGER)
	          return num;
	      }
	      return id;
	    });
	
	  this.build = m[5] ? m[5].split('.') : [];
	  this.format();
	}
	
	SemVer.prototype.format = function() {
	  this.version = this.major + '.' + this.minor + '.' + this.patch;
	  if (this.prerelease.length)
	    this.version += '-' + this.prerelease.join('.');
	  return this.version;
	};
	
	SemVer.prototype.toString = function() {
	  return this.version;
	};
	
	SemVer.prototype.compare = function(other) {
	  debug('SemVer.compare', this.version, this.loose, other);
	  if (!(other instanceof SemVer))
	    other = new SemVer(other, this.loose);
	
	  return this.compareMain(other) || this.comparePre(other);
	};
	
	SemVer.prototype.compareMain = function(other) {
	  if (!(other instanceof SemVer))
	    other = new SemVer(other, this.loose);
	
	  return compareIdentifiers(this.major, other.major) ||
	         compareIdentifiers(this.minor, other.minor) ||
	         compareIdentifiers(this.patch, other.patch);
	};
	
	SemVer.prototype.comparePre = function(other) {
	  if (!(other instanceof SemVer))
	    other = new SemVer(other, this.loose);
	
	  // NOT having a prerelease is > having one
	  if (this.prerelease.length && !other.prerelease.length)
	    return -1;
	  else if (!this.prerelease.length && other.prerelease.length)
	    return 1;
	  else if (!this.prerelease.length && !other.prerelease.length)
	    return 0;
	
	  var i = 0;
	  do {
	    var a = this.prerelease[i];
	    var b = other.prerelease[i];
	    debug('prerelease compare', i, a, b);
	    if (a === undefined && b === undefined)
	      return 0;
	    else if (b === undefined)
	      return 1;
	    else if (a === undefined)
	      return -1;
	    else if (a === b)
	      continue;
	    else
	      return compareIdentifiers(a, b);
	  } while (++i);
	};
	
	// preminor will bump the version up to the next minor release, and immediately
	// down to pre-release. premajor and prepatch work the same way.
	SemVer.prototype.inc = function(release, identifier) {
	  switch (release) {
	    case 'premajor':
	      this.prerelease.length = 0;
	      this.patch = 0;
	      this.minor = 0;
	      this.major++;
	      this.inc('pre', identifier);
	      break;
	    case 'preminor':
	      this.prerelease.length = 0;
	      this.patch = 0;
	      this.minor++;
	      this.inc('pre', identifier);
	      break;
	    case 'prepatch':
	      // If this is already a prerelease, it will bump to the next version
	      // drop any prereleases that might already exist, since they are not
	      // relevant at this point.
	      this.prerelease.length = 0;
	      this.inc('patch', identifier);
	      this.inc('pre', identifier);
	      break;
	    // If the input is a non-prerelease version, this acts the same as
	    // prepatch.
	    case 'prerelease':
	      if (this.prerelease.length === 0)
	        this.inc('patch', identifier);
	      this.inc('pre', identifier);
	      break;
	
	    case 'major':
	      // If this is a pre-major version, bump up to the same major version.
	      // Otherwise increment major.
	      // 1.0.0-5 bumps to 1.0.0
	      // 1.1.0 bumps to 2.0.0
	      if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0)
	        this.major++;
	      this.minor = 0;
	      this.patch = 0;
	      this.prerelease = [];
	      break;
	    case 'minor':
	      // If this is a pre-minor version, bump up to the same minor version.
	      // Otherwise increment minor.
	      // 1.2.0-5 bumps to 1.2.0
	      // 1.2.1 bumps to 1.3.0
	      if (this.patch !== 0 || this.prerelease.length === 0)
	        this.minor++;
	      this.patch = 0;
	      this.prerelease = [];
	      break;
	    case 'patch':
	      // If this is not a pre-release version, it will increment the patch.
	      // If it is a pre-release it will bump up to the same patch version.
	      // 1.2.0-5 patches to 1.2.0
	      // 1.2.0 patches to 1.2.1
	      if (this.prerelease.length === 0)
	        this.patch++;
	      this.prerelease = [];
	      break;
	    // This probably shouldn't be used publicly.
	    // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
	    case 'pre':
	      if (this.prerelease.length === 0)
	        this.prerelease = [0];
	      else {
	        var i = this.prerelease.length;
	        while (--i >= 0) {
	          if (typeof this.prerelease[i] === 'number') {
	            this.prerelease[i]++;
	            i = -2;
	          }
	        }
	        if (i === -1) // didn't increment anything
	          this.prerelease.push(0);
	      }
	      if (identifier) {
	        // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
	        // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
	        if (this.prerelease[0] === identifier) {
	          if (isNaN(this.prerelease[1]))
	            this.prerelease = [identifier, 0];
	        } else
	          this.prerelease = [identifier, 0];
	      }
	      break;
	
	    default:
	      throw new Error('invalid increment argument: ' + release);
	  }
	  this.format();
	  this.raw = this.version;
	  return this;
	};
	
	exports.inc = inc;
	function inc(version, release, loose, identifier) {
	  if (typeof(loose) === 'string') {
	    identifier = loose;
	    loose = undefined;
	  }
	
	  try {
	    return new SemVer(version, loose).inc(release, identifier).version;
	  } catch (er) {
	    return null;
	  }
	}
	
	exports.diff = diff;
	function diff(version1, version2) {
	  if (eq(version1, version2)) {
	    return null;
	  } else {
	    var v1 = parse(version1);
	    var v2 = parse(version2);
	    if (v1.prerelease.length || v2.prerelease.length) {
	      for (var key in v1) {
	        if (key === 'major' || key === 'minor' || key === 'patch') {
	          if (v1[key] !== v2[key]) {
	            return 'pre'+key;
	          }
	        }
	      }
	      return 'prerelease';
	    }
	    for (var key in v1) {
	      if (key === 'major' || key === 'minor' || key === 'patch') {
	        if (v1[key] !== v2[key]) {
	          return key;
	        }
	      }
	    }
	  }
	}
	
	exports.compareIdentifiers = compareIdentifiers;
	
	var numeric = /^[0-9]+$/;
	function compareIdentifiers(a, b) {
	  var anum = numeric.test(a);
	  var bnum = numeric.test(b);
	
	  if (anum && bnum) {
	    a = +a;
	    b = +b;
	  }
	
	  return (anum && !bnum) ? -1 :
	         (bnum && !anum) ? 1 :
	         a < b ? -1 :
	         a > b ? 1 :
	         0;
	}
	
	exports.rcompareIdentifiers = rcompareIdentifiers;
	function rcompareIdentifiers(a, b) {
	  return compareIdentifiers(b, a);
	}
	
	exports.major = major;
	function major(a, loose) {
	  return new SemVer(a, loose).major;
	}
	
	exports.minor = minor;
	function minor(a, loose) {
	  return new SemVer(a, loose).minor;
	}
	
	exports.patch = patch;
	function patch(a, loose) {
	  return new SemVer(a, loose).patch;
	}
	
	exports.compare = compare;
	function compare(a, b, loose) {
	  return new SemVer(a, loose).compare(b);
	}
	
	exports.compareLoose = compareLoose;
	function compareLoose(a, b) {
	  return compare(a, b, true);
	}
	
	exports.rcompare = rcompare;
	function rcompare(a, b, loose) {
	  return compare(b, a, loose);
	}
	
	exports.sort = sort;
	function sort(list, loose) {
	  return list.sort(function(a, b) {
	    return exports.compare(a, b, loose);
	  });
	}
	
	exports.rsort = rsort;
	function rsort(list, loose) {
	  return list.sort(function(a, b) {
	    return exports.rcompare(a, b, loose);
	  });
	}
	
	exports.gt = gt;
	function gt(a, b, loose) {
	  return compare(a, b, loose) > 0;
	}
	
	exports.lt = lt;
	function lt(a, b, loose) {
	  return compare(a, b, loose) < 0;
	}
	
	exports.eq = eq;
	function eq(a, b, loose) {
	  return compare(a, b, loose) === 0;
	}
	
	exports.neq = neq;
	function neq(a, b, loose) {
	  return compare(a, b, loose) !== 0;
	}
	
	exports.gte = gte;
	function gte(a, b, loose) {
	  return compare(a, b, loose) >= 0;
	}
	
	exports.lte = lte;
	function lte(a, b, loose) {
	  return compare(a, b, loose) <= 0;
	}
	
	exports.cmp = cmp;
	function cmp(a, op, b, loose) {
	  var ret;
	  switch (op) {
	    case '===':
	      if (typeof a === 'object') a = a.version;
	      if (typeof b === 'object') b = b.version;
	      ret = a === b;
	      break;
	    case '!==':
	      if (typeof a === 'object') a = a.version;
	      if (typeof b === 'object') b = b.version;
	      ret = a !== b;
	      break;
	    case '': case '=': case '==': ret = eq(a, b, loose); break;
	    case '!=': ret = neq(a, b, loose); break;
	    case '>': ret = gt(a, b, loose); break;
	    case '>=': ret = gte(a, b, loose); break;
	    case '<': ret = lt(a, b, loose); break;
	    case '<=': ret = lte(a, b, loose); break;
	    default: throw new TypeError('Invalid operator: ' + op);
	  }
	  return ret;
	}
	
	exports.Comparator = Comparator;
	function Comparator(comp, loose) {
	  if (comp instanceof Comparator) {
	    if (comp.loose === loose)
	      return comp;
	    else
	      comp = comp.value;
	  }
	
	  if (!(this instanceof Comparator))
	    return new Comparator(comp, loose);
	
	  debug('comparator', comp, loose);
	  this.loose = loose;
	  this.parse(comp);
	
	  if (this.semver === ANY)
	    this.value = '';
	  else
	    this.value = this.operator + this.semver.version;
	
	  debug('comp', this);
	}
	
	var ANY = {};
	Comparator.prototype.parse = function(comp) {
	  var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
	  var m = comp.match(r);
	
	  if (!m)
	    throw new TypeError('Invalid comparator: ' + comp);
	
	  this.operator = m[1];
	  if (this.operator === '=')
	    this.operator = '';
	
	  // if it literally is just '>' or '' then allow anything.
	  if (!m[2])
	    this.semver = ANY;
	  else
	    this.semver = new SemVer(m[2], this.loose);
	};
	
	Comparator.prototype.toString = function() {
	  return this.value;
	};
	
	Comparator.prototype.test = function(version) {
	  debug('Comparator.test', version, this.loose);
	
	  if (this.semver === ANY)
	    return true;
	
	  if (typeof version === 'string')
	    version = new SemVer(version, this.loose);
	
	  return cmp(version, this.operator, this.semver, this.loose);
	};
	
	
	exports.Range = Range;
	function Range(range, loose) {
	  if ((range instanceof Range) && range.loose === loose)
	    return range;
	
	  if (!(this instanceof Range))
	    return new Range(range, loose);
	
	  this.loose = loose;
	
	  // First, split based on boolean or ||
	  this.raw = range;
	  this.set = range.split(/\s*\|\|\s*/).map(function(range) {
	    return this.parseRange(range.trim());
	  }, this).filter(function(c) {
	    // throw out any that are not relevant for whatever reason
	    return c.length;
	  });
	
	  if (!this.set.length) {
	    throw new TypeError('Invalid SemVer Range: ' + range);
	  }
	
	  this.format();
	}
	
	Range.prototype.format = function() {
	  this.range = this.set.map(function(comps) {
	    return comps.join(' ').trim();
	  }).join('||').trim();
	  return this.range;
	};
	
	Range.prototype.toString = function() {
	  return this.range;
	};
	
	Range.prototype.parseRange = function(range) {
	  var loose = this.loose;
	  range = range.trim();
	  debug('range', range, loose);
	  // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
	  var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];
	  range = range.replace(hr, hyphenReplace);
	  debug('hyphen replace', range);
	  // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
	  range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);
	  debug('comparator trim', range, re[COMPARATORTRIM]);
	
	  // `~ 1.2.3` => `~1.2.3`
	  range = range.replace(re[TILDETRIM], tildeTrimReplace);
	
	  // `^ 1.2.3` => `^1.2.3`
	  range = range.replace(re[CARETTRIM], caretTrimReplace);
	
	  // normalize spaces
	  range = range.split(/\s+/).join(' ');
	
	  // At this point, the range is completely trimmed and
	  // ready to be split into comparators.
	
	  var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
	  var set = range.split(' ').map(function(comp) {
	    return parseComparator(comp, loose);
	  }).join(' ').split(/\s+/);
	  if (this.loose) {
	    // in loose mode, throw out any that are not valid comparators
	    set = set.filter(function(comp) {
	      return !!comp.match(compRe);
	    });
	  }
	  set = set.map(function(comp) {
	    return new Comparator(comp, loose);
	  });
	
	  return set;
	};
	
	// Mostly just for testing and legacy API reasons
	exports.toComparators = toComparators;
	function toComparators(range, loose) {
	  return new Range(range, loose).set.map(function(comp) {
	    return comp.map(function(c) {
	      return c.value;
	    }).join(' ').trim().split(' ');
	  });
	}
	
	// comprised of xranges, tildes, stars, and gtlt's at this point.
	// already replaced the hyphen ranges
	// turn into a set of JUST comparators.
	function parseComparator(comp, loose) {
	  debug('comp', comp);
	  comp = replaceCarets(comp, loose);
	  debug('caret', comp);
	  comp = replaceTildes(comp, loose);
	  debug('tildes', comp);
	  comp = replaceXRanges(comp, loose);
	  debug('xrange', comp);
	  comp = replaceStars(comp, loose);
	  debug('stars', comp);
	  return comp;
	}
	
	function isX(id) {
	  return !id || id.toLowerCase() === 'x' || id === '*';
	}
	
	// ~, ~> --> * (any, kinda silly)
	// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
	// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
	// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
	// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
	// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
	function replaceTildes(comp, loose) {
	  return comp.trim().split(/\s+/).map(function(comp) {
	    return replaceTilde(comp, loose);
	  }).join(' ');
	}
	
	function replaceTilde(comp, loose) {
	  var r = loose ? re[TILDELOOSE] : re[TILDE];
	  return comp.replace(r, function(_, M, m, p, pr) {
	    debug('tilde', comp, _, M, m, p, pr);
	    var ret;
	
	    if (isX(M))
	      ret = '';
	    else if (isX(m))
	      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
	    else if (isX(p))
	      // ~1.2 == >=1.2.0 <1.3.0
	      ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
	    else if (pr) {
	      debug('replaceTilde pr', pr);
	      if (pr.charAt(0) !== '-')
	        pr = '-' + pr;
	      ret = '>=' + M + '.' + m + '.' + p + pr +
	            ' <' + M + '.' + (+m + 1) + '.0';
	    } else
	      // ~1.2.3 == >=1.2.3 <1.3.0
	      ret = '>=' + M + '.' + m + '.' + p +
	            ' <' + M + '.' + (+m + 1) + '.0';
	
	    debug('tilde return', ret);
	    return ret;
	  });
	}
	
	// ^ --> * (any, kinda silly)
	// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
	// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
	// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
	// ^1.2.3 --> >=1.2.3 <2.0.0
	// ^1.2.0 --> >=1.2.0 <2.0.0
	function replaceCarets(comp, loose) {
	  return comp.trim().split(/\s+/).map(function(comp) {
	    return replaceCaret(comp, loose);
	  }).join(' ');
	}
	
	function replaceCaret(comp, loose) {
	  debug('caret', comp, loose);
	  var r = loose ? re[CARETLOOSE] : re[CARET];
	  return comp.replace(r, function(_, M, m, p, pr) {
	    debug('caret', comp, _, M, m, p, pr);
	    var ret;
	
	    if (isX(M))
	      ret = '';
	    else if (isX(m))
	      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
	    else if (isX(p)) {
	      if (M === '0')
	        ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
	      else
	        ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0';
	    } else if (pr) {
	      debug('replaceCaret pr', pr);
	      if (pr.charAt(0) !== '-')
	        pr = '-' + pr;
	      if (M === '0') {
	        if (m === '0')
	          ret = '>=' + M + '.' + m + '.' + p + pr +
	                ' <' + M + '.' + m + '.' + (+p + 1);
	        else
	          ret = '>=' + M + '.' + m + '.' + p + pr +
	                ' <' + M + '.' + (+m + 1) + '.0';
	      } else
	        ret = '>=' + M + '.' + m + '.' + p + pr +
	              ' <' + (+M + 1) + '.0.0';
	    } else {
	      debug('no pr');
	      if (M === '0') {
	        if (m === '0')
	          ret = '>=' + M + '.' + m + '.' + p +
	                ' <' + M + '.' + m + '.' + (+p + 1);
	        else
	          ret = '>=' + M + '.' + m + '.' + p +
	                ' <' + M + '.' + (+m + 1) + '.0';
	      } else
	        ret = '>=' + M + '.' + m + '.' + p +
	              ' <' + (+M + 1) + '.0.0';
	    }
	
	    debug('caret return', ret);
	    return ret;
	  });
	}
	
	function replaceXRanges(comp, loose) {
	  debug('replaceXRanges', comp, loose);
	  return comp.split(/\s+/).map(function(comp) {
	    return replaceXRange(comp, loose);
	  }).join(' ');
	}
	
	function replaceXRange(comp, loose) {
	  comp = comp.trim();
	  var r = loose ? re[XRANGELOOSE] : re[XRANGE];
	  return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
	    debug('xRange', comp, ret, gtlt, M, m, p, pr);
	    var xM = isX(M);
	    var xm = xM || isX(m);
	    var xp = xm || isX(p);
	    var anyX = xp;
	
	    if (gtlt === '=' && anyX)
	      gtlt = '';
	
	    if (xM) {
	      if (gtlt === '>' || gtlt === '<') {
	        // nothing is allowed
	        ret = '<0.0.0';
	      } else {
	        // nothing is forbidden
	        ret = '*';
	      }
	    } else if (gtlt && anyX) {
	      // replace X with 0
	      if (xm)
	        m = 0;
	      if (xp)
	        p = 0;
	
	      if (gtlt === '>') {
	        // >1 => >=2.0.0
	        // >1.2 => >=1.3.0
	        // >1.2.3 => >= 1.2.4
	        gtlt = '>=';
	        if (xm) {
	          M = +M + 1;
	          m = 0;
	          p = 0;
	        } else if (xp) {
	          m = +m + 1;
	          p = 0;
	        }
	      } else if (gtlt === '<=') {
	        // <=0.7.x is actually <0.8.0, since any 0.7.x should
	        // pass.  Similarly, <=7.x is actually <8.0.0, etc.
	        gtlt = '<';
	        if (xm)
	          M = +M + 1;
	        else
	          m = +m + 1;
	      }
	
	      ret = gtlt + M + '.' + m + '.' + p;
	    } else if (xm) {
	      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
	    } else if (xp) {
	      ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
	    }
	
	    debug('xRange return', ret);
	
	    return ret;
	  });
	}
	
	// Because * is AND-ed with everything else in the comparator,
	// and '' means "any version", just remove the *s entirely.
	function replaceStars(comp, loose) {
	  debug('replaceStars', comp, loose);
	  // Looseness is ignored here.  star is always as loose as it gets!
	  return comp.trim().replace(re[STAR], '');
	}
	
	// This function is passed to string.replace(re[HYPHENRANGE])
	// M, m, patch, prerelease, build
	// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
	// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
	// 1.2 - 3.4 => >=1.2.0 <3.5.0
	function hyphenReplace($0,
	                       from, fM, fm, fp, fpr, fb,
	                       to, tM, tm, tp, tpr, tb) {
	
	  if (isX(fM))
	    from = '';
	  else if (isX(fm))
	    from = '>=' + fM + '.0.0';
	  else if (isX(fp))
	    from = '>=' + fM + '.' + fm + '.0';
	  else
	    from = '>=' + from;
	
	  if (isX(tM))
	    to = '';
	  else if (isX(tm))
	    to = '<' + (+tM + 1) + '.0.0';
	  else if (isX(tp))
	    to = '<' + tM + '.' + (+tm + 1) + '.0';
	  else if (tpr)
	    to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;
	  else
	    to = '<=' + to;
	
	  return (from + ' ' + to).trim();
	}
	
	
	// if ANY of the sets match ALL of its comparators, then pass
	Range.prototype.test = function(version) {
	  if (!version)
	    return false;
	
	  if (typeof version === 'string')
	    version = new SemVer(version, this.loose);
	
	  for (var i = 0; i < this.set.length; i++) {
	    if (testSet(this.set[i], version))
	      return true;
	  }
	  return false;
	};
	
	function testSet(set, version) {
	  for (var i = 0; i < set.length; i++) {
	    if (!set[i].test(version))
	      return false;
	  }
	
	  if (version.prerelease.length) {
	    // Find the set of versions that are allowed to have prereleases
	    // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
	    // That should allow `1.2.3-pr.2` to pass.
	    // However, `1.2.4-alpha.notready` should NOT be allowed,
	    // even though it's within the range set by the comparators.
	    for (var i = 0; i < set.length; i++) {
	      debug(set[i].semver);
	      if (set[i].semver === ANY)
	        continue;
	
	      if (set[i].semver.prerelease.length > 0) {
	        var allowed = set[i].semver;
	        if (allowed.major === version.major &&
	            allowed.minor === version.minor &&
	            allowed.patch === version.patch)
	          return true;
	      }
	    }
	
	    // Version has a -pre, but it's not one of the ones we like.
	    return false;
	  }
	
	  return true;
	}
	
	exports.satisfies = satisfies;
	function satisfies(version, range, loose) {
	  try {
	    range = new Range(range, loose);
	  } catch (er) {
	    return false;
	  }
	  return range.test(version);
	}
	
	exports.maxSatisfying = maxSatisfying;
	function maxSatisfying(versions, range, loose) {
	  return versions.filter(function(version) {
	    return satisfies(version, range, loose);
	  }).sort(function(a, b) {
	    return rcompare(a, b, loose);
	  })[0] || null;
	}
	
	exports.minSatisfying = minSatisfying;
	function minSatisfying(versions, range, loose) {
	  return versions.filter(function(version) {
	    return satisfies(version, range, loose);
	  }).sort(function(a, b) {
	    return compare(a, b, loose);
	  })[0] || null;
	}
	
	exports.validRange = validRange;
	function validRange(range, loose) {
	  try {
	    // Return '*' instead of '' so that truthiness works.
	    // This will throw if it's invalid anyway
	    return new Range(range, loose).range || '*';
	  } catch (er) {
	    return null;
	  }
	}
	
	// Determine if version is less than all the versions possible in the range
	exports.ltr = ltr;
	function ltr(version, range, loose) {
	  return outside(version, range, '<', loose);
	}
	
	// Determine if version is greater than all the versions possible in the range.
	exports.gtr = gtr;
	function gtr(version, range, loose) {
	  return outside(version, range, '>', loose);
	}
	
	exports.outside = outside;
	function outside(version, range, hilo, loose) {
	  version = new SemVer(version, loose);
	  range = new Range(range, loose);
	
	  var gtfn, ltefn, ltfn, comp, ecomp;
	  switch (hilo) {
	    case '>':
	      gtfn = gt;
	      ltefn = lte;
	      ltfn = lt;
	      comp = '>';
	      ecomp = '>=';
	      break;
	    case '<':
	      gtfn = lt;
	      ltefn = gte;
	      ltfn = gt;
	      comp = '<';
	      ecomp = '<=';
	      break;
	    default:
	      throw new TypeError('Must provide a hilo val of "<" or ">"');
	  }
	
	  // If it satisifes the range it is not outside
	  if (satisfies(version, range, loose)) {
	    return false;
	  }
	
	  // From now on, variable terms are as if we're in "gtr" mode.
	  // but note that everything is flipped for the "ltr" function.
	
	  for (var i = 0; i < range.set.length; ++i) {
	    var comparators = range.set[i];
	
	    var high = null;
	    var low = null;
	
	    comparators.forEach(function(comparator) {
	      if (comparator.semver === ANY) {
	        comparator = new Comparator('>=0.0.0')
	      }
	      high = high || comparator;
	      low = low || comparator;
	      if (gtfn(comparator.semver, high.semver, loose)) {
	        high = comparator;
	      } else if (ltfn(comparator.semver, low.semver, loose)) {
	        low = comparator;
	      }
	    });
	
	    // If the edge version comparator has a operator then our version
	    // isn't outside it
	    if (high.operator === comp || high.operator === ecomp) {
	      return false;
	    }
	
	    // If the lowest version comparator has an operator and our version
	    // is less than it then it isn't higher than the range
	    if ((!low.operator || low.operator === comp) &&
	        ltefn(version, low.semver)) {
	      return false;
	    } else if (low.operator === ecomp && ltfn(version, low.semver)) {
	      return false;
	    }
	  }
	  return true;
	}
	
	exports.prerelease = prerelease;
	function prerelease(version, loose) {
	  var parsed = parse(version, loose);
	  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null;
	}
	
	/* WEBPACK VAR INJECTION */}.call(exports, __jupyter_require__('process@0.11.9/browser.js')))
})
/** END DEFINE BLOCK for semver@5.3.0/semver.js **/


/** START DEFINE BLOCK for process@0.11.9/browser.js **/
jupyter.define('process@0.11.9/browser.js', function (module, exports, __jupyter_require__) {
	// shim for using process in browser
	var process = module.exports = {};
	
	// cached from whatever global is present so that test runners that stub it
	// don't break things.  But we need to wrap it in a try catch in case it is
	// wrapped in strict mode code which doesn't define any globals.  It's inside a
	// function because try/catches deoptimize in certain engines.
	
	var cachedSetTimeout;
	var cachedClearTimeout;
	
	function defaultSetTimout() {
	    throw new Error('setTimeout has not been defined');
	}
	function defaultClearTimeout () {
	    throw new Error('clearTimeout has not been defined');
	}
	(function () {
	    try {
	        if (typeof setTimeout === 'function') {
	            cachedSetTimeout = setTimeout;
	        } else {
	            cachedSetTimeout = defaultSetTimout;
	        }
	    } catch (e) {
	        cachedSetTimeout = defaultSetTimout;
	    }
	    try {
	        if (typeof clearTimeout === 'function') {
	            cachedClearTimeout = clearTimeout;
	        } else {
	            cachedClearTimeout = defaultClearTimeout;
	        }
	    } catch (e) {
	        cachedClearTimeout = defaultClearTimeout;
	    }
	} ())
	function runTimeout(fun) {
	    if (cachedSetTimeout === setTimeout) {
	        //normal enviroments in sane situations
	        return setTimeout(fun, 0);
	    }
	    // if setTimeout wasn't available but was latter defined
	    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
	        cachedSetTimeout = setTimeout;
	        return setTimeout(fun, 0);
	    }
	    try {
	        // when when somebody has screwed with setTimeout but no I.E. maddness
	        return cachedSetTimeout(fun, 0);
	    } catch(e){
	        try {
	            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
	            return cachedSetTimeout.call(null, fun, 0);
	        } catch(e){
	            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
	            return cachedSetTimeout.call(this, fun, 0);
	        }
	    }
	
	
	}
	function runClearTimeout(marker) {
	    if (cachedClearTimeout === clearTimeout) {
	        //normal enviroments in sane situations
	        return clearTimeout(marker);
	    }
	    // if clearTimeout wasn't available but was latter defined
	    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
	        cachedClearTimeout = clearTimeout;
	        return clearTimeout(marker);
	    }
	    try {
	        // when when somebody has screwed with setTimeout but no I.E. maddness
	        return cachedClearTimeout(marker);
	    } catch (e){
	        try {
	            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
	            return cachedClearTimeout.call(null, marker);
	        } catch (e){
	            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
	            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
	            return cachedClearTimeout.call(this, marker);
	        }
	    }
	
	
	
	}
	var queue = [];
	var draining = false;
	var currentQueue;
	var queueIndex = -1;
	
	function cleanUpNextTick() {
	    if (!draining || !currentQueue) {
	        return;
	    }
	    draining = false;
	    if (currentQueue.length) {
	        queue = currentQueue.concat(queue);
	    } else {
	        queueIndex = -1;
	    }
	    if (queue.length) {
	        drainQueue();
	    }
	}
	
	function drainQueue() {
	    if (draining) {
	        return;
	    }
	    var timeout = runTimeout(cleanUpNextTick);
	    draining = true;
	
	    var len = queue.length;
	    while(len) {
	        currentQueue = queue;
	        queue = [];
	        while (++queueIndex < len) {
	            if (currentQueue) {
	                currentQueue[queueIndex].run();
	            }
	        }
	        queueIndex = -1;
	        len = queue.length;
	    }
	    currentQueue = null;
	    draining = false;
	    runClearTimeout(timeout);
	}
	
	process.nextTick = function (fun) {
	    var args = new Array(arguments.length - 1);
	    if (arguments.length > 1) {
	        for (var i = 1; i < arguments.length; i++) {
	            args[i - 1] = arguments[i];
	        }
	    }
	    queue.push(new Item(fun, args));
	    if (queue.length === 1 && !draining) {
	        runTimeout(drainQueue);
	    }
	};
	
	// v8 likes predictible objects
	function Item(fun, array) {
	    this.fun = fun;
	    this.array = array;
	}
	Item.prototype.run = function () {
	    this.fun.apply(null, this.array);
	};
	process.title = 'browser';
	process.browser = true;
	process.env = {};
	process.argv = [];
	process.version = ''; // empty string to avoid regexp issues
	process.versions = {};
	
	function noop() {}
	
	process.on = noop;
	process.addListener = noop;
	process.once = noop;
	process.off = noop;
	process.removeListener = noop;
	process.removeAllListeners = noop;
	process.emit = noop;
	
	process.binding = function (name) {
	    throw new Error('process.binding is not supported');
	};
	
	process.cwd = function () { return '/' };
	process.chdir = function (dir) {
	    throw new Error('process.chdir is not supported');
	};
	process.umask = function() { return 0; };
	
})
/** END DEFINE BLOCK for process@0.11.9/browser.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_string.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_string.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var StringModel = (function (_super) {
	    __extends(StringModel, _super);
	    function StringModel() {
	        _super.apply(this, arguments);
	    }
	    StringModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            value: '',
	            disabled: false,
	            placeholder: '\u200b',
	            _model_name: 'StringModel'
	        });
	    };
	    return StringModel;
	}(widget_core_1.CoreLabeledDOMWidgetModel));
	exports.StringModel = StringModel;
	var HTMLModel = (function (_super) {
	    __extends(HTMLModel, _super);
	    function HTMLModel() {
	        _super.apply(this, arguments);
	    }
	    HTMLModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'HTMLView',
	            _model_name: 'HTMLModel'
	        });
	    };
	    return HTMLModel;
	}(StringModel));
	exports.HTMLModel = HTMLModel;
	var HTMLView = (function (_super) {
	    __extends(HTMLView, _super);
	    function HTMLView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    HTMLView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-html');
	        this.content = document.createElement('div');
	        this.content.classList.add('widget-html-content');
	        this.el.appendChild(this.content);
	        this.update(); // Set defaults.
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed.  The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    HTMLView.prototype.update = function () {
	        this.content.innerHTML = this.model.get('value');
	        return _super.prototype.update.call(this);
	    };
	    return HTMLView;
	}(widget_1.LabeledDOMWidgetView));
	exports.HTMLView = HTMLView;
	var HTMLMathModel = (function (_super) {
	    __extends(HTMLMathModel, _super);
	    function HTMLMathModel() {
	        _super.apply(this, arguments);
	    }
	    HTMLMathModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'HTMLMathView',
	            _model_name: 'HTMLMathModel'
	        });
	    };
	    return HTMLMathModel;
	}(StringModel));
	exports.HTMLMathModel = HTMLMathModel;
	var HTMLMathView = (function (_super) {
	    __extends(HTMLMathView, _super);
	    function HTMLMathView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    HTMLMathView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-htmlmath');
	        this.content = document.createElement('div');
	        this.content.classList.add('widget-htmlmath-content');
	        this.el.appendChild(this.content);
	        this.update(); // Set defaults.
	    };
	    /**
	     * Update the contents of this view
	     */
	    HTMLMathView.prototype.update = function () {
	        this.content.innerHTML = this.model.get('value');
	        this.typeset(this.content);
	        return _super.prototype.update.call(this);
	    };
	    return HTMLMathView;
	}(widget_1.LabeledDOMWidgetView));
	exports.HTMLMathView = HTMLMathView;
	var LabelModel = (function (_super) {
	    __extends(LabelModel, _super);
	    function LabelModel() {
	        _super.apply(this, arguments);
	    }
	    LabelModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'LabelView',
	            _model_name: 'LabelModel'
	        });
	    };
	    return LabelModel;
	}(StringModel));
	exports.LabelModel = LabelModel;
	var LabelView = (function (_super) {
	    __extends(LabelView, _super);
	    function LabelView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    LabelView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-label');
	        this.update(); // Set defaults.
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed.  The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    LabelView.prototype.update = function () {
	        this.typeset(this.el, this.model.get('value'));
	        return _super.prototype.update.call(this);
	    };
	    return LabelView;
	}(widget_1.LabeledDOMWidgetView));
	exports.LabelView = LabelView;
	var TextareaModel = (function (_super) {
	    __extends(TextareaModel, _super);
	    function TextareaModel() {
	        _super.apply(this, arguments);
	    }
	    TextareaModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'TextareaView',
	            _model_name: 'TextareaModel',
	            rows: null
	        });
	    };
	    return TextareaModel;
	}(StringModel));
	exports.TextareaModel = TextareaModel;
	var TextareaView = (function (_super) {
	    __extends(TextareaView, _super);
	    function TextareaView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    TextareaView.prototype.render = function () {
	        var _this = this;
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-textarea');
	        this.textbox = document.createElement('textarea');
	        this.textbox.setAttribute('rows', '5');
	        this.el.appendChild(this.textbox);
	        this.update(); // Set defaults.
	        this.listenTo(this.model, 'msg:custom', function (content) {
	            _this._handle_textarea_msg(content);
	        });
	        this.listenTo(this.model, 'change:placeholder', function (model, value, options) {
	            this.update_placeholder(value);
	        });
	        this.update_placeholder();
	    };
	    /**
	     * Handle when a custom msg is recieved from the back-end.
	     */
	    TextareaView.prototype._handle_textarea_msg = function (content) {
	        if (content.method == 'scroll_to_bottom') {
	            this.scroll_to_bottom();
	        }
	    };
	    TextareaView.prototype.update_placeholder = function (value) {
	        value = value || this.model.get('placeholder');
	        this.textbox.setAttribute('placeholder', value.toString());
	    };
	    /**
	     * Scroll the text-area view to the bottom.
	     */
	    TextareaView.prototype.scroll_to_bottom = function () {
	        //this.$textbox.scrollTop(this.$textbox[0].scrollHeight); // DW TODO
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed.  The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    TextareaView.prototype.update = function (options) {
	        if (options === undefined || options.updated_view != this) {
	            this.textbox.value = this.model.get('value');
	            this.textbox.rows = this.model.get('rows');
	            var disabled = this.model.get('disabled');
	            this.textbox.disabled = disabled;
	        }
	        return _super.prototype.update.call(this);
	    };
	    TextareaView.prototype.events = function () {
	        return {
	            // Dictionary of events and their handlers.
	            'keydown textarea': 'handleKeyDown',
	            'keypress textarea': 'handleKeypress',
	            'keyup textarea': 'handleChanging',
	            'paste textarea': 'handleChanging',
	            'cut textarea': 'handleChanging'
	        };
	    };
	    /**
	     * Handle key down
	     *
	     * Stop propagation so the event isn't sent to the application.
	     */
	    TextareaView.prototype.handleKeyDown = function (e) {
	        e.stopPropagation();
	    };
	    /**
	     * Handles key press
	     *
	     * Stop propagation so the keypress isn't sent to the application.
	     */
	    TextareaView.prototype.handleKeypress = function (e) {
	        e.stopPropagation();
	    };
	    /**
	     * Handles and validates user input.
	     *
	     * Calling model.set will trigger all of the other views of the
	     * model to update.
	     */
	    TextareaView.prototype.handleChanging = function (e) {
	        this.model.set('value', e.target.value, { updated_view: this });
	        this.touch();
	    };
	    return TextareaView;
	}(widget_1.LabeledDOMWidgetView));
	exports.TextareaView = TextareaView;
	var TextModel = (function (_super) {
	    __extends(TextModel, _super);
	    function TextModel() {
	        _super.apply(this, arguments);
	    }
	    TextModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'TextView',
	            _model_name: 'TextModel'
	        });
	    };
	    return TextModel;
	}(StringModel));
	exports.TextModel = TextModel;
	var TextView = (function (_super) {
	    __extends(TextView, _super);
	    function TextView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    TextView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-text');
	        this.textbox = document.createElement('input');
	        this.textbox.setAttribute('type', 'text');
	        this.el.appendChild(this.textbox);
	        this.update(); // Set defaults.
	        this.listenTo(this.model, 'change:placeholder', function (model, value, options) {
	            this.update_placeholder(value);
	        });
	        this.update_placeholder();
	    };
	    TextView.prototype.update_placeholder = function (value) {
	        if (!value) {
	            value = this.model.get('placeholder');
	        }
	        this.textbox.setAttribute('placeholder', value);
	    };
	    TextView.prototype.update = function (options) {
	        /**
	         * Update the contents of this view
	         *
	         * Called when the model is changed.  The model may have been
	         * changed by another view or by a state update from the back-end.
	         */
	        if (options === undefined || options.updated_view != this) {
	            if (this.textbox.value != this.model.get('value')) {
	                this.textbox.value = this.model.get('value');
	            }
	            var disabled = this.model.get('disabled');
	            this.textbox.disabled = disabled;
	        }
	        return _super.prototype.update.call(this);
	    };
	    TextView.prototype.events = function () {
	        return {
	            // Dictionary of events and their handlers.
	            'keydown input': 'handleKeyDown',
	            'keypress input': 'handleKeypress',
	            'keyup input': 'handleChanging',
	            'paste input': 'handleChanging',
	            'cut input': 'handleChanging',
	            'blur input': 'handleBlur',
	            'focusout input': 'handleFocusOut'
	        };
	    };
	    /**
	     * Handle key down
	     *
	     * Stop propagation so the keypress isn't sent to the application.
	     */
	    TextView.prototype.handleKeyDown = function (e) {
	        e.stopPropagation();
	    };
	    /**
	     * Handles text submission
	     */
	    TextView.prototype.handleKeypress = function (e) {
	        e.stopPropagation();
	        if (e.keyCode == 13) {
	            this.send({ event: 'submit' });
	            e.preventDefault();
	        }
	    };
	    /**
	     * Handles user input.
	     *
	     * Calling model.set will trigger all of the other views of the
	     * model to update.
	     */
	    TextView.prototype.handleChanging = function (e) {
	        e.stopPropagation();
	        this.model.set('value', e.target.value, { updated_view: this });
	        this.touch();
	    };
	    /**
	     * Prevent a blur from firing if the blur was not user intended.
	     * This is a workaround for the return-key focus loss bug.
	     * TODO: Is the original bug actually a fault of the keyboard
	     * manager?
	     */
	    TextView.prototype.handleBlur = function (e) {
	        if (e.relatedTarget === null) {
	            e.stopPropagation();
	            e.preventDefault();
	        }
	    };
	    /**
	     * Prevent a blur from firing if the blur was not user intended.
	     * This is a workaround for the return-key focus loss bug.
	     */
	    TextView.prototype.handleFocusOut = function (e) {
	        if (e.relatedTarget === null) {
	            e.stopPropagation();
	            e.preventDefault();
	        }
	    };
	    return TextView;
	}(widget_1.LabeledDOMWidgetView));
	exports.TextView = TextView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_string.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var Backbone = __jupyter_require__('backbone@1.2.0/backbone.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var utils = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/utils.js');
	var $ = __jupyter_require__('jquery@^3.1.1/dist/jquery.js');
	var nativeview_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/nativeview.js');
	var widget_1 = __jupyter_require__('phosphor@^0.7.0/lib/ui/widget.js');
	var messaging_1 = __jupyter_require__('phosphor@^0.7.0/lib/core/messaging.js');
	var widget_2 = __jupyter_require__('phosphor@^0.7.0/lib/ui/widget.js');
	/**
	 * Replace model ids with models recursively.
	 */
	function unpack_models(value, manager) {
	    var unpacked;
	    if (_.isArray(value)) {
	        unpacked = [];
	        _.each(value, function (sub_value, key) {
	            unpacked.push(unpack_models(sub_value, manager));
	        });
	        return Promise.all(unpacked);
	    }
	    else if (value instanceof Object) {
	        unpacked = {};
	        _.each(value, function (sub_value, key) {
	            unpacked[key] = unpack_models(sub_value, manager);
	        });
	        return utils.resolvePromisesDict(unpacked);
	    }
	    else if (typeof value === 'string' && value.slice(0, 10) === 'IPY_MODEL_') {
	        // get_model returns a promise already
	        return manager.get_model(value.slice(10, value.length));
	    }
	    else {
	        return Promise.resolve(value);
	    }
	}
	exports.unpack_models = unpack_models;
	;
	var WidgetModel = (function (_super) {
	    __extends(WidgetModel, _super);
	    function WidgetModel() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * The default attributes.
	     */
	    WidgetModel.prototype.defaults = function () {
	        return {
	            _model_module: "jupyter-js-widgets",
	            _model_name: "WidgetModel",
	            _model_module_version: "*",
	            _view_module: "jupyter-js-widgets",
	            _view_name: null,
	            _view_module_version: "*",
	            msg_throttle: 1,
	        };
	    };
	    /**
	     * Test to see if the model has been synced with the server.
	     *
	     * #### Notes
	     * As of backbone 1.1, backbone ignores `patch` if it thinks the
	     * model has never been pushed.
	     */
	    WidgetModel.prototype.isNew = function () {
	        return false;
	    };
	    /**
	     * Constructor
	     *
	     * Creates a WidgetModel instance.
	     *
	     * Parameters
	     * ----------
	     * widget_manager : WidgetManager instance
	     * model_id : string
	     *      An ID unique to this model.
	     * comm : Comm instance (optional)
	     */
	    WidgetModel.prototype.initialize = function (attributes, options) {
	        _super.prototype.initialize.call(this, attributes, options);
	        this.widget_manager = options.widget_manager;
	        this.id = options.model_id;
	        var comm = options.comm;
	        this.state_change = Promise.resolve();
	        this.pending_msgs = 0;
	        this.msg_buffer = null;
	        this.state_lock = null;
	        this._buffered_state_diff = {};
	        this.views = {};
	        if (comm) {
	            // Remember comm associated with the model.
	            this.comm = comm;
	            comm.model = this;
	            // Hook comm messages up to model.
	            comm.on_close(_.bind(this._handle_comm_closed, this));
	            comm.on_msg(_.bind(this._handle_comm_msg, this));
	            this.comm_live = true;
	        }
	        else {
	            this.comm_live = false;
	        }
	    };
	    /**
	     * Send a custom msg over the comm.
	     */
	    WidgetModel.prototype.send = function (content, callbacks, buffers) {
	        if (this.comm !== undefined) {
	            var data = { method: 'custom', content: content };
	            this.comm.send(data, callbacks, {}, buffers);
	            this.pending_msgs++;
	        }
	    };
	    /**
	     * Close model
	     */
	    WidgetModel.prototype.close = function (comm_closed) {
	        if (this.comm && !comm_closed) {
	            this.comm.close();
	        }
	        this.stopListening();
	        this.trigger('destroy', this);
	        if (this.comm) {
	            delete this.comm.model; // Delete ref so GC will collect widget model.
	            delete this.comm;
	        }
	        delete this.model_id; // Delete id from model so widget manager cleans up.
	        _.each(this.views, function (v, id, views) {
	            v.then(function (view) {
	                view.remove();
	                delete views[id];
	            });
	        });
	    };
	    /**
	     * Handle when a widget is closed.
	     */
	    WidgetModel.prototype._handle_comm_closed = function (msg) {
	        this.trigger('comm:close');
	        this.close(true);
	    };
	    /**
	     * Handle incoming comm msg.
	     */
	    WidgetModel.prototype._handle_comm_msg = function (msg) {
	        var _this = this;
	        var method = msg.content.data.method;
	        switch (method) {
	            case 'update':
	                this.state_change = this.state_change
	                    .then(function () {
	                    var state = msg.content.data.state || {};
	                    var buffer_keys = msg.content.data.buffers || [];
	                    var buffers = msg.buffers || [];
	                    for (var i = 0; i < buffer_keys.length; i++) {
	                        state[buffer_keys[i]] = buffers[i];
	                    }
	                    return _this.constructor._deserialize_state(state, _this.widget_manager);
	                }).then(function (state) {
	                    _this.set_state(state);
	                }).catch(utils.reject('Could not process update msg for model id: ' + String(this.id), true));
	                return this.state_change;
	            case 'custom':
	                this.trigger('msg:custom', msg.content.data.content, msg.buffers);
	                return Promise.resolve();
	            case 'display':
	                if (this.widget_manager.displayWithOutput) {
	                    return;
	                }
	                this.state_change = this.state_change.then(function () {
	                    _this.widget_manager.display_model(msg, _this);
	                }).catch(utils.reject('Could not process display view msg', true));
	                return this.state_change;
	        }
	    };
	    /**
	     * Handle when a widget is updated from the backend.
	     */
	    WidgetModel.prototype.set_state = function (state) {
	        this.state_lock = state;
	        try {
	            this.set(state);
	        }
	        catch (e) {
	            console.error('Error setting state:', e.message);
	        }
	        finally {
	            this.state_lock = null;
	        }
	    };
	    /**
	     * Get the serializable state of the model.
	     *
	     * If drop_default is thruthy, attributes that are equal to their default
	     * values are dropped.
	     */
	    WidgetModel.prototype.get_state = function (drop_defaults) {
	        var state = this.attributes;
	        if (drop_defaults) {
	            var defaults = _.result(this, 'defaults');
	            return Object.keys(state).reduce(function (obj, key) {
	                if (!_.isEqual(state[key], defaults[key])) {
	                    obj[key] = state[key];
	                }
	                return obj;
	            }, {});
	        }
	        else {
	            return _.clone(state);
	        }
	    };
	    /**
	     * Handle status msgs.
	     *
	     * execution_state : ('busy', 'idle', 'starting')
	     */
	    WidgetModel.prototype._handle_status = function (msg, callbacks) {
	        if (this.comm !== undefined) {
	            if (msg.content.execution_state === 'idle') {
	                // Send buffer if this message caused another message to be
	                // throttled.
	                if (this.msg_buffer !== null &&
	                    (this.get('msg_throttle') || 1) === this.pending_msgs) {
	                    var data = {
	                        method: 'backbone',
	                        sync_method: 'update',
	                        sync_data: this.msg_buffer
	                    };
	                    this.comm.send(data, callbacks);
	                    this.msg_buffer = null;
	                }
	                else {
	                    --this.pending_msgs;
	                }
	            }
	        }
	    };
	    /**
	     * Create msg callbacks for a comm msg.
	     */
	    WidgetModel.prototype.callbacks = function (view) {
	        var _this = this;
	        var callbacks = this.widget_manager.callbacks(view);
	        if (callbacks.iopub === undefined) {
	            callbacks.iopub = {};
	        }
	        callbacks.iopub.status = function (msg) {
	            _this._handle_status(msg, callbacks);
	        };
	        return callbacks;
	    };
	    /**
	     * Set a value.
	     *
	     * We just call the super method, in which val and options are optional
	     */
	    WidgetModel.prototype.set = function (key, val, options) {
	        var return_value = _super.prototype.set.call(this, key, val, options);
	        // Backbone only remembers the diff of the most recent set()
	        // operation.  Calling set multiple times in a row results in a
	        // loss of diff information.  Here we keep our own running diff.
	        //
	        // We don't buffer the state set in the constructor (including
	        // defaults), so we first check to see if we've initialized _buffered_state_diff.
	        // which happens after the constructor sets attributes at creation.
	        if (this._buffered_state_diff !== void 0) {
	            this._buffered_state_diff = _.extend(this._buffered_state_diff, this.changedAttributes() || {});
	        }
	        return return_value;
	    };
	    /**
	     * Handle sync to the back-end.  Called when a model.save() is called.
	     *
	     * Make sure a comm exists.
	     *
	     * Parameters
	     * ----------
	     * method : create, update, patch, delete, read
	     *   create/update always send the full attribute set
	     *   patch - only send attributes listed in options.attrs, and if we
	     *   are queuing up messages, combine with previous messages that have
	     *   not been sent yet
	     * model : the model we are syncing
	     *   will normally be the same as `this`
	     * options : dict
	     *   the `attrs` key, if it exists, gives an {attr: value} dict that
	     *   should be synced, otherwise, sync all attributes.
	     *
	     */
	    WidgetModel.prototype.sync = function (method, model, options) {
	        if (options === void 0) { options = {}; }
	        // the typing is to return `any` since the super.sync method returns a JqXHR, but we just return false if there is an error.
	        var error = options.error || function () {
	            console.error('Backbone sync error:', arguments);
	        };
	        if (this.comm === undefined) {
	            error();
	            return false;
	        }
	        var attrs = (method === 'patch') ? options.attrs : model.get_state(options.drop_defaults);
	        // The state_lock lists attributes that are currently being changed
	        // right now from a kernel message.
	        // We don't want to send these non-changes back to the kernel, so we
	        // delete them out of attrs, (but we only delete them if the value
	        // hasn't changed from the value stored in the state_lock).
	        if (this.state_lock !== null) {
	            var keys = Object.keys(this.state_lock);
	            for (var i = 0; i < keys.length; i++) {
	                var key = keys[i];
	                if (attrs[key] === this.state_lock[key]) {
	                    delete attrs[key];
	                }
	            }
	        }
	        if (_.size(attrs) > 0) {
	            // If this message was sent via backbone itself, it will not
	            // have any callbacks.  It's important that we create callbacks
	            // so we can listen for status messages, etc...
	            var callbacks = options.callbacks || this.callbacks();
	            // Check throttle.
	            if (this.pending_msgs >= (this.get('msg_throttle') || 1)) {
	                // The throttle has been exceeded, buffer the current msg so
	                // it can be sent once the kernel has finished processing
	                // some of the existing messages.
	                // Combine updates if it is a 'patch' sync, otherwise replace updates
	                switch (method) {
	                    case 'patch':
	                        this.msg_buffer = _.extend(this.msg_buffer || {}, attrs);
	                        break;
	                    case 'update':
	                    case 'create':
	                        this.msg_buffer = attrs;
	                        break;
	                    default:
	                        error();
	                        return false;
	                }
	                this.msg_buffer_callbacks = callbacks;
	            }
	            else {
	                // We haven't exceeded the throttle, send the message like
	                // normal.
	                this.send_sync_message(attrs, callbacks);
	                this.pending_msgs++;
	            }
	        }
	    };
	    WidgetModel.prototype.send_sync_message = function (attrs, callbacks) {
	        var _this = this;
	        // prepare and send a comm message syncing attrs
	        // first, build a state dictionary with key=the attribute and the value
	        // being the value or the promise of the serialized value
	        var serializers = this.constructor.serializers;
	        if (serializers) {
	            for (var k in attrs) {
	                if (serializers[k] && serializers[k].serialize) {
	                    attrs[k] = (serializers[k].serialize)(attrs[k], this);
	                }
	            }
	        }
	        utils.resolvePromisesDict(attrs).then(function (state) {
	            // get binary values, then send
	            var keys = Object.keys(state);
	            var buffers = [];
	            var buffer_keys = [];
	            for (var i = 0; i < keys.length; i++) {
	                var key = keys[i];
	                var value = state[key];
	                if (value) {
	                    if (value.buffer instanceof ArrayBuffer
	                        || value instanceof ArrayBuffer) {
	                        buffers.push(value);
	                        buffer_keys.push(key);
	                        delete state[key];
	                    }
	                }
	            }
	            _this.comm.send({
	                method: 'backbone',
	                sync_data: state,
	                buffer_keys: buffer_keys
	            }, callbacks, {}, buffers);
	        }).catch(function (error) {
	            _this.pending_msgs--;
	            return (utils.reject('Could not send widget sync message', true))(error);
	        });
	    };
	    /**
	     * Push this model's state to the back-end
	     *
	     * This invokes a Backbone.Sync.
	     */
	    WidgetModel.prototype.save_changes = function (callbacks) {
	        if (this.comm_live) {
	            var options = { patch: true };
	            if (callbacks) {
	                options.callbacks = callbacks;
	            }
	            this.save(this._buffered_state_diff, options);
	            this._buffered_state_diff = {};
	        }
	    };
	    /**
	     * on_some_change(['key1', 'key2'], foo, context) differs from
	     * on('change:key1 change:key2', foo, context).
	     * If the widget attributes key1 and key2 are both modified,
	     * the second form will result in foo being called twice
	     * while the first will call foo only once.
	     */
	    WidgetModel.prototype.on_some_change = function (keys, callback, context) {
	        this.on('change', function () {
	            if (keys.some(this.hasChanged, this)) {
	                callback.apply(context, arguments);
	            }
	        }, this);
	    };
	    /**
	     * Serialize the model.  See the deserialization function at the top of this file
	     * and the kernel-side serializer/deserializer.
	     */
	    WidgetModel.prototype.toJSON = function (options) {
	        return 'IPY_MODEL_' + this.id;
	    };
	    /**
	     * Returns a promise for the deserialized state. The second argument
	     * is an instance of widget manager, which is required for the
	     * deserialization of widget models.
	     */
	    WidgetModel._deserialize_state = function (state, manager) {
	        var serializers = this.serializers;
	        var deserialized;
	        if (serializers) {
	            deserialized = {};
	            for (var k in state) {
	                if (serializers[k] && serializers[k].deserialize) {
	                    deserialized[k] = (serializers[k].deserialize)(state[k], manager);
	                }
	                else {
	                    deserialized[k] = state[k];
	                }
	            }
	        }
	        else {
	            deserialized = state;
	        }
	        return utils.resolvePromisesDict(deserialized);
	    };
	    /**
	     * Returns a promise for the serialized state. The second argument
	     * is an instance of widget manager.
	     */
	    WidgetModel._serialize_state = function (state, manager) {
	        var serializers = this.serializers;
	        var serialized;
	        if (serializers) {
	            serialized = {};
	            for (var k in state) {
	                if (serializers[k] && serializers[k].serialize) {
	                    serialized[k] = (serializers[k].serialize)(state[k], manager);
	                }
	                else {
	                    serialized[k] = state[k];
	                }
	            }
	        }
	        else {
	            serialized = state;
	        }
	        return utils.resolvePromisesDict(serialized);
	    };
	    return WidgetModel;
	}(Backbone.Model));
	exports.WidgetModel = WidgetModel;
	var DOMWidgetModel = (function (_super) {
	    __extends(DOMWidgetModel, _super);
	    function DOMWidgetModel() {
	        _super.apply(this, arguments);
	    }
	    DOMWidgetModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            layout: void 0,
	            _dom_classes: []
	        });
	    };
	    DOMWidgetModel.serializers = _.extend({
	        layout: { deserialize: unpack_models },
	        style: { deserialize: unpack_models },
	    }, WidgetModel.serializers);
	    return DOMWidgetModel;
	}(WidgetModel));
	exports.DOMWidgetModel = DOMWidgetModel;
	/**
	 * - create_view and remove_view are default functions called when adding or removing views
	 * - create_view takes a model and an index and returns a view or a promise for a view for that model
	 * - remove_view takes a view and destroys it (including calling `view.remove()`)
	 * - each time the update() function is called with a new list, the create and remove
	 *   callbacks will be called in an order so that if you append the views created in the
	 *   create callback and remove the views in the remove callback, you will duplicate
	 *   the order of the list.
	 * - the remove callback defaults to just removing the view (e.g., pass in null for the second parameter)
	 * - the context defaults to the created ViewList.  If you pass another context, the create and remove
	 *   will be called in that context.
	 */
	var ViewList = (function () {
	    function ViewList(create_view, remove_view, context) {
	        this.initialize(create_view, remove_view, context);
	    }
	    ViewList.prototype.initialize = function (create_view, remove_view, context) {
	        this._handler_context = context || this;
	        this._models = [];
	        this.views = []; // list of promises for views
	        this._create_view = create_view;
	        this._remove_view = remove_view || function (view) { view.remove(); };
	    };
	    /**
	     * the create_view, remove_view, and context arguments override the defaults
	     * specified when the list is created.
	     * after this function, the .views attribute is a list of promises for views
	     * if you want to perform some action on the list of views, do something like
	     * `Promise.all(myviewlist.views).then(function(views) {...});`
	     */
	    ViewList.prototype.update = function (new_models, create_view, remove_view, context) {
	        var remove = remove_view || this._remove_view;
	        var create = create_view || this._create_view;
	        context = context || this._handler_context;
	        var i = 0;
	        // first, skip past the beginning of the lists if they are identical
	        for (; i < new_models.length; i++) {
	            if (i >= this._models.length || new_models[i] !== this._models[i]) {
	                break;
	            }
	        }
	        var first_removed = i;
	        // Remove the non-matching items from the old list.
	        var removed = this.views.splice(first_removed, this.views.length - first_removed);
	        for (var j = 0; j < removed.length; j++) {
	            removed[j].then(function (view) {
	                remove.call(context, view);
	            });
	        }
	        // Add the rest of the new list items.
	        for (; i < new_models.length; i++) {
	            this.views.push(Promise.resolve(create.call(context, new_models[i], i)));
	        }
	        // make a copy of the input array
	        this._models = new_models.slice();
	        // return a promise that resolves to all of the resolved views
	        return Promise.all(this.views);
	    };
	    /**
	     * removes every view in the list; convenience function for `.update([])`
	     * that should be faster
	     * returns a promise that resolves after this removal is done
	     */
	    ViewList.prototype.remove = function () {
	        var _this = this;
	        return Promise.all(this.views).then(function (views) {
	            views.forEach(function (value) { return _this._remove_view.call(_this._handler_context, value); });
	            _this.views = [];
	            _this._models = [];
	        });
	    };
	    /**
	     * Dispose this viewlist.
	     *
	     * A synchronous function which just deletes references to child views. This
	     * function does not call .remove() on child views because that is
	     * asynchronous. Use this in cases where child views will be removed in
	     * another way.
	     */
	    ViewList.prototype.dispose = function () {
	        this.views = null;
	        this._models = null;
	    };
	    return ViewList;
	}());
	exports.ViewList = ViewList;
	var WidgetView = (function (_super) {
	    __extends(WidgetView, _super);
	    function WidgetView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Public constructor.
	     */
	    WidgetView.prototype.initialize = function (parameters) {
	        var _this = this;
	        this.listenTo(this.model, 'change', this.update);
	        this.options = parameters.options;
	        this.displayed = new Promise(function (resolve, reject) {
	            _this.once('displayed', resolve);
	        });
	    };
	    /**
	     * Triggered on model change.
	     *
	     * Update view to be consistent with this.model
	     */
	    WidgetView.prototype.update = function (options) {
	    };
	    ;
	    /**
	     * Render a view
	     *
	     * @returns the view or a promise to the view.
	     */
	    WidgetView.prototype.render = function () {
	    };
	    /**
	     * Create and promise that resolves to a child view of a given model
	     */
	    WidgetView.prototype.create_child_view = function (child_model, options) {
	        var that = this;
	        options = _.extend({ parent: this }, options || {});
	        return this.model.widget_manager.create_view(child_model, options)
	            .catch(utils.reject('Could not create child view', true));
	    };
	    /**
	     * Create msg callbacks for a comm msg.
	     */
	    WidgetView.prototype.callbacks = function () {
	        return this.model.callbacks(this);
	    };
	    /**
	     * Send a custom msg associated with this view.
	     */
	    WidgetView.prototype.send = function (content, buffers) {
	        this.model.send(content, this.callbacks(), buffers);
	    };
	    WidgetView.prototype.touch = function () {
	        this.model.save_changes(this.callbacks());
	    };
	    WidgetView.prototype.remove = function () {
	        // Raise a remove event when the view is removed.
	        _super.prototype.remove.call(this);
	        this.trigger('remove');
	        return this;
	    };
	    return WidgetView;
	}(nativeview_1.NativeView));
	exports.WidgetView = WidgetView;
	var JupyterPhosphorWidget = (function (_super) {
	    __extends(JupyterPhosphorWidget, _super);
	    function JupyterPhosphorWidget(options) {
	        var view = options.view;
	        delete options.view;
	        _super.call(this, options);
	        this._view = view;
	    }
	    /**
	     * Dispose the widget.
	     *
	     * This causes the view to be destroyed as well with 'remove'
	     */
	    JupyterPhosphorWidget.prototype.dispose = function () {
	        if (this.isDisposed) {
	            return;
	        }
	        _super.prototype.dispose.call(this);
	        if (this._view) {
	            this._view.remove();
	        }
	        this._view = null;
	    };
	    /**
	     * Process the phosphor message.
	     *
	     * Any custom phosphor widget used inside a Jupyter widget should override
	     * the processMessage function like this.
	     */
	    JupyterPhosphorWidget.prototype.processMessage = function (msg) {
	        _super.prototype.processMessage.call(this, msg);
	        this._view.processPhosphorMessage(msg);
	    };
	    return JupyterPhosphorWidget;
	}(widget_1.Widget));
	exports.JupyterPhosphorWidget = JupyterPhosphorWidget;
	var DOMWidgetView = (function (_super) {
	    __extends(DOMWidgetView, _super);
	    function DOMWidgetView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Public constructor
	     */
	    DOMWidgetView.prototype.initialize = function (parameters) {
	        var _this = this;
	        _super.prototype.initialize.call(this, parameters);
	        this.id = utils.uuid();
	        this.listenTo(this.model, 'change:_dom_classes', function (model, new_classes) {
	            var old_classes = model.previous('_dom_classes');
	            _this.update_classes(old_classes, new_classes);
	        });
	        this.layoutPromise = Promise.resolve();
	        this.listenTo(this.model, 'change:layout', function (model, value) {
	            _this.setLayout(value, model.previous('layout'));
	        });
	        this.stylePromise = Promise.resolve();
	        this.listenTo(this.model, 'change:style', function (model, value) {
	            _this.setStyle(value, model.previous('style'));
	        });
	        this.displayed.then(function () {
	            _this.update_classes([], _this.model.get('_dom_classes'));
	            _this.setLayout(_this.model.get('layout'));
	            _this.setStyle(_this.model.get('style'));
	        });
	    };
	    DOMWidgetView.prototype.setLayout = function (layout, oldLayout) {
	        var _this = this;
	        if (layout) {
	            this.layoutPromise = this.layoutPromise.then(function (oldLayoutView) {
	                if (oldLayoutView) {
	                    oldLayoutView.unlayout();
	                    _this.stopListening(oldLayoutView.model);
	                    oldLayoutView.remove();
	                }
	                return _this.create_child_view(layout).then(function (view) {
	                    // Trigger the displayed event of the child view.
	                    return _this.displayed.then(function () {
	                        view.trigger('displayed');
	                        _this.listenTo(view.model, 'change', function () {
	                            // Post (asynchronous) so layout changes can take
	                            // effect first.
	                            messaging_1.postMessage(_this.pWidget, widget_2.ResizeMessage.UnknownSize);
	                        });
	                        messaging_1.postMessage(_this.pWidget, widget_2.ResizeMessage.UnknownSize);
	                        return view;
	                    });
	                }).catch(utils.reject('Could not add LayoutView to DOMWidgetView', true));
	            });
	        }
	    };
	    DOMWidgetView.prototype.setStyle = function (style, oldStyle) {
	        var _this = this;
	        if (style) {
	            this.stylePromise = this.stylePromise.then(function (oldStyleView) {
	                if (oldStyleView) {
	                    oldStyleView.unstyle();
	                    _this.stopListening(oldStyleView.model);
	                    oldStyleView.remove();
	                }
	                return _this.create_child_view(style).then(function (view) {
	                    // Trigger the displayed event of the child view.
	                    return _this.displayed.then(function () {
	                        view.trigger('displayed');
	                        // Unlike for the layout attribute, style changes don't
	                        // trigger phosphor resize messages.
	                        return view;
	                    });
	                }).catch(utils.reject('Could not add styleView to DOMWidgetView', true));
	            });
	        }
	    };
	    /**
	     * Update the DOM classes applied to an element, default to this.el.
	     */
	    DOMWidgetView.prototype.update_classes = function (old_classes, new_classes, el) {
	        if (el === undefined) {
	            el = this.el;
	        }
	        _.difference(old_classes, new_classes).map(function (c) {
	            if (el.classList) {
	                el.classList.remove(c);
	            }
	            else {
	                el.setAttribute('class', el.getAttribute('class').replace(c, ''));
	            }
	        });
	        _.difference(new_classes, old_classes).map(function (c) {
	            if (el.classList) {
	                el.classList.add(c);
	            }
	            else {
	                el.setAttribute('class', el.getAttribute('class').concat(' ', c));
	            }
	        });
	    };
	    /**
	     * Update the DOM classes applied to the widget based on a single
	     * trait's value.
	     *
	     * Given a trait value classes map, this function automatically
	     * handles applying the appropriate classes to the widget element
	     * and removing classes that are no longer valid.
	     *
	     * Parameters
	     * ----------
	     * class_map: dictionary
	     *  Dictionary of trait values to class lists.
	     *  Example:
	     *      {
	     *          success: ['alert', 'alert-success'],
	     *          info: ['alert', 'alert-info'],
	     *          warning: ['alert', 'alert-warning'],
	     *          danger: ['alert', 'alert-danger']
	     *      };
	     * trait_name: string
	     *  Name of the trait to check the value of.
	     * el: optional DOM element handle, defaults to this.el
	     *  Element that the classes are applied to.
	     */
	    DOMWidgetView.prototype.update_mapped_classes = function (class_map, trait_name, el) {
	        var key = this.model.previous(trait_name);
	        var old_classes = class_map[key] ? class_map[key] : [];
	        key = this.model.get(trait_name);
	        var new_classes = class_map[key] ? class_map[key] : [];
	        this.update_classes(old_classes, new_classes, el || this.el);
	    };
	    DOMWidgetView.prototype.set_mapped_classes = function (class_map, trait_name, el) {
	        var key = this.model.get(trait_name);
	        var new_classes = class_map[key] ? class_map[key] : [];
	        this.update_classes([], new_classes, el || this.el);
	    };
	    DOMWidgetView.prototype.typeset = function (element, text) {
	        this.displayed.then(function () { utils.typeset(element, text); });
	    };
	    DOMWidgetView.prototype._setElement = function (el) {
	        if (this.pWidget) {
	            this.pWidget.dispose();
	        }
	        this.$el = el instanceof $ ? el : $(el);
	        this.el = this.$el[0];
	        this.pWidget = new JupyterPhosphorWidget({
	            node: el,
	            view: this
	        });
	    };
	    DOMWidgetView.prototype.remove = function () {
	        if (this.pWidget) {
	            this.pWidget.dispose();
	        }
	        return _super.prototype.remove.call(this);
	    };
	    DOMWidgetView.prototype.processPhosphorMessage = function (msg) {
	        switch (msg.type) {
	            case 'after-attach':
	                this.trigger('displayed');
	                break;
	        }
	    };
	    return DOMWidgetView;
	}(WidgetView));
	exports.DOMWidgetView = DOMWidgetView;
	var LabeledDOMWidgetModel = (function (_super) {
	    __extends(LabeledDOMWidgetModel, _super);
	    function LabeledDOMWidgetModel() {
	        _super.apply(this, arguments);
	    }
	    LabeledDOMWidgetModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            description: '',
	        });
	    };
	    return LabeledDOMWidgetModel;
	}(DOMWidgetModel));
	exports.LabeledDOMWidgetModel = LabeledDOMWidgetModel;
	var LabeledDOMWidgetView = (function (_super) {
	    __extends(LabeledDOMWidgetView, _super);
	    function LabeledDOMWidgetView() {
	        _super.apply(this, arguments);
	    }
	    LabeledDOMWidgetView.prototype.render = function () {
	        this.label = document.createElement('div');
	        this.el.appendChild(this.label);
	        this.label.className = 'widget-label';
	        this.label.style.display = 'none';
	        this.listenTo(this.model, 'change:description', this.updateDescription);
	        this.updateDescription();
	    };
	    LabeledDOMWidgetView.prototype.updateDescription = function () {
	        var description = this.model.get('description');
	        if (description.length === 0) {
	            this.label.style.display = 'none';
	        }
	        else {
	            this.label.innerHTML = description;
	            this.typeset(this.label);
	            this.label.style.display = '';
	        }
	        this.label.title = description;
	    };
	    return LabeledDOMWidgetView;
	}(DOMWidgetView));
	exports.LabeledDOMWidgetView = LabeledDOMWidgetView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget.js **/


/** START DEFINE BLOCK for backbone@1.2.0/backbone.js **/
jupyter.define('backbone@1.2.0/backbone.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global) {//     Backbone.js 1.2.0
	
	//     (c) 2010-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
	//     Backbone may be freely distributed under the MIT license.
	//     For all details and documentation:
	//     http://backbonejs.org
	
	(function(factory) {
	
	  // Establish the root object, `window` (`self`) in the browser, or `global` on the server.
	  // We use `self` instead of `window` for `WebWorker` support.
	  var root = (typeof self == 'object' && self.self == self && self) ||
	            (typeof global == 'object' && global.global == global && global);
	
	  // Set up Backbone appropriately for the environment. Start with AMD.
	  if (true) {
	    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__jupyter_require__('underscore@>=1.7.0/underscore.js'), __jupyter_require__('jquery@2.2.4/dist/jquery.js'), exports], __WEBPACK_AMD_DEFINE_RESULT__ = function(_, $, exports) {
	      // Export global even in AMD case in case this script is loaded with
	      // others that may still expect a global Backbone.
	      root.Backbone = factory(root, exports, _, $);
	    }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	
	  // Next for Node.js or CommonJS. jQuery may not be needed as a module.
	  } else if (typeof exports !== 'undefined') {
	    var _ = require('underscore'), $;
	    try { $ = require('jquery'); } catch(e) {}
	    factory(root, exports, _, $);
	
	  // Finally, as a browser global.
	  } else {
	    root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));
	  }
	
	}(function(root, Backbone, _, $) {
	
	  // Initial Setup
	  // -------------
	
	  // Save the previous value of the `Backbone` variable, so that it can be
	  // restored later on, if `noConflict` is used.
	  var previousBackbone = root.Backbone;
	
	  // Create local references to array methods we'll want to use later.
	  var array = [];
	  var slice = array.slice;
	
	  // Current version of the library. Keep in sync with `package.json`.
	  Backbone.VERSION = '1.2.0';
	
	  // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns
	  // the `$` variable.
	  Backbone.$ = $;
	
	  // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
	  // to its previous owner. Returns a reference to this Backbone object.
	  Backbone.noConflict = function() {
	    root.Backbone = previousBackbone;
	    return this;
	  };
	
	  // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
	  // will fake `"PATCH"`, `"PUT"` and `"DELETE"` requests via the `_method` parameter and
	  // set a `X-Http-Method-Override` header.
	  Backbone.emulateHTTP = false;
	
	  // Turn on `emulateJSON` to support legacy servers that can't deal with direct
	  // `application/json` requests ... this will encode the body as
	  // `application/x-www-form-urlencoded` instead and will send the model in a
	  // form param named `model`.
	  Backbone.emulateJSON = false;
	
	  // Backbone.Events
	  // ---------------
	
	  // A module that can be mixed in to *any object* in order to provide it with
	  // custom events. You may bind with `on` or remove with `off` callback
	  // functions to an event; `trigger`-ing an event fires all callbacks in
	  // succession.
	  //
	  //     var object = {};
	  //     _.extend(object, Backbone.Events);
	  //     object.on('expand', function(){ alert('expanded'); });
	  //     object.trigger('expand');
	  //
	  var Events = Backbone.Events = {};
	
	  // Regular expression used to split event strings.
	  var eventSplitter = /\s+/;
	
	  // Iterates over the standard `event, callback` (as well as the fancy multiple
	  // space-separated events `"change blur", callback` and jQuery-style event
	  // maps `{event: callback}`), reducing them by manipulating `memo`.
	  // Passes a normalized single event name and callback, as well as any
	  // optional `opts`.
	  var eventsApi = function(iteratee, memo, name, callback, opts) {
	    var i = 0, names;
	    if (name && typeof name === 'object') {
	      // Handle event maps.
	      for (names = _.keys(name); i < names.length ; i++) {
	        memo = iteratee(memo, names[i], name[names[i]], opts);
	      }
	    } else if (name && eventSplitter.test(name)) {
	      // Handle space separated event names.
	      for (names = name.split(eventSplitter); i < names.length; i++) {
	        memo = iteratee(memo, names[i], callback, opts);
	      }
	    } else {
	      memo = iteratee(memo, name, callback, opts);
	    }
	    return memo;
	  };
	
	  // Bind an event to a `callback` function. Passing `"all"` will bind
	  // the callback to all events fired.
	  Events.on = function(name, callback, context) {
	    return internalOn(this, name, callback, context);
	  };
	
	  // An internal use `on` function, used to guard the `listening` argument from
	  // the public API.
	  var internalOn = function(obj, name, callback, context, listening) {
	    obj._events = eventsApi(onApi, obj._events || {}, name, callback, {
	        context: context,
	        ctx: obj,
	        listening: listening
	    });
	
	    if (listening) {
	      var listeners = obj._listeners || (obj._listeners = {});
	      listeners[listening.id] = listening;
	    }
	
	    return obj;
	  };
	
	  // Inversion-of-control versions of `on`. Tell *this* object to listen to
	  // an event in another object... keeping track of what it's listening to.
	  Events.listenTo =  function(obj, name, callback) {
	    if (!obj) return this;
	    var id = obj._listenId || (obj._listenId = _.uniqueId('l'));
	    var listeningTo = this._listeningTo || (this._listeningTo = {});
	    var listening = listeningTo[id];
	
	    // This object is not listening to any other events on `obj` yet.
	    // Setup the necessary references to track the listening callbacks.
	    if (!listening) {
	      var thisId = this._listenId || (this._listenId = _.uniqueId('l'));
	      listening = listeningTo[id] = {obj: obj, objId: id, id: thisId, listeningTo: listeningTo, count: 0};
	    }
	
	    // Bind callbacks on obj, and keep track of them on listening.
	    internalOn(obj, name, callback, this, listening);
	    return this;
	  };
	
	  // The reducing API that adds a callback to the `events` object.
	  var onApi = function(events, name, callback, options) {
	    if (callback) {
	      var handlers = events[name] || (events[name] = []);
	      var context = options.context, ctx = options.ctx, listening = options.listening;
	      if (listening) listening.count++;
	
	      handlers.push({ callback: callback, context: context, ctx: context || ctx, listening: listening });
	    }
	    return events;
	  };
	
	  // Remove one or many callbacks. If `context` is null, removes all
	  // callbacks with that function. If `callback` is null, removes all
	  // callbacks for the event. If `name` is null, removes all bound
	  // callbacks for all events.
	  Events.off =  function(name, callback, context) {
	    if (!this._events) return this;
	    this._events = eventsApi(offApi, this._events, name, callback, {
	        context: context,
	        listeners: this._listeners
	    });
	    return this;
	  };
	
	  // Tell this object to stop listening to either specific events ... or
	  // to every object it's currently listening to.
	  Events.stopListening =  function(obj, name, callback) {
	    var listeningTo = this._listeningTo;
	    if (!listeningTo) return this;
	
	    var ids = obj ? [obj._listenId] : _.keys(listeningTo);
	
	    for (var i = 0; i < ids.length; i++) {
	      var listening = listeningTo[ids[i]];
	
	      // If listening doesn't exist, this object is not currently
	      // listening to obj. Break out early.
	      if (!listening) break;
	
	      listening.obj.off(name, callback, this);
	    }
	    if (_.isEmpty(listeningTo)) this._listeningTo = void 0;
	
	    return this;
	  };
	
	  // The reducing API that removes a callback from the `events` object.
	  var offApi = function(events, name, callback, options) {
	    // No events to consider.
	    if (!events) return;
	
	    var i = 0, length, listening;
	    var context = options.context, listeners = options.listeners;
	
	    // Delete all events listeners and "drop" events.
	    if (!name && !callback && !context) {
	      var ids = _.keys(listeners);
	      for (; i < ids.length; i++) {
	        listening = listeners[ids[i]];
	        delete listeners[listening.id];
	        delete listening.listeningTo[listening.objId];
	      }
	      return;
	    }
	
	    var names = name ? [name] : _.keys(events);
	    for (; i < names.length; i++) {
	      name = names[i];
	      var handlers = events[name];
	
	      // Bail out if there are no events stored.
	      if (!handlers) break;
	
	      // Replace events if there are any remaining.  Otherwise, clean up.
	      var remaining = [];
	      for (var j = 0; j < handlers.length; j++) {
	        var handler = handlers[j];
	        if (
	          callback && callback !== handler.callback &&
	            callback !== handler.callback._callback ||
	              context && context !== handler.context
	        ) {
	          remaining.push(handler);
	        } else {
	          listening = handler.listening;
	          if (listening && --listening.count === 0) {
	            delete listeners[listening.id];
	            delete listening.listeningTo[listening.objId];
	          }
	        }
	      }
	
	      // Update tail event if the list has any events.  Otherwise, clean up.
	      if (remaining.length) {
	        events[name] = remaining;
	      } else {
	        delete events[name];
	      }
	    }
	    if (_.size(events)) return events;
	  };
	
	  // Bind an event to only be triggered a single time. After the first time
	  // the callback is invoked, it will be removed. When multiple events are
	  // passed in using the space-separated syntax, the event will fire once for every
	  // event you passed in, not once for a combination of all events
	  Events.once =  function(name, callback, context) {
	    // Map the event into a `{event: once}` object.
	    var events = eventsApi(onceMap, {}, name, callback, _.bind(this.off, this));
	    return this.on(events, void 0, context);
	  };
	
	  // Inversion-of-control versions of `once`.
	  Events.listenToOnce =  function(obj, name, callback) {
	    // Map the event into a `{event: once}` object.
	    var events = eventsApi(onceMap, {}, name, callback, _.bind(this.stopListening, this, obj));
	    return this.listenTo(obj, events);
	  };
	
	  // Reduces the event callbacks into a map of `{event: onceWrapper}`.
	  // `offer` unbinds the `onceWrapper` after it as been called.
	  var onceMap = function(map, name, callback, offer) {
	    if (callback) {
	      var once = map[name] = _.once(function() {
	        offer(name, once);
	        callback.apply(this, arguments);
	      });
	      once._callback = callback;
	    }
	    return map;
	  };
	
	  // Trigger one or many events, firing all bound callbacks. Callbacks are
	  // passed the same arguments as `trigger` is, apart from the event name
	  // (unless you're listening on `"all"`, which will cause your callback to
	  // receive the true name of the event as the first argument).
	  Events.trigger =  function(name) {
	    if (!this._events) return this;
	
	    var length = Math.max(0, arguments.length - 1);
	    var args = Array(length);
	    for (var i = 0; i < length; i++) args[i] = arguments[i + 1];
	
	    eventsApi(triggerApi, this._events, name, void 0, args);
	    return this;
	  };
	
	  // Handles triggering the appropriate event callbacks.
	  var triggerApi = function(objEvents, name, cb, args) {
	    if (objEvents) {
	      var events = objEvents[name];
	      var allEvents = objEvents.all;
	      if (events && allEvents) allEvents = allEvents.slice();
	      if (events) triggerEvents(events, args);
	      if (allEvents) triggerEvents(allEvents, [name].concat(args));
	    }
	    return objEvents;
	  };
	
	  // A difficult-to-believe, but optimized internal dispatch function for
	  // triggering events. Tries to keep the usual cases speedy (most internal
	  // Backbone events have 3 arguments).
	  var triggerEvents = function(events, args) {
	    var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];
	    switch (args.length) {
	      case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;
	      case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;
	      case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;
	      case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;
	      default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;
	    }
	  };
	
	  // Proxy Underscore methods to a Backbone class' prototype using a
	  // particular attribute as the data argument
	  var addMethod = function(length, method, attribute) {
	    switch (length) {
	      case 1: return function() {
	        return _[method](this[attribute]);
	      };
	      case 2: return function(value) {
	        return _[method](this[attribute], value);
	      };
	      case 3: return function(iteratee, context) {
	        return _[method](this[attribute], iteratee, context);
	      };
	      case 4: return function(iteratee, defaultVal, context) {
	        return _[method](this[attribute], iteratee, defaultVal, context);
	      };
	      default: return function() {
	        var args = slice.call(arguments);
	        args.unshift(this[attribute]);
	        return _[method].apply(_, args);
	      };
	    }
	  };
	  var addUnderscoreMethods = function(Class, methods, attribute) {
	    _.each(methods, function(length, method) {
	      if (_[method]) Class.prototype[method] = addMethod(length, method, attribute);
	    });
	  };
	
	  // Aliases for backwards compatibility.
	  Events.bind   = Events.on;
	  Events.unbind = Events.off;
	
	  // Allow the `Backbone` object to serve as a global event bus, for folks who
	  // want global "pubsub" in a convenient place.
	  _.extend(Backbone, Events);
	
	  // Backbone.Model
	  // --------------
	
	  // Backbone **Models** are the basic data object in the framework --
	  // frequently representing a row in a table in a database on your server.
	  // A discrete chunk of data and a bunch of useful, related methods for
	  // performing computations and transformations on that data.
	
	  // Create a new model with the specified attributes. A client id (`cid`)
	  // is automatically generated and assigned for you.
	  var Model = Backbone.Model = function(attributes, options) {
	    var attrs = attributes || {};
	    options || (options = {});
	    this.cid = _.uniqueId(this.cidPrefix);
	    this.attributes = {};
	    if (options.collection) this.collection = options.collection;
	    if (options.parse) attrs = this.parse(attrs, options) || {};
	    attrs = _.defaults({}, attrs, _.result(this, 'defaults'));
	    this.set(attrs, options);
	    this.changed = {};
	    this.initialize.apply(this, arguments);
	  };
	
	  // Attach all inheritable methods to the Model prototype.
	  _.extend(Model.prototype, Events, {
	
	    // A hash of attributes whose current and previous value differ.
	    changed: null,
	
	    // The value returned during the last failed validation.
	    validationError: null,
	
	    // The default name for the JSON `id` attribute is `"id"`. MongoDB and
	    // CouchDB users may want to set this to `"_id"`.
	    idAttribute: 'id',
	
	    // The prefix is used to create the client id which is used to identify models locally.
	    // You may want to override this if you're experiencing name clashes with model ids.
	    cidPrefix: 'c',
	
	    // Initialize is an empty function by default. Override it with your own
	    // initialization logic.
	    initialize: function(){},
	
	    // Return a copy of the model's `attributes` object.
	    toJSON: function(options) {
	      return _.clone(this.attributes);
	    },
	
	    // Proxy `Backbone.sync` by default -- but override this if you need
	    // custom syncing semantics for *this* particular model.
	    sync: function() {
	      return Backbone.sync.apply(this, arguments);
	    },
	
	    // Get the value of an attribute.
	    get: function(attr) {
	      return this.attributes[attr];
	    },
	
	    // Get the HTML-escaped value of an attribute.
	    escape: function(attr) {
	      return _.escape(this.get(attr));
	    },
	
	    // Returns `true` if the attribute contains a value that is not null
	    // or undefined.
	    has: function(attr) {
	      return this.get(attr) != null;
	    },
	
	    // Special-cased proxy to underscore's `_.matches` method.
	    matches: function(attrs) {
	      return !!_.iteratee(attrs, this)(this.attributes);
	    },
	
	    // Set a hash of model attributes on the object, firing `"change"`. This is
	    // the core primitive operation of a model, updating the data and notifying
	    // anyone who needs to know about the change in state. The heart of the beast.
	    set: function(key, val, options) {
	      var attr, attrs, unset, changes, silent, changing, prev, current;
	      if (key == null) return this;
	
	      // Handle both `"key", value` and `{key: value}` -style arguments.
	      if (typeof key === 'object') {
	        attrs = key;
	        options = val;
	      } else {
	        (attrs = {})[key] = val;
	      }
	
	      options || (options = {});
	
	      // Run validation.
	      if (!this._validate(attrs, options)) return false;
	
	      // Extract attributes and options.
	      unset           = options.unset;
	      silent          = options.silent;
	      changes         = [];
	      changing        = this._changing;
	      this._changing  = true;
	
	      if (!changing) {
	        this._previousAttributes = _.clone(this.attributes);
	        this.changed = {};
	      }
	      current = this.attributes, prev = this._previousAttributes;
	
	      // Check for changes of `id`.
	      if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
	
	      // For each `set` attribute, update or delete the current value.
	      for (attr in attrs) {
	        val = attrs[attr];
	        if (!_.isEqual(current[attr], val)) changes.push(attr);
	        if (!_.isEqual(prev[attr], val)) {
	          this.changed[attr] = val;
	        } else {
	          delete this.changed[attr];
	        }
	        unset ? delete current[attr] : current[attr] = val;
	      }
	
	      // Trigger all relevant attribute changes.
	      if (!silent) {
	        if (changes.length) this._pending = options;
	        for (var i = 0; i < changes.length; i++) {
	          this.trigger('change:' + changes[i], this, current[changes[i]], options);
	        }
	      }
	
	      // You might be wondering why there's a `while` loop here. Changes can
	      // be recursively nested within `"change"` events.
	      if (changing) return this;
	      if (!silent) {
	        while (this._pending) {
	          options = this._pending;
	          this._pending = false;
	          this.trigger('change', this, options);
	        }
	      }
	      this._pending = false;
	      this._changing = false;
	      return this;
	    },
	
	    // Remove an attribute from the model, firing `"change"`. `unset` is a noop
	    // if the attribute doesn't exist.
	    unset: function(attr, options) {
	      return this.set(attr, void 0, _.extend({}, options, {unset: true}));
	    },
	
	    // Clear all attributes on the model, firing `"change"`.
	    clear: function(options) {
	      var attrs = {};
	      for (var key in this.attributes) attrs[key] = void 0;
	      return this.set(attrs, _.extend({}, options, {unset: true}));
	    },
	
	    // Determine if the model has changed since the last `"change"` event.
	    // If you specify an attribute name, determine if that attribute has changed.
	    hasChanged: function(attr) {
	      if (attr == null) return !_.isEmpty(this.changed);
	      return _.has(this.changed, attr);
	    },
	
	    // Return an object containing all the attributes that have changed, or
	    // false if there are no changed attributes. Useful for determining what
	    // parts of a view need to be updated and/or what attributes need to be
	    // persisted to the server. Unset attributes will be set to undefined.
	    // You can also pass an attributes object to diff against the model,
	    // determining if there *would be* a change.
	    changedAttributes: function(diff) {
	      if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
	      var val, changed = false;
	      var old = this._changing ? this._previousAttributes : this.attributes;
	      for (var attr in diff) {
	        if (_.isEqual(old[attr], (val = diff[attr]))) continue;
	        (changed || (changed = {}))[attr] = val;
	      }
	      return changed;
	    },
	
	    // Get the previous value of an attribute, recorded at the time the last
	    // `"change"` event was fired.
	    previous: function(attr) {
	      if (attr == null || !this._previousAttributes) return null;
	      return this._previousAttributes[attr];
	    },
	
	    // Get all of the attributes of the model at the time of the previous
	    // `"change"` event.
	    previousAttributes: function() {
	      return _.clone(this._previousAttributes);
	    },
	
	    // Fetch the model from the server, merging the response with the model's
	    // local attributes. Any changed attributes will trigger a "change" event.
	    fetch: function(options) {
	      options = options ? _.clone(options) : {};
	      if (options.parse === void 0) options.parse = true;
	      var model = this;
	      var success = options.success;
	      options.success = function(resp) {
	        if (!model.set(model.parse(resp, options), options)) return false;
	        if (success) success.call(options.context, model, resp, options);
	        model.trigger('sync', model, resp, options);
	      };
	      wrapError(this, options);
	      return this.sync('read', this, options);
	    },
	
	    // Set a hash of model attributes, and sync the model to the server.
	    // If the server returns an attributes hash that differs, the model's
	    // state will be `set` again.
	    save: function(key, val, options) {
	      var attrs, method, xhr, attributes = this.attributes, wait;
	
	      // Handle both `"key", value` and `{key: value}` -style arguments.
	      if (key == null || typeof key === 'object') {
	        attrs = key;
	        options = val;
	      } else {
	        (attrs = {})[key] = val;
	      }
	
	      options = _.extend({validate: true}, options);
	      wait = options.wait;
	
	      // If we're not waiting and attributes exist, save acts as
	      // `set(attr).save(null, opts)` with validation. Otherwise, check if
	      // the model will be valid when the attributes, if any, are set.
	      if (attrs && !wait) {
	        if (!this.set(attrs, options)) return false;
	      } else {
	        if (!this._validate(attrs, options)) return false;
	      }
	
	      // Set temporary attributes if `{wait: true}`.
	      if (attrs && wait) {
	        this.attributes = _.extend({}, attributes, attrs);
	      }
	
	      // After a successful server-side save, the client is (optionally)
	      // updated with the server-side state.
	      if (options.parse === void 0) options.parse = true;
	      var model = this;
	      var success = options.success;
	      options.success = function(resp) {
	        // Ensure attributes are restored during synchronous saves.
	        model.attributes = attributes;
	        var serverAttrs = options.parse ? model.parse(resp, options) : resp;
	        if (wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
	        if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
	          return false;
	        }
	        if (success) success.call(options.context, model, resp, options);
	        model.trigger('sync', model, resp, options);
	      };
	      wrapError(this, options);
	
	      method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
	      if (method === 'patch' && !options.attrs) options.attrs = attrs;
	      xhr = this.sync(method, this, options);
	
	      // Restore attributes.
	      if (attrs && wait) this.attributes = attributes;
	
	      return xhr;
	    },
	
	    // Destroy this model on the server if it was already persisted.
	    // Optimistically removes the model from its collection, if it has one.
	    // If `wait: true` is passed, waits for the server to respond before removal.
	    destroy: function(options) {
	      options = options ? _.clone(options) : {};
	      var model = this;
	      var success = options.success;
	      var wait = options.wait;
	
	      var destroy = function() {
	        model.stopListening();
	        model.trigger('destroy', model, model.collection, options);
	      };
	
	      options.success = function(resp) {
	        if (wait) destroy();
	        if (success) success.call(options.context, model, resp, options);
	        if (!model.isNew()) model.trigger('sync', model, resp, options);
	      };
	
	      var xhr = false;
	      if (this.isNew()) {
	        _.defer(options.success);
	      } else {
	        wrapError(this, options);
	        xhr = this.sync('delete', this, options);
	      }
	      if (!wait) destroy();
	      return xhr;
	    },
	
	    // Default URL for the model's representation on the server -- if you're
	    // using Backbone's restful methods, override this to change the endpoint
	    // that will be called.
	    url: function() {
	      var base =
	        _.result(this, 'urlRoot') ||
	        _.result(this.collection, 'url') ||
	        urlError();
	      if (this.isNew()) return base;
	      var id = this.id || this.attributes[this.idAttribute];
	      return base.replace(/([^\/])$/, '$1/') + encodeURIComponent(id);
	    },
	
	    // **parse** converts a response into the hash of attributes to be `set` on
	    // the model. The default implementation is just to pass the response along.
	    parse: function(resp, options) {
	      return resp;
	    },
	
	    // Create a new model with identical attributes to this one.
	    clone: function() {
	      return new this.constructor(this.attributes);
	    },
	
	    // A model is new if it has never been saved to the server, and lacks an id.
	    isNew: function() {
	      return !this.has(this.idAttribute);
	    },
	
	    // Check if the model is currently in a valid state.
	    isValid: function(options) {
	      return this._validate({}, _.extend(options || {}, { validate: true }));
	    },
	
	    // Run validation against the next complete set of model attributes,
	    // returning `true` if all is well. Otherwise, fire an `"invalid"` event.
	    _validate: function(attrs, options) {
	      if (!options.validate || !this.validate) return true;
	      attrs = _.extend({}, this.attributes, attrs);
	      var error = this.validationError = this.validate(attrs, options) || null;
	      if (!error) return true;
	      this.trigger('invalid', this, error, _.extend(options, {validationError: error}));
	      return false;
	    }
	
	  });
	
	  // Underscore methods that we want to implement on the Model.
	  var modelMethods = { keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,
	      omit: 0, chain: 1, isEmpty: 1 };
	
	  // Mix in each Underscore method as a proxy to `Model#attributes`.
	  addUnderscoreMethods(Model, modelMethods, 'attributes');
	
	  // Backbone.Collection
	  // -------------------
	
	  // If models tend to represent a single row of data, a Backbone Collection is
	  // more analogous to a table full of data ... or a small slice or page of that
	  // table, or a collection of rows that belong together for a particular reason
	  // -- all of the messages in this particular folder, all of the documents
	  // belonging to this particular author, and so on. Collections maintain
	  // indexes of their models, both in order, and for lookup by `id`.
	
	  // Create a new **Collection**, perhaps to contain a specific type of `model`.
	  // If a `comparator` is specified, the Collection will maintain
	  // its models in sort order, as they're added and removed.
	  var Collection = Backbone.Collection = function(models, options) {
	    options || (options = {});
	    if (options.model) this.model = options.model;
	    if (options.comparator !== void 0) this.comparator = options.comparator;
	    this._reset();
	    this.initialize.apply(this, arguments);
	    if (models) this.reset(models, _.extend({silent: true}, options));
	  };
	
	  // Default options for `Collection#set`.
	  var setOptions = {add: true, remove: true, merge: true};
	  var addOptions = {add: true, remove: false};
	
	  // Define the Collection's inheritable methods.
	  _.extend(Collection.prototype, Events, {
	
	    // The default model for a collection is just a **Backbone.Model**.
	    // This should be overridden in most cases.
	    model: Model,
	
	    // Initialize is an empty function by default. Override it with your own
	    // initialization logic.
	    initialize: function(){},
	
	    // The JSON representation of a Collection is an array of the
	    // models' attributes.
	    toJSON: function(options) {
	      return this.map(function(model){ return model.toJSON(options); });
	    },
	
	    // Proxy `Backbone.sync` by default.
	    sync: function() {
	      return Backbone.sync.apply(this, arguments);
	    },
	
	    // Add a model, or list of models to the set.
	    add: function(models, options) {
	      return this.set(models, _.extend({merge: false}, options, addOptions));
	    },
	
	    // Remove a model, or a list of models from the set.
	    remove: function(models, options) {
	      var singular = !_.isArray(models), removed;
	      models = singular ? [models] : _.clone(models);
	      options || (options = {});
	      removed = this._removeModels(models, options);
	      if (!options.silent && removed) this.trigger('update', this, options);
	      return singular ? models[0] : models;
	    },
	
	    // Update a collection by `set`-ing a new list of models, adding new ones,
	    // removing models that are no longer present, and merging models that
	    // already exist in the collection, as necessary. Similar to **Model#set**,
	    // the core operation for updating the data contained by the collection.
	    set: function(models, options) {
	      options = _.defaults({}, options, setOptions);
	      if (options.parse) models = this.parse(models, options);
	      var singular = !_.isArray(models);
	      models = singular ? (models ? [models] : []) : models.slice();
	      var id, model, attrs, existing, sort;
	      var at = options.at;
	      if (at != null) at = +at;
	      if (at < 0) at += this.length + 1;
	      var sortable = this.comparator && (at == null) && options.sort !== false;
	      var sortAttr = _.isString(this.comparator) ? this.comparator : null;
	      var toAdd = [], toRemove = [], modelMap = {};
	      var add = options.add, merge = options.merge, remove = options.remove;
	      var order = !sortable && add && remove ? [] : false;
	      var orderChanged = false;
	
	      // Turn bare objects into model references, and prevent invalid models
	      // from being added.
	      for (var i = 0; i < models.length; i++) {
	        attrs = models[i];
	
	        // If a duplicate is found, prevent it from being added and
	        // optionally merge it into the existing model.
	        if (existing = this.get(attrs)) {
	          if (remove) modelMap[existing.cid] = true;
	          if (merge && attrs !== existing) {
	            attrs = this._isModel(attrs) ? attrs.attributes : attrs;
	            if (options.parse) attrs = existing.parse(attrs, options);
	            existing.set(attrs, options);
	            if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;
	          }
	          models[i] = existing;
	
	        // If this is a new, valid model, push it to the `toAdd` list.
	        } else if (add) {
	          model = models[i] = this._prepareModel(attrs, options);
	          if (!model) continue;
	          toAdd.push(model);
	          this._addReference(model, options);
	        }
	
	        // Do not add multiple models with the same `id`.
	        model = existing || model;
	        if (!model) continue;
	        id = this.modelId(model.attributes);
	        if (order && (model.isNew() || !modelMap[id])) {
	          order.push(model);
	
	          // Check to see if this is actually a new model at this index.
	          orderChanged = orderChanged || !this.models[i] || model.cid !== this.models[i].cid;
	        }
	
	        modelMap[id] = true;
	      }
	
	      // Remove nonexistent models if appropriate.
	      if (remove) {
	        for (var i = 0; i < this.length; i++) {
	          if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
	        }
	        if (toRemove.length) this._removeModels(toRemove, options);
	      }
	
	      // See if sorting is needed, update `length` and splice in new models.
	      if (toAdd.length || orderChanged) {
	        if (sortable) sort = true;
	        this.length += toAdd.length;
	        if (at != null) {
	          for (var i = 0; i < toAdd.length; i++) {
	            this.models.splice(at + i, 0, toAdd[i]);
	          }
	        } else {
	          if (order) this.models.length = 0;
	          var orderedModels = order || toAdd;
	          for (var i = 0; i < orderedModels.length; i++) {
	            this.models.push(orderedModels[i]);
	          }
	        }
	      }
	
	      // Silently sort the collection if appropriate.
	      if (sort) this.sort({silent: true});
	
	      // Unless silenced, it's time to fire all appropriate add/sort events.
	      if (!options.silent) {
	        var addOpts = at != null ? _.clone(options) : options;
	        for (var i = 0; i < toAdd.length; i++) {
	          if (at != null) addOpts.index = at + i;
	          (model = toAdd[i]).trigger('add', model, this, addOpts);
	        }
	        if (sort || orderChanged) this.trigger('sort', this, options);
	        if (toAdd.length || toRemove.length) this.trigger('update', this, options);
	      }
	
	      // Return the added (or merged) model (or models).
	      return singular ? models[0] : models;
	    },
	
	    // When you have more items than you want to add or remove individually,
	    // you can reset the entire set with a new list of models, without firing
	    // any granular `add` or `remove` events. Fires `reset` when finished.
	    // Useful for bulk operations and optimizations.
	    reset: function(models, options) {
	      options = options ? _.clone(options) : {};
	      for (var i = 0; i < this.models.length; i++) {
	        this._removeReference(this.models[i], options);
	      }
	      options.previousModels = this.models;
	      this._reset();
	      models = this.add(models, _.extend({silent: true}, options));
	      if (!options.silent) this.trigger('reset', this, options);
	      return models;
	    },
	
	    // Add a model to the end of the collection.
	    push: function(model, options) {
	      return this.add(model, _.extend({at: this.length}, options));
	    },
	
	    // Remove a model from the end of the collection.
	    pop: function(options) {
	      var model = this.at(this.length - 1);
	      this.remove(model, options);
	      return model;
	    },
	
	    // Add a model to the beginning of the collection.
	    unshift: function(model, options) {
	      return this.add(model, _.extend({at: 0}, options));
	    },
	
	    // Remove a model from the beginning of the collection.
	    shift: function(options) {
	      var model = this.at(0);
	      this.remove(model, options);
	      return model;
	    },
	
	    // Slice out a sub-array of models from the collection.
	    slice: function() {
	      return slice.apply(this.models, arguments);
	    },
	
	    // Get a model from the set by id.
	    get: function(obj) {
	      if (obj == null) return void 0;
	      var id = this.modelId(this._isModel(obj) ? obj.attributes : obj);
	      return this._byId[obj] || this._byId[id] || this._byId[obj.cid];
	    },
	
	    // Get the model at the given index.
	    at: function(index) {
	      if (index < 0) index += this.length;
	      return this.models[index];
	    },
	
	    // Return models with matching attributes. Useful for simple cases of
	    // `filter`.
	    where: function(attrs, first) {
	      var matches = _.matches(attrs);
	      return this[first ? 'find' : 'filter'](function(model) {
	        return matches(model.attributes);
	      });
	    },
	
	    // Return the first model with matching attributes. Useful for simple cases
	    // of `find`.
	    findWhere: function(attrs) {
	      return this.where(attrs, true);
	    },
	
	    // Force the collection to re-sort itself. You don't need to call this under
	    // normal circumstances, as the set will maintain sort order as each item
	    // is added.
	    sort: function(options) {
	      if (!this.comparator) throw new Error('Cannot sort a set without a comparator');
	      options || (options = {});
	
	      // Run sort based on type of `comparator`.
	      if (_.isString(this.comparator) || this.comparator.length === 1) {
	        this.models = this.sortBy(this.comparator, this);
	      } else {
	        this.models.sort(_.bind(this.comparator, this));
	      }
	
	      if (!options.silent) this.trigger('sort', this, options);
	      return this;
	    },
	
	    // Pluck an attribute from each model in the collection.
	    pluck: function(attr) {
	      return _.invoke(this.models, 'get', attr);
	    },
	
	    // Fetch the default set of models for this collection, resetting the
	    // collection when they arrive. If `reset: true` is passed, the response
	    // data will be passed through the `reset` method instead of `set`.
	    fetch: function(options) {
	      options = options ? _.clone(options) : {};
	      if (options.parse === void 0) options.parse = true;
	      var success = options.success;
	      var collection = this;
	      options.success = function(resp) {
	        var method = options.reset ? 'reset' : 'set';
	        collection[method](resp, options);
	        if (success) success.call(options.context, collection, resp, options);
	        collection.trigger('sync', collection, resp, options);
	      };
	      wrapError(this, options);
	      return this.sync('read', this, options);
	    },
	
	    // Create a new instance of a model in this collection. Add the model to the
	    // collection immediately, unless `wait: true` is passed, in which case we
	    // wait for the server to agree.
	    create: function(model, options) {
	      options = options ? _.clone(options) : {};
	      var wait = options.wait;
	      if (!(model = this._prepareModel(model, options))) return false;
	      if (!wait) this.add(model, options);
	      var collection = this;
	      var success = options.success;
	      options.success = function(model, resp, callbackOpts) {
	        if (wait) collection.add(model, callbackOpts);
	        if (success) success.call(callbackOpts.context, model, resp, callbackOpts);
	      };
	      model.save(null, options);
	      return model;
	    },
	
	    // **parse** converts a response into a list of models to be added to the
	    // collection. The default implementation is just to pass it through.
	    parse: function(resp, options) {
	      return resp;
	    },
	
	    // Create a new collection with an identical list of models as this one.
	    clone: function() {
	      return new this.constructor(this.models, {
	        model: this.model,
	        comparator: this.comparator
	      });
	    },
	
	    // Define how to uniquely identify models in the collection.
	    modelId: function (attrs) {
	      return attrs[this.model.prototype.idAttribute || 'id'];
	    },
	
	    // Private method to reset all internal state. Called when the collection
	    // is first initialized or reset.
	    _reset: function() {
	      this.length = 0;
	      this.models = [];
	      this._byId  = {};
	    },
	
	    // Prepare a hash of attributes (or other model) to be added to this
	    // collection.
	    _prepareModel: function(attrs, options) {
	      if (this._isModel(attrs)) {
	        if (!attrs.collection) attrs.collection = this;
	        return attrs;
	      }
	      options = options ? _.clone(options) : {};
	      options.collection = this;
	      var model = new this.model(attrs, options);
	      if (!model.validationError) return model;
	      this.trigger('invalid', this, model.validationError, options);
	      return false;
	    },
	
	    // Internal method called by both remove and set. Does not trigger any
	    // additional events. Returns true if anything was actually removed.
	    _removeModels: function(models, options) {
	      var i, l, index, model, removed = false;
	      for (var i = 0, j = 0; i < models.length; i++) {
	        var model = models[i] = this.get(models[i]);
	        if (!model) continue;
	        var id = this.modelId(model.attributes);
	        if (id != null) delete this._byId[id];
	        delete this._byId[model.cid];
	        var index = this.indexOf(model);
	        this.models.splice(index, 1);
	        this.length--;
	        if (!options.silent) {
	          options.index = index;
	          model.trigger('remove', model, this, options);
	        }
	        models[j++] = model;
	        this._removeReference(model, options);
	        removed = true;
	      }
	      // We only need to slice if models array should be smaller, which is
	      // caused by some models not actually getting removed.
	      if (models.length !== j) models = models.slice(0, j);
	      return removed;
	    },
	
	    // Method for checking whether an object should be considered a model for
	    // the purposes of adding to the collection.
	    _isModel: function (model) {
	      return model instanceof Model;
	    },
	
	    // Internal method to create a model's ties to a collection.
	    _addReference: function(model, options) {
	      this._byId[model.cid] = model;
	      var id = this.modelId(model.attributes);
	      if (id != null) this._byId[id] = model;
	      model.on('all', this._onModelEvent, this);
	    },
	
	    // Internal method to sever a model's ties to a collection.
	    _removeReference: function(model, options) {
	      if (this === model.collection) delete model.collection;
	      model.off('all', this._onModelEvent, this);
	    },
	
	    // Internal method called every time a model in the set fires an event.
	    // Sets need to update their indexes when models change ids. All other
	    // events simply proxy through. "add" and "remove" events that originate
	    // in other collections are ignored.
	    _onModelEvent: function(event, model, collection, options) {
	      if ((event === 'add' || event === 'remove') && collection !== this) return;
	      if (event === 'destroy') this.remove(model, options);
	      if (event === 'change') {
	        var prevId = this.modelId(model.previousAttributes());
	        var id = this.modelId(model.attributes);
	        if (prevId !== id) {
	          if (prevId != null) delete this._byId[prevId];
	          if (id != null) this._byId[id] = model;
	        }
	      }
	      this.trigger.apply(this, arguments);
	    }
	
	  });
	
	  // Underscore methods that we want to implement on the Collection.
	  // 90% of the core usefulness of Backbone Collections is actually implemented
	  // right here:
	  var collectionMethods = { forEach: 3, each: 3, map: 3, collect: 3, reduce: 4,
	      foldl: 4, inject: 4, reduceRight: 4, foldr: 4, find: 3, detect: 3, filter: 3,
	      select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 2,
	      contains: 2, invoke: 2, max: 3, min: 3, toArray: 1, size: 1, first: 3,
	      head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,
	      without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,
	      isEmpty: 1, chain: 1, sample: 3, partition: 3 };
	
	  // Mix in each Underscore method as a proxy to `Collection#models`.
	  addUnderscoreMethods(Collection, collectionMethods, 'models');
	
	  // Underscore methods that take a property name as an argument.
	  var attributeMethods = ['groupBy', 'countBy', 'sortBy', 'indexBy'];
	
	  // Use attributes instead of properties.
	  _.each(attributeMethods, function(method) {
	    if (!_[method]) return;
	    Collection.prototype[method] = function(value, context) {
	      var iterator = _.isFunction(value) ? value : function(model) {
	        return model.get(value);
	      };
	      return _[method](this.models, iterator, context);
	    };
	  });
	
	  // Backbone.View
	  // -------------
	
	  // Backbone Views are almost more convention than they are actual code. A View
	  // is simply a JavaScript object that represents a logical chunk of UI in the
	  // DOM. This might be a single item, an entire list, a sidebar or panel, or
	  // even the surrounding frame which wraps your whole app. Defining a chunk of
	  // UI as a **View** allows you to define your DOM events declaratively, without
	  // having to worry about render order ... and makes it easy for the view to
	  // react to specific changes in the state of your models.
	
	  // Creating a Backbone.View creates its initial element outside of the DOM,
	  // if an existing element is not provided...
	  var View = Backbone.View = function(options) {
	    this.cid = _.uniqueId('view');
	    options || (options = {});
	    _.extend(this, _.pick(options, viewOptions));
	    this._ensureElement();
	    this.initialize.apply(this, arguments);
	  };
	
	  // Cached regex to split keys for `delegate`.
	  var delegateEventSplitter = /^(\S+)\s*(.*)$/;
	
	  // List of view options to be merged as properties.
	  var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];
	
	  // Set up all inheritable **Backbone.View** properties and methods.
	  _.extend(View.prototype, Events, {
	
	    // The default `tagName` of a View's element is `"div"`.
	    tagName: 'div',
	
	    // jQuery delegate for element lookup, scoped to DOM elements within the
	    // current view. This should be preferred to global lookups where possible.
	    $: function(selector) {
	      return this.$el.find(selector);
	    },
	
	    // Initialize is an empty function by default. Override it with your own
	    // initialization logic.
	    initialize: function(){},
	
	    // **render** is the core function that your view should override, in order
	    // to populate its element (`this.el`), with the appropriate HTML. The
	    // convention is for **render** to always return `this`.
	    render: function() {
	      return this;
	    },
	
	    // Remove this view by taking the element out of the DOM, and removing any
	    // applicable Backbone.Events listeners.
	    remove: function() {
	      this._removeElement();
	      this.stopListening();
	      return this;
	    },
	
	    // Remove this view's element from the document and all event listeners
	    // attached to it. Exposed for subclasses using an alternative DOM
	    // manipulation API.
	    _removeElement: function() {
	      this.$el.remove();
	    },
	
	    // Change the view's element (`this.el` property) and re-delegate the
	    // view's events on the new element.
	    setElement: function(element) {
	      this.undelegateEvents();
	      this._setElement(element);
	      this.delegateEvents();
	      return this;
	    },
	
	    // Creates the `this.el` and `this.$el` references for this view using the
	    // given `el`. `el` can be a CSS selector or an HTML string, a jQuery
	    // context or an element. Subclasses can override this to utilize an
	    // alternative DOM manipulation API and are only required to set the
	    // `this.el` property.
	    _setElement: function(el) {
	      this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);
	      this.el = this.$el[0];
	    },
	
	    // Set callbacks, where `this.events` is a hash of
	    //
	    // *{"event selector": "callback"}*
	    //
	    //     {
	    //       'mousedown .title':  'edit',
	    //       'click .button':     'save',
	    //       'click .open':       function(e) { ... }
	    //     }
	    //
	    // pairs. Callbacks will be bound to the view, with `this` set properly.
	    // Uses event delegation for efficiency.
	    // Omitting the selector binds the event to `this.el`.
	    delegateEvents: function(events) {
	      if (!(events || (events = _.result(this, 'events')))) return this;
	      this.undelegateEvents();
	      for (var key in events) {
	        var method = events[key];
	        if (!_.isFunction(method)) method = this[events[key]];
	        if (!method) continue;
	        var match = key.match(delegateEventSplitter);
	        this.delegate(match[1], match[2], _.bind(method, this));
	      }
	      return this;
	    },
	
	    // Add a single event listener to the view's element (or a child element
	    // using `selector`). This only works for delegate-able events: not `focus`,
	    // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.
	    delegate: function(eventName, selector, listener) {
	      this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);
	    },
	
	    // Clears all callbacks previously bound to the view by `delegateEvents`.
	    // You usually don't need to use this, but may wish to if you have multiple
	    // Backbone views attached to the same DOM element.
	    undelegateEvents: function() {
	      if (this.$el) this.$el.off('.delegateEvents' + this.cid);
	      return this;
	    },
	
	    // A finer-grained `undelegateEvents` for removing a single delegated event.
	    // `selector` and `listener` are both optional.
	    undelegate: function(eventName, selector, listener) {
	      this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);
	    },
	
	    // Produces a DOM element to be assigned to your view. Exposed for
	    // subclasses using an alternative DOM manipulation API.
	    _createElement: function(tagName) {
	      return document.createElement(tagName);
	    },
	
	    // Ensure that the View has a DOM element to render into.
	    // If `this.el` is a string, pass it through `$()`, take the first
	    // matching element, and re-assign it to `el`. Otherwise, create
	    // an element from the `id`, `className` and `tagName` properties.
	    _ensureElement: function() {
	      if (!this.el) {
	        var attrs = _.extend({}, _.result(this, 'attributes'));
	        if (this.id) attrs.id = _.result(this, 'id');
	        if (this.className) attrs['class'] = _.result(this, 'className');
	        this.setElement(this._createElement(_.result(this, 'tagName')));
	        this._setAttributes(attrs);
	      } else {
	        this.setElement(_.result(this, 'el'));
	      }
	    },
	
	    // Set attributes from a hash on this view's element.  Exposed for
	    // subclasses using an alternative DOM manipulation API.
	    _setAttributes: function(attributes) {
	      this.$el.attr(attributes);
	    }
	
	  });
	
	  // Backbone.sync
	  // -------------
	
	  // Override this function to change the manner in which Backbone persists
	  // models to the server. You will be passed the type of request, and the
	  // model in question. By default, makes a RESTful Ajax request
	  // to the model's `url()`. Some possible customizations could be:
	  //
	  // * Use `setTimeout` to batch rapid-fire updates into a single request.
	  // * Send up the models as XML instead of JSON.
	  // * Persist models via WebSockets instead of Ajax.
	  //
	  // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
	  // as `POST`, with a `_method` parameter containing the true HTTP method,
	  // as well as all requests with the body as `application/x-www-form-urlencoded`
	  // instead of `application/json` with the model in a param named `model`.
	  // Useful when interfacing with server-side languages like **PHP** that make
	  // it difficult to read the body of `PUT` requests.
	  Backbone.sync = function(method, model, options) {
	    var type = methodMap[method];
	
	    // Default options, unless specified.
	    _.defaults(options || (options = {}), {
	      emulateHTTP: Backbone.emulateHTTP,
	      emulateJSON: Backbone.emulateJSON
	    });
	
	    // Default JSON-request options.
	    var params = {type: type, dataType: 'json'};
	
	    // Ensure that we have a URL.
	    if (!options.url) {
	      params.url = _.result(model, 'url') || urlError();
	    }
	
	    // Ensure that we have the appropriate request data.
	    if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
	      params.contentType = 'application/json';
	      params.data = JSON.stringify(options.attrs || model.toJSON(options));
	    }
	
	    // For older servers, emulate JSON by encoding the request into an HTML-form.
	    if (options.emulateJSON) {
	      params.contentType = 'application/x-www-form-urlencoded';
	      params.data = params.data ? {model: params.data} : {};
	    }
	
	    // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
	    // And an `X-HTTP-Method-Override` header.
	    if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
	      params.type = 'POST';
	      if (options.emulateJSON) params.data._method = type;
	      var beforeSend = options.beforeSend;
	      options.beforeSend = function(xhr) {
	        xhr.setRequestHeader('X-HTTP-Method-Override', type);
	        if (beforeSend) return beforeSend.apply(this, arguments);
	      };
	    }
	
	    // Don't process data on a non-GET request.
	    if (params.type !== 'GET' && !options.emulateJSON) {
	      params.processData = false;
	    }
	
	    // Pass along `textStatus` and `errorThrown` from jQuery.
	    var error = options.error;
	    options.error = function(xhr, textStatus, errorThrown) {
	      options.textStatus = textStatus;
	      options.errorThrown = errorThrown;
	      if (error) error.call(options.context, xhr, textStatus, errorThrown);
	    };
	
	    // Make the request, allowing the user to override any Ajax options.
	    var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
	    model.trigger('request', model, xhr, options);
	    return xhr;
	  };
	
	  // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
	  var methodMap = {
	    'create': 'POST',
	    'update': 'PUT',
	    'patch':  'PATCH',
	    'delete': 'DELETE',
	    'read':   'GET'
	  };
	
	  // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
	  // Override this if you'd like to use a different library.
	  Backbone.ajax = function() {
	    return Backbone.$.ajax.apply(Backbone.$, arguments);
	  };
	
	  // Backbone.Router
	  // ---------------
	
	  // Routers map faux-URLs to actions, and fire events when routes are
	  // matched. Creating a new one sets its `routes` hash, if not set statically.
	  var Router = Backbone.Router = function(options) {
	    options || (options = {});
	    if (options.routes) this.routes = options.routes;
	    this._bindRoutes();
	    this.initialize.apply(this, arguments);
	  };
	
	  // Cached regular expressions for matching named param parts and splatted
	  // parts of route strings.
	  var optionalParam = /\((.*?)\)/g;
	  var namedParam    = /(\(\?)?:\w+/g;
	  var splatParam    = /\*\w+/g;
	  var escapeRegExp  = /[\-{}\[\]+?.,\\\^$|#\s]/g;
	
	  // Set up all inheritable **Backbone.Router** properties and methods.
	  _.extend(Router.prototype, Events, {
	
	    // Initialize is an empty function by default. Override it with your own
	    // initialization logic.
	    initialize: function(){},
	
	    // Manually bind a single named route to a callback. For example:
	    //
	    //     this.route('search/:query/p:num', 'search', function(query, num) {
	    //       ...
	    //     });
	    //
	    route: function(route, name, callback) {
	      if (!_.isRegExp(route)) route = this._routeToRegExp(route);
	      if (_.isFunction(name)) {
	        callback = name;
	        name = '';
	      }
	      if (!callback) callback = this[name];
	      var router = this;
	      Backbone.history.route(route, function(fragment) {
	        var args = router._extractParameters(route, fragment);
	        if (router.execute(callback, args, name) !== false) {
	          router.trigger.apply(router, ['route:' + name].concat(args));
	          router.trigger('route', name, args);
	          Backbone.history.trigger('route', router, name, args);
	        }
	      });
	      return this;
	    },
	
	    // Execute a route handler with the provided parameters.  This is an
	    // excellent place to do pre-route setup or post-route cleanup.
	    execute: function(callback, args, name) {
	      if (callback) callback.apply(this, args);
	    },
	
	    // Simple proxy to `Backbone.history` to save a fragment into the history.
	    navigate: function(fragment, options) {
	      Backbone.history.navigate(fragment, options);
	      return this;
	    },
	
	    // Bind all defined routes to `Backbone.history`. We have to reverse the
	    // order of the routes here to support behavior where the most general
	    // routes can be defined at the bottom of the route map.
	    _bindRoutes: function() {
	      if (!this.routes) return;
	      this.routes = _.result(this, 'routes');
	      var route, routes = _.keys(this.routes);
	      while ((route = routes.pop()) != null) {
	        this.route(route, this.routes[route]);
	      }
	    },
	
	    // Convert a route string into a regular expression, suitable for matching
	    // against the current location hash.
	    _routeToRegExp: function(route) {
	      route = route.replace(escapeRegExp, '\\$&')
	                   .replace(optionalParam, '(?:$1)?')
	                   .replace(namedParam, function(match, optional) {
	                     return optional ? match : '([^/?]+)';
	                   })
	                   .replace(splatParam, '([^?]*?)');
	      return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
	    },
	
	    // Given a route, and a URL fragment that it matches, return the array of
	    // extracted decoded parameters. Empty or unmatched parameters will be
	    // treated as `null` to normalize cross-browser behavior.
	    _extractParameters: function(route, fragment) {
	      var params = route.exec(fragment).slice(1);
	      return _.map(params, function(param, i) {
	        // Don't decode the search params.
	        if (i === params.length - 1) return param || null;
	        return param ? decodeURIComponent(param) : null;
	      });
	    }
	
	  });
	
	  // Backbone.History
	  // ----------------
	
	  // Handles cross-browser history management, based on either
	  // [pushState](http://diveintohtml5.info/history.html) and real URLs, or
	  // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)
	  // and URL fragments. If the browser supports neither (old IE, natch),
	  // falls back to polling.
	  var History = Backbone.History = function() {
	    this.handlers = [];
	    _.bindAll(this, 'checkUrl');
	
	    // Ensure that `History` can be used outside of the browser.
	    if (typeof window !== 'undefined') {
	      this.location = window.location;
	      this.history = window.history;
	    }
	  };
	
	  // Cached regex for stripping a leading hash/slash and trailing space.
	  var routeStripper = /^[#\/]|\s+$/g;
	
	  // Cached regex for stripping leading and trailing slashes.
	  var rootStripper = /^\/+|\/+$/g;
	
	  // Cached regex for stripping urls of hash.
	  var pathStripper = /#.*$/;
	
	  // Has the history handling already been started?
	  History.started = false;
	
	  // Set up all inheritable **Backbone.History** properties and methods.
	  _.extend(History.prototype, Events, {
	
	    // The default interval to poll for hash changes, if necessary, is
	    // twenty times a second.
	    interval: 50,
	
	    // Are we at the app root?
	    atRoot: function() {
	      var path = this.location.pathname.replace(/[^\/]$/, '$&/');
	      return path === this.root && !this.getSearch();
	    },
	
	    // Does the pathname match the root?
	    matchRoot: function() {
	      var path = this.decodeFragment(this.location.pathname);
	      var root = path.slice(0, this.root.length - 1) + '/';
	      return root === this.root;
	    },
	
	    // Unicode characters in `location.pathname` are percent encoded so they're
	    // decoded for comparison. `%25` should not be decoded since it may be part
	    // of an encoded parameter.
	    decodeFragment: function(fragment) {
	      return decodeURI(fragment.replace(/%25/g, '%2525'));
	    },
	
	    // In IE6, the hash fragment and search params are incorrect if the
	    // fragment contains `?`.
	    getSearch: function() {
	      var match = this.location.href.replace(/#.*/, '').match(/\?.+/);
	      return match ? match[0] : '';
	    },
	
	    // Gets the true hash value. Cannot use location.hash directly due to bug
	    // in Firefox where location.hash will always be decoded.
	    getHash: function(window) {
	      var match = (window || this).location.href.match(/#(.*)$/);
	      return match ? match[1] : '';
	    },
	
	    // Get the pathname and search params, without the root.
	    getPath: function() {
	      var path = this.decodeFragment(
	        this.location.pathname + this.getSearch()
	      ).slice(this.root.length - 1);
	      return path.charAt(0) === '/' ? path.slice(1) : path;
	    },
	
	    // Get the cross-browser normalized URL fragment from the path or hash.
	    getFragment: function(fragment) {
	      if (fragment == null) {
	        if (this._usePushState || !this._wantsHashChange) {
	          fragment = this.getPath();
	        } else {
	          fragment = this.getHash();
	        }
	      }
	      return fragment.replace(routeStripper, '');
	    },
	
	    // Start the hash change handling, returning `true` if the current URL matches
	    // an existing route, and `false` otherwise.
	    start: function(options) {
	      if (History.started) throw new Error('Backbone.history has already been started');
	      History.started = true;
	
	      // Figure out the initial configuration. Do we need an iframe?
	      // Is pushState desired ... is it available?
	      this.options          = _.extend({root: '/'}, this.options, options);
	      this.root             = this.options.root;
	      this._wantsHashChange = this.options.hashChange !== false;
	      this._hasHashChange   = 'onhashchange' in window;
	      this._useHashChange   = this._wantsHashChange && this._hasHashChange;
	      this._wantsPushState  = !!this.options.pushState;
	      this._hasPushState    = !!(this.history && this.history.pushState);
	      this._usePushState    = this._wantsPushState && this._hasPushState;
	      this.fragment         = this.getFragment();
	
	      // Normalize root to always include a leading and trailing slash.
	      this.root = ('/' + this.root + '/').replace(rootStripper, '/');
	
	      // Transition from hashChange to pushState or vice versa if both are
	      // requested.
	      if (this._wantsHashChange && this._wantsPushState) {
	
	        // If we've started off with a route from a `pushState`-enabled
	        // browser, but we're currently in a browser that doesn't support it...
	        if (!this._hasPushState && !this.atRoot()) {
	          var root = this.root.slice(0, -1) || '/';
	          this.location.replace(root + '#' + this.getPath());
	          // Return immediately as browser will do redirect to new url
	          return true;
	
	        // Or if we've started out with a hash-based route, but we're currently
	        // in a browser where it could be `pushState`-based instead...
	        } else if (this._hasPushState && this.atRoot()) {
	          this.navigate(this.getHash(), {replace: true});
	        }
	
	      }
	
	      // Proxy an iframe to handle location events if the browser doesn't
	      // support the `hashchange` event, HTML5 history, or the user wants
	      // `hashChange` but not `pushState`.
	      if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {
	        var iframe = document.createElement('iframe');
	        iframe.src = 'javascript:0';
	        iframe.style.display = 'none';
	        iframe.tabIndex = -1;
	        var body = document.body;
	        // Using `appendChild` will throw on IE < 9 if the document is not ready.
	        this.iframe = body.insertBefore(iframe, body.firstChild).contentWindow;
	        this.iframe.document.open().close();
	        this.iframe.location.hash = '#' + this.fragment;
	      }
	
	      // Add a cross-platform `addEventListener` shim for older browsers.
	      var addEventListener = window.addEventListener || function (eventName, listener) {
	        return attachEvent('on' + eventName, listener);
	      };
	
	      // Depending on whether we're using pushState or hashes, and whether
	      // 'onhashchange' is supported, determine how we check the URL state.
	      if (this._usePushState) {
	        addEventListener('popstate', this.checkUrl, false);
	      } else if (this._useHashChange && !this.iframe) {
	        addEventListener('hashchange', this.checkUrl, false);
	      } else if (this._wantsHashChange) {
	        this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
	      }
	
	      if (!this.options.silent) return this.loadUrl();
	    },
	
	    // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
	    // but possibly useful for unit testing Routers.
	    stop: function() {
	      // Add a cross-platform `removeEventListener` shim for older browsers.
	      var removeEventListener = window.removeEventListener || function (eventName, listener) {
	        return detachEvent('on' + eventName, listener);
	      };
	
	      // Remove window listeners.
	      if (this._usePushState) {
	        removeEventListener('popstate', this.checkUrl, false);
	      } else if (this._useHashChange && !this.iframe) {
	        removeEventListener('hashchange', this.checkUrl, false);
	      }
	
	      // Clean up the iframe if necessary.
	      if (this.iframe) {
	        document.body.removeChild(this.iframe.frameElement);
	        this.iframe = null;
	      }
	
	      // Some environments will throw when clearing an undefined interval.
	      if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);
	      History.started = false;
	    },
	
	    // Add a route to be tested when the fragment changes. Routes added later
	    // may override previous routes.
	    route: function(route, callback) {
	      this.handlers.unshift({route: route, callback: callback});
	    },
	
	    // Checks the current URL to see if it has changed, and if it has,
	    // calls `loadUrl`, normalizing across the hidden iframe.
	    checkUrl: function(e) {
	      var current = this.getFragment();
	
	      // If the user pressed the back button, the iframe's hash will have
	      // changed and we should use that for comparison.
	      if (current === this.fragment && this.iframe) {
	        current = this.getHash(this.iframe);
	      }
	
	      if (current === this.fragment) return false;
	      if (this.iframe) this.navigate(current);
	      this.loadUrl();
	    },
	
	    // Attempt to load the current URL fragment. If a route succeeds with a
	    // match, returns `true`. If no defined routes matches the fragment,
	    // returns `false`.
	    loadUrl: function(fragment) {
	      // If the root doesn't match, no routes can match either.
	      if (!this.matchRoot()) return false;
	      fragment = this.fragment = this.getFragment(fragment);
	      return _.any(this.handlers, function(handler) {
	        if (handler.route.test(fragment)) {
	          handler.callback(fragment);
	          return true;
	        }
	      });
	    },
	
	    // Save a fragment into the hash history, or replace the URL state if the
	    // 'replace' option is passed. You are responsible for properly URL-encoding
	    // the fragment in advance.
	    //
	    // The options object can contain `trigger: true` if you wish to have the
	    // route callback be fired (not usually desirable), or `replace: true`, if
	    // you wish to modify the current URL without adding an entry to the history.
	    navigate: function(fragment, options) {
	      if (!History.started) return false;
	      if (!options || options === true) options = {trigger: !!options};
	
	      // Normalize the fragment.
	      fragment = this.getFragment(fragment || '');
	
	      // Don't include a trailing slash on the root.
	      var root = this.root;
	      if (fragment === '' || fragment.charAt(0) === '?') {
	        root = root.slice(0, -1) || '/';
	      }
	      var url = root + fragment;
	
	      // Strip the hash and decode for matching.
	      fragment = this.decodeFragment(fragment.replace(pathStripper, ''));
	
	      if (this.fragment === fragment) return;
	      this.fragment = fragment;
	
	      // If pushState is available, we use it to set the fragment as a real URL.
	      if (this._usePushState) {
	        this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);
	
	      // If hash changes haven't been explicitly disabled, update the hash
	      // fragment to store history.
	      } else if (this._wantsHashChange) {
	        this._updateHash(this.location, fragment, options.replace);
	        if (this.iframe && (fragment !== this.getHash(this.iframe))) {
	          // Opening and closing the iframe tricks IE7 and earlier to push a
	          // history entry on hash-tag change.  When replace is true, we don't
	          // want this.
	          if (!options.replace) this.iframe.document.open().close();
	          this._updateHash(this.iframe.location, fragment, options.replace);
	        }
	
	      // If you've told us that you explicitly don't want fallback hashchange-
	      // based history, then `navigate` becomes a page refresh.
	      } else {
	        return this.location.assign(url);
	      }
	      if (options.trigger) return this.loadUrl(fragment);
	    },
	
	    // Update the hash location, either replacing the current entry, or adding
	    // a new one to the browser history.
	    _updateHash: function(location, fragment, replace) {
	      if (replace) {
	        var href = location.href.replace(/(javascript:|#).*$/, '');
	        location.replace(href + '#' + fragment);
	      } else {
	        // Some browsers require that `hash` contains a leading #.
	        location.hash = '#' + fragment;
	      }
	    }
	
	  });
	
	  // Create the default Backbone.history.
	  Backbone.history = new History;
	
	  // Helpers
	  // -------
	
	  // Helper function to correctly set up the prototype chain for subclasses.
	  // Similar to `goog.inherits`, but uses a hash of prototype properties and
	  // class properties to be extended.
	  var extend = function(protoProps, staticProps) {
	    var parent = this;
	    var child;
	
	    // The constructor function for the new subclass is either defined by you
	    // (the "constructor" property in your `extend` definition), or defaulted
	    // by us to simply call the parent constructor.
	    if (protoProps && _.has(protoProps, 'constructor')) {
	      child = protoProps.constructor;
	    } else {
	      child = function(){ return parent.apply(this, arguments); };
	    }
	
	    // Add static properties to the constructor function, if supplied.
	    _.extend(child, parent, staticProps);
	
	    // Set the prototype chain to inherit from `parent`, without calling
	    // `parent` constructor function.
	    var Surrogate = function(){ this.constructor = child; };
	    Surrogate.prototype = parent.prototype;
	    child.prototype = new Surrogate;
	
	    // Add prototype properties (instance properties) to the subclass,
	    // if supplied.
	    if (protoProps) _.extend(child.prototype, protoProps);
	
	    // Set a convenience property in case the parent's prototype is needed
	    // later.
	    child.__super__ = parent.prototype;
	
	    return child;
	  };
	
	  // Set up inheritance for the model, collection, router, view and history.
	  Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;
	
	  // Throw an error when a URL is needed, and none is supplied.
	  var urlError = function() {
	    throw new Error('A "url" property or function must be specified');
	  };
	
	  // Wrap an optional error callback with a fallback error event.
	  var wrapError = function(model, options) {
	    var error = options.error;
	    options.error = function(resp) {
	      if (error) error.call(options.context, model, resp, options);
	      model.trigger('error', model, resp, options);
	    };
	  };
	
	  return Backbone;
	
	}));
	
	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
})
/** END DEFINE BLOCK for backbone@1.2.0/backbone.js **/


/** START DEFINE BLOCK for jquery@2.2.4/dist/jquery.js **/
jupyter.define('jquery@2.2.4/dist/jquery.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery JavaScript Library v2.2.4
	 * http://jquery.com/
	 *
	 * Includes Sizzle.js
	 * http://sizzlejs.com/
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license
	 * http://jquery.org/license
	 *
	 * Date: 2016-05-20T17:23Z
	 */
	
	(function( global, factory ) {
	
		if ( typeof module === "object" && typeof module.exports === "object" ) {
			// For CommonJS and CommonJS-like environments where a proper `window`
			// is present, execute the factory and get jQuery.
			// For environments that do not have a `window` with a `document`
			// (such as Node.js), expose a factory as module.exports.
			// This accentuates the need for the creation of a real `window`.
			// e.g. var jQuery = require("jquery")(window);
			// See ticket #14549 for more info.
			module.exports = global.document ?
				factory( global, true ) :
				function( w ) {
					if ( !w.document ) {
						throw new Error( "jQuery requires a window with a document" );
					}
					return factory( w );
				};
		} else {
			factory( global );
		}
	
	// Pass this if window is not defined yet
	}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
	
	// Support: Firefox 18+
	// Can't be in strict mode, several libs including ASP.NET trace
	// the stack via arguments.caller.callee and Firefox dies if
	// you try to trace through "use strict" call chains. (#13335)
	//"use strict";
	var arr = [];
	
	var document = window.document;
	
	var slice = arr.slice;
	
	var concat = arr.concat;
	
	var push = arr.push;
	
	var indexOf = arr.indexOf;
	
	var class2type = {};
	
	var toString = class2type.toString;
	
	var hasOwn = class2type.hasOwnProperty;
	
	var support = {};
	
	
	
	var
		version = "2.2.4",
	
		// Define a local copy of jQuery
		jQuery = function( selector, context ) {
	
			// The jQuery object is actually just the init constructor 'enhanced'
			// Need init if jQuery is called (just allow error to be thrown if not included)
			return new jQuery.fn.init( selector, context );
		},
	
		// Support: Android<4.1
		// Make sure we trim BOM and NBSP
		rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
	
		// Matches dashed string for camelizing
		rmsPrefix = /^-ms-/,
		rdashAlpha = /-([\da-z])/gi,
	
		// Used by jQuery.camelCase as callback to replace()
		fcamelCase = function( all, letter ) {
			return letter.toUpperCase();
		};
	
	jQuery.fn = jQuery.prototype = {
	
		// The current version of jQuery being used
		jquery: version,
	
		constructor: jQuery,
	
		// Start with an empty selector
		selector: "",
	
		// The default length of a jQuery object is 0
		length: 0,
	
		toArray: function() {
			return slice.call( this );
		},
	
		// Get the Nth element in the matched element set OR
		// Get the whole matched element set as a clean array
		get: function( num ) {
			return num != null ?
	
				// Return just the one element from the set
				( num < 0 ? this[ num + this.length ] : this[ num ] ) :
	
				// Return all the elements in a clean array
				slice.call( this );
		},
	
		// Take an array of elements and push it onto the stack
		// (returning the new matched element set)
		pushStack: function( elems ) {
	
			// Build a new jQuery matched element set
			var ret = jQuery.merge( this.constructor(), elems );
	
			// Add the old object onto the stack (as a reference)
			ret.prevObject = this;
			ret.context = this.context;
	
			// Return the newly-formed element set
			return ret;
		},
	
		// Execute a callback for every element in the matched set.
		each: function( callback ) {
			return jQuery.each( this, callback );
		},
	
		map: function( callback ) {
			return this.pushStack( jQuery.map( this, function( elem, i ) {
				return callback.call( elem, i, elem );
			} ) );
		},
	
		slice: function() {
			return this.pushStack( slice.apply( this, arguments ) );
		},
	
		first: function() {
			return this.eq( 0 );
		},
	
		last: function() {
			return this.eq( -1 );
		},
	
		eq: function( i ) {
			var len = this.length,
				j = +i + ( i < 0 ? len : 0 );
			return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
		},
	
		end: function() {
			return this.prevObject || this.constructor();
		},
	
		// For internal use only.
		// Behaves like an Array's method, not like a jQuery method.
		push: push,
		sort: arr.sort,
		splice: arr.splice
	};
	
	jQuery.extend = jQuery.fn.extend = function() {
		var options, name, src, copy, copyIsArray, clone,
			target = arguments[ 0 ] || {},
			i = 1,
			length = arguments.length,
			deep = false;
	
		// Handle a deep copy situation
		if ( typeof target === "boolean" ) {
			deep = target;
	
			// Skip the boolean and the target
			target = arguments[ i ] || {};
			i++;
		}
	
		// Handle case when target is a string or something (possible in deep copy)
		if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
			target = {};
		}
	
		// Extend jQuery itself if only one argument is passed
		if ( i === length ) {
			target = this;
			i--;
		}
	
		for ( ; i < length; i++ ) {
	
			// Only deal with non-null/undefined values
			if ( ( options = arguments[ i ] ) != null ) {
	
				// Extend the base object
				for ( name in options ) {
					src = target[ name ];
					copy = options[ name ];
	
					// Prevent never-ending loop
					if ( target === copy ) {
						continue;
					}
	
					// Recurse if we're merging plain objects or arrays
					if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
						( copyIsArray = jQuery.isArray( copy ) ) ) ) {
	
						if ( copyIsArray ) {
							copyIsArray = false;
							clone = src && jQuery.isArray( src ) ? src : [];
	
						} else {
							clone = src && jQuery.isPlainObject( src ) ? src : {};
						}
	
						// Never move original objects, clone them
						target[ name ] = jQuery.extend( deep, clone, copy );
	
					// Don't bring in undefined values
					} else if ( copy !== undefined ) {
						target[ name ] = copy;
					}
				}
			}
		}
	
		// Return the modified object
		return target;
	};
	
	jQuery.extend( {
	
		// Unique for each copy of jQuery on the page
		expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
	
		// Assume jQuery is ready without the ready module
		isReady: true,
	
		error: function( msg ) {
			throw new Error( msg );
		},
	
		noop: function() {},
	
		isFunction: function( obj ) {
			return jQuery.type( obj ) === "function";
		},
	
		isArray: Array.isArray,
	
		isWindow: function( obj ) {
			return obj != null && obj === obj.window;
		},
	
		isNumeric: function( obj ) {
	
			// parseFloat NaNs numeric-cast false positives (null|true|false|"")
			// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
			// subtraction forces infinities to NaN
			// adding 1 corrects loss of precision from parseFloat (#15100)
			var realStringObj = obj && obj.toString();
			return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
		},
	
		isPlainObject: function( obj ) {
			var key;
	
			// Not plain objects:
			// - Any object or value whose internal [[Class]] property is not "[object Object]"
			// - DOM nodes
			// - window
			if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
				return false;
			}
	
			// Not own constructor property must be Object
			if ( obj.constructor &&
					!hasOwn.call( obj, "constructor" ) &&
					!hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) {
				return false;
			}
	
			// Own properties are enumerated firstly, so to speed up,
			// if last one is own, then all properties are own
			for ( key in obj ) {}
	
			return key === undefined || hasOwn.call( obj, key );
		},
	
		isEmptyObject: function( obj ) {
			var name;
			for ( name in obj ) {
				return false;
			}
			return true;
		},
	
		type: function( obj ) {
			if ( obj == null ) {
				return obj + "";
			}
	
			// Support: Android<4.0, iOS<6 (functionish RegExp)
			return typeof obj === "object" || typeof obj === "function" ?
				class2type[ toString.call( obj ) ] || "object" :
				typeof obj;
		},
	
		// Evaluates a script in a global context
		globalEval: function( code ) {
			var script,
				indirect = eval;
	
			code = jQuery.trim( code );
	
			if ( code ) {
	
				// If the code includes a valid, prologue position
				// strict mode pragma, execute code by injecting a
				// script tag into the document.
				if ( code.indexOf( "use strict" ) === 1 ) {
					script = document.createElement( "script" );
					script.text = code;
					document.head.appendChild( script ).parentNode.removeChild( script );
				} else {
	
					// Otherwise, avoid the DOM node creation, insertion
					// and removal by using an indirect global eval
	
					indirect( code );
				}
			}
		},
	
		// Convert dashed to camelCase; used by the css and data modules
		// Support: IE9-11+
		// Microsoft forgot to hump their vendor prefix (#9572)
		camelCase: function( string ) {
			return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
		},
	
		nodeName: function( elem, name ) {
			return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
		},
	
		each: function( obj, callback ) {
			var length, i = 0;
	
			if ( isArrayLike( obj ) ) {
				length = obj.length;
				for ( ; i < length; i++ ) {
					if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
						break;
					}
				}
			} else {
				for ( i in obj ) {
					if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
						break;
					}
				}
			}
	
			return obj;
		},
	
		// Support: Android<4.1
		trim: function( text ) {
			return text == null ?
				"" :
				( text + "" ).replace( rtrim, "" );
		},
	
		// results is for internal usage only
		makeArray: function( arr, results ) {
			var ret = results || [];
	
			if ( arr != null ) {
				if ( isArrayLike( Object( arr ) ) ) {
					jQuery.merge( ret,
						typeof arr === "string" ?
						[ arr ] : arr
					);
				} else {
					push.call( ret, arr );
				}
			}
	
			return ret;
		},
	
		inArray: function( elem, arr, i ) {
			return arr == null ? -1 : indexOf.call( arr, elem, i );
		},
	
		merge: function( first, second ) {
			var len = +second.length,
				j = 0,
				i = first.length;
	
			for ( ; j < len; j++ ) {
				first[ i++ ] = second[ j ];
			}
	
			first.length = i;
	
			return first;
		},
	
		grep: function( elems, callback, invert ) {
			var callbackInverse,
				matches = [],
				i = 0,
				length = elems.length,
				callbackExpect = !invert;
	
			// Go through the array, only saving the items
			// that pass the validator function
			for ( ; i < length; i++ ) {
				callbackInverse = !callback( elems[ i ], i );
				if ( callbackInverse !== callbackExpect ) {
					matches.push( elems[ i ] );
				}
			}
	
			return matches;
		},
	
		// arg is for internal usage only
		map: function( elems, callback, arg ) {
			var length, value,
				i = 0,
				ret = [];
	
			// Go through the array, translating each of the items to their new values
			if ( isArrayLike( elems ) ) {
				length = elems.length;
				for ( ; i < length; i++ ) {
					value = callback( elems[ i ], i, arg );
	
					if ( value != null ) {
						ret.push( value );
					}
				}
	
			// Go through every key on the object,
			} else {
				for ( i in elems ) {
					value = callback( elems[ i ], i, arg );
	
					if ( value != null ) {
						ret.push( value );
					}
				}
			}
	
			// Flatten any nested arrays
			return concat.apply( [], ret );
		},
	
		// A global GUID counter for objects
		guid: 1,
	
		// Bind a function to a context, optionally partially applying any
		// arguments.
		proxy: function( fn, context ) {
			var tmp, args, proxy;
	
			if ( typeof context === "string" ) {
				tmp = fn[ context ];
				context = fn;
				fn = tmp;
			}
	
			// Quick check to determine if target is callable, in the spec
			// this throws a TypeError, but we will just return undefined.
			if ( !jQuery.isFunction( fn ) ) {
				return undefined;
			}
	
			// Simulated bind
			args = slice.call( arguments, 2 );
			proxy = function() {
				return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
			};
	
			// Set the guid of unique handler to the same of original handler, so it can be removed
			proxy.guid = fn.guid = fn.guid || jQuery.guid++;
	
			return proxy;
		},
	
		now: Date.now,
	
		// jQuery.support is not used in Core but other projects attach their
		// properties to it so it needs to exist.
		support: support
	} );
	
	// JSHint would error on this code due to the Symbol not being defined in ES5.
	// Defining this global in .jshintrc would create a danger of using the global
	// unguarded in another place, it seems safer to just disable JSHint for these
	// three lines.
	/* jshint ignore: start */
	if ( typeof Symbol === "function" ) {
		jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
	}
	/* jshint ignore: end */
	
	// Populate the class2type map
	jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
	function( i, name ) {
		class2type[ "[object " + name + "]" ] = name.toLowerCase();
	} );
	
	function isArrayLike( obj ) {
	
		// Support: iOS 8.2 (not reproducible in simulator)
		// `in` check used to prevent JIT error (gh-2145)
		// hasOwn isn't used here due to false negatives
		// regarding Nodelist length in IE
		var length = !!obj && "length" in obj && obj.length,
			type = jQuery.type( obj );
	
		if ( type === "function" || jQuery.isWindow( obj ) ) {
			return false;
		}
	
		return type === "array" || length === 0 ||
			typeof length === "number" && length > 0 && ( length - 1 ) in obj;
	}
	var Sizzle =
	/*!
	 * Sizzle CSS Selector Engine v2.2.1
	 * http://sizzlejs.com/
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license
	 * http://jquery.org/license
	 *
	 * Date: 2015-10-17
	 */
	(function( window ) {
	
	var i,
		support,
		Expr,
		getText,
		isXML,
		tokenize,
		compile,
		select,
		outermostContext,
		sortInput,
		hasDuplicate,
	
		// Local document vars
		setDocument,
		document,
		docElem,
		documentIsHTML,
		rbuggyQSA,
		rbuggyMatches,
		matches,
		contains,
	
		// Instance-specific data
		expando = "sizzle" + 1 * new Date(),
		preferredDoc = window.document,
		dirruns = 0,
		done = 0,
		classCache = createCache(),
		tokenCache = createCache(),
		compilerCache = createCache(),
		sortOrder = function( a, b ) {
			if ( a === b ) {
				hasDuplicate = true;
			}
			return 0;
		},
	
		// General-purpose constants
		MAX_NEGATIVE = 1 << 31,
	
		// Instance methods
		hasOwn = ({}).hasOwnProperty,
		arr = [],
		pop = arr.pop,
		push_native = arr.push,
		push = arr.push,
		slice = arr.slice,
		// Use a stripped-down indexOf as it's faster than native
		// http://jsperf.com/thor-indexof-vs-for/5
		indexOf = function( list, elem ) {
			var i = 0,
				len = list.length;
			for ( ; i < len; i++ ) {
				if ( list[i] === elem ) {
					return i;
				}
			}
			return -1;
		},
	
		booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
	
		// Regular expressions
	
		// http://www.w3.org/TR/css3-selectors/#whitespace
		whitespace = "[\\x20\\t\\r\\n\\f]",
	
		// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
		identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
	
		// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
		attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
			// Operator (capture 2)
			"*([*^$|!~]?=)" + whitespace +
			// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
			"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
			"*\\]",
	
		pseudos = ":(" + identifier + ")(?:\\((" +
			// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
			// 1. quoted (capture 3; capture 4 or capture 5)
			"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
			// 2. simple (capture 6)
			"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
			// 3. anything else (capture 2)
			".*" +
			")\\)|)",
	
		// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
		rwhitespace = new RegExp( whitespace + "+", "g" ),
		rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
	
		rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
		rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
	
		rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
	
		rpseudo = new RegExp( pseudos ),
		ridentifier = new RegExp( "^" + identifier + "$" ),
	
		matchExpr = {
			"ID": new RegExp( "^#(" + identifier + ")" ),
			"CLASS": new RegExp( "^\\.(" + identifier + ")" ),
			"TAG": new RegExp( "^(" + identifier + "|[*])" ),
			"ATTR": new RegExp( "^" + attributes ),
			"PSEUDO": new RegExp( "^" + pseudos ),
			"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
				"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
				"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
			"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
			// For use in libraries implementing .is()
			// We use this for POS matching in `select`
			"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
				whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
		},
	
		rinputs = /^(?:input|select|textarea|button)$/i,
		rheader = /^h\d$/i,
	
		rnative = /^[^{]+\{\s*\[native \w/,
	
		// Easily-parseable/retrievable ID or TAG or CLASS selectors
		rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
	
		rsibling = /[+~]/,
		rescape = /'|\\/g,
	
		// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
		runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
		funescape = function( _, escaped, escapedWhitespace ) {
			var high = "0x" + escaped - 0x10000;
			// NaN means non-codepoint
			// Support: Firefox<24
			// Workaround erroneous numeric interpretation of +"0x"
			return high !== high || escapedWhitespace ?
				escaped :
				high < 0 ?
					// BMP codepoint
					String.fromCharCode( high + 0x10000 ) :
					// Supplemental Plane codepoint (surrogate pair)
					String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
		},
	
		// Used for iframes
		// See setDocument()
		// Removing the function wrapper causes a "Permission Denied"
		// error in IE
		unloadHandler = function() {
			setDocument();
		};
	
	// Optimize for push.apply( _, NodeList )
	try {
		push.apply(
			(arr = slice.call( preferredDoc.childNodes )),
			preferredDoc.childNodes
		);
		// Support: Android<4.0
		// Detect silently failing push.apply
		arr[ preferredDoc.childNodes.length ].nodeType;
	} catch ( e ) {
		push = { apply: arr.length ?
	
			// Leverage slice if possible
			function( target, els ) {
				push_native.apply( target, slice.call(els) );
			} :
	
			// Support: IE<9
			// Otherwise append directly
			function( target, els ) {
				var j = target.length,
					i = 0;
				// Can't trust NodeList.length
				while ( (target[j++] = els[i++]) ) {}
				target.length = j - 1;
			}
		};
	}
	
	function Sizzle( selector, context, results, seed ) {
		var m, i, elem, nid, nidselect, match, groups, newSelector,
			newContext = context && context.ownerDocument,
	
			// nodeType defaults to 9, since context defaults to document
			nodeType = context ? context.nodeType : 9;
	
		results = results || [];
	
		// Return early from calls with invalid selector or context
		if ( typeof selector !== "string" || !selector ||
			nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
	
			return results;
		}
	
		// Try to shortcut find operations (as opposed to filters) in HTML documents
		if ( !seed ) {
	
			if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
				setDocument( context );
			}
			context = context || document;
	
			if ( documentIsHTML ) {
	
				// If the selector is sufficiently simple, try using a "get*By*" DOM method
				// (excepting DocumentFragment context, where the methods don't exist)
				if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
	
					// ID selector
					if ( (m = match[1]) ) {
	
						// Document context
						if ( nodeType === 9 ) {
							if ( (elem = context.getElementById( m )) ) {
	
								// Support: IE, Opera, Webkit
								// TODO: identify versions
								// getElementById can match elements by name instead of ID
								if ( elem.id === m ) {
									results.push( elem );
									return results;
								}
							} else {
								return results;
							}
	
						// Element context
						} else {
	
							// Support: IE, Opera, Webkit
							// TODO: identify versions
							// getElementById can match elements by name instead of ID
							if ( newContext && (elem = newContext.getElementById( m )) &&
								contains( context, elem ) &&
								elem.id === m ) {
	
								results.push( elem );
								return results;
							}
						}
	
					// Type selector
					} else if ( match[2] ) {
						push.apply( results, context.getElementsByTagName( selector ) );
						return results;
	
					// Class selector
					} else if ( (m = match[3]) && support.getElementsByClassName &&
						context.getElementsByClassName ) {
	
						push.apply( results, context.getElementsByClassName( m ) );
						return results;
					}
				}
	
				// Take advantage of querySelectorAll
				if ( support.qsa &&
					!compilerCache[ selector + " " ] &&
					(!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
	
					if ( nodeType !== 1 ) {
						newContext = context;
						newSelector = selector;
	
					// qSA looks outside Element context, which is not what we want
					// Thanks to Andrew Dupont for this workaround technique
					// Support: IE <=8
					// Exclude object elements
					} else if ( context.nodeName.toLowerCase() !== "object" ) {
	
						// Capture the context ID, setting it first if necessary
						if ( (nid = context.getAttribute( "id" )) ) {
							nid = nid.replace( rescape, "\\$&" );
						} else {
							context.setAttribute( "id", (nid = expando) );
						}
	
						// Prefix every selector in the list
						groups = tokenize( selector );
						i = groups.length;
						nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
						while ( i-- ) {
							groups[i] = nidselect + " " + toSelector( groups[i] );
						}
						newSelector = groups.join( "," );
	
						// Expand context for sibling selectors
						newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
							context;
					}
	
					if ( newSelector ) {
						try {
							push.apply( results,
								newContext.querySelectorAll( newSelector )
							);
							return results;
						} catch ( qsaError ) {
						} finally {
							if ( nid === expando ) {
								context.removeAttribute( "id" );
							}
						}
					}
				}
			}
		}
	
		// All others
		return select( selector.replace( rtrim, "$1" ), context, results, seed );
	}
	
	/**
	 * Create key-value caches of limited size
	 * @returns {function(string, object)} Returns the Object data after storing it on itself with
	 *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
	 *	deleting the oldest entry
	 */
	function createCache() {
		var keys = [];
	
		function cache( key, value ) {
			// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
			if ( keys.push( key + " " ) > Expr.cacheLength ) {
				// Only keep the most recent entries
				delete cache[ keys.shift() ];
			}
			return (cache[ key + " " ] = value);
		}
		return cache;
	}
	
	/**
	 * Mark a function for special use by Sizzle
	 * @param {Function} fn The function to mark
	 */
	function markFunction( fn ) {
		fn[ expando ] = true;
		return fn;
	}
	
	/**
	 * Support testing using an element
	 * @param {Function} fn Passed the created div and expects a boolean result
	 */
	function assert( fn ) {
		var div = document.createElement("div");
	
		try {
			return !!fn( div );
		} catch (e) {
			return false;
		} finally {
			// Remove from its parent by default
			if ( div.parentNode ) {
				div.parentNode.removeChild( div );
			}
			// release memory in IE
			div = null;
		}
	}
	
	/**
	 * Adds the same handler for all of the specified attrs
	 * @param {String} attrs Pipe-separated list of attributes
	 * @param {Function} handler The method that will be applied
	 */
	function addHandle( attrs, handler ) {
		var arr = attrs.split("|"),
			i = arr.length;
	
		while ( i-- ) {
			Expr.attrHandle[ arr[i] ] = handler;
		}
	}
	
	/**
	 * Checks document order of two siblings
	 * @param {Element} a
	 * @param {Element} b
	 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
	 */
	function siblingCheck( a, b ) {
		var cur = b && a,
			diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
				( ~b.sourceIndex || MAX_NEGATIVE ) -
				( ~a.sourceIndex || MAX_NEGATIVE );
	
		// Use IE sourceIndex if available on both nodes
		if ( diff ) {
			return diff;
		}
	
		// Check if b follows a
		if ( cur ) {
			while ( (cur = cur.nextSibling) ) {
				if ( cur === b ) {
					return -1;
				}
			}
		}
	
		return a ? 1 : -1;
	}
	
	/**
	 * Returns a function to use in pseudos for input types
	 * @param {String} type
	 */
	function createInputPseudo( type ) {
		return function( elem ) {
			var name = elem.nodeName.toLowerCase();
			return name === "input" && elem.type === type;
		};
	}
	
	/**
	 * Returns a function to use in pseudos for buttons
	 * @param {String} type
	 */
	function createButtonPseudo( type ) {
		return function( elem ) {
			var name = elem.nodeName.toLowerCase();
			return (name === "input" || name === "button") && elem.type === type;
		};
	}
	
	/**
	 * Returns a function to use in pseudos for positionals
	 * @param {Function} fn
	 */
	function createPositionalPseudo( fn ) {
		return markFunction(function( argument ) {
			argument = +argument;
			return markFunction(function( seed, matches ) {
				var j,
					matchIndexes = fn( [], seed.length, argument ),
					i = matchIndexes.length;
	
				// Match elements found at the specified indexes
				while ( i-- ) {
					if ( seed[ (j = matchIndexes[i]) ] ) {
						seed[j] = !(matches[j] = seed[j]);
					}
				}
			});
		});
	}
	
	/**
	 * Checks a node for validity as a Sizzle context
	 * @param {Element|Object=} context
	 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
	 */
	function testContext( context ) {
		return context && typeof context.getElementsByTagName !== "undefined" && context;
	}
	
	// Expose support vars for convenience
	support = Sizzle.support = {};
	
	/**
	 * Detects XML nodes
	 * @param {Element|Object} elem An element or a document
	 * @returns {Boolean} True iff elem is a non-HTML XML node
	 */
	isXML = Sizzle.isXML = function( elem ) {
		// documentElement is verified for cases where it doesn't yet exist
		// (such as loading iframes in IE - #4833)
		var documentElement = elem && (elem.ownerDocument || elem).documentElement;
		return documentElement ? documentElement.nodeName !== "HTML" : false;
	};
	
	/**
	 * Sets document-related variables once based on the current document
	 * @param {Element|Object} [doc] An element or document object to use to set the document
	 * @returns {Object} Returns the current document
	 */
	setDocument = Sizzle.setDocument = function( node ) {
		var hasCompare, parent,
			doc = node ? node.ownerDocument || node : preferredDoc;
	
		// Return early if doc is invalid or already selected
		if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
			return document;
		}
	
		// Update global variables
		document = doc;
		docElem = document.documentElement;
		documentIsHTML = !isXML( document );
	
		// Support: IE 9-11, Edge
		// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
		if ( (parent = document.defaultView) && parent.top !== parent ) {
			// Support: IE 11
			if ( parent.addEventListener ) {
				parent.addEventListener( "unload", unloadHandler, false );
	
			// Support: IE 9 - 10 only
			} else if ( parent.attachEvent ) {
				parent.attachEvent( "onunload", unloadHandler );
			}
		}
	
		/* Attributes
		---------------------------------------------------------------------- */
	
		// Support: IE<8
		// Verify that getAttribute really returns attributes and not properties
		// (excepting IE8 booleans)
		support.attributes = assert(function( div ) {
			div.className = "i";
			return !div.getAttribute("className");
		});
	
		/* getElement(s)By*
		---------------------------------------------------------------------- */
	
		// Check if getElementsByTagName("*") returns only elements
		support.getElementsByTagName = assert(function( div ) {
			div.appendChild( document.createComment("") );
			return !div.getElementsByTagName("*").length;
		});
	
		// Support: IE<9
		support.getElementsByClassName = rnative.test( document.getElementsByClassName );
	
		// Support: IE<10
		// Check if getElementById returns elements by name
		// The broken getElementById methods don't pick up programatically-set names,
		// so use a roundabout getElementsByName test
		support.getById = assert(function( div ) {
			docElem.appendChild( div ).id = expando;
			return !document.getElementsByName || !document.getElementsByName( expando ).length;
		});
	
		// ID find and filter
		if ( support.getById ) {
			Expr.find["ID"] = function( id, context ) {
				if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
					var m = context.getElementById( id );
					return m ? [ m ] : [];
				}
			};
			Expr.filter["ID"] = function( id ) {
				var attrId = id.replace( runescape, funescape );
				return function( elem ) {
					return elem.getAttribute("id") === attrId;
				};
			};
		} else {
			// Support: IE6/7
			// getElementById is not reliable as a find shortcut
			delete Expr.find["ID"];
	
			Expr.filter["ID"] =  function( id ) {
				var attrId = id.replace( runescape, funescape );
				return function( elem ) {
					var node = typeof elem.getAttributeNode !== "undefined" &&
						elem.getAttributeNode("id");
					return node && node.value === attrId;
				};
			};
		}
	
		// Tag
		Expr.find["TAG"] = support.getElementsByTagName ?
			function( tag, context ) {
				if ( typeof context.getElementsByTagName !== "undefined" ) {
					return context.getElementsByTagName( tag );
	
				// DocumentFragment nodes don't have gEBTN
				} else if ( support.qsa ) {
					return context.querySelectorAll( tag );
				}
			} :
	
			function( tag, context ) {
				var elem,
					tmp = [],
					i = 0,
					// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
					results = context.getElementsByTagName( tag );
	
				// Filter out possible comments
				if ( tag === "*" ) {
					while ( (elem = results[i++]) ) {
						if ( elem.nodeType === 1 ) {
							tmp.push( elem );
						}
					}
	
					return tmp;
				}
				return results;
			};
	
		// Class
		Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
			if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
				return context.getElementsByClassName( className );
			}
		};
	
		/* QSA/matchesSelector
		---------------------------------------------------------------------- */
	
		// QSA and matchesSelector support
	
		// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
		rbuggyMatches = [];
	
		// qSa(:focus) reports false when true (Chrome 21)
		// We allow this because of a bug in IE8/9 that throws an error
		// whenever `document.activeElement` is accessed on an iframe
		// So, we allow :focus to pass through QSA all the time to avoid the IE error
		// See http://bugs.jquery.com/ticket/13378
		rbuggyQSA = [];
	
		if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
			// Build QSA regex
			// Regex strategy adopted from Diego Perini
			assert(function( div ) {
				// Select is set to empty string on purpose
				// This is to test IE's treatment of not explicitly
				// setting a boolean content attribute,
				// since its presence should be enough
				// http://bugs.jquery.com/ticket/12359
				docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
					"<select id='" + expando + "-\r\\' msallowcapture=''>" +
					"<option selected=''></option></select>";
	
				// Support: IE8, Opera 11-12.16
				// Nothing should be selected when empty strings follow ^= or $= or *=
				// The test attribute must be unknown in Opera but "safe" for WinRT
				// http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
				if ( div.querySelectorAll("[msallowcapture^='']").length ) {
					rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
				}
	
				// Support: IE8
				// Boolean attributes and "value" are not treated correctly
				if ( !div.querySelectorAll("[selected]").length ) {
					rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
				}
	
				// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
				if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
					rbuggyQSA.push("~=");
				}
	
				// Webkit/Opera - :checked should return selected option elements
				// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
				// IE8 throws error here and will not see later tests
				if ( !div.querySelectorAll(":checked").length ) {
					rbuggyQSA.push(":checked");
				}
	
				// Support: Safari 8+, iOS 8+
				// https://bugs.webkit.org/show_bug.cgi?id=136851
				// In-page `selector#id sibing-combinator selector` fails
				if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
					rbuggyQSA.push(".#.+[+~]");
				}
			});
	
			assert(function( div ) {
				// Support: Windows 8 Native Apps
				// The type and name attributes are restricted during .innerHTML assignment
				var input = document.createElement("input");
				input.setAttribute( "type", "hidden" );
				div.appendChild( input ).setAttribute( "name", "D" );
	
				// Support: IE8
				// Enforce case-sensitivity of name attribute
				if ( div.querySelectorAll("[name=d]").length ) {
					rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
				}
	
				// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
				// IE8 throws error here and will not see later tests
				if ( !div.querySelectorAll(":enabled").length ) {
					rbuggyQSA.push( ":enabled", ":disabled" );
				}
	
				// Opera 10-11 does not throw on post-comma invalid pseudos
				div.querySelectorAll("*,:x");
				rbuggyQSA.push(",.*:");
			});
		}
	
		if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
			docElem.webkitMatchesSelector ||
			docElem.mozMatchesSelector ||
			docElem.oMatchesSelector ||
			docElem.msMatchesSelector) )) ) {
	
			assert(function( div ) {
				// Check to see if it's possible to do matchesSelector
				// on a disconnected node (IE 9)
				support.disconnectedMatch = matches.call( div, "div" );
	
				// This should fail with an exception
				// Gecko does not error, returns false instead
				matches.call( div, "[s!='']:x" );
				rbuggyMatches.push( "!=", pseudos );
			});
		}
	
		rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
		rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
	
		/* Contains
		---------------------------------------------------------------------- */
		hasCompare = rnative.test( docElem.compareDocumentPosition );
	
		// Element contains another
		// Purposefully self-exclusive
		// As in, an element does not contain itself
		contains = hasCompare || rnative.test( docElem.contains ) ?
			function( a, b ) {
				var adown = a.nodeType === 9 ? a.documentElement : a,
					bup = b && b.parentNode;
				return a === bup || !!( bup && bup.nodeType === 1 && (
					adown.contains ?
						adown.contains( bup ) :
						a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
				));
			} :
			function( a, b ) {
				if ( b ) {
					while ( (b = b.parentNode) ) {
						if ( b === a ) {
							return true;
						}
					}
				}
				return false;
			};
	
		/* Sorting
		---------------------------------------------------------------------- */
	
		// Document order sorting
		sortOrder = hasCompare ?
		function( a, b ) {
	
			// Flag for duplicate removal
			if ( a === b ) {
				hasDuplicate = true;
				return 0;
			}
	
			// Sort on method existence if only one input has compareDocumentPosition
			var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
			if ( compare ) {
				return compare;
			}
	
			// Calculate position if both inputs belong to the same document
			compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
				a.compareDocumentPosition( b ) :
	
				// Otherwise we know they are disconnected
				1;
	
			// Disconnected nodes
			if ( compare & 1 ||
				(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
	
				// Choose the first element that is related to our preferred document
				if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
					return -1;
				}
				if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
					return 1;
				}
	
				// Maintain original order
				return sortInput ?
					( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
					0;
			}
	
			return compare & 4 ? -1 : 1;
		} :
		function( a, b ) {
			// Exit early if the nodes are identical
			if ( a === b ) {
				hasDuplicate = true;
				return 0;
			}
	
			var cur,
				i = 0,
				aup = a.parentNode,
				bup = b.parentNode,
				ap = [ a ],
				bp = [ b ];
	
			// Parentless nodes are either documents or disconnected
			if ( !aup || !bup ) {
				return a === document ? -1 :
					b === document ? 1 :
					aup ? -1 :
					bup ? 1 :
					sortInput ?
					( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
					0;
	
			// If the nodes are siblings, we can do a quick check
			} else if ( aup === bup ) {
				return siblingCheck( a, b );
			}
	
			// Otherwise we need full lists of their ancestors for comparison
			cur = a;
			while ( (cur = cur.parentNode) ) {
				ap.unshift( cur );
			}
			cur = b;
			while ( (cur = cur.parentNode) ) {
				bp.unshift( cur );
			}
	
			// Walk down the tree looking for a discrepancy
			while ( ap[i] === bp[i] ) {
				i++;
			}
	
			return i ?
				// Do a sibling check if the nodes have a common ancestor
				siblingCheck( ap[i], bp[i] ) :
	
				// Otherwise nodes in our document sort first
				ap[i] === preferredDoc ? -1 :
				bp[i] === preferredDoc ? 1 :
				0;
		};
	
		return document;
	};
	
	Sizzle.matches = function( expr, elements ) {
		return Sizzle( expr, null, null, elements );
	};
	
	Sizzle.matchesSelector = function( elem, expr ) {
		// Set document vars if needed
		if ( ( elem.ownerDocument || elem ) !== document ) {
			setDocument( elem );
		}
	
		// Make sure that attribute selectors are quoted
		expr = expr.replace( rattributeQuotes, "='$1']" );
	
		if ( support.matchesSelector && documentIsHTML &&
			!compilerCache[ expr + " " ] &&
			( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
			( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
	
			try {
				var ret = matches.call( elem, expr );
	
				// IE 9's matchesSelector returns false on disconnected nodes
				if ( ret || support.disconnectedMatch ||
						// As well, disconnected nodes are said to be in a document
						// fragment in IE 9
						elem.document && elem.document.nodeType !== 11 ) {
					return ret;
				}
			} catch (e) {}
		}
	
		return Sizzle( expr, document, null, [ elem ] ).length > 0;
	};
	
	Sizzle.contains = function( context, elem ) {
		// Set document vars if needed
		if ( ( context.ownerDocument || context ) !== document ) {
			setDocument( context );
		}
		return contains( context, elem );
	};
	
	Sizzle.attr = function( elem, name ) {
		// Set document vars if needed
		if ( ( elem.ownerDocument || elem ) !== document ) {
			setDocument( elem );
		}
	
		var fn = Expr.attrHandle[ name.toLowerCase() ],
			// Don't get fooled by Object.prototype properties (jQuery #13807)
			val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
				fn( elem, name, !documentIsHTML ) :
				undefined;
	
		return val !== undefined ?
			val :
			support.attributes || !documentIsHTML ?
				elem.getAttribute( name ) :
				(val = elem.getAttributeNode(name)) && val.specified ?
					val.value :
					null;
	};
	
	Sizzle.error = function( msg ) {
		throw new Error( "Syntax error, unrecognized expression: " + msg );
	};
	
	/**
	 * Document sorting and removing duplicates
	 * @param {ArrayLike} results
	 */
	Sizzle.uniqueSort = function( results ) {
		var elem,
			duplicates = [],
			j = 0,
			i = 0;
	
		// Unless we *know* we can detect duplicates, assume their presence
		hasDuplicate = !support.detectDuplicates;
		sortInput = !support.sortStable && results.slice( 0 );
		results.sort( sortOrder );
	
		if ( hasDuplicate ) {
			while ( (elem = results[i++]) ) {
				if ( elem === results[ i ] ) {
					j = duplicates.push( i );
				}
			}
			while ( j-- ) {
				results.splice( duplicates[ j ], 1 );
			}
		}
	
		// Clear input after sorting to release objects
		// See https://github.com/jquery/sizzle/pull/225
		sortInput = null;
	
		return results;
	};
	
	/**
	 * Utility function for retrieving the text value of an array of DOM nodes
	 * @param {Array|Element} elem
	 */
	getText = Sizzle.getText = function( elem ) {
		var node,
			ret = "",
			i = 0,
			nodeType = elem.nodeType;
	
		if ( !nodeType ) {
			// If no nodeType, this is expected to be an array
			while ( (node = elem[i++]) ) {
				// Do not traverse comment nodes
				ret += getText( node );
			}
		} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
			// Use textContent for elements
			// innerText usage removed for consistency of new lines (jQuery #11153)
			if ( typeof elem.textContent === "string" ) {
				return elem.textContent;
			} else {
				// Traverse its children
				for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
					ret += getText( elem );
				}
			}
		} else if ( nodeType === 3 || nodeType === 4 ) {
			return elem.nodeValue;
		}
		// Do not include comment or processing instruction nodes
	
		return ret;
	};
	
	Expr = Sizzle.selectors = {
	
		// Can be adjusted by the user
		cacheLength: 50,
	
		createPseudo: markFunction,
	
		match: matchExpr,
	
		attrHandle: {},
	
		find: {},
	
		relative: {
			">": { dir: "parentNode", first: true },
			" ": { dir: "parentNode" },
			"+": { dir: "previousSibling", first: true },
			"~": { dir: "previousSibling" }
		},
	
		preFilter: {
			"ATTR": function( match ) {
				match[1] = match[1].replace( runescape, funescape );
	
				// Move the given value to match[3] whether quoted or unquoted
				match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
	
				if ( match[2] === "~=" ) {
					match[3] = " " + match[3] + " ";
				}
	
				return match.slice( 0, 4 );
			},
	
			"CHILD": function( match ) {
				/* matches from matchExpr["CHILD"]
					1 type (only|nth|...)
					2 what (child|of-type)
					3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
					4 xn-component of xn+y argument ([+-]?\d*n|)
					5 sign of xn-component
					6 x of xn-component
					7 sign of y-component
					8 y of y-component
				*/
				match[1] = match[1].toLowerCase();
	
				if ( match[1].slice( 0, 3 ) === "nth" ) {
					// nth-* requires argument
					if ( !match[3] ) {
						Sizzle.error( match[0] );
					}
	
					// numeric x and y parameters for Expr.filter.CHILD
					// remember that false/true cast respectively to 0/1
					match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
					match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
	
				// other types prohibit arguments
				} else if ( match[3] ) {
					Sizzle.error( match[0] );
				}
	
				return match;
			},
	
			"PSEUDO": function( match ) {
				var excess,
					unquoted = !match[6] && match[2];
	
				if ( matchExpr["CHILD"].test( match[0] ) ) {
					return null;
				}
	
				// Accept quoted arguments as-is
				if ( match[3] ) {
					match[2] = match[4] || match[5] || "";
	
				// Strip excess characters from unquoted arguments
				} else if ( unquoted && rpseudo.test( unquoted ) &&
					// Get excess from tokenize (recursively)
					(excess = tokenize( unquoted, true )) &&
					// advance to the next closing parenthesis
					(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
	
					// excess is a negative index
					match[0] = match[0].slice( 0, excess );
					match[2] = unquoted.slice( 0, excess );
				}
	
				// Return only captures needed by the pseudo filter method (type and argument)
				return match.slice( 0, 3 );
			}
		},
	
		filter: {
	
			"TAG": function( nodeNameSelector ) {
				var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
				return nodeNameSelector === "*" ?
					function() { return true; } :
					function( elem ) {
						return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
					};
			},
	
			"CLASS": function( className ) {
				var pattern = classCache[ className + " " ];
	
				return pattern ||
					(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
					classCache( className, function( elem ) {
						return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
					});
			},
	
			"ATTR": function( name, operator, check ) {
				return function( elem ) {
					var result = Sizzle.attr( elem, name );
	
					if ( result == null ) {
						return operator === "!=";
					}
					if ( !operator ) {
						return true;
					}
	
					result += "";
	
					return operator === "=" ? result === check :
						operator === "!=" ? result !== check :
						operator === "^=" ? check && result.indexOf( check ) === 0 :
						operator === "*=" ? check && result.indexOf( check ) > -1 :
						operator === "$=" ? check && result.slice( -check.length ) === check :
						operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
						operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
						false;
				};
			},
	
			"CHILD": function( type, what, argument, first, last ) {
				var simple = type.slice( 0, 3 ) !== "nth",
					forward = type.slice( -4 ) !== "last",
					ofType = what === "of-type";
	
				return first === 1 && last === 0 ?
	
					// Shortcut for :nth-*(n)
					function( elem ) {
						return !!elem.parentNode;
					} :
	
					function( elem, context, xml ) {
						var cache, uniqueCache, outerCache, node, nodeIndex, start,
							dir = simple !== forward ? "nextSibling" : "previousSibling",
							parent = elem.parentNode,
							name = ofType && elem.nodeName.toLowerCase(),
							useCache = !xml && !ofType,
							diff = false;
	
						if ( parent ) {
	
							// :(first|last|only)-(child|of-type)
							if ( simple ) {
								while ( dir ) {
									node = elem;
									while ( (node = node[ dir ]) ) {
										if ( ofType ?
											node.nodeName.toLowerCase() === name :
											node.nodeType === 1 ) {
	
											return false;
										}
									}
									// Reverse direction for :only-* (if we haven't yet done so)
									start = dir = type === "only" && !start && "nextSibling";
								}
								return true;
							}
	
							start = [ forward ? parent.firstChild : parent.lastChild ];
	
							// non-xml :nth-child(...) stores cache data on `parent`
							if ( forward && useCache ) {
	
								// Seek `elem` from a previously-cached index
	
								// ...in a gzip-friendly way
								node = parent;
								outerCache = node[ expando ] || (node[ expando ] = {});
	
								// Support: IE <9 only
								// Defend against cloned attroperties (jQuery gh-1709)
								uniqueCache = outerCache[ node.uniqueID ] ||
									(outerCache[ node.uniqueID ] = {});
	
								cache = uniqueCache[ type ] || [];
								nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
								diff = nodeIndex && cache[ 2 ];
								node = nodeIndex && parent.childNodes[ nodeIndex ];
	
								while ( (node = ++nodeIndex && node && node[ dir ] ||
	
									// Fallback to seeking `elem` from the start
									(diff = nodeIndex = 0) || start.pop()) ) {
	
									// When found, cache indexes on `parent` and break
									if ( node.nodeType === 1 && ++diff && node === elem ) {
										uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
										break;
									}
								}
	
							} else {
								// Use previously-cached element index if available
								if ( useCache ) {
									// ...in a gzip-friendly way
									node = elem;
									outerCache = node[ expando ] || (node[ expando ] = {});
	
									// Support: IE <9 only
									// Defend against cloned attroperties (jQuery gh-1709)
									uniqueCache = outerCache[ node.uniqueID ] ||
										(outerCache[ node.uniqueID ] = {});
	
									cache = uniqueCache[ type ] || [];
									nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
									diff = nodeIndex;
								}
	
								// xml :nth-child(...)
								// or :nth-last-child(...) or :nth(-last)?-of-type(...)
								if ( diff === false ) {
									// Use the same loop as above to seek `elem` from the start
									while ( (node = ++nodeIndex && node && node[ dir ] ||
										(diff = nodeIndex = 0) || start.pop()) ) {
	
										if ( ( ofType ?
											node.nodeName.toLowerCase() === name :
											node.nodeType === 1 ) &&
											++diff ) {
	
											// Cache the index of each encountered element
											if ( useCache ) {
												outerCache = node[ expando ] || (node[ expando ] = {});
	
												// Support: IE <9 only
												// Defend against cloned attroperties (jQuery gh-1709)
												uniqueCache = outerCache[ node.uniqueID ] ||
													(outerCache[ node.uniqueID ] = {});
	
												uniqueCache[ type ] = [ dirruns, diff ];
											}
	
											if ( node === elem ) {
												break;
											}
										}
									}
								}
							}
	
							// Incorporate the offset, then check against cycle size
							diff -= last;
							return diff === first || ( diff % first === 0 && diff / first >= 0 );
						}
					};
			},
	
			"PSEUDO": function( pseudo, argument ) {
				// pseudo-class names are case-insensitive
				// http://www.w3.org/TR/selectors/#pseudo-classes
				// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
				// Remember that setFilters inherits from pseudos
				var args,
					fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
						Sizzle.error( "unsupported pseudo: " + pseudo );
	
				// The user may use createPseudo to indicate that
				// arguments are needed to create the filter function
				// just as Sizzle does
				if ( fn[ expando ] ) {
					return fn( argument );
				}
	
				// But maintain support for old signatures
				if ( fn.length > 1 ) {
					args = [ pseudo, pseudo, "", argument ];
					return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
						markFunction(function( seed, matches ) {
							var idx,
								matched = fn( seed, argument ),
								i = matched.length;
							while ( i-- ) {
								idx = indexOf( seed, matched[i] );
								seed[ idx ] = !( matches[ idx ] = matched[i] );
							}
						}) :
						function( elem ) {
							return fn( elem, 0, args );
						};
				}
	
				return fn;
			}
		},
	
		pseudos: {
			// Potentially complex pseudos
			"not": markFunction(function( selector ) {
				// Trim the selector passed to compile
				// to avoid treating leading and trailing
				// spaces as combinators
				var input = [],
					results = [],
					matcher = compile( selector.replace( rtrim, "$1" ) );
	
				return matcher[ expando ] ?
					markFunction(function( seed, matches, context, xml ) {
						var elem,
							unmatched = matcher( seed, null, xml, [] ),
							i = seed.length;
	
						// Match elements unmatched by `matcher`
						while ( i-- ) {
							if ( (elem = unmatched[i]) ) {
								seed[i] = !(matches[i] = elem);
							}
						}
					}) :
					function( elem, context, xml ) {
						input[0] = elem;
						matcher( input, null, xml, results );
						// Don't keep the element (issue #299)
						input[0] = null;
						return !results.pop();
					};
			}),
	
			"has": markFunction(function( selector ) {
				return function( elem ) {
					return Sizzle( selector, elem ).length > 0;
				};
			}),
	
			"contains": markFunction(function( text ) {
				text = text.replace( runescape, funescape );
				return function( elem ) {
					return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
				};
			}),
	
			// "Whether an element is represented by a :lang() selector
			// is based solely on the element's language value
			// being equal to the identifier C,
			// or beginning with the identifier C immediately followed by "-".
			// The matching of C against the element's language value is performed case-insensitively.
			// The identifier C does not have to be a valid language name."
			// http://www.w3.org/TR/selectors/#lang-pseudo
			"lang": markFunction( function( lang ) {
				// lang value must be a valid identifier
				if ( !ridentifier.test(lang || "") ) {
					Sizzle.error( "unsupported lang: " + lang );
				}
				lang = lang.replace( runescape, funescape ).toLowerCase();
				return function( elem ) {
					var elemLang;
					do {
						if ( (elemLang = documentIsHTML ?
							elem.lang :
							elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
	
							elemLang = elemLang.toLowerCase();
							return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
						}
					} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
					return false;
				};
			}),
	
			// Miscellaneous
			"target": function( elem ) {
				var hash = window.location && window.location.hash;
				return hash && hash.slice( 1 ) === elem.id;
			},
	
			"root": function( elem ) {
				return elem === docElem;
			},
	
			"focus": function( elem ) {
				return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
			},
	
			// Boolean properties
			"enabled": function( elem ) {
				return elem.disabled === false;
			},
	
			"disabled": function( elem ) {
				return elem.disabled === true;
			},
	
			"checked": function( elem ) {
				// In CSS3, :checked should return both checked and selected elements
				// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
				var nodeName = elem.nodeName.toLowerCase();
				return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
			},
	
			"selected": function( elem ) {
				// Accessing this property makes selected-by-default
				// options in Safari work properly
				if ( elem.parentNode ) {
					elem.parentNode.selectedIndex;
				}
	
				return elem.selected === true;
			},
	
			// Contents
			"empty": function( elem ) {
				// http://www.w3.org/TR/selectors/#empty-pseudo
				// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
				//   but not by others (comment: 8; processing instruction: 7; etc.)
				// nodeType < 6 works because attributes (2) do not appear as children
				for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
					if ( elem.nodeType < 6 ) {
						return false;
					}
				}
				return true;
			},
	
			"parent": function( elem ) {
				return !Expr.pseudos["empty"]( elem );
			},
	
			// Element/input types
			"header": function( elem ) {
				return rheader.test( elem.nodeName );
			},
	
			"input": function( elem ) {
				return rinputs.test( elem.nodeName );
			},
	
			"button": function( elem ) {
				var name = elem.nodeName.toLowerCase();
				return name === "input" && elem.type === "button" || name === "button";
			},
	
			"text": function( elem ) {
				var attr;
				return elem.nodeName.toLowerCase() === "input" &&
					elem.type === "text" &&
	
					// Support: IE<8
					// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
					( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
			},
	
			// Position-in-collection
			"first": createPositionalPseudo(function() {
				return [ 0 ];
			}),
	
			"last": createPositionalPseudo(function( matchIndexes, length ) {
				return [ length - 1 ];
			}),
	
			"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
				return [ argument < 0 ? argument + length : argument ];
			}),
	
			"even": createPositionalPseudo(function( matchIndexes, length ) {
				var i = 0;
				for ( ; i < length; i += 2 ) {
					matchIndexes.push( i );
				}
				return matchIndexes;
			}),
	
			"odd": createPositionalPseudo(function( matchIndexes, length ) {
				var i = 1;
				for ( ; i < length; i += 2 ) {
					matchIndexes.push( i );
				}
				return matchIndexes;
			}),
	
			"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
				var i = argument < 0 ? argument + length : argument;
				for ( ; --i >= 0; ) {
					matchIndexes.push( i );
				}
				return matchIndexes;
			}),
	
			"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
				var i = argument < 0 ? argument + length : argument;
				for ( ; ++i < length; ) {
					matchIndexes.push( i );
				}
				return matchIndexes;
			})
		}
	};
	
	Expr.pseudos["nth"] = Expr.pseudos["eq"];
	
	// Add button/input type pseudos
	for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
		Expr.pseudos[ i ] = createInputPseudo( i );
	}
	for ( i in { submit: true, reset: true } ) {
		Expr.pseudos[ i ] = createButtonPseudo( i );
	}
	
	// Easy API for creating new setFilters
	function setFilters() {}
	setFilters.prototype = Expr.filters = Expr.pseudos;
	Expr.setFilters = new setFilters();
	
	tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
		var matched, match, tokens, type,
			soFar, groups, preFilters,
			cached = tokenCache[ selector + " " ];
	
		if ( cached ) {
			return parseOnly ? 0 : cached.slice( 0 );
		}
	
		soFar = selector;
		groups = [];
		preFilters = Expr.preFilter;
	
		while ( soFar ) {
	
			// Comma and first run
			if ( !matched || (match = rcomma.exec( soFar )) ) {
				if ( match ) {
					// Don't consume trailing commas as valid
					soFar = soFar.slice( match[0].length ) || soFar;
				}
				groups.push( (tokens = []) );
			}
	
			matched = false;
	
			// Combinators
			if ( (match = rcombinators.exec( soFar )) ) {
				matched = match.shift();
				tokens.push({
					value: matched,
					// Cast descendant combinators to space
					type: match[0].replace( rtrim, " " )
				});
				soFar = soFar.slice( matched.length );
			}
	
			// Filters
			for ( type in Expr.filter ) {
				if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
					(match = preFilters[ type ]( match ))) ) {
					matched = match.shift();
					tokens.push({
						value: matched,
						type: type,
						matches: match
					});
					soFar = soFar.slice( matched.length );
				}
			}
	
			if ( !matched ) {
				break;
			}
		}
	
		// Return the length of the invalid excess
		// if we're just parsing
		// Otherwise, throw an error or return tokens
		return parseOnly ?
			soFar.length :
			soFar ?
				Sizzle.error( selector ) :
				// Cache the tokens
				tokenCache( selector, groups ).slice( 0 );
	};
	
	function toSelector( tokens ) {
		var i = 0,
			len = tokens.length,
			selector = "";
		for ( ; i < len; i++ ) {
			selector += tokens[i].value;
		}
		return selector;
	}
	
	function addCombinator( matcher, combinator, base ) {
		var dir = combinator.dir,
			checkNonElements = base && dir === "parentNode",
			doneName = done++;
	
		return combinator.first ?
			// Check against closest ancestor/preceding element
			function( elem, context, xml ) {
				while ( (elem = elem[ dir ]) ) {
					if ( elem.nodeType === 1 || checkNonElements ) {
						return matcher( elem, context, xml );
					}
				}
			} :
	
			// Check against all ancestor/preceding elements
			function( elem, context, xml ) {
				var oldCache, uniqueCache, outerCache,
					newCache = [ dirruns, doneName ];
	
				// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
				if ( xml ) {
					while ( (elem = elem[ dir ]) ) {
						if ( elem.nodeType === 1 || checkNonElements ) {
							if ( matcher( elem, context, xml ) ) {
								return true;
							}
						}
					}
				} else {
					while ( (elem = elem[ dir ]) ) {
						if ( elem.nodeType === 1 || checkNonElements ) {
							outerCache = elem[ expando ] || (elem[ expando ] = {});
	
							// Support: IE <9 only
							// Defend against cloned attroperties (jQuery gh-1709)
							uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
	
							if ( (oldCache = uniqueCache[ dir ]) &&
								oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
	
								// Assign to newCache so results back-propagate to previous elements
								return (newCache[ 2 ] = oldCache[ 2 ]);
							} else {
								// Reuse newcache so results back-propagate to previous elements
								uniqueCache[ dir ] = newCache;
	
								// A match means we're done; a fail means we have to keep checking
								if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
									return true;
								}
							}
						}
					}
				}
			};
	}
	
	function elementMatcher( matchers ) {
		return matchers.length > 1 ?
			function( elem, context, xml ) {
				var i = matchers.length;
				while ( i-- ) {
					if ( !matchers[i]( elem, context, xml ) ) {
						return false;
					}
				}
				return true;
			} :
			matchers[0];
	}
	
	function multipleContexts( selector, contexts, results ) {
		var i = 0,
			len = contexts.length;
		for ( ; i < len; i++ ) {
			Sizzle( selector, contexts[i], results );
		}
		return results;
	}
	
	function condense( unmatched, map, filter, context, xml ) {
		var elem,
			newUnmatched = [],
			i = 0,
			len = unmatched.length,
			mapped = map != null;
	
		for ( ; i < len; i++ ) {
			if ( (elem = unmatched[i]) ) {
				if ( !filter || filter( elem, context, xml ) ) {
					newUnmatched.push( elem );
					if ( mapped ) {
						map.push( i );
					}
				}
			}
		}
	
		return newUnmatched;
	}
	
	function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
		if ( postFilter && !postFilter[ expando ] ) {
			postFilter = setMatcher( postFilter );
		}
		if ( postFinder && !postFinder[ expando ] ) {
			postFinder = setMatcher( postFinder, postSelector );
		}
		return markFunction(function( seed, results, context, xml ) {
			var temp, i, elem,
				preMap = [],
				postMap = [],
				preexisting = results.length,
	
				// Get initial elements from seed or context
				elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
	
				// Prefilter to get matcher input, preserving a map for seed-results synchronization
				matcherIn = preFilter && ( seed || !selector ) ?
					condense( elems, preMap, preFilter, context, xml ) :
					elems,
	
				matcherOut = matcher ?
					// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
					postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
	
						// ...intermediate processing is necessary
						[] :
	
						// ...otherwise use results directly
						results :
					matcherIn;
	
			// Find primary matches
			if ( matcher ) {
				matcher( matcherIn, matcherOut, context, xml );
			}
	
			// Apply postFilter
			if ( postFilter ) {
				temp = condense( matcherOut, postMap );
				postFilter( temp, [], context, xml );
	
				// Un-match failing elements by moving them back to matcherIn
				i = temp.length;
				while ( i-- ) {
					if ( (elem = temp[i]) ) {
						matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
					}
				}
			}
	
			if ( seed ) {
				if ( postFinder || preFilter ) {
					if ( postFinder ) {
						// Get the final matcherOut by condensing this intermediate into postFinder contexts
						temp = [];
						i = matcherOut.length;
						while ( i-- ) {
							if ( (elem = matcherOut[i]) ) {
								// Restore matcherIn since elem is not yet a final match
								temp.push( (matcherIn[i] = elem) );
							}
						}
						postFinder( null, (matcherOut = []), temp, xml );
					}
	
					// Move matched elements from seed to results to keep them synchronized
					i = matcherOut.length;
					while ( i-- ) {
						if ( (elem = matcherOut[i]) &&
							(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
	
							seed[temp] = !(results[temp] = elem);
						}
					}
				}
	
			// Add elements to results, through postFinder if defined
			} else {
				matcherOut = condense(
					matcherOut === results ?
						matcherOut.splice( preexisting, matcherOut.length ) :
						matcherOut
				);
				if ( postFinder ) {
					postFinder( null, results, matcherOut, xml );
				} else {
					push.apply( results, matcherOut );
				}
			}
		});
	}
	
	function matcherFromTokens( tokens ) {
		var checkContext, matcher, j,
			len = tokens.length,
			leadingRelative = Expr.relative[ tokens[0].type ],
			implicitRelative = leadingRelative || Expr.relative[" "],
			i = leadingRelative ? 1 : 0,
	
			// The foundational matcher ensures that elements are reachable from top-level context(s)
			matchContext = addCombinator( function( elem ) {
				return elem === checkContext;
			}, implicitRelative, true ),
			matchAnyContext = addCombinator( function( elem ) {
				return indexOf( checkContext, elem ) > -1;
			}, implicitRelative, true ),
			matchers = [ function( elem, context, xml ) {
				var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
					(checkContext = context).nodeType ?
						matchContext( elem, context, xml ) :
						matchAnyContext( elem, context, xml ) );
				// Avoid hanging onto element (issue #299)
				checkContext = null;
				return ret;
			} ];
	
		for ( ; i < len; i++ ) {
			if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
				matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
			} else {
				matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
	
				// Return special upon seeing a positional matcher
				if ( matcher[ expando ] ) {
					// Find the next relative operator (if any) for proper handling
					j = ++i;
					for ( ; j < len; j++ ) {
						if ( Expr.relative[ tokens[j].type ] ) {
							break;
						}
					}
					return setMatcher(
						i > 1 && elementMatcher( matchers ),
						i > 1 && toSelector(
							// If the preceding token was a descendant combinator, insert an implicit any-element `*`
							tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
						).replace( rtrim, "$1" ),
						matcher,
						i < j && matcherFromTokens( tokens.slice( i, j ) ),
						j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
						j < len && toSelector( tokens )
					);
				}
				matchers.push( matcher );
			}
		}
	
		return elementMatcher( matchers );
	}
	
	function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
		var bySet = setMatchers.length > 0,
			byElement = elementMatchers.length > 0,
			superMatcher = function( seed, context, xml, results, outermost ) {
				var elem, j, matcher,
					matchedCount = 0,
					i = "0",
					unmatched = seed && [],
					setMatched = [],
					contextBackup = outermostContext,
					// We must always have either seed elements or outermost context
					elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
					// Use integer dirruns iff this is the outermost matcher
					dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
					len = elems.length;
	
				if ( outermost ) {
					outermostContext = context === document || context || outermost;
				}
	
				// Add elements passing elementMatchers directly to results
				// Support: IE<9, Safari
				// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
				for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
					if ( byElement && elem ) {
						j = 0;
						if ( !context && elem.ownerDocument !== document ) {
							setDocument( elem );
							xml = !documentIsHTML;
						}
						while ( (matcher = elementMatchers[j++]) ) {
							if ( matcher( elem, context || document, xml) ) {
								results.push( elem );
								break;
							}
						}
						if ( outermost ) {
							dirruns = dirrunsUnique;
						}
					}
	
					// Track unmatched elements for set filters
					if ( bySet ) {
						// They will have gone through all possible matchers
						if ( (elem = !matcher && elem) ) {
							matchedCount--;
						}
	
						// Lengthen the array for every element, matched or not
						if ( seed ) {
							unmatched.push( elem );
						}
					}
				}
	
				// `i` is now the count of elements visited above, and adding it to `matchedCount`
				// makes the latter nonnegative.
				matchedCount += i;
	
				// Apply set filters to unmatched elements
				// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
				// equals `i`), unless we didn't visit _any_ elements in the above loop because we have
				// no element matchers and no seed.
				// Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
				// case, which will result in a "00" `matchedCount` that differs from `i` but is also
				// numerically zero.
				if ( bySet && i !== matchedCount ) {
					j = 0;
					while ( (matcher = setMatchers[j++]) ) {
						matcher( unmatched, setMatched, context, xml );
					}
	
					if ( seed ) {
						// Reintegrate element matches to eliminate the need for sorting
						if ( matchedCount > 0 ) {
							while ( i-- ) {
								if ( !(unmatched[i] || setMatched[i]) ) {
									setMatched[i] = pop.call( results );
								}
							}
						}
	
						// Discard index placeholder values to get only actual matches
						setMatched = condense( setMatched );
					}
	
					// Add matches to results
					push.apply( results, setMatched );
	
					// Seedless set matches succeeding multiple successful matchers stipulate sorting
					if ( outermost && !seed && setMatched.length > 0 &&
						( matchedCount + setMatchers.length ) > 1 ) {
	
						Sizzle.uniqueSort( results );
					}
				}
	
				// Override manipulation of globals by nested matchers
				if ( outermost ) {
					dirruns = dirrunsUnique;
					outermostContext = contextBackup;
				}
	
				return unmatched;
			};
	
		return bySet ?
			markFunction( superMatcher ) :
			superMatcher;
	}
	
	compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
		var i,
			setMatchers = [],
			elementMatchers = [],
			cached = compilerCache[ selector + " " ];
	
		if ( !cached ) {
			// Generate a function of recursive functions that can be used to check each element
			if ( !match ) {
				match = tokenize( selector );
			}
			i = match.length;
			while ( i-- ) {
				cached = matcherFromTokens( match[i] );
				if ( cached[ expando ] ) {
					setMatchers.push( cached );
				} else {
					elementMatchers.push( cached );
				}
			}
	
			// Cache the compiled function
			cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
	
			// Save selector and tokenization
			cached.selector = selector;
		}
		return cached;
	};
	
	/**
	 * A low-level selection function that works with Sizzle's compiled
	 *  selector functions
	 * @param {String|Function} selector A selector or a pre-compiled
	 *  selector function built with Sizzle.compile
	 * @param {Element} context
	 * @param {Array} [results]
	 * @param {Array} [seed] A set of elements to match against
	 */
	select = Sizzle.select = function( selector, context, results, seed ) {
		var i, tokens, token, type, find,
			compiled = typeof selector === "function" && selector,
			match = !seed && tokenize( (selector = compiled.selector || selector) );
	
		results = results || [];
	
		// Try to minimize operations if there is only one selector in the list and no seed
		// (the latter of which guarantees us context)
		if ( match.length === 1 ) {
	
			// Reduce context if the leading compound selector is an ID
			tokens = match[0] = match[0].slice( 0 );
			if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
					support.getById && context.nodeType === 9 && documentIsHTML &&
					Expr.relative[ tokens[1].type ] ) {
	
				context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
				if ( !context ) {
					return results;
	
				// Precompiled matchers will still verify ancestry, so step up a level
				} else if ( compiled ) {
					context = context.parentNode;
				}
	
				selector = selector.slice( tokens.shift().value.length );
			}
	
			// Fetch a seed set for right-to-left matching
			i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
			while ( i-- ) {
				token = tokens[i];
	
				// Abort if we hit a combinator
				if ( Expr.relative[ (type = token.type) ] ) {
					break;
				}
				if ( (find = Expr.find[ type ]) ) {
					// Search, expanding context for leading sibling combinators
					if ( (seed = find(
						token.matches[0].replace( runescape, funescape ),
						rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
					)) ) {
	
						// If seed is empty or no tokens remain, we can return early
						tokens.splice( i, 1 );
						selector = seed.length && toSelector( tokens );
						if ( !selector ) {
							push.apply( results, seed );
							return results;
						}
	
						break;
					}
				}
			}
		}
	
		// Compile and execute a filtering function if one is not provided
		// Provide `match` to avoid retokenization if we modified the selector above
		( compiled || compile( selector, match ) )(
			seed,
			context,
			!documentIsHTML,
			results,
			!context || rsibling.test( selector ) && testContext( context.parentNode ) || context
		);
		return results;
	};
	
	// One-time assignments
	
	// Sort stability
	support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
	
	// Support: Chrome 14-35+
	// Always assume duplicates if they aren't passed to the comparison function
	support.detectDuplicates = !!hasDuplicate;
	
	// Initialize against the default document
	setDocument();
	
	// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
	// Detached nodes confoundingly follow *each other*
	support.sortDetached = assert(function( div1 ) {
		// Should return 1, but returns 4 (following)
		return div1.compareDocumentPosition( document.createElement("div") ) & 1;
	});
	
	// Support: IE<8
	// Prevent attribute/property "interpolation"
	// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
	if ( !assert(function( div ) {
		div.innerHTML = "<a href='#'></a>";
		return div.firstChild.getAttribute("href") === "#" ;
	}) ) {
		addHandle( "type|href|height|width", function( elem, name, isXML ) {
			if ( !isXML ) {
				return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
			}
		});
	}
	
	// Support: IE<9
	// Use defaultValue in place of getAttribute("value")
	if ( !support.attributes || !assert(function( div ) {
		div.innerHTML = "<input/>";
		div.firstChild.setAttribute( "value", "" );
		return div.firstChild.getAttribute( "value" ) === "";
	}) ) {
		addHandle( "value", function( elem, name, isXML ) {
			if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
				return elem.defaultValue;
			}
		});
	}
	
	// Support: IE<9
	// Use getAttributeNode to fetch booleans when getAttribute lies
	if ( !assert(function( div ) {
		return div.getAttribute("disabled") == null;
	}) ) {
		addHandle( booleans, function( elem, name, isXML ) {
			var val;
			if ( !isXML ) {
				return elem[ name ] === true ? name.toLowerCase() :
						(val = elem.getAttributeNode( name )) && val.specified ?
						val.value :
					null;
			}
		});
	}
	
	return Sizzle;
	
	})( window );
	
	
	
	jQuery.find = Sizzle;
	jQuery.expr = Sizzle.selectors;
	jQuery.expr[ ":" ] = jQuery.expr.pseudos;
	jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
	jQuery.text = Sizzle.getText;
	jQuery.isXMLDoc = Sizzle.isXML;
	jQuery.contains = Sizzle.contains;
	
	
	
	var dir = function( elem, dir, until ) {
		var matched = [],
			truncate = until !== undefined;
	
		while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
			if ( elem.nodeType === 1 ) {
				if ( truncate && jQuery( elem ).is( until ) ) {
					break;
				}
				matched.push( elem );
			}
		}
		return matched;
	};
	
	
	var siblings = function( n, elem ) {
		var matched = [];
	
		for ( ; n; n = n.nextSibling ) {
			if ( n.nodeType === 1 && n !== elem ) {
				matched.push( n );
			}
		}
	
		return matched;
	};
	
	
	var rneedsContext = jQuery.expr.match.needsContext;
	
	var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
	
	
	
	var risSimple = /^.[^:#\[\.,]*$/;
	
	// Implement the identical functionality for filter and not
	function winnow( elements, qualifier, not ) {
		if ( jQuery.isFunction( qualifier ) ) {
			return jQuery.grep( elements, function( elem, i ) {
				/* jshint -W018 */
				return !!qualifier.call( elem, i, elem ) !== not;
			} );
	
		}
	
		if ( qualifier.nodeType ) {
			return jQuery.grep( elements, function( elem ) {
				return ( elem === qualifier ) !== not;
			} );
	
		}
	
		if ( typeof qualifier === "string" ) {
			if ( risSimple.test( qualifier ) ) {
				return jQuery.filter( qualifier, elements, not );
			}
	
			qualifier = jQuery.filter( qualifier, elements );
		}
	
		return jQuery.grep( elements, function( elem ) {
			return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
		} );
	}
	
	jQuery.filter = function( expr, elems, not ) {
		var elem = elems[ 0 ];
	
		if ( not ) {
			expr = ":not(" + expr + ")";
		}
	
		return elems.length === 1 && elem.nodeType === 1 ?
			jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
			jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
				return elem.nodeType === 1;
			} ) );
	};
	
	jQuery.fn.extend( {
		find: function( selector ) {
			var i,
				len = this.length,
				ret = [],
				self = this;
	
			if ( typeof selector !== "string" ) {
				return this.pushStack( jQuery( selector ).filter( function() {
					for ( i = 0; i < len; i++ ) {
						if ( jQuery.contains( self[ i ], this ) ) {
							return true;
						}
					}
				} ) );
			}
	
			for ( i = 0; i < len; i++ ) {
				jQuery.find( selector, self[ i ], ret );
			}
	
			// Needed because $( selector, context ) becomes $( context ).find( selector )
			ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
			ret.selector = this.selector ? this.selector + " " + selector : selector;
			return ret;
		},
		filter: function( selector ) {
			return this.pushStack( winnow( this, selector || [], false ) );
		},
		not: function( selector ) {
			return this.pushStack( winnow( this, selector || [], true ) );
		},
		is: function( selector ) {
			return !!winnow(
				this,
	
				// If this is a positional/relative selector, check membership in the returned set
				// so $("p:first").is("p:last") won't return true for a doc with two "p".
				typeof selector === "string" && rneedsContext.test( selector ) ?
					jQuery( selector ) :
					selector || [],
				false
			).length;
		}
	} );
	
	
	// Initialize a jQuery object
	
	
	// A central reference to the root jQuery(document)
	var rootjQuery,
	
		// A simple way to check for HTML strings
		// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
		// Strict HTML recognition (#11290: must start with <)
		rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
	
		init = jQuery.fn.init = function( selector, context, root ) {
			var match, elem;
	
			// HANDLE: $(""), $(null), $(undefined), $(false)
			if ( !selector ) {
				return this;
			}
	
			// Method init() accepts an alternate rootjQuery
			// so migrate can support jQuery.sub (gh-2101)
			root = root || rootjQuery;
	
			// Handle HTML strings
			if ( typeof selector === "string" ) {
				if ( selector[ 0 ] === "<" &&
					selector[ selector.length - 1 ] === ">" &&
					selector.length >= 3 ) {
	
					// Assume that strings that start and end with <> are HTML and skip the regex check
					match = [ null, selector, null ];
	
				} else {
					match = rquickExpr.exec( selector );
				}
	
				// Match html or make sure no context is specified for #id
				if ( match && ( match[ 1 ] || !context ) ) {
	
					// HANDLE: $(html) -> $(array)
					if ( match[ 1 ] ) {
						context = context instanceof jQuery ? context[ 0 ] : context;
	
						// Option to run scripts is true for back-compat
						// Intentionally let the error be thrown if parseHTML is not present
						jQuery.merge( this, jQuery.parseHTML(
							match[ 1 ],
							context && context.nodeType ? context.ownerDocument || context : document,
							true
						) );
	
						// HANDLE: $(html, props)
						if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
							for ( match in context ) {
	
								// Properties of context are called as methods if possible
								if ( jQuery.isFunction( this[ match ] ) ) {
									this[ match ]( context[ match ] );
	
								// ...and otherwise set as attributes
								} else {
									this.attr( match, context[ match ] );
								}
							}
						}
	
						return this;
	
					// HANDLE: $(#id)
					} else {
						elem = document.getElementById( match[ 2 ] );
	
						// Support: Blackberry 4.6
						// gEBID returns nodes no longer in the document (#6963)
						if ( elem && elem.parentNode ) {
	
							// Inject the element directly into the jQuery object
							this.length = 1;
							this[ 0 ] = elem;
						}
	
						this.context = document;
						this.selector = selector;
						return this;
					}
	
				// HANDLE: $(expr, $(...))
				} else if ( !context || context.jquery ) {
					return ( context || root ).find( selector );
	
				// HANDLE: $(expr, context)
				// (which is just equivalent to: $(context).find(expr)
				} else {
					return this.constructor( context ).find( selector );
				}
	
			// HANDLE: $(DOMElement)
			} else if ( selector.nodeType ) {
				this.context = this[ 0 ] = selector;
				this.length = 1;
				return this;
	
			// HANDLE: $(function)
			// Shortcut for document ready
			} else if ( jQuery.isFunction( selector ) ) {
				return root.ready !== undefined ?
					root.ready( selector ) :
	
					// Execute immediately if ready is not present
					selector( jQuery );
			}
	
			if ( selector.selector !== undefined ) {
				this.selector = selector.selector;
				this.context = selector.context;
			}
	
			return jQuery.makeArray( selector, this );
		};
	
	// Give the init function the jQuery prototype for later instantiation
	init.prototype = jQuery.fn;
	
	// Initialize central reference
	rootjQuery = jQuery( document );
	
	
	var rparentsprev = /^(?:parents|prev(?:Until|All))/,
	
		// Methods guaranteed to produce a unique set when starting from a unique set
		guaranteedUnique = {
			children: true,
			contents: true,
			next: true,
			prev: true
		};
	
	jQuery.fn.extend( {
		has: function( target ) {
			var targets = jQuery( target, this ),
				l = targets.length;
	
			return this.filter( function() {
				var i = 0;
				for ( ; i < l; i++ ) {
					if ( jQuery.contains( this, targets[ i ] ) ) {
						return true;
					}
				}
			} );
		},
	
		closest: function( selectors, context ) {
			var cur,
				i = 0,
				l = this.length,
				matched = [],
				pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
					jQuery( selectors, context || this.context ) :
					0;
	
			for ( ; i < l; i++ ) {
				for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
	
					// Always skip document fragments
					if ( cur.nodeType < 11 && ( pos ?
						pos.index( cur ) > -1 :
	
						// Don't pass non-elements to Sizzle
						cur.nodeType === 1 &&
							jQuery.find.matchesSelector( cur, selectors ) ) ) {
	
						matched.push( cur );
						break;
					}
				}
			}
	
			return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
		},
	
		// Determine the position of an element within the set
		index: function( elem ) {
	
			// No argument, return index in parent
			if ( !elem ) {
				return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
			}
	
			// Index in selector
			if ( typeof elem === "string" ) {
				return indexOf.call( jQuery( elem ), this[ 0 ] );
			}
	
			// Locate the position of the desired element
			return indexOf.call( this,
	
				// If it receives a jQuery object, the first element is used
				elem.jquery ? elem[ 0 ] : elem
			);
		},
	
		add: function( selector, context ) {
			return this.pushStack(
				jQuery.uniqueSort(
					jQuery.merge( this.get(), jQuery( selector, context ) )
				)
			);
		},
	
		addBack: function( selector ) {
			return this.add( selector == null ?
				this.prevObject : this.prevObject.filter( selector )
			);
		}
	} );
	
	function sibling( cur, dir ) {
		while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
		return cur;
	}
	
	jQuery.each( {
		parent: function( elem ) {
			var parent = elem.parentNode;
			return parent && parent.nodeType !== 11 ? parent : null;
		},
		parents: function( elem ) {
			return dir( elem, "parentNode" );
		},
		parentsUntil: function( elem, i, until ) {
			return dir( elem, "parentNode", until );
		},
		next: function( elem ) {
			return sibling( elem, "nextSibling" );
		},
		prev: function( elem ) {
			return sibling( elem, "previousSibling" );
		},
		nextAll: function( elem ) {
			return dir( elem, "nextSibling" );
		},
		prevAll: function( elem ) {
			return dir( elem, "previousSibling" );
		},
		nextUntil: function( elem, i, until ) {
			return dir( elem, "nextSibling", until );
		},
		prevUntil: function( elem, i, until ) {
			return dir( elem, "previousSibling", until );
		},
		siblings: function( elem ) {
			return siblings( ( elem.parentNode || {} ).firstChild, elem );
		},
		children: function( elem ) {
			return siblings( elem.firstChild );
		},
		contents: function( elem ) {
			return elem.contentDocument || jQuery.merge( [], elem.childNodes );
		}
	}, function( name, fn ) {
		jQuery.fn[ name ] = function( until, selector ) {
			var matched = jQuery.map( this, fn, until );
	
			if ( name.slice( -5 ) !== "Until" ) {
				selector = until;
			}
	
			if ( selector && typeof selector === "string" ) {
				matched = jQuery.filter( selector, matched );
			}
	
			if ( this.length > 1 ) {
	
				// Remove duplicates
				if ( !guaranteedUnique[ name ] ) {
					jQuery.uniqueSort( matched );
				}
	
				// Reverse order for parents* and prev-derivatives
				if ( rparentsprev.test( name ) ) {
					matched.reverse();
				}
			}
	
			return this.pushStack( matched );
		};
	} );
	var rnotwhite = ( /\S+/g );
	
	
	
	// Convert String-formatted options into Object-formatted ones
	function createOptions( options ) {
		var object = {};
		jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
			object[ flag ] = true;
		} );
		return object;
	}
	
	/*
	 * Create a callback list using the following parameters:
	 *
	 *	options: an optional list of space-separated options that will change how
	 *			the callback list behaves or a more traditional option object
	 *
	 * By default a callback list will act like an event callback list and can be
	 * "fired" multiple times.
	 *
	 * Possible options:
	 *
	 *	once:			will ensure the callback list can only be fired once (like a Deferred)
	 *
	 *	memory:			will keep track of previous values and will call any callback added
	 *					after the list has been fired right away with the latest "memorized"
	 *					values (like a Deferred)
	 *
	 *	unique:			will ensure a callback can only be added once (no duplicate in the list)
	 *
	 *	stopOnFalse:	interrupt callings when a callback returns false
	 *
	 */
	jQuery.Callbacks = function( options ) {
	
		// Convert options from String-formatted to Object-formatted if needed
		// (we check in cache first)
		options = typeof options === "string" ?
			createOptions( options ) :
			jQuery.extend( {}, options );
	
		var // Flag to know if list is currently firing
			firing,
	
			// Last fire value for non-forgettable lists
			memory,
	
			// Flag to know if list was already fired
			fired,
	
			// Flag to prevent firing
			locked,
	
			// Actual callback list
			list = [],
	
			// Queue of execution data for repeatable lists
			queue = [],
	
			// Index of currently firing callback (modified by add/remove as needed)
			firingIndex = -1,
	
			// Fire callbacks
			fire = function() {
	
				// Enforce single-firing
				locked = options.once;
	
				// Execute callbacks for all pending executions,
				// respecting firingIndex overrides and runtime changes
				fired = firing = true;
				for ( ; queue.length; firingIndex = -1 ) {
					memory = queue.shift();
					while ( ++firingIndex < list.length ) {
	
						// Run callback and check for early termination
						if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
							options.stopOnFalse ) {
	
							// Jump to end and forget the data so .add doesn't re-fire
							firingIndex = list.length;
							memory = false;
						}
					}
				}
	
				// Forget the data if we're done with it
				if ( !options.memory ) {
					memory = false;
				}
	
				firing = false;
	
				// Clean up if we're done firing for good
				if ( locked ) {
	
					// Keep an empty list if we have data for future add calls
					if ( memory ) {
						list = [];
	
					// Otherwise, this object is spent
					} else {
						list = "";
					}
				}
			},
	
			// Actual Callbacks object
			self = {
	
				// Add a callback or a collection of callbacks to the list
				add: function() {
					if ( list ) {
	
						// If we have memory from a past run, we should fire after adding
						if ( memory && !firing ) {
							firingIndex = list.length - 1;
							queue.push( memory );
						}
	
						( function add( args ) {
							jQuery.each( args, function( _, arg ) {
								if ( jQuery.isFunction( arg ) ) {
									if ( !options.unique || !self.has( arg ) ) {
										list.push( arg );
									}
								} else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
	
									// Inspect recursively
									add( arg );
								}
							} );
						} )( arguments );
	
						if ( memory && !firing ) {
							fire();
						}
					}
					return this;
				},
	
				// Remove a callback from the list
				remove: function() {
					jQuery.each( arguments, function( _, arg ) {
						var index;
						while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
							list.splice( index, 1 );
	
							// Handle firing indexes
							if ( index <= firingIndex ) {
								firingIndex--;
							}
						}
					} );
					return this;
				},
	
				// Check if a given callback is in the list.
				// If no argument is given, return whether or not list has callbacks attached.
				has: function( fn ) {
					return fn ?
						jQuery.inArray( fn, list ) > -1 :
						list.length > 0;
				},
	
				// Remove all callbacks from the list
				empty: function() {
					if ( list ) {
						list = [];
					}
					return this;
				},
	
				// Disable .fire and .add
				// Abort any current/pending executions
				// Clear all callbacks and values
				disable: function() {
					locked = queue = [];
					list = memory = "";
					return this;
				},
				disabled: function() {
					return !list;
				},
	
				// Disable .fire
				// Also disable .add unless we have memory (since it would have no effect)
				// Abort any pending executions
				lock: function() {
					locked = queue = [];
					if ( !memory ) {
						list = memory = "";
					}
					return this;
				},
				locked: function() {
					return !!locked;
				},
	
				// Call all callbacks with the given context and arguments
				fireWith: function( context, args ) {
					if ( !locked ) {
						args = args || [];
						args = [ context, args.slice ? args.slice() : args ];
						queue.push( args );
						if ( !firing ) {
							fire();
						}
					}
					return this;
				},
	
				// Call all the callbacks with the given arguments
				fire: function() {
					self.fireWith( this, arguments );
					return this;
				},
	
				// To know if the callbacks have already been called at least once
				fired: function() {
					return !!fired;
				}
			};
	
		return self;
	};
	
	
	jQuery.extend( {
	
		Deferred: function( func ) {
			var tuples = [
	
					// action, add listener, listener list, final state
					[ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
					[ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
					[ "notify", "progress", jQuery.Callbacks( "memory" ) ]
				],
				state = "pending",
				promise = {
					state: function() {
						return state;
					},
					always: function() {
						deferred.done( arguments ).fail( arguments );
						return this;
					},
					then: function( /* fnDone, fnFail, fnProgress */ ) {
						var fns = arguments;
						return jQuery.Deferred( function( newDefer ) {
							jQuery.each( tuples, function( i, tuple ) {
								var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
	
								// deferred[ done | fail | progress ] for forwarding actions to newDefer
								deferred[ tuple[ 1 ] ]( function() {
									var returned = fn && fn.apply( this, arguments );
									if ( returned && jQuery.isFunction( returned.promise ) ) {
										returned.promise()
											.progress( newDefer.notify )
											.done( newDefer.resolve )
											.fail( newDefer.reject );
									} else {
										newDefer[ tuple[ 0 ] + "With" ](
											this === promise ? newDefer.promise() : this,
											fn ? [ returned ] : arguments
										);
									}
								} );
							} );
							fns = null;
						} ).promise();
					},
	
					// Get a promise for this deferred
					// If obj is provided, the promise aspect is added to the object
					promise: function( obj ) {
						return obj != null ? jQuery.extend( obj, promise ) : promise;
					}
				},
				deferred = {};
	
			// Keep pipe for back-compat
			promise.pipe = promise.then;
	
			// Add list-specific methods
			jQuery.each( tuples, function( i, tuple ) {
				var list = tuple[ 2 ],
					stateString = tuple[ 3 ];
	
				// promise[ done | fail | progress ] = list.add
				promise[ tuple[ 1 ] ] = list.add;
	
				// Handle state
				if ( stateString ) {
					list.add( function() {
	
						// state = [ resolved | rejected ]
						state = stateString;
	
					// [ reject_list | resolve_list ].disable; progress_list.lock
					}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
				}
	
				// deferred[ resolve | reject | notify ]
				deferred[ tuple[ 0 ] ] = function() {
					deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
					return this;
				};
				deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
			} );
	
			// Make the deferred a promise
			promise.promise( deferred );
	
			// Call given func if any
			if ( func ) {
				func.call( deferred, deferred );
			}
	
			// All done!
			return deferred;
		},
	
		// Deferred helper
		when: function( subordinate /* , ..., subordinateN */ ) {
			var i = 0,
				resolveValues = slice.call( arguments ),
				length = resolveValues.length,
	
				// the count of uncompleted subordinates
				remaining = length !== 1 ||
					( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
	
				// the master Deferred.
				// If resolveValues consist of only a single Deferred, just use that.
				deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
	
				// Update function for both resolve and progress values
				updateFunc = function( i, contexts, values ) {
					return function( value ) {
						contexts[ i ] = this;
						values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
						if ( values === progressValues ) {
							deferred.notifyWith( contexts, values );
						} else if ( !( --remaining ) ) {
							deferred.resolveWith( contexts, values );
						}
					};
				},
	
				progressValues, progressContexts, resolveContexts;
	
			// Add listeners to Deferred subordinates; treat others as resolved
			if ( length > 1 ) {
				progressValues = new Array( length );
				progressContexts = new Array( length );
				resolveContexts = new Array( length );
				for ( ; i < length; i++ ) {
					if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
						resolveValues[ i ].promise()
							.progress( updateFunc( i, progressContexts, progressValues ) )
							.done( updateFunc( i, resolveContexts, resolveValues ) )
							.fail( deferred.reject );
					} else {
						--remaining;
					}
				}
			}
	
			// If we're not waiting on anything, resolve the master
			if ( !remaining ) {
				deferred.resolveWith( resolveContexts, resolveValues );
			}
	
			return deferred.promise();
		}
	} );
	
	
	// The deferred used on DOM ready
	var readyList;
	
	jQuery.fn.ready = function( fn ) {
	
		// Add the callback
		jQuery.ready.promise().done( fn );
	
		return this;
	};
	
	jQuery.extend( {
	
		// Is the DOM ready to be used? Set to true once it occurs.
		isReady: false,
	
		// A counter to track how many items to wait for before
		// the ready event fires. See #6781
		readyWait: 1,
	
		// Hold (or release) the ready event
		holdReady: function( hold ) {
			if ( hold ) {
				jQuery.readyWait++;
			} else {
				jQuery.ready( true );
			}
		},
	
		// Handle when the DOM is ready
		ready: function( wait ) {
	
			// Abort if there are pending holds or we're already ready
			if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
				return;
			}
	
			// Remember that the DOM is ready
			jQuery.isReady = true;
	
			// If a normal DOM Ready event fired, decrement, and wait if need be
			if ( wait !== true && --jQuery.readyWait > 0 ) {
				return;
			}
	
			// If there are functions bound, to execute
			readyList.resolveWith( document, [ jQuery ] );
	
			// Trigger any bound ready events
			if ( jQuery.fn.triggerHandler ) {
				jQuery( document ).triggerHandler( "ready" );
				jQuery( document ).off( "ready" );
			}
		}
	} );
	
	/**
	 * The ready event handler and self cleanup method
	 */
	function completed() {
		document.removeEventListener( "DOMContentLoaded", completed );
		window.removeEventListener( "load", completed );
		jQuery.ready();
	}
	
	jQuery.ready.promise = function( obj ) {
		if ( !readyList ) {
	
			readyList = jQuery.Deferred();
	
			// Catch cases where $(document).ready() is called
			// after the browser event has already occurred.
			// Support: IE9-10 only
			// Older IE sometimes signals "interactive" too soon
			if ( document.readyState === "complete" ||
				( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
	
				// Handle it asynchronously to allow scripts the opportunity to delay ready
				window.setTimeout( jQuery.ready );
	
			} else {
	
				// Use the handy event callback
				document.addEventListener( "DOMContentLoaded", completed );
	
				// A fallback to window.onload, that will always work
				window.addEventListener( "load", completed );
			}
		}
		return readyList.promise( obj );
	};
	
	// Kick off the DOM ready check even if the user does not
	jQuery.ready.promise();
	
	
	
	
	// Multifunctional method to get and set values of a collection
	// The value/s can optionally be executed if it's a function
	var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
		var i = 0,
			len = elems.length,
			bulk = key == null;
	
		// Sets many values
		if ( jQuery.type( key ) === "object" ) {
			chainable = true;
			for ( i in key ) {
				access( elems, fn, i, key[ i ], true, emptyGet, raw );
			}
	
		// Sets one value
		} else if ( value !== undefined ) {
			chainable = true;
	
			if ( !jQuery.isFunction( value ) ) {
				raw = true;
			}
	
			if ( bulk ) {
	
				// Bulk operations run against the entire set
				if ( raw ) {
					fn.call( elems, value );
					fn = null;
	
				// ...except when executing function values
				} else {
					bulk = fn;
					fn = function( elem, key, value ) {
						return bulk.call( jQuery( elem ), value );
					};
				}
			}
	
			if ( fn ) {
				for ( ; i < len; i++ ) {
					fn(
						elems[ i ], key, raw ?
						value :
						value.call( elems[ i ], i, fn( elems[ i ], key ) )
					);
				}
			}
		}
	
		return chainable ?
			elems :
	
			// Gets
			bulk ?
				fn.call( elems ) :
				len ? fn( elems[ 0 ], key ) : emptyGet;
	};
	var acceptData = function( owner ) {
	
		// Accepts only:
		//  - Node
		//    - Node.ELEMENT_NODE
		//    - Node.DOCUMENT_NODE
		//  - Object
		//    - Any
		/* jshint -W018 */
		return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
	};
	
	
	
	
	function Data() {
		this.expando = jQuery.expando + Data.uid++;
	}
	
	Data.uid = 1;
	
	Data.prototype = {
	
		register: function( owner, initial ) {
			var value = initial || {};
	
			// If it is a node unlikely to be stringify-ed or looped over
			// use plain assignment
			if ( owner.nodeType ) {
				owner[ this.expando ] = value;
	
			// Otherwise secure it in a non-enumerable, non-writable property
			// configurability must be true to allow the property to be
			// deleted with the delete operator
			} else {
				Object.defineProperty( owner, this.expando, {
					value: value,
					writable: true,
					configurable: true
				} );
			}
			return owner[ this.expando ];
		},
		cache: function( owner ) {
	
			// We can accept data for non-element nodes in modern browsers,
			// but we should not, see #8335.
			// Always return an empty object.
			if ( !acceptData( owner ) ) {
				return {};
			}
	
			// Check if the owner object already has a cache
			var value = owner[ this.expando ];
	
			// If not, create one
			if ( !value ) {
				value = {};
	
				// We can accept data for non-element nodes in modern browsers,
				// but we should not, see #8335.
				// Always return an empty object.
				if ( acceptData( owner ) ) {
	
					// If it is a node unlikely to be stringify-ed or looped over
					// use plain assignment
					if ( owner.nodeType ) {
						owner[ this.expando ] = value;
	
					// Otherwise secure it in a non-enumerable property
					// configurable must be true to allow the property to be
					// deleted when data is removed
					} else {
						Object.defineProperty( owner, this.expando, {
							value: value,
							configurable: true
						} );
					}
				}
			}
	
			return value;
		},
		set: function( owner, data, value ) {
			var prop,
				cache = this.cache( owner );
	
			// Handle: [ owner, key, value ] args
			if ( typeof data === "string" ) {
				cache[ data ] = value;
	
			// Handle: [ owner, { properties } ] args
			} else {
	
				// Copy the properties one-by-one to the cache object
				for ( prop in data ) {
					cache[ prop ] = data[ prop ];
				}
			}
			return cache;
		},
		get: function( owner, key ) {
			return key === undefined ?
				this.cache( owner ) :
				owner[ this.expando ] && owner[ this.expando ][ key ];
		},
		access: function( owner, key, value ) {
			var stored;
	
			// In cases where either:
			//
			//   1. No key was specified
			//   2. A string key was specified, but no value provided
			//
			// Take the "read" path and allow the get method to determine
			// which value to return, respectively either:
			//
			//   1. The entire cache object
			//   2. The data stored at the key
			//
			if ( key === undefined ||
					( ( key && typeof key === "string" ) && value === undefined ) ) {
	
				stored = this.get( owner, key );
	
				return stored !== undefined ?
					stored : this.get( owner, jQuery.camelCase( key ) );
			}
	
			// When the key is not a string, or both a key and value
			// are specified, set or extend (existing objects) with either:
			//
			//   1. An object of properties
			//   2. A key and value
			//
			this.set( owner, key, value );
	
			// Since the "set" path can have two possible entry points
			// return the expected data based on which path was taken[*]
			return value !== undefined ? value : key;
		},
		remove: function( owner, key ) {
			var i, name, camel,
				cache = owner[ this.expando ];
	
			if ( cache === undefined ) {
				return;
			}
	
			if ( key === undefined ) {
				this.register( owner );
	
			} else {
	
				// Support array or space separated string of keys
				if ( jQuery.isArray( key ) ) {
	
					// If "name" is an array of keys...
					// When data is initially created, via ("key", "val") signature,
					// keys will be converted to camelCase.
					// Since there is no way to tell _how_ a key was added, remove
					// both plain key and camelCase key. #12786
					// This will only penalize the array argument path.
					name = key.concat( key.map( jQuery.camelCase ) );
				} else {
					camel = jQuery.camelCase( key );
	
					// Try the string as a key before any manipulation
					if ( key in cache ) {
						name = [ key, camel ];
					} else {
	
						// If a key with the spaces exists, use it.
						// Otherwise, create an array by matching non-whitespace
						name = camel;
						name = name in cache ?
							[ name ] : ( name.match( rnotwhite ) || [] );
					}
				}
	
				i = name.length;
	
				while ( i-- ) {
					delete cache[ name[ i ] ];
				}
			}
	
			// Remove the expando if there's no more data
			if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
	
				// Support: Chrome <= 35-45+
				// Webkit & Blink performance suffers when deleting properties
				// from DOM nodes, so set to undefined instead
				// https://code.google.com/p/chromium/issues/detail?id=378607
				if ( owner.nodeType ) {
					owner[ this.expando ] = undefined;
				} else {
					delete owner[ this.expando ];
				}
			}
		},
		hasData: function( owner ) {
			var cache = owner[ this.expando ];
			return cache !== undefined && !jQuery.isEmptyObject( cache );
		}
	};
	var dataPriv = new Data();
	
	var dataUser = new Data();
	
	
	
	//	Implementation Summary
	//
	//	1. Enforce API surface and semantic compatibility with 1.9.x branch
	//	2. Improve the module's maintainability by reducing the storage
	//		paths to a single mechanism.
	//	3. Use the same single mechanism to support "private" and "user" data.
	//	4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
	//	5. Avoid exposing implementation details on user objects (eg. expando properties)
	//	6. Provide a clear path for implementation upgrade to WeakMap in 2014
	
	var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
		rmultiDash = /[A-Z]/g;
	
	function dataAttr( elem, key, data ) {
		var name;
	
		// If nothing was found internally, try to fetch any
		// data from the HTML5 data-* attribute
		if ( data === undefined && elem.nodeType === 1 ) {
			name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
			data = elem.getAttribute( name );
	
			if ( typeof data === "string" ) {
				try {
					data = data === "true" ? true :
						data === "false" ? false :
						data === "null" ? null :
	
						// Only convert to a number if it doesn't change the string
						+data + "" === data ? +data :
						rbrace.test( data ) ? jQuery.parseJSON( data ) :
						data;
				} catch ( e ) {}
	
				// Make sure we set the data so it isn't changed later
				dataUser.set( elem, key, data );
			} else {
				data = undefined;
			}
		}
		return data;
	}
	
	jQuery.extend( {
		hasData: function( elem ) {
			return dataUser.hasData( elem ) || dataPriv.hasData( elem );
		},
	
		data: function( elem, name, data ) {
			return dataUser.access( elem, name, data );
		},
	
		removeData: function( elem, name ) {
			dataUser.remove( elem, name );
		},
	
		// TODO: Now that all calls to _data and _removeData have been replaced
		// with direct calls to dataPriv methods, these can be deprecated.
		_data: function( elem, name, data ) {
			return dataPriv.access( elem, name, data );
		},
	
		_removeData: function( elem, name ) {
			dataPriv.remove( elem, name );
		}
	} );
	
	jQuery.fn.extend( {
		data: function( key, value ) {
			var i, name, data,
				elem = this[ 0 ],
				attrs = elem && elem.attributes;
	
			// Gets all values
			if ( key === undefined ) {
				if ( this.length ) {
					data = dataUser.get( elem );
	
					if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
						i = attrs.length;
						while ( i-- ) {
	
							// Support: IE11+
							// The attrs elements can be null (#14894)
							if ( attrs[ i ] ) {
								name = attrs[ i ].name;
								if ( name.indexOf( "data-" ) === 0 ) {
									name = jQuery.camelCase( name.slice( 5 ) );
									dataAttr( elem, name, data[ name ] );
								}
							}
						}
						dataPriv.set( elem, "hasDataAttrs", true );
					}
				}
	
				return data;
			}
	
			// Sets multiple values
			if ( typeof key === "object" ) {
				return this.each( function() {
					dataUser.set( this, key );
				} );
			}
	
			return access( this, function( value ) {
				var data, camelKey;
	
				// The calling jQuery object (element matches) is not empty
				// (and therefore has an element appears at this[ 0 ]) and the
				// `value` parameter was not undefined. An empty jQuery object
				// will result in `undefined` for elem = this[ 0 ] which will
				// throw an exception if an attempt to read a data cache is made.
				if ( elem && value === undefined ) {
	
					// Attempt to get data from the cache
					// with the key as-is
					data = dataUser.get( elem, key ) ||
	
						// Try to find dashed key if it exists (gh-2779)
						// This is for 2.2.x only
						dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() );
	
					if ( data !== undefined ) {
						return data;
					}
	
					camelKey = jQuery.camelCase( key );
	
					// Attempt to get data from the cache
					// with the key camelized
					data = dataUser.get( elem, camelKey );
					if ( data !== undefined ) {
						return data;
					}
	
					// Attempt to "discover" the data in
					// HTML5 custom data-* attrs
					data = dataAttr( elem, camelKey, undefined );
					if ( data !== undefined ) {
						return data;
					}
	
					// We tried really hard, but the data doesn't exist.
					return;
				}
	
				// Set the data...
				camelKey = jQuery.camelCase( key );
				this.each( function() {
	
					// First, attempt to store a copy or reference of any
					// data that might've been store with a camelCased key.
					var data = dataUser.get( this, camelKey );
	
					// For HTML5 data-* attribute interop, we have to
					// store property names with dashes in a camelCase form.
					// This might not apply to all properties...*
					dataUser.set( this, camelKey, value );
	
					// *... In the case of properties that might _actually_
					// have dashes, we need to also store a copy of that
					// unchanged property.
					if ( key.indexOf( "-" ) > -1 && data !== undefined ) {
						dataUser.set( this, key, value );
					}
				} );
			}, null, value, arguments.length > 1, null, true );
		},
	
		removeData: function( key ) {
			return this.each( function() {
				dataUser.remove( this, key );
			} );
		}
	} );
	
	
	jQuery.extend( {
		queue: function( elem, type, data ) {
			var queue;
	
			if ( elem ) {
				type = ( type || "fx" ) + "queue";
				queue = dataPriv.get( elem, type );
	
				// Speed up dequeue by getting out quickly if this is just a lookup
				if ( data ) {
					if ( !queue || jQuery.isArray( data ) ) {
						queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
					} else {
						queue.push( data );
					}
				}
				return queue || [];
			}
		},
	
		dequeue: function( elem, type ) {
			type = type || "fx";
	
			var queue = jQuery.queue( elem, type ),
				startLength = queue.length,
				fn = queue.shift(),
				hooks = jQuery._queueHooks( elem, type ),
				next = function() {
					jQuery.dequeue( elem, type );
				};
	
			// If the fx queue is dequeued, always remove the progress sentinel
			if ( fn === "inprogress" ) {
				fn = queue.shift();
				startLength--;
			}
	
			if ( fn ) {
	
				// Add a progress sentinel to prevent the fx queue from being
				// automatically dequeued
				if ( type === "fx" ) {
					queue.unshift( "inprogress" );
				}
	
				// Clear up the last queue stop function
				delete hooks.stop;
				fn.call( elem, next, hooks );
			}
	
			if ( !startLength && hooks ) {
				hooks.empty.fire();
			}
		},
	
		// Not public - generate a queueHooks object, or return the current one
		_queueHooks: function( elem, type ) {
			var key = type + "queueHooks";
			return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
				empty: jQuery.Callbacks( "once memory" ).add( function() {
					dataPriv.remove( elem, [ type + "queue", key ] );
				} )
			} );
		}
	} );
	
	jQuery.fn.extend( {
		queue: function( type, data ) {
			var setter = 2;
	
			if ( typeof type !== "string" ) {
				data = type;
				type = "fx";
				setter--;
			}
	
			if ( arguments.length < setter ) {
				return jQuery.queue( this[ 0 ], type );
			}
	
			return data === undefined ?
				this :
				this.each( function() {
					var queue = jQuery.queue( this, type, data );
	
					// Ensure a hooks for this queue
					jQuery._queueHooks( this, type );
	
					if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
						jQuery.dequeue( this, type );
					}
				} );
		},
		dequeue: function( type ) {
			return this.each( function() {
				jQuery.dequeue( this, type );
			} );
		},
		clearQueue: function( type ) {
			return this.queue( type || "fx", [] );
		},
	
		// Get a promise resolved when queues of a certain type
		// are emptied (fx is the type by default)
		promise: function( type, obj ) {
			var tmp,
				count = 1,
				defer = jQuery.Deferred(),
				elements = this,
				i = this.length,
				resolve = function() {
					if ( !( --count ) ) {
						defer.resolveWith( elements, [ elements ] );
					}
				};
	
			if ( typeof type !== "string" ) {
				obj = type;
				type = undefined;
			}
			type = type || "fx";
	
			while ( i-- ) {
				tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
				if ( tmp && tmp.empty ) {
					count++;
					tmp.empty.add( resolve );
				}
			}
			resolve();
			return defer.promise( obj );
		}
	} );
	var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
	
	var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
	
	
	var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
	
	var isHidden = function( elem, el ) {
	
			// isHidden might be called from jQuery#filter function;
			// in that case, element will be second argument
			elem = el || elem;
			return jQuery.css( elem, "display" ) === "none" ||
				!jQuery.contains( elem.ownerDocument, elem );
		};
	
	
	
	function adjustCSS( elem, prop, valueParts, tween ) {
		var adjusted,
			scale = 1,
			maxIterations = 20,
			currentValue = tween ?
				function() { return tween.cur(); } :
				function() { return jQuery.css( elem, prop, "" ); },
			initial = currentValue(),
			unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
	
			// Starting value computation is required for potential unit mismatches
			initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
				rcssNum.exec( jQuery.css( elem, prop ) );
	
		if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
	
			// Trust units reported by jQuery.css
			unit = unit || initialInUnit[ 3 ];
	
			// Make sure we update the tween properties later on
			valueParts = valueParts || [];
	
			// Iteratively approximate from a nonzero starting point
			initialInUnit = +initial || 1;
	
			do {
	
				// If previous iteration zeroed out, double until we get *something*.
				// Use string for doubling so we don't accidentally see scale as unchanged below
				scale = scale || ".5";
	
				// Adjust and apply
				initialInUnit = initialInUnit / scale;
				jQuery.style( elem, prop, initialInUnit + unit );
	
			// Update scale, tolerating zero or NaN from tween.cur()
			// Break the loop if scale is unchanged or perfect, or if we've just had enough.
			} while (
				scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
			);
		}
	
		if ( valueParts ) {
			initialInUnit = +initialInUnit || +initial || 0;
	
			// Apply relative offset (+=/-=) if specified
			adjusted = valueParts[ 1 ] ?
				initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
				+valueParts[ 2 ];
			if ( tween ) {
				tween.unit = unit;
				tween.start = initialInUnit;
				tween.end = adjusted;
			}
		}
		return adjusted;
	}
	var rcheckableType = ( /^(?:checkbox|radio)$/i );
	
	var rtagName = ( /<([\w:-]+)/ );
	
	var rscriptType = ( /^$|\/(?:java|ecma)script/i );
	
	
	
	// We have to close these tags to support XHTML (#13200)
	var wrapMap = {
	
		// Support: IE9
		option: [ 1, "<select multiple='multiple'>", "</select>" ],
	
		// XHTML parsers do not magically insert elements in the
		// same way that tag soup parsers do. So we cannot shorten
		// this by omitting <tbody> or other required elements.
		thead: [ 1, "<table>", "</table>" ],
		col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
	
		_default: [ 0, "", "" ]
	};
	
	// Support: IE9
	wrapMap.optgroup = wrapMap.option;
	
	wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
	wrapMap.th = wrapMap.td;
	
	
	function getAll( context, tag ) {
	
		// Support: IE9-11+
		// Use typeof to avoid zero-argument method invocation on host objects (#15151)
		var ret = typeof context.getElementsByTagName !== "undefined" ?
				context.getElementsByTagName( tag || "*" ) :
				typeof context.querySelectorAll !== "undefined" ?
					context.querySelectorAll( tag || "*" ) :
				[];
	
		return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
			jQuery.merge( [ context ], ret ) :
			ret;
	}
	
	
	// Mark scripts as having already been evaluated
	function setGlobalEval( elems, refElements ) {
		var i = 0,
			l = elems.length;
	
		for ( ; i < l; i++ ) {
			dataPriv.set(
				elems[ i ],
				"globalEval",
				!refElements || dataPriv.get( refElements[ i ], "globalEval" )
			);
		}
	}
	
	
	var rhtml = /<|&#?\w+;/;
	
	function buildFragment( elems, context, scripts, selection, ignored ) {
		var elem, tmp, tag, wrap, contains, j,
			fragment = context.createDocumentFragment(),
			nodes = [],
			i = 0,
			l = elems.length;
	
		for ( ; i < l; i++ ) {
			elem = elems[ i ];
	
			if ( elem || elem === 0 ) {
	
				// Add nodes directly
				if ( jQuery.type( elem ) === "object" ) {
	
					// Support: Android<4.1, PhantomJS<2
					// push.apply(_, arraylike) throws on ancient WebKit
					jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
	
				// Convert non-html into a text node
				} else if ( !rhtml.test( elem ) ) {
					nodes.push( context.createTextNode( elem ) );
	
				// Convert html into DOM nodes
				} else {
					tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
	
					// Deserialize a standard representation
					tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
					wrap = wrapMap[ tag ] || wrapMap._default;
					tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
	
					// Descend through wrappers to the right content
					j = wrap[ 0 ];
					while ( j-- ) {
						tmp = tmp.lastChild;
					}
	
					// Support: Android<4.1, PhantomJS<2
					// push.apply(_, arraylike) throws on ancient WebKit
					jQuery.merge( nodes, tmp.childNodes );
	
					// Remember the top-level container
					tmp = fragment.firstChild;
	
					// Ensure the created nodes are orphaned (#12392)
					tmp.textContent = "";
				}
			}
		}
	
		// Remove wrapper from fragment
		fragment.textContent = "";
	
		i = 0;
		while ( ( elem = nodes[ i++ ] ) ) {
	
			// Skip elements already in the context collection (trac-4087)
			if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
				if ( ignored ) {
					ignored.push( elem );
				}
				continue;
			}
	
			contains = jQuery.contains( elem.ownerDocument, elem );
	
			// Append to fragment
			tmp = getAll( fragment.appendChild( elem ), "script" );
	
			// Preserve script evaluation history
			if ( contains ) {
				setGlobalEval( tmp );
			}
	
			// Capture executables
			if ( scripts ) {
				j = 0;
				while ( ( elem = tmp[ j++ ] ) ) {
					if ( rscriptType.test( elem.type || "" ) ) {
						scripts.push( elem );
					}
				}
			}
		}
	
		return fragment;
	}
	
	
	( function() {
		var fragment = document.createDocumentFragment(),
			div = fragment.appendChild( document.createElement( "div" ) ),
			input = document.createElement( "input" );
	
		// Support: Android 4.0-4.3, Safari<=5.1
		// Check state lost if the name is set (#11217)
		// Support: Windows Web Apps (WWA)
		// `name` and `type` must use .setAttribute for WWA (#14901)
		input.setAttribute( "type", "radio" );
		input.setAttribute( "checked", "checked" );
		input.setAttribute( "name", "t" );
	
		div.appendChild( input );
	
		// Support: Safari<=5.1, Android<4.2
		// Older WebKit doesn't clone checked state correctly in fragments
		support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
	
		// Support: IE<=11+
		// Make sure textarea (and checkbox) defaultValue is properly cloned
		div.innerHTML = "<textarea>x</textarea>";
		support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
	} )();
	
	
	var
		rkeyEvent = /^key/,
		rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
		rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
	
	function returnTrue() {
		return true;
	}
	
	function returnFalse() {
		return false;
	}
	
	// Support: IE9
	// See #13393 for more info
	function safeActiveElement() {
		try {
			return document.activeElement;
		} catch ( err ) { }
	}
	
	function on( elem, types, selector, data, fn, one ) {
		var origFn, type;
	
		// Types can be a map of types/handlers
		if ( typeof types === "object" ) {
	
			// ( types-Object, selector, data )
			if ( typeof selector !== "string" ) {
	
				// ( types-Object, data )
				data = data || selector;
				selector = undefined;
			}
			for ( type in types ) {
				on( elem, type, selector, data, types[ type ], one );
			}
			return elem;
		}
	
		if ( data == null && fn == null ) {
	
			// ( types, fn )
			fn = selector;
			data = selector = undefined;
		} else if ( fn == null ) {
			if ( typeof selector === "string" ) {
	
				// ( types, selector, fn )
				fn = data;
				data = undefined;
			} else {
	
				// ( types, data, fn )
				fn = data;
				data = selector;
				selector = undefined;
			}
		}
		if ( fn === false ) {
			fn = returnFalse;
		} else if ( !fn ) {
			return elem;
		}
	
		if ( one === 1 ) {
			origFn = fn;
			fn = function( event ) {
	
				// Can use an empty set, since event contains the info
				jQuery().off( event );
				return origFn.apply( this, arguments );
			};
	
			// Use same guid so caller can remove using origFn
			fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
		}
		return elem.each( function() {
			jQuery.event.add( this, types, fn, data, selector );
		} );
	}
	
	/*
	 * Helper functions for managing events -- not part of the public interface.
	 * Props to Dean Edwards' addEvent library for many of the ideas.
	 */
	jQuery.event = {
	
		global: {},
	
		add: function( elem, types, handler, data, selector ) {
	
			var handleObjIn, eventHandle, tmp,
				events, t, handleObj,
				special, handlers, type, namespaces, origType,
				elemData = dataPriv.get( elem );
	
			// Don't attach events to noData or text/comment nodes (but allow plain objects)
			if ( !elemData ) {
				return;
			}
	
			// Caller can pass in an object of custom data in lieu of the handler
			if ( handler.handler ) {
				handleObjIn = handler;
				handler = handleObjIn.handler;
				selector = handleObjIn.selector;
			}
	
			// Make sure that the handler has a unique ID, used to find/remove it later
			if ( !handler.guid ) {
				handler.guid = jQuery.guid++;
			}
	
			// Init the element's event structure and main handler, if this is the first
			if ( !( events = elemData.events ) ) {
				events = elemData.events = {};
			}
			if ( !( eventHandle = elemData.handle ) ) {
				eventHandle = elemData.handle = function( e ) {
	
					// Discard the second event of a jQuery.event.trigger() and
					// when an event is called after a page has unloaded
					return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
						jQuery.event.dispatch.apply( elem, arguments ) : undefined;
				};
			}
	
			// Handle multiple events separated by a space
			types = ( types || "" ).match( rnotwhite ) || [ "" ];
			t = types.length;
			while ( t-- ) {
				tmp = rtypenamespace.exec( types[ t ] ) || [];
				type = origType = tmp[ 1 ];
				namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
	
				// There *must* be a type, no attaching namespace-only handlers
				if ( !type ) {
					continue;
				}
	
				// If event changes its type, use the special event handlers for the changed type
				special = jQuery.event.special[ type ] || {};
	
				// If selector defined, determine special event api type, otherwise given type
				type = ( selector ? special.delegateType : special.bindType ) || type;
	
				// Update special based on newly reset type
				special = jQuery.event.special[ type ] || {};
	
				// handleObj is passed to all event handlers
				handleObj = jQuery.extend( {
					type: type,
					origType: origType,
					data: data,
					handler: handler,
					guid: handler.guid,
					selector: selector,
					needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
					namespace: namespaces.join( "." )
				}, handleObjIn );
	
				// Init the event handler queue if we're the first
				if ( !( handlers = events[ type ] ) ) {
					handlers = events[ type ] = [];
					handlers.delegateCount = 0;
	
					// Only use addEventListener if the special events handler returns false
					if ( !special.setup ||
						special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
	
						if ( elem.addEventListener ) {
							elem.addEventListener( type, eventHandle );
						}
					}
				}
	
				if ( special.add ) {
					special.add.call( elem, handleObj );
	
					if ( !handleObj.handler.guid ) {
						handleObj.handler.guid = handler.guid;
					}
				}
	
				// Add to the element's handler list, delegates in front
				if ( selector ) {
					handlers.splice( handlers.delegateCount++, 0, handleObj );
				} else {
					handlers.push( handleObj );
				}
	
				// Keep track of which events have ever been used, for event optimization
				jQuery.event.global[ type ] = true;
			}
	
		},
	
		// Detach an event or set of events from an element
		remove: function( elem, types, handler, selector, mappedTypes ) {
	
			var j, origCount, tmp,
				events, t, handleObj,
				special, handlers, type, namespaces, origType,
				elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
	
			if ( !elemData || !( events = elemData.events ) ) {
				return;
			}
	
			// Once for each type.namespace in types; type may be omitted
			types = ( types || "" ).match( rnotwhite ) || [ "" ];
			t = types.length;
			while ( t-- ) {
				tmp = rtypenamespace.exec( types[ t ] ) || [];
				type = origType = tmp[ 1 ];
				namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
	
				// Unbind all events (on this namespace, if provided) for the element
				if ( !type ) {
					for ( type in events ) {
						jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
					}
					continue;
				}
	
				special = jQuery.event.special[ type ] || {};
				type = ( selector ? special.delegateType : special.bindType ) || type;
				handlers = events[ type ] || [];
				tmp = tmp[ 2 ] &&
					new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
	
				// Remove matching events
				origCount = j = handlers.length;
				while ( j-- ) {
					handleObj = handlers[ j ];
	
					if ( ( mappedTypes || origType === handleObj.origType ) &&
						( !handler || handler.guid === handleObj.guid ) &&
						( !tmp || tmp.test( handleObj.namespace ) ) &&
						( !selector || selector === handleObj.selector ||
							selector === "**" && handleObj.selector ) ) {
						handlers.splice( j, 1 );
	
						if ( handleObj.selector ) {
							handlers.delegateCount--;
						}
						if ( special.remove ) {
							special.remove.call( elem, handleObj );
						}
					}
				}
	
				// Remove generic event handler if we removed something and no more handlers exist
				// (avoids potential for endless recursion during removal of special event handlers)
				if ( origCount && !handlers.length ) {
					if ( !special.teardown ||
						special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
	
						jQuery.removeEvent( elem, type, elemData.handle );
					}
	
					delete events[ type ];
				}
			}
	
			// Remove data and the expando if it's no longer used
			if ( jQuery.isEmptyObject( events ) ) {
				dataPriv.remove( elem, "handle events" );
			}
		},
	
		dispatch: function( event ) {
	
			// Make a writable jQuery.Event from the native event object
			event = jQuery.event.fix( event );
	
			var i, j, ret, matched, handleObj,
				handlerQueue = [],
				args = slice.call( arguments ),
				handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
				special = jQuery.event.special[ event.type ] || {};
	
			// Use the fix-ed jQuery.Event rather than the (read-only) native event
			args[ 0 ] = event;
			event.delegateTarget = this;
	
			// Call the preDispatch hook for the mapped type, and let it bail if desired
			if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
				return;
			}
	
			// Determine handlers
			handlerQueue = jQuery.event.handlers.call( this, event, handlers );
	
			// Run delegates first; they may want to stop propagation beneath us
			i = 0;
			while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
				event.currentTarget = matched.elem;
	
				j = 0;
				while ( ( handleObj = matched.handlers[ j++ ] ) &&
					!event.isImmediatePropagationStopped() ) {
	
					// Triggered event must either 1) have no namespace, or 2) have namespace(s)
					// a subset or equal to those in the bound event (both can have no namespace).
					if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
	
						event.handleObj = handleObj;
						event.data = handleObj.data;
	
						ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
							handleObj.handler ).apply( matched.elem, args );
	
						if ( ret !== undefined ) {
							if ( ( event.result = ret ) === false ) {
								event.preventDefault();
								event.stopPropagation();
							}
						}
					}
				}
			}
	
			// Call the postDispatch hook for the mapped type
			if ( special.postDispatch ) {
				special.postDispatch.call( this, event );
			}
	
			return event.result;
		},
	
		handlers: function( event, handlers ) {
			var i, matches, sel, handleObj,
				handlerQueue = [],
				delegateCount = handlers.delegateCount,
				cur = event.target;
	
			// Support (at least): Chrome, IE9
			// Find delegate handlers
			// Black-hole SVG <use> instance trees (#13180)
			//
			// Support: Firefox<=42+
			// Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
			if ( delegateCount && cur.nodeType &&
				( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
	
				for ( ; cur !== this; cur = cur.parentNode || this ) {
	
					// Don't check non-elements (#13208)
					// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
					if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
						matches = [];
						for ( i = 0; i < delegateCount; i++ ) {
							handleObj = handlers[ i ];
	
							// Don't conflict with Object.prototype properties (#13203)
							sel = handleObj.selector + " ";
	
							if ( matches[ sel ] === undefined ) {
								matches[ sel ] = handleObj.needsContext ?
									jQuery( sel, this ).index( cur ) > -1 :
									jQuery.find( sel, this, null, [ cur ] ).length;
							}
							if ( matches[ sel ] ) {
								matches.push( handleObj );
							}
						}
						if ( matches.length ) {
							handlerQueue.push( { elem: cur, handlers: matches } );
						}
					}
				}
			}
	
			// Add the remaining (directly-bound) handlers
			if ( delegateCount < handlers.length ) {
				handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
			}
	
			return handlerQueue;
		},
	
		// Includes some event props shared by KeyEvent and MouseEvent
		props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
			"metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ),
	
		fixHooks: {},
	
		keyHooks: {
			props: "char charCode key keyCode".split( " " ),
			filter: function( event, original ) {
	
				// Add which for key events
				if ( event.which == null ) {
					event.which = original.charCode != null ? original.charCode : original.keyCode;
				}
	
				return event;
			}
		},
	
		mouseHooks: {
			props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " +
				"screenX screenY toElement" ).split( " " ),
			filter: function( event, original ) {
				var eventDoc, doc, body,
					button = original.button;
	
				// Calculate pageX/Y if missing and clientX/Y available
				if ( event.pageX == null && original.clientX != null ) {
					eventDoc = event.target.ownerDocument || document;
					doc = eventDoc.documentElement;
					body = eventDoc.body;
	
					event.pageX = original.clientX +
						( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
						( doc && doc.clientLeft || body && body.clientLeft || 0 );
					event.pageY = original.clientY +
						( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) -
						( doc && doc.clientTop  || body && body.clientTop  || 0 );
				}
	
				// Add which for click: 1 === left; 2 === middle; 3 === right
				// Note: button is not normalized, so don't use it
				if ( !event.which && button !== undefined ) {
					event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
				}
	
				return event;
			}
		},
	
		fix: function( event ) {
			if ( event[ jQuery.expando ] ) {
				return event;
			}
	
			// Create a writable copy of the event object and normalize some properties
			var i, prop, copy,
				type = event.type,
				originalEvent = event,
				fixHook = this.fixHooks[ type ];
	
			if ( !fixHook ) {
				this.fixHooks[ type ] = fixHook =
					rmouseEvent.test( type ) ? this.mouseHooks :
					rkeyEvent.test( type ) ? this.keyHooks :
					{};
			}
			copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
	
			event = new jQuery.Event( originalEvent );
	
			i = copy.length;
			while ( i-- ) {
				prop = copy[ i ];
				event[ prop ] = originalEvent[ prop ];
			}
	
			// Support: Cordova 2.5 (WebKit) (#13255)
			// All events should have a target; Cordova deviceready doesn't
			if ( !event.target ) {
				event.target = document;
			}
	
			// Support: Safari 6.0+, Chrome<28
			// Target should not be a text node (#504, #13143)
			if ( event.target.nodeType === 3 ) {
				event.target = event.target.parentNode;
			}
	
			return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
		},
	
		special: {
			load: {
	
				// Prevent triggered image.load events from bubbling to window.load
				noBubble: true
			},
			focus: {
	
				// Fire native event if possible so blur/focus sequence is correct
				trigger: function() {
					if ( this !== safeActiveElement() && this.focus ) {
						this.focus();
						return false;
					}
				},
				delegateType: "focusin"
			},
			blur: {
				trigger: function() {
					if ( this === safeActiveElement() && this.blur ) {
						this.blur();
						return false;
					}
				},
				delegateType: "focusout"
			},
			click: {
	
				// For checkbox, fire native event so checked state will be right
				trigger: function() {
					if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
						this.click();
						return false;
					}
				},
	
				// For cross-browser consistency, don't fire native .click() on links
				_default: function( event ) {
					return jQuery.nodeName( event.target, "a" );
				}
			},
	
			beforeunload: {
				postDispatch: function( event ) {
	
					// Support: Firefox 20+
					// Firefox doesn't alert if the returnValue field is not set.
					if ( event.result !== undefined && event.originalEvent ) {
						event.originalEvent.returnValue = event.result;
					}
				}
			}
		}
	};
	
	jQuery.removeEvent = function( elem, type, handle ) {
	
		// This "if" is needed for plain objects
		if ( elem.removeEventListener ) {
			elem.removeEventListener( type, handle );
		}
	};
	
	jQuery.Event = function( src, props ) {
	
		// Allow instantiation without the 'new' keyword
		if ( !( this instanceof jQuery.Event ) ) {
			return new jQuery.Event( src, props );
		}
	
		// Event object
		if ( src && src.type ) {
			this.originalEvent = src;
			this.type = src.type;
	
			// Events bubbling up the document may have been marked as prevented
			// by a handler lower down the tree; reflect the correct value.
			this.isDefaultPrevented = src.defaultPrevented ||
					src.defaultPrevented === undefined &&
	
					// Support: Android<4.0
					src.returnValue === false ?
				returnTrue :
				returnFalse;
	
		// Event type
		} else {
			this.type = src;
		}
	
		// Put explicitly provided properties onto the event object
		if ( props ) {
			jQuery.extend( this, props );
		}
	
		// Create a timestamp if incoming event doesn't have one
		this.timeStamp = src && src.timeStamp || jQuery.now();
	
		// Mark it as fixed
		this[ jQuery.expando ] = true;
	};
	
	// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
	// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
	jQuery.Event.prototype = {
		constructor: jQuery.Event,
		isDefaultPrevented: returnFalse,
		isPropagationStopped: returnFalse,
		isImmediatePropagationStopped: returnFalse,
		isSimulated: false,
	
		preventDefault: function() {
			var e = this.originalEvent;
	
			this.isDefaultPrevented = returnTrue;
	
			if ( e && !this.isSimulated ) {
				e.preventDefault();
			}
		},
		stopPropagation: function() {
			var e = this.originalEvent;
	
			this.isPropagationStopped = returnTrue;
	
			if ( e && !this.isSimulated ) {
				e.stopPropagation();
			}
		},
		stopImmediatePropagation: function() {
			var e = this.originalEvent;
	
			this.isImmediatePropagationStopped = returnTrue;
	
			if ( e && !this.isSimulated ) {
				e.stopImmediatePropagation();
			}
	
			this.stopPropagation();
		}
	};
	
	// Create mouseenter/leave events using mouseover/out and event-time checks
	// so that event delegation works in jQuery.
	// Do the same for pointerenter/pointerleave and pointerover/pointerout
	//
	// Support: Safari 7 only
	// Safari sends mouseenter too often; see:
	// https://code.google.com/p/chromium/issues/detail?id=470258
	// for the description of the bug (it existed in older Chrome versions as well).
	jQuery.each( {
		mouseenter: "mouseover",
		mouseleave: "mouseout",
		pointerenter: "pointerover",
		pointerleave: "pointerout"
	}, function( orig, fix ) {
		jQuery.event.special[ orig ] = {
			delegateType: fix,
			bindType: fix,
	
			handle: function( event ) {
				var ret,
					target = this,
					related = event.relatedTarget,
					handleObj = event.handleObj;
	
				// For mouseenter/leave call the handler if related is outside the target.
				// NB: No relatedTarget if the mouse left/entered the browser window
				if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
					event.type = handleObj.origType;
					ret = handleObj.handler.apply( this, arguments );
					event.type = fix;
				}
				return ret;
			}
		};
	} );
	
	jQuery.fn.extend( {
		on: function( types, selector, data, fn ) {
			return on( this, types, selector, data, fn );
		},
		one: function( types, selector, data, fn ) {
			return on( this, types, selector, data, fn, 1 );
		},
		off: function( types, selector, fn ) {
			var handleObj, type;
			if ( types && types.preventDefault && types.handleObj ) {
	
				// ( event )  dispatched jQuery.Event
				handleObj = types.handleObj;
				jQuery( types.delegateTarget ).off(
					handleObj.namespace ?
						handleObj.origType + "." + handleObj.namespace :
						handleObj.origType,
					handleObj.selector,
					handleObj.handler
				);
				return this;
			}
			if ( typeof types === "object" ) {
	
				// ( types-object [, selector] )
				for ( type in types ) {
					this.off( type, selector, types[ type ] );
				}
				return this;
			}
			if ( selector === false || typeof selector === "function" ) {
	
				// ( types [, fn] )
				fn = selector;
				selector = undefined;
			}
			if ( fn === false ) {
				fn = returnFalse;
			}
			return this.each( function() {
				jQuery.event.remove( this, types, fn, selector );
			} );
		}
	} );
	
	
	var
		rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
	
		// Support: IE 10-11, Edge 10240+
		// In IE/Edge using regex groups here causes severe slowdowns.
		// See https://connect.microsoft.com/IE/feedback/details/1736512/
		rnoInnerhtml = /<script|<style|<link/i,
	
		// checked="checked" or checked
		rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
		rscriptTypeMasked = /^true\/(.*)/,
		rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
	
	// Manipulating tables requires a tbody
	function manipulationTarget( elem, content ) {
		return jQuery.nodeName( elem, "table" ) &&
			jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
	
			elem.getElementsByTagName( "tbody" )[ 0 ] ||
				elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
			elem;
	}
	
	// Replace/restore the type attribute of script elements for safe DOM manipulation
	function disableScript( elem ) {
		elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
		return elem;
	}
	function restoreScript( elem ) {
		var match = rscriptTypeMasked.exec( elem.type );
	
		if ( match ) {
			elem.type = match[ 1 ];
		} else {
			elem.removeAttribute( "type" );
		}
	
		return elem;
	}
	
	function cloneCopyEvent( src, dest ) {
		var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
	
		if ( dest.nodeType !== 1 ) {
			return;
		}
	
		// 1. Copy private data: events, handlers, etc.
		if ( dataPriv.hasData( src ) ) {
			pdataOld = dataPriv.access( src );
			pdataCur = dataPriv.set( dest, pdataOld );
			events = pdataOld.events;
	
			if ( events ) {
				delete pdataCur.handle;
				pdataCur.events = {};
	
				for ( type in events ) {
					for ( i = 0, l = events[ type ].length; i < l; i++ ) {
						jQuery.event.add( dest, type, events[ type ][ i ] );
					}
				}
			}
		}
	
		// 2. Copy user data
		if ( dataUser.hasData( src ) ) {
			udataOld = dataUser.access( src );
			udataCur = jQuery.extend( {}, udataOld );
	
			dataUser.set( dest, udataCur );
		}
	}
	
	// Fix IE bugs, see support tests
	function fixInput( src, dest ) {
		var nodeName = dest.nodeName.toLowerCase();
	
		// Fails to persist the checked state of a cloned checkbox or radio button.
		if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
			dest.checked = src.checked;
	
		// Fails to return the selected option to the default selected state when cloning options
		} else if ( nodeName === "input" || nodeName === "textarea" ) {
			dest.defaultValue = src.defaultValue;
		}
	}
	
	function domManip( collection, args, callback, ignored ) {
	
		// Flatten any nested arrays
		args = concat.apply( [], args );
	
		var fragment, first, scripts, hasScripts, node, doc,
			i = 0,
			l = collection.length,
			iNoClone = l - 1,
			value = args[ 0 ],
			isFunction = jQuery.isFunction( value );
	
		// We can't cloneNode fragments that contain checked, in WebKit
		if ( isFunction ||
				( l > 1 && typeof value === "string" &&
					!support.checkClone && rchecked.test( value ) ) ) {
			return collection.each( function( index ) {
				var self = collection.eq( index );
				if ( isFunction ) {
					args[ 0 ] = value.call( this, index, self.html() );
				}
				domManip( self, args, callback, ignored );
			} );
		}
	
		if ( l ) {
			fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
			first = fragment.firstChild;
	
			if ( fragment.childNodes.length === 1 ) {
				fragment = first;
			}
	
			// Require either new content or an interest in ignored elements to invoke the callback
			if ( first || ignored ) {
				scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
				hasScripts = scripts.length;
	
				// Use the original fragment for the last item
				// instead of the first because it can end up
				// being emptied incorrectly in certain situations (#8070).
				for ( ; i < l; i++ ) {
					node = fragment;
	
					if ( i !== iNoClone ) {
						node = jQuery.clone( node, true, true );
	
						// Keep references to cloned scripts for later restoration
						if ( hasScripts ) {
	
							// Support: Android<4.1, PhantomJS<2
							// push.apply(_, arraylike) throws on ancient WebKit
							jQuery.merge( scripts, getAll( node, "script" ) );
						}
					}
	
					callback.call( collection[ i ], node, i );
				}
	
				if ( hasScripts ) {
					doc = scripts[ scripts.length - 1 ].ownerDocument;
	
					// Reenable scripts
					jQuery.map( scripts, restoreScript );
	
					// Evaluate executable scripts on first document insertion
					for ( i = 0; i < hasScripts; i++ ) {
						node = scripts[ i ];
						if ( rscriptType.test( node.type || "" ) &&
							!dataPriv.access( node, "globalEval" ) &&
							jQuery.contains( doc, node ) ) {
	
							if ( node.src ) {
	
								// Optional AJAX dependency, but won't run scripts if not present
								if ( jQuery._evalUrl ) {
									jQuery._evalUrl( node.src );
								}
							} else {
								jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
							}
						}
					}
				}
			}
		}
	
		return collection;
	}
	
	function remove( elem, selector, keepData ) {
		var node,
			nodes = selector ? jQuery.filter( selector, elem ) : elem,
			i = 0;
	
		for ( ; ( node = nodes[ i ] ) != null; i++ ) {
			if ( !keepData && node.nodeType === 1 ) {
				jQuery.cleanData( getAll( node ) );
			}
	
			if ( node.parentNode ) {
				if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
					setGlobalEval( getAll( node, "script" ) );
				}
				node.parentNode.removeChild( node );
			}
		}
	
		return elem;
	}
	
	jQuery.extend( {
		htmlPrefilter: function( html ) {
			return html.replace( rxhtmlTag, "<$1></$2>" );
		},
	
		clone: function( elem, dataAndEvents, deepDataAndEvents ) {
			var i, l, srcElements, destElements,
				clone = elem.cloneNode( true ),
				inPage = jQuery.contains( elem.ownerDocument, elem );
	
			// Fix IE cloning issues
			if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
					!jQuery.isXMLDoc( elem ) ) {
	
				// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
				destElements = getAll( clone );
				srcElements = getAll( elem );
	
				for ( i = 0, l = srcElements.length; i < l; i++ ) {
					fixInput( srcElements[ i ], destElements[ i ] );
				}
			}
	
			// Copy the events from the original to the clone
			if ( dataAndEvents ) {
				if ( deepDataAndEvents ) {
					srcElements = srcElements || getAll( elem );
					destElements = destElements || getAll( clone );
	
					for ( i = 0, l = srcElements.length; i < l; i++ ) {
						cloneCopyEvent( srcElements[ i ], destElements[ i ] );
					}
				} else {
					cloneCopyEvent( elem, clone );
				}
			}
	
			// Preserve script evaluation history
			destElements = getAll( clone, "script" );
			if ( destElements.length > 0 ) {
				setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
			}
	
			// Return the cloned set
			return clone;
		},
	
		cleanData: function( elems ) {
			var data, elem, type,
				special = jQuery.event.special,
				i = 0;
	
			for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
				if ( acceptData( elem ) ) {
					if ( ( data = elem[ dataPriv.expando ] ) ) {
						if ( data.events ) {
							for ( type in data.events ) {
								if ( special[ type ] ) {
									jQuery.event.remove( elem, type );
	
								// This is a shortcut to avoid jQuery.event.remove's overhead
								} else {
									jQuery.removeEvent( elem, type, data.handle );
								}
							}
						}
	
						// Support: Chrome <= 35-45+
						// Assign undefined instead of using delete, see Data#remove
						elem[ dataPriv.expando ] = undefined;
					}
					if ( elem[ dataUser.expando ] ) {
	
						// Support: Chrome <= 35-45+
						// Assign undefined instead of using delete, see Data#remove
						elem[ dataUser.expando ] = undefined;
					}
				}
			}
		}
	} );
	
	jQuery.fn.extend( {
	
		// Keep domManip exposed until 3.0 (gh-2225)
		domManip: domManip,
	
		detach: function( selector ) {
			return remove( this, selector, true );
		},
	
		remove: function( selector ) {
			return remove( this, selector );
		},
	
		text: function( value ) {
			return access( this, function( value ) {
				return value === undefined ?
					jQuery.text( this ) :
					this.empty().each( function() {
						if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
							this.textContent = value;
						}
					} );
			}, null, value, arguments.length );
		},
	
		append: function() {
			return domManip( this, arguments, function( elem ) {
				if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
					var target = manipulationTarget( this, elem );
					target.appendChild( elem );
				}
			} );
		},
	
		prepend: function() {
			return domManip( this, arguments, function( elem ) {
				if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
					var target = manipulationTarget( this, elem );
					target.insertBefore( elem, target.firstChild );
				}
			} );
		},
	
		before: function() {
			return domManip( this, arguments, function( elem ) {
				if ( this.parentNode ) {
					this.parentNode.insertBefore( elem, this );
				}
			} );
		},
	
		after: function() {
			return domManip( this, arguments, function( elem ) {
				if ( this.parentNode ) {
					this.parentNode.insertBefore( elem, this.nextSibling );
				}
			} );
		},
	
		empty: function() {
			var elem,
				i = 0;
	
			for ( ; ( elem = this[ i ] ) != null; i++ ) {
				if ( elem.nodeType === 1 ) {
	
					// Prevent memory leaks
					jQuery.cleanData( getAll( elem, false ) );
	
					// Remove any remaining nodes
					elem.textContent = "";
				}
			}
	
			return this;
		},
	
		clone: function( dataAndEvents, deepDataAndEvents ) {
			dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
			deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
	
			return this.map( function() {
				return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
			} );
		},
	
		html: function( value ) {
			return access( this, function( value ) {
				var elem = this[ 0 ] || {},
					i = 0,
					l = this.length;
	
				if ( value === undefined && elem.nodeType === 1 ) {
					return elem.innerHTML;
				}
	
				// See if we can take a shortcut and just use innerHTML
				if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
					!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
	
					value = jQuery.htmlPrefilter( value );
	
					try {
						for ( ; i < l; i++ ) {
							elem = this[ i ] || {};
	
							// Remove element nodes and prevent memory leaks
							if ( elem.nodeType === 1 ) {
								jQuery.cleanData( getAll( elem, false ) );
								elem.innerHTML = value;
							}
						}
	
						elem = 0;
	
					// If using innerHTML throws an exception, use the fallback method
					} catch ( e ) {}
				}
	
				if ( elem ) {
					this.empty().append( value );
				}
			}, null, value, arguments.length );
		},
	
		replaceWith: function() {
			var ignored = [];
	
			// Make the changes, replacing each non-ignored context element with the new content
			return domManip( this, arguments, function( elem ) {
				var parent = this.parentNode;
	
				if ( jQuery.inArray( this, ignored ) < 0 ) {
					jQuery.cleanData( getAll( this ) );
					if ( parent ) {
						parent.replaceChild( elem, this );
					}
				}
	
			// Force callback invocation
			}, ignored );
		}
	} );
	
	jQuery.each( {
		appendTo: "append",
		prependTo: "prepend",
		insertBefore: "before",
		insertAfter: "after",
		replaceAll: "replaceWith"
	}, function( name, original ) {
		jQuery.fn[ name ] = function( selector ) {
			var elems,
				ret = [],
				insert = jQuery( selector ),
				last = insert.length - 1,
				i = 0;
	
			for ( ; i <= last; i++ ) {
				elems = i === last ? this : this.clone( true );
				jQuery( insert[ i ] )[ original ]( elems );
	
				// Support: QtWebKit
				// .get() because push.apply(_, arraylike) throws
				push.apply( ret, elems.get() );
			}
	
			return this.pushStack( ret );
		};
	} );
	
	
	var iframe,
		elemdisplay = {
	
			// Support: Firefox
			// We have to pre-define these values for FF (#10227)
			HTML: "block",
			BODY: "block"
		};
	
	/**
	 * Retrieve the actual display of a element
	 * @param {String} name nodeName of the element
	 * @param {Object} doc Document object
	 */
	
	// Called only from within defaultDisplay
	function actualDisplay( name, doc ) {
		var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
	
			display = jQuery.css( elem[ 0 ], "display" );
	
		// We don't have any data stored on the element,
		// so use "detach" method as fast way to get rid of the element
		elem.detach();
	
		return display;
	}
	
	/**
	 * Try to determine the default display value of an element
	 * @param {String} nodeName
	 */
	function defaultDisplay( nodeName ) {
		var doc = document,
			display = elemdisplay[ nodeName ];
	
		if ( !display ) {
			display = actualDisplay( nodeName, doc );
	
			// If the simple way fails, read from inside an iframe
			if ( display === "none" || !display ) {
	
				// Use the already-created iframe if possible
				iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
					.appendTo( doc.documentElement );
	
				// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
				doc = iframe[ 0 ].contentDocument;
	
				// Support: IE
				doc.write();
				doc.close();
	
				display = actualDisplay( nodeName, doc );
				iframe.detach();
			}
	
			// Store the correct default display
			elemdisplay[ nodeName ] = display;
		}
	
		return display;
	}
	var rmargin = ( /^margin/ );
	
	var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
	
	var getStyles = function( elem ) {
	
			// Support: IE<=11+, Firefox<=30+ (#15098, #14150)
			// IE throws on elements created in popups
			// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
			var view = elem.ownerDocument.defaultView;
	
			if ( !view || !view.opener ) {
				view = window;
			}
	
			return view.getComputedStyle( elem );
		};
	
	var swap = function( elem, options, callback, args ) {
		var ret, name,
			old = {};
	
		// Remember the old values, and insert the new ones
		for ( name in options ) {
			old[ name ] = elem.style[ name ];
			elem.style[ name ] = options[ name ];
		}
	
		ret = callback.apply( elem, args || [] );
	
		// Revert the old values
		for ( name in options ) {
			elem.style[ name ] = old[ name ];
		}
	
		return ret;
	};
	
	
	var documentElement = document.documentElement;
	
	
	
	( function() {
		var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
			container = document.createElement( "div" ),
			div = document.createElement( "div" );
	
		// Finish early in limited (non-browser) environments
		if ( !div.style ) {
			return;
		}
	
		// Support: IE9-11+
		// Style of cloned element affects source element cloned (#8908)
		div.style.backgroundClip = "content-box";
		div.cloneNode( true ).style.backgroundClip = "";
		support.clearCloneStyle = div.style.backgroundClip === "content-box";
	
		container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
			"padding:0;margin-top:1px;position:absolute";
		container.appendChild( div );
	
		// Executing both pixelPosition & boxSizingReliable tests require only one layout
		// so they're executed at the same time to save the second computation.
		function computeStyleTests() {
			div.style.cssText =
	
				// Support: Firefox<29, Android 2.3
				// Vendor-prefix box-sizing
				"-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
				"position:relative;display:block;" +
				"margin:auto;border:1px;padding:1px;" +
				"top:1%;width:50%";
			div.innerHTML = "";
			documentElement.appendChild( container );
	
			var divStyle = window.getComputedStyle( div );
			pixelPositionVal = divStyle.top !== "1%";
			reliableMarginLeftVal = divStyle.marginLeft === "2px";
			boxSizingReliableVal = divStyle.width === "4px";
	
			// Support: Android 4.0 - 4.3 only
			// Some styles come back with percentage values, even though they shouldn't
			div.style.marginRight = "50%";
			pixelMarginRightVal = divStyle.marginRight === "4px";
	
			documentElement.removeChild( container );
		}
	
		jQuery.extend( support, {
			pixelPosition: function() {
	
				// This test is executed only once but we still do memoizing
				// since we can use the boxSizingReliable pre-computing.
				// No need to check if the test was already performed, though.
				computeStyleTests();
				return pixelPositionVal;
			},
			boxSizingReliable: function() {
				if ( boxSizingReliableVal == null ) {
					computeStyleTests();
				}
				return boxSizingReliableVal;
			},
			pixelMarginRight: function() {
	
				// Support: Android 4.0-4.3
				// We're checking for boxSizingReliableVal here instead of pixelMarginRightVal
				// since that compresses better and they're computed together anyway.
				if ( boxSizingReliableVal == null ) {
					computeStyleTests();
				}
				return pixelMarginRightVal;
			},
			reliableMarginLeft: function() {
	
				// Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
				if ( boxSizingReliableVal == null ) {
					computeStyleTests();
				}
				return reliableMarginLeftVal;
			},
			reliableMarginRight: function() {
	
				// Support: Android 2.3
				// Check if div with explicit width and no margin-right incorrectly
				// gets computed margin-right based on width of container. (#3333)
				// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
				// This support function is only executed once so no memoizing is needed.
				var ret,
					marginDiv = div.appendChild( document.createElement( "div" ) );
	
				// Reset CSS: box-sizing; display; margin; border; padding
				marginDiv.style.cssText = div.style.cssText =
	
					// Support: Android 2.3
					// Vendor-prefix box-sizing
					"-webkit-box-sizing:content-box;box-sizing:content-box;" +
					"display:block;margin:0;border:0;padding:0";
				marginDiv.style.marginRight = marginDiv.style.width = "0";
				div.style.width = "1px";
				documentElement.appendChild( container );
	
				ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
	
				documentElement.removeChild( container );
				div.removeChild( marginDiv );
	
				return ret;
			}
		} );
	} )();
	
	
	function curCSS( elem, name, computed ) {
		var width, minWidth, maxWidth, ret,
			style = elem.style;
	
		computed = computed || getStyles( elem );
		ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
	
		// Support: Opera 12.1x only
		// Fall back to style even without computed
		// computed is undefined for elems on document fragments
		if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
			ret = jQuery.style( elem, name );
		}
	
		// Support: IE9
		// getPropertyValue is only needed for .css('filter') (#12537)
		if ( computed ) {
	
			// A tribute to the "awesome hack by Dean Edwards"
			// Android Browser returns percentage for some values,
			// but width seems to be reliably pixels.
			// This is against the CSSOM draft spec:
			// http://dev.w3.org/csswg/cssom/#resolved-values
			if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
	
				// Remember the original values
				width = style.width;
				minWidth = style.minWidth;
				maxWidth = style.maxWidth;
	
				// Put in the new values to get a computed value out
				style.minWidth = style.maxWidth = style.width = ret;
				ret = computed.width;
	
				// Revert the changed values
				style.width = width;
				style.minWidth = minWidth;
				style.maxWidth = maxWidth;
			}
		}
	
		return ret !== undefined ?
	
			// Support: IE9-11+
			// IE returns zIndex value as an integer.
			ret + "" :
			ret;
	}
	
	
	function addGetHookIf( conditionFn, hookFn ) {
	
		// Define the hook, we'll check on the first run if it's really needed.
		return {
			get: function() {
				if ( conditionFn() ) {
	
					// Hook not needed (or it's not possible to use it due
					// to missing dependency), remove it.
					delete this.get;
					return;
				}
	
				// Hook needed; redefine it so that the support test is not executed again.
				return ( this.get = hookFn ).apply( this, arguments );
			}
		};
	}
	
	
	var
	
		// Swappable if display is none or starts with table
		// except "table", "table-cell", or "table-caption"
		// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
		rdisplayswap = /^(none|table(?!-c[ea]).+)/,
	
		cssShow = { position: "absolute", visibility: "hidden", display: "block" },
		cssNormalTransform = {
			letterSpacing: "0",
			fontWeight: "400"
		},
	
		cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
		emptyStyle = document.createElement( "div" ).style;
	
	// Return a css property mapped to a potentially vendor prefixed property
	function vendorPropName( name ) {
	
		// Shortcut for names that are not vendor prefixed
		if ( name in emptyStyle ) {
			return name;
		}
	
		// Check for vendor prefixed names
		var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
			i = cssPrefixes.length;
	
		while ( i-- ) {
			name = cssPrefixes[ i ] + capName;
			if ( name in emptyStyle ) {
				return name;
			}
		}
	}
	
	function setPositiveNumber( elem, value, subtract ) {
	
		// Any relative (+/-) values have already been
		// normalized at this point
		var matches = rcssNum.exec( value );
		return matches ?
	
			// Guard against undefined "subtract", e.g., when used as in cssHooks
			Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
			value;
	}
	
	function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
		var i = extra === ( isBorderBox ? "border" : "content" ) ?
	
			// If we already have the right measurement, avoid augmentation
			4 :
	
			// Otherwise initialize for horizontal or vertical properties
			name === "width" ? 1 : 0,
	
			val = 0;
	
		for ( ; i < 4; i += 2 ) {
	
			// Both box models exclude margin, so add it if we want it
			if ( extra === "margin" ) {
				val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
			}
	
			if ( isBorderBox ) {
	
				// border-box includes padding, so remove it if we want content
				if ( extra === "content" ) {
					val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
				}
	
				// At this point, extra isn't border nor margin, so remove border
				if ( extra !== "margin" ) {
					val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
				}
			} else {
	
				// At this point, extra isn't content, so add padding
				val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
	
				// At this point, extra isn't content nor padding, so add border
				if ( extra !== "padding" ) {
					val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
				}
			}
		}
	
		return val;
	}
	
	function getWidthOrHeight( elem, name, extra ) {
	
		// Start with offset property, which is equivalent to the border-box value
		var valueIsBorderBox = true,
			val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
			styles = getStyles( elem ),
			isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
	
		// Some non-html elements return undefined for offsetWidth, so check for null/undefined
		// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
		// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
		if ( val <= 0 || val == null ) {
	
			// Fall back to computed then uncomputed css if necessary
			val = curCSS( elem, name, styles );
			if ( val < 0 || val == null ) {
				val = elem.style[ name ];
			}
	
			// Computed unit is not pixels. Stop here and return.
			if ( rnumnonpx.test( val ) ) {
				return val;
			}
	
			// Check for style in case a browser which returns unreliable values
			// for getComputedStyle silently falls back to the reliable elem.style
			valueIsBorderBox = isBorderBox &&
				( support.boxSizingReliable() || val === elem.style[ name ] );
	
			// Normalize "", auto, and prepare for extra
			val = parseFloat( val ) || 0;
		}
	
		// Use the active box-sizing model to add/subtract irrelevant styles
		return ( val +
			augmentWidthOrHeight(
				elem,
				name,
				extra || ( isBorderBox ? "border" : "content" ),
				valueIsBorderBox,
				styles
			)
		) + "px";
	}
	
	function showHide( elements, show ) {
		var display, elem, hidden,
			values = [],
			index = 0,
			length = elements.length;
	
		for ( ; index < length; index++ ) {
			elem = elements[ index ];
			if ( !elem.style ) {
				continue;
			}
	
			values[ index ] = dataPriv.get( elem, "olddisplay" );
			display = elem.style.display;
			if ( show ) {
	
				// Reset the inline display of this element to learn if it is
				// being hidden by cascaded rules or not
				if ( !values[ index ] && display === "none" ) {
					elem.style.display = "";
				}
	
				// Set elements which have been overridden with display: none
				// in a stylesheet to whatever the default browser style is
				// for such an element
				if ( elem.style.display === "" && isHidden( elem ) ) {
					values[ index ] = dataPriv.access(
						elem,
						"olddisplay",
						defaultDisplay( elem.nodeName )
					);
				}
			} else {
				hidden = isHidden( elem );
	
				if ( display !== "none" || !hidden ) {
					dataPriv.set(
						elem,
						"olddisplay",
						hidden ? display : jQuery.css( elem, "display" )
					);
				}
			}
		}
	
		// Set the display of most of the elements in a second loop
		// to avoid the constant reflow
		for ( index = 0; index < length; index++ ) {
			elem = elements[ index ];
			if ( !elem.style ) {
				continue;
			}
			if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
				elem.style.display = show ? values[ index ] || "" : "none";
			}
		}
	
		return elements;
	}
	
	jQuery.extend( {
	
		// Add in style property hooks for overriding the default
		// behavior of getting and setting a style property
		cssHooks: {
			opacity: {
				get: function( elem, computed ) {
					if ( computed ) {
	
						// We should always get a number back from opacity
						var ret = curCSS( elem, "opacity" );
						return ret === "" ? "1" : ret;
					}
				}
			}
		},
	
		// Don't automatically add "px" to these possibly-unitless properties
		cssNumber: {
			"animationIterationCount": true,
			"columnCount": true,
			"fillOpacity": true,
			"flexGrow": true,
			"flexShrink": true,
			"fontWeight": true,
			"lineHeight": true,
			"opacity": true,
			"order": true,
			"orphans": true,
			"widows": true,
			"zIndex": true,
			"zoom": true
		},
	
		// Add in properties whose names you wish to fix before
		// setting or getting the value
		cssProps: {
			"float": "cssFloat"
		},
	
		// Get and set the style property on a DOM Node
		style: function( elem, name, value, extra ) {
	
			// Don't set styles on text and comment nodes
			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
				return;
			}
	
			// Make sure that we're working with the right name
			var ret, type, hooks,
				origName = jQuery.camelCase( name ),
				style = elem.style;
	
			name = jQuery.cssProps[ origName ] ||
				( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
	
			// Gets hook for the prefixed version, then unprefixed version
			hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
	
			// Check if we're setting a value
			if ( value !== undefined ) {
				type = typeof value;
	
				// Convert "+=" or "-=" to relative numbers (#7345)
				if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
					value = adjustCSS( elem, name, ret );
	
					// Fixes bug #9237
					type = "number";
				}
	
				// Make sure that null and NaN values aren't set (#7116)
				if ( value == null || value !== value ) {
					return;
				}
	
				// If a number was passed in, add the unit (except for certain CSS properties)
				if ( type === "number" ) {
					value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
				}
	
				// Support: IE9-11+
				// background-* props affect original clone's values
				if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
					style[ name ] = "inherit";
				}
	
				// If a hook was provided, use that value, otherwise just set the specified value
				if ( !hooks || !( "set" in hooks ) ||
					( value = hooks.set( elem, value, extra ) ) !== undefined ) {
	
					style[ name ] = value;
				}
	
			} else {
	
				// If a hook was provided get the non-computed value from there
				if ( hooks && "get" in hooks &&
					( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
	
					return ret;
				}
	
				// Otherwise just get the value from the style object
				return style[ name ];
			}
		},
	
		css: function( elem, name, extra, styles ) {
			var val, num, hooks,
				origName = jQuery.camelCase( name );
	
			// Make sure that we're working with the right name
			name = jQuery.cssProps[ origName ] ||
				( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
	
			// Try prefixed name followed by the unprefixed name
			hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
	
			// If a hook was provided get the computed value from there
			if ( hooks && "get" in hooks ) {
				val = hooks.get( elem, true, extra );
			}
	
			// Otherwise, if a way to get the computed value exists, use that
			if ( val === undefined ) {
				val = curCSS( elem, name, styles );
			}
	
			// Convert "normal" to computed value
			if ( val === "normal" && name in cssNormalTransform ) {
				val = cssNormalTransform[ name ];
			}
	
			// Make numeric if forced or a qualifier was provided and val looks numeric
			if ( extra === "" || extra ) {
				num = parseFloat( val );
				return extra === true || isFinite( num ) ? num || 0 : val;
			}
			return val;
		}
	} );
	
	jQuery.each( [ "height", "width" ], function( i, name ) {
		jQuery.cssHooks[ name ] = {
			get: function( elem, computed, extra ) {
				if ( computed ) {
	
					// Certain elements can have dimension info if we invisibly show them
					// but it must have a current display style that would benefit
					return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
						elem.offsetWidth === 0 ?
							swap( elem, cssShow, function() {
								return getWidthOrHeight( elem, name, extra );
							} ) :
							getWidthOrHeight( elem, name, extra );
				}
			},
	
			set: function( elem, value, extra ) {
				var matches,
					styles = extra && getStyles( elem ),
					subtract = extra && augmentWidthOrHeight(
						elem,
						name,
						extra,
						jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
						styles
					);
	
				// Convert to pixels if value adjustment is needed
				if ( subtract && ( matches = rcssNum.exec( value ) ) &&
					( matches[ 3 ] || "px" ) !== "px" ) {
	
					elem.style[ name ] = value;
					value = jQuery.css( elem, name );
				}
	
				return setPositiveNumber( elem, value, subtract );
			}
		};
	} );
	
	jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
		function( elem, computed ) {
			if ( computed ) {
				return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
					elem.getBoundingClientRect().left -
						swap( elem, { marginLeft: 0 }, function() {
							return elem.getBoundingClientRect().left;
						} )
					) + "px";
			}
		}
	);
	
	// Support: Android 2.3
	jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
		function( elem, computed ) {
			if ( computed ) {
				return swap( elem, { "display": "inline-block" },
					curCSS, [ elem, "marginRight" ] );
			}
		}
	);
	
	// These hooks are used by animate to expand properties
	jQuery.each( {
		margin: "",
		padding: "",
		border: "Width"
	}, function( prefix, suffix ) {
		jQuery.cssHooks[ prefix + suffix ] = {
			expand: function( value ) {
				var i = 0,
					expanded = {},
	
					// Assumes a single number if not a string
					parts = typeof value === "string" ? value.split( " " ) : [ value ];
	
				for ( ; i < 4; i++ ) {
					expanded[ prefix + cssExpand[ i ] + suffix ] =
						parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
				}
	
				return expanded;
			}
		};
	
		if ( !rmargin.test( prefix ) ) {
			jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
		}
	} );
	
	jQuery.fn.extend( {
		css: function( name, value ) {
			return access( this, function( elem, name, value ) {
				var styles, len,
					map = {},
					i = 0;
	
				if ( jQuery.isArray( name ) ) {
					styles = getStyles( elem );
					len = name.length;
	
					for ( ; i < len; i++ ) {
						map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
					}
	
					return map;
				}
	
				return value !== undefined ?
					jQuery.style( elem, name, value ) :
					jQuery.css( elem, name );
			}, name, value, arguments.length > 1 );
		},
		show: function() {
			return showHide( this, true );
		},
		hide: function() {
			return showHide( this );
		},
		toggle: function( state ) {
			if ( typeof state === "boolean" ) {
				return state ? this.show() : this.hide();
			}
	
			return this.each( function() {
				if ( isHidden( this ) ) {
					jQuery( this ).show();
				} else {
					jQuery( this ).hide();
				}
			} );
		}
	} );
	
	
	function Tween( elem, options, prop, end, easing ) {
		return new Tween.prototype.init( elem, options, prop, end, easing );
	}
	jQuery.Tween = Tween;
	
	Tween.prototype = {
		constructor: Tween,
		init: function( elem, options, prop, end, easing, unit ) {
			this.elem = elem;
			this.prop = prop;
			this.easing = easing || jQuery.easing._default;
			this.options = options;
			this.start = this.now = this.cur();
			this.end = end;
			this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
		},
		cur: function() {
			var hooks = Tween.propHooks[ this.prop ];
	
			return hooks && hooks.get ?
				hooks.get( this ) :
				Tween.propHooks._default.get( this );
		},
		run: function( percent ) {
			var eased,
				hooks = Tween.propHooks[ this.prop ];
	
			if ( this.options.duration ) {
				this.pos = eased = jQuery.easing[ this.easing ](
					percent, this.options.duration * percent, 0, 1, this.options.duration
				);
			} else {
				this.pos = eased = percent;
			}
			this.now = ( this.end - this.start ) * eased + this.start;
	
			if ( this.options.step ) {
				this.options.step.call( this.elem, this.now, this );
			}
	
			if ( hooks && hooks.set ) {
				hooks.set( this );
			} else {
				Tween.propHooks._default.set( this );
			}
			return this;
		}
	};
	
	Tween.prototype.init.prototype = Tween.prototype;
	
	Tween.propHooks = {
		_default: {
			get: function( tween ) {
				var result;
	
				// Use a property on the element directly when it is not a DOM element,
				// or when there is no matching style property that exists.
				if ( tween.elem.nodeType !== 1 ||
					tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
					return tween.elem[ tween.prop ];
				}
	
				// Passing an empty string as a 3rd parameter to .css will automatically
				// attempt a parseFloat and fallback to a string if the parse fails.
				// Simple values such as "10px" are parsed to Float;
				// complex values such as "rotate(1rad)" are returned as-is.
				result = jQuery.css( tween.elem, tween.prop, "" );
	
				// Empty strings, null, undefined and "auto" are converted to 0.
				return !result || result === "auto" ? 0 : result;
			},
			set: function( tween ) {
	
				// Use step hook for back compat.
				// Use cssHook if its there.
				// Use .style if available and use plain properties where available.
				if ( jQuery.fx.step[ tween.prop ] ) {
					jQuery.fx.step[ tween.prop ]( tween );
				} else if ( tween.elem.nodeType === 1 &&
					( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
						jQuery.cssHooks[ tween.prop ] ) ) {
					jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
				} else {
					tween.elem[ tween.prop ] = tween.now;
				}
			}
		}
	};
	
	// Support: IE9
	// Panic based approach to setting things on disconnected nodes
	Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
		set: function( tween ) {
			if ( tween.elem.nodeType && tween.elem.parentNode ) {
				tween.elem[ tween.prop ] = tween.now;
			}
		}
	};
	
	jQuery.easing = {
		linear: function( p ) {
			return p;
		},
		swing: function( p ) {
			return 0.5 - Math.cos( p * Math.PI ) / 2;
		},
		_default: "swing"
	};
	
	jQuery.fx = Tween.prototype.init;
	
	// Back Compat <1.8 extension point
	jQuery.fx.step = {};
	
	
	
	
	var
		fxNow, timerId,
		rfxtypes = /^(?:toggle|show|hide)$/,
		rrun = /queueHooks$/;
	
	// Animations created synchronously will run synchronously
	function createFxNow() {
		window.setTimeout( function() {
			fxNow = undefined;
		} );
		return ( fxNow = jQuery.now() );
	}
	
	// Generate parameters to create a standard animation
	function genFx( type, includeWidth ) {
		var which,
			i = 0,
			attrs = { height: type };
	
		// If we include width, step value is 1 to do all cssExpand values,
		// otherwise step value is 2 to skip over Left and Right
		includeWidth = includeWidth ? 1 : 0;
		for ( ; i < 4 ; i += 2 - includeWidth ) {
			which = cssExpand[ i ];
			attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
		}
	
		if ( includeWidth ) {
			attrs.opacity = attrs.width = type;
		}
	
		return attrs;
	}
	
	function createTween( value, prop, animation ) {
		var tween,
			collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
			index = 0,
			length = collection.length;
		for ( ; index < length; index++ ) {
			if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
	
				// We're done with this property
				return tween;
			}
		}
	}
	
	function defaultPrefilter( elem, props, opts ) {
		/* jshint validthis: true */
		var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
			anim = this,
			orig = {},
			style = elem.style,
			hidden = elem.nodeType && isHidden( elem ),
			dataShow = dataPriv.get( elem, "fxshow" );
	
		// Handle queue: false promises
		if ( !opts.queue ) {
			hooks = jQuery._queueHooks( elem, "fx" );
			if ( hooks.unqueued == null ) {
				hooks.unqueued = 0;
				oldfire = hooks.empty.fire;
				hooks.empty.fire = function() {
					if ( !hooks.unqueued ) {
						oldfire();
					}
				};
			}
			hooks.unqueued++;
	
			anim.always( function() {
	
				// Ensure the complete handler is called before this completes
				anim.always( function() {
					hooks.unqueued--;
					if ( !jQuery.queue( elem, "fx" ).length ) {
						hooks.empty.fire();
					}
				} );
			} );
		}
	
		// Height/width overflow pass
		if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
	
			// Make sure that nothing sneaks out
			// Record all 3 overflow attributes because IE9-10 do not
			// change the overflow attribute when overflowX and
			// overflowY are set to the same value
			opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
	
			// Set display property to inline-block for height/width
			// animations on inline elements that are having width/height animated
			display = jQuery.css( elem, "display" );
	
			// Test default display if display is currently "none"
			checkDisplay = display === "none" ?
				dataPriv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
	
			if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
				style.display = "inline-block";
			}
		}
	
		if ( opts.overflow ) {
			style.overflow = "hidden";
			anim.always( function() {
				style.overflow = opts.overflow[ 0 ];
				style.overflowX = opts.overflow[ 1 ];
				style.overflowY = opts.overflow[ 2 ];
			} );
		}
	
		// show/hide pass
		for ( prop in props ) {
			value = props[ prop ];
			if ( rfxtypes.exec( value ) ) {
				delete props[ prop ];
				toggle = toggle || value === "toggle";
				if ( value === ( hidden ? "hide" : "show" ) ) {
	
					// If there is dataShow left over from a stopped hide or show
					// and we are going to proceed with show, we should pretend to be hidden
					if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
						hidden = true;
					} else {
						continue;
					}
				}
				orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
	
			// Any non-fx value stops us from restoring the original display value
			} else {
				display = undefined;
			}
		}
	
		if ( !jQuery.isEmptyObject( orig ) ) {
			if ( dataShow ) {
				if ( "hidden" in dataShow ) {
					hidden = dataShow.hidden;
				}
			} else {
				dataShow = dataPriv.access( elem, "fxshow", {} );
			}
	
			// Store state if its toggle - enables .stop().toggle() to "reverse"
			if ( toggle ) {
				dataShow.hidden = !hidden;
			}
			if ( hidden ) {
				jQuery( elem ).show();
			} else {
				anim.done( function() {
					jQuery( elem ).hide();
				} );
			}
			anim.done( function() {
				var prop;
	
				dataPriv.remove( elem, "fxshow" );
				for ( prop in orig ) {
					jQuery.style( elem, prop, orig[ prop ] );
				}
			} );
			for ( prop in orig ) {
				tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
	
				if ( !( prop in dataShow ) ) {
					dataShow[ prop ] = tween.start;
					if ( hidden ) {
						tween.end = tween.start;
						tween.start = prop === "width" || prop === "height" ? 1 : 0;
					}
				}
			}
	
		// If this is a noop like .hide().hide(), restore an overwritten display value
		} else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) {
			style.display = display;
		}
	}
	
	function propFilter( props, specialEasing ) {
		var index, name, easing, value, hooks;
	
		// camelCase, specialEasing and expand cssHook pass
		for ( index in props ) {
			name = jQuery.camelCase( index );
			easing = specialEasing[ name ];
			value = props[ index ];
			if ( jQuery.isArray( value ) ) {
				easing = value[ 1 ];
				value = props[ index ] = value[ 0 ];
			}
	
			if ( index !== name ) {
				props[ name ] = value;
				delete props[ index ];
			}
	
			hooks = jQuery.cssHooks[ name ];
			if ( hooks && "expand" in hooks ) {
				value = hooks.expand( value );
				delete props[ name ];
	
				// Not quite $.extend, this won't overwrite existing keys.
				// Reusing 'index' because we have the correct "name"
				for ( index in value ) {
					if ( !( index in props ) ) {
						props[ index ] = value[ index ];
						specialEasing[ index ] = easing;
					}
				}
			} else {
				specialEasing[ name ] = easing;
			}
		}
	}
	
	function Animation( elem, properties, options ) {
		var result,
			stopped,
			index = 0,
			length = Animation.prefilters.length,
			deferred = jQuery.Deferred().always( function() {
	
				// Don't match elem in the :animated selector
				delete tick.elem;
			} ),
			tick = function() {
				if ( stopped ) {
					return false;
				}
				var currentTime = fxNow || createFxNow(),
					remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
	
					// Support: Android 2.3
					// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
					temp = remaining / animation.duration || 0,
					percent = 1 - temp,
					index = 0,
					length = animation.tweens.length;
	
				for ( ; index < length ; index++ ) {
					animation.tweens[ index ].run( percent );
				}
	
				deferred.notifyWith( elem, [ animation, percent, remaining ] );
	
				if ( percent < 1 && length ) {
					return remaining;
				} else {
					deferred.resolveWith( elem, [ animation ] );
					return false;
				}
			},
			animation = deferred.promise( {
				elem: elem,
				props: jQuery.extend( {}, properties ),
				opts: jQuery.extend( true, {
					specialEasing: {},
					easing: jQuery.easing._default
				}, options ),
				originalProperties: properties,
				originalOptions: options,
				startTime: fxNow || createFxNow(),
				duration: options.duration,
				tweens: [],
				createTween: function( prop, end ) {
					var tween = jQuery.Tween( elem, animation.opts, prop, end,
							animation.opts.specialEasing[ prop ] || animation.opts.easing );
					animation.tweens.push( tween );
					return tween;
				},
				stop: function( gotoEnd ) {
					var index = 0,
	
						// If we are going to the end, we want to run all the tweens
						// otherwise we skip this part
						length = gotoEnd ? animation.tweens.length : 0;
					if ( stopped ) {
						return this;
					}
					stopped = true;
					for ( ; index < length ; index++ ) {
						animation.tweens[ index ].run( 1 );
					}
	
					// Resolve when we played the last frame; otherwise, reject
					if ( gotoEnd ) {
						deferred.notifyWith( elem, [ animation, 1, 0 ] );
						deferred.resolveWith( elem, [ animation, gotoEnd ] );
					} else {
						deferred.rejectWith( elem, [ animation, gotoEnd ] );
					}
					return this;
				}
			} ),
			props = animation.props;
	
		propFilter( props, animation.opts.specialEasing );
	
		for ( ; index < length ; index++ ) {
			result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
			if ( result ) {
				if ( jQuery.isFunction( result.stop ) ) {
					jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
						jQuery.proxy( result.stop, result );
				}
				return result;
			}
		}
	
		jQuery.map( props, createTween, animation );
	
		if ( jQuery.isFunction( animation.opts.start ) ) {
			animation.opts.start.call( elem, animation );
		}
	
		jQuery.fx.timer(
			jQuery.extend( tick, {
				elem: elem,
				anim: animation,
				queue: animation.opts.queue
			} )
		);
	
		// attach callbacks from options
		return animation.progress( animation.opts.progress )
			.done( animation.opts.done, animation.opts.complete )
			.fail( animation.opts.fail )
			.always( animation.opts.always );
	}
	
	jQuery.Animation = jQuery.extend( Animation, {
		tweeners: {
			"*": [ function( prop, value ) {
				var tween = this.createTween( prop, value );
				adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
				return tween;
			} ]
		},
	
		tweener: function( props, callback ) {
			if ( jQuery.isFunction( props ) ) {
				callback = props;
				props = [ "*" ];
			} else {
				props = props.match( rnotwhite );
			}
	
			var prop,
				index = 0,
				length = props.length;
	
			for ( ; index < length ; index++ ) {
				prop = props[ index ];
				Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
				Animation.tweeners[ prop ].unshift( callback );
			}
		},
	
		prefilters: [ defaultPrefilter ],
	
		prefilter: function( callback, prepend ) {
			if ( prepend ) {
				Animation.prefilters.unshift( callback );
			} else {
				Animation.prefilters.push( callback );
			}
		}
	} );
	
	jQuery.speed = function( speed, easing, fn ) {
		var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
			complete: fn || !fn && easing ||
				jQuery.isFunction( speed ) && speed,
			duration: speed,
			easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
		};
	
		opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ?
			opt.duration : opt.duration in jQuery.fx.speeds ?
				jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
	
		// Normalize opt.queue - true/undefined/null -> "fx"
		if ( opt.queue == null || opt.queue === true ) {
			opt.queue = "fx";
		}
	
		// Queueing
		opt.old = opt.complete;
	
		opt.complete = function() {
			if ( jQuery.isFunction( opt.old ) ) {
				opt.old.call( this );
			}
	
			if ( opt.queue ) {
				jQuery.dequeue( this, opt.queue );
			}
		};
	
		return opt;
	};
	
	jQuery.fn.extend( {
		fadeTo: function( speed, to, easing, callback ) {
	
			// Show any hidden elements after setting opacity to 0
			return this.filter( isHidden ).css( "opacity", 0 ).show()
	
				// Animate to the value specified
				.end().animate( { opacity: to }, speed, easing, callback );
		},
		animate: function( prop, speed, easing, callback ) {
			var empty = jQuery.isEmptyObject( prop ),
				optall = jQuery.speed( speed, easing, callback ),
				doAnimation = function() {
	
					// Operate on a copy of prop so per-property easing won't be lost
					var anim = Animation( this, jQuery.extend( {}, prop ), optall );
	
					// Empty animations, or finishing resolves immediately
					if ( empty || dataPriv.get( this, "finish" ) ) {
						anim.stop( true );
					}
				};
				doAnimation.finish = doAnimation;
	
			return empty || optall.queue === false ?
				this.each( doAnimation ) :
				this.queue( optall.queue, doAnimation );
		},
		stop: function( type, clearQueue, gotoEnd ) {
			var stopQueue = function( hooks ) {
				var stop = hooks.stop;
				delete hooks.stop;
				stop( gotoEnd );
			};
	
			if ( typeof type !== "string" ) {
				gotoEnd = clearQueue;
				clearQueue = type;
				type = undefined;
			}
			if ( clearQueue && type !== false ) {
				this.queue( type || "fx", [] );
			}
	
			return this.each( function() {
				var dequeue = true,
					index = type != null && type + "queueHooks",
					timers = jQuery.timers,
					data = dataPriv.get( this );
	
				if ( index ) {
					if ( data[ index ] && data[ index ].stop ) {
						stopQueue( data[ index ] );
					}
				} else {
					for ( index in data ) {
						if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
							stopQueue( data[ index ] );
						}
					}
				}
	
				for ( index = timers.length; index--; ) {
					if ( timers[ index ].elem === this &&
						( type == null || timers[ index ].queue === type ) ) {
	
						timers[ index ].anim.stop( gotoEnd );
						dequeue = false;
						timers.splice( index, 1 );
					}
				}
	
				// Start the next in the queue if the last step wasn't forced.
				// Timers currently will call their complete callbacks, which
				// will dequeue but only if they were gotoEnd.
				if ( dequeue || !gotoEnd ) {
					jQuery.dequeue( this, type );
				}
			} );
		},
		finish: function( type ) {
			if ( type !== false ) {
				type = type || "fx";
			}
			return this.each( function() {
				var index,
					data = dataPriv.get( this ),
					queue = data[ type + "queue" ],
					hooks = data[ type + "queueHooks" ],
					timers = jQuery.timers,
					length = queue ? queue.length : 0;
	
				// Enable finishing flag on private data
				data.finish = true;
	
				// Empty the queue first
				jQuery.queue( this, type, [] );
	
				if ( hooks && hooks.stop ) {
					hooks.stop.call( this, true );
				}
	
				// Look for any active animations, and finish them
				for ( index = timers.length; index--; ) {
					if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
						timers[ index ].anim.stop( true );
						timers.splice( index, 1 );
					}
				}
	
				// Look for any animations in the old queue and finish them
				for ( index = 0; index < length; index++ ) {
					if ( queue[ index ] && queue[ index ].finish ) {
						queue[ index ].finish.call( this );
					}
				}
	
				// Turn off finishing flag
				delete data.finish;
			} );
		}
	} );
	
	jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
		var cssFn = jQuery.fn[ name ];
		jQuery.fn[ name ] = function( speed, easing, callback ) {
			return speed == null || typeof speed === "boolean" ?
				cssFn.apply( this, arguments ) :
				this.animate( genFx( name, true ), speed, easing, callback );
		};
	} );
	
	// Generate shortcuts for custom animations
	jQuery.each( {
		slideDown: genFx( "show" ),
		slideUp: genFx( "hide" ),
		slideToggle: genFx( "toggle" ),
		fadeIn: { opacity: "show" },
		fadeOut: { opacity: "hide" },
		fadeToggle: { opacity: "toggle" }
	}, function( name, props ) {
		jQuery.fn[ name ] = function( speed, easing, callback ) {
			return this.animate( props, speed, easing, callback );
		};
	} );
	
	jQuery.timers = [];
	jQuery.fx.tick = function() {
		var timer,
			i = 0,
			timers = jQuery.timers;
	
		fxNow = jQuery.now();
	
		for ( ; i < timers.length; i++ ) {
			timer = timers[ i ];
	
			// Checks the timer has not already been removed
			if ( !timer() && timers[ i ] === timer ) {
				timers.splice( i--, 1 );
			}
		}
	
		if ( !timers.length ) {
			jQuery.fx.stop();
		}
		fxNow = undefined;
	};
	
	jQuery.fx.timer = function( timer ) {
		jQuery.timers.push( timer );
		if ( timer() ) {
			jQuery.fx.start();
		} else {
			jQuery.timers.pop();
		}
	};
	
	jQuery.fx.interval = 13;
	jQuery.fx.start = function() {
		if ( !timerId ) {
			timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
		}
	};
	
	jQuery.fx.stop = function() {
		window.clearInterval( timerId );
	
		timerId = null;
	};
	
	jQuery.fx.speeds = {
		slow: 600,
		fast: 200,
	
		// Default speed
		_default: 400
	};
	
	
	// Based off of the plugin by Clint Helfers, with permission.
	// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
	jQuery.fn.delay = function( time, type ) {
		time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
		type = type || "fx";
	
		return this.queue( type, function( next, hooks ) {
			var timeout = window.setTimeout( next, time );
			hooks.stop = function() {
				window.clearTimeout( timeout );
			};
		} );
	};
	
	
	( function() {
		var input = document.createElement( "input" ),
			select = document.createElement( "select" ),
			opt = select.appendChild( document.createElement( "option" ) );
	
		input.type = "checkbox";
	
		// Support: iOS<=5.1, Android<=4.2+
		// Default value for a checkbox should be "on"
		support.checkOn = input.value !== "";
	
		// Support: IE<=11+
		// Must access selectedIndex to make default options select
		support.optSelected = opt.selected;
	
		// Support: Android<=2.3
		// Options inside disabled selects are incorrectly marked as disabled
		select.disabled = true;
		support.optDisabled = !opt.disabled;
	
		// Support: IE<=11+
		// An input loses its value after becoming a radio
		input = document.createElement( "input" );
		input.value = "t";
		input.type = "radio";
		support.radioValue = input.value === "t";
	} )();
	
	
	var boolHook,
		attrHandle = jQuery.expr.attrHandle;
	
	jQuery.fn.extend( {
		attr: function( name, value ) {
			return access( this, jQuery.attr, name, value, arguments.length > 1 );
		},
	
		removeAttr: function( name ) {
			return this.each( function() {
				jQuery.removeAttr( this, name );
			} );
		}
	} );
	
	jQuery.extend( {
		attr: function( elem, name, value ) {
			var ret, hooks,
				nType = elem.nodeType;
	
			// Don't get/set attributes on text, comment and attribute nodes
			if ( nType === 3 || nType === 8 || nType === 2 ) {
				return;
			}
	
			// Fallback to prop when attributes are not supported
			if ( typeof elem.getAttribute === "undefined" ) {
				return jQuery.prop( elem, name, value );
			}
	
			// All attributes are lowercase
			// Grab necessary hook if one is defined
			if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
				name = name.toLowerCase();
				hooks = jQuery.attrHooks[ name ] ||
					( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
			}
	
			if ( value !== undefined ) {
				if ( value === null ) {
					jQuery.removeAttr( elem, name );
					return;
				}
	
				if ( hooks && "set" in hooks &&
					( ret = hooks.set( elem, value, name ) ) !== undefined ) {
					return ret;
				}
	
				elem.setAttribute( name, value + "" );
				return value;
			}
	
			if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
				return ret;
			}
	
			ret = jQuery.find.attr( elem, name );
	
			// Non-existent attributes return null, we normalize to undefined
			return ret == null ? undefined : ret;
		},
	
		attrHooks: {
			type: {
				set: function( elem, value ) {
					if ( !support.radioValue && value === "radio" &&
						jQuery.nodeName( elem, "input" ) ) {
						var val = elem.value;
						elem.setAttribute( "type", value );
						if ( val ) {
							elem.value = val;
						}
						return value;
					}
				}
			}
		},
	
		removeAttr: function( elem, value ) {
			var name, propName,
				i = 0,
				attrNames = value && value.match( rnotwhite );
	
			if ( attrNames && elem.nodeType === 1 ) {
				while ( ( name = attrNames[ i++ ] ) ) {
					propName = jQuery.propFix[ name ] || name;
	
					// Boolean attributes get special treatment (#10870)
					if ( jQuery.expr.match.bool.test( name ) ) {
	
						// Set corresponding property to false
						elem[ propName ] = false;
					}
	
					elem.removeAttribute( name );
				}
			}
		}
	} );
	
	// Hooks for boolean attributes
	boolHook = {
		set: function( elem, value, name ) {
			if ( value === false ) {
	
				// Remove boolean attributes when set to false
				jQuery.removeAttr( elem, name );
			} else {
				elem.setAttribute( name, name );
			}
			return name;
		}
	};
	jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
		var getter = attrHandle[ name ] || jQuery.find.attr;
	
		attrHandle[ name ] = function( elem, name, isXML ) {
			var ret, handle;
			if ( !isXML ) {
	
				// Avoid an infinite loop by temporarily removing this function from the getter
				handle = attrHandle[ name ];
				attrHandle[ name ] = ret;
				ret = getter( elem, name, isXML ) != null ?
					name.toLowerCase() :
					null;
				attrHandle[ name ] = handle;
			}
			return ret;
		};
	} );
	
	
	
	
	var rfocusable = /^(?:input|select|textarea|button)$/i,
		rclickable = /^(?:a|area)$/i;
	
	jQuery.fn.extend( {
		prop: function( name, value ) {
			return access( this, jQuery.prop, name, value, arguments.length > 1 );
		},
	
		removeProp: function( name ) {
			return this.each( function() {
				delete this[ jQuery.propFix[ name ] || name ];
			} );
		}
	} );
	
	jQuery.extend( {
		prop: function( elem, name, value ) {
			var ret, hooks,
				nType = elem.nodeType;
	
			// Don't get/set properties on text, comment and attribute nodes
			if ( nType === 3 || nType === 8 || nType === 2 ) {
				return;
			}
	
			if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
	
				// Fix name and attach hooks
				name = jQuery.propFix[ name ] || name;
				hooks = jQuery.propHooks[ name ];
			}
	
			if ( value !== undefined ) {
				if ( hooks && "set" in hooks &&
					( ret = hooks.set( elem, value, name ) ) !== undefined ) {
					return ret;
				}
	
				return ( elem[ name ] = value );
			}
	
			if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
				return ret;
			}
	
			return elem[ name ];
		},
	
		propHooks: {
			tabIndex: {
				get: function( elem ) {
	
					// elem.tabIndex doesn't always return the
					// correct value when it hasn't been explicitly set
					// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
					// Use proper attribute retrieval(#12072)
					var tabindex = jQuery.find.attr( elem, "tabindex" );
	
					return tabindex ?
						parseInt( tabindex, 10 ) :
						rfocusable.test( elem.nodeName ) ||
							rclickable.test( elem.nodeName ) && elem.href ?
								0 :
								-1;
				}
			}
		},
	
		propFix: {
			"for": "htmlFor",
			"class": "className"
		}
	} );
	
	// Support: IE <=11 only
	// Accessing the selectedIndex property
	// forces the browser to respect setting selected
	// on the option
	// The getter ensures a default option is selected
	// when in an optgroup
	if ( !support.optSelected ) {
		jQuery.propHooks.selected = {
			get: function( elem ) {
				var parent = elem.parentNode;
				if ( parent && parent.parentNode ) {
					parent.parentNode.selectedIndex;
				}
				return null;
			},
			set: function( elem ) {
				var parent = elem.parentNode;
				if ( parent ) {
					parent.selectedIndex;
	
					if ( parent.parentNode ) {
						parent.parentNode.selectedIndex;
					}
				}
			}
		};
	}
	
	jQuery.each( [
		"tabIndex",
		"readOnly",
		"maxLength",
		"cellSpacing",
		"cellPadding",
		"rowSpan",
		"colSpan",
		"useMap",
		"frameBorder",
		"contentEditable"
	], function() {
		jQuery.propFix[ this.toLowerCase() ] = this;
	} );
	
	
	
	
	var rclass = /[\t\r\n\f]/g;
	
	function getClass( elem ) {
		return elem.getAttribute && elem.getAttribute( "class" ) || "";
	}
	
	jQuery.fn.extend( {
		addClass: function( value ) {
			var classes, elem, cur, curValue, clazz, j, finalValue,
				i = 0;
	
			if ( jQuery.isFunction( value ) ) {
				return this.each( function( j ) {
					jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
				} );
			}
	
			if ( typeof value === "string" && value ) {
				classes = value.match( rnotwhite ) || [];
	
				while ( ( elem = this[ i++ ] ) ) {
					curValue = getClass( elem );
					cur = elem.nodeType === 1 &&
						( " " + curValue + " " ).replace( rclass, " " );
	
					if ( cur ) {
						j = 0;
						while ( ( clazz = classes[ j++ ] ) ) {
							if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
								cur += clazz + " ";
							}
						}
	
						// Only assign if different to avoid unneeded rendering.
						finalValue = jQuery.trim( cur );
						if ( curValue !== finalValue ) {
							elem.setAttribute( "class", finalValue );
						}
					}
				}
			}
	
			return this;
		},
	
		removeClass: function( value ) {
			var classes, elem, cur, curValue, clazz, j, finalValue,
				i = 0;
	
			if ( jQuery.isFunction( value ) ) {
				return this.each( function( j ) {
					jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
				} );
			}
	
			if ( !arguments.length ) {
				return this.attr( "class", "" );
			}
	
			if ( typeof value === "string" && value ) {
				classes = value.match( rnotwhite ) || [];
	
				while ( ( elem = this[ i++ ] ) ) {
					curValue = getClass( elem );
	
					// This expression is here for better compressibility (see addClass)
					cur = elem.nodeType === 1 &&
						( " " + curValue + " " ).replace( rclass, " " );
	
					if ( cur ) {
						j = 0;
						while ( ( clazz = classes[ j++ ] ) ) {
	
							// Remove *all* instances
							while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
								cur = cur.replace( " " + clazz + " ", " " );
							}
						}
	
						// Only assign if different to avoid unneeded rendering.
						finalValue = jQuery.trim( cur );
						if ( curValue !== finalValue ) {
							elem.setAttribute( "class", finalValue );
						}
					}
				}
			}
	
			return this;
		},
	
		toggleClass: function( value, stateVal ) {
			var type = typeof value;
	
			if ( typeof stateVal === "boolean" && type === "string" ) {
				return stateVal ? this.addClass( value ) : this.removeClass( value );
			}
	
			if ( jQuery.isFunction( value ) ) {
				return this.each( function( i ) {
					jQuery( this ).toggleClass(
						value.call( this, i, getClass( this ), stateVal ),
						stateVal
					);
				} );
			}
	
			return this.each( function() {
				var className, i, self, classNames;
	
				if ( type === "string" ) {
	
					// Toggle individual class names
					i = 0;
					self = jQuery( this );
					classNames = value.match( rnotwhite ) || [];
	
					while ( ( className = classNames[ i++ ] ) ) {
	
						// Check each className given, space separated list
						if ( self.hasClass( className ) ) {
							self.removeClass( className );
						} else {
							self.addClass( className );
						}
					}
	
				// Toggle whole class name
				} else if ( value === undefined || type === "boolean" ) {
					className = getClass( this );
					if ( className ) {
	
						// Store className if set
						dataPriv.set( this, "__className__", className );
					}
	
					// If the element has a class name or if we're passed `false`,
					// then remove the whole classname (if there was one, the above saved it).
					// Otherwise bring back whatever was previously saved (if anything),
					// falling back to the empty string if nothing was stored.
					if ( this.setAttribute ) {
						this.setAttribute( "class",
							className || value === false ?
							"" :
							dataPriv.get( this, "__className__" ) || ""
						);
					}
				}
			} );
		},
	
		hasClass: function( selector ) {
			var className, elem,
				i = 0;
	
			className = " " + selector + " ";
			while ( ( elem = this[ i++ ] ) ) {
				if ( elem.nodeType === 1 &&
					( " " + getClass( elem ) + " " ).replace( rclass, " " )
						.indexOf( className ) > -1
				) {
					return true;
				}
			}
	
			return false;
		}
	} );
	
	
	
	
	var rreturn = /\r/g,
		rspaces = /[\x20\t\r\n\f]+/g;
	
	jQuery.fn.extend( {
		val: function( value ) {
			var hooks, ret, isFunction,
				elem = this[ 0 ];
	
			if ( !arguments.length ) {
				if ( elem ) {
					hooks = jQuery.valHooks[ elem.type ] ||
						jQuery.valHooks[ elem.nodeName.toLowerCase() ];
	
					if ( hooks &&
						"get" in hooks &&
						( ret = hooks.get( elem, "value" ) ) !== undefined
					) {
						return ret;
					}
	
					ret = elem.value;
	
					return typeof ret === "string" ?
	
						// Handle most common string cases
						ret.replace( rreturn, "" ) :
	
						// Handle cases where value is null/undef or number
						ret == null ? "" : ret;
				}
	
				return;
			}
	
			isFunction = jQuery.isFunction( value );
	
			return this.each( function( i ) {
				var val;
	
				if ( this.nodeType !== 1 ) {
					return;
				}
	
				if ( isFunction ) {
					val = value.call( this, i, jQuery( this ).val() );
				} else {
					val = value;
				}
	
				// Treat null/undefined as ""; convert numbers to string
				if ( val == null ) {
					val = "";
	
				} else if ( typeof val === "number" ) {
					val += "";
	
				} else if ( jQuery.isArray( val ) ) {
					val = jQuery.map( val, function( value ) {
						return value == null ? "" : value + "";
					} );
				}
	
				hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
	
				// If set returns undefined, fall back to normal setting
				if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
					this.value = val;
				}
			} );
		}
	} );
	
	jQuery.extend( {
		valHooks: {
			option: {
				get: function( elem ) {
	
					var val = jQuery.find.attr( elem, "value" );
					return val != null ?
						val :
	
						// Support: IE10-11+
						// option.text throws exceptions (#14686, #14858)
						// Strip and collapse whitespace
						// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
						jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " );
				}
			},
			select: {
				get: function( elem ) {
					var value, option,
						options = elem.options,
						index = elem.selectedIndex,
						one = elem.type === "select-one" || index < 0,
						values = one ? null : [],
						max = one ? index + 1 : options.length,
						i = index < 0 ?
							max :
							one ? index : 0;
	
					// Loop through all the selected options
					for ( ; i < max; i++ ) {
						option = options[ i ];
	
						// IE8-9 doesn't update selected after form reset (#2551)
						if ( ( option.selected || i === index ) &&
	
								// Don't return options that are disabled or in a disabled optgroup
								( support.optDisabled ?
									!option.disabled : option.getAttribute( "disabled" ) === null ) &&
								( !option.parentNode.disabled ||
									!jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
	
							// Get the specific value for the option
							value = jQuery( option ).val();
	
							// We don't need an array for one selects
							if ( one ) {
								return value;
							}
	
							// Multi-Selects return an array
							values.push( value );
						}
					}
	
					return values;
				},
	
				set: function( elem, value ) {
					var optionSet, option,
						options = elem.options,
						values = jQuery.makeArray( value ),
						i = options.length;
	
					while ( i-- ) {
						option = options[ i ];
						if ( option.selected =
							jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
						) {
							optionSet = true;
						}
					}
	
					// Force browsers to behave consistently when non-matching value is set
					if ( !optionSet ) {
						elem.selectedIndex = -1;
					}
					return values;
				}
			}
		}
	} );
	
	// Radios and checkboxes getter/setter
	jQuery.each( [ "radio", "checkbox" ], function() {
		jQuery.valHooks[ this ] = {
			set: function( elem, value ) {
				if ( jQuery.isArray( value ) ) {
					return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
				}
			}
		};
		if ( !support.checkOn ) {
			jQuery.valHooks[ this ].get = function( elem ) {
				return elem.getAttribute( "value" ) === null ? "on" : elem.value;
			};
		}
	} );
	
	
	
	
	// Return jQuery for attributes-only inclusion
	
	
	var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
	
	jQuery.extend( jQuery.event, {
	
		trigger: function( event, data, elem, onlyHandlers ) {
	
			var i, cur, tmp, bubbleType, ontype, handle, special,
				eventPath = [ elem || document ],
				type = hasOwn.call( event, "type" ) ? event.type : event,
				namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
	
			cur = tmp = elem = elem || document;
	
			// Don't do events on text and comment nodes
			if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
				return;
			}
	
			// focus/blur morphs to focusin/out; ensure we're not firing them right now
			if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
				return;
			}
	
			if ( type.indexOf( "." ) > -1 ) {
	
				// Namespaced trigger; create a regexp to match event type in handle()
				namespaces = type.split( "." );
				type = namespaces.shift();
				namespaces.sort();
			}
			ontype = type.indexOf( ":" ) < 0 && "on" + type;
	
			// Caller can pass in a jQuery.Event object, Object, or just an event type string
			event = event[ jQuery.expando ] ?
				event :
				new jQuery.Event( type, typeof event === "object" && event );
	
			// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
			event.isTrigger = onlyHandlers ? 2 : 3;
			event.namespace = namespaces.join( "." );
			event.rnamespace = event.namespace ?
				new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
				null;
	
			// Clean up the event in case it is being reused
			event.result = undefined;
			if ( !event.target ) {
				event.target = elem;
			}
	
			// Clone any incoming data and prepend the event, creating the handler arg list
			data = data == null ?
				[ event ] :
				jQuery.makeArray( data, [ event ] );
	
			// Allow special events to draw outside the lines
			special = jQuery.event.special[ type ] || {};
			if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
				return;
			}
	
			// Determine event propagation path in advance, per W3C events spec (#9951)
			// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
			if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
	
				bubbleType = special.delegateType || type;
				if ( !rfocusMorph.test( bubbleType + type ) ) {
					cur = cur.parentNode;
				}
				for ( ; cur; cur = cur.parentNode ) {
					eventPath.push( cur );
					tmp = cur;
				}
	
				// Only add window if we got to document (e.g., not plain obj or detached DOM)
				if ( tmp === ( elem.ownerDocument || document ) ) {
					eventPath.push( tmp.defaultView || tmp.parentWindow || window );
				}
			}
	
			// Fire handlers on the event path
			i = 0;
			while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
	
				event.type = i > 1 ?
					bubbleType :
					special.bindType || type;
	
				// jQuery handler
				handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
					dataPriv.get( cur, "handle" );
				if ( handle ) {
					handle.apply( cur, data );
				}
	
				// Native handler
				handle = ontype && cur[ ontype ];
				if ( handle && handle.apply && acceptData( cur ) ) {
					event.result = handle.apply( cur, data );
					if ( event.result === false ) {
						event.preventDefault();
					}
				}
			}
			event.type = type;
	
			// If nobody prevented the default action, do it now
			if ( !onlyHandlers && !event.isDefaultPrevented() ) {
	
				if ( ( !special._default ||
					special._default.apply( eventPath.pop(), data ) === false ) &&
					acceptData( elem ) ) {
	
					// Call a native DOM method on the target with the same name name as the event.
					// Don't do default actions on window, that's where global variables be (#6170)
					if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
	
						// Don't re-trigger an onFOO event when we call its FOO() method
						tmp = elem[ ontype ];
	
						if ( tmp ) {
							elem[ ontype ] = null;
						}
	
						// Prevent re-triggering of the same event, since we already bubbled it above
						jQuery.event.triggered = type;
						elem[ type ]();
						jQuery.event.triggered = undefined;
	
						if ( tmp ) {
							elem[ ontype ] = tmp;
						}
					}
				}
			}
	
			return event.result;
		},
	
		// Piggyback on a donor event to simulate a different one
		// Used only for `focus(in | out)` events
		simulate: function( type, elem, event ) {
			var e = jQuery.extend(
				new jQuery.Event(),
				event,
				{
					type: type,
					isSimulated: true
				}
			);
	
			jQuery.event.trigger( e, null, elem );
		}
	
	} );
	
	jQuery.fn.extend( {
	
		trigger: function( type, data ) {
			return this.each( function() {
				jQuery.event.trigger( type, data, this );
			} );
		},
		triggerHandler: function( type, data ) {
			var elem = this[ 0 ];
			if ( elem ) {
				return jQuery.event.trigger( type, data, elem, true );
			}
		}
	} );
	
	
	jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
		"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
		"change select submit keydown keypress keyup error contextmenu" ).split( " " ),
		function( i, name ) {
	
		// Handle event binding
		jQuery.fn[ name ] = function( data, fn ) {
			return arguments.length > 0 ?
				this.on( name, null, data, fn ) :
				this.trigger( name );
		};
	} );
	
	jQuery.fn.extend( {
		hover: function( fnOver, fnOut ) {
			return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
		}
	} );
	
	
	
	
	support.focusin = "onfocusin" in window;
	
	
	// Support: Firefox
	// Firefox doesn't have focus(in | out) events
	// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
	//
	// Support: Chrome, Safari
	// focus(in | out) events fire after focus & blur events,
	// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
	// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
	if ( !support.focusin ) {
		jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
	
			// Attach a single capturing handler on the document while someone wants focusin/focusout
			var handler = function( event ) {
				jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
			};
	
			jQuery.event.special[ fix ] = {
				setup: function() {
					var doc = this.ownerDocument || this,
						attaches = dataPriv.access( doc, fix );
	
					if ( !attaches ) {
						doc.addEventListener( orig, handler, true );
					}
					dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
				},
				teardown: function() {
					var doc = this.ownerDocument || this,
						attaches = dataPriv.access( doc, fix ) - 1;
	
					if ( !attaches ) {
						doc.removeEventListener( orig, handler, true );
						dataPriv.remove( doc, fix );
	
					} else {
						dataPriv.access( doc, fix, attaches );
					}
				}
			};
		} );
	}
	var location = window.location;
	
	var nonce = jQuery.now();
	
	var rquery = ( /\?/ );
	
	
	
	// Support: Android 2.3
	// Workaround failure to string-cast null input
	jQuery.parseJSON = function( data ) {
		return JSON.parse( data + "" );
	};
	
	
	// Cross-browser xml parsing
	jQuery.parseXML = function( data ) {
		var xml;
		if ( !data || typeof data !== "string" ) {
			return null;
		}
	
		// Support: IE9
		try {
			xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
		} catch ( e ) {
			xml = undefined;
		}
	
		if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
			jQuery.error( "Invalid XML: " + data );
		}
		return xml;
	};
	
	
	var
		rhash = /#.*$/,
		rts = /([?&])_=[^&]*/,
		rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
	
		// #7653, #8125, #8152: local protocol detection
		rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
		rnoContent = /^(?:GET|HEAD)$/,
		rprotocol = /^\/\//,
	
		/* Prefilters
		 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
		 * 2) These are called:
		 *    - BEFORE asking for a transport
		 *    - AFTER param serialization (s.data is a string if s.processData is true)
		 * 3) key is the dataType
		 * 4) the catchall symbol "*" can be used
		 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
		 */
		prefilters = {},
	
		/* Transports bindings
		 * 1) key is the dataType
		 * 2) the catchall symbol "*" can be used
		 * 3) selection will start with transport dataType and THEN go to "*" if needed
		 */
		transports = {},
	
		// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
		allTypes = "*/".concat( "*" ),
	
		// Anchor tag for parsing the document origin
		originAnchor = document.createElement( "a" );
		originAnchor.href = location.href;
	
	// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
	function addToPrefiltersOrTransports( structure ) {
	
		// dataTypeExpression is optional and defaults to "*"
		return function( dataTypeExpression, func ) {
	
			if ( typeof dataTypeExpression !== "string" ) {
				func = dataTypeExpression;
				dataTypeExpression = "*";
			}
	
			var dataType,
				i = 0,
				dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
	
			if ( jQuery.isFunction( func ) ) {
	
				// For each dataType in the dataTypeExpression
				while ( ( dataType = dataTypes[ i++ ] ) ) {
	
					// Prepend if requested
					if ( dataType[ 0 ] === "+" ) {
						dataType = dataType.slice( 1 ) || "*";
						( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
	
					// Otherwise append
					} else {
						( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
					}
				}
			}
		};
	}
	
	// Base inspection function for prefilters and transports
	function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
	
		var inspected = {},
			seekingTransport = ( structure === transports );
	
		function inspect( dataType ) {
			var selected;
			inspected[ dataType ] = true;
			jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
				var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
				if ( typeof dataTypeOrTransport === "string" &&
					!seekingTransport && !inspected[ dataTypeOrTransport ] ) {
	
					options.dataTypes.unshift( dataTypeOrTransport );
					inspect( dataTypeOrTransport );
					return false;
				} else if ( seekingTransport ) {
					return !( selected = dataTypeOrTransport );
				}
			} );
			return selected;
		}
	
		return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
	}
	
	// A special extend for ajax options
	// that takes "flat" options (not to be deep extended)
	// Fixes #9887
	function ajaxExtend( target, src ) {
		var key, deep,
			flatOptions = jQuery.ajaxSettings.flatOptions || {};
	
		for ( key in src ) {
			if ( src[ key ] !== undefined ) {
				( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
			}
		}
		if ( deep ) {
			jQuery.extend( true, target, deep );
		}
	
		return target;
	}
	
	/* Handles responses to an ajax request:
	 * - finds the right dataType (mediates between content-type and expected dataType)
	 * - returns the corresponding response
	 */
	function ajaxHandleResponses( s, jqXHR, responses ) {
	
		var ct, type, finalDataType, firstDataType,
			contents = s.contents,
			dataTypes = s.dataTypes;
	
		// Remove auto dataType and get content-type in the process
		while ( dataTypes[ 0 ] === "*" ) {
			dataTypes.shift();
			if ( ct === undefined ) {
				ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
			}
		}
	
		// Check if we're dealing with a known content-type
		if ( ct ) {
			for ( type in contents ) {
				if ( contents[ type ] && contents[ type ].test( ct ) ) {
					dataTypes.unshift( type );
					break;
				}
			}
		}
	
		// Check to see if we have a response for the expected dataType
		if ( dataTypes[ 0 ] in responses ) {
			finalDataType = dataTypes[ 0 ];
		} else {
	
			// Try convertible dataTypes
			for ( type in responses ) {
				if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
					finalDataType = type;
					break;
				}
				if ( !firstDataType ) {
					firstDataType = type;
				}
			}
	
			// Or just use first one
			finalDataType = finalDataType || firstDataType;
		}
	
		// If we found a dataType
		// We add the dataType to the list if needed
		// and return the corresponding response
		if ( finalDataType ) {
			if ( finalDataType !== dataTypes[ 0 ] ) {
				dataTypes.unshift( finalDataType );
			}
			return responses[ finalDataType ];
		}
	}
	
	/* Chain conversions given the request and the original response
	 * Also sets the responseXXX fields on the jqXHR instance
	 */
	function ajaxConvert( s, response, jqXHR, isSuccess ) {
		var conv2, current, conv, tmp, prev,
			converters = {},
	
			// Work with a copy of dataTypes in case we need to modify it for conversion
			dataTypes = s.dataTypes.slice();
	
		// Create converters map with lowercased keys
		if ( dataTypes[ 1 ] ) {
			for ( conv in s.converters ) {
				converters[ conv.toLowerCase() ] = s.converters[ conv ];
			}
		}
	
		current = dataTypes.shift();
	
		// Convert to each sequential dataType
		while ( current ) {
	
			if ( s.responseFields[ current ] ) {
				jqXHR[ s.responseFields[ current ] ] = response;
			}
	
			// Apply the dataFilter if provided
			if ( !prev && isSuccess && s.dataFilter ) {
				response = s.dataFilter( response, s.dataType );
			}
	
			prev = current;
			current = dataTypes.shift();
	
			if ( current ) {
	
			// There's only work to do if current dataType is non-auto
				if ( current === "*" ) {
	
					current = prev;
	
				// Convert response if prev dataType is non-auto and differs from current
				} else if ( prev !== "*" && prev !== current ) {
	
					// Seek a direct converter
					conv = converters[ prev + " " + current ] || converters[ "* " + current ];
	
					// If none found, seek a pair
					if ( !conv ) {
						for ( conv2 in converters ) {
	
							// If conv2 outputs current
							tmp = conv2.split( " " );
							if ( tmp[ 1 ] === current ) {
	
								// If prev can be converted to accepted input
								conv = converters[ prev + " " + tmp[ 0 ] ] ||
									converters[ "* " + tmp[ 0 ] ];
								if ( conv ) {
	
									// Condense equivalence converters
									if ( conv === true ) {
										conv = converters[ conv2 ];
	
									// Otherwise, insert the intermediate dataType
									} else if ( converters[ conv2 ] !== true ) {
										current = tmp[ 0 ];
										dataTypes.unshift( tmp[ 1 ] );
									}
									break;
								}
							}
						}
					}
	
					// Apply converter (if not an equivalence)
					if ( conv !== true ) {
	
						// Unless errors are allowed to bubble, catch and return them
						if ( conv && s.throws ) {
							response = conv( response );
						} else {
							try {
								response = conv( response );
							} catch ( e ) {
								return {
									state: "parsererror",
									error: conv ? e : "No conversion from " + prev + " to " + current
								};
							}
						}
					}
				}
			}
		}
	
		return { state: "success", data: response };
	}
	
	jQuery.extend( {
	
		// Counter for holding the number of active queries
		active: 0,
	
		// Last-Modified header cache for next request
		lastModified: {},
		etag: {},
	
		ajaxSettings: {
			url: location.href,
			type: "GET",
			isLocal: rlocalProtocol.test( location.protocol ),
			global: true,
			processData: true,
			async: true,
			contentType: "application/x-www-form-urlencoded; charset=UTF-8",
			/*
			timeout: 0,
			data: null,
			dataType: null,
			username: null,
			password: null,
			cache: null,
			throws: false,
			traditional: false,
			headers: {},
			*/
	
			accepts: {
				"*": allTypes,
				text: "text/plain",
				html: "text/html",
				xml: "application/xml, text/xml",
				json: "application/json, text/javascript"
			},
	
			contents: {
				xml: /\bxml\b/,
				html: /\bhtml/,
				json: /\bjson\b/
			},
	
			responseFields: {
				xml: "responseXML",
				text: "responseText",
				json: "responseJSON"
			},
	
			// Data converters
			// Keys separate source (or catchall "*") and destination types with a single space
			converters: {
	
				// Convert anything to text
				"* text": String,
	
				// Text to html (true = no transformation)
				"text html": true,
	
				// Evaluate text as a json expression
				"text json": jQuery.parseJSON,
	
				// Parse text as xml
				"text xml": jQuery.parseXML
			},
	
			// For options that shouldn't be deep extended:
			// you can add your own custom options here if
			// and when you create one that shouldn't be
			// deep extended (see ajaxExtend)
			flatOptions: {
				url: true,
				context: true
			}
		},
	
		// Creates a full fledged settings object into target
		// with both ajaxSettings and settings fields.
		// If target is omitted, writes into ajaxSettings.
		ajaxSetup: function( target, settings ) {
			return settings ?
	
				// Building a settings object
				ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
	
				// Extending ajaxSettings
				ajaxExtend( jQuery.ajaxSettings, target );
		},
	
		ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
		ajaxTransport: addToPrefiltersOrTransports( transports ),
	
		// Main method
		ajax: function( url, options ) {
	
			// If url is an object, simulate pre-1.5 signature
			if ( typeof url === "object" ) {
				options = url;
				url = undefined;
			}
	
			// Force options to be an object
			options = options || {};
	
			var transport,
	
				// URL without anti-cache param
				cacheURL,
	
				// Response headers
				responseHeadersString,
				responseHeaders,
	
				// timeout handle
				timeoutTimer,
	
				// Url cleanup var
				urlAnchor,
	
				// To know if global events are to be dispatched
				fireGlobals,
	
				// Loop variable
				i,
	
				// Create the final options object
				s = jQuery.ajaxSetup( {}, options ),
	
				// Callbacks context
				callbackContext = s.context || s,
	
				// Context for global events is callbackContext if it is a DOM node or jQuery collection
				globalEventContext = s.context &&
					( callbackContext.nodeType || callbackContext.jquery ) ?
						jQuery( callbackContext ) :
						jQuery.event,
	
				// Deferreds
				deferred = jQuery.Deferred(),
				completeDeferred = jQuery.Callbacks( "once memory" ),
	
				// Status-dependent callbacks
				statusCode = s.statusCode || {},
	
				// Headers (they are sent all at once)
				requestHeaders = {},
				requestHeadersNames = {},
	
				// The jqXHR state
				state = 0,
	
				// Default abort message
				strAbort = "canceled",
	
				// Fake xhr
				jqXHR = {
					readyState: 0,
	
					// Builds headers hashtable if needed
					getResponseHeader: function( key ) {
						var match;
						if ( state === 2 ) {
							if ( !responseHeaders ) {
								responseHeaders = {};
								while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
									responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
								}
							}
							match = responseHeaders[ key.toLowerCase() ];
						}
						return match == null ? null : match;
					},
	
					// Raw string
					getAllResponseHeaders: function() {
						return state === 2 ? responseHeadersString : null;
					},
	
					// Caches the header
					setRequestHeader: function( name, value ) {
						var lname = name.toLowerCase();
						if ( !state ) {
							name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
							requestHeaders[ name ] = value;
						}
						return this;
					},
	
					// Overrides response content-type header
					overrideMimeType: function( type ) {
						if ( !state ) {
							s.mimeType = type;
						}
						return this;
					},
	
					// Status-dependent callbacks
					statusCode: function( map ) {
						var code;
						if ( map ) {
							if ( state < 2 ) {
								for ( code in map ) {
	
									// Lazy-add the new callback in a way that preserves old ones
									statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
								}
							} else {
	
								// Execute the appropriate callbacks
								jqXHR.always( map[ jqXHR.status ] );
							}
						}
						return this;
					},
	
					// Cancel the request
					abort: function( statusText ) {
						var finalText = statusText || strAbort;
						if ( transport ) {
							transport.abort( finalText );
						}
						done( 0, finalText );
						return this;
					}
				};
	
			// Attach deferreds
			deferred.promise( jqXHR ).complete = completeDeferred.add;
			jqXHR.success = jqXHR.done;
			jqXHR.error = jqXHR.fail;
	
			// Remove hash character (#7531: and string promotion)
			// Add protocol if not provided (prefilters might expect it)
			// Handle falsy url in the settings object (#10093: consistency with old signature)
			// We also use the url parameter if available
			s.url = ( ( url || s.url || location.href ) + "" ).replace( rhash, "" )
				.replace( rprotocol, location.protocol + "//" );
	
			// Alias method option to type as per ticket #12004
			s.type = options.method || options.type || s.method || s.type;
	
			// Extract dataTypes list
			s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
	
			// A cross-domain request is in order when the origin doesn't match the current origin.
			if ( s.crossDomain == null ) {
				urlAnchor = document.createElement( "a" );
	
				// Support: IE8-11+
				// IE throws exception if url is malformed, e.g. http://example.com:80x/
				try {
					urlAnchor.href = s.url;
	
					// Support: IE8-11+
					// Anchor's host property isn't correctly set when s.url is relative
					urlAnchor.href = urlAnchor.href;
					s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
						urlAnchor.protocol + "//" + urlAnchor.host;
				} catch ( e ) {
	
					// If there is an error parsing the URL, assume it is crossDomain,
					// it can be rejected by the transport if it is invalid
					s.crossDomain = true;
				}
			}
	
			// Convert data if not already a string
			if ( s.data && s.processData && typeof s.data !== "string" ) {
				s.data = jQuery.param( s.data, s.traditional );
			}
	
			// Apply prefilters
			inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
	
			// If request was aborted inside a prefilter, stop there
			if ( state === 2 ) {
				return jqXHR;
			}
	
			// We can fire global events as of now if asked to
			// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
			fireGlobals = jQuery.event && s.global;
	
			// Watch for a new set of requests
			if ( fireGlobals && jQuery.active++ === 0 ) {
				jQuery.event.trigger( "ajaxStart" );
			}
	
			// Uppercase the type
			s.type = s.type.toUpperCase();
	
			// Determine if request has content
			s.hasContent = !rnoContent.test( s.type );
	
			// Save the URL in case we're toying with the If-Modified-Since
			// and/or If-None-Match header later on
			cacheURL = s.url;
	
			// More options handling for requests with no content
			if ( !s.hasContent ) {
	
				// If data is available, append data to url
				if ( s.data ) {
					cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
	
					// #9682: remove data so that it's not used in an eventual retry
					delete s.data;
				}
	
				// Add anti-cache in url if needed
				if ( s.cache === false ) {
					s.url = rts.test( cacheURL ) ?
	
						// If there is already a '_' parameter, set its value
						cacheURL.replace( rts, "$1_=" + nonce++ ) :
	
						// Otherwise add one to the end
						cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
				}
			}
	
			// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
			if ( s.ifModified ) {
				if ( jQuery.lastModified[ cacheURL ] ) {
					jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
				}
				if ( jQuery.etag[ cacheURL ] ) {
					jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
				}
			}
	
			// Set the correct header, if data is being sent
			if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
				jqXHR.setRequestHeader( "Content-Type", s.contentType );
			}
	
			// Set the Accepts header for the server, depending on the dataType
			jqXHR.setRequestHeader(
				"Accept",
				s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
					s.accepts[ s.dataTypes[ 0 ] ] +
						( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
					s.accepts[ "*" ]
			);
	
			// Check for headers option
			for ( i in s.headers ) {
				jqXHR.setRequestHeader( i, s.headers[ i ] );
			}
	
			// Allow custom headers/mimetypes and early abort
			if ( s.beforeSend &&
				( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
	
				// Abort if not done already and return
				return jqXHR.abort();
			}
	
			// Aborting is no longer a cancellation
			strAbort = "abort";
	
			// Install callbacks on deferreds
			for ( i in { success: 1, error: 1, complete: 1 } ) {
				jqXHR[ i ]( s[ i ] );
			}
	
			// Get transport
			transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
	
			// If no transport, we auto-abort
			if ( !transport ) {
				done( -1, "No Transport" );
			} else {
				jqXHR.readyState = 1;
	
				// Send global event
				if ( fireGlobals ) {
					globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
				}
	
				// If request was aborted inside ajaxSend, stop there
				if ( state === 2 ) {
					return jqXHR;
				}
	
				// Timeout
				if ( s.async && s.timeout > 0 ) {
					timeoutTimer = window.setTimeout( function() {
						jqXHR.abort( "timeout" );
					}, s.timeout );
				}
	
				try {
					state = 1;
					transport.send( requestHeaders, done );
				} catch ( e ) {
	
					// Propagate exception as error if not done
					if ( state < 2 ) {
						done( -1, e );
	
					// Simply rethrow otherwise
					} else {
						throw e;
					}
				}
			}
	
			// Callback for when everything is done
			function done( status, nativeStatusText, responses, headers ) {
				var isSuccess, success, error, response, modified,
					statusText = nativeStatusText;
	
				// Called once
				if ( state === 2 ) {
					return;
				}
	
				// State is "done" now
				state = 2;
	
				// Clear timeout if it exists
				if ( timeoutTimer ) {
					window.clearTimeout( timeoutTimer );
				}
	
				// Dereference transport for early garbage collection
				// (no matter how long the jqXHR object will be used)
				transport = undefined;
	
				// Cache response headers
				responseHeadersString = headers || "";
	
				// Set readyState
				jqXHR.readyState = status > 0 ? 4 : 0;
	
				// Determine if successful
				isSuccess = status >= 200 && status < 300 || status === 304;
	
				// Get response data
				if ( responses ) {
					response = ajaxHandleResponses( s, jqXHR, responses );
				}
	
				// Convert no matter what (that way responseXXX fields are always set)
				response = ajaxConvert( s, response, jqXHR, isSuccess );
	
				// If successful, handle type chaining
				if ( isSuccess ) {
	
					// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
					if ( s.ifModified ) {
						modified = jqXHR.getResponseHeader( "Last-Modified" );
						if ( modified ) {
							jQuery.lastModified[ cacheURL ] = modified;
						}
						modified = jqXHR.getResponseHeader( "etag" );
						if ( modified ) {
							jQuery.etag[ cacheURL ] = modified;
						}
					}
	
					// if no content
					if ( status === 204 || s.type === "HEAD" ) {
						statusText = "nocontent";
	
					// if not modified
					} else if ( status === 304 ) {
						statusText = "notmodified";
	
					// If we have data, let's convert it
					} else {
						statusText = response.state;
						success = response.data;
						error = response.error;
						isSuccess = !error;
					}
				} else {
	
					// Extract error from statusText and normalize for non-aborts
					error = statusText;
					if ( status || !statusText ) {
						statusText = "error";
						if ( status < 0 ) {
							status = 0;
						}
					}
				}
	
				// Set data for the fake xhr object
				jqXHR.status = status;
				jqXHR.statusText = ( nativeStatusText || statusText ) + "";
	
				// Success/Error
				if ( isSuccess ) {
					deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
				} else {
					deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
				}
	
				// Status-dependent callbacks
				jqXHR.statusCode( statusCode );
				statusCode = undefined;
	
				if ( fireGlobals ) {
					globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
						[ jqXHR, s, isSuccess ? success : error ] );
				}
	
				// Complete
				completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
	
				if ( fireGlobals ) {
					globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
	
					// Handle the global AJAX counter
					if ( !( --jQuery.active ) ) {
						jQuery.event.trigger( "ajaxStop" );
					}
				}
			}
	
			return jqXHR;
		},
	
		getJSON: function( url, data, callback ) {
			return jQuery.get( url, data, callback, "json" );
		},
	
		getScript: function( url, callback ) {
			return jQuery.get( url, undefined, callback, "script" );
		}
	} );
	
	jQuery.each( [ "get", "post" ], function( i, method ) {
		jQuery[ method ] = function( url, data, callback, type ) {
	
			// Shift arguments if data argument was omitted
			if ( jQuery.isFunction( data ) ) {
				type = type || callback;
				callback = data;
				data = undefined;
			}
	
			// The url can be an options object (which then must have .url)
			return jQuery.ajax( jQuery.extend( {
				url: url,
				type: method,
				dataType: type,
				data: data,
				success: callback
			}, jQuery.isPlainObject( url ) && url ) );
		};
	} );
	
	
	jQuery._evalUrl = function( url ) {
		return jQuery.ajax( {
			url: url,
	
			// Make this explicit, since user can override this through ajaxSetup (#11264)
			type: "GET",
			dataType: "script",
			async: false,
			global: false,
			"throws": true
		} );
	};
	
	
	jQuery.fn.extend( {
		wrapAll: function( html ) {
			var wrap;
	
			if ( jQuery.isFunction( html ) ) {
				return this.each( function( i ) {
					jQuery( this ).wrapAll( html.call( this, i ) );
				} );
			}
	
			if ( this[ 0 ] ) {
	
				// The elements to wrap the target around
				wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
	
				if ( this[ 0 ].parentNode ) {
					wrap.insertBefore( this[ 0 ] );
				}
	
				wrap.map( function() {
					var elem = this;
	
					while ( elem.firstElementChild ) {
						elem = elem.firstElementChild;
					}
	
					return elem;
				} ).append( this );
			}
	
			return this;
		},
	
		wrapInner: function( html ) {
			if ( jQuery.isFunction( html ) ) {
				return this.each( function( i ) {
					jQuery( this ).wrapInner( html.call( this, i ) );
				} );
			}
	
			return this.each( function() {
				var self = jQuery( this ),
					contents = self.contents();
	
				if ( contents.length ) {
					contents.wrapAll( html );
	
				} else {
					self.append( html );
				}
			} );
		},
	
		wrap: function( html ) {
			var isFunction = jQuery.isFunction( html );
	
			return this.each( function( i ) {
				jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
			} );
		},
	
		unwrap: function() {
			return this.parent().each( function() {
				if ( !jQuery.nodeName( this, "body" ) ) {
					jQuery( this ).replaceWith( this.childNodes );
				}
			} ).end();
		}
	} );
	
	
	jQuery.expr.filters.hidden = function( elem ) {
		return !jQuery.expr.filters.visible( elem );
	};
	jQuery.expr.filters.visible = function( elem ) {
	
		// Support: Opera <= 12.12
		// Opera reports offsetWidths and offsetHeights less than zero on some elements
		// Use OR instead of AND as the element is not visible if either is true
		// See tickets #10406 and #13132
		return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
	};
	
	
	
	
	var r20 = /%20/g,
		rbracket = /\[\]$/,
		rCRLF = /\r?\n/g,
		rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
		rsubmittable = /^(?:input|select|textarea|keygen)/i;
	
	function buildParams( prefix, obj, traditional, add ) {
		var name;
	
		if ( jQuery.isArray( obj ) ) {
	
			// Serialize array item.
			jQuery.each( obj, function( i, v ) {
				if ( traditional || rbracket.test( prefix ) ) {
	
					// Treat each array item as a scalar.
					add( prefix, v );
	
				} else {
	
					// Item is non-scalar (array or object), encode its numeric index.
					buildParams(
						prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
						v,
						traditional,
						add
					);
				}
			} );
	
		} else if ( !traditional && jQuery.type( obj ) === "object" ) {
	
			// Serialize object item.
			for ( name in obj ) {
				buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
			}
	
		} else {
	
			// Serialize scalar item.
			add( prefix, obj );
		}
	}
	
	// Serialize an array of form elements or a set of
	// key/values into a query string
	jQuery.param = function( a, traditional ) {
		var prefix,
			s = [],
			add = function( key, value ) {
	
				// If value is a function, invoke it and return its value
				value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
				s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
			};
	
		// Set traditional to true for jQuery <= 1.3.2 behavior.
		if ( traditional === undefined ) {
			traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
		}
	
		// If an array was passed in, assume that it is an array of form elements.
		if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
	
			// Serialize the form elements
			jQuery.each( a, function() {
				add( this.name, this.value );
			} );
	
		} else {
	
			// If traditional, encode the "old" way (the way 1.3.2 or older
			// did it), otherwise encode params recursively.
			for ( prefix in a ) {
				buildParams( prefix, a[ prefix ], traditional, add );
			}
		}
	
		// Return the resulting serialization
		return s.join( "&" ).replace( r20, "+" );
	};
	
	jQuery.fn.extend( {
		serialize: function() {
			return jQuery.param( this.serializeArray() );
		},
		serializeArray: function() {
			return this.map( function() {
	
				// Can add propHook for "elements" to filter or add form elements
				var elements = jQuery.prop( this, "elements" );
				return elements ? jQuery.makeArray( elements ) : this;
			} )
			.filter( function() {
				var type = this.type;
	
				// Use .is( ":disabled" ) so that fieldset[disabled] works
				return this.name && !jQuery( this ).is( ":disabled" ) &&
					rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
					( this.checked || !rcheckableType.test( type ) );
			} )
			.map( function( i, elem ) {
				var val = jQuery( this ).val();
	
				return val == null ?
					null :
					jQuery.isArray( val ) ?
						jQuery.map( val, function( val ) {
							return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
						} ) :
						{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
			} ).get();
		}
	} );
	
	
	jQuery.ajaxSettings.xhr = function() {
		try {
			return new window.XMLHttpRequest();
		} catch ( e ) {}
	};
	
	var xhrSuccessStatus = {
	
			// File protocol always yields status code 0, assume 200
			0: 200,
	
			// Support: IE9
			// #1450: sometimes IE returns 1223 when it should be 204
			1223: 204
		},
		xhrSupported = jQuery.ajaxSettings.xhr();
	
	support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
	support.ajax = xhrSupported = !!xhrSupported;
	
	jQuery.ajaxTransport( function( options ) {
		var callback, errorCallback;
	
		// Cross domain only allowed if supported through XMLHttpRequest
		if ( support.cors || xhrSupported && !options.crossDomain ) {
			return {
				send: function( headers, complete ) {
					var i,
						xhr = options.xhr();
	
					xhr.open(
						options.type,
						options.url,
						options.async,
						options.username,
						options.password
					);
	
					// Apply custom fields if provided
					if ( options.xhrFields ) {
						for ( i in options.xhrFields ) {
							xhr[ i ] = options.xhrFields[ i ];
						}
					}
	
					// Override mime type if needed
					if ( options.mimeType && xhr.overrideMimeType ) {
						xhr.overrideMimeType( options.mimeType );
					}
	
					// X-Requested-With header
					// For cross-domain requests, seeing as conditions for a preflight are
					// akin to a jigsaw puzzle, we simply never set it to be sure.
					// (it can always be set on a per-request basis or even using ajaxSetup)
					// For same-domain requests, won't change header if already provided.
					if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
						headers[ "X-Requested-With" ] = "XMLHttpRequest";
					}
	
					// Set headers
					for ( i in headers ) {
						xhr.setRequestHeader( i, headers[ i ] );
					}
	
					// Callback
					callback = function( type ) {
						return function() {
							if ( callback ) {
								callback = errorCallback = xhr.onload =
									xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
	
								if ( type === "abort" ) {
									xhr.abort();
								} else if ( type === "error" ) {
	
									// Support: IE9
									// On a manual native abort, IE9 throws
									// errors on any property access that is not readyState
									if ( typeof xhr.status !== "number" ) {
										complete( 0, "error" );
									} else {
										complete(
	
											// File: protocol always yields status 0; see #8605, #14207
											xhr.status,
											xhr.statusText
										);
									}
								} else {
									complete(
										xhrSuccessStatus[ xhr.status ] || xhr.status,
										xhr.statusText,
	
										// Support: IE9 only
										// IE9 has no XHR2 but throws on binary (trac-11426)
										// For XHR2 non-text, let the caller handle it (gh-2498)
										( xhr.responseType || "text" ) !== "text"  ||
										typeof xhr.responseText !== "string" ?
											{ binary: xhr.response } :
											{ text: xhr.responseText },
										xhr.getAllResponseHeaders()
									);
								}
							}
						};
					};
	
					// Listen to events
					xhr.onload = callback();
					errorCallback = xhr.onerror = callback( "error" );
	
					// Support: IE9
					// Use onreadystatechange to replace onabort
					// to handle uncaught aborts
					if ( xhr.onabort !== undefined ) {
						xhr.onabort = errorCallback;
					} else {
						xhr.onreadystatechange = function() {
	
							// Check readyState before timeout as it changes
							if ( xhr.readyState === 4 ) {
	
								// Allow onerror to be called first,
								// but that will not handle a native abort
								// Also, save errorCallback to a variable
								// as xhr.onerror cannot be accessed
								window.setTimeout( function() {
									if ( callback ) {
										errorCallback();
									}
								} );
							}
						};
					}
	
					// Create the abort callback
					callback = callback( "abort" );
	
					try {
	
						// Do send the request (this may raise an exception)
						xhr.send( options.hasContent && options.data || null );
					} catch ( e ) {
	
						// #14683: Only rethrow if this hasn't been notified as an error yet
						if ( callback ) {
							throw e;
						}
					}
				},
	
				abort: function() {
					if ( callback ) {
						callback();
					}
				}
			};
		}
	} );
	
	
	
	
	// Install script dataType
	jQuery.ajaxSetup( {
		accepts: {
			script: "text/javascript, application/javascript, " +
				"application/ecmascript, application/x-ecmascript"
		},
		contents: {
			script: /\b(?:java|ecma)script\b/
		},
		converters: {
			"text script": function( text ) {
				jQuery.globalEval( text );
				return text;
			}
		}
	} );
	
	// Handle cache's special case and crossDomain
	jQuery.ajaxPrefilter( "script", function( s ) {
		if ( s.cache === undefined ) {
			s.cache = false;
		}
		if ( s.crossDomain ) {
			s.type = "GET";
		}
	} );
	
	// Bind script tag hack transport
	jQuery.ajaxTransport( "script", function( s ) {
	
		// This transport only deals with cross domain requests
		if ( s.crossDomain ) {
			var script, callback;
			return {
				send: function( _, complete ) {
					script = jQuery( "<script>" ).prop( {
						charset: s.scriptCharset,
						src: s.url
					} ).on(
						"load error",
						callback = function( evt ) {
							script.remove();
							callback = null;
							if ( evt ) {
								complete( evt.type === "error" ? 404 : 200, evt.type );
							}
						}
					);
	
					// Use native DOM manipulation to avoid our domManip AJAX trickery
					document.head.appendChild( script[ 0 ] );
				},
				abort: function() {
					if ( callback ) {
						callback();
					}
				}
			};
		}
	} );
	
	
	
	
	var oldCallbacks = [],
		rjsonp = /(=)\?(?=&|$)|\?\?/;
	
	// Default jsonp settings
	jQuery.ajaxSetup( {
		jsonp: "callback",
		jsonpCallback: function() {
			var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
			this[ callback ] = true;
			return callback;
		}
	} );
	
	// Detect, normalize options and install callbacks for jsonp requests
	jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
	
		var callbackName, overwritten, responseContainer,
			jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
				"url" :
				typeof s.data === "string" &&
					( s.contentType || "" )
						.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
					rjsonp.test( s.data ) && "data"
			);
	
		// Handle iff the expected data type is "jsonp" or we have a parameter to set
		if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
	
			// Get callback name, remembering preexisting value associated with it
			callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
				s.jsonpCallback() :
				s.jsonpCallback;
	
			// Insert callback into url or form data
			if ( jsonProp ) {
				s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
			} else if ( s.jsonp !== false ) {
				s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
			}
	
			// Use data converter to retrieve json after script execution
			s.converters[ "script json" ] = function() {
				if ( !responseContainer ) {
					jQuery.error( callbackName + " was not called" );
				}
				return responseContainer[ 0 ];
			};
	
			// Force json dataType
			s.dataTypes[ 0 ] = "json";
	
			// Install callback
			overwritten = window[ callbackName ];
			window[ callbackName ] = function() {
				responseContainer = arguments;
			};
	
			// Clean-up function (fires after converters)
			jqXHR.always( function() {
	
				// If previous value didn't exist - remove it
				if ( overwritten === undefined ) {
					jQuery( window ).removeProp( callbackName );
	
				// Otherwise restore preexisting value
				} else {
					window[ callbackName ] = overwritten;
				}
	
				// Save back as free
				if ( s[ callbackName ] ) {
	
					// Make sure that re-using the options doesn't screw things around
					s.jsonpCallback = originalSettings.jsonpCallback;
	
					// Save the callback name for future use
					oldCallbacks.push( callbackName );
				}
	
				// Call if it was a function and we have a response
				if ( responseContainer && jQuery.isFunction( overwritten ) ) {
					overwritten( responseContainer[ 0 ] );
				}
	
				responseContainer = overwritten = undefined;
			} );
	
			// Delegate to script
			return "script";
		}
	} );
	
	
	
	
	// Argument "data" should be string of html
	// context (optional): If specified, the fragment will be created in this context,
	// defaults to document
	// keepScripts (optional): If true, will include scripts passed in the html string
	jQuery.parseHTML = function( data, context, keepScripts ) {
		if ( !data || typeof data !== "string" ) {
			return null;
		}
		if ( typeof context === "boolean" ) {
			keepScripts = context;
			context = false;
		}
		context = context || document;
	
		var parsed = rsingleTag.exec( data ),
			scripts = !keepScripts && [];
	
		// Single tag
		if ( parsed ) {
			return [ context.createElement( parsed[ 1 ] ) ];
		}
	
		parsed = buildFragment( [ data ], context, scripts );
	
		if ( scripts && scripts.length ) {
			jQuery( scripts ).remove();
		}
	
		return jQuery.merge( [], parsed.childNodes );
	};
	
	
	// Keep a copy of the old load method
	var _load = jQuery.fn.load;
	
	/**
	 * Load a url into a page
	 */
	jQuery.fn.load = function( url, params, callback ) {
		if ( typeof url !== "string" && _load ) {
			return _load.apply( this, arguments );
		}
	
		var selector, type, response,
			self = this,
			off = url.indexOf( " " );
	
		if ( off > -1 ) {
			selector = jQuery.trim( url.slice( off ) );
			url = url.slice( 0, off );
		}
	
		// If it's a function
		if ( jQuery.isFunction( params ) ) {
	
			// We assume that it's the callback
			callback = params;
			params = undefined;
	
		// Otherwise, build a param string
		} else if ( params && typeof params === "object" ) {
			type = "POST";
		}
	
		// If we have elements to modify, make the request
		if ( self.length > 0 ) {
			jQuery.ajax( {
				url: url,
	
				// If "type" variable is undefined, then "GET" method will be used.
				// Make value of this field explicit since
				// user can override it through ajaxSetup method
				type: type || "GET",
				dataType: "html",
				data: params
			} ).done( function( responseText ) {
	
				// Save response for use in complete callback
				response = arguments;
	
				self.html( selector ?
	
					// If a selector was specified, locate the right elements in a dummy div
					// Exclude scripts to avoid IE 'Permission Denied' errors
					jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
	
					// Otherwise use the full result
					responseText );
	
			// If the request succeeds, this function gets "data", "status", "jqXHR"
			// but they are ignored because response was set above.
			// If it fails, this function gets "jqXHR", "status", "error"
			} ).always( callback && function( jqXHR, status ) {
				self.each( function() {
					callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
				} );
			} );
		}
	
		return this;
	};
	
	
	
	
	// Attach a bunch of functions for handling common AJAX events
	jQuery.each( [
		"ajaxStart",
		"ajaxStop",
		"ajaxComplete",
		"ajaxError",
		"ajaxSuccess",
		"ajaxSend"
	], function( i, type ) {
		jQuery.fn[ type ] = function( fn ) {
			return this.on( type, fn );
		};
	} );
	
	
	
	
	jQuery.expr.filters.animated = function( elem ) {
		return jQuery.grep( jQuery.timers, function( fn ) {
			return elem === fn.elem;
		} ).length;
	};
	
	
	
	
	/**
	 * Gets a window from an element
	 */
	function getWindow( elem ) {
		return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
	}
	
	jQuery.offset = {
		setOffset: function( elem, options, i ) {
			var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
				position = jQuery.css( elem, "position" ),
				curElem = jQuery( elem ),
				props = {};
	
			// Set position first, in-case top/left are set even on static elem
			if ( position === "static" ) {
				elem.style.position = "relative";
			}
	
			curOffset = curElem.offset();
			curCSSTop = jQuery.css( elem, "top" );
			curCSSLeft = jQuery.css( elem, "left" );
			calculatePosition = ( position === "absolute" || position === "fixed" ) &&
				( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
	
			// Need to be able to calculate position if either
			// top or left is auto and position is either absolute or fixed
			if ( calculatePosition ) {
				curPosition = curElem.position();
				curTop = curPosition.top;
				curLeft = curPosition.left;
	
			} else {
				curTop = parseFloat( curCSSTop ) || 0;
				curLeft = parseFloat( curCSSLeft ) || 0;
			}
	
			if ( jQuery.isFunction( options ) ) {
	
				// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
				options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
			}
	
			if ( options.top != null ) {
				props.top = ( options.top - curOffset.top ) + curTop;
			}
			if ( options.left != null ) {
				props.left = ( options.left - curOffset.left ) + curLeft;
			}
	
			if ( "using" in options ) {
				options.using.call( elem, props );
	
			} else {
				curElem.css( props );
			}
		}
	};
	
	jQuery.fn.extend( {
		offset: function( options ) {
			if ( arguments.length ) {
				return options === undefined ?
					this :
					this.each( function( i ) {
						jQuery.offset.setOffset( this, options, i );
					} );
			}
	
			var docElem, win,
				elem = this[ 0 ],
				box = { top: 0, left: 0 },
				doc = elem && elem.ownerDocument;
	
			if ( !doc ) {
				return;
			}
	
			docElem = doc.documentElement;
	
			// Make sure it's not a disconnected DOM node
			if ( !jQuery.contains( docElem, elem ) ) {
				return box;
			}
	
			box = elem.getBoundingClientRect();
			win = getWindow( doc );
			return {
				top: box.top + win.pageYOffset - docElem.clientTop,
				left: box.left + win.pageXOffset - docElem.clientLeft
			};
		},
	
		position: function() {
			if ( !this[ 0 ] ) {
				return;
			}
	
			var offsetParent, offset,
				elem = this[ 0 ],
				parentOffset = { top: 0, left: 0 };
	
			// Fixed elements are offset from window (parentOffset = {top:0, left: 0},
			// because it is its only offset parent
			if ( jQuery.css( elem, "position" ) === "fixed" ) {
	
				// Assume getBoundingClientRect is there when computed position is fixed
				offset = elem.getBoundingClientRect();
	
			} else {
	
				// Get *real* offsetParent
				offsetParent = this.offsetParent();
	
				// Get correct offsets
				offset = this.offset();
				if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
					parentOffset = offsetParent.offset();
				}
	
				// Add offsetParent borders
				parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
				parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
			}
	
			// Subtract parent offsets and element margins
			return {
				top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
				left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
			};
		},
	
		// This method will return documentElement in the following cases:
		// 1) For the element inside the iframe without offsetParent, this method will return
		//    documentElement of the parent window
		// 2) For the hidden or detached element
		// 3) For body or html element, i.e. in case of the html node - it will return itself
		//
		// but those exceptions were never presented as a real life use-cases
		// and might be considered as more preferable results.
		//
		// This logic, however, is not guaranteed and can change at any point in the future
		offsetParent: function() {
			return this.map( function() {
				var offsetParent = this.offsetParent;
	
				while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
					offsetParent = offsetParent.offsetParent;
				}
	
				return offsetParent || documentElement;
			} );
		}
	} );
	
	// Create scrollLeft and scrollTop methods
	jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
		var top = "pageYOffset" === prop;
	
		jQuery.fn[ method ] = function( val ) {
			return access( this, function( elem, method, val ) {
				var win = getWindow( elem );
	
				if ( val === undefined ) {
					return win ? win[ prop ] : elem[ method ];
				}
	
				if ( win ) {
					win.scrollTo(
						!top ? val : win.pageXOffset,
						top ? val : win.pageYOffset
					);
	
				} else {
					elem[ method ] = val;
				}
			}, method, val, arguments.length );
		};
	} );
	
	// Support: Safari<7-8+, Chrome<37-44+
	// Add the top/left cssHooks using jQuery.fn.position
	// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
	// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
	// getComputedStyle returns percent when specified for top/left/bottom/right;
	// rather than make the css module depend on the offset module, just check for it here
	jQuery.each( [ "top", "left" ], function( i, prop ) {
		jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
			function( elem, computed ) {
				if ( computed ) {
					computed = curCSS( elem, prop );
	
					// If curCSS returns percentage, fallback to offset
					return rnumnonpx.test( computed ) ?
						jQuery( elem ).position()[ prop ] + "px" :
						computed;
				}
			}
		);
	} );
	
	
	// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
	jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
		jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
			function( defaultExtra, funcName ) {
	
			// Margin is only for outerHeight, outerWidth
			jQuery.fn[ funcName ] = function( margin, value ) {
				var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
					extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
	
				return access( this, function( elem, type, value ) {
					var doc;
	
					if ( jQuery.isWindow( elem ) ) {
	
						// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
						// isn't a whole lot we can do. See pull request at this URL for discussion:
						// https://github.com/jquery/jquery/pull/764
						return elem.document.documentElement[ "client" + name ];
					}
	
					// Get document width or height
					if ( elem.nodeType === 9 ) {
						doc = elem.documentElement;
	
						// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
						// whichever is greatest
						return Math.max(
							elem.body[ "scroll" + name ], doc[ "scroll" + name ],
							elem.body[ "offset" + name ], doc[ "offset" + name ],
							doc[ "client" + name ]
						);
					}
	
					return value === undefined ?
	
						// Get width or height on the element, requesting but not forcing parseFloat
						jQuery.css( elem, type, extra ) :
	
						// Set width or height on the element
						jQuery.style( elem, type, value, extra );
				}, type, chainable ? margin : undefined, chainable, null );
			};
		} );
	} );
	
	
	jQuery.fn.extend( {
	
		bind: function( types, data, fn ) {
			return this.on( types, null, data, fn );
		},
		unbind: function( types, fn ) {
			return this.off( types, null, fn );
		},
	
		delegate: function( selector, types, data, fn ) {
			return this.on( types, selector, data, fn );
		},
		undelegate: function( selector, types, fn ) {
	
			// ( namespace ) or ( selector, types [, fn] )
			return arguments.length === 1 ?
				this.off( selector, "**" ) :
				this.off( types, selector || "**", fn );
		},
		size: function() {
			return this.length;
		}
	} );
	
	jQuery.fn.andSelf = jQuery.fn.addBack;
	
	
	
	
	// Register as a named AMD module, since jQuery can be concatenated with other
	// files that may use define, but not via a proper concatenation script that
	// understands anonymous AMD modules. A named AMD is safest and most robust
	// way to register. Lowercase jquery is used because AMD module names are
	// derived from file names, and jQuery is normally delivered in a lowercase
	// file name. Do this after creating the global so that if an AMD module wants
	// to call noConflict to hide this version of jQuery, it will work.
	
	// Note that for maximum portability, libraries that are not jQuery should
	// declare themselves as anonymous modules, and avoid setting a global if an
	// AMD loader is present. jQuery is a special case. For more information, see
	// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
	
	if ( true ) {
		!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
			return jQuery;
		}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	}
	
	
	
	var
	
		// Map over jQuery in case of overwrite
		_jQuery = window.jQuery,
	
		// Map over the $ in case of overwrite
		_$ = window.$;
	
	jQuery.noConflict = function( deep ) {
		if ( window.$ === jQuery ) {
			window.$ = _$;
		}
	
		if ( deep && window.jQuery === jQuery ) {
			window.jQuery = _jQuery;
		}
	
		return jQuery;
	};
	
	// Expose jQuery and $ identifiers, even in AMD
	// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
	// and CommonJS for browser emulators (#13566)
	if ( !noGlobal ) {
		window.jQuery = window.$ = jQuery;
	}
	
	return jQuery;
	}));
	
})
/** END DEFINE BLOCK for jquery@2.2.4/dist/jquery.js **/


/** START DEFINE BLOCK for jquery@3.2.1/dist/jquery.js **/
jupyter.define('jquery@3.2.1/dist/jquery.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery JavaScript Library v3.2.1
	 * https://jquery.com/
	 *
	 * Includes Sizzle.js
	 * https://sizzlejs.com/
	 *
	 * Copyright JS Foundation and other contributors
	 * Released under the MIT license
	 * https://jquery.org/license
	 *
	 * Date: 2017-03-20T18:59Z
	 */
	( function( global, factory ) {
	
		"use strict";
	
		if ( typeof module === "object" && typeof module.exports === "object" ) {
	
			// For CommonJS and CommonJS-like environments where a proper `window`
			// is present, execute the factory and get jQuery.
			// For environments that do not have a `window` with a `document`
			// (such as Node.js), expose a factory as module.exports.
			// This accentuates the need for the creation of a real `window`.
			// e.g. var jQuery = require("jquery")(window);
			// See ticket #14549 for more info.
			module.exports = global.document ?
				factory( global, true ) :
				function( w ) {
					if ( !w.document ) {
						throw new Error( "jQuery requires a window with a document" );
					}
					return factory( w );
				};
		} else {
			factory( global );
		}
	
	// Pass this if window is not defined yet
	} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
	
	// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
	// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
	// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
	// enough that all such attempts are guarded in a try block.
	"use strict";
	
	var arr = [];
	
	var document = window.document;
	
	var getProto = Object.getPrototypeOf;
	
	var slice = arr.slice;
	
	var concat = arr.concat;
	
	var push = arr.push;
	
	var indexOf = arr.indexOf;
	
	var class2type = {};
	
	var toString = class2type.toString;
	
	var hasOwn = class2type.hasOwnProperty;
	
	var fnToString = hasOwn.toString;
	
	var ObjectFunctionString = fnToString.call( Object );
	
	var support = {};
	
	
	
		function DOMEval( code, doc ) {
			doc = doc || document;
	
			var script = doc.createElement( "script" );
	
			script.text = code;
			doc.head.appendChild( script ).parentNode.removeChild( script );
		}
	/* global Symbol */
	// Defining this global in .eslintrc.json would create a danger of using the global
	// unguarded in another place, it seems safer to define global only for this module
	
	
	
	var
		version = "3.2.1",
	
		// Define a local copy of jQuery
		jQuery = function( selector, context ) {
	
			// The jQuery object is actually just the init constructor 'enhanced'
			// Need init if jQuery is called (just allow error to be thrown if not included)
			return new jQuery.fn.init( selector, context );
		},
	
		// Support: Android <=4.0 only
		// Make sure we trim BOM and NBSP
		rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
	
		// Matches dashed string for camelizing
		rmsPrefix = /^-ms-/,
		rdashAlpha = /-([a-z])/g,
	
		// Used by jQuery.camelCase as callback to replace()
		fcamelCase = function( all, letter ) {
			return letter.toUpperCase();
		};
	
	jQuery.fn = jQuery.prototype = {
	
		// The current version of jQuery being used
		jquery: version,
	
		constructor: jQuery,
	
		// The default length of a jQuery object is 0
		length: 0,
	
		toArray: function() {
			return slice.call( this );
		},
	
		// Get the Nth element in the matched element set OR
		// Get the whole matched element set as a clean array
		get: function( num ) {
	
			// Return all the elements in a clean array
			if ( num == null ) {
				return slice.call( this );
			}
	
			// Return just the one element from the set
			return num < 0 ? this[ num + this.length ] : this[ num ];
		},
	
		// Take an array of elements and push it onto the stack
		// (returning the new matched element set)
		pushStack: function( elems ) {
	
			// Build a new jQuery matched element set
			var ret = jQuery.merge( this.constructor(), elems );
	
			// Add the old object onto the stack (as a reference)
			ret.prevObject = this;
	
			// Return the newly-formed element set
			return ret;
		},
	
		// Execute a callback for every element in the matched set.
		each: function( callback ) {
			return jQuery.each( this, callback );
		},
	
		map: function( callback ) {
			return this.pushStack( jQuery.map( this, function( elem, i ) {
				return callback.call( elem, i, elem );
			} ) );
		},
	
		slice: function() {
			return this.pushStack( slice.apply( this, arguments ) );
		},
	
		first: function() {
			return this.eq( 0 );
		},
	
		last: function() {
			return this.eq( -1 );
		},
	
		eq: function( i ) {
			var len = this.length,
				j = +i + ( i < 0 ? len : 0 );
			return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
		},
	
		end: function() {
			return this.prevObject || this.constructor();
		},
	
		// For internal use only.
		// Behaves like an Array's method, not like a jQuery method.
		push: push,
		sort: arr.sort,
		splice: arr.splice
	};
	
	jQuery.extend = jQuery.fn.extend = function() {
		var options, name, src, copy, copyIsArray, clone,
			target = arguments[ 0 ] || {},
			i = 1,
			length = arguments.length,
			deep = false;
	
		// Handle a deep copy situation
		if ( typeof target === "boolean" ) {
			deep = target;
	
			// Skip the boolean and the target
			target = arguments[ i ] || {};
			i++;
		}
	
		// Handle case when target is a string or something (possible in deep copy)
		if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
			target = {};
		}
	
		// Extend jQuery itself if only one argument is passed
		if ( i === length ) {
			target = this;
			i--;
		}
	
		for ( ; i < length; i++ ) {
	
			// Only deal with non-null/undefined values
			if ( ( options = arguments[ i ] ) != null ) {
	
				// Extend the base object
				for ( name in options ) {
					src = target[ name ];
					copy = options[ name ];
	
					// Prevent never-ending loop
					if ( target === copy ) {
						continue;
					}
	
					// Recurse if we're merging plain objects or arrays
					if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
						( copyIsArray = Array.isArray( copy ) ) ) ) {
	
						if ( copyIsArray ) {
							copyIsArray = false;
							clone = src && Array.isArray( src ) ? src : [];
	
						} else {
							clone = src && jQuery.isPlainObject( src ) ? src : {};
						}
	
						// Never move original objects, clone them
						target[ name ] = jQuery.extend( deep, clone, copy );
	
					// Don't bring in undefined values
					} else if ( copy !== undefined ) {
						target[ name ] = copy;
					}
				}
			}
		}
	
		// Return the modified object
		return target;
	};
	
	jQuery.extend( {
	
		// Unique for each copy of jQuery on the page
		expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
	
		// Assume jQuery is ready without the ready module
		isReady: true,
	
		error: function( msg ) {
			throw new Error( msg );
		},
	
		noop: function() {},
	
		isFunction: function( obj ) {
			return jQuery.type( obj ) === "function";
		},
	
		isWindow: function( obj ) {
			return obj != null && obj === obj.window;
		},
	
		isNumeric: function( obj ) {
	
			// As of jQuery 3.0, isNumeric is limited to
			// strings and numbers (primitives or objects)
			// that can be coerced to finite numbers (gh-2662)
			var type = jQuery.type( obj );
			return ( type === "number" || type === "string" ) &&
	
				// parseFloat NaNs numeric-cast false positives ("")
				// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
				// subtraction forces infinities to NaN
				!isNaN( obj - parseFloat( obj ) );
		},
	
		isPlainObject: function( obj ) {
			var proto, Ctor;
	
			// Detect obvious negatives
			// Use toString instead of jQuery.type to catch host objects
			if ( !obj || toString.call( obj ) !== "[object Object]" ) {
				return false;
			}
	
			proto = getProto( obj );
	
			// Objects with no prototype (e.g., `Object.create( null )`) are plain
			if ( !proto ) {
				return true;
			}
	
			// Objects with prototype are plain iff they were constructed by a global Object function
			Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
			return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
		},
	
		isEmptyObject: function( obj ) {
	
			/* eslint-disable no-unused-vars */
			// See https://github.com/eslint/eslint/issues/6125
			var name;
	
			for ( name in obj ) {
				return false;
			}
			return true;
		},
	
		type: function( obj ) {
			if ( obj == null ) {
				return obj + "";
			}
	
			// Support: Android <=2.3 only (functionish RegExp)
			return typeof obj === "object" || typeof obj === "function" ?
				class2type[ toString.call( obj ) ] || "object" :
				typeof obj;
		},
	
		// Evaluates a script in a global context
		globalEval: function( code ) {
			DOMEval( code );
		},
	
		// Convert dashed to camelCase; used by the css and data modules
		// Support: IE <=9 - 11, Edge 12 - 13
		// Microsoft forgot to hump their vendor prefix (#9572)
		camelCase: function( string ) {
			return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
		},
	
		each: function( obj, callback ) {
			var length, i = 0;
	
			if ( isArrayLike( obj ) ) {
				length = obj.length;
				for ( ; i < length; i++ ) {
					if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
						break;
					}
				}
			} else {
				for ( i in obj ) {
					if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
						break;
					}
				}
			}
	
			return obj;
		},
	
		// Support: Android <=4.0 only
		trim: function( text ) {
			return text == null ?
				"" :
				( text + "" ).replace( rtrim, "" );
		},
	
		// results is for internal usage only
		makeArray: function( arr, results ) {
			var ret = results || [];
	
			if ( arr != null ) {
				if ( isArrayLike( Object( arr ) ) ) {
					jQuery.merge( ret,
						typeof arr === "string" ?
						[ arr ] : arr
					);
				} else {
					push.call( ret, arr );
				}
			}
	
			return ret;
		},
	
		inArray: function( elem, arr, i ) {
			return arr == null ? -1 : indexOf.call( arr, elem, i );
		},
	
		// Support: Android <=4.0 only, PhantomJS 1 only
		// push.apply(_, arraylike) throws on ancient WebKit
		merge: function( first, second ) {
			var len = +second.length,
				j = 0,
				i = first.length;
	
			for ( ; j < len; j++ ) {
				first[ i++ ] = second[ j ];
			}
	
			first.length = i;
	
			return first;
		},
	
		grep: function( elems, callback, invert ) {
			var callbackInverse,
				matches = [],
				i = 0,
				length = elems.length,
				callbackExpect = !invert;
	
			// Go through the array, only saving the items
			// that pass the validator function
			for ( ; i < length; i++ ) {
				callbackInverse = !callback( elems[ i ], i );
				if ( callbackInverse !== callbackExpect ) {
					matches.push( elems[ i ] );
				}
			}
	
			return matches;
		},
	
		// arg is for internal usage only
		map: function( elems, callback, arg ) {
			var length, value,
				i = 0,
				ret = [];
	
			// Go through the array, translating each of the items to their new values
			if ( isArrayLike( elems ) ) {
				length = elems.length;
				for ( ; i < length; i++ ) {
					value = callback( elems[ i ], i, arg );
	
					if ( value != null ) {
						ret.push( value );
					}
				}
	
			// Go through every key on the object,
			} else {
				for ( i in elems ) {
					value = callback( elems[ i ], i, arg );
	
					if ( value != null ) {
						ret.push( value );
					}
				}
			}
	
			// Flatten any nested arrays
			return concat.apply( [], ret );
		},
	
		// A global GUID counter for objects
		guid: 1,
	
		// Bind a function to a context, optionally partially applying any
		// arguments.
		proxy: function( fn, context ) {
			var tmp, args, proxy;
	
			if ( typeof context === "string" ) {
				tmp = fn[ context ];
				context = fn;
				fn = tmp;
			}
	
			// Quick check to determine if target is callable, in the spec
			// this throws a TypeError, but we will just return undefined.
			if ( !jQuery.isFunction( fn ) ) {
				return undefined;
			}
	
			// Simulated bind
			args = slice.call( arguments, 2 );
			proxy = function() {
				return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
			};
	
			// Set the guid of unique handler to the same of original handler, so it can be removed
			proxy.guid = fn.guid = fn.guid || jQuery.guid++;
	
			return proxy;
		},
	
		now: Date.now,
	
		// jQuery.support is not used in Core but other projects attach their
		// properties to it so it needs to exist.
		support: support
	} );
	
	if ( typeof Symbol === "function" ) {
		jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
	}
	
	// Populate the class2type map
	jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
	function( i, name ) {
		class2type[ "[object " + name + "]" ] = name.toLowerCase();
	} );
	
	function isArrayLike( obj ) {
	
		// Support: real iOS 8.2 only (not reproducible in simulator)
		// `in` check used to prevent JIT error (gh-2145)
		// hasOwn isn't used here due to false negatives
		// regarding Nodelist length in IE
		var length = !!obj && "length" in obj && obj.length,
			type = jQuery.type( obj );
	
		if ( type === "function" || jQuery.isWindow( obj ) ) {
			return false;
		}
	
		return type === "array" || length === 0 ||
			typeof length === "number" && length > 0 && ( length - 1 ) in obj;
	}
	var Sizzle =
	/*!
	 * Sizzle CSS Selector Engine v2.3.3
	 * https://sizzlejs.com/
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license
	 * http://jquery.org/license
	 *
	 * Date: 2016-08-08
	 */
	(function( window ) {
	
	var i,
		support,
		Expr,
		getText,
		isXML,
		tokenize,
		compile,
		select,
		outermostContext,
		sortInput,
		hasDuplicate,
	
		// Local document vars
		setDocument,
		document,
		docElem,
		documentIsHTML,
		rbuggyQSA,
		rbuggyMatches,
		matches,
		contains,
	
		// Instance-specific data
		expando = "sizzle" + 1 * new Date(),
		preferredDoc = window.document,
		dirruns = 0,
		done = 0,
		classCache = createCache(),
		tokenCache = createCache(),
		compilerCache = createCache(),
		sortOrder = function( a, b ) {
			if ( a === b ) {
				hasDuplicate = true;
			}
			return 0;
		},
	
		// Instance methods
		hasOwn = ({}).hasOwnProperty,
		arr = [],
		pop = arr.pop,
		push_native = arr.push,
		push = arr.push,
		slice = arr.slice,
		// Use a stripped-down indexOf as it's faster than native
		// https://jsperf.com/thor-indexof-vs-for/5
		indexOf = function( list, elem ) {
			var i = 0,
				len = list.length;
			for ( ; i < len; i++ ) {
				if ( list[i] === elem ) {
					return i;
				}
			}
			return -1;
		},
	
		booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
	
		// Regular expressions
	
		// http://www.w3.org/TR/css3-selectors/#whitespace
		whitespace = "[\\x20\\t\\r\\n\\f]",
	
		// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
		identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
	
		// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
		attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
			// Operator (capture 2)
			"*([*^$|!~]?=)" + whitespace +
			// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
			"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
			"*\\]",
	
		pseudos = ":(" + identifier + ")(?:\\((" +
			// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
			// 1. quoted (capture 3; capture 4 or capture 5)
			"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
			// 2. simple (capture 6)
			"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
			// 3. anything else (capture 2)
			".*" +
			")\\)|)",
	
		// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
		rwhitespace = new RegExp( whitespace + "+", "g" ),
		rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
	
		rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
		rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
	
		rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
	
		rpseudo = new RegExp( pseudos ),
		ridentifier = new RegExp( "^" + identifier + "$" ),
	
		matchExpr = {
			"ID": new RegExp( "^#(" + identifier + ")" ),
			"CLASS": new RegExp( "^\\.(" + identifier + ")" ),
			"TAG": new RegExp( "^(" + identifier + "|[*])" ),
			"ATTR": new RegExp( "^" + attributes ),
			"PSEUDO": new RegExp( "^" + pseudos ),
			"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
				"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
				"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
			"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
			// For use in libraries implementing .is()
			// We use this for POS matching in `select`
			"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
				whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
		},
	
		rinputs = /^(?:input|select|textarea|button)$/i,
		rheader = /^h\d$/i,
	
		rnative = /^[^{]+\{\s*\[native \w/,
	
		// Easily-parseable/retrievable ID or TAG or CLASS selectors
		rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
	
		rsibling = /[+~]/,
	
		// CSS escapes
		// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
		runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
		funescape = function( _, escaped, escapedWhitespace ) {
			var high = "0x" + escaped - 0x10000;
			// NaN means non-codepoint
			// Support: Firefox<24
			// Workaround erroneous numeric interpretation of +"0x"
			return high !== high || escapedWhitespace ?
				escaped :
				high < 0 ?
					// BMP codepoint
					String.fromCharCode( high + 0x10000 ) :
					// Supplemental Plane codepoint (surrogate pair)
					String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
		},
	
		// CSS string/identifier serialization
		// https://drafts.csswg.org/cssom/#common-serializing-idioms
		rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
		fcssescape = function( ch, asCodePoint ) {
			if ( asCodePoint ) {
	
				// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
				if ( ch === "\0" ) {
					return "\uFFFD";
				}
	
				// Control characters and (dependent upon position) numbers get escaped as code points
				return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
			}
	
			// Other potentially-special ASCII characters get backslash-escaped
			return "\\" + ch;
		},
	
		// Used for iframes
		// See setDocument()
		// Removing the function wrapper causes a "Permission Denied"
		// error in IE
		unloadHandler = function() {
			setDocument();
		},
	
		disabledAncestor = addCombinator(
			function( elem ) {
				return elem.disabled === true && ("form" in elem || "label" in elem);
			},
			{ dir: "parentNode", next: "legend" }
		);
	
	// Optimize for push.apply( _, NodeList )
	try {
		push.apply(
			(arr = slice.call( preferredDoc.childNodes )),
			preferredDoc.childNodes
		);
		// Support: Android<4.0
		// Detect silently failing push.apply
		arr[ preferredDoc.childNodes.length ].nodeType;
	} catch ( e ) {
		push = { apply: arr.length ?
	
			// Leverage slice if possible
			function( target, els ) {
				push_native.apply( target, slice.call(els) );
			} :
	
			// Support: IE<9
			// Otherwise append directly
			function( target, els ) {
				var j = target.length,
					i = 0;
				// Can't trust NodeList.length
				while ( (target[j++] = els[i++]) ) {}
				target.length = j - 1;
			}
		};
	}
	
	function Sizzle( selector, context, results, seed ) {
		var m, i, elem, nid, match, groups, newSelector,
			newContext = context && context.ownerDocument,
	
			// nodeType defaults to 9, since context defaults to document
			nodeType = context ? context.nodeType : 9;
	
		results = results || [];
	
		// Return early from calls with invalid selector or context
		if ( typeof selector !== "string" || !selector ||
			nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
	
			return results;
		}
	
		// Try to shortcut find operations (as opposed to filters) in HTML documents
		if ( !seed ) {
	
			if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
				setDocument( context );
			}
			context = context || document;
	
			if ( documentIsHTML ) {
	
				// If the selector is sufficiently simple, try using a "get*By*" DOM method
				// (excepting DocumentFragment context, where the methods don't exist)
				if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
	
					// ID selector
					if ( (m = match[1]) ) {
	
						// Document context
						if ( nodeType === 9 ) {
							if ( (elem = context.getElementById( m )) ) {
	
								// Support: IE, Opera, Webkit
								// TODO: identify versions
								// getElementById can match elements by name instead of ID
								if ( elem.id === m ) {
									results.push( elem );
									return results;
								}
							} else {
								return results;
							}
	
						// Element context
						} else {
	
							// Support: IE, Opera, Webkit
							// TODO: identify versions
							// getElementById can match elements by name instead of ID
							if ( newContext && (elem = newContext.getElementById( m )) &&
								contains( context, elem ) &&
								elem.id === m ) {
	
								results.push( elem );
								return results;
							}
						}
	
					// Type selector
					} else if ( match[2] ) {
						push.apply( results, context.getElementsByTagName( selector ) );
						return results;
	
					// Class selector
					} else if ( (m = match[3]) && support.getElementsByClassName &&
						context.getElementsByClassName ) {
	
						push.apply( results, context.getElementsByClassName( m ) );
						return results;
					}
				}
	
				// Take advantage of querySelectorAll
				if ( support.qsa &&
					!compilerCache[ selector + " " ] &&
					(!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
	
					if ( nodeType !== 1 ) {
						newContext = context;
						newSelector = selector;
	
					// qSA looks outside Element context, which is not what we want
					// Thanks to Andrew Dupont for this workaround technique
					// Support: IE <=8
					// Exclude object elements
					} else if ( context.nodeName.toLowerCase() !== "object" ) {
	
						// Capture the context ID, setting it first if necessary
						if ( (nid = context.getAttribute( "id" )) ) {
							nid = nid.replace( rcssescape, fcssescape );
						} else {
							context.setAttribute( "id", (nid = expando) );
						}
	
						// Prefix every selector in the list
						groups = tokenize( selector );
						i = groups.length;
						while ( i-- ) {
							groups[i] = "#" + nid + " " + toSelector( groups[i] );
						}
						newSelector = groups.join( "," );
	
						// Expand context for sibling selectors
						newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
							context;
					}
	
					if ( newSelector ) {
						try {
							push.apply( results,
								newContext.querySelectorAll( newSelector )
							);
							return results;
						} catch ( qsaError ) {
						} finally {
							if ( nid === expando ) {
								context.removeAttribute( "id" );
							}
						}
					}
				}
			}
		}
	
		// All others
		return select( selector.replace( rtrim, "$1" ), context, results, seed );
	}
	
	/**
	 * Create key-value caches of limited size
	 * @returns {function(string, object)} Returns the Object data after storing it on itself with
	 *	property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
	 *	deleting the oldest entry
	 */
	function createCache() {
		var keys = [];
	
		function cache( key, value ) {
			// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
			if ( keys.push( key + " " ) > Expr.cacheLength ) {
				// Only keep the most recent entries
				delete cache[ keys.shift() ];
			}
			return (cache[ key + " " ] = value);
		}
		return cache;
	}
	
	/**
	 * Mark a function for special use by Sizzle
	 * @param {Function} fn The function to mark
	 */
	function markFunction( fn ) {
		fn[ expando ] = true;
		return fn;
	}
	
	/**
	 * Support testing using an element
	 * @param {Function} fn Passed the created element and returns a boolean result
	 */
	function assert( fn ) {
		var el = document.createElement("fieldset");
	
		try {
			return !!fn( el );
		} catch (e) {
			return false;
		} finally {
			// Remove from its parent by default
			if ( el.parentNode ) {
				el.parentNode.removeChild( el );
			}
			// release memory in IE
			el = null;
		}
	}
	
	/**
	 * Adds the same handler for all of the specified attrs
	 * @param {String} attrs Pipe-separated list of attributes
	 * @param {Function} handler The method that will be applied
	 */
	function addHandle( attrs, handler ) {
		var arr = attrs.split("|"),
			i = arr.length;
	
		while ( i-- ) {
			Expr.attrHandle[ arr[i] ] = handler;
		}
	}
	
	/**
	 * Checks document order of two siblings
	 * @param {Element} a
	 * @param {Element} b
	 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
	 */
	function siblingCheck( a, b ) {
		var cur = b && a,
			diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
				a.sourceIndex - b.sourceIndex;
	
		// Use IE sourceIndex if available on both nodes
		if ( diff ) {
			return diff;
		}
	
		// Check if b follows a
		if ( cur ) {
			while ( (cur = cur.nextSibling) ) {
				if ( cur === b ) {
					return -1;
				}
			}
		}
	
		return a ? 1 : -1;
	}
	
	/**
	 * Returns a function to use in pseudos for input types
	 * @param {String} type
	 */
	function createInputPseudo( type ) {
		return function( elem ) {
			var name = elem.nodeName.toLowerCase();
			return name === "input" && elem.type === type;
		};
	}
	
	/**
	 * Returns a function to use in pseudos for buttons
	 * @param {String} type
	 */
	function createButtonPseudo( type ) {
		return function( elem ) {
			var name = elem.nodeName.toLowerCase();
			return (name === "input" || name === "button") && elem.type === type;
		};
	}
	
	/**
	 * Returns a function to use in pseudos for :enabled/:disabled
	 * @param {Boolean} disabled true for :disabled; false for :enabled
	 */
	function createDisabledPseudo( disabled ) {
	
		// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
		return function( elem ) {
	
			// Only certain elements can match :enabled or :disabled
			// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
			// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
			if ( "form" in elem ) {
	
				// Check for inherited disabledness on relevant non-disabled elements:
				// * listed form-associated elements in a disabled fieldset
				//   https://html.spec.whatwg.org/multipage/forms.html#category-listed
				//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
				// * option elements in a disabled optgroup
				//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
				// All such elements have a "form" property.
				if ( elem.parentNode && elem.disabled === false ) {
	
					// Option elements defer to a parent optgroup if present
					if ( "label" in elem ) {
						if ( "label" in elem.parentNode ) {
							return elem.parentNode.disabled === disabled;
						} else {
							return elem.disabled === disabled;
						}
					}
	
					// Support: IE 6 - 11
					// Use the isDisabled shortcut property to check for disabled fieldset ancestors
					return elem.isDisabled === disabled ||
	
						// Where there is no isDisabled, check manually
						/* jshint -W018 */
						elem.isDisabled !== !disabled &&
							disabledAncestor( elem ) === disabled;
				}
	
				return elem.disabled === disabled;
	
			// Try to winnow out elements that can't be disabled before trusting the disabled property.
			// Some victims get caught in our net (label, legend, menu, track), but it shouldn't
			// even exist on them, let alone have a boolean value.
			} else if ( "label" in elem ) {
				return elem.disabled === disabled;
			}
	
			// Remaining elements are neither :enabled nor :disabled
			return false;
		};
	}
	
	/**
	 * Returns a function to use in pseudos for positionals
	 * @param {Function} fn
	 */
	function createPositionalPseudo( fn ) {
		return markFunction(function( argument ) {
			argument = +argument;
			return markFunction(function( seed, matches ) {
				var j,
					matchIndexes = fn( [], seed.length, argument ),
					i = matchIndexes.length;
	
				// Match elements found at the specified indexes
				while ( i-- ) {
					if ( seed[ (j = matchIndexes[i]) ] ) {
						seed[j] = !(matches[j] = seed[j]);
					}
				}
			});
		});
	}
	
	/**
	 * Checks a node for validity as a Sizzle context
	 * @param {Element|Object=} context
	 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
	 */
	function testContext( context ) {
		return context && typeof context.getElementsByTagName !== "undefined" && context;
	}
	
	// Expose support vars for convenience
	support = Sizzle.support = {};
	
	/**
	 * Detects XML nodes
	 * @param {Element|Object} elem An element or a document
	 * @returns {Boolean} True iff elem is a non-HTML XML node
	 */
	isXML = Sizzle.isXML = function( elem ) {
		// documentElement is verified for cases where it doesn't yet exist
		// (such as loading iframes in IE - #4833)
		var documentElement = elem && (elem.ownerDocument || elem).documentElement;
		return documentElement ? documentElement.nodeName !== "HTML" : false;
	};
	
	/**
	 * Sets document-related variables once based on the current document
	 * @param {Element|Object} [doc] An element or document object to use to set the document
	 * @returns {Object} Returns the current document
	 */
	setDocument = Sizzle.setDocument = function( node ) {
		var hasCompare, subWindow,
			doc = node ? node.ownerDocument || node : preferredDoc;
	
		// Return early if doc is invalid or already selected
		if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
			return document;
		}
	
		// Update global variables
		document = doc;
		docElem = document.documentElement;
		documentIsHTML = !isXML( document );
	
		// Support: IE 9-11, Edge
		// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
		if ( preferredDoc !== document &&
			(subWindow = document.defaultView) && subWindow.top !== subWindow ) {
	
			// Support: IE 11, Edge
			if ( subWindow.addEventListener ) {
				subWindow.addEventListener( "unload", unloadHandler, false );
	
			// Support: IE 9 - 10 only
			} else if ( subWindow.attachEvent ) {
				subWindow.attachEvent( "onunload", unloadHandler );
			}
		}
	
		/* Attributes
		---------------------------------------------------------------------- */
	
		// Support: IE<8
		// Verify that getAttribute really returns attributes and not properties
		// (excepting IE8 booleans)
		support.attributes = assert(function( el ) {
			el.className = "i";
			return !el.getAttribute("className");
		});
	
		/* getElement(s)By*
		---------------------------------------------------------------------- */
	
		// Check if getElementsByTagName("*") returns only elements
		support.getElementsByTagName = assert(function( el ) {
			el.appendChild( document.createComment("") );
			return !el.getElementsByTagName("*").length;
		});
	
		// Support: IE<9
		support.getElementsByClassName = rnative.test( document.getElementsByClassName );
	
		// Support: IE<10
		// Check if getElementById returns elements by name
		// The broken getElementById methods don't pick up programmatically-set names,
		// so use a roundabout getElementsByName test
		support.getById = assert(function( el ) {
			docElem.appendChild( el ).id = expando;
			return !document.getElementsByName || !document.getElementsByName( expando ).length;
		});
	
		// ID filter and find
		if ( support.getById ) {
			Expr.filter["ID"] = function( id ) {
				var attrId = id.replace( runescape, funescape );
				return function( elem ) {
					return elem.getAttribute("id") === attrId;
				};
			};
			Expr.find["ID"] = function( id, context ) {
				if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
					var elem = context.getElementById( id );
					return elem ? [ elem ] : [];
				}
			};
		} else {
			Expr.filter["ID"] =  function( id ) {
				var attrId = id.replace( runescape, funescape );
				return function( elem ) {
					var node = typeof elem.getAttributeNode !== "undefined" &&
						elem.getAttributeNode("id");
					return node && node.value === attrId;
				};
			};
	
			// Support: IE 6 - 7 only
			// getElementById is not reliable as a find shortcut
			Expr.find["ID"] = function( id, context ) {
				if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
					var node, i, elems,
						elem = context.getElementById( id );
	
					if ( elem ) {
	
						// Verify the id attribute
						node = elem.getAttributeNode("id");
						if ( node && node.value === id ) {
							return [ elem ];
						}
	
						// Fall back on getElementsByName
						elems = context.getElementsByName( id );
						i = 0;
						while ( (elem = elems[i++]) ) {
							node = elem.getAttributeNode("id");
							if ( node && node.value === id ) {
								return [ elem ];
							}
						}
					}
	
					return [];
				}
			};
		}
	
		// Tag
		Expr.find["TAG"] = support.getElementsByTagName ?
			function( tag, context ) {
				if ( typeof context.getElementsByTagName !== "undefined" ) {
					return context.getElementsByTagName( tag );
	
				// DocumentFragment nodes don't have gEBTN
				} else if ( support.qsa ) {
					return context.querySelectorAll( tag );
				}
			} :
	
			function( tag, context ) {
				var elem,
					tmp = [],
					i = 0,
					// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
					results = context.getElementsByTagName( tag );
	
				// Filter out possible comments
				if ( tag === "*" ) {
					while ( (elem = results[i++]) ) {
						if ( elem.nodeType === 1 ) {
							tmp.push( elem );
						}
					}
	
					return tmp;
				}
				return results;
			};
	
		// Class
		Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
			if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
				return context.getElementsByClassName( className );
			}
		};
	
		/* QSA/matchesSelector
		---------------------------------------------------------------------- */
	
		// QSA and matchesSelector support
	
		// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
		rbuggyMatches = [];
	
		// qSa(:focus) reports false when true (Chrome 21)
		// We allow this because of a bug in IE8/9 that throws an error
		// whenever `document.activeElement` is accessed on an iframe
		// So, we allow :focus to pass through QSA all the time to avoid the IE error
		// See https://bugs.jquery.com/ticket/13378
		rbuggyQSA = [];
	
		if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
			// Build QSA regex
			// Regex strategy adopted from Diego Perini
			assert(function( el ) {
				// Select is set to empty string on purpose
				// This is to test IE's treatment of not explicitly
				// setting a boolean content attribute,
				// since its presence should be enough
				// https://bugs.jquery.com/ticket/12359
				docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
					"<select id='" + expando + "-\r\\' msallowcapture=''>" +
					"<option selected=''></option></select>";
	
				// Support: IE8, Opera 11-12.16
				// Nothing should be selected when empty strings follow ^= or $= or *=
				// The test attribute must be unknown in Opera but "safe" for WinRT
				// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
				if ( el.querySelectorAll("[msallowcapture^='']").length ) {
					rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
				}
	
				// Support: IE8
				// Boolean attributes and "value" are not treated correctly
				if ( !el.querySelectorAll("[selected]").length ) {
					rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
				}
	
				// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
				if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
					rbuggyQSA.push("~=");
				}
	
				// Webkit/Opera - :checked should return selected option elements
				// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
				// IE8 throws error here and will not see later tests
				if ( !el.querySelectorAll(":checked").length ) {
					rbuggyQSA.push(":checked");
				}
	
				// Support: Safari 8+, iOS 8+
				// https://bugs.webkit.org/show_bug.cgi?id=136851
				// In-page `selector#id sibling-combinator selector` fails
				if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
					rbuggyQSA.push(".#.+[+~]");
				}
			});
	
			assert(function( el ) {
				el.innerHTML = "<a href='' disabled='disabled'></a>" +
					"<select disabled='disabled'><option/></select>";
	
				// Support: Windows 8 Native Apps
				// The type and name attributes are restricted during .innerHTML assignment
				var input = document.createElement("input");
				input.setAttribute( "type", "hidden" );
				el.appendChild( input ).setAttribute( "name", "D" );
	
				// Support: IE8
				// Enforce case-sensitivity of name attribute
				if ( el.querySelectorAll("[name=d]").length ) {
					rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
				}
	
				// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
				// IE8 throws error here and will not see later tests
				if ( el.querySelectorAll(":enabled").length !== 2 ) {
					rbuggyQSA.push( ":enabled", ":disabled" );
				}
	
				// Support: IE9-11+
				// IE's :disabled selector does not pick up the children of disabled fieldsets
				docElem.appendChild( el ).disabled = true;
				if ( el.querySelectorAll(":disabled").length !== 2 ) {
					rbuggyQSA.push( ":enabled", ":disabled" );
				}
	
				// Opera 10-11 does not throw on post-comma invalid pseudos
				el.querySelectorAll("*,:x");
				rbuggyQSA.push(",.*:");
			});
		}
	
		if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
			docElem.webkitMatchesSelector ||
			docElem.mozMatchesSelector ||
			docElem.oMatchesSelector ||
			docElem.msMatchesSelector) )) ) {
	
			assert(function( el ) {
				// Check to see if it's possible to do matchesSelector
				// on a disconnected node (IE 9)
				support.disconnectedMatch = matches.call( el, "*" );
	
				// This should fail with an exception
				// Gecko does not error, returns false instead
				matches.call( el, "[s!='']:x" );
				rbuggyMatches.push( "!=", pseudos );
			});
		}
	
		rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
		rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
	
		/* Contains
		---------------------------------------------------------------------- */
		hasCompare = rnative.test( docElem.compareDocumentPosition );
	
		// Element contains another
		// Purposefully self-exclusive
		// As in, an element does not contain itself
		contains = hasCompare || rnative.test( docElem.contains ) ?
			function( a, b ) {
				var adown = a.nodeType === 9 ? a.documentElement : a,
					bup = b && b.parentNode;
				return a === bup || !!( bup && bup.nodeType === 1 && (
					adown.contains ?
						adown.contains( bup ) :
						a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
				));
			} :
			function( a, b ) {
				if ( b ) {
					while ( (b = b.parentNode) ) {
						if ( b === a ) {
							return true;
						}
					}
				}
				return false;
			};
	
		/* Sorting
		---------------------------------------------------------------------- */
	
		// Document order sorting
		sortOrder = hasCompare ?
		function( a, b ) {
	
			// Flag for duplicate removal
			if ( a === b ) {
				hasDuplicate = true;
				return 0;
			}
	
			// Sort on method existence if only one input has compareDocumentPosition
			var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
			if ( compare ) {
				return compare;
			}
	
			// Calculate position if both inputs belong to the same document
			compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
				a.compareDocumentPosition( b ) :
	
				// Otherwise we know they are disconnected
				1;
	
			// Disconnected nodes
			if ( compare & 1 ||
				(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
	
				// Choose the first element that is related to our preferred document
				if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
					return -1;
				}
				if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
					return 1;
				}
	
				// Maintain original order
				return sortInput ?
					( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
					0;
			}
	
			return compare & 4 ? -1 : 1;
		} :
		function( a, b ) {
			// Exit early if the nodes are identical
			if ( a === b ) {
				hasDuplicate = true;
				return 0;
			}
	
			var cur,
				i = 0,
				aup = a.parentNode,
				bup = b.parentNode,
				ap = [ a ],
				bp = [ b ];
	
			// Parentless nodes are either documents or disconnected
			if ( !aup || !bup ) {
				return a === document ? -1 :
					b === document ? 1 :
					aup ? -1 :
					bup ? 1 :
					sortInput ?
					( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
					0;
	
			// If the nodes are siblings, we can do a quick check
			} else if ( aup === bup ) {
				return siblingCheck( a, b );
			}
	
			// Otherwise we need full lists of their ancestors for comparison
			cur = a;
			while ( (cur = cur.parentNode) ) {
				ap.unshift( cur );
			}
			cur = b;
			while ( (cur = cur.parentNode) ) {
				bp.unshift( cur );
			}
	
			// Walk down the tree looking for a discrepancy
			while ( ap[i] === bp[i] ) {
				i++;
			}
	
			return i ?
				// Do a sibling check if the nodes have a common ancestor
				siblingCheck( ap[i], bp[i] ) :
	
				// Otherwise nodes in our document sort first
				ap[i] === preferredDoc ? -1 :
				bp[i] === preferredDoc ? 1 :
				0;
		};
	
		return document;
	};
	
	Sizzle.matches = function( expr, elements ) {
		return Sizzle( expr, null, null, elements );
	};
	
	Sizzle.matchesSelector = function( elem, expr ) {
		// Set document vars if needed
		if ( ( elem.ownerDocument || elem ) !== document ) {
			setDocument( elem );
		}
	
		// Make sure that attribute selectors are quoted
		expr = expr.replace( rattributeQuotes, "='$1']" );
	
		if ( support.matchesSelector && documentIsHTML &&
			!compilerCache[ expr + " " ] &&
			( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
			( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
	
			try {
				var ret = matches.call( elem, expr );
	
				// IE 9's matchesSelector returns false on disconnected nodes
				if ( ret || support.disconnectedMatch ||
						// As well, disconnected nodes are said to be in a document
						// fragment in IE 9
						elem.document && elem.document.nodeType !== 11 ) {
					return ret;
				}
			} catch (e) {}
		}
	
		return Sizzle( expr, document, null, [ elem ] ).length > 0;
	};
	
	Sizzle.contains = function( context, elem ) {
		// Set document vars if needed
		if ( ( context.ownerDocument || context ) !== document ) {
			setDocument( context );
		}
		return contains( context, elem );
	};
	
	Sizzle.attr = function( elem, name ) {
		// Set document vars if needed
		if ( ( elem.ownerDocument || elem ) !== document ) {
			setDocument( elem );
		}
	
		var fn = Expr.attrHandle[ name.toLowerCase() ],
			// Don't get fooled by Object.prototype properties (jQuery #13807)
			val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
				fn( elem, name, !documentIsHTML ) :
				undefined;
	
		return val !== undefined ?
			val :
			support.attributes || !documentIsHTML ?
				elem.getAttribute( name ) :
				(val = elem.getAttributeNode(name)) && val.specified ?
					val.value :
					null;
	};
	
	Sizzle.escape = function( sel ) {
		return (sel + "").replace( rcssescape, fcssescape );
	};
	
	Sizzle.error = function( msg ) {
		throw new Error( "Syntax error, unrecognized expression: " + msg );
	};
	
	/**
	 * Document sorting and removing duplicates
	 * @param {ArrayLike} results
	 */
	Sizzle.uniqueSort = function( results ) {
		var elem,
			duplicates = [],
			j = 0,
			i = 0;
	
		// Unless we *know* we can detect duplicates, assume their presence
		hasDuplicate = !support.detectDuplicates;
		sortInput = !support.sortStable && results.slice( 0 );
		results.sort( sortOrder );
	
		if ( hasDuplicate ) {
			while ( (elem = results[i++]) ) {
				if ( elem === results[ i ] ) {
					j = duplicates.push( i );
				}
			}
			while ( j-- ) {
				results.splice( duplicates[ j ], 1 );
			}
		}
	
		// Clear input after sorting to release objects
		// See https://github.com/jquery/sizzle/pull/225
		sortInput = null;
	
		return results;
	};
	
	/**
	 * Utility function for retrieving the text value of an array of DOM nodes
	 * @param {Array|Element} elem
	 */
	getText = Sizzle.getText = function( elem ) {
		var node,
			ret = "",
			i = 0,
			nodeType = elem.nodeType;
	
		if ( !nodeType ) {
			// If no nodeType, this is expected to be an array
			while ( (node = elem[i++]) ) {
				// Do not traverse comment nodes
				ret += getText( node );
			}
		} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
			// Use textContent for elements
			// innerText usage removed for consistency of new lines (jQuery #11153)
			if ( typeof elem.textContent === "string" ) {
				return elem.textContent;
			} else {
				// Traverse its children
				for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
					ret += getText( elem );
				}
			}
		} else if ( nodeType === 3 || nodeType === 4 ) {
			return elem.nodeValue;
		}
		// Do not include comment or processing instruction nodes
	
		return ret;
	};
	
	Expr = Sizzle.selectors = {
	
		// Can be adjusted by the user
		cacheLength: 50,
	
		createPseudo: markFunction,
	
		match: matchExpr,
	
		attrHandle: {},
	
		find: {},
	
		relative: {
			">": { dir: "parentNode", first: true },
			" ": { dir: "parentNode" },
			"+": { dir: "previousSibling", first: true },
			"~": { dir: "previousSibling" }
		},
	
		preFilter: {
			"ATTR": function( match ) {
				match[1] = match[1].replace( runescape, funescape );
	
				// Move the given value to match[3] whether quoted or unquoted
				match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
	
				if ( match[2] === "~=" ) {
					match[3] = " " + match[3] + " ";
				}
	
				return match.slice( 0, 4 );
			},
	
			"CHILD": function( match ) {
				/* matches from matchExpr["CHILD"]
					1 type (only|nth|...)
					2 what (child|of-type)
					3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
					4 xn-component of xn+y argument ([+-]?\d*n|)
					5 sign of xn-component
					6 x of xn-component
					7 sign of y-component
					8 y of y-component
				*/
				match[1] = match[1].toLowerCase();
	
				if ( match[1].slice( 0, 3 ) === "nth" ) {
					// nth-* requires argument
					if ( !match[3] ) {
						Sizzle.error( match[0] );
					}
	
					// numeric x and y parameters for Expr.filter.CHILD
					// remember that false/true cast respectively to 0/1
					match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
					match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
	
				// other types prohibit arguments
				} else if ( match[3] ) {
					Sizzle.error( match[0] );
				}
	
				return match;
			},
	
			"PSEUDO": function( match ) {
				var excess,
					unquoted = !match[6] && match[2];
	
				if ( matchExpr["CHILD"].test( match[0] ) ) {
					return null;
				}
	
				// Accept quoted arguments as-is
				if ( match[3] ) {
					match[2] = match[4] || match[5] || "";
	
				// Strip excess characters from unquoted arguments
				} else if ( unquoted && rpseudo.test( unquoted ) &&
					// Get excess from tokenize (recursively)
					(excess = tokenize( unquoted, true )) &&
					// advance to the next closing parenthesis
					(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
	
					// excess is a negative index
					match[0] = match[0].slice( 0, excess );
					match[2] = unquoted.slice( 0, excess );
				}
	
				// Return only captures needed by the pseudo filter method (type and argument)
				return match.slice( 0, 3 );
			}
		},
	
		filter: {
	
			"TAG": function( nodeNameSelector ) {
				var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
				return nodeNameSelector === "*" ?
					function() { return true; } :
					function( elem ) {
						return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
					};
			},
	
			"CLASS": function( className ) {
				var pattern = classCache[ className + " " ];
	
				return pattern ||
					(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
					classCache( className, function( elem ) {
						return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
					});
			},
	
			"ATTR": function( name, operator, check ) {
				return function( elem ) {
					var result = Sizzle.attr( elem, name );
	
					if ( result == null ) {
						return operator === "!=";
					}
					if ( !operator ) {
						return true;
					}
	
					result += "";
	
					return operator === "=" ? result === check :
						operator === "!=" ? result !== check :
						operator === "^=" ? check && result.indexOf( check ) === 0 :
						operator === "*=" ? check && result.indexOf( check ) > -1 :
						operator === "$=" ? check && result.slice( -check.length ) === check :
						operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
						operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
						false;
				};
			},
	
			"CHILD": function( type, what, argument, first, last ) {
				var simple = type.slice( 0, 3 ) !== "nth",
					forward = type.slice( -4 ) !== "last",
					ofType = what === "of-type";
	
				return first === 1 && last === 0 ?
	
					// Shortcut for :nth-*(n)
					function( elem ) {
						return !!elem.parentNode;
					} :
	
					function( elem, context, xml ) {
						var cache, uniqueCache, outerCache, node, nodeIndex, start,
							dir = simple !== forward ? "nextSibling" : "previousSibling",
							parent = elem.parentNode,
							name = ofType && elem.nodeName.toLowerCase(),
							useCache = !xml && !ofType,
							diff = false;
	
						if ( parent ) {
	
							// :(first|last|only)-(child|of-type)
							if ( simple ) {
								while ( dir ) {
									node = elem;
									while ( (node = node[ dir ]) ) {
										if ( ofType ?
											node.nodeName.toLowerCase() === name :
											node.nodeType === 1 ) {
	
											return false;
										}
									}
									// Reverse direction for :only-* (if we haven't yet done so)
									start = dir = type === "only" && !start && "nextSibling";
								}
								return true;
							}
	
							start = [ forward ? parent.firstChild : parent.lastChild ];
	
							// non-xml :nth-child(...) stores cache data on `parent`
							if ( forward && useCache ) {
	
								// Seek `elem` from a previously-cached index
	
								// ...in a gzip-friendly way
								node = parent;
								outerCache = node[ expando ] || (node[ expando ] = {});
	
								// Support: IE <9 only
								// Defend against cloned attroperties (jQuery gh-1709)
								uniqueCache = outerCache[ node.uniqueID ] ||
									(outerCache[ node.uniqueID ] = {});
	
								cache = uniqueCache[ type ] || [];
								nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
								diff = nodeIndex && cache[ 2 ];
								node = nodeIndex && parent.childNodes[ nodeIndex ];
	
								while ( (node = ++nodeIndex && node && node[ dir ] ||
	
									// Fallback to seeking `elem` from the start
									(diff = nodeIndex = 0) || start.pop()) ) {
	
									// When found, cache indexes on `parent` and break
									if ( node.nodeType === 1 && ++diff && node === elem ) {
										uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
										break;
									}
								}
	
							} else {
								// Use previously-cached element index if available
								if ( useCache ) {
									// ...in a gzip-friendly way
									node = elem;
									outerCache = node[ expando ] || (node[ expando ] = {});
	
									// Support: IE <9 only
									// Defend against cloned attroperties (jQuery gh-1709)
									uniqueCache = outerCache[ node.uniqueID ] ||
										(outerCache[ node.uniqueID ] = {});
	
									cache = uniqueCache[ type ] || [];
									nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
									diff = nodeIndex;
								}
	
								// xml :nth-child(...)
								// or :nth-last-child(...) or :nth(-last)?-of-type(...)
								if ( diff === false ) {
									// Use the same loop as above to seek `elem` from the start
									while ( (node = ++nodeIndex && node && node[ dir ] ||
										(diff = nodeIndex = 0) || start.pop()) ) {
	
										if ( ( ofType ?
											node.nodeName.toLowerCase() === name :
											node.nodeType === 1 ) &&
											++diff ) {
	
											// Cache the index of each encountered element
											if ( useCache ) {
												outerCache = node[ expando ] || (node[ expando ] = {});
	
												// Support: IE <9 only
												// Defend against cloned attroperties (jQuery gh-1709)
												uniqueCache = outerCache[ node.uniqueID ] ||
													(outerCache[ node.uniqueID ] = {});
	
												uniqueCache[ type ] = [ dirruns, diff ];
											}
	
											if ( node === elem ) {
												break;
											}
										}
									}
								}
							}
	
							// Incorporate the offset, then check against cycle size
							diff -= last;
							return diff === first || ( diff % first === 0 && diff / first >= 0 );
						}
					};
			},
	
			"PSEUDO": function( pseudo, argument ) {
				// pseudo-class names are case-insensitive
				// http://www.w3.org/TR/selectors/#pseudo-classes
				// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
				// Remember that setFilters inherits from pseudos
				var args,
					fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
						Sizzle.error( "unsupported pseudo: " + pseudo );
	
				// The user may use createPseudo to indicate that
				// arguments are needed to create the filter function
				// just as Sizzle does
				if ( fn[ expando ] ) {
					return fn( argument );
				}
	
				// But maintain support for old signatures
				if ( fn.length > 1 ) {
					args = [ pseudo, pseudo, "", argument ];
					return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
						markFunction(function( seed, matches ) {
							var idx,
								matched = fn( seed, argument ),
								i = matched.length;
							while ( i-- ) {
								idx = indexOf( seed, matched[i] );
								seed[ idx ] = !( matches[ idx ] = matched[i] );
							}
						}) :
						function( elem ) {
							return fn( elem, 0, args );
						};
				}
	
				return fn;
			}
		},
	
		pseudos: {
			// Potentially complex pseudos
			"not": markFunction(function( selector ) {
				// Trim the selector passed to compile
				// to avoid treating leading and trailing
				// spaces as combinators
				var input = [],
					results = [],
					matcher = compile( selector.replace( rtrim, "$1" ) );
	
				return matcher[ expando ] ?
					markFunction(function( seed, matches, context, xml ) {
						var elem,
							unmatched = matcher( seed, null, xml, [] ),
							i = seed.length;
	
						// Match elements unmatched by `matcher`
						while ( i-- ) {
							if ( (elem = unmatched[i]) ) {
								seed[i] = !(matches[i] = elem);
							}
						}
					}) :
					function( elem, context, xml ) {
						input[0] = elem;
						matcher( input, null, xml, results );
						// Don't keep the element (issue #299)
						input[0] = null;
						return !results.pop();
					};
			}),
	
			"has": markFunction(function( selector ) {
				return function( elem ) {
					return Sizzle( selector, elem ).length > 0;
				};
			}),
	
			"contains": markFunction(function( text ) {
				text = text.replace( runescape, funescape );
				return function( elem ) {
					return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
				};
			}),
	
			// "Whether an element is represented by a :lang() selector
			// is based solely on the element's language value
			// being equal to the identifier C,
			// or beginning with the identifier C immediately followed by "-".
			// The matching of C against the element's language value is performed case-insensitively.
			// The identifier C does not have to be a valid language name."
			// http://www.w3.org/TR/selectors/#lang-pseudo
			"lang": markFunction( function( lang ) {
				// lang value must be a valid identifier
				if ( !ridentifier.test(lang || "") ) {
					Sizzle.error( "unsupported lang: " + lang );
				}
				lang = lang.replace( runescape, funescape ).toLowerCase();
				return function( elem ) {
					var elemLang;
					do {
						if ( (elemLang = documentIsHTML ?
							elem.lang :
							elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
	
							elemLang = elemLang.toLowerCase();
							return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
						}
					} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
					return false;
				};
			}),
	
			// Miscellaneous
			"target": function( elem ) {
				var hash = window.location && window.location.hash;
				return hash && hash.slice( 1 ) === elem.id;
			},
	
			"root": function( elem ) {
				return elem === docElem;
			},
	
			"focus": function( elem ) {
				return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
			},
	
			// Boolean properties
			"enabled": createDisabledPseudo( false ),
			"disabled": createDisabledPseudo( true ),
	
			"checked": function( elem ) {
				// In CSS3, :checked should return both checked and selected elements
				// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
				var nodeName = elem.nodeName.toLowerCase();
				return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
			},
	
			"selected": function( elem ) {
				// Accessing this property makes selected-by-default
				// options in Safari work properly
				if ( elem.parentNode ) {
					elem.parentNode.selectedIndex;
				}
	
				return elem.selected === true;
			},
	
			// Contents
			"empty": function( elem ) {
				// http://www.w3.org/TR/selectors/#empty-pseudo
				// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
				//   but not by others (comment: 8; processing instruction: 7; etc.)
				// nodeType < 6 works because attributes (2) do not appear as children
				for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
					if ( elem.nodeType < 6 ) {
						return false;
					}
				}
				return true;
			},
	
			"parent": function( elem ) {
				return !Expr.pseudos["empty"]( elem );
			},
	
			// Element/input types
			"header": function( elem ) {
				return rheader.test( elem.nodeName );
			},
	
			"input": function( elem ) {
				return rinputs.test( elem.nodeName );
			},
	
			"button": function( elem ) {
				var name = elem.nodeName.toLowerCase();
				return name === "input" && elem.type === "button" || name === "button";
			},
	
			"text": function( elem ) {
				var attr;
				return elem.nodeName.toLowerCase() === "input" &&
					elem.type === "text" &&
	
					// Support: IE<8
					// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
					( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
			},
	
			// Position-in-collection
			"first": createPositionalPseudo(function() {
				return [ 0 ];
			}),
	
			"last": createPositionalPseudo(function( matchIndexes, length ) {
				return [ length - 1 ];
			}),
	
			"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
				return [ argument < 0 ? argument + length : argument ];
			}),
	
			"even": createPositionalPseudo(function( matchIndexes, length ) {
				var i = 0;
				for ( ; i < length; i += 2 ) {
					matchIndexes.push( i );
				}
				return matchIndexes;
			}),
	
			"odd": createPositionalPseudo(function( matchIndexes, length ) {
				var i = 1;
				for ( ; i < length; i += 2 ) {
					matchIndexes.push( i );
				}
				return matchIndexes;
			}),
	
			"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
				var i = argument < 0 ? argument + length : argument;
				for ( ; --i >= 0; ) {
					matchIndexes.push( i );
				}
				return matchIndexes;
			}),
	
			"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
				var i = argument < 0 ? argument + length : argument;
				for ( ; ++i < length; ) {
					matchIndexes.push( i );
				}
				return matchIndexes;
			})
		}
	};
	
	Expr.pseudos["nth"] = Expr.pseudos["eq"];
	
	// Add button/input type pseudos
	for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
		Expr.pseudos[ i ] = createInputPseudo( i );
	}
	for ( i in { submit: true, reset: true } ) {
		Expr.pseudos[ i ] = createButtonPseudo( i );
	}
	
	// Easy API for creating new setFilters
	function setFilters() {}
	setFilters.prototype = Expr.filters = Expr.pseudos;
	Expr.setFilters = new setFilters();
	
	tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
		var matched, match, tokens, type,
			soFar, groups, preFilters,
			cached = tokenCache[ selector + " " ];
	
		if ( cached ) {
			return parseOnly ? 0 : cached.slice( 0 );
		}
	
		soFar = selector;
		groups = [];
		preFilters = Expr.preFilter;
	
		while ( soFar ) {
	
			// Comma and first run
			if ( !matched || (match = rcomma.exec( soFar )) ) {
				if ( match ) {
					// Don't consume trailing commas as valid
					soFar = soFar.slice( match[0].length ) || soFar;
				}
				groups.push( (tokens = []) );
			}
	
			matched = false;
	
			// Combinators
			if ( (match = rcombinators.exec( soFar )) ) {
				matched = match.shift();
				tokens.push({
					value: matched,
					// Cast descendant combinators to space
					type: match[0].replace( rtrim, " " )
				});
				soFar = soFar.slice( matched.length );
			}
	
			// Filters
			for ( type in Expr.filter ) {
				if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
					(match = preFilters[ type ]( match ))) ) {
					matched = match.shift();
					tokens.push({
						value: matched,
						type: type,
						matches: match
					});
					soFar = soFar.slice( matched.length );
				}
			}
	
			if ( !matched ) {
				break;
			}
		}
	
		// Return the length of the invalid excess
		// if we're just parsing
		// Otherwise, throw an error or return tokens
		return parseOnly ?
			soFar.length :
			soFar ?
				Sizzle.error( selector ) :
				// Cache the tokens
				tokenCache( selector, groups ).slice( 0 );
	};
	
	function toSelector( tokens ) {
		var i = 0,
			len = tokens.length,
			selector = "";
		for ( ; i < len; i++ ) {
			selector += tokens[i].value;
		}
		return selector;
	}
	
	function addCombinator( matcher, combinator, base ) {
		var dir = combinator.dir,
			skip = combinator.next,
			key = skip || dir,
			checkNonElements = base && key === "parentNode",
			doneName = done++;
	
		return combinator.first ?
			// Check against closest ancestor/preceding element
			function( elem, context, xml ) {
				while ( (elem = elem[ dir ]) ) {
					if ( elem.nodeType === 1 || checkNonElements ) {
						return matcher( elem, context, xml );
					}
				}
				return false;
			} :
	
			// Check against all ancestor/preceding elements
			function( elem, context, xml ) {
				var oldCache, uniqueCache, outerCache,
					newCache = [ dirruns, doneName ];
	
				// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
				if ( xml ) {
					while ( (elem = elem[ dir ]) ) {
						if ( elem.nodeType === 1 || checkNonElements ) {
							if ( matcher( elem, context, xml ) ) {
								return true;
							}
						}
					}
				} else {
					while ( (elem = elem[ dir ]) ) {
						if ( elem.nodeType === 1 || checkNonElements ) {
							outerCache = elem[ expando ] || (elem[ expando ] = {});
	
							// Support: IE <9 only
							// Defend against cloned attroperties (jQuery gh-1709)
							uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
	
							if ( skip && skip === elem.nodeName.toLowerCase() ) {
								elem = elem[ dir ] || elem;
							} else if ( (oldCache = uniqueCache[ key ]) &&
								oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
	
								// Assign to newCache so results back-propagate to previous elements
								return (newCache[ 2 ] = oldCache[ 2 ]);
							} else {
								// Reuse newcache so results back-propagate to previous elements
								uniqueCache[ key ] = newCache;
	
								// A match means we're done; a fail means we have to keep checking
								if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
									return true;
								}
							}
						}
					}
				}
				return false;
			};
	}
	
	function elementMatcher( matchers ) {
		return matchers.length > 1 ?
			function( elem, context, xml ) {
				var i = matchers.length;
				while ( i-- ) {
					if ( !matchers[i]( elem, context, xml ) ) {
						return false;
					}
				}
				return true;
			} :
			matchers[0];
	}
	
	function multipleContexts( selector, contexts, results ) {
		var i = 0,
			len = contexts.length;
		for ( ; i < len; i++ ) {
			Sizzle( selector, contexts[i], results );
		}
		return results;
	}
	
	function condense( unmatched, map, filter, context, xml ) {
		var elem,
			newUnmatched = [],
			i = 0,
			len = unmatched.length,
			mapped = map != null;
	
		for ( ; i < len; i++ ) {
			if ( (elem = unmatched[i]) ) {
				if ( !filter || filter( elem, context, xml ) ) {
					newUnmatched.push( elem );
					if ( mapped ) {
						map.push( i );
					}
				}
			}
		}
	
		return newUnmatched;
	}
	
	function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
		if ( postFilter && !postFilter[ expando ] ) {
			postFilter = setMatcher( postFilter );
		}
		if ( postFinder && !postFinder[ expando ] ) {
			postFinder = setMatcher( postFinder, postSelector );
		}
		return markFunction(function( seed, results, context, xml ) {
			var temp, i, elem,
				preMap = [],
				postMap = [],
				preexisting = results.length,
	
				// Get initial elements from seed or context
				elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
	
				// Prefilter to get matcher input, preserving a map for seed-results synchronization
				matcherIn = preFilter && ( seed || !selector ) ?
					condense( elems, preMap, preFilter, context, xml ) :
					elems,
	
				matcherOut = matcher ?
					// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
					postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
	
						// ...intermediate processing is necessary
						[] :
	
						// ...otherwise use results directly
						results :
					matcherIn;
	
			// Find primary matches
			if ( matcher ) {
				matcher( matcherIn, matcherOut, context, xml );
			}
	
			// Apply postFilter
			if ( postFilter ) {
				temp = condense( matcherOut, postMap );
				postFilter( temp, [], context, xml );
	
				// Un-match failing elements by moving them back to matcherIn
				i = temp.length;
				while ( i-- ) {
					if ( (elem = temp[i]) ) {
						matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
					}
				}
			}
	
			if ( seed ) {
				if ( postFinder || preFilter ) {
					if ( postFinder ) {
						// Get the final matcherOut by condensing this intermediate into postFinder contexts
						temp = [];
						i = matcherOut.length;
						while ( i-- ) {
							if ( (elem = matcherOut[i]) ) {
								// Restore matcherIn since elem is not yet a final match
								temp.push( (matcherIn[i] = elem) );
							}
						}
						postFinder( null, (matcherOut = []), temp, xml );
					}
	
					// Move matched elements from seed to results to keep them synchronized
					i = matcherOut.length;
					while ( i-- ) {
						if ( (elem = matcherOut[i]) &&
							(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
	
							seed[temp] = !(results[temp] = elem);
						}
					}
				}
	
			// Add elements to results, through postFinder if defined
			} else {
				matcherOut = condense(
					matcherOut === results ?
						matcherOut.splice( preexisting, matcherOut.length ) :
						matcherOut
				);
				if ( postFinder ) {
					postFinder( null, results, matcherOut, xml );
				} else {
					push.apply( results, matcherOut );
				}
			}
		});
	}
	
	function matcherFromTokens( tokens ) {
		var checkContext, matcher, j,
			len = tokens.length,
			leadingRelative = Expr.relative[ tokens[0].type ],
			implicitRelative = leadingRelative || Expr.relative[" "],
			i = leadingRelative ? 1 : 0,
	
			// The foundational matcher ensures that elements are reachable from top-level context(s)
			matchContext = addCombinator( function( elem ) {
				return elem === checkContext;
			}, implicitRelative, true ),
			matchAnyContext = addCombinator( function( elem ) {
				return indexOf( checkContext, elem ) > -1;
			}, implicitRelative, true ),
			matchers = [ function( elem, context, xml ) {
				var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
					(checkContext = context).nodeType ?
						matchContext( elem, context, xml ) :
						matchAnyContext( elem, context, xml ) );
				// Avoid hanging onto element (issue #299)
				checkContext = null;
				return ret;
			} ];
	
		for ( ; i < len; i++ ) {
			if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
				matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
			} else {
				matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
	
				// Return special upon seeing a positional matcher
				if ( matcher[ expando ] ) {
					// Find the next relative operator (if any) for proper handling
					j = ++i;
					for ( ; j < len; j++ ) {
						if ( Expr.relative[ tokens[j].type ] ) {
							break;
						}
					}
					return setMatcher(
						i > 1 && elementMatcher( matchers ),
						i > 1 && toSelector(
							// If the preceding token was a descendant combinator, insert an implicit any-element `*`
							tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
						).replace( rtrim, "$1" ),
						matcher,
						i < j && matcherFromTokens( tokens.slice( i, j ) ),
						j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
						j < len && toSelector( tokens )
					);
				}
				matchers.push( matcher );
			}
		}
	
		return elementMatcher( matchers );
	}
	
	function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
		var bySet = setMatchers.length > 0,
			byElement = elementMatchers.length > 0,
			superMatcher = function( seed, context, xml, results, outermost ) {
				var elem, j, matcher,
					matchedCount = 0,
					i = "0",
					unmatched = seed && [],
					setMatched = [],
					contextBackup = outermostContext,
					// We must always have either seed elements or outermost context
					elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
					// Use integer dirruns iff this is the outermost matcher
					dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
					len = elems.length;
	
				if ( outermost ) {
					outermostContext = context === document || context || outermost;
				}
	
				// Add elements passing elementMatchers directly to results
				// Support: IE<9, Safari
				// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
				for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
					if ( byElement && elem ) {
						j = 0;
						if ( !context && elem.ownerDocument !== document ) {
							setDocument( elem );
							xml = !documentIsHTML;
						}
						while ( (matcher = elementMatchers[j++]) ) {
							if ( matcher( elem, context || document, xml) ) {
								results.push( elem );
								break;
							}
						}
						if ( outermost ) {
							dirruns = dirrunsUnique;
						}
					}
	
					// Track unmatched elements for set filters
					if ( bySet ) {
						// They will have gone through all possible matchers
						if ( (elem = !matcher && elem) ) {
							matchedCount--;
						}
	
						// Lengthen the array for every element, matched or not
						if ( seed ) {
							unmatched.push( elem );
						}
					}
				}
	
				// `i` is now the count of elements visited above, and adding it to `matchedCount`
				// makes the latter nonnegative.
				matchedCount += i;
	
				// Apply set filters to unmatched elements
				// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
				// equals `i`), unless we didn't visit _any_ elements in the above loop because we have
				// no element matchers and no seed.
				// Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
				// case, which will result in a "00" `matchedCount` that differs from `i` but is also
				// numerically zero.
				if ( bySet && i !== matchedCount ) {
					j = 0;
					while ( (matcher = setMatchers[j++]) ) {
						matcher( unmatched, setMatched, context, xml );
					}
	
					if ( seed ) {
						// Reintegrate element matches to eliminate the need for sorting
						if ( matchedCount > 0 ) {
							while ( i-- ) {
								if ( !(unmatched[i] || setMatched[i]) ) {
									setMatched[i] = pop.call( results );
								}
							}
						}
	
						// Discard index placeholder values to get only actual matches
						setMatched = condense( setMatched );
					}
	
					// Add matches to results
					push.apply( results, setMatched );
	
					// Seedless set matches succeeding multiple successful matchers stipulate sorting
					if ( outermost && !seed && setMatched.length > 0 &&
						( matchedCount + setMatchers.length ) > 1 ) {
	
						Sizzle.uniqueSort( results );
					}
				}
	
				// Override manipulation of globals by nested matchers
				if ( outermost ) {
					dirruns = dirrunsUnique;
					outermostContext = contextBackup;
				}
	
				return unmatched;
			};
	
		return bySet ?
			markFunction( superMatcher ) :
			superMatcher;
	}
	
	compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
		var i,
			setMatchers = [],
			elementMatchers = [],
			cached = compilerCache[ selector + " " ];
	
		if ( !cached ) {
			// Generate a function of recursive functions that can be used to check each element
			if ( !match ) {
				match = tokenize( selector );
			}
			i = match.length;
			while ( i-- ) {
				cached = matcherFromTokens( match[i] );
				if ( cached[ expando ] ) {
					setMatchers.push( cached );
				} else {
					elementMatchers.push( cached );
				}
			}
	
			// Cache the compiled function
			cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
	
			// Save selector and tokenization
			cached.selector = selector;
		}
		return cached;
	};
	
	/**
	 * A low-level selection function that works with Sizzle's compiled
	 *  selector functions
	 * @param {String|Function} selector A selector or a pre-compiled
	 *  selector function built with Sizzle.compile
	 * @param {Element} context
	 * @param {Array} [results]
	 * @param {Array} [seed] A set of elements to match against
	 */
	select = Sizzle.select = function( selector, context, results, seed ) {
		var i, tokens, token, type, find,
			compiled = typeof selector === "function" && selector,
			match = !seed && tokenize( (selector = compiled.selector || selector) );
	
		results = results || [];
	
		// Try to minimize operations if there is only one selector in the list and no seed
		// (the latter of which guarantees us context)
		if ( match.length === 1 ) {
	
			// Reduce context if the leading compound selector is an ID
			tokens = match[0] = match[0].slice( 0 );
			if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
					context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
	
				context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
				if ( !context ) {
					return results;
	
				// Precompiled matchers will still verify ancestry, so step up a level
				} else if ( compiled ) {
					context = context.parentNode;
				}
	
				selector = selector.slice( tokens.shift().value.length );
			}
	
			// Fetch a seed set for right-to-left matching
			i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
			while ( i-- ) {
				token = tokens[i];
	
				// Abort if we hit a combinator
				if ( Expr.relative[ (type = token.type) ] ) {
					break;
				}
				if ( (find = Expr.find[ type ]) ) {
					// Search, expanding context for leading sibling combinators
					if ( (seed = find(
						token.matches[0].replace( runescape, funescape ),
						rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
					)) ) {
	
						// If seed is empty or no tokens remain, we can return early
						tokens.splice( i, 1 );
						selector = seed.length && toSelector( tokens );
						if ( !selector ) {
							push.apply( results, seed );
							return results;
						}
	
						break;
					}
				}
			}
		}
	
		// Compile and execute a filtering function if one is not provided
		// Provide `match` to avoid retokenization if we modified the selector above
		( compiled || compile( selector, match ) )(
			seed,
			context,
			!documentIsHTML,
			results,
			!context || rsibling.test( selector ) && testContext( context.parentNode ) || context
		);
		return results;
	};
	
	// One-time assignments
	
	// Sort stability
	support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
	
	// Support: Chrome 14-35+
	// Always assume duplicates if they aren't passed to the comparison function
	support.detectDuplicates = !!hasDuplicate;
	
	// Initialize against the default document
	setDocument();
	
	// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
	// Detached nodes confoundingly follow *each other*
	support.sortDetached = assert(function( el ) {
		// Should return 1, but returns 4 (following)
		return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
	});
	
	// Support: IE<8
	// Prevent attribute/property "interpolation"
	// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
	if ( !assert(function( el ) {
		el.innerHTML = "<a href='#'></a>";
		return el.firstChild.getAttribute("href") === "#" ;
	}) ) {
		addHandle( "type|href|height|width", function( elem, name, isXML ) {
			if ( !isXML ) {
				return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
			}
		});
	}
	
	// Support: IE<9
	// Use defaultValue in place of getAttribute("value")
	if ( !support.attributes || !assert(function( el ) {
		el.innerHTML = "<input/>";
		el.firstChild.setAttribute( "value", "" );
		return el.firstChild.getAttribute( "value" ) === "";
	}) ) {
		addHandle( "value", function( elem, name, isXML ) {
			if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
				return elem.defaultValue;
			}
		});
	}
	
	// Support: IE<9
	// Use getAttributeNode to fetch booleans when getAttribute lies
	if ( !assert(function( el ) {
		return el.getAttribute("disabled") == null;
	}) ) {
		addHandle( booleans, function( elem, name, isXML ) {
			var val;
			if ( !isXML ) {
				return elem[ name ] === true ? name.toLowerCase() :
						(val = elem.getAttributeNode( name )) && val.specified ?
						val.value :
					null;
			}
		});
	}
	
	return Sizzle;
	
	})( window );
	
	
	
	jQuery.find = Sizzle;
	jQuery.expr = Sizzle.selectors;
	
	// Deprecated
	jQuery.expr[ ":" ] = jQuery.expr.pseudos;
	jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
	jQuery.text = Sizzle.getText;
	jQuery.isXMLDoc = Sizzle.isXML;
	jQuery.contains = Sizzle.contains;
	jQuery.escapeSelector = Sizzle.escape;
	
	
	
	
	var dir = function( elem, dir, until ) {
		var matched = [],
			truncate = until !== undefined;
	
		while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
			if ( elem.nodeType === 1 ) {
				if ( truncate && jQuery( elem ).is( until ) ) {
					break;
				}
				matched.push( elem );
			}
		}
		return matched;
	};
	
	
	var siblings = function( n, elem ) {
		var matched = [];
	
		for ( ; n; n = n.nextSibling ) {
			if ( n.nodeType === 1 && n !== elem ) {
				matched.push( n );
			}
		}
	
		return matched;
	};
	
	
	var rneedsContext = jQuery.expr.match.needsContext;
	
	
	
	function nodeName( elem, name ) {
	
	  return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
	
	};
	var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
	
	
	
	var risSimple = /^.[^:#\[\.,]*$/;
	
	// Implement the identical functionality for filter and not
	function winnow( elements, qualifier, not ) {
		if ( jQuery.isFunction( qualifier ) ) {
			return jQuery.grep( elements, function( elem, i ) {
				return !!qualifier.call( elem, i, elem ) !== not;
			} );
		}
	
		// Single element
		if ( qualifier.nodeType ) {
			return jQuery.grep( elements, function( elem ) {
				return ( elem === qualifier ) !== not;
			} );
		}
	
		// Arraylike of elements (jQuery, arguments, Array)
		if ( typeof qualifier !== "string" ) {
			return jQuery.grep( elements, function( elem ) {
				return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
			} );
		}
	
		// Simple selector that can be filtered directly, removing non-Elements
		if ( risSimple.test( qualifier ) ) {
			return jQuery.filter( qualifier, elements, not );
		}
	
		// Complex selector, compare the two sets, removing non-Elements
		qualifier = jQuery.filter( qualifier, elements );
		return jQuery.grep( elements, function( elem ) {
			return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
		} );
	}
	
	jQuery.filter = function( expr, elems, not ) {
		var elem = elems[ 0 ];
	
		if ( not ) {
			expr = ":not(" + expr + ")";
		}
	
		if ( elems.length === 1 && elem.nodeType === 1 ) {
			return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
		}
	
		return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
			return elem.nodeType === 1;
		} ) );
	};
	
	jQuery.fn.extend( {
		find: function( selector ) {
			var i, ret,
				len = this.length,
				self = this;
	
			if ( typeof selector !== "string" ) {
				return this.pushStack( jQuery( selector ).filter( function() {
					for ( i = 0; i < len; i++ ) {
						if ( jQuery.contains( self[ i ], this ) ) {
							return true;
						}
					}
				} ) );
			}
	
			ret = this.pushStack( [] );
	
			for ( i = 0; i < len; i++ ) {
				jQuery.find( selector, self[ i ], ret );
			}
	
			return len > 1 ? jQuery.uniqueSort( ret ) : ret;
		},
		filter: function( selector ) {
			return this.pushStack( winnow( this, selector || [], false ) );
		},
		not: function( selector ) {
			return this.pushStack( winnow( this, selector || [], true ) );
		},
		is: function( selector ) {
			return !!winnow(
				this,
	
				// If this is a positional/relative selector, check membership in the returned set
				// so $("p:first").is("p:last") won't return true for a doc with two "p".
				typeof selector === "string" && rneedsContext.test( selector ) ?
					jQuery( selector ) :
					selector || [],
				false
			).length;
		}
	} );
	
	
	// Initialize a jQuery object
	
	
	// A central reference to the root jQuery(document)
	var rootjQuery,
	
		// A simple way to check for HTML strings
		// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
		// Strict HTML recognition (#11290: must start with <)
		// Shortcut simple #id case for speed
		rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
	
		init = jQuery.fn.init = function( selector, context, root ) {
			var match, elem;
	
			// HANDLE: $(""), $(null), $(undefined), $(false)
			if ( !selector ) {
				return this;
			}
	
			// Method init() accepts an alternate rootjQuery
			// so migrate can support jQuery.sub (gh-2101)
			root = root || rootjQuery;
	
			// Handle HTML strings
			if ( typeof selector === "string" ) {
				if ( selector[ 0 ] === "<" &&
					selector[ selector.length - 1 ] === ">" &&
					selector.length >= 3 ) {
	
					// Assume that strings that start and end with <> are HTML and skip the regex check
					match = [ null, selector, null ];
	
				} else {
					match = rquickExpr.exec( selector );
				}
	
				// Match html or make sure no context is specified for #id
				if ( match && ( match[ 1 ] || !context ) ) {
	
					// HANDLE: $(html) -> $(array)
					if ( match[ 1 ] ) {
						context = context instanceof jQuery ? context[ 0 ] : context;
	
						// Option to run scripts is true for back-compat
						// Intentionally let the error be thrown if parseHTML is not present
						jQuery.merge( this, jQuery.parseHTML(
							match[ 1 ],
							context && context.nodeType ? context.ownerDocument || context : document,
							true
						) );
	
						// HANDLE: $(html, props)
						if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
							for ( match in context ) {
	
								// Properties of context are called as methods if possible
								if ( jQuery.isFunction( this[ match ] ) ) {
									this[ match ]( context[ match ] );
	
								// ...and otherwise set as attributes
								} else {
									this.attr( match, context[ match ] );
								}
							}
						}
	
						return this;
	
					// HANDLE: $(#id)
					} else {
						elem = document.getElementById( match[ 2 ] );
	
						if ( elem ) {
	
							// Inject the element directly into the jQuery object
							this[ 0 ] = elem;
							this.length = 1;
						}
						return this;
					}
	
				// HANDLE: $(expr, $(...))
				} else if ( !context || context.jquery ) {
					return ( context || root ).find( selector );
	
				// HANDLE: $(expr, context)
				// (which is just equivalent to: $(context).find(expr)
				} else {
					return this.constructor( context ).find( selector );
				}
	
			// HANDLE: $(DOMElement)
			} else if ( selector.nodeType ) {
				this[ 0 ] = selector;
				this.length = 1;
				return this;
	
			// HANDLE: $(function)
			// Shortcut for document ready
			} else if ( jQuery.isFunction( selector ) ) {
				return root.ready !== undefined ?
					root.ready( selector ) :
	
					// Execute immediately if ready is not present
					selector( jQuery );
			}
	
			return jQuery.makeArray( selector, this );
		};
	
	// Give the init function the jQuery prototype for later instantiation
	init.prototype = jQuery.fn;
	
	// Initialize central reference
	rootjQuery = jQuery( document );
	
	
	var rparentsprev = /^(?:parents|prev(?:Until|All))/,
	
		// Methods guaranteed to produce a unique set when starting from a unique set
		guaranteedUnique = {
			children: true,
			contents: true,
			next: true,
			prev: true
		};
	
	jQuery.fn.extend( {
		has: function( target ) {
			var targets = jQuery( target, this ),
				l = targets.length;
	
			return this.filter( function() {
				var i = 0;
				for ( ; i < l; i++ ) {
					if ( jQuery.contains( this, targets[ i ] ) ) {
						return true;
					}
				}
			} );
		},
	
		closest: function( selectors, context ) {
			var cur,
				i = 0,
				l = this.length,
				matched = [],
				targets = typeof selectors !== "string" && jQuery( selectors );
	
			// Positional selectors never match, since there's no _selection_ context
			if ( !rneedsContext.test( selectors ) ) {
				for ( ; i < l; i++ ) {
					for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
	
						// Always skip document fragments
						if ( cur.nodeType < 11 && ( targets ?
							targets.index( cur ) > -1 :
	
							// Don't pass non-elements to Sizzle
							cur.nodeType === 1 &&
								jQuery.find.matchesSelector( cur, selectors ) ) ) {
	
							matched.push( cur );
							break;
						}
					}
				}
			}
	
			return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
		},
	
		// Determine the position of an element within the set
		index: function( elem ) {
	
			// No argument, return index in parent
			if ( !elem ) {
				return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
			}
	
			// Index in selector
			if ( typeof elem === "string" ) {
				return indexOf.call( jQuery( elem ), this[ 0 ] );
			}
	
			// Locate the position of the desired element
			return indexOf.call( this,
	
				// If it receives a jQuery object, the first element is used
				elem.jquery ? elem[ 0 ] : elem
			);
		},
	
		add: function( selector, context ) {
			return this.pushStack(
				jQuery.uniqueSort(
					jQuery.merge( this.get(), jQuery( selector, context ) )
				)
			);
		},
	
		addBack: function( selector ) {
			return this.add( selector == null ?
				this.prevObject : this.prevObject.filter( selector )
			);
		}
	} );
	
	function sibling( cur, dir ) {
		while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
		return cur;
	}
	
	jQuery.each( {
		parent: function( elem ) {
			var parent = elem.parentNode;
			return parent && parent.nodeType !== 11 ? parent : null;
		},
		parents: function( elem ) {
			return dir( elem, "parentNode" );
		},
		parentsUntil: function( elem, i, until ) {
			return dir( elem, "parentNode", until );
		},
		next: function( elem ) {
			return sibling( elem, "nextSibling" );
		},
		prev: function( elem ) {
			return sibling( elem, "previousSibling" );
		},
		nextAll: function( elem ) {
			return dir( elem, "nextSibling" );
		},
		prevAll: function( elem ) {
			return dir( elem, "previousSibling" );
		},
		nextUntil: function( elem, i, until ) {
			return dir( elem, "nextSibling", until );
		},
		prevUntil: function( elem, i, until ) {
			return dir( elem, "previousSibling", until );
		},
		siblings: function( elem ) {
			return siblings( ( elem.parentNode || {} ).firstChild, elem );
		},
		children: function( elem ) {
			return siblings( elem.firstChild );
		},
		contents: function( elem ) {
	        if ( nodeName( elem, "iframe" ) ) {
	            return elem.contentDocument;
	        }
	
	        // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
	        // Treat the template element as a regular one in browsers that
	        // don't support it.
	        if ( nodeName( elem, "template" ) ) {
	            elem = elem.content || elem;
	        }
	
	        return jQuery.merge( [], elem.childNodes );
		}
	}, function( name, fn ) {
		jQuery.fn[ name ] = function( until, selector ) {
			var matched = jQuery.map( this, fn, until );
	
			if ( name.slice( -5 ) !== "Until" ) {
				selector = until;
			}
	
			if ( selector && typeof selector === "string" ) {
				matched = jQuery.filter( selector, matched );
			}
	
			if ( this.length > 1 ) {
	
				// Remove duplicates
				if ( !guaranteedUnique[ name ] ) {
					jQuery.uniqueSort( matched );
				}
	
				// Reverse order for parents* and prev-derivatives
				if ( rparentsprev.test( name ) ) {
					matched.reverse();
				}
			}
	
			return this.pushStack( matched );
		};
	} );
	var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
	
	
	
	// Convert String-formatted options into Object-formatted ones
	function createOptions( options ) {
		var object = {};
		jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
			object[ flag ] = true;
		} );
		return object;
	}
	
	/*
	 * Create a callback list using the following parameters:
	 *
	 *	options: an optional list of space-separated options that will change how
	 *			the callback list behaves or a more traditional option object
	 *
	 * By default a callback list will act like an event callback list and can be
	 * "fired" multiple times.
	 *
	 * Possible options:
	 *
	 *	once:			will ensure the callback list can only be fired once (like a Deferred)
	 *
	 *	memory:			will keep track of previous values and will call any callback added
	 *					after the list has been fired right away with the latest "memorized"
	 *					values (like a Deferred)
	 *
	 *	unique:			will ensure a callback can only be added once (no duplicate in the list)
	 *
	 *	stopOnFalse:	interrupt callings when a callback returns false
	 *
	 */
	jQuery.Callbacks = function( options ) {
	
		// Convert options from String-formatted to Object-formatted if needed
		// (we check in cache first)
		options = typeof options === "string" ?
			createOptions( options ) :
			jQuery.extend( {}, options );
	
		var // Flag to know if list is currently firing
			firing,
	
			// Last fire value for non-forgettable lists
			memory,
	
			// Flag to know if list was already fired
			fired,
	
			// Flag to prevent firing
			locked,
	
			// Actual callback list
			list = [],
	
			// Queue of execution data for repeatable lists
			queue = [],
	
			// Index of currently firing callback (modified by add/remove as needed)
			firingIndex = -1,
	
			// Fire callbacks
			fire = function() {
	
				// Enforce single-firing
				locked = locked || options.once;
	
				// Execute callbacks for all pending executions,
				// respecting firingIndex overrides and runtime changes
				fired = firing = true;
				for ( ; queue.length; firingIndex = -1 ) {
					memory = queue.shift();
					while ( ++firingIndex < list.length ) {
	
						// Run callback and check for early termination
						if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
							options.stopOnFalse ) {
	
							// Jump to end and forget the data so .add doesn't re-fire
							firingIndex = list.length;
							memory = false;
						}
					}
				}
	
				// Forget the data if we're done with it
				if ( !options.memory ) {
					memory = false;
				}
	
				firing = false;
	
				// Clean up if we're done firing for good
				if ( locked ) {
	
					// Keep an empty list if we have data for future add calls
					if ( memory ) {
						list = [];
	
					// Otherwise, this object is spent
					} else {
						list = "";
					}
				}
			},
	
			// Actual Callbacks object
			self = {
	
				// Add a callback or a collection of callbacks to the list
				add: function() {
					if ( list ) {
	
						// If we have memory from a past run, we should fire after adding
						if ( memory && !firing ) {
							firingIndex = list.length - 1;
							queue.push( memory );
						}
	
						( function add( args ) {
							jQuery.each( args, function( _, arg ) {
								if ( jQuery.isFunction( arg ) ) {
									if ( !options.unique || !self.has( arg ) ) {
										list.push( arg );
									}
								} else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
	
									// Inspect recursively
									add( arg );
								}
							} );
						} )( arguments );
	
						if ( memory && !firing ) {
							fire();
						}
					}
					return this;
				},
	
				// Remove a callback from the list
				remove: function() {
					jQuery.each( arguments, function( _, arg ) {
						var index;
						while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
							list.splice( index, 1 );
	
							// Handle firing indexes
							if ( index <= firingIndex ) {
								firingIndex--;
							}
						}
					} );
					return this;
				},
	
				// Check if a given callback is in the list.
				// If no argument is given, return whether or not list has callbacks attached.
				has: function( fn ) {
					return fn ?
						jQuery.inArray( fn, list ) > -1 :
						list.length > 0;
				},
	
				// Remove all callbacks from the list
				empty: function() {
					if ( list ) {
						list = [];
					}
					return this;
				},
	
				// Disable .fire and .add
				// Abort any current/pending executions
				// Clear all callbacks and values
				disable: function() {
					locked = queue = [];
					list = memory = "";
					return this;
				},
				disabled: function() {
					return !list;
				},
	
				// Disable .fire
				// Also disable .add unless we have memory (since it would have no effect)
				// Abort any pending executions
				lock: function() {
					locked = queue = [];
					if ( !memory && !firing ) {
						list = memory = "";
					}
					return this;
				},
				locked: function() {
					return !!locked;
				},
	
				// Call all callbacks with the given context and arguments
				fireWith: function( context, args ) {
					if ( !locked ) {
						args = args || [];
						args = [ context, args.slice ? args.slice() : args ];
						queue.push( args );
						if ( !firing ) {
							fire();
						}
					}
					return this;
				},
	
				// Call all the callbacks with the given arguments
				fire: function() {
					self.fireWith( this, arguments );
					return this;
				},
	
				// To know if the callbacks have already been called at least once
				fired: function() {
					return !!fired;
				}
			};
	
		return self;
	};
	
	
	function Identity( v ) {
		return v;
	}
	function Thrower( ex ) {
		throw ex;
	}
	
	function adoptValue( value, resolve, reject, noValue ) {
		var method;
	
		try {
	
			// Check for promise aspect first to privilege synchronous behavior
			if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
				method.call( value ).done( resolve ).fail( reject );
	
			// Other thenables
			} else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
				method.call( value, resolve, reject );
	
			// Other non-thenables
			} else {
	
				// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
				// * false: [ value ].slice( 0 ) => resolve( value )
				// * true: [ value ].slice( 1 ) => resolve()
				resolve.apply( undefined, [ value ].slice( noValue ) );
			}
	
		// For Promises/A+, convert exceptions into rejections
		// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
		// Deferred#then to conditionally suppress rejection.
		} catch ( value ) {
	
			// Support: Android 4.0 only
			// Strict mode functions invoked without .call/.apply get global-object context
			reject.apply( undefined, [ value ] );
		}
	}
	
	jQuery.extend( {
	
		Deferred: function( func ) {
			var tuples = [
	
					// action, add listener, callbacks,
					// ... .then handlers, argument index, [final state]
					[ "notify", "progress", jQuery.Callbacks( "memory" ),
						jQuery.Callbacks( "memory" ), 2 ],
					[ "resolve", "done", jQuery.Callbacks( "once memory" ),
						jQuery.Callbacks( "once memory" ), 0, "resolved" ],
					[ "reject", "fail", jQuery.Callbacks( "once memory" ),
						jQuery.Callbacks( "once memory" ), 1, "rejected" ]
				],
				state = "pending",
				promise = {
					state: function() {
						return state;
					},
					always: function() {
						deferred.done( arguments ).fail( arguments );
						return this;
					},
					"catch": function( fn ) {
						return promise.then( null, fn );
					},
	
					// Keep pipe for back-compat
					pipe: function( /* fnDone, fnFail, fnProgress */ ) {
						var fns = arguments;
	
						return jQuery.Deferred( function( newDefer ) {
							jQuery.each( tuples, function( i, tuple ) {
	
								// Map tuples (progress, done, fail) to arguments (done, fail, progress)
								var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
	
								// deferred.progress(function() { bind to newDefer or newDefer.notify })
								// deferred.done(function() { bind to newDefer or newDefer.resolve })
								// deferred.fail(function() { bind to newDefer or newDefer.reject })
								deferred[ tuple[ 1 ] ]( function() {
									var returned = fn && fn.apply( this, arguments );
									if ( returned && jQuery.isFunction( returned.promise ) ) {
										returned.promise()
											.progress( newDefer.notify )
											.done( newDefer.resolve )
											.fail( newDefer.reject );
									} else {
										newDefer[ tuple[ 0 ] + "With" ](
											this,
											fn ? [ returned ] : arguments
										);
									}
								} );
							} );
							fns = null;
						} ).promise();
					},
					then: function( onFulfilled, onRejected, onProgress ) {
						var maxDepth = 0;
						function resolve( depth, deferred, handler, special ) {
							return function() {
								var that = this,
									args = arguments,
									mightThrow = function() {
										var returned, then;
	
										// Support: Promises/A+ section 2.3.3.3.3
										// https://promisesaplus.com/#point-59
										// Ignore double-resolution attempts
										if ( depth < maxDepth ) {
											return;
										}
	
										returned = handler.apply( that, args );
	
										// Support: Promises/A+ section 2.3.1
										// https://promisesaplus.com/#point-48
										if ( returned === deferred.promise() ) {
											throw new TypeError( "Thenable self-resolution" );
										}
	
										// Support: Promises/A+ sections 2.3.3.1, 3.5
										// https://promisesaplus.com/#point-54
										// https://promisesaplus.com/#point-75
										// Retrieve `then` only once
										then = returned &&
	
											// Support: Promises/A+ section 2.3.4
											// https://promisesaplus.com/#point-64
											// Only check objects and functions for thenability
											( typeof returned === "object" ||
												typeof returned === "function" ) &&
											returned.then;
	
										// Handle a returned thenable
										if ( jQuery.isFunction( then ) ) {
	
											// Special processors (notify) just wait for resolution
											if ( special ) {
												then.call(
													returned,
													resolve( maxDepth, deferred, Identity, special ),
													resolve( maxDepth, deferred, Thrower, special )
												);
	
											// Normal processors (resolve) also hook into progress
											} else {
	
												// ...and disregard older resolution values
												maxDepth++;
	
												then.call(
													returned,
													resolve( maxDepth, deferred, Identity, special ),
													resolve( maxDepth, deferred, Thrower, special ),
													resolve( maxDepth, deferred, Identity,
														deferred.notifyWith )
												);
											}
	
										// Handle all other returned values
										} else {
	
											// Only substitute handlers pass on context
											// and multiple values (non-spec behavior)
											if ( handler !== Identity ) {
												that = undefined;
												args = [ returned ];
											}
	
											// Process the value(s)
											// Default process is resolve
											( special || deferred.resolveWith )( that, args );
										}
									},
	
									// Only normal processors (resolve) catch and reject exceptions
									process = special ?
										mightThrow :
										function() {
											try {
												mightThrow();
											} catch ( e ) {
	
												if ( jQuery.Deferred.exceptionHook ) {
													jQuery.Deferred.exceptionHook( e,
														process.stackTrace );
												}
	
												// Support: Promises/A+ section 2.3.3.3.4.1
												// https://promisesaplus.com/#point-61
												// Ignore post-resolution exceptions
												if ( depth + 1 >= maxDepth ) {
	
													// Only substitute handlers pass on context
													// and multiple values (non-spec behavior)
													if ( handler !== Thrower ) {
														that = undefined;
														args = [ e ];
													}
	
													deferred.rejectWith( that, args );
												}
											}
										};
	
								// Support: Promises/A+ section 2.3.3.3.1
								// https://promisesaplus.com/#point-57
								// Re-resolve promises immediately to dodge false rejection from
								// subsequent errors
								if ( depth ) {
									process();
								} else {
	
									// Call an optional hook to record the stack, in case of exception
									// since it's otherwise lost when execution goes async
									if ( jQuery.Deferred.getStackHook ) {
										process.stackTrace = jQuery.Deferred.getStackHook();
									}
									window.setTimeout( process );
								}
							};
						}
	
						return jQuery.Deferred( function( newDefer ) {
	
							// progress_handlers.add( ... )
							tuples[ 0 ][ 3 ].add(
								resolve(
									0,
									newDefer,
									jQuery.isFunction( onProgress ) ?
										onProgress :
										Identity,
									newDefer.notifyWith
								)
							);
	
							// fulfilled_handlers.add( ... )
							tuples[ 1 ][ 3 ].add(
								resolve(
									0,
									newDefer,
									jQuery.isFunction( onFulfilled ) ?
										onFulfilled :
										Identity
								)
							);
	
							// rejected_handlers.add( ... )
							tuples[ 2 ][ 3 ].add(
								resolve(
									0,
									newDefer,
									jQuery.isFunction( onRejected ) ?
										onRejected :
										Thrower
								)
							);
						} ).promise();
					},
	
					// Get a promise for this deferred
					// If obj is provided, the promise aspect is added to the object
					promise: function( obj ) {
						return obj != null ? jQuery.extend( obj, promise ) : promise;
					}
				},
				deferred = {};
	
			// Add list-specific methods
			jQuery.each( tuples, function( i, tuple ) {
				var list = tuple[ 2 ],
					stateString = tuple[ 5 ];
	
				// promise.progress = list.add
				// promise.done = list.add
				// promise.fail = list.add
				promise[ tuple[ 1 ] ] = list.add;
	
				// Handle state
				if ( stateString ) {
					list.add(
						function() {
	
							// state = "resolved" (i.e., fulfilled)
							// state = "rejected"
							state = stateString;
						},
	
						// rejected_callbacks.disable
						// fulfilled_callbacks.disable
						tuples[ 3 - i ][ 2 ].disable,
	
						// progress_callbacks.lock
						tuples[ 0 ][ 2 ].lock
					);
				}
	
				// progress_handlers.fire
				// fulfilled_handlers.fire
				// rejected_handlers.fire
				list.add( tuple[ 3 ].fire );
	
				// deferred.notify = function() { deferred.notifyWith(...) }
				// deferred.resolve = function() { deferred.resolveWith(...) }
				// deferred.reject = function() { deferred.rejectWith(...) }
				deferred[ tuple[ 0 ] ] = function() {
					deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
					return this;
				};
	
				// deferred.notifyWith = list.fireWith
				// deferred.resolveWith = list.fireWith
				// deferred.rejectWith = list.fireWith
				deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
			} );
	
			// Make the deferred a promise
			promise.promise( deferred );
	
			// Call given func if any
			if ( func ) {
				func.call( deferred, deferred );
			}
	
			// All done!
			return deferred;
		},
	
		// Deferred helper
		when: function( singleValue ) {
			var
	
				// count of uncompleted subordinates
				remaining = arguments.length,
	
				// count of unprocessed arguments
				i = remaining,
	
				// subordinate fulfillment data
				resolveContexts = Array( i ),
				resolveValues = slice.call( arguments ),
	
				// the master Deferred
				master = jQuery.Deferred(),
	
				// subordinate callback factory
				updateFunc = function( i ) {
					return function( value ) {
						resolveContexts[ i ] = this;
						resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
						if ( !( --remaining ) ) {
							master.resolveWith( resolveContexts, resolveValues );
						}
					};
				};
	
			// Single- and empty arguments are adopted like Promise.resolve
			if ( remaining <= 1 ) {
				adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
					!remaining );
	
				// Use .then() to unwrap secondary thenables (cf. gh-3000)
				if ( master.state() === "pending" ||
					jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
	
					return master.then();
				}
			}
	
			// Multiple arguments are aggregated like Promise.all array elements
			while ( i-- ) {
				adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
			}
	
			return master.promise();
		}
	} );
	
	
	// These usually indicate a programmer mistake during development,
	// warn about them ASAP rather than swallowing them by default.
	var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
	
	jQuery.Deferred.exceptionHook = function( error, stack ) {
	
		// Support: IE 8 - 9 only
		// Console exists when dev tools are open, which can happen at any time
		if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
			window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
		}
	};
	
	
	
	
	jQuery.readyException = function( error ) {
		window.setTimeout( function() {
			throw error;
		} );
	};
	
	
	
	
	// The deferred used on DOM ready
	var readyList = jQuery.Deferred();
	
	jQuery.fn.ready = function( fn ) {
	
		readyList
			.then( fn )
	
			// Wrap jQuery.readyException in a function so that the lookup
			// happens at the time of error handling instead of callback
			// registration.
			.catch( function( error ) {
				jQuery.readyException( error );
			} );
	
		return this;
	};
	
	jQuery.extend( {
	
		// Is the DOM ready to be used? Set to true once it occurs.
		isReady: false,
	
		// A counter to track how many items to wait for before
		// the ready event fires. See #6781
		readyWait: 1,
	
		// Handle when the DOM is ready
		ready: function( wait ) {
	
			// Abort if there are pending holds or we're already ready
			if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
				return;
			}
	
			// Remember that the DOM is ready
			jQuery.isReady = true;
	
			// If a normal DOM Ready event fired, decrement, and wait if need be
			if ( wait !== true && --jQuery.readyWait > 0 ) {
				return;
			}
	
			// If there are functions bound, to execute
			readyList.resolveWith( document, [ jQuery ] );
		}
	} );
	
	jQuery.ready.then = readyList.then;
	
	// The ready event handler and self cleanup method
	function completed() {
		document.removeEventListener( "DOMContentLoaded", completed );
		window.removeEventListener( "load", completed );
		jQuery.ready();
	}
	
	// Catch cases where $(document).ready() is called
	// after the browser event has already occurred.
	// Support: IE <=9 - 10 only
	// Older IE sometimes signals "interactive" too soon
	if ( document.readyState === "complete" ||
		( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
	
		// Handle it asynchronously to allow scripts the opportunity to delay ready
		window.setTimeout( jQuery.ready );
	
	} else {
	
		// Use the handy event callback
		document.addEventListener( "DOMContentLoaded", completed );
	
		// A fallback to window.onload, that will always work
		window.addEventListener( "load", completed );
	}
	
	
	
	
	// Multifunctional method to get and set values of a collection
	// The value/s can optionally be executed if it's a function
	var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
		var i = 0,
			len = elems.length,
			bulk = key == null;
	
		// Sets many values
		if ( jQuery.type( key ) === "object" ) {
			chainable = true;
			for ( i in key ) {
				access( elems, fn, i, key[ i ], true, emptyGet, raw );
			}
	
		// Sets one value
		} else if ( value !== undefined ) {
			chainable = true;
	
			if ( !jQuery.isFunction( value ) ) {
				raw = true;
			}
	
			if ( bulk ) {
	
				// Bulk operations run against the entire set
				if ( raw ) {
					fn.call( elems, value );
					fn = null;
	
				// ...except when executing function values
				} else {
					bulk = fn;
					fn = function( elem, key, value ) {
						return bulk.call( jQuery( elem ), value );
					};
				}
			}
	
			if ( fn ) {
				for ( ; i < len; i++ ) {
					fn(
						elems[ i ], key, raw ?
						value :
						value.call( elems[ i ], i, fn( elems[ i ], key ) )
					);
				}
			}
		}
	
		if ( chainable ) {
			return elems;
		}
	
		// Gets
		if ( bulk ) {
			return fn.call( elems );
		}
	
		return len ? fn( elems[ 0 ], key ) : emptyGet;
	};
	var acceptData = function( owner ) {
	
		// Accepts only:
		//  - Node
		//    - Node.ELEMENT_NODE
		//    - Node.DOCUMENT_NODE
		//  - Object
		//    - Any
		return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
	};
	
	
	
	
	function Data() {
		this.expando = jQuery.expando + Data.uid++;
	}
	
	Data.uid = 1;
	
	Data.prototype = {
	
		cache: function( owner ) {
	
			// Check if the owner object already has a cache
			var value = owner[ this.expando ];
	
			// If not, create one
			if ( !value ) {
				value = {};
	
				// We can accept data for non-element nodes in modern browsers,
				// but we should not, see #8335.
				// Always return an empty object.
				if ( acceptData( owner ) ) {
	
					// If it is a node unlikely to be stringify-ed or looped over
					// use plain assignment
					if ( owner.nodeType ) {
						owner[ this.expando ] = value;
	
					// Otherwise secure it in a non-enumerable property
					// configurable must be true to allow the property to be
					// deleted when data is removed
					} else {
						Object.defineProperty( owner, this.expando, {
							value: value,
							configurable: true
						} );
					}
				}
			}
	
			return value;
		},
		set: function( owner, data, value ) {
			var prop,
				cache = this.cache( owner );
	
			// Handle: [ owner, key, value ] args
			// Always use camelCase key (gh-2257)
			if ( typeof data === "string" ) {
				cache[ jQuery.camelCase( data ) ] = value;
	
			// Handle: [ owner, { properties } ] args
			} else {
	
				// Copy the properties one-by-one to the cache object
				for ( prop in data ) {
					cache[ jQuery.camelCase( prop ) ] = data[ prop ];
				}
			}
			return cache;
		},
		get: function( owner, key ) {
			return key === undefined ?
				this.cache( owner ) :
	
				// Always use camelCase key (gh-2257)
				owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
		},
		access: function( owner, key, value ) {
	
			// In cases where either:
			//
			//   1. No key was specified
			//   2. A string key was specified, but no value provided
			//
			// Take the "read" path and allow the get method to determine
			// which value to return, respectively either:
			//
			//   1. The entire cache object
			//   2. The data stored at the key
			//
			if ( key === undefined ||
					( ( key && typeof key === "string" ) && value === undefined ) ) {
	
				return this.get( owner, key );
			}
	
			// When the key is not a string, or both a key and value
			// are specified, set or extend (existing objects) with either:
			//
			//   1. An object of properties
			//   2. A key and value
			//
			this.set( owner, key, value );
	
			// Since the "set" path can have two possible entry points
			// return the expected data based on which path was taken[*]
			return value !== undefined ? value : key;
		},
		remove: function( owner, key ) {
			var i,
				cache = owner[ this.expando ];
	
			if ( cache === undefined ) {
				return;
			}
	
			if ( key !== undefined ) {
	
				// Support array or space separated string of keys
				if ( Array.isArray( key ) ) {
	
					// If key is an array of keys...
					// We always set camelCase keys, so remove that.
					key = key.map( jQuery.camelCase );
				} else {
					key = jQuery.camelCase( key );
	
					// If a key with the spaces exists, use it.
					// Otherwise, create an array by matching non-whitespace
					key = key in cache ?
						[ key ] :
						( key.match( rnothtmlwhite ) || [] );
				}
	
				i = key.length;
	
				while ( i-- ) {
					delete cache[ key[ i ] ];
				}
			}
	
			// Remove the expando if there's no more data
			if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
	
				// Support: Chrome <=35 - 45
				// Webkit & Blink performance suffers when deleting properties
				// from DOM nodes, so set to undefined instead
				// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
				if ( owner.nodeType ) {
					owner[ this.expando ] = undefined;
				} else {
					delete owner[ this.expando ];
				}
			}
		},
		hasData: function( owner ) {
			var cache = owner[ this.expando ];
			return cache !== undefined && !jQuery.isEmptyObject( cache );
		}
	};
	var dataPriv = new Data();
	
	var dataUser = new Data();
	
	
	
	//	Implementation Summary
	//
	//	1. Enforce API surface and semantic compatibility with 1.9.x branch
	//	2. Improve the module's maintainability by reducing the storage
	//		paths to a single mechanism.
	//	3. Use the same single mechanism to support "private" and "user" data.
	//	4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
	//	5. Avoid exposing implementation details on user objects (eg. expando properties)
	//	6. Provide a clear path for implementation upgrade to WeakMap in 2014
	
	var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
		rmultiDash = /[A-Z]/g;
	
	function getData( data ) {
		if ( data === "true" ) {
			return true;
		}
	
		if ( data === "false" ) {
			return false;
		}
	
		if ( data === "null" ) {
			return null;
		}
	
		// Only convert to a number if it doesn't change the string
		if ( data === +data + "" ) {
			return +data;
		}
	
		if ( rbrace.test( data ) ) {
			return JSON.parse( data );
		}
	
		return data;
	}
	
	function dataAttr( elem, key, data ) {
		var name;
	
		// If nothing was found internally, try to fetch any
		// data from the HTML5 data-* attribute
		if ( data === undefined && elem.nodeType === 1 ) {
			name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
			data = elem.getAttribute( name );
	
			if ( typeof data === "string" ) {
				try {
					data = getData( data );
				} catch ( e ) {}
	
				// Make sure we set the data so it isn't changed later
				dataUser.set( elem, key, data );
			} else {
				data = undefined;
			}
		}
		return data;
	}
	
	jQuery.extend( {
		hasData: function( elem ) {
			return dataUser.hasData( elem ) || dataPriv.hasData( elem );
		},
	
		data: function( elem, name, data ) {
			return dataUser.access( elem, name, data );
		},
	
		removeData: function( elem, name ) {
			dataUser.remove( elem, name );
		},
	
		// TODO: Now that all calls to _data and _removeData have been replaced
		// with direct calls to dataPriv methods, these can be deprecated.
		_data: function( elem, name, data ) {
			return dataPriv.access( elem, name, data );
		},
	
		_removeData: function( elem, name ) {
			dataPriv.remove( elem, name );
		}
	} );
	
	jQuery.fn.extend( {
		data: function( key, value ) {
			var i, name, data,
				elem = this[ 0 ],
				attrs = elem && elem.attributes;
	
			// Gets all values
			if ( key === undefined ) {
				if ( this.length ) {
					data = dataUser.get( elem );
	
					if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
						i = attrs.length;
						while ( i-- ) {
	
							// Support: IE 11 only
							// The attrs elements can be null (#14894)
							if ( attrs[ i ] ) {
								name = attrs[ i ].name;
								if ( name.indexOf( "data-" ) === 0 ) {
									name = jQuery.camelCase( name.slice( 5 ) );
									dataAttr( elem, name, data[ name ] );
								}
							}
						}
						dataPriv.set( elem, "hasDataAttrs", true );
					}
				}
	
				return data;
			}
	
			// Sets multiple values
			if ( typeof key === "object" ) {
				return this.each( function() {
					dataUser.set( this, key );
				} );
			}
	
			return access( this, function( value ) {
				var data;
	
				// The calling jQuery object (element matches) is not empty
				// (and therefore has an element appears at this[ 0 ]) and the
				// `value` parameter was not undefined. An empty jQuery object
				// will result in `undefined` for elem = this[ 0 ] which will
				// throw an exception if an attempt to read a data cache is made.
				if ( elem && value === undefined ) {
	
					// Attempt to get data from the cache
					// The key will always be camelCased in Data
					data = dataUser.get( elem, key );
					if ( data !== undefined ) {
						return data;
					}
	
					// Attempt to "discover" the data in
					// HTML5 custom data-* attrs
					data = dataAttr( elem, key );
					if ( data !== undefined ) {
						return data;
					}
	
					// We tried really hard, but the data doesn't exist.
					return;
				}
	
				// Set the data...
				this.each( function() {
	
					// We always store the camelCased key
					dataUser.set( this, key, value );
				} );
			}, null, value, arguments.length > 1, null, true );
		},
	
		removeData: function( key ) {
			return this.each( function() {
				dataUser.remove( this, key );
			} );
		}
	} );
	
	
	jQuery.extend( {
		queue: function( elem, type, data ) {
			var queue;
	
			if ( elem ) {
				type = ( type || "fx" ) + "queue";
				queue = dataPriv.get( elem, type );
	
				// Speed up dequeue by getting out quickly if this is just a lookup
				if ( data ) {
					if ( !queue || Array.isArray( data ) ) {
						queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
					} else {
						queue.push( data );
					}
				}
				return queue || [];
			}
		},
	
		dequeue: function( elem, type ) {
			type = type || "fx";
	
			var queue = jQuery.queue( elem, type ),
				startLength = queue.length,
				fn = queue.shift(),
				hooks = jQuery._queueHooks( elem, type ),
				next = function() {
					jQuery.dequeue( elem, type );
				};
	
			// If the fx queue is dequeued, always remove the progress sentinel
			if ( fn === "inprogress" ) {
				fn = queue.shift();
				startLength--;
			}
	
			if ( fn ) {
	
				// Add a progress sentinel to prevent the fx queue from being
				// automatically dequeued
				if ( type === "fx" ) {
					queue.unshift( "inprogress" );
				}
	
				// Clear up the last queue stop function
				delete hooks.stop;
				fn.call( elem, next, hooks );
			}
	
			if ( !startLength && hooks ) {
				hooks.empty.fire();
			}
		},
	
		// Not public - generate a queueHooks object, or return the current one
		_queueHooks: function( elem, type ) {
			var key = type + "queueHooks";
			return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
				empty: jQuery.Callbacks( "once memory" ).add( function() {
					dataPriv.remove( elem, [ type + "queue", key ] );
				} )
			} );
		}
	} );
	
	jQuery.fn.extend( {
		queue: function( type, data ) {
			var setter = 2;
	
			if ( typeof type !== "string" ) {
				data = type;
				type = "fx";
				setter--;
			}
	
			if ( arguments.length < setter ) {
				return jQuery.queue( this[ 0 ], type );
			}
	
			return data === undefined ?
				this :
				this.each( function() {
					var queue = jQuery.queue( this, type, data );
	
					// Ensure a hooks for this queue
					jQuery._queueHooks( this, type );
	
					if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
						jQuery.dequeue( this, type );
					}
				} );
		},
		dequeue: function( type ) {
			return this.each( function() {
				jQuery.dequeue( this, type );
			} );
		},
		clearQueue: function( type ) {
			return this.queue( type || "fx", [] );
		},
	
		// Get a promise resolved when queues of a certain type
		// are emptied (fx is the type by default)
		promise: function( type, obj ) {
			var tmp,
				count = 1,
				defer = jQuery.Deferred(),
				elements = this,
				i = this.length,
				resolve = function() {
					if ( !( --count ) ) {
						defer.resolveWith( elements, [ elements ] );
					}
				};
	
			if ( typeof type !== "string" ) {
				obj = type;
				type = undefined;
			}
			type = type || "fx";
	
			while ( i-- ) {
				tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
				if ( tmp && tmp.empty ) {
					count++;
					tmp.empty.add( resolve );
				}
			}
			resolve();
			return defer.promise( obj );
		}
	} );
	var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
	
	var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
	
	
	var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
	
	var isHiddenWithinTree = function( elem, el ) {
	
			// isHiddenWithinTree might be called from jQuery#filter function;
			// in that case, element will be second argument
			elem = el || elem;
	
			// Inline style trumps all
			return elem.style.display === "none" ||
				elem.style.display === "" &&
	
				// Otherwise, check computed style
				// Support: Firefox <=43 - 45
				// Disconnected elements can have computed display: none, so first confirm that elem is
				// in the document.
				jQuery.contains( elem.ownerDocument, elem ) &&
	
				jQuery.css( elem, "display" ) === "none";
		};
	
	var swap = function( elem, options, callback, args ) {
		var ret, name,
			old = {};
	
		// Remember the old values, and insert the new ones
		for ( name in options ) {
			old[ name ] = elem.style[ name ];
			elem.style[ name ] = options[ name ];
		}
	
		ret = callback.apply( elem, args || [] );
	
		// Revert the old values
		for ( name in options ) {
			elem.style[ name ] = old[ name ];
		}
	
		return ret;
	};
	
	
	
	
	function adjustCSS( elem, prop, valueParts, tween ) {
		var adjusted,
			scale = 1,
			maxIterations = 20,
			currentValue = tween ?
				function() {
					return tween.cur();
				} :
				function() {
					return jQuery.css( elem, prop, "" );
				},
			initial = currentValue(),
			unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
	
			// Starting value computation is required for potential unit mismatches
			initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
				rcssNum.exec( jQuery.css( elem, prop ) );
	
		if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
	
			// Trust units reported by jQuery.css
			unit = unit || initialInUnit[ 3 ];
	
			// Make sure we update the tween properties later on
			valueParts = valueParts || [];
	
			// Iteratively approximate from a nonzero starting point
			initialInUnit = +initial || 1;
	
			do {
	
				// If previous iteration zeroed out, double until we get *something*.
				// Use string for doubling so we don't accidentally see scale as unchanged below
				scale = scale || ".5";
	
				// Adjust and apply
				initialInUnit = initialInUnit / scale;
				jQuery.style( elem, prop, initialInUnit + unit );
	
			// Update scale, tolerating zero or NaN from tween.cur()
			// Break the loop if scale is unchanged or perfect, or if we've just had enough.
			} while (
				scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
			);
		}
	
		if ( valueParts ) {
			initialInUnit = +initialInUnit || +initial || 0;
	
			// Apply relative offset (+=/-=) if specified
			adjusted = valueParts[ 1 ] ?
				initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
				+valueParts[ 2 ];
			if ( tween ) {
				tween.unit = unit;
				tween.start = initialInUnit;
				tween.end = adjusted;
			}
		}
		return adjusted;
	}
	
	
	var defaultDisplayMap = {};
	
	function getDefaultDisplay( elem ) {
		var temp,
			doc = elem.ownerDocument,
			nodeName = elem.nodeName,
			display = defaultDisplayMap[ nodeName ];
	
		if ( display ) {
			return display;
		}
	
		temp = doc.body.appendChild( doc.createElement( nodeName ) );
		display = jQuery.css( temp, "display" );
	
		temp.parentNode.removeChild( temp );
	
		if ( display === "none" ) {
			display = "block";
		}
		defaultDisplayMap[ nodeName ] = display;
	
		return display;
	}
	
	function showHide( elements, show ) {
		var display, elem,
			values = [],
			index = 0,
			length = elements.length;
	
		// Determine new display value for elements that need to change
		for ( ; index < length; index++ ) {
			elem = elements[ index ];
			if ( !elem.style ) {
				continue;
			}
	
			display = elem.style.display;
			if ( show ) {
	
				// Since we force visibility upon cascade-hidden elements, an immediate (and slow)
				// check is required in this first loop unless we have a nonempty display value (either
				// inline or about-to-be-restored)
				if ( display === "none" ) {
					values[ index ] = dataPriv.get( elem, "display" ) || null;
					if ( !values[ index ] ) {
						elem.style.display = "";
					}
				}
				if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
					values[ index ] = getDefaultDisplay( elem );
				}
			} else {
				if ( display !== "none" ) {
					values[ index ] = "none";
	
					// Remember what we're overwriting
					dataPriv.set( elem, "display", display );
				}
			}
		}
	
		// Set the display of the elements in a second loop to avoid constant reflow
		for ( index = 0; index < length; index++ ) {
			if ( values[ index ] != null ) {
				elements[ index ].style.display = values[ index ];
			}
		}
	
		return elements;
	}
	
	jQuery.fn.extend( {
		show: function() {
			return showHide( this, true );
		},
		hide: function() {
			return showHide( this );
		},
		toggle: function( state ) {
			if ( typeof state === "boolean" ) {
				return state ? this.show() : this.hide();
			}
	
			return this.each( function() {
				if ( isHiddenWithinTree( this ) ) {
					jQuery( this ).show();
				} else {
					jQuery( this ).hide();
				}
			} );
		}
	} );
	var rcheckableType = ( /^(?:checkbox|radio)$/i );
	
	var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
	
	var rscriptType = ( /^$|\/(?:java|ecma)script/i );
	
	
	
	// We have to close these tags to support XHTML (#13200)
	var wrapMap = {
	
		// Support: IE <=9 only
		option: [ 1, "<select multiple='multiple'>", "</select>" ],
	
		// XHTML parsers do not magically insert elements in the
		// same way that tag soup parsers do. So we cannot shorten
		// this by omitting <tbody> or other required elements.
		thead: [ 1, "<table>", "</table>" ],
		col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
	
		_default: [ 0, "", "" ]
	};
	
	// Support: IE <=9 only
	wrapMap.optgroup = wrapMap.option;
	
	wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
	wrapMap.th = wrapMap.td;
	
	
	function getAll( context, tag ) {
	
		// Support: IE <=9 - 11 only
		// Use typeof to avoid zero-argument method invocation on host objects (#15151)
		var ret;
	
		if ( typeof context.getElementsByTagName !== "undefined" ) {
			ret = context.getElementsByTagName( tag || "*" );
	
		} else if ( typeof context.querySelectorAll !== "undefined" ) {
			ret = context.querySelectorAll( tag || "*" );
	
		} else {
			ret = [];
		}
	
		if ( tag === undefined || tag && nodeName( context, tag ) ) {
			return jQuery.merge( [ context ], ret );
		}
	
		return ret;
	}
	
	
	// Mark scripts as having already been evaluated
	function setGlobalEval( elems, refElements ) {
		var i = 0,
			l = elems.length;
	
		for ( ; i < l; i++ ) {
			dataPriv.set(
				elems[ i ],
				"globalEval",
				!refElements || dataPriv.get( refElements[ i ], "globalEval" )
			);
		}
	}
	
	
	var rhtml = /<|&#?\w+;/;
	
	function buildFragment( elems, context, scripts, selection, ignored ) {
		var elem, tmp, tag, wrap, contains, j,
			fragment = context.createDocumentFragment(),
			nodes = [],
			i = 0,
			l = elems.length;
	
		for ( ; i < l; i++ ) {
			elem = elems[ i ];
	
			if ( elem || elem === 0 ) {
	
				// Add nodes directly
				if ( jQuery.type( elem ) === "object" ) {
	
					// Support: Android <=4.0 only, PhantomJS 1 only
					// push.apply(_, arraylike) throws on ancient WebKit
					jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
	
				// Convert non-html into a text node
				} else if ( !rhtml.test( elem ) ) {
					nodes.push( context.createTextNode( elem ) );
	
				// Convert html into DOM nodes
				} else {
					tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
	
					// Deserialize a standard representation
					tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
					wrap = wrapMap[ tag ] || wrapMap._default;
					tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
	
					// Descend through wrappers to the right content
					j = wrap[ 0 ];
					while ( j-- ) {
						tmp = tmp.lastChild;
					}
	
					// Support: Android <=4.0 only, PhantomJS 1 only
					// push.apply(_, arraylike) throws on ancient WebKit
					jQuery.merge( nodes, tmp.childNodes );
	
					// Remember the top-level container
					tmp = fragment.firstChild;
	
					// Ensure the created nodes are orphaned (#12392)
					tmp.textContent = "";
				}
			}
		}
	
		// Remove wrapper from fragment
		fragment.textContent = "";
	
		i = 0;
		while ( ( elem = nodes[ i++ ] ) ) {
	
			// Skip elements already in the context collection (trac-4087)
			if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
				if ( ignored ) {
					ignored.push( elem );
				}
				continue;
			}
	
			contains = jQuery.contains( elem.ownerDocument, elem );
	
			// Append to fragment
			tmp = getAll( fragment.appendChild( elem ), "script" );
	
			// Preserve script evaluation history
			if ( contains ) {
				setGlobalEval( tmp );
			}
	
			// Capture executables
			if ( scripts ) {
				j = 0;
				while ( ( elem = tmp[ j++ ] ) ) {
					if ( rscriptType.test( elem.type || "" ) ) {
						scripts.push( elem );
					}
				}
			}
		}
	
		return fragment;
	}
	
	
	( function() {
		var fragment = document.createDocumentFragment(),
			div = fragment.appendChild( document.createElement( "div" ) ),
			input = document.createElement( "input" );
	
		// Support: Android 4.0 - 4.3 only
		// Check state lost if the name is set (#11217)
		// Support: Windows Web Apps (WWA)
		// `name` and `type` must use .setAttribute for WWA (#14901)
		input.setAttribute( "type", "radio" );
		input.setAttribute( "checked", "checked" );
		input.setAttribute( "name", "t" );
	
		div.appendChild( input );
	
		// Support: Android <=4.1 only
		// Older WebKit doesn't clone checked state correctly in fragments
		support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
	
		// Support: IE <=11 only
		// Make sure textarea (and checkbox) defaultValue is properly cloned
		div.innerHTML = "<textarea>x</textarea>";
		support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
	} )();
	var documentElement = document.documentElement;
	
	
	
	var
		rkeyEvent = /^key/,
		rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
		rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
	
	function returnTrue() {
		return true;
	}
	
	function returnFalse() {
		return false;
	}
	
	// Support: IE <=9 only
	// See #13393 for more info
	function safeActiveElement() {
		try {
			return document.activeElement;
		} catch ( err ) { }
	}
	
	function on( elem, types, selector, data, fn, one ) {
		var origFn, type;
	
		// Types can be a map of types/handlers
		if ( typeof types === "object" ) {
	
			// ( types-Object, selector, data )
			if ( typeof selector !== "string" ) {
	
				// ( types-Object, data )
				data = data || selector;
				selector = undefined;
			}
			for ( type in types ) {
				on( elem, type, selector, data, types[ type ], one );
			}
			return elem;
		}
	
		if ( data == null && fn == null ) {
	
			// ( types, fn )
			fn = selector;
			data = selector = undefined;
		} else if ( fn == null ) {
			if ( typeof selector === "string" ) {
	
				// ( types, selector, fn )
				fn = data;
				data = undefined;
			} else {
	
				// ( types, data, fn )
				fn = data;
				data = selector;
				selector = undefined;
			}
		}
		if ( fn === false ) {
			fn = returnFalse;
		} else if ( !fn ) {
			return elem;
		}
	
		if ( one === 1 ) {
			origFn = fn;
			fn = function( event ) {
	
				// Can use an empty set, since event contains the info
				jQuery().off( event );
				return origFn.apply( this, arguments );
			};
	
			// Use same guid so caller can remove using origFn
			fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
		}
		return elem.each( function() {
			jQuery.event.add( this, types, fn, data, selector );
		} );
	}
	
	/*
	 * Helper functions for managing events -- not part of the public interface.
	 * Props to Dean Edwards' addEvent library for many of the ideas.
	 */
	jQuery.event = {
	
		global: {},
	
		add: function( elem, types, handler, data, selector ) {
	
			var handleObjIn, eventHandle, tmp,
				events, t, handleObj,
				special, handlers, type, namespaces, origType,
				elemData = dataPriv.get( elem );
	
			// Don't attach events to noData or text/comment nodes (but allow plain objects)
			if ( !elemData ) {
				return;
			}
	
			// Caller can pass in an object of custom data in lieu of the handler
			if ( handler.handler ) {
				handleObjIn = handler;
				handler = handleObjIn.handler;
				selector = handleObjIn.selector;
			}
	
			// Ensure that invalid selectors throw exceptions at attach time
			// Evaluate against documentElement in case elem is a non-element node (e.g., document)
			if ( selector ) {
				jQuery.find.matchesSelector( documentElement, selector );
			}
	
			// Make sure that the handler has a unique ID, used to find/remove it later
			if ( !handler.guid ) {
				handler.guid = jQuery.guid++;
			}
	
			// Init the element's event structure and main handler, if this is the first
			if ( !( events = elemData.events ) ) {
				events = elemData.events = {};
			}
			if ( !( eventHandle = elemData.handle ) ) {
				eventHandle = elemData.handle = function( e ) {
	
					// Discard the second event of a jQuery.event.trigger() and
					// when an event is called after a page has unloaded
					return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
						jQuery.event.dispatch.apply( elem, arguments ) : undefined;
				};
			}
	
			// Handle multiple events separated by a space
			types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
			t = types.length;
			while ( t-- ) {
				tmp = rtypenamespace.exec( types[ t ] ) || [];
				type = origType = tmp[ 1 ];
				namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
	
				// There *must* be a type, no attaching namespace-only handlers
				if ( !type ) {
					continue;
				}
	
				// If event changes its type, use the special event handlers for the changed type
				special = jQuery.event.special[ type ] || {};
	
				// If selector defined, determine special event api type, otherwise given type
				type = ( selector ? special.delegateType : special.bindType ) || type;
	
				// Update special based on newly reset type
				special = jQuery.event.special[ type ] || {};
	
				// handleObj is passed to all event handlers
				handleObj = jQuery.extend( {
					type: type,
					origType: origType,
					data: data,
					handler: handler,
					guid: handler.guid,
					selector: selector,
					needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
					namespace: namespaces.join( "." )
				}, handleObjIn );
	
				// Init the event handler queue if we're the first
				if ( !( handlers = events[ type ] ) ) {
					handlers = events[ type ] = [];
					handlers.delegateCount = 0;
	
					// Only use addEventListener if the special events handler returns false
					if ( !special.setup ||
						special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
	
						if ( elem.addEventListener ) {
							elem.addEventListener( type, eventHandle );
						}
					}
				}
	
				if ( special.add ) {
					special.add.call( elem, handleObj );
	
					if ( !handleObj.handler.guid ) {
						handleObj.handler.guid = handler.guid;
					}
				}
	
				// Add to the element's handler list, delegates in front
				if ( selector ) {
					handlers.splice( handlers.delegateCount++, 0, handleObj );
				} else {
					handlers.push( handleObj );
				}
	
				// Keep track of which events have ever been used, for event optimization
				jQuery.event.global[ type ] = true;
			}
	
		},
	
		// Detach an event or set of events from an element
		remove: function( elem, types, handler, selector, mappedTypes ) {
	
			var j, origCount, tmp,
				events, t, handleObj,
				special, handlers, type, namespaces, origType,
				elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
	
			if ( !elemData || !( events = elemData.events ) ) {
				return;
			}
	
			// Once for each type.namespace in types; type may be omitted
			types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
			t = types.length;
			while ( t-- ) {
				tmp = rtypenamespace.exec( types[ t ] ) || [];
				type = origType = tmp[ 1 ];
				namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
	
				// Unbind all events (on this namespace, if provided) for the element
				if ( !type ) {
					for ( type in events ) {
						jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
					}
					continue;
				}
	
				special = jQuery.event.special[ type ] || {};
				type = ( selector ? special.delegateType : special.bindType ) || type;
				handlers = events[ type ] || [];
				tmp = tmp[ 2 ] &&
					new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
	
				// Remove matching events
				origCount = j = handlers.length;
				while ( j-- ) {
					handleObj = handlers[ j ];
	
					if ( ( mappedTypes || origType === handleObj.origType ) &&
						( !handler || handler.guid === handleObj.guid ) &&
						( !tmp || tmp.test( handleObj.namespace ) ) &&
						( !selector || selector === handleObj.selector ||
							selector === "**" && handleObj.selector ) ) {
						handlers.splice( j, 1 );
	
						if ( handleObj.selector ) {
							handlers.delegateCount--;
						}
						if ( special.remove ) {
							special.remove.call( elem, handleObj );
						}
					}
				}
	
				// Remove generic event handler if we removed something and no more handlers exist
				// (avoids potential for endless recursion during removal of special event handlers)
				if ( origCount && !handlers.length ) {
					if ( !special.teardown ||
						special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
	
						jQuery.removeEvent( elem, type, elemData.handle );
					}
	
					delete events[ type ];
				}
			}
	
			// Remove data and the expando if it's no longer used
			if ( jQuery.isEmptyObject( events ) ) {
				dataPriv.remove( elem, "handle events" );
			}
		},
	
		dispatch: function( nativeEvent ) {
	
			// Make a writable jQuery.Event from the native event object
			var event = jQuery.event.fix( nativeEvent );
	
			var i, j, ret, matched, handleObj, handlerQueue,
				args = new Array( arguments.length ),
				handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
				special = jQuery.event.special[ event.type ] || {};
	
			// Use the fix-ed jQuery.Event rather than the (read-only) native event
			args[ 0 ] = event;
	
			for ( i = 1; i < arguments.length; i++ ) {
				args[ i ] = arguments[ i ];
			}
	
			event.delegateTarget = this;
	
			// Call the preDispatch hook for the mapped type, and let it bail if desired
			if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
				return;
			}
	
			// Determine handlers
			handlerQueue = jQuery.event.handlers.call( this, event, handlers );
	
			// Run delegates first; they may want to stop propagation beneath us
			i = 0;
			while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
				event.currentTarget = matched.elem;
	
				j = 0;
				while ( ( handleObj = matched.handlers[ j++ ] ) &&
					!event.isImmediatePropagationStopped() ) {
	
					// Triggered event must either 1) have no namespace, or 2) have namespace(s)
					// a subset or equal to those in the bound event (both can have no namespace).
					if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
	
						event.handleObj = handleObj;
						event.data = handleObj.data;
	
						ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
							handleObj.handler ).apply( matched.elem, args );
	
						if ( ret !== undefined ) {
							if ( ( event.result = ret ) === false ) {
								event.preventDefault();
								event.stopPropagation();
							}
						}
					}
				}
			}
	
			// Call the postDispatch hook for the mapped type
			if ( special.postDispatch ) {
				special.postDispatch.call( this, event );
			}
	
			return event.result;
		},
	
		handlers: function( event, handlers ) {
			var i, handleObj, sel, matchedHandlers, matchedSelectors,
				handlerQueue = [],
				delegateCount = handlers.delegateCount,
				cur = event.target;
	
			// Find delegate handlers
			if ( delegateCount &&
	
				// Support: IE <=9
				// Black-hole SVG <use> instance trees (trac-13180)
				cur.nodeType &&
	
				// Support: Firefox <=42
				// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
				// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
				// Support: IE 11 only
				// ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
				!( event.type === "click" && event.button >= 1 ) ) {
	
				for ( ; cur !== this; cur = cur.parentNode || this ) {
	
					// Don't check non-elements (#13208)
					// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
					if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
						matchedHandlers = [];
						matchedSelectors = {};
						for ( i = 0; i < delegateCount; i++ ) {
							handleObj = handlers[ i ];
	
							// Don't conflict with Object.prototype properties (#13203)
							sel = handleObj.selector + " ";
	
							if ( matchedSelectors[ sel ] === undefined ) {
								matchedSelectors[ sel ] = handleObj.needsContext ?
									jQuery( sel, this ).index( cur ) > -1 :
									jQuery.find( sel, this, null, [ cur ] ).length;
							}
							if ( matchedSelectors[ sel ] ) {
								matchedHandlers.push( handleObj );
							}
						}
						if ( matchedHandlers.length ) {
							handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
						}
					}
				}
			}
	
			// Add the remaining (directly-bound) handlers
			cur = this;
			if ( delegateCount < handlers.length ) {
				handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
			}
	
			return handlerQueue;
		},
	
		addProp: function( name, hook ) {
			Object.defineProperty( jQuery.Event.prototype, name, {
				enumerable: true,
				configurable: true,
	
				get: jQuery.isFunction( hook ) ?
					function() {
						if ( this.originalEvent ) {
								return hook( this.originalEvent );
						}
					} :
					function() {
						if ( this.originalEvent ) {
								return this.originalEvent[ name ];
						}
					},
	
				set: function( value ) {
					Object.defineProperty( this, name, {
						enumerable: true,
						configurable: true,
						writable: true,
						value: value
					} );
				}
			} );
		},
	
		fix: function( originalEvent ) {
			return originalEvent[ jQuery.expando ] ?
				originalEvent :
				new jQuery.Event( originalEvent );
		},
	
		special: {
			load: {
	
				// Prevent triggered image.load events from bubbling to window.load
				noBubble: true
			},
			focus: {
	
				// Fire native event if possible so blur/focus sequence is correct
				trigger: function() {
					if ( this !== safeActiveElement() && this.focus ) {
						this.focus();
						return false;
					}
				},
				delegateType: "focusin"
			},
			blur: {
				trigger: function() {
					if ( this === safeActiveElement() && this.blur ) {
						this.blur();
						return false;
					}
				},
				delegateType: "focusout"
			},
			click: {
	
				// For checkbox, fire native event so checked state will be right
				trigger: function() {
					if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) {
						this.click();
						return false;
					}
				},
	
				// For cross-browser consistency, don't fire native .click() on links
				_default: function( event ) {
					return nodeName( event.target, "a" );
				}
			},
	
			beforeunload: {
				postDispatch: function( event ) {
	
					// Support: Firefox 20+
					// Firefox doesn't alert if the returnValue field is not set.
					if ( event.result !== undefined && event.originalEvent ) {
						event.originalEvent.returnValue = event.result;
					}
				}
			}
		}
	};
	
	jQuery.removeEvent = function( elem, type, handle ) {
	
		// This "if" is needed for plain objects
		if ( elem.removeEventListener ) {
			elem.removeEventListener( type, handle );
		}
	};
	
	jQuery.Event = function( src, props ) {
	
		// Allow instantiation without the 'new' keyword
		if ( !( this instanceof jQuery.Event ) ) {
			return new jQuery.Event( src, props );
		}
	
		// Event object
		if ( src && src.type ) {
			this.originalEvent = src;
			this.type = src.type;
	
			// Events bubbling up the document may have been marked as prevented
			// by a handler lower down the tree; reflect the correct value.
			this.isDefaultPrevented = src.defaultPrevented ||
					src.defaultPrevented === undefined &&
	
					// Support: Android <=2.3 only
					src.returnValue === false ?
				returnTrue :
				returnFalse;
	
			// Create target properties
			// Support: Safari <=6 - 7 only
			// Target should not be a text node (#504, #13143)
			this.target = ( src.target && src.target.nodeType === 3 ) ?
				src.target.parentNode :
				src.target;
	
			this.currentTarget = src.currentTarget;
			this.relatedTarget = src.relatedTarget;
	
		// Event type
		} else {
			this.type = src;
		}
	
		// Put explicitly provided properties onto the event object
		if ( props ) {
			jQuery.extend( this, props );
		}
	
		// Create a timestamp if incoming event doesn't have one
		this.timeStamp = src && src.timeStamp || jQuery.now();
	
		// Mark it as fixed
		this[ jQuery.expando ] = true;
	};
	
	// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
	// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
	jQuery.Event.prototype = {
		constructor: jQuery.Event,
		isDefaultPrevented: returnFalse,
		isPropagationStopped: returnFalse,
		isImmediatePropagationStopped: returnFalse,
		isSimulated: false,
	
		preventDefault: function() {
			var e = this.originalEvent;
	
			this.isDefaultPrevented = returnTrue;
	
			if ( e && !this.isSimulated ) {
				e.preventDefault();
			}
		},
		stopPropagation: function() {
			var e = this.originalEvent;
	
			this.isPropagationStopped = returnTrue;
	
			if ( e && !this.isSimulated ) {
				e.stopPropagation();
			}
		},
		stopImmediatePropagation: function() {
			var e = this.originalEvent;
	
			this.isImmediatePropagationStopped = returnTrue;
	
			if ( e && !this.isSimulated ) {
				e.stopImmediatePropagation();
			}
	
			this.stopPropagation();
		}
	};
	
	// Includes all common event props including KeyEvent and MouseEvent specific props
	jQuery.each( {
		altKey: true,
		bubbles: true,
		cancelable: true,
		changedTouches: true,
		ctrlKey: true,
		detail: true,
		eventPhase: true,
		metaKey: true,
		pageX: true,
		pageY: true,
		shiftKey: true,
		view: true,
		"char": true,
		charCode: true,
		key: true,
		keyCode: true,
		button: true,
		buttons: true,
		clientX: true,
		clientY: true,
		offsetX: true,
		offsetY: true,
		pointerId: true,
		pointerType: true,
		screenX: true,
		screenY: true,
		targetTouches: true,
		toElement: true,
		touches: true,
	
		which: function( event ) {
			var button = event.button;
	
			// Add which for key events
			if ( event.which == null && rkeyEvent.test( event.type ) ) {
				return event.charCode != null ? event.charCode : event.keyCode;
			}
	
			// Add which for click: 1 === left; 2 === middle; 3 === right
			if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
				if ( button & 1 ) {
					return 1;
				}
	
				if ( button & 2 ) {
					return 3;
				}
	
				if ( button & 4 ) {
					return 2;
				}
	
				return 0;
			}
	
			return event.which;
		}
	}, jQuery.event.addProp );
	
	// Create mouseenter/leave events using mouseover/out and event-time checks
	// so that event delegation works in jQuery.
	// Do the same for pointerenter/pointerleave and pointerover/pointerout
	//
	// Support: Safari 7 only
	// Safari sends mouseenter too often; see:
	// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
	// for the description of the bug (it existed in older Chrome versions as well).
	jQuery.each( {
		mouseenter: "mouseover",
		mouseleave: "mouseout",
		pointerenter: "pointerover",
		pointerleave: "pointerout"
	}, function( orig, fix ) {
		jQuery.event.special[ orig ] = {
			delegateType: fix,
			bindType: fix,
	
			handle: function( event ) {
				var ret,
					target = this,
					related = event.relatedTarget,
					handleObj = event.handleObj;
	
				// For mouseenter/leave call the handler if related is outside the target.
				// NB: No relatedTarget if the mouse left/entered the browser window
				if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
					event.type = handleObj.origType;
					ret = handleObj.handler.apply( this, arguments );
					event.type = fix;
				}
				return ret;
			}
		};
	} );
	
	jQuery.fn.extend( {
	
		on: function( types, selector, data, fn ) {
			return on( this, types, selector, data, fn );
		},
		one: function( types, selector, data, fn ) {
			return on( this, types, selector, data, fn, 1 );
		},
		off: function( types, selector, fn ) {
			var handleObj, type;
			if ( types && types.preventDefault && types.handleObj ) {
	
				// ( event )  dispatched jQuery.Event
				handleObj = types.handleObj;
				jQuery( types.delegateTarget ).off(
					handleObj.namespace ?
						handleObj.origType + "." + handleObj.namespace :
						handleObj.origType,
					handleObj.selector,
					handleObj.handler
				);
				return this;
			}
			if ( typeof types === "object" ) {
	
				// ( types-object [, selector] )
				for ( type in types ) {
					this.off( type, selector, types[ type ] );
				}
				return this;
			}
			if ( selector === false || typeof selector === "function" ) {
	
				// ( types [, fn] )
				fn = selector;
				selector = undefined;
			}
			if ( fn === false ) {
				fn = returnFalse;
			}
			return this.each( function() {
				jQuery.event.remove( this, types, fn, selector );
			} );
		}
	} );
	
	
	var
	
		/* eslint-disable max-len */
	
		// See https://github.com/eslint/eslint/issues/3229
		rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
	
		/* eslint-enable */
	
		// Support: IE <=10 - 11, Edge 12 - 13
		// In IE/Edge using regex groups here causes severe slowdowns.
		// See https://connect.microsoft.com/IE/feedback/details/1736512/
		rnoInnerhtml = /<script|<style|<link/i,
	
		// checked="checked" or checked
		rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
		rscriptTypeMasked = /^true\/(.*)/,
		rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
	
	// Prefer a tbody over its parent table for containing new rows
	function manipulationTarget( elem, content ) {
		if ( nodeName( elem, "table" ) &&
			nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
	
			return jQuery( ">tbody", elem )[ 0 ] || elem;
		}
	
		return elem;
	}
	
	// Replace/restore the type attribute of script elements for safe DOM manipulation
	function disableScript( elem ) {
		elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
		return elem;
	}
	function restoreScript( elem ) {
		var match = rscriptTypeMasked.exec( elem.type );
	
		if ( match ) {
			elem.type = match[ 1 ];
		} else {
			elem.removeAttribute( "type" );
		}
	
		return elem;
	}
	
	function cloneCopyEvent( src, dest ) {
		var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
	
		if ( dest.nodeType !== 1 ) {
			return;
		}
	
		// 1. Copy private data: events, handlers, etc.
		if ( dataPriv.hasData( src ) ) {
			pdataOld = dataPriv.access( src );
			pdataCur = dataPriv.set( dest, pdataOld );
			events = pdataOld.events;
	
			if ( events ) {
				delete pdataCur.handle;
				pdataCur.events = {};
	
				for ( type in events ) {
					for ( i = 0, l = events[ type ].length; i < l; i++ ) {
						jQuery.event.add( dest, type, events[ type ][ i ] );
					}
				}
			}
		}
	
		// 2. Copy user data
		if ( dataUser.hasData( src ) ) {
			udataOld = dataUser.access( src );
			udataCur = jQuery.extend( {}, udataOld );
	
			dataUser.set( dest, udataCur );
		}
	}
	
	// Fix IE bugs, see support tests
	function fixInput( src, dest ) {
		var nodeName = dest.nodeName.toLowerCase();
	
		// Fails to persist the checked state of a cloned checkbox or radio button.
		if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
			dest.checked = src.checked;
	
		// Fails to return the selected option to the default selected state when cloning options
		} else if ( nodeName === "input" || nodeName === "textarea" ) {
			dest.defaultValue = src.defaultValue;
		}
	}
	
	function domManip( collection, args, callback, ignored ) {
	
		// Flatten any nested arrays
		args = concat.apply( [], args );
	
		var fragment, first, scripts, hasScripts, node, doc,
			i = 0,
			l = collection.length,
			iNoClone = l - 1,
			value = args[ 0 ],
			isFunction = jQuery.isFunction( value );
	
		// We can't cloneNode fragments that contain checked, in WebKit
		if ( isFunction ||
				( l > 1 && typeof value === "string" &&
					!support.checkClone && rchecked.test( value ) ) ) {
			return collection.each( function( index ) {
				var self = collection.eq( index );
				if ( isFunction ) {
					args[ 0 ] = value.call( this, index, self.html() );
				}
				domManip( self, args, callback, ignored );
			} );
		}
	
		if ( l ) {
			fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
			first = fragment.firstChild;
	
			if ( fragment.childNodes.length === 1 ) {
				fragment = first;
			}
	
			// Require either new content or an interest in ignored elements to invoke the callback
			if ( first || ignored ) {
				scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
				hasScripts = scripts.length;
	
				// Use the original fragment for the last item
				// instead of the first because it can end up
				// being emptied incorrectly in certain situations (#8070).
				for ( ; i < l; i++ ) {
					node = fragment;
	
					if ( i !== iNoClone ) {
						node = jQuery.clone( node, true, true );
	
						// Keep references to cloned scripts for later restoration
						if ( hasScripts ) {
	
							// Support: Android <=4.0 only, PhantomJS 1 only
							// push.apply(_, arraylike) throws on ancient WebKit
							jQuery.merge( scripts, getAll( node, "script" ) );
						}
					}
	
					callback.call( collection[ i ], node, i );
				}
	
				if ( hasScripts ) {
					doc = scripts[ scripts.length - 1 ].ownerDocument;
	
					// Reenable scripts
					jQuery.map( scripts, restoreScript );
	
					// Evaluate executable scripts on first document insertion
					for ( i = 0; i < hasScripts; i++ ) {
						node = scripts[ i ];
						if ( rscriptType.test( node.type || "" ) &&
							!dataPriv.access( node, "globalEval" ) &&
							jQuery.contains( doc, node ) ) {
	
							if ( node.src ) {
	
								// Optional AJAX dependency, but won't run scripts if not present
								if ( jQuery._evalUrl ) {
									jQuery._evalUrl( node.src );
								}
							} else {
								DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
							}
						}
					}
				}
			}
		}
	
		return collection;
	}
	
	function remove( elem, selector, keepData ) {
		var node,
			nodes = selector ? jQuery.filter( selector, elem ) : elem,
			i = 0;
	
		for ( ; ( node = nodes[ i ] ) != null; i++ ) {
			if ( !keepData && node.nodeType === 1 ) {
				jQuery.cleanData( getAll( node ) );
			}
	
			if ( node.parentNode ) {
				if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
					setGlobalEval( getAll( node, "script" ) );
				}
				node.parentNode.removeChild( node );
			}
		}
	
		return elem;
	}
	
	jQuery.extend( {
		htmlPrefilter: function( html ) {
			return html.replace( rxhtmlTag, "<$1></$2>" );
		},
	
		clone: function( elem, dataAndEvents, deepDataAndEvents ) {
			var i, l, srcElements, destElements,
				clone = elem.cloneNode( true ),
				inPage = jQuery.contains( elem.ownerDocument, elem );
	
			// Fix IE cloning issues
			if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
					!jQuery.isXMLDoc( elem ) ) {
	
				// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
				destElements = getAll( clone );
				srcElements = getAll( elem );
	
				for ( i = 0, l = srcElements.length; i < l; i++ ) {
					fixInput( srcElements[ i ], destElements[ i ] );
				}
			}
	
			// Copy the events from the original to the clone
			if ( dataAndEvents ) {
				if ( deepDataAndEvents ) {
					srcElements = srcElements || getAll( elem );
					destElements = destElements || getAll( clone );
	
					for ( i = 0, l = srcElements.length; i < l; i++ ) {
						cloneCopyEvent( srcElements[ i ], destElements[ i ] );
					}
				} else {
					cloneCopyEvent( elem, clone );
				}
			}
	
			// Preserve script evaluation history
			destElements = getAll( clone, "script" );
			if ( destElements.length > 0 ) {
				setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
			}
	
			// Return the cloned set
			return clone;
		},
	
		cleanData: function( elems ) {
			var data, elem, type,
				special = jQuery.event.special,
				i = 0;
	
			for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
				if ( acceptData( elem ) ) {
					if ( ( data = elem[ dataPriv.expando ] ) ) {
						if ( data.events ) {
							for ( type in data.events ) {
								if ( special[ type ] ) {
									jQuery.event.remove( elem, type );
	
								// This is a shortcut to avoid jQuery.event.remove's overhead
								} else {
									jQuery.removeEvent( elem, type, data.handle );
								}
							}
						}
	
						// Support: Chrome <=35 - 45+
						// Assign undefined instead of using delete, see Data#remove
						elem[ dataPriv.expando ] = undefined;
					}
					if ( elem[ dataUser.expando ] ) {
	
						// Support: Chrome <=35 - 45+
						// Assign undefined instead of using delete, see Data#remove
						elem[ dataUser.expando ] = undefined;
					}
				}
			}
		}
	} );
	
	jQuery.fn.extend( {
		detach: function( selector ) {
			return remove( this, selector, true );
		},
	
		remove: function( selector ) {
			return remove( this, selector );
		},
	
		text: function( value ) {
			return access( this, function( value ) {
				return value === undefined ?
					jQuery.text( this ) :
					this.empty().each( function() {
						if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
							this.textContent = value;
						}
					} );
			}, null, value, arguments.length );
		},
	
		append: function() {
			return domManip( this, arguments, function( elem ) {
				if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
					var target = manipulationTarget( this, elem );
					target.appendChild( elem );
				}
			} );
		},
	
		prepend: function() {
			return domManip( this, arguments, function( elem ) {
				if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
					var target = manipulationTarget( this, elem );
					target.insertBefore( elem, target.firstChild );
				}
			} );
		},
	
		before: function() {
			return domManip( this, arguments, function( elem ) {
				if ( this.parentNode ) {
					this.parentNode.insertBefore( elem, this );
				}
			} );
		},
	
		after: function() {
			return domManip( this, arguments, function( elem ) {
				if ( this.parentNode ) {
					this.parentNode.insertBefore( elem, this.nextSibling );
				}
			} );
		},
	
		empty: function() {
			var elem,
				i = 0;
	
			for ( ; ( elem = this[ i ] ) != null; i++ ) {
				if ( elem.nodeType === 1 ) {
	
					// Prevent memory leaks
					jQuery.cleanData( getAll( elem, false ) );
	
					// Remove any remaining nodes
					elem.textContent = "";
				}
			}
	
			return this;
		},
	
		clone: function( dataAndEvents, deepDataAndEvents ) {
			dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
			deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
	
			return this.map( function() {
				return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
			} );
		},
	
		html: function( value ) {
			return access( this, function( value ) {
				var elem = this[ 0 ] || {},
					i = 0,
					l = this.length;
	
				if ( value === undefined && elem.nodeType === 1 ) {
					return elem.innerHTML;
				}
	
				// See if we can take a shortcut and just use innerHTML
				if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
					!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
	
					value = jQuery.htmlPrefilter( value );
	
					try {
						for ( ; i < l; i++ ) {
							elem = this[ i ] || {};
	
							// Remove element nodes and prevent memory leaks
							if ( elem.nodeType === 1 ) {
								jQuery.cleanData( getAll( elem, false ) );
								elem.innerHTML = value;
							}
						}
	
						elem = 0;
	
					// If using innerHTML throws an exception, use the fallback method
					} catch ( e ) {}
				}
	
				if ( elem ) {
					this.empty().append( value );
				}
			}, null, value, arguments.length );
		},
	
		replaceWith: function() {
			var ignored = [];
	
			// Make the changes, replacing each non-ignored context element with the new content
			return domManip( this, arguments, function( elem ) {
				var parent = this.parentNode;
	
				if ( jQuery.inArray( this, ignored ) < 0 ) {
					jQuery.cleanData( getAll( this ) );
					if ( parent ) {
						parent.replaceChild( elem, this );
					}
				}
	
			// Force callback invocation
			}, ignored );
		}
	} );
	
	jQuery.each( {
		appendTo: "append",
		prependTo: "prepend",
		insertBefore: "before",
		insertAfter: "after",
		replaceAll: "replaceWith"
	}, function( name, original ) {
		jQuery.fn[ name ] = function( selector ) {
			var elems,
				ret = [],
				insert = jQuery( selector ),
				last = insert.length - 1,
				i = 0;
	
			for ( ; i <= last; i++ ) {
				elems = i === last ? this : this.clone( true );
				jQuery( insert[ i ] )[ original ]( elems );
	
				// Support: Android <=4.0 only, PhantomJS 1 only
				// .get() because push.apply(_, arraylike) throws on ancient WebKit
				push.apply( ret, elems.get() );
			}
	
			return this.pushStack( ret );
		};
	} );
	var rmargin = ( /^margin/ );
	
	var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
	
	var getStyles = function( elem ) {
	
			// Support: IE <=11 only, Firefox <=30 (#15098, #14150)
			// IE throws on elements created in popups
			// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
			var view = elem.ownerDocument.defaultView;
	
			if ( !view || !view.opener ) {
				view = window;
			}
	
			return view.getComputedStyle( elem );
		};
	
	
	
	( function() {
	
		// Executing both pixelPosition & boxSizingReliable tests require only one layout
		// so they're executed at the same time to save the second computation.
		function computeStyleTests() {
	
			// This is a singleton, we need to execute it only once
			if ( !div ) {
				return;
			}
	
			div.style.cssText =
				"box-sizing:border-box;" +
				"position:relative;display:block;" +
				"margin:auto;border:1px;padding:1px;" +
				"top:1%;width:50%";
			div.innerHTML = "";
			documentElement.appendChild( container );
	
			var divStyle = window.getComputedStyle( div );
			pixelPositionVal = divStyle.top !== "1%";
	
			// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
			reliableMarginLeftVal = divStyle.marginLeft === "2px";
			boxSizingReliableVal = divStyle.width === "4px";
	
			// Support: Android 4.0 - 4.3 only
			// Some styles come back with percentage values, even though they shouldn't
			div.style.marginRight = "50%";
			pixelMarginRightVal = divStyle.marginRight === "4px";
	
			documentElement.removeChild( container );
	
			// Nullify the div so it wouldn't be stored in the memory and
			// it will also be a sign that checks already performed
			div = null;
		}
	
		var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
			container = document.createElement( "div" ),
			div = document.createElement( "div" );
	
		// Finish early in limited (non-browser) environments
		if ( !div.style ) {
			return;
		}
	
		// Support: IE <=9 - 11 only
		// Style of cloned element affects source element cloned (#8908)
		div.style.backgroundClip = "content-box";
		div.cloneNode( true ).style.backgroundClip = "";
		support.clearCloneStyle = div.style.backgroundClip === "content-box";
	
		container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
			"padding:0;margin-top:1px;position:absolute";
		container.appendChild( div );
	
		jQuery.extend( support, {
			pixelPosition: function() {
				computeStyleTests();
				return pixelPositionVal;
			},
			boxSizingReliable: function() {
				computeStyleTests();
				return boxSizingReliableVal;
			},
			pixelMarginRight: function() {
				computeStyleTests();
				return pixelMarginRightVal;
			},
			reliableMarginLeft: function() {
				computeStyleTests();
				return reliableMarginLeftVal;
			}
		} );
	} )();
	
	
	function curCSS( elem, name, computed ) {
		var width, minWidth, maxWidth, ret,
	
			// Support: Firefox 51+
			// Retrieving style before computed somehow
			// fixes an issue with getting wrong values
			// on detached elements
			style = elem.style;
	
		computed = computed || getStyles( elem );
	
		// getPropertyValue is needed for:
		//   .css('filter') (IE 9 only, #12537)
		//   .css('--customProperty) (#3144)
		if ( computed ) {
			ret = computed.getPropertyValue( name ) || computed[ name ];
	
			if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
				ret = jQuery.style( elem, name );
			}
	
			// A tribute to the "awesome hack by Dean Edwards"
			// Android Browser returns percentage for some values,
			// but width seems to be reliably pixels.
			// This is against the CSSOM draft spec:
			// https://drafts.csswg.org/cssom/#resolved-values
			if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
	
				// Remember the original values
				width = style.width;
				minWidth = style.minWidth;
				maxWidth = style.maxWidth;
	
				// Put in the new values to get a computed value out
				style.minWidth = style.maxWidth = style.width = ret;
				ret = computed.width;
	
				// Revert the changed values
				style.width = width;
				style.minWidth = minWidth;
				style.maxWidth = maxWidth;
			}
		}
	
		return ret !== undefined ?
	
			// Support: IE <=9 - 11 only
			// IE returns zIndex value as an integer.
			ret + "" :
			ret;
	}
	
	
	function addGetHookIf( conditionFn, hookFn ) {
	
		// Define the hook, we'll check on the first run if it's really needed.
		return {
			get: function() {
				if ( conditionFn() ) {
	
					// Hook not needed (or it's not possible to use it due
					// to missing dependency), remove it.
					delete this.get;
					return;
				}
	
				// Hook needed; redefine it so that the support test is not executed again.
				return ( this.get = hookFn ).apply( this, arguments );
			}
		};
	}
	
	
	var
	
		// Swappable if display is none or starts with table
		// except "table", "table-cell", or "table-caption"
		// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
		rdisplayswap = /^(none|table(?!-c[ea]).+)/,
		rcustomProp = /^--/,
		cssShow = { position: "absolute", visibility: "hidden", display: "block" },
		cssNormalTransform = {
			letterSpacing: "0",
			fontWeight: "400"
		},
	
		cssPrefixes = [ "Webkit", "Moz", "ms" ],
		emptyStyle = document.createElement( "div" ).style;
	
	// Return a css property mapped to a potentially vendor prefixed property
	function vendorPropName( name ) {
	
		// Shortcut for names that are not vendor prefixed
		if ( name in emptyStyle ) {
			return name;
		}
	
		// Check for vendor prefixed names
		var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
			i = cssPrefixes.length;
	
		while ( i-- ) {
			name = cssPrefixes[ i ] + capName;
			if ( name in emptyStyle ) {
				return name;
			}
		}
	}
	
	// Return a property mapped along what jQuery.cssProps suggests or to
	// a vendor prefixed property.
	function finalPropName( name ) {
		var ret = jQuery.cssProps[ name ];
		if ( !ret ) {
			ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;
		}
		return ret;
	}
	
	function setPositiveNumber( elem, value, subtract ) {
	
		// Any relative (+/-) values have already been
		// normalized at this point
		var matches = rcssNum.exec( value );
		return matches ?
	
			// Guard against undefined "subtract", e.g., when used as in cssHooks
			Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
			value;
	}
	
	function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
		var i,
			val = 0;
	
		// If we already have the right measurement, avoid augmentation
		if ( extra === ( isBorderBox ? "border" : "content" ) ) {
			i = 4;
	
		// Otherwise initialize for horizontal or vertical properties
		} else {
			i = name === "width" ? 1 : 0;
		}
	
		for ( ; i < 4; i += 2 ) {
	
			// Both box models exclude margin, so add it if we want it
			if ( extra === "margin" ) {
				val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
			}
	
			if ( isBorderBox ) {
	
				// border-box includes padding, so remove it if we want content
				if ( extra === "content" ) {
					val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
				}
	
				// At this point, extra isn't border nor margin, so remove border
				if ( extra !== "margin" ) {
					val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
				}
			} else {
	
				// At this point, extra isn't content, so add padding
				val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
	
				// At this point, extra isn't content nor padding, so add border
				if ( extra !== "padding" ) {
					val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
				}
			}
		}
	
		return val;
	}
	
	function getWidthOrHeight( elem, name, extra ) {
	
		// Start with computed style
		var valueIsBorderBox,
			styles = getStyles( elem ),
			val = curCSS( elem, name, styles ),
			isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
	
		// Computed unit is not pixels. Stop here and return.
		if ( rnumnonpx.test( val ) ) {
			return val;
		}
	
		// Check for style in case a browser which returns unreliable values
		// for getComputedStyle silently falls back to the reliable elem.style
		valueIsBorderBox = isBorderBox &&
			( support.boxSizingReliable() || val === elem.style[ name ] );
	
		// Fall back to offsetWidth/Height when value is "auto"
		// This happens for inline elements with no explicit setting (gh-3571)
		if ( val === "auto" ) {
			val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ];
		}
	
		// Normalize "", auto, and prepare for extra
		val = parseFloat( val ) || 0;
	
		// Use the active box-sizing model to add/subtract irrelevant styles
		return ( val +
			augmentWidthOrHeight(
				elem,
				name,
				extra || ( isBorderBox ? "border" : "content" ),
				valueIsBorderBox,
				styles
			)
		) + "px";
	}
	
	jQuery.extend( {
	
		// Add in style property hooks for overriding the default
		// behavior of getting and setting a style property
		cssHooks: {
			opacity: {
				get: function( elem, computed ) {
					if ( computed ) {
	
						// We should always get a number back from opacity
						var ret = curCSS( elem, "opacity" );
						return ret === "" ? "1" : ret;
					}
				}
			}
		},
	
		// Don't automatically add "px" to these possibly-unitless properties
		cssNumber: {
			"animationIterationCount": true,
			"columnCount": true,
			"fillOpacity": true,
			"flexGrow": true,
			"flexShrink": true,
			"fontWeight": true,
			"lineHeight": true,
			"opacity": true,
			"order": true,
			"orphans": true,
			"widows": true,
			"zIndex": true,
			"zoom": true
		},
	
		// Add in properties whose names you wish to fix before
		// setting or getting the value
		cssProps: {
			"float": "cssFloat"
		},
	
		// Get and set the style property on a DOM Node
		style: function( elem, name, value, extra ) {
	
			// Don't set styles on text and comment nodes
			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
				return;
			}
	
			// Make sure that we're working with the right name
			var ret, type, hooks,
				origName = jQuery.camelCase( name ),
				isCustomProp = rcustomProp.test( name ),
				style = elem.style;
	
			// Make sure that we're working with the right name. We don't
			// want to query the value if it is a CSS custom property
			// since they are user-defined.
			if ( !isCustomProp ) {
				name = finalPropName( origName );
			}
	
			// Gets hook for the prefixed version, then unprefixed version
			hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
	
			// Check if we're setting a value
			if ( value !== undefined ) {
				type = typeof value;
	
				// Convert "+=" or "-=" to relative numbers (#7345)
				if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
					value = adjustCSS( elem, name, ret );
	
					// Fixes bug #9237
					type = "number";
				}
	
				// Make sure that null and NaN values aren't set (#7116)
				if ( value == null || value !== value ) {
					return;
				}
	
				// If a number was passed in, add the unit (except for certain CSS properties)
				if ( type === "number" ) {
					value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
				}
	
				// background-* props affect original clone's values
				if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
					style[ name ] = "inherit";
				}
	
				// If a hook was provided, use that value, otherwise just set the specified value
				if ( !hooks || !( "set" in hooks ) ||
					( value = hooks.set( elem, value, extra ) ) !== undefined ) {
	
					if ( isCustomProp ) {
						style.setProperty( name, value );
					} else {
						style[ name ] = value;
					}
				}
	
			} else {
	
				// If a hook was provided get the non-computed value from there
				if ( hooks && "get" in hooks &&
					( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
	
					return ret;
				}
	
				// Otherwise just get the value from the style object
				return style[ name ];
			}
		},
	
		css: function( elem, name, extra, styles ) {
			var val, num, hooks,
				origName = jQuery.camelCase( name ),
				isCustomProp = rcustomProp.test( name );
	
			// Make sure that we're working with the right name. We don't
			// want to modify the value if it is a CSS custom property
			// since they are user-defined.
			if ( !isCustomProp ) {
				name = finalPropName( origName );
			}
	
			// Try prefixed name followed by the unprefixed name
			hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
	
			// If a hook was provided get the computed value from there
			if ( hooks && "get" in hooks ) {
				val = hooks.get( elem, true, extra );
			}
	
			// Otherwise, if a way to get the computed value exists, use that
			if ( val === undefined ) {
				val = curCSS( elem, name, styles );
			}
	
			// Convert "normal" to computed value
			if ( val === "normal" && name in cssNormalTransform ) {
				val = cssNormalTransform[ name ];
			}
	
			// Make numeric if forced or a qualifier was provided and val looks numeric
			if ( extra === "" || extra ) {
				num = parseFloat( val );
				return extra === true || isFinite( num ) ? num || 0 : val;
			}
	
			return val;
		}
	} );
	
	jQuery.each( [ "height", "width" ], function( i, name ) {
		jQuery.cssHooks[ name ] = {
			get: function( elem, computed, extra ) {
				if ( computed ) {
	
					// Certain elements can have dimension info if we invisibly show them
					// but it must have a current display style that would benefit
					return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
	
						// Support: Safari 8+
						// Table columns in Safari have non-zero offsetWidth & zero
						// getBoundingClientRect().width unless display is changed.
						// Support: IE <=11 only
						// Running getBoundingClientRect on a disconnected node
						// in IE throws an error.
						( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
							swap( elem, cssShow, function() {
								return getWidthOrHeight( elem, name, extra );
							} ) :
							getWidthOrHeight( elem, name, extra );
				}
			},
	
			set: function( elem, value, extra ) {
				var matches,
					styles = extra && getStyles( elem ),
					subtract = extra && augmentWidthOrHeight(
						elem,
						name,
						extra,
						jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
						styles
					);
	
				// Convert to pixels if value adjustment is needed
				if ( subtract && ( matches = rcssNum.exec( value ) ) &&
					( matches[ 3 ] || "px" ) !== "px" ) {
	
					elem.style[ name ] = value;
					value = jQuery.css( elem, name );
				}
	
				return setPositiveNumber( elem, value, subtract );
			}
		};
	} );
	
	jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
		function( elem, computed ) {
			if ( computed ) {
				return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
					elem.getBoundingClientRect().left -
						swap( elem, { marginLeft: 0 }, function() {
							return elem.getBoundingClientRect().left;
						} )
					) + "px";
			}
		}
	);
	
	// These hooks are used by animate to expand properties
	jQuery.each( {
		margin: "",
		padding: "",
		border: "Width"
	}, function( prefix, suffix ) {
		jQuery.cssHooks[ prefix + suffix ] = {
			expand: function( value ) {
				var i = 0,
					expanded = {},
	
					// Assumes a single number if not a string
					parts = typeof value === "string" ? value.split( " " ) : [ value ];
	
				for ( ; i < 4; i++ ) {
					expanded[ prefix + cssExpand[ i ] + suffix ] =
						parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
				}
	
				return expanded;
			}
		};
	
		if ( !rmargin.test( prefix ) ) {
			jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
		}
	} );
	
	jQuery.fn.extend( {
		css: function( name, value ) {
			return access( this, function( elem, name, value ) {
				var styles, len,
					map = {},
					i = 0;
	
				if ( Array.isArray( name ) ) {
					styles = getStyles( elem );
					len = name.length;
	
					for ( ; i < len; i++ ) {
						map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
					}
	
					return map;
				}
	
				return value !== undefined ?
					jQuery.style( elem, name, value ) :
					jQuery.css( elem, name );
			}, name, value, arguments.length > 1 );
		}
	} );
	
	
	function Tween( elem, options, prop, end, easing ) {
		return new Tween.prototype.init( elem, options, prop, end, easing );
	}
	jQuery.Tween = Tween;
	
	Tween.prototype = {
		constructor: Tween,
		init: function( elem, options, prop, end, easing, unit ) {
			this.elem = elem;
			this.prop = prop;
			this.easing = easing || jQuery.easing._default;
			this.options = options;
			this.start = this.now = this.cur();
			this.end = end;
			this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
		},
		cur: function() {
			var hooks = Tween.propHooks[ this.prop ];
	
			return hooks && hooks.get ?
				hooks.get( this ) :
				Tween.propHooks._default.get( this );
		},
		run: function( percent ) {
			var eased,
				hooks = Tween.propHooks[ this.prop ];
	
			if ( this.options.duration ) {
				this.pos = eased = jQuery.easing[ this.easing ](
					percent, this.options.duration * percent, 0, 1, this.options.duration
				);
			} else {
				this.pos = eased = percent;
			}
			this.now = ( this.end - this.start ) * eased + this.start;
	
			if ( this.options.step ) {
				this.options.step.call( this.elem, this.now, this );
			}
	
			if ( hooks && hooks.set ) {
				hooks.set( this );
			} else {
				Tween.propHooks._default.set( this );
			}
			return this;
		}
	};
	
	Tween.prototype.init.prototype = Tween.prototype;
	
	Tween.propHooks = {
		_default: {
			get: function( tween ) {
				var result;
	
				// Use a property on the element directly when it is not a DOM element,
				// or when there is no matching style property that exists.
				if ( tween.elem.nodeType !== 1 ||
					tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
					return tween.elem[ tween.prop ];
				}
	
				// Passing an empty string as a 3rd parameter to .css will automatically
				// attempt a parseFloat and fallback to a string if the parse fails.
				// Simple values such as "10px" are parsed to Float;
				// complex values such as "rotate(1rad)" are returned as-is.
				result = jQuery.css( tween.elem, tween.prop, "" );
	
				// Empty strings, null, undefined and "auto" are converted to 0.
				return !result || result === "auto" ? 0 : result;
			},
			set: function( tween ) {
	
				// Use step hook for back compat.
				// Use cssHook if its there.
				// Use .style if available and use plain properties where available.
				if ( jQuery.fx.step[ tween.prop ] ) {
					jQuery.fx.step[ tween.prop ]( tween );
				} else if ( tween.elem.nodeType === 1 &&
					( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
						jQuery.cssHooks[ tween.prop ] ) ) {
					jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
				} else {
					tween.elem[ tween.prop ] = tween.now;
				}
			}
		}
	};
	
	// Support: IE <=9 only
	// Panic based approach to setting things on disconnected nodes
	Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
		set: function( tween ) {
			if ( tween.elem.nodeType && tween.elem.parentNode ) {
				tween.elem[ tween.prop ] = tween.now;
			}
		}
	};
	
	jQuery.easing = {
		linear: function( p ) {
			return p;
		},
		swing: function( p ) {
			return 0.5 - Math.cos( p * Math.PI ) / 2;
		},
		_default: "swing"
	};
	
	jQuery.fx = Tween.prototype.init;
	
	// Back compat <1.8 extension point
	jQuery.fx.step = {};
	
	
	
	
	var
		fxNow, inProgress,
		rfxtypes = /^(?:toggle|show|hide)$/,
		rrun = /queueHooks$/;
	
	function schedule() {
		if ( inProgress ) {
			if ( document.hidden === false && window.requestAnimationFrame ) {
				window.requestAnimationFrame( schedule );
			} else {
				window.setTimeout( schedule, jQuery.fx.interval );
			}
	
			jQuery.fx.tick();
		}
	}
	
	// Animations created synchronously will run synchronously
	function createFxNow() {
		window.setTimeout( function() {
			fxNow = undefined;
		} );
		return ( fxNow = jQuery.now() );
	}
	
	// Generate parameters to create a standard animation
	function genFx( type, includeWidth ) {
		var which,
			i = 0,
			attrs = { height: type };
	
		// If we include width, step value is 1 to do all cssExpand values,
		// otherwise step value is 2 to skip over Left and Right
		includeWidth = includeWidth ? 1 : 0;
		for ( ; i < 4; i += 2 - includeWidth ) {
			which = cssExpand[ i ];
			attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
		}
	
		if ( includeWidth ) {
			attrs.opacity = attrs.width = type;
		}
	
		return attrs;
	}
	
	function createTween( value, prop, animation ) {
		var tween,
			collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
			index = 0,
			length = collection.length;
		for ( ; index < length; index++ ) {
			if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
	
				// We're done with this property
				return tween;
			}
		}
	}
	
	function defaultPrefilter( elem, props, opts ) {
		var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
			isBox = "width" in props || "height" in props,
			anim = this,
			orig = {},
			style = elem.style,
			hidden = elem.nodeType && isHiddenWithinTree( elem ),
			dataShow = dataPriv.get( elem, "fxshow" );
	
		// Queue-skipping animations hijack the fx hooks
		if ( !opts.queue ) {
			hooks = jQuery._queueHooks( elem, "fx" );
			if ( hooks.unqueued == null ) {
				hooks.unqueued = 0;
				oldfire = hooks.empty.fire;
				hooks.empty.fire = function() {
					if ( !hooks.unqueued ) {
						oldfire();
					}
				};
			}
			hooks.unqueued++;
	
			anim.always( function() {
	
				// Ensure the complete handler is called before this completes
				anim.always( function() {
					hooks.unqueued--;
					if ( !jQuery.queue( elem, "fx" ).length ) {
						hooks.empty.fire();
					}
				} );
			} );
		}
	
		// Detect show/hide animations
		for ( prop in props ) {
			value = props[ prop ];
			if ( rfxtypes.test( value ) ) {
				delete props[ prop ];
				toggle = toggle || value === "toggle";
				if ( value === ( hidden ? "hide" : "show" ) ) {
	
					// Pretend to be hidden if this is a "show" and
					// there is still data from a stopped show/hide
					if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
						hidden = true;
	
					// Ignore all other no-op show/hide data
					} else {
						continue;
					}
				}
				orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
			}
		}
	
		// Bail out if this is a no-op like .hide().hide()
		propTween = !jQuery.isEmptyObject( props );
		if ( !propTween && jQuery.isEmptyObject( orig ) ) {
			return;
		}
	
		// Restrict "overflow" and "display" styles during box animations
		if ( isBox && elem.nodeType === 1 ) {
	
			// Support: IE <=9 - 11, Edge 12 - 13
			// Record all 3 overflow attributes because IE does not infer the shorthand
			// from identically-valued overflowX and overflowY
			opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
	
			// Identify a display type, preferring old show/hide data over the CSS cascade
			restoreDisplay = dataShow && dataShow.display;
			if ( restoreDisplay == null ) {
				restoreDisplay = dataPriv.get( elem, "display" );
			}
			display = jQuery.css( elem, "display" );
			if ( display === "none" ) {
				if ( restoreDisplay ) {
					display = restoreDisplay;
				} else {
	
					// Get nonempty value(s) by temporarily forcing visibility
					showHide( [ elem ], true );
					restoreDisplay = elem.style.display || restoreDisplay;
					display = jQuery.css( elem, "display" );
					showHide( [ elem ] );
				}
			}
	
			// Animate inline elements as inline-block
			if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
				if ( jQuery.css( elem, "float" ) === "none" ) {
	
					// Restore the original display value at the end of pure show/hide animations
					if ( !propTween ) {
						anim.done( function() {
							style.display = restoreDisplay;
						} );
						if ( restoreDisplay == null ) {
							display = style.display;
							restoreDisplay = display === "none" ? "" : display;
						}
					}
					style.display = "inline-block";
				}
			}
		}
	
		if ( opts.overflow ) {
			style.overflow = "hidden";
			anim.always( function() {
				style.overflow = opts.overflow[ 0 ];
				style.overflowX = opts.overflow[ 1 ];
				style.overflowY = opts.overflow[ 2 ];
			} );
		}
	
		// Implement show/hide animations
		propTween = false;
		for ( prop in orig ) {
	
			// General show/hide setup for this element animation
			if ( !propTween ) {
				if ( dataShow ) {
					if ( "hidden" in dataShow ) {
						hidden = dataShow.hidden;
					}
				} else {
					dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
				}
	
				// Store hidden/visible for toggle so `.stop().toggle()` "reverses"
				if ( toggle ) {
					dataShow.hidden = !hidden;
				}
	
				// Show elements before animating them
				if ( hidden ) {
					showHide( [ elem ], true );
				}
	
				/* eslint-disable no-loop-func */
	
				anim.done( function() {
	
				/* eslint-enable no-loop-func */
	
					// The final step of a "hide" animation is actually hiding the element
					if ( !hidden ) {
						showHide( [ elem ] );
					}
					dataPriv.remove( elem, "fxshow" );
					for ( prop in orig ) {
						jQuery.style( elem, prop, orig[ prop ] );
					}
				} );
			}
	
			// Per-property setup
			propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
			if ( !( prop in dataShow ) ) {
				dataShow[ prop ] = propTween.start;
				if ( hidden ) {
					propTween.end = propTween.start;
					propTween.start = 0;
				}
			}
		}
	}
	
	function propFilter( props, specialEasing ) {
		var index, name, easing, value, hooks;
	
		// camelCase, specialEasing and expand cssHook pass
		for ( index in props ) {
			name = jQuery.camelCase( index );
			easing = specialEasing[ name ];
			value = props[ index ];
			if ( Array.isArray( value ) ) {
				easing = value[ 1 ];
				value = props[ index ] = value[ 0 ];
			}
	
			if ( index !== name ) {
				props[ name ] = value;
				delete props[ index ];
			}
	
			hooks = jQuery.cssHooks[ name ];
			if ( hooks && "expand" in hooks ) {
				value = hooks.expand( value );
				delete props[ name ];
	
				// Not quite $.extend, this won't overwrite existing keys.
				// Reusing 'index' because we have the correct "name"
				for ( index in value ) {
					if ( !( index in props ) ) {
						props[ index ] = value[ index ];
						specialEasing[ index ] = easing;
					}
				}
			} else {
				specialEasing[ name ] = easing;
			}
		}
	}
	
	function Animation( elem, properties, options ) {
		var result,
			stopped,
			index = 0,
			length = Animation.prefilters.length,
			deferred = jQuery.Deferred().always( function() {
	
				// Don't match elem in the :animated selector
				delete tick.elem;
			} ),
			tick = function() {
				if ( stopped ) {
					return false;
				}
				var currentTime = fxNow || createFxNow(),
					remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
	
					// Support: Android 2.3 only
					// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
					temp = remaining / animation.duration || 0,
					percent = 1 - temp,
					index = 0,
					length = animation.tweens.length;
	
				for ( ; index < length; index++ ) {
					animation.tweens[ index ].run( percent );
				}
	
				deferred.notifyWith( elem, [ animation, percent, remaining ] );
	
				// If there's more to do, yield
				if ( percent < 1 && length ) {
					return remaining;
				}
	
				// If this was an empty animation, synthesize a final progress notification
				if ( !length ) {
					deferred.notifyWith( elem, [ animation, 1, 0 ] );
				}
	
				// Resolve the animation and report its conclusion
				deferred.resolveWith( elem, [ animation ] );
				return false;
			},
			animation = deferred.promise( {
				elem: elem,
				props: jQuery.extend( {}, properties ),
				opts: jQuery.extend( true, {
					specialEasing: {},
					easing: jQuery.easing._default
				}, options ),
				originalProperties: properties,
				originalOptions: options,
				startTime: fxNow || createFxNow(),
				duration: options.duration,
				tweens: [],
				createTween: function( prop, end ) {
					var tween = jQuery.Tween( elem, animation.opts, prop, end,
							animation.opts.specialEasing[ prop ] || animation.opts.easing );
					animation.tweens.push( tween );
					return tween;
				},
				stop: function( gotoEnd ) {
					var index = 0,
	
						// If we are going to the end, we want to run all the tweens
						// otherwise we skip this part
						length = gotoEnd ? animation.tweens.length : 0;
					if ( stopped ) {
						return this;
					}
					stopped = true;
					for ( ; index < length; index++ ) {
						animation.tweens[ index ].run( 1 );
					}
	
					// Resolve when we played the last frame; otherwise, reject
					if ( gotoEnd ) {
						deferred.notifyWith( elem, [ animation, 1, 0 ] );
						deferred.resolveWith( elem, [ animation, gotoEnd ] );
					} else {
						deferred.rejectWith( elem, [ animation, gotoEnd ] );
					}
					return this;
				}
			} ),
			props = animation.props;
	
		propFilter( props, animation.opts.specialEasing );
	
		for ( ; index < length; index++ ) {
			result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
			if ( result ) {
				if ( jQuery.isFunction( result.stop ) ) {
					jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
						jQuery.proxy( result.stop, result );
				}
				return result;
			}
		}
	
		jQuery.map( props, createTween, animation );
	
		if ( jQuery.isFunction( animation.opts.start ) ) {
			animation.opts.start.call( elem, animation );
		}
	
		// Attach callbacks from options
		animation
			.progress( animation.opts.progress )
			.done( animation.opts.done, animation.opts.complete )
			.fail( animation.opts.fail )
			.always( animation.opts.always );
	
		jQuery.fx.timer(
			jQuery.extend( tick, {
				elem: elem,
				anim: animation,
				queue: animation.opts.queue
			} )
		);
	
		return animation;
	}
	
	jQuery.Animation = jQuery.extend( Animation, {
	
		tweeners: {
			"*": [ function( prop, value ) {
				var tween = this.createTween( prop, value );
				adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
				return tween;
			} ]
		},
	
		tweener: function( props, callback ) {
			if ( jQuery.isFunction( props ) ) {
				callback = props;
				props = [ "*" ];
			} else {
				props = props.match( rnothtmlwhite );
			}
	
			var prop,
				index = 0,
				length = props.length;
	
			for ( ; index < length; index++ ) {
				prop = props[ index ];
				Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
				Animation.tweeners[ prop ].unshift( callback );
			}
		},
	
		prefilters: [ defaultPrefilter ],
	
		prefilter: function( callback, prepend ) {
			if ( prepend ) {
				Animation.prefilters.unshift( callback );
			} else {
				Animation.prefilters.push( callback );
			}
		}
	} );
	
	jQuery.speed = function( speed, easing, fn ) {
		var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
			complete: fn || !fn && easing ||
				jQuery.isFunction( speed ) && speed,
			duration: speed,
			easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
		};
	
		// Go to the end state if fx are off
		if ( jQuery.fx.off ) {
			opt.duration = 0;
	
		} else {
			if ( typeof opt.duration !== "number" ) {
				if ( opt.duration in jQuery.fx.speeds ) {
					opt.duration = jQuery.fx.speeds[ opt.duration ];
	
				} else {
					opt.duration = jQuery.fx.speeds._default;
				}
			}
		}
	
		// Normalize opt.queue - true/undefined/null -> "fx"
		if ( opt.queue == null || opt.queue === true ) {
			opt.queue = "fx";
		}
	
		// Queueing
		opt.old = opt.complete;
	
		opt.complete = function() {
			if ( jQuery.isFunction( opt.old ) ) {
				opt.old.call( this );
			}
	
			if ( opt.queue ) {
				jQuery.dequeue( this, opt.queue );
			}
		};
	
		return opt;
	};
	
	jQuery.fn.extend( {
		fadeTo: function( speed, to, easing, callback ) {
	
			// Show any hidden elements after setting opacity to 0
			return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
	
				// Animate to the value specified
				.end().animate( { opacity: to }, speed, easing, callback );
		},
		animate: function( prop, speed, easing, callback ) {
			var empty = jQuery.isEmptyObject( prop ),
				optall = jQuery.speed( speed, easing, callback ),
				doAnimation = function() {
	
					// Operate on a copy of prop so per-property easing won't be lost
					var anim = Animation( this, jQuery.extend( {}, prop ), optall );
	
					// Empty animations, or finishing resolves immediately
					if ( empty || dataPriv.get( this, "finish" ) ) {
						anim.stop( true );
					}
				};
				doAnimation.finish = doAnimation;
	
			return empty || optall.queue === false ?
				this.each( doAnimation ) :
				this.queue( optall.queue, doAnimation );
		},
		stop: function( type, clearQueue, gotoEnd ) {
			var stopQueue = function( hooks ) {
				var stop = hooks.stop;
				delete hooks.stop;
				stop( gotoEnd );
			};
	
			if ( typeof type !== "string" ) {
				gotoEnd = clearQueue;
				clearQueue = type;
				type = undefined;
			}
			if ( clearQueue && type !== false ) {
				this.queue( type || "fx", [] );
			}
	
			return this.each( function() {
				var dequeue = true,
					index = type != null && type + "queueHooks",
					timers = jQuery.timers,
					data = dataPriv.get( this );
	
				if ( index ) {
					if ( data[ index ] && data[ index ].stop ) {
						stopQueue( data[ index ] );
					}
				} else {
					for ( index in data ) {
						if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
							stopQueue( data[ index ] );
						}
					}
				}
	
				for ( index = timers.length; index--; ) {
					if ( timers[ index ].elem === this &&
						( type == null || timers[ index ].queue === type ) ) {
	
						timers[ index ].anim.stop( gotoEnd );
						dequeue = false;
						timers.splice( index, 1 );
					}
				}
	
				// Start the next in the queue if the last step wasn't forced.
				// Timers currently will call their complete callbacks, which
				// will dequeue but only if they were gotoEnd.
				if ( dequeue || !gotoEnd ) {
					jQuery.dequeue( this, type );
				}
			} );
		},
		finish: function( type ) {
			if ( type !== false ) {
				type = type || "fx";
			}
			return this.each( function() {
				var index,
					data = dataPriv.get( this ),
					queue = data[ type + "queue" ],
					hooks = data[ type + "queueHooks" ],
					timers = jQuery.timers,
					length = queue ? queue.length : 0;
	
				// Enable finishing flag on private data
				data.finish = true;
	
				// Empty the queue first
				jQuery.queue( this, type, [] );
	
				if ( hooks && hooks.stop ) {
					hooks.stop.call( this, true );
				}
	
				// Look for any active animations, and finish them
				for ( index = timers.length; index--; ) {
					if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
						timers[ index ].anim.stop( true );
						timers.splice( index, 1 );
					}
				}
	
				// Look for any animations in the old queue and finish them
				for ( index = 0; index < length; index++ ) {
					if ( queue[ index ] && queue[ index ].finish ) {
						queue[ index ].finish.call( this );
					}
				}
	
				// Turn off finishing flag
				delete data.finish;
			} );
		}
	} );
	
	jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
		var cssFn = jQuery.fn[ name ];
		jQuery.fn[ name ] = function( speed, easing, callback ) {
			return speed == null || typeof speed === "boolean" ?
				cssFn.apply( this, arguments ) :
				this.animate( genFx( name, true ), speed, easing, callback );
		};
	} );
	
	// Generate shortcuts for custom animations
	jQuery.each( {
		slideDown: genFx( "show" ),
		slideUp: genFx( "hide" ),
		slideToggle: genFx( "toggle" ),
		fadeIn: { opacity: "show" },
		fadeOut: { opacity: "hide" },
		fadeToggle: { opacity: "toggle" }
	}, function( name, props ) {
		jQuery.fn[ name ] = function( speed, easing, callback ) {
			return this.animate( props, speed, easing, callback );
		};
	} );
	
	jQuery.timers = [];
	jQuery.fx.tick = function() {
		var timer,
			i = 0,
			timers = jQuery.timers;
	
		fxNow = jQuery.now();
	
		for ( ; i < timers.length; i++ ) {
			timer = timers[ i ];
	
			// Run the timer and safely remove it when done (allowing for external removal)
			if ( !timer() && timers[ i ] === timer ) {
				timers.splice( i--, 1 );
			}
		}
	
		if ( !timers.length ) {
			jQuery.fx.stop();
		}
		fxNow = undefined;
	};
	
	jQuery.fx.timer = function( timer ) {
		jQuery.timers.push( timer );
		jQuery.fx.start();
	};
	
	jQuery.fx.interval = 13;
	jQuery.fx.start = function() {
		if ( inProgress ) {
			return;
		}
	
		inProgress = true;
		schedule();
	};
	
	jQuery.fx.stop = function() {
		inProgress = null;
	};
	
	jQuery.fx.speeds = {
		slow: 600,
		fast: 200,
	
		// Default speed
		_default: 400
	};
	
	
	// Based off of the plugin by Clint Helfers, with permission.
	// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
	jQuery.fn.delay = function( time, type ) {
		time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
		type = type || "fx";
	
		return this.queue( type, function( next, hooks ) {
			var timeout = window.setTimeout( next, time );
			hooks.stop = function() {
				window.clearTimeout( timeout );
			};
		} );
	};
	
	
	( function() {
		var input = document.createElement( "input" ),
			select = document.createElement( "select" ),
			opt = select.appendChild( document.createElement( "option" ) );
	
		input.type = "checkbox";
	
		// Support: Android <=4.3 only
		// Default value for a checkbox should be "on"
		support.checkOn = input.value !== "";
	
		// Support: IE <=11 only
		// Must access selectedIndex to make default options select
		support.optSelected = opt.selected;
	
		// Support: IE <=11 only
		// An input loses its value after becoming a radio
		input = document.createElement( "input" );
		input.value = "t";
		input.type = "radio";
		support.radioValue = input.value === "t";
	} )();
	
	
	var boolHook,
		attrHandle = jQuery.expr.attrHandle;
	
	jQuery.fn.extend( {
		attr: function( name, value ) {
			return access( this, jQuery.attr, name, value, arguments.length > 1 );
		},
	
		removeAttr: function( name ) {
			return this.each( function() {
				jQuery.removeAttr( this, name );
			} );
		}
	} );
	
	jQuery.extend( {
		attr: function( elem, name, value ) {
			var ret, hooks,
				nType = elem.nodeType;
	
			// Don't get/set attributes on text, comment and attribute nodes
			if ( nType === 3 || nType === 8 || nType === 2 ) {
				return;
			}
	
			// Fallback to prop when attributes are not supported
			if ( typeof elem.getAttribute === "undefined" ) {
				return jQuery.prop( elem, name, value );
			}
	
			// Attribute hooks are determined by the lowercase version
			// Grab necessary hook if one is defined
			if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
				hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
					( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
			}
	
			if ( value !== undefined ) {
				if ( value === null ) {
					jQuery.removeAttr( elem, name );
					return;
				}
	
				if ( hooks && "set" in hooks &&
					( ret = hooks.set( elem, value, name ) ) !== undefined ) {
					return ret;
				}
	
				elem.setAttribute( name, value + "" );
				return value;
			}
	
			if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
				return ret;
			}
	
			ret = jQuery.find.attr( elem, name );
	
			// Non-existent attributes return null, we normalize to undefined
			return ret == null ? undefined : ret;
		},
	
		attrHooks: {
			type: {
				set: function( elem, value ) {
					if ( !support.radioValue && value === "radio" &&
						nodeName( elem, "input" ) ) {
						var val = elem.value;
						elem.setAttribute( "type", value );
						if ( val ) {
							elem.value = val;
						}
						return value;
					}
				}
			}
		},
	
		removeAttr: function( elem, value ) {
			var name,
				i = 0,
	
				// Attribute names can contain non-HTML whitespace characters
				// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
				attrNames = value && value.match( rnothtmlwhite );
	
			if ( attrNames && elem.nodeType === 1 ) {
				while ( ( name = attrNames[ i++ ] ) ) {
					elem.removeAttribute( name );
				}
			}
		}
	} );
	
	// Hooks for boolean attributes
	boolHook = {
		set: function( elem, value, name ) {
			if ( value === false ) {
	
				// Remove boolean attributes when set to false
				jQuery.removeAttr( elem, name );
			} else {
				elem.setAttribute( name, name );
			}
			return name;
		}
	};
	
	jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
		var getter = attrHandle[ name ] || jQuery.find.attr;
	
		attrHandle[ name ] = function( elem, name, isXML ) {
			var ret, handle,
				lowercaseName = name.toLowerCase();
	
			if ( !isXML ) {
	
				// Avoid an infinite loop by temporarily removing this function from the getter
				handle = attrHandle[ lowercaseName ];
				attrHandle[ lowercaseName ] = ret;
				ret = getter( elem, name, isXML ) != null ?
					lowercaseName :
					null;
				attrHandle[ lowercaseName ] = handle;
			}
			return ret;
		};
	} );
	
	
	
	
	var rfocusable = /^(?:input|select|textarea|button)$/i,
		rclickable = /^(?:a|area)$/i;
	
	jQuery.fn.extend( {
		prop: function( name, value ) {
			return access( this, jQuery.prop, name, value, arguments.length > 1 );
		},
	
		removeProp: function( name ) {
			return this.each( function() {
				delete this[ jQuery.propFix[ name ] || name ];
			} );
		}
	} );
	
	jQuery.extend( {
		prop: function( elem, name, value ) {
			var ret, hooks,
				nType = elem.nodeType;
	
			// Don't get/set properties on text, comment and attribute nodes
			if ( nType === 3 || nType === 8 || nType === 2 ) {
				return;
			}
	
			if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
	
				// Fix name and attach hooks
				name = jQuery.propFix[ name ] || name;
				hooks = jQuery.propHooks[ name ];
			}
	
			if ( value !== undefined ) {
				if ( hooks && "set" in hooks &&
					( ret = hooks.set( elem, value, name ) ) !== undefined ) {
					return ret;
				}
	
				return ( elem[ name ] = value );
			}
	
			if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
				return ret;
			}
	
			return elem[ name ];
		},
	
		propHooks: {
			tabIndex: {
				get: function( elem ) {
	
					// Support: IE <=9 - 11 only
					// elem.tabIndex doesn't always return the
					// correct value when it hasn't been explicitly set
					// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
					// Use proper attribute retrieval(#12072)
					var tabindex = jQuery.find.attr( elem, "tabindex" );
	
					if ( tabindex ) {
						return parseInt( tabindex, 10 );
					}
	
					if (
						rfocusable.test( elem.nodeName ) ||
						rclickable.test( elem.nodeName ) &&
						elem.href
					) {
						return 0;
					}
	
					return -1;
				}
			}
		},
	
		propFix: {
			"for": "htmlFor",
			"class": "className"
		}
	} );
	
	// Support: IE <=11 only
	// Accessing the selectedIndex property
	// forces the browser to respect setting selected
	// on the option
	// The getter ensures a default option is selected
	// when in an optgroup
	// eslint rule "no-unused-expressions" is disabled for this code
	// since it considers such accessions noop
	if ( !support.optSelected ) {
		jQuery.propHooks.selected = {
			get: function( elem ) {
	
				/* eslint no-unused-expressions: "off" */
	
				var parent = elem.parentNode;
				if ( parent && parent.parentNode ) {
					parent.parentNode.selectedIndex;
				}
				return null;
			},
			set: function( elem ) {
	
				/* eslint no-unused-expressions: "off" */
	
				var parent = elem.parentNode;
				if ( parent ) {
					parent.selectedIndex;
	
					if ( parent.parentNode ) {
						parent.parentNode.selectedIndex;
					}
				}
			}
		};
	}
	
	jQuery.each( [
		"tabIndex",
		"readOnly",
		"maxLength",
		"cellSpacing",
		"cellPadding",
		"rowSpan",
		"colSpan",
		"useMap",
		"frameBorder",
		"contentEditable"
	], function() {
		jQuery.propFix[ this.toLowerCase() ] = this;
	} );
	
	
	
	
		// Strip and collapse whitespace according to HTML spec
		// https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
		function stripAndCollapse( value ) {
			var tokens = value.match( rnothtmlwhite ) || [];
			return tokens.join( " " );
		}
	
	
	function getClass( elem ) {
		return elem.getAttribute && elem.getAttribute( "class" ) || "";
	}
	
	jQuery.fn.extend( {
		addClass: function( value ) {
			var classes, elem, cur, curValue, clazz, j, finalValue,
				i = 0;
	
			if ( jQuery.isFunction( value ) ) {
				return this.each( function( j ) {
					jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
				} );
			}
	
			if ( typeof value === "string" && value ) {
				classes = value.match( rnothtmlwhite ) || [];
	
				while ( ( elem = this[ i++ ] ) ) {
					curValue = getClass( elem );
					cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
	
					if ( cur ) {
						j = 0;
						while ( ( clazz = classes[ j++ ] ) ) {
							if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
								cur += clazz + " ";
							}
						}
	
						// Only assign if different to avoid unneeded rendering.
						finalValue = stripAndCollapse( cur );
						if ( curValue !== finalValue ) {
							elem.setAttribute( "class", finalValue );
						}
					}
				}
			}
	
			return this;
		},
	
		removeClass: function( value ) {
			var classes, elem, cur, curValue, clazz, j, finalValue,
				i = 0;
	
			if ( jQuery.isFunction( value ) ) {
				return this.each( function( j ) {
					jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
				} );
			}
	
			if ( !arguments.length ) {
				return this.attr( "class", "" );
			}
	
			if ( typeof value === "string" && value ) {
				classes = value.match( rnothtmlwhite ) || [];
	
				while ( ( elem = this[ i++ ] ) ) {
					curValue = getClass( elem );
	
					// This expression is here for better compressibility (see addClass)
					cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
	
					if ( cur ) {
						j = 0;
						while ( ( clazz = classes[ j++ ] ) ) {
	
							// Remove *all* instances
							while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
								cur = cur.replace( " " + clazz + " ", " " );
							}
						}
	
						// Only assign if different to avoid unneeded rendering.
						finalValue = stripAndCollapse( cur );
						if ( curValue !== finalValue ) {
							elem.setAttribute( "class", finalValue );
						}
					}
				}
			}
	
			return this;
		},
	
		toggleClass: function( value, stateVal ) {
			var type = typeof value;
	
			if ( typeof stateVal === "boolean" && type === "string" ) {
				return stateVal ? this.addClass( value ) : this.removeClass( value );
			}
	
			if ( jQuery.isFunction( value ) ) {
				return this.each( function( i ) {
					jQuery( this ).toggleClass(
						value.call( this, i, getClass( this ), stateVal ),
						stateVal
					);
				} );
			}
	
			return this.each( function() {
				var className, i, self, classNames;
	
				if ( type === "string" ) {
	
					// Toggle individual class names
					i = 0;
					self = jQuery( this );
					classNames = value.match( rnothtmlwhite ) || [];
	
					while ( ( className = classNames[ i++ ] ) ) {
	
						// Check each className given, space separated list
						if ( self.hasClass( className ) ) {
							self.removeClass( className );
						} else {
							self.addClass( className );
						}
					}
	
				// Toggle whole class name
				} else if ( value === undefined || type === "boolean" ) {
					className = getClass( this );
					if ( className ) {
	
						// Store className if set
						dataPriv.set( this, "__className__", className );
					}
	
					// If the element has a class name or if we're passed `false`,
					// then remove the whole classname (if there was one, the above saved it).
					// Otherwise bring back whatever was previously saved (if anything),
					// falling back to the empty string if nothing was stored.
					if ( this.setAttribute ) {
						this.setAttribute( "class",
							className || value === false ?
							"" :
							dataPriv.get( this, "__className__" ) || ""
						);
					}
				}
			} );
		},
	
		hasClass: function( selector ) {
			var className, elem,
				i = 0;
	
			className = " " + selector + " ";
			while ( ( elem = this[ i++ ] ) ) {
				if ( elem.nodeType === 1 &&
					( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
						return true;
				}
			}
	
			return false;
		}
	} );
	
	
	
	
	var rreturn = /\r/g;
	
	jQuery.fn.extend( {
		val: function( value ) {
			var hooks, ret, isFunction,
				elem = this[ 0 ];
	
			if ( !arguments.length ) {
				if ( elem ) {
					hooks = jQuery.valHooks[ elem.type ] ||
						jQuery.valHooks[ elem.nodeName.toLowerCase() ];
	
					if ( hooks &&
						"get" in hooks &&
						( ret = hooks.get( elem, "value" ) ) !== undefined
					) {
						return ret;
					}
	
					ret = elem.value;
	
					// Handle most common string cases
					if ( typeof ret === "string" ) {
						return ret.replace( rreturn, "" );
					}
	
					// Handle cases where value is null/undef or number
					return ret == null ? "" : ret;
				}
	
				return;
			}
	
			isFunction = jQuery.isFunction( value );
	
			return this.each( function( i ) {
				var val;
	
				if ( this.nodeType !== 1 ) {
					return;
				}
	
				if ( isFunction ) {
					val = value.call( this, i, jQuery( this ).val() );
				} else {
					val = value;
				}
	
				// Treat null/undefined as ""; convert numbers to string
				if ( val == null ) {
					val = "";
	
				} else if ( typeof val === "number" ) {
					val += "";
	
				} else if ( Array.isArray( val ) ) {
					val = jQuery.map( val, function( value ) {
						return value == null ? "" : value + "";
					} );
				}
	
				hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
	
				// If set returns undefined, fall back to normal setting
				if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
					this.value = val;
				}
			} );
		}
	} );
	
	jQuery.extend( {
		valHooks: {
			option: {
				get: function( elem ) {
	
					var val = jQuery.find.attr( elem, "value" );
					return val != null ?
						val :
	
						// Support: IE <=10 - 11 only
						// option.text throws exceptions (#14686, #14858)
						// Strip and collapse whitespace
						// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
						stripAndCollapse( jQuery.text( elem ) );
				}
			},
			select: {
				get: function( elem ) {
					var value, option, i,
						options = elem.options,
						index = elem.selectedIndex,
						one = elem.type === "select-one",
						values = one ? null : [],
						max = one ? index + 1 : options.length;
	
					if ( index < 0 ) {
						i = max;
	
					} else {
						i = one ? index : 0;
					}
	
					// Loop through all the selected options
					for ( ; i < max; i++ ) {
						option = options[ i ];
	
						// Support: IE <=9 only
						// IE8-9 doesn't update selected after form reset (#2551)
						if ( ( option.selected || i === index ) &&
	
								// Don't return options that are disabled or in a disabled optgroup
								!option.disabled &&
								( !option.parentNode.disabled ||
									!nodeName( option.parentNode, "optgroup" ) ) ) {
	
							// Get the specific value for the option
							value = jQuery( option ).val();
	
							// We don't need an array for one selects
							if ( one ) {
								return value;
							}
	
							// Multi-Selects return an array
							values.push( value );
						}
					}
	
					return values;
				},
	
				set: function( elem, value ) {
					var optionSet, option,
						options = elem.options,
						values = jQuery.makeArray( value ),
						i = options.length;
	
					while ( i-- ) {
						option = options[ i ];
	
						/* eslint-disable no-cond-assign */
	
						if ( option.selected =
							jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
						) {
							optionSet = true;
						}
	
						/* eslint-enable no-cond-assign */
					}
	
					// Force browsers to behave consistently when non-matching value is set
					if ( !optionSet ) {
						elem.selectedIndex = -1;
					}
					return values;
				}
			}
		}
	} );
	
	// Radios and checkboxes getter/setter
	jQuery.each( [ "radio", "checkbox" ], function() {
		jQuery.valHooks[ this ] = {
			set: function( elem, value ) {
				if ( Array.isArray( value ) ) {
					return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
				}
			}
		};
		if ( !support.checkOn ) {
			jQuery.valHooks[ this ].get = function( elem ) {
				return elem.getAttribute( "value" ) === null ? "on" : elem.value;
			};
		}
	} );
	
	
	
	
	// Return jQuery for attributes-only inclusion
	
	
	var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
	
	jQuery.extend( jQuery.event, {
	
		trigger: function( event, data, elem, onlyHandlers ) {
	
			var i, cur, tmp, bubbleType, ontype, handle, special,
				eventPath = [ elem || document ],
				type = hasOwn.call( event, "type" ) ? event.type : event,
				namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
	
			cur = tmp = elem = elem || document;
	
			// Don't do events on text and comment nodes
			if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
				return;
			}
	
			// focus/blur morphs to focusin/out; ensure we're not firing them right now
			if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
				return;
			}
	
			if ( type.indexOf( "." ) > -1 ) {
	
				// Namespaced trigger; create a regexp to match event type in handle()
				namespaces = type.split( "." );
				type = namespaces.shift();
				namespaces.sort();
			}
			ontype = type.indexOf( ":" ) < 0 && "on" + type;
	
			// Caller can pass in a jQuery.Event object, Object, or just an event type string
			event = event[ jQuery.expando ] ?
				event :
				new jQuery.Event( type, typeof event === "object" && event );
	
			// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
			event.isTrigger = onlyHandlers ? 2 : 3;
			event.namespace = namespaces.join( "." );
			event.rnamespace = event.namespace ?
				new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
				null;
	
			// Clean up the event in case it is being reused
			event.result = undefined;
			if ( !event.target ) {
				event.target = elem;
			}
	
			// Clone any incoming data and prepend the event, creating the handler arg list
			data = data == null ?
				[ event ] :
				jQuery.makeArray( data, [ event ] );
	
			// Allow special events to draw outside the lines
			special = jQuery.event.special[ type ] || {};
			if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
				return;
			}
	
			// Determine event propagation path in advance, per W3C events spec (#9951)
			// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
			if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
	
				bubbleType = special.delegateType || type;
				if ( !rfocusMorph.test( bubbleType + type ) ) {
					cur = cur.parentNode;
				}
				for ( ; cur; cur = cur.parentNode ) {
					eventPath.push( cur );
					tmp = cur;
				}
	
				// Only add window if we got to document (e.g., not plain obj or detached DOM)
				if ( tmp === ( elem.ownerDocument || document ) ) {
					eventPath.push( tmp.defaultView || tmp.parentWindow || window );
				}
			}
	
			// Fire handlers on the event path
			i = 0;
			while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
	
				event.type = i > 1 ?
					bubbleType :
					special.bindType || type;
	
				// jQuery handler
				handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
					dataPriv.get( cur, "handle" );
				if ( handle ) {
					handle.apply( cur, data );
				}
	
				// Native handler
				handle = ontype && cur[ ontype ];
				if ( handle && handle.apply && acceptData( cur ) ) {
					event.result = handle.apply( cur, data );
					if ( event.result === false ) {
						event.preventDefault();
					}
				}
			}
			event.type = type;
	
			// If nobody prevented the default action, do it now
			if ( !onlyHandlers && !event.isDefaultPrevented() ) {
	
				if ( ( !special._default ||
					special._default.apply( eventPath.pop(), data ) === false ) &&
					acceptData( elem ) ) {
	
					// Call a native DOM method on the target with the same name as the event.
					// Don't do default actions on window, that's where global variables be (#6170)
					if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
	
						// Don't re-trigger an onFOO event when we call its FOO() method
						tmp = elem[ ontype ];
	
						if ( tmp ) {
							elem[ ontype ] = null;
						}
	
						// Prevent re-triggering of the same event, since we already bubbled it above
						jQuery.event.triggered = type;
						elem[ type ]();
						jQuery.event.triggered = undefined;
	
						if ( tmp ) {
							elem[ ontype ] = tmp;
						}
					}
				}
			}
	
			return event.result;
		},
	
		// Piggyback on a donor event to simulate a different one
		// Used only for `focus(in | out)` events
		simulate: function( type, elem, event ) {
			var e = jQuery.extend(
				new jQuery.Event(),
				event,
				{
					type: type,
					isSimulated: true
				}
			);
	
			jQuery.event.trigger( e, null, elem );
		}
	
	} );
	
	jQuery.fn.extend( {
	
		trigger: function( type, data ) {
			return this.each( function() {
				jQuery.event.trigger( type, data, this );
			} );
		},
		triggerHandler: function( type, data ) {
			var elem = this[ 0 ];
			if ( elem ) {
				return jQuery.event.trigger( type, data, elem, true );
			}
		}
	} );
	
	
	jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
		"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
		"change select submit keydown keypress keyup contextmenu" ).split( " " ),
		function( i, name ) {
	
		// Handle event binding
		jQuery.fn[ name ] = function( data, fn ) {
			return arguments.length > 0 ?
				this.on( name, null, data, fn ) :
				this.trigger( name );
		};
	} );
	
	jQuery.fn.extend( {
		hover: function( fnOver, fnOut ) {
			return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
		}
	} );
	
	
	
	
	support.focusin = "onfocusin" in window;
	
	
	// Support: Firefox <=44
	// Firefox doesn't have focus(in | out) events
	// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
	//
	// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
	// focus(in | out) events fire after focus & blur events,
	// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
	// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
	if ( !support.focusin ) {
		jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
	
			// Attach a single capturing handler on the document while someone wants focusin/focusout
			var handler = function( event ) {
				jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
			};
	
			jQuery.event.special[ fix ] = {
				setup: function() {
					var doc = this.ownerDocument || this,
						attaches = dataPriv.access( doc, fix );
	
					if ( !attaches ) {
						doc.addEventListener( orig, handler, true );
					}
					dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
				},
				teardown: function() {
					var doc = this.ownerDocument || this,
						attaches = dataPriv.access( doc, fix ) - 1;
	
					if ( !attaches ) {
						doc.removeEventListener( orig, handler, true );
						dataPriv.remove( doc, fix );
	
					} else {
						dataPriv.access( doc, fix, attaches );
					}
				}
			};
		} );
	}
	var location = window.location;
	
	var nonce = jQuery.now();
	
	var rquery = ( /\?/ );
	
	
	
	// Cross-browser xml parsing
	jQuery.parseXML = function( data ) {
		var xml;
		if ( !data || typeof data !== "string" ) {
			return null;
		}
	
		// Support: IE 9 - 11 only
		// IE throws on parseFromString with invalid input.
		try {
			xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
		} catch ( e ) {
			xml = undefined;
		}
	
		if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
			jQuery.error( "Invalid XML: " + data );
		}
		return xml;
	};
	
	
	var
		rbracket = /\[\]$/,
		rCRLF = /\r?\n/g,
		rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
		rsubmittable = /^(?:input|select|textarea|keygen)/i;
	
	function buildParams( prefix, obj, traditional, add ) {
		var name;
	
		if ( Array.isArray( obj ) ) {
	
			// Serialize array item.
			jQuery.each( obj, function( i, v ) {
				if ( traditional || rbracket.test( prefix ) ) {
	
					// Treat each array item as a scalar.
					add( prefix, v );
	
				} else {
	
					// Item is non-scalar (array or object), encode its numeric index.
					buildParams(
						prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
						v,
						traditional,
						add
					);
				}
			} );
	
		} else if ( !traditional && jQuery.type( obj ) === "object" ) {
	
			// Serialize object item.
			for ( name in obj ) {
				buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
			}
	
		} else {
	
			// Serialize scalar item.
			add( prefix, obj );
		}
	}
	
	// Serialize an array of form elements or a set of
	// key/values into a query string
	jQuery.param = function( a, traditional ) {
		var prefix,
			s = [],
			add = function( key, valueOrFunction ) {
	
				// If value is a function, invoke it and use its return value
				var value = jQuery.isFunction( valueOrFunction ) ?
					valueOrFunction() :
					valueOrFunction;
	
				s[ s.length ] = encodeURIComponent( key ) + "=" +
					encodeURIComponent( value == null ? "" : value );
			};
	
		// If an array was passed in, assume that it is an array of form elements.
		if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
	
			// Serialize the form elements
			jQuery.each( a, function() {
				add( this.name, this.value );
			} );
	
		} else {
	
			// If traditional, encode the "old" way (the way 1.3.2 or older
			// did it), otherwise encode params recursively.
			for ( prefix in a ) {
				buildParams( prefix, a[ prefix ], traditional, add );
			}
		}
	
		// Return the resulting serialization
		return s.join( "&" );
	};
	
	jQuery.fn.extend( {
		serialize: function() {
			return jQuery.param( this.serializeArray() );
		},
		serializeArray: function() {
			return this.map( function() {
	
				// Can add propHook for "elements" to filter or add form elements
				var elements = jQuery.prop( this, "elements" );
				return elements ? jQuery.makeArray( elements ) : this;
			} )
			.filter( function() {
				var type = this.type;
	
				// Use .is( ":disabled" ) so that fieldset[disabled] works
				return this.name && !jQuery( this ).is( ":disabled" ) &&
					rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
					( this.checked || !rcheckableType.test( type ) );
			} )
			.map( function( i, elem ) {
				var val = jQuery( this ).val();
	
				if ( val == null ) {
					return null;
				}
	
				if ( Array.isArray( val ) ) {
					return jQuery.map( val, function( val ) {
						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
					} );
				}
	
				return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
			} ).get();
		}
	} );
	
	
	var
		r20 = /%20/g,
		rhash = /#.*$/,
		rantiCache = /([?&])_=[^&]*/,
		rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
	
		// #7653, #8125, #8152: local protocol detection
		rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
		rnoContent = /^(?:GET|HEAD)$/,
		rprotocol = /^\/\//,
	
		/* Prefilters
		 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
		 * 2) These are called:
		 *    - BEFORE asking for a transport
		 *    - AFTER param serialization (s.data is a string if s.processData is true)
		 * 3) key is the dataType
		 * 4) the catchall symbol "*" can be used
		 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
		 */
		prefilters = {},
	
		/* Transports bindings
		 * 1) key is the dataType
		 * 2) the catchall symbol "*" can be used
		 * 3) selection will start with transport dataType and THEN go to "*" if needed
		 */
		transports = {},
	
		// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
		allTypes = "*/".concat( "*" ),
	
		// Anchor tag for parsing the document origin
		originAnchor = document.createElement( "a" );
		originAnchor.href = location.href;
	
	// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
	function addToPrefiltersOrTransports( structure ) {
	
		// dataTypeExpression is optional and defaults to "*"
		return function( dataTypeExpression, func ) {
	
			if ( typeof dataTypeExpression !== "string" ) {
				func = dataTypeExpression;
				dataTypeExpression = "*";
			}
	
			var dataType,
				i = 0,
				dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
	
			if ( jQuery.isFunction( func ) ) {
	
				// For each dataType in the dataTypeExpression
				while ( ( dataType = dataTypes[ i++ ] ) ) {
	
					// Prepend if requested
					if ( dataType[ 0 ] === "+" ) {
						dataType = dataType.slice( 1 ) || "*";
						( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
	
					// Otherwise append
					} else {
						( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
					}
				}
			}
		};
	}
	
	// Base inspection function for prefilters and transports
	function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
	
		var inspected = {},
			seekingTransport = ( structure === transports );
	
		function inspect( dataType ) {
			var selected;
			inspected[ dataType ] = true;
			jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
				var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
				if ( typeof dataTypeOrTransport === "string" &&
					!seekingTransport && !inspected[ dataTypeOrTransport ] ) {
	
					options.dataTypes.unshift( dataTypeOrTransport );
					inspect( dataTypeOrTransport );
					return false;
				} else if ( seekingTransport ) {
					return !( selected = dataTypeOrTransport );
				}
			} );
			return selected;
		}
	
		return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
	}
	
	// A special extend for ajax options
	// that takes "flat" options (not to be deep extended)
	// Fixes #9887
	function ajaxExtend( target, src ) {
		var key, deep,
			flatOptions = jQuery.ajaxSettings.flatOptions || {};
	
		for ( key in src ) {
			if ( src[ key ] !== undefined ) {
				( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
			}
		}
		if ( deep ) {
			jQuery.extend( true, target, deep );
		}
	
		return target;
	}
	
	/* Handles responses to an ajax request:
	 * - finds the right dataType (mediates between content-type and expected dataType)
	 * - returns the corresponding response
	 */
	function ajaxHandleResponses( s, jqXHR, responses ) {
	
		var ct, type, finalDataType, firstDataType,
			contents = s.contents,
			dataTypes = s.dataTypes;
	
		// Remove auto dataType and get content-type in the process
		while ( dataTypes[ 0 ] === "*" ) {
			dataTypes.shift();
			if ( ct === undefined ) {
				ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
			}
		}
	
		// Check if we're dealing with a known content-type
		if ( ct ) {
			for ( type in contents ) {
				if ( contents[ type ] && contents[ type ].test( ct ) ) {
					dataTypes.unshift( type );
					break;
				}
			}
		}
	
		// Check to see if we have a response for the expected dataType
		if ( dataTypes[ 0 ] in responses ) {
			finalDataType = dataTypes[ 0 ];
		} else {
	
			// Try convertible dataTypes
			for ( type in responses ) {
				if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
					finalDataType = type;
					break;
				}
				if ( !firstDataType ) {
					firstDataType = type;
				}
			}
	
			// Or just use first one
			finalDataType = finalDataType || firstDataType;
		}
	
		// If we found a dataType
		// We add the dataType to the list if needed
		// and return the corresponding response
		if ( finalDataType ) {
			if ( finalDataType !== dataTypes[ 0 ] ) {
				dataTypes.unshift( finalDataType );
			}
			return responses[ finalDataType ];
		}
	}
	
	/* Chain conversions given the request and the original response
	 * Also sets the responseXXX fields on the jqXHR instance
	 */
	function ajaxConvert( s, response, jqXHR, isSuccess ) {
		var conv2, current, conv, tmp, prev,
			converters = {},
	
			// Work with a copy of dataTypes in case we need to modify it for conversion
			dataTypes = s.dataTypes.slice();
	
		// Create converters map with lowercased keys
		if ( dataTypes[ 1 ] ) {
			for ( conv in s.converters ) {
				converters[ conv.toLowerCase() ] = s.converters[ conv ];
			}
		}
	
		current = dataTypes.shift();
	
		// Convert to each sequential dataType
		while ( current ) {
	
			if ( s.responseFields[ current ] ) {
				jqXHR[ s.responseFields[ current ] ] = response;
			}
	
			// Apply the dataFilter if provided
			if ( !prev && isSuccess && s.dataFilter ) {
				response = s.dataFilter( response, s.dataType );
			}
	
			prev = current;
			current = dataTypes.shift();
	
			if ( current ) {
	
				// There's only work to do if current dataType is non-auto
				if ( current === "*" ) {
	
					current = prev;
	
				// Convert response if prev dataType is non-auto and differs from current
				} else if ( prev !== "*" && prev !== current ) {
	
					// Seek a direct converter
					conv = converters[ prev + " " + current ] || converters[ "* " + current ];
	
					// If none found, seek a pair
					if ( !conv ) {
						for ( conv2 in converters ) {
	
							// If conv2 outputs current
							tmp = conv2.split( " " );
							if ( tmp[ 1 ] === current ) {
	
								// If prev can be converted to accepted input
								conv = converters[ prev + " " + tmp[ 0 ] ] ||
									converters[ "* " + tmp[ 0 ] ];
								if ( conv ) {
	
									// Condense equivalence converters
									if ( conv === true ) {
										conv = converters[ conv2 ];
	
									// Otherwise, insert the intermediate dataType
									} else if ( converters[ conv2 ] !== true ) {
										current = tmp[ 0 ];
										dataTypes.unshift( tmp[ 1 ] );
									}
									break;
								}
							}
						}
					}
	
					// Apply converter (if not an equivalence)
					if ( conv !== true ) {
	
						// Unless errors are allowed to bubble, catch and return them
						if ( conv && s.throws ) {
							response = conv( response );
						} else {
							try {
								response = conv( response );
							} catch ( e ) {
								return {
									state: "parsererror",
									error: conv ? e : "No conversion from " + prev + " to " + current
								};
							}
						}
					}
				}
			}
		}
	
		return { state: "success", data: response };
	}
	
	jQuery.extend( {
	
		// Counter for holding the number of active queries
		active: 0,
	
		// Last-Modified header cache for next request
		lastModified: {},
		etag: {},
	
		ajaxSettings: {
			url: location.href,
			type: "GET",
			isLocal: rlocalProtocol.test( location.protocol ),
			global: true,
			processData: true,
			async: true,
			contentType: "application/x-www-form-urlencoded; charset=UTF-8",
	
			/*
			timeout: 0,
			data: null,
			dataType: null,
			username: null,
			password: null,
			cache: null,
			throws: false,
			traditional: false,
			headers: {},
			*/
	
			accepts: {
				"*": allTypes,
				text: "text/plain",
				html: "text/html",
				xml: "application/xml, text/xml",
				json: "application/json, text/javascript"
			},
	
			contents: {
				xml: /\bxml\b/,
				html: /\bhtml/,
				json: /\bjson\b/
			},
	
			responseFields: {
				xml: "responseXML",
				text: "responseText",
				json: "responseJSON"
			},
	
			// Data converters
			// Keys separate source (or catchall "*") and destination types with a single space
			converters: {
	
				// Convert anything to text
				"* text": String,
	
				// Text to html (true = no transformation)
				"text html": true,
	
				// Evaluate text as a json expression
				"text json": JSON.parse,
	
				// Parse text as xml
				"text xml": jQuery.parseXML
			},
	
			// For options that shouldn't be deep extended:
			// you can add your own custom options here if
			// and when you create one that shouldn't be
			// deep extended (see ajaxExtend)
			flatOptions: {
				url: true,
				context: true
			}
		},
	
		// Creates a full fledged settings object into target
		// with both ajaxSettings and settings fields.
		// If target is omitted, writes into ajaxSettings.
		ajaxSetup: function( target, settings ) {
			return settings ?
	
				// Building a settings object
				ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
	
				// Extending ajaxSettings
				ajaxExtend( jQuery.ajaxSettings, target );
		},
	
		ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
		ajaxTransport: addToPrefiltersOrTransports( transports ),
	
		// Main method
		ajax: function( url, options ) {
	
			// If url is an object, simulate pre-1.5 signature
			if ( typeof url === "object" ) {
				options = url;
				url = undefined;
			}
	
			// Force options to be an object
			options = options || {};
	
			var transport,
	
				// URL without anti-cache param
				cacheURL,
	
				// Response headers
				responseHeadersString,
				responseHeaders,
	
				// timeout handle
				timeoutTimer,
	
				// Url cleanup var
				urlAnchor,
	
				// Request state (becomes false upon send and true upon completion)
				completed,
	
				// To know if global events are to be dispatched
				fireGlobals,
	
				// Loop variable
				i,
	
				// uncached part of the url
				uncached,
	
				// Create the final options object
				s = jQuery.ajaxSetup( {}, options ),
	
				// Callbacks context
				callbackContext = s.context || s,
	
				// Context for global events is callbackContext if it is a DOM node or jQuery collection
				globalEventContext = s.context &&
					( callbackContext.nodeType || callbackContext.jquery ) ?
						jQuery( callbackContext ) :
						jQuery.event,
	
				// Deferreds
				deferred = jQuery.Deferred(),
				completeDeferred = jQuery.Callbacks( "once memory" ),
	
				// Status-dependent callbacks
				statusCode = s.statusCode || {},
	
				// Headers (they are sent all at once)
				requestHeaders = {},
				requestHeadersNames = {},
	
				// Default abort message
				strAbort = "canceled",
	
				// Fake xhr
				jqXHR = {
					readyState: 0,
	
					// Builds headers hashtable if needed
					getResponseHeader: function( key ) {
						var match;
						if ( completed ) {
							if ( !responseHeaders ) {
								responseHeaders = {};
								while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
									responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
								}
							}
							match = responseHeaders[ key.toLowerCase() ];
						}
						return match == null ? null : match;
					},
	
					// Raw string
					getAllResponseHeaders: function() {
						return completed ? responseHeadersString : null;
					},
	
					// Caches the header
					setRequestHeader: function( name, value ) {
						if ( completed == null ) {
							name = requestHeadersNames[ name.toLowerCase() ] =
								requestHeadersNames[ name.toLowerCase() ] || name;
							requestHeaders[ name ] = value;
						}
						return this;
					},
	
					// Overrides response content-type header
					overrideMimeType: function( type ) {
						if ( completed == null ) {
							s.mimeType = type;
						}
						return this;
					},
	
					// Status-dependent callbacks
					statusCode: function( map ) {
						var code;
						if ( map ) {
							if ( completed ) {
	
								// Execute the appropriate callbacks
								jqXHR.always( map[ jqXHR.status ] );
							} else {
	
								// Lazy-add the new callbacks in a way that preserves old ones
								for ( code in map ) {
									statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
								}
							}
						}
						return this;
					},
	
					// Cancel the request
					abort: function( statusText ) {
						var finalText = statusText || strAbort;
						if ( transport ) {
							transport.abort( finalText );
						}
						done( 0, finalText );
						return this;
					}
				};
	
			// Attach deferreds
			deferred.promise( jqXHR );
	
			// Add protocol if not provided (prefilters might expect it)
			// Handle falsy url in the settings object (#10093: consistency with old signature)
			// We also use the url parameter if available
			s.url = ( ( url || s.url || location.href ) + "" )
				.replace( rprotocol, location.protocol + "//" );
	
			// Alias method option to type as per ticket #12004
			s.type = options.method || options.type || s.method || s.type;
	
			// Extract dataTypes list
			s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
	
			// A cross-domain request is in order when the origin doesn't match the current origin.
			if ( s.crossDomain == null ) {
				urlAnchor = document.createElement( "a" );
	
				// Support: IE <=8 - 11, Edge 12 - 13
				// IE throws exception on accessing the href property if url is malformed,
				// e.g. http://example.com:80x/
				try {
					urlAnchor.href = s.url;
	
					// Support: IE <=8 - 11 only
					// Anchor's host property isn't correctly set when s.url is relative
					urlAnchor.href = urlAnchor.href;
					s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
						urlAnchor.protocol + "//" + urlAnchor.host;
				} catch ( e ) {
	
					// If there is an error parsing the URL, assume it is crossDomain,
					// it can be rejected by the transport if it is invalid
					s.crossDomain = true;
				}
			}
	
			// Convert data if not already a string
			if ( s.data && s.processData && typeof s.data !== "string" ) {
				s.data = jQuery.param( s.data, s.traditional );
			}
	
			// Apply prefilters
			inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
	
			// If request was aborted inside a prefilter, stop there
			if ( completed ) {
				return jqXHR;
			}
	
			// We can fire global events as of now if asked to
			// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
			fireGlobals = jQuery.event && s.global;
	
			// Watch for a new set of requests
			if ( fireGlobals && jQuery.active++ === 0 ) {
				jQuery.event.trigger( "ajaxStart" );
			}
	
			// Uppercase the type
			s.type = s.type.toUpperCase();
	
			// Determine if request has content
			s.hasContent = !rnoContent.test( s.type );
	
			// Save the URL in case we're toying with the If-Modified-Since
			// and/or If-None-Match header later on
			// Remove hash to simplify url manipulation
			cacheURL = s.url.replace( rhash, "" );
	
			// More options handling for requests with no content
			if ( !s.hasContent ) {
	
				// Remember the hash so we can put it back
				uncached = s.url.slice( cacheURL.length );
	
				// If data is available, append data to url
				if ( s.data ) {
					cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
	
					// #9682: remove data so that it's not used in an eventual retry
					delete s.data;
				}
	
				// Add or update anti-cache param if needed
				if ( s.cache === false ) {
					cacheURL = cacheURL.replace( rantiCache, "$1" );
					uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
				}
	
				// Put hash and anti-cache on the URL that will be requested (gh-1732)
				s.url = cacheURL + uncached;
	
			// Change '%20' to '+' if this is encoded form body content (gh-2658)
			} else if ( s.data && s.processData &&
				( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
				s.data = s.data.replace( r20, "+" );
			}
	
			// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
			if ( s.ifModified ) {
				if ( jQuery.lastModified[ cacheURL ] ) {
					jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
				}
				if ( jQuery.etag[ cacheURL ] ) {
					jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
				}
			}
	
			// Set the correct header, if data is being sent
			if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
				jqXHR.setRequestHeader( "Content-Type", s.contentType );
			}
	
			// Set the Accepts header for the server, depending on the dataType
			jqXHR.setRequestHeader(
				"Accept",
				s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
					s.accepts[ s.dataTypes[ 0 ] ] +
						( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
					s.accepts[ "*" ]
			);
	
			// Check for headers option
			for ( i in s.headers ) {
				jqXHR.setRequestHeader( i, s.headers[ i ] );
			}
	
			// Allow custom headers/mimetypes and early abort
			if ( s.beforeSend &&
				( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
	
				// Abort if not done already and return
				return jqXHR.abort();
			}
	
			// Aborting is no longer a cancellation
			strAbort = "abort";
	
			// Install callbacks on deferreds
			completeDeferred.add( s.complete );
			jqXHR.done( s.success );
			jqXHR.fail( s.error );
	
			// Get transport
			transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
	
			// If no transport, we auto-abort
			if ( !transport ) {
				done( -1, "No Transport" );
			} else {
				jqXHR.readyState = 1;
	
				// Send global event
				if ( fireGlobals ) {
					globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
				}
	
				// If request was aborted inside ajaxSend, stop there
				if ( completed ) {
					return jqXHR;
				}
	
				// Timeout
				if ( s.async && s.timeout > 0 ) {
					timeoutTimer = window.setTimeout( function() {
						jqXHR.abort( "timeout" );
					}, s.timeout );
				}
	
				try {
					completed = false;
					transport.send( requestHeaders, done );
				} catch ( e ) {
	
					// Rethrow post-completion exceptions
					if ( completed ) {
						throw e;
					}
	
					// Propagate others as results
					done( -1, e );
				}
			}
	
			// Callback for when everything is done
			function done( status, nativeStatusText, responses, headers ) {
				var isSuccess, success, error, response, modified,
					statusText = nativeStatusText;
	
				// Ignore repeat invocations
				if ( completed ) {
					return;
				}
	
				completed = true;
	
				// Clear timeout if it exists
				if ( timeoutTimer ) {
					window.clearTimeout( timeoutTimer );
				}
	
				// Dereference transport for early garbage collection
				// (no matter how long the jqXHR object will be used)
				transport = undefined;
	
				// Cache response headers
				responseHeadersString = headers || "";
	
				// Set readyState
				jqXHR.readyState = status > 0 ? 4 : 0;
	
				// Determine if successful
				isSuccess = status >= 200 && status < 300 || status === 304;
	
				// Get response data
				if ( responses ) {
					response = ajaxHandleResponses( s, jqXHR, responses );
				}
	
				// Convert no matter what (that way responseXXX fields are always set)
				response = ajaxConvert( s, response, jqXHR, isSuccess );
	
				// If successful, handle type chaining
				if ( isSuccess ) {
	
					// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
					if ( s.ifModified ) {
						modified = jqXHR.getResponseHeader( "Last-Modified" );
						if ( modified ) {
							jQuery.lastModified[ cacheURL ] = modified;
						}
						modified = jqXHR.getResponseHeader( "etag" );
						if ( modified ) {
							jQuery.etag[ cacheURL ] = modified;
						}
					}
	
					// if no content
					if ( status === 204 || s.type === "HEAD" ) {
						statusText = "nocontent";
	
					// if not modified
					} else if ( status === 304 ) {
						statusText = "notmodified";
	
					// If we have data, let's convert it
					} else {
						statusText = response.state;
						success = response.data;
						error = response.error;
						isSuccess = !error;
					}
				} else {
	
					// Extract error from statusText and normalize for non-aborts
					error = statusText;
					if ( status || !statusText ) {
						statusText = "error";
						if ( status < 0 ) {
							status = 0;
						}
					}
				}
	
				// Set data for the fake xhr object
				jqXHR.status = status;
				jqXHR.statusText = ( nativeStatusText || statusText ) + "";
	
				// Success/Error
				if ( isSuccess ) {
					deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
				} else {
					deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
				}
	
				// Status-dependent callbacks
				jqXHR.statusCode( statusCode );
				statusCode = undefined;
	
				if ( fireGlobals ) {
					globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
						[ jqXHR, s, isSuccess ? success : error ] );
				}
	
				// Complete
				completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
	
				if ( fireGlobals ) {
					globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
	
					// Handle the global AJAX counter
					if ( !( --jQuery.active ) ) {
						jQuery.event.trigger( "ajaxStop" );
					}
				}
			}
	
			return jqXHR;
		},
	
		getJSON: function( url, data, callback ) {
			return jQuery.get( url, data, callback, "json" );
		},
	
		getScript: function( url, callback ) {
			return jQuery.get( url, undefined, callback, "script" );
		}
	} );
	
	jQuery.each( [ "get", "post" ], function( i, method ) {
		jQuery[ method ] = function( url, data, callback, type ) {
	
			// Shift arguments if data argument was omitted
			if ( jQuery.isFunction( data ) ) {
				type = type || callback;
				callback = data;
				data = undefined;
			}
	
			// The url can be an options object (which then must have .url)
			return jQuery.ajax( jQuery.extend( {
				url: url,
				type: method,
				dataType: type,
				data: data,
				success: callback
			}, jQuery.isPlainObject( url ) && url ) );
		};
	} );
	
	
	jQuery._evalUrl = function( url ) {
		return jQuery.ajax( {
			url: url,
	
			// Make this explicit, since user can override this through ajaxSetup (#11264)
			type: "GET",
			dataType: "script",
			cache: true,
			async: false,
			global: false,
			"throws": true
		} );
	};
	
	
	jQuery.fn.extend( {
		wrapAll: function( html ) {
			var wrap;
	
			if ( this[ 0 ] ) {
				if ( jQuery.isFunction( html ) ) {
					html = html.call( this[ 0 ] );
				}
	
				// The elements to wrap the target around
				wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
	
				if ( this[ 0 ].parentNode ) {
					wrap.insertBefore( this[ 0 ] );
				}
	
				wrap.map( function() {
					var elem = this;
	
					while ( elem.firstElementChild ) {
						elem = elem.firstElementChild;
					}
	
					return elem;
				} ).append( this );
			}
	
			return this;
		},
	
		wrapInner: function( html ) {
			if ( jQuery.isFunction( html ) ) {
				return this.each( function( i ) {
					jQuery( this ).wrapInner( html.call( this, i ) );
				} );
			}
	
			return this.each( function() {
				var self = jQuery( this ),
					contents = self.contents();
	
				if ( contents.length ) {
					contents.wrapAll( html );
	
				} else {
					self.append( html );
				}
			} );
		},
	
		wrap: function( html ) {
			var isFunction = jQuery.isFunction( html );
	
			return this.each( function( i ) {
				jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
			} );
		},
	
		unwrap: function( selector ) {
			this.parent( selector ).not( "body" ).each( function() {
				jQuery( this ).replaceWith( this.childNodes );
			} );
			return this;
		}
	} );
	
	
	jQuery.expr.pseudos.hidden = function( elem ) {
		return !jQuery.expr.pseudos.visible( elem );
	};
	jQuery.expr.pseudos.visible = function( elem ) {
		return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
	};
	
	
	
	
	jQuery.ajaxSettings.xhr = function() {
		try {
			return new window.XMLHttpRequest();
		} catch ( e ) {}
	};
	
	var xhrSuccessStatus = {
	
			// File protocol always yields status code 0, assume 200
			0: 200,
	
			// Support: IE <=9 only
			// #1450: sometimes IE returns 1223 when it should be 204
			1223: 204
		},
		xhrSupported = jQuery.ajaxSettings.xhr();
	
	support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
	support.ajax = xhrSupported = !!xhrSupported;
	
	jQuery.ajaxTransport( function( options ) {
		var callback, errorCallback;
	
		// Cross domain only allowed if supported through XMLHttpRequest
		if ( support.cors || xhrSupported && !options.crossDomain ) {
			return {
				send: function( headers, complete ) {
					var i,
						xhr = options.xhr();
	
					xhr.open(
						options.type,
						options.url,
						options.async,
						options.username,
						options.password
					);
	
					// Apply custom fields if provided
					if ( options.xhrFields ) {
						for ( i in options.xhrFields ) {
							xhr[ i ] = options.xhrFields[ i ];
						}
					}
	
					// Override mime type if needed
					if ( options.mimeType && xhr.overrideMimeType ) {
						xhr.overrideMimeType( options.mimeType );
					}
	
					// X-Requested-With header
					// For cross-domain requests, seeing as conditions for a preflight are
					// akin to a jigsaw puzzle, we simply never set it to be sure.
					// (it can always be set on a per-request basis or even using ajaxSetup)
					// For same-domain requests, won't change header if already provided.
					if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
						headers[ "X-Requested-With" ] = "XMLHttpRequest";
					}
	
					// Set headers
					for ( i in headers ) {
						xhr.setRequestHeader( i, headers[ i ] );
					}
	
					// Callback
					callback = function( type ) {
						return function() {
							if ( callback ) {
								callback = errorCallback = xhr.onload =
									xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
	
								if ( type === "abort" ) {
									xhr.abort();
								} else if ( type === "error" ) {
	
									// Support: IE <=9 only
									// On a manual native abort, IE9 throws
									// errors on any property access that is not readyState
									if ( typeof xhr.status !== "number" ) {
										complete( 0, "error" );
									} else {
										complete(
	
											// File: protocol always yields status 0; see #8605, #14207
											xhr.status,
											xhr.statusText
										);
									}
								} else {
									complete(
										xhrSuccessStatus[ xhr.status ] || xhr.status,
										xhr.statusText,
	
										// Support: IE <=9 only
										// IE9 has no XHR2 but throws on binary (trac-11426)
										// For XHR2 non-text, let the caller handle it (gh-2498)
										( xhr.responseType || "text" ) !== "text"  ||
										typeof xhr.responseText !== "string" ?
											{ binary: xhr.response } :
											{ text: xhr.responseText },
										xhr.getAllResponseHeaders()
									);
								}
							}
						};
					};
	
					// Listen to events
					xhr.onload = callback();
					errorCallback = xhr.onerror = callback( "error" );
	
					// Support: IE 9 only
					// Use onreadystatechange to replace onabort
					// to handle uncaught aborts
					if ( xhr.onabort !== undefined ) {
						xhr.onabort = errorCallback;
					} else {
						xhr.onreadystatechange = function() {
	
							// Check readyState before timeout as it changes
							if ( xhr.readyState === 4 ) {
	
								// Allow onerror to be called first,
								// but that will not handle a native abort
								// Also, save errorCallback to a variable
								// as xhr.onerror cannot be accessed
								window.setTimeout( function() {
									if ( callback ) {
										errorCallback();
									}
								} );
							}
						};
					}
	
					// Create the abort callback
					callback = callback( "abort" );
	
					try {
	
						// Do send the request (this may raise an exception)
						xhr.send( options.hasContent && options.data || null );
					} catch ( e ) {
	
						// #14683: Only rethrow if this hasn't been notified as an error yet
						if ( callback ) {
							throw e;
						}
					}
				},
	
				abort: function() {
					if ( callback ) {
						callback();
					}
				}
			};
		}
	} );
	
	
	
	
	// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
	jQuery.ajaxPrefilter( function( s ) {
		if ( s.crossDomain ) {
			s.contents.script = false;
		}
	} );
	
	// Install script dataType
	jQuery.ajaxSetup( {
		accepts: {
			script: "text/javascript, application/javascript, " +
				"application/ecmascript, application/x-ecmascript"
		},
		contents: {
			script: /\b(?:java|ecma)script\b/
		},
		converters: {
			"text script": function( text ) {
				jQuery.globalEval( text );
				return text;
			}
		}
	} );
	
	// Handle cache's special case and crossDomain
	jQuery.ajaxPrefilter( "script", function( s ) {
		if ( s.cache === undefined ) {
			s.cache = false;
		}
		if ( s.crossDomain ) {
			s.type = "GET";
		}
	} );
	
	// Bind script tag hack transport
	jQuery.ajaxTransport( "script", function( s ) {
	
		// This transport only deals with cross domain requests
		if ( s.crossDomain ) {
			var script, callback;
			return {
				send: function( _, complete ) {
					script = jQuery( "<script>" ).prop( {
						charset: s.scriptCharset,
						src: s.url
					} ).on(
						"load error",
						callback = function( evt ) {
							script.remove();
							callback = null;
							if ( evt ) {
								complete( evt.type === "error" ? 404 : 200, evt.type );
							}
						}
					);
	
					// Use native DOM manipulation to avoid our domManip AJAX trickery
					document.head.appendChild( script[ 0 ] );
				},
				abort: function() {
					if ( callback ) {
						callback();
					}
				}
			};
		}
	} );
	
	
	
	
	var oldCallbacks = [],
		rjsonp = /(=)\?(?=&|$)|\?\?/;
	
	// Default jsonp settings
	jQuery.ajaxSetup( {
		jsonp: "callback",
		jsonpCallback: function() {
			var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
			this[ callback ] = true;
			return callback;
		}
	} );
	
	// Detect, normalize options and install callbacks for jsonp requests
	jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
	
		var callbackName, overwritten, responseContainer,
			jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
				"url" :
				typeof s.data === "string" &&
					( s.contentType || "" )
						.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
					rjsonp.test( s.data ) && "data"
			);
	
		// Handle iff the expected data type is "jsonp" or we have a parameter to set
		if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
	
			// Get callback name, remembering preexisting value associated with it
			callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
				s.jsonpCallback() :
				s.jsonpCallback;
	
			// Insert callback into url or form data
			if ( jsonProp ) {
				s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
			} else if ( s.jsonp !== false ) {
				s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
			}
	
			// Use data converter to retrieve json after script execution
			s.converters[ "script json" ] = function() {
				if ( !responseContainer ) {
					jQuery.error( callbackName + " was not called" );
				}
				return responseContainer[ 0 ];
			};
	
			// Force json dataType
			s.dataTypes[ 0 ] = "json";
	
			// Install callback
			overwritten = window[ callbackName ];
			window[ callbackName ] = function() {
				responseContainer = arguments;
			};
	
			// Clean-up function (fires after converters)
			jqXHR.always( function() {
	
				// If previous value didn't exist - remove it
				if ( overwritten === undefined ) {
					jQuery( window ).removeProp( callbackName );
	
				// Otherwise restore preexisting value
				} else {
					window[ callbackName ] = overwritten;
				}
	
				// Save back as free
				if ( s[ callbackName ] ) {
	
					// Make sure that re-using the options doesn't screw things around
					s.jsonpCallback = originalSettings.jsonpCallback;
	
					// Save the callback name for future use
					oldCallbacks.push( callbackName );
				}
	
				// Call if it was a function and we have a response
				if ( responseContainer && jQuery.isFunction( overwritten ) ) {
					overwritten( responseContainer[ 0 ] );
				}
	
				responseContainer = overwritten = undefined;
			} );
	
			// Delegate to script
			return "script";
		}
	} );
	
	
	
	
	// Support: Safari 8 only
	// In Safari 8 documents created via document.implementation.createHTMLDocument
	// collapse sibling forms: the second one becomes a child of the first one.
	// Because of that, this security measure has to be disabled in Safari 8.
	// https://bugs.webkit.org/show_bug.cgi?id=137337
	support.createHTMLDocument = ( function() {
		var body = document.implementation.createHTMLDocument( "" ).body;
		body.innerHTML = "<form></form><form></form>";
		return body.childNodes.length === 2;
	} )();
	
	
	// Argument "data" should be string of html
	// context (optional): If specified, the fragment will be created in this context,
	// defaults to document
	// keepScripts (optional): If true, will include scripts passed in the html string
	jQuery.parseHTML = function( data, context, keepScripts ) {
		if ( typeof data !== "string" ) {
			return [];
		}
		if ( typeof context === "boolean" ) {
			keepScripts = context;
			context = false;
		}
	
		var base, parsed, scripts;
	
		if ( !context ) {
	
			// Stop scripts or inline event handlers from being executed immediately
			// by using document.implementation
			if ( support.createHTMLDocument ) {
				context = document.implementation.createHTMLDocument( "" );
	
				// Set the base href for the created document
				// so any parsed elements with URLs
				// are based on the document's URL (gh-2965)
				base = context.createElement( "base" );
				base.href = document.location.href;
				context.head.appendChild( base );
			} else {
				context = document;
			}
		}
	
		parsed = rsingleTag.exec( data );
		scripts = !keepScripts && [];
	
		// Single tag
		if ( parsed ) {
			return [ context.createElement( parsed[ 1 ] ) ];
		}
	
		parsed = buildFragment( [ data ], context, scripts );
	
		if ( scripts && scripts.length ) {
			jQuery( scripts ).remove();
		}
	
		return jQuery.merge( [], parsed.childNodes );
	};
	
	
	/**
	 * Load a url into a page
	 */
	jQuery.fn.load = function( url, params, callback ) {
		var selector, type, response,
			self = this,
			off = url.indexOf( " " );
	
		if ( off > -1 ) {
			selector = stripAndCollapse( url.slice( off ) );
			url = url.slice( 0, off );
		}
	
		// If it's a function
		if ( jQuery.isFunction( params ) ) {
	
			// We assume that it's the callback
			callback = params;
			params = undefined;
	
		// Otherwise, build a param string
		} else if ( params && typeof params === "object" ) {
			type = "POST";
		}
	
		// If we have elements to modify, make the request
		if ( self.length > 0 ) {
			jQuery.ajax( {
				url: url,
	
				// If "type" variable is undefined, then "GET" method will be used.
				// Make value of this field explicit since
				// user can override it through ajaxSetup method
				type: type || "GET",
				dataType: "html",
				data: params
			} ).done( function( responseText ) {
	
				// Save response for use in complete callback
				response = arguments;
	
				self.html( selector ?
	
					// If a selector was specified, locate the right elements in a dummy div
					// Exclude scripts to avoid IE 'Permission Denied' errors
					jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
	
					// Otherwise use the full result
					responseText );
	
			// If the request succeeds, this function gets "data", "status", "jqXHR"
			// but they are ignored because response was set above.
			// If it fails, this function gets "jqXHR", "status", "error"
			} ).always( callback && function( jqXHR, status ) {
				self.each( function() {
					callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
				} );
			} );
		}
	
		return this;
	};
	
	
	
	
	// Attach a bunch of functions for handling common AJAX events
	jQuery.each( [
		"ajaxStart",
		"ajaxStop",
		"ajaxComplete",
		"ajaxError",
		"ajaxSuccess",
		"ajaxSend"
	], function( i, type ) {
		jQuery.fn[ type ] = function( fn ) {
			return this.on( type, fn );
		};
	} );
	
	
	
	
	jQuery.expr.pseudos.animated = function( elem ) {
		return jQuery.grep( jQuery.timers, function( fn ) {
			return elem === fn.elem;
		} ).length;
	};
	
	
	
	
	jQuery.offset = {
		setOffset: function( elem, options, i ) {
			var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
				position = jQuery.css( elem, "position" ),
				curElem = jQuery( elem ),
				props = {};
	
			// Set position first, in-case top/left are set even on static elem
			if ( position === "static" ) {
				elem.style.position = "relative";
			}
	
			curOffset = curElem.offset();
			curCSSTop = jQuery.css( elem, "top" );
			curCSSLeft = jQuery.css( elem, "left" );
			calculatePosition = ( position === "absolute" || position === "fixed" ) &&
				( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
	
			// Need to be able to calculate position if either
			// top or left is auto and position is either absolute or fixed
			if ( calculatePosition ) {
				curPosition = curElem.position();
				curTop = curPosition.top;
				curLeft = curPosition.left;
	
			} else {
				curTop = parseFloat( curCSSTop ) || 0;
				curLeft = parseFloat( curCSSLeft ) || 0;
			}
	
			if ( jQuery.isFunction( options ) ) {
	
				// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
				options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
			}
	
			if ( options.top != null ) {
				props.top = ( options.top - curOffset.top ) + curTop;
			}
			if ( options.left != null ) {
				props.left = ( options.left - curOffset.left ) + curLeft;
			}
	
			if ( "using" in options ) {
				options.using.call( elem, props );
	
			} else {
				curElem.css( props );
			}
		}
	};
	
	jQuery.fn.extend( {
		offset: function( options ) {
	
			// Preserve chaining for setter
			if ( arguments.length ) {
				return options === undefined ?
					this :
					this.each( function( i ) {
						jQuery.offset.setOffset( this, options, i );
					} );
			}
	
			var doc, docElem, rect, win,
				elem = this[ 0 ];
	
			if ( !elem ) {
				return;
			}
	
			// Return zeros for disconnected and hidden (display: none) elements (gh-2310)
			// Support: IE <=11 only
			// Running getBoundingClientRect on a
			// disconnected node in IE throws an error
			if ( !elem.getClientRects().length ) {
				return { top: 0, left: 0 };
			}
	
			rect = elem.getBoundingClientRect();
	
			doc = elem.ownerDocument;
			docElem = doc.documentElement;
			win = doc.defaultView;
	
			return {
				top: rect.top + win.pageYOffset - docElem.clientTop,
				left: rect.left + win.pageXOffset - docElem.clientLeft
			};
		},
	
		position: function() {
			if ( !this[ 0 ] ) {
				return;
			}
	
			var offsetParent, offset,
				elem = this[ 0 ],
				parentOffset = { top: 0, left: 0 };
	
			// Fixed elements are offset from window (parentOffset = {top:0, left: 0},
			// because it is its only offset parent
			if ( jQuery.css( elem, "position" ) === "fixed" ) {
	
				// Assume getBoundingClientRect is there when computed position is fixed
				offset = elem.getBoundingClientRect();
	
			} else {
	
				// Get *real* offsetParent
				offsetParent = this.offsetParent();
	
				// Get correct offsets
				offset = this.offset();
				if ( !nodeName( offsetParent[ 0 ], "html" ) ) {
					parentOffset = offsetParent.offset();
				}
	
				// Add offsetParent borders
				parentOffset = {
					top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
					left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
				};
			}
	
			// Subtract parent offsets and element margins
			return {
				top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
				left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
			};
		},
	
		// This method will return documentElement in the following cases:
		// 1) For the element inside the iframe without offsetParent, this method will return
		//    documentElement of the parent window
		// 2) For the hidden or detached element
		// 3) For body or html element, i.e. in case of the html node - it will return itself
		//
		// but those exceptions were never presented as a real life use-cases
		// and might be considered as more preferable results.
		//
		// This logic, however, is not guaranteed and can change at any point in the future
		offsetParent: function() {
			return this.map( function() {
				var offsetParent = this.offsetParent;
	
				while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
					offsetParent = offsetParent.offsetParent;
				}
	
				return offsetParent || documentElement;
			} );
		}
	} );
	
	// Create scrollLeft and scrollTop methods
	jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
		var top = "pageYOffset" === prop;
	
		jQuery.fn[ method ] = function( val ) {
			return access( this, function( elem, method, val ) {
	
				// Coalesce documents and windows
				var win;
				if ( jQuery.isWindow( elem ) ) {
					win = elem;
				} else if ( elem.nodeType === 9 ) {
					win = elem.defaultView;
				}
	
				if ( val === undefined ) {
					return win ? win[ prop ] : elem[ method ];
				}
	
				if ( win ) {
					win.scrollTo(
						!top ? val : win.pageXOffset,
						top ? val : win.pageYOffset
					);
	
				} else {
					elem[ method ] = val;
				}
			}, method, val, arguments.length );
		};
	} );
	
	// Support: Safari <=7 - 9.1, Chrome <=37 - 49
	// Add the top/left cssHooks using jQuery.fn.position
	// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
	// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
	// getComputedStyle returns percent when specified for top/left/bottom/right;
	// rather than make the css module depend on the offset module, just check for it here
	jQuery.each( [ "top", "left" ], function( i, prop ) {
		jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
			function( elem, computed ) {
				if ( computed ) {
					computed = curCSS( elem, prop );
	
					// If curCSS returns percentage, fallback to offset
					return rnumnonpx.test( computed ) ?
						jQuery( elem ).position()[ prop ] + "px" :
						computed;
				}
			}
		);
	} );
	
	
	// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
	jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
		jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
			function( defaultExtra, funcName ) {
	
			// Margin is only for outerHeight, outerWidth
			jQuery.fn[ funcName ] = function( margin, value ) {
				var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
					extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
	
				return access( this, function( elem, type, value ) {
					var doc;
	
					if ( jQuery.isWindow( elem ) ) {
	
						// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
						return funcName.indexOf( "outer" ) === 0 ?
							elem[ "inner" + name ] :
							elem.document.documentElement[ "client" + name ];
					}
	
					// Get document width or height
					if ( elem.nodeType === 9 ) {
						doc = elem.documentElement;
	
						// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
						// whichever is greatest
						return Math.max(
							elem.body[ "scroll" + name ], doc[ "scroll" + name ],
							elem.body[ "offset" + name ], doc[ "offset" + name ],
							doc[ "client" + name ]
						);
					}
	
					return value === undefined ?
	
						// Get width or height on the element, requesting but not forcing parseFloat
						jQuery.css( elem, type, extra ) :
	
						// Set width or height on the element
						jQuery.style( elem, type, value, extra );
				}, type, chainable ? margin : undefined, chainable );
			};
		} );
	} );
	
	
	jQuery.fn.extend( {
	
		bind: function( types, data, fn ) {
			return this.on( types, null, data, fn );
		},
		unbind: function( types, fn ) {
			return this.off( types, null, fn );
		},
	
		delegate: function( selector, types, data, fn ) {
			return this.on( types, selector, data, fn );
		},
		undelegate: function( selector, types, fn ) {
	
			// ( namespace ) or ( selector, types [, fn] )
			return arguments.length === 1 ?
				this.off( selector, "**" ) :
				this.off( types, selector || "**", fn );
		}
	} );
	
	jQuery.holdReady = function( hold ) {
		if ( hold ) {
			jQuery.readyWait++;
		} else {
			jQuery.ready( true );
		}
	};
	jQuery.isArray = Array.isArray;
	jQuery.parseJSON = JSON.parse;
	jQuery.nodeName = nodeName;
	
	
	
	
	// Register as a named AMD module, since jQuery can be concatenated with other
	// files that may use define, but not via a proper concatenation script that
	// understands anonymous AMD modules. A named AMD is safest and most robust
	// way to register. Lowercase jquery is used because AMD module names are
	// derived from file names, and jQuery is normally delivered in a lowercase
	// file name. Do this after creating the global so that if an AMD module wants
	// to call noConflict to hide this version of jQuery, it will work.
	
	// Note that for maximum portability, libraries that are not jQuery should
	// declare themselves as anonymous modules, and avoid setting a global if an
	// AMD loader is present. jQuery is a special case. For more information, see
	// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
	
	if ( true ) {
		!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
			return jQuery;
		}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	}
	
	
	
	
	var
	
		// Map over jQuery in case of overwrite
		_jQuery = window.jQuery,
	
		// Map over the $ in case of overwrite
		_$ = window.$;
	
	jQuery.noConflict = function( deep ) {
		if ( window.$ === jQuery ) {
			window.$ = _$;
		}
	
		if ( deep && window.jQuery === jQuery ) {
			window.jQuery = _jQuery;
		}
	
		return jQuery;
	};
	
	// Expose jQuery and $ identifiers, even in AMD
	// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
	// and CommonJS for browser emulators (#13566)
	if ( !noGlobal ) {
		window.jQuery = window.$ = jQuery;
	}
	
	
	
	
	return jQuery;
	} );
	
})
/** END DEFINE BLOCK for jquery@3.2.1/dist/jquery.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/nativeview.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/nativeview.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	/*
	 This file contains substantial portions of https://github.com/akre54/Backbone.NativeView/blob/521188d9554b53d95d70ed34f878d8ac9fc10df2/backbone.nativeview.js, which has the following license:
	
	(c) 2015 Adam Krebs, Jimmy Yuen Ho Wong
	Backbone.NativeView may be freely distributed under the MIT license.
	
	Copyright (c) 2014 Adam Krebs
	
	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.
	
	*/
	var Backbone = __jupyter_require__('backbone@1.2.0/backbone.js');
	// Caches a local reference to `Element.prototype` for faster access.
	var ElementProto = Element.prototype; //: typeof Element = (typeof Element !== 'undefined' && Element.prototype) || {};
	// Find the right `Element#matches` for IE>=9 and modern browsers.
	var matchesSelector = ElementProto.matches ||
	    ElementProto['webkitMatchesSelector'] ||
	    ElementProto['mozMatchesSelector'] ||
	    ElementProto['msMatchesSelector'] ||
	    ElementProto['oMatchesSelector'] ||
	    function matches(selector) {
	        var matches = (this.document || this.ownerDocument).querySelectorAll(selector), i = matches.length;
	        while (--i >= 0 && matches.item(i) !== this) { }
	        return i > -1;
	    };
	var NativeView = (function (_super) {
	    __extends(NativeView, _super);
	    function NativeView() {
	        _super.apply(this, arguments);
	    }
	    NativeView.prototype._removeElement = function () {
	        this.undelegateEvents();
	        if (this.el.parentNode) {
	            this.el.parentNode.removeChild(this.el);
	        }
	    };
	    // Apply the `element` to the view.
	    NativeView.prototype._setElement = function (element) {
	        this.el = element;
	    };
	    // Set a hash of attributes to the view's `el`. We use the "prop" version
	    // if available, falling back to `setAttribute` for the catch-all.
	    NativeView.prototype._setAttributes = function (attrs) {
	        for (var attr in attrs) {
	            attr in this.el ? this.el[attr] = attrs[attr] : this.el.setAttribute(attr, attrs[attr]);
	        }
	    };
	    /**
	     * Make an event delegation handler for the given `eventName` and `selector`
	     * and attach it to `this.el`.
	     * If selector is empty, the listener will be bound to `this.el`. If not, a
	     * new handler that will recursively traverse up the event target's DOM
	     * hierarchy looking for a node that matches the selector. If one is found,
	     * the event's `delegateTarget` property is set to it and the return the
	     * result of calling bound `listener` with the parameters given to the
	     * handler.
	     *
	     * This does not properly handle selectors for things like focus and blur (see
	     * https://github.com/jquery/jquery/blob/7d21f02b9ec9f655583e898350badf89165ed4d5/src/event.js#L442
	     * for some similar exceptional cases).
	     */
	    NativeView.prototype.delegate = function (eventName, selector, listener) {
	        if (typeof selector !== 'string') {
	            listener = selector;
	            selector = null;
	        }
	        // We have to initialize this here, instead of in the constructor, because the
	        // super constructor eventually calls this method before we get a chance to initialize
	        // this._domEvents to an empty list.
	        if (this._domEvents === void 0) {
	            this._domEvents = [];
	        }
	        var root = this.el;
	        var handler = selector ? function (e) {
	            var node = e.target || e.srcElement;
	            for (; node && node != root; node = node.parentNode) {
	                if (matchesSelector.call(node, selector)) {
	                    e.delegateTarget = node;
	                    if (listener.handleEvent) {
	                        return listener.handleEvent(e);
	                    }
	                    else {
	                        return listener(e);
	                    }
	                }
	            }
	        } : listener;
	        this.el.addEventListener(eventName, handler, false);
	        this._domEvents.push({ eventName: eventName, handler: handler, listener: listener, selector: selector });
	        return handler;
	    };
	    // Remove a single delegated event. Either `eventName` or `selector` must
	    // be included, `selector` and `listener` are optional.
	    NativeView.prototype.undelegate = function (eventName, selector, listener) {
	        if (typeof selector === 'function') {
	            listener = selector;
	            selector = null;
	        }
	        if (this.el && this._domEvents) {
	            var handlers = this._domEvents.slice();
	            var i = handlers.length;
	            while (i--) {
	                var item = handlers[i];
	                var match = item.eventName === eventName &&
	                    (listener ? item.listener === listener : true) &&
	                    (selector ? item.selector === selector : true);
	                if (!match)
	                    continue;
	                this.el.removeEventListener(item.eventName, item.handler, false);
	                this._domEvents.splice(i, 1);
	            }
	        }
	        return this;
	    };
	    // Remove all events created with `delegate` from `el`
	    NativeView.prototype.undelegateEvents = function () {
	        if (this.el && this._domEvents) {
	            for (var i = 0, len = this._domEvents.length; i < len; i++) {
	                var item = this._domEvents[i];
	                this.el.removeEventListener(item.eventName, item.handler, false);
	            }
	            ;
	            this._domEvents.length = 0;
	        }
	        return this;
	    };
	    return NativeView;
	}(Backbone.View));
	exports.NativeView = NativeView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/nativeview.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/ui/widget.js **/
jupyter.define('phosphor@0.7.1/lib/ui/widget.js', function (module, exports, __jupyter_require__) {
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var iteration_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/iteration.js');
	var messaging_1 = __jupyter_require__('phosphor@0.7.1/lib/core/messaging.js');
	var properties_1 = __jupyter_require__('phosphor@0.7.1/lib/core/properties.js');
	var signaling_1 = __jupyter_require__('phosphor@0.7.1/lib/core/signaling.js');
	var title_1 = __jupyter_require__('phosphor@0.7.1/lib/ui/title.js');
	/**
	 * The class name added to Widget instances.
	 */
	var WIDGET_CLASS = 'p-Widget';
	/**
	 * The class name added to hidden widgets.
	 */
	var HIDDEN_CLASS = 'p-mod-hidden';
	/**
	 * The base class of the Phosphor widget hierarchy.
	 *
	 * #### Notes
	 * This class will typically be subclassed in order to create a useful
	 * widget. However, it can be used directly to host externally created
	 * content.
	 */
	var Widget = (function () {
	    /**
	     * Construct a new widget.
	     *
	     * @param options - The options for initializing the widget.
	     */
	    function Widget(options) {
	        if (options === void 0) { options = {}; }
	        this._flags = 0;
	        this._layout = null;
	        this._parent = null;
	        this._node = Private.createNode(options);
	        this.addClass(WIDGET_CLASS);
	    }
	    /**
	     * Dispose of the widget and its descendant widgets.
	     *
	     * #### Notes
	     * It is unsafe to use the widget after it has been disposed.
	     *
	     * All calls made to this method after the first are a no-op.
	     */
	    Widget.prototype.dispose = function () {
	        // Do nothing if the widget is already disposed.
	        if (this.isDisposed) {
	            return;
	        }
	        // Set the disposed flag and emit the disposed signal.
	        this.setFlag(WidgetFlag.IsDisposed);
	        this.disposed.emit(void 0);
	        // Remove or detach the widget if necessary.
	        if (this.parent) {
	            this.parent = null;
	        }
	        else if (this.isAttached) {
	            Widget.detach(this);
	        }
	        // Dispose of the widget layout.
	        if (this._layout) {
	            this._layout.dispose();
	            this._layout = null;
	        }
	        // Clear the attached data associated with the widget.
	        signaling_1.clearSignalData(this);
	        messaging_1.clearMessageData(this);
	        properties_1.clearPropertyData(this);
	        // Clear the reference to the DOM node.
	        this._node = null;
	    };
	    Object.defineProperty(Widget.prototype, "isDisposed", {
	        /**
	         * Test whether the widget has been disposed.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this.testFlag(WidgetFlag.IsDisposed);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Widget.prototype, "isAttached", {
	        /**
	         * Test whether the widget's node is attached to the DOM.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this.testFlag(WidgetFlag.IsAttached);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Widget.prototype, "isHidden", {
	        /**
	         * Test whether the widget is explicitly hidden.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this.testFlag(WidgetFlag.IsHidden);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Widget.prototype, "isVisible", {
	        /**
	         * Test whether the widget is visible.
	         *
	         * #### Notes
	         * A widget is visible when it is attached to the DOM, is not
	         * explicitly hidden, and has no explicitly hidden ancestors.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return this.testFlag(WidgetFlag.IsVisible);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Widget.prototype, "node", {
	        /**
	         * Get the DOM node owned by the widget.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._node;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Widget.prototype, "id", {
	        /**
	         * Get the id of the widget's DOM node.
	         */
	        get: function () {
	            return this._node.id;
	        },
	        /**
	         * Set the id of the widget's DOM node.
	         */
	        set: function (value) {
	            this._node.id = value;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Widget.prototype, "title", {
	        /**
	         * Get the title object for the widget.
	         *
	         * #### Notes
	         * The title object is used by some container widgets when displaying
	         * the widget alongside some title, such as a tab panel or side bar.
	         *
	         * Since not all widgets will use the title, it is created on demand.
	         *
	         * The `owner` property of the title is set to this widget.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return Private.titleProperty.get(this);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Widget.prototype, "parent", {
	        /**
	         * Get the parent of the widget.
	         *
	         * #### Notes
	         * This will be `null` if the widget does not have a parent.
	         */
	        get: function () {
	            return this._parent;
	        },
	        /**
	         * Set the parent of the widget.
	         *
	         * #### Notes
	         * Children are typically added to a widget by using a layout, which
	         * means user code will not normally set the parent widget directly.
	         *
	         * The widget will be automatically removed from its old parent.
	         *
	         * This is a no-op if there is no effective parent change.
	         */
	        set: function (value) {
	            value = value || null;
	            if (this._parent === value) {
	                return;
	            }
	            if (value && this.contains(value)) {
	                throw new Error('Invalid parent widget.');
	            }
	            if (this._parent && !this._parent.isDisposed) {
	                messaging_1.sendMessage(this._parent, new ChildMessage('child-removed', this));
	            }
	            this._parent = value;
	            if (this._parent && !this._parent.isDisposed) {
	                messaging_1.sendMessage(this._parent, new ChildMessage('child-added', this));
	            }
	            messaging_1.sendMessage(this, WidgetMessage.ParentChanged);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Widget.prototype, "layout", {
	        /**
	         * Get the layout for the widget.
	         *
	         * #### Notes
	         * This will be `null` if the widget does not have a layout.
	         */
	        get: function () {
	            return this._layout;
	        },
	        /**
	         * Set the layout for the widget.
	         *
	         * #### Notes
	         * The layout is single-use only. It cannot be set to `null` and it
	         * cannot be changed after the first assignment.
	         *
	         * The layout is disposed automatically when the widget is disposed.
	         */
	        set: function (value) {
	            value = value || null;
	            if (this._layout === value) {
	                return;
	            }
	            if (this.testFlag(WidgetFlag.DisallowLayout)) {
	                throw new Error('Cannot set widget layout.');
	            }
	            if (this._layout) {
	                throw new Error('Cannot change widget layout.');
	            }
	            if (value.parent) {
	                throw new Error('Cannot change layout parent.');
	            }
	            this._layout = value;
	            value.parent = this;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Create an iterator over the widget's children.
	     *
	     * @returns A new iterator over the children of the widget.
	     *
	     * #### Notes
	     * The widget must have a populated layout in order to have children.
	     *
	     * If a layout is not installed, the returned iterator will be empty.
	     */
	    Widget.prototype.children = function () {
	        return this._layout ? this._layout.iter() : iteration_1.empty();
	    };
	    /**
	     * Test whether a widget is a descendant of this widget.
	     *
	     * @param widget - The descendant widget of interest.
	     *
	     * @returns `true` if the widget is a descendant, `false` otherwise.
	     */
	    Widget.prototype.contains = function (widget) {
	        for (; widget; widget = widget._parent) {
	            if (widget === this)
	                return true;
	        }
	        return false;
	    };
	    /**
	     * Test whether the widget's DOM node has the given class name.
	     *
	     * @param name - The class name of interest.
	     *
	     * @returns `true` if the node has the class, `false` otherwise.
	     */
	    Widget.prototype.hasClass = function (name) {
	        return this._node.classList.contains(name);
	    };
	    /**
	     * Add a class name to the widget's DOM node.
	     *
	     * @param name - The class name to add to the node.
	     *
	     * #### Notes
	     * If the class name is already added to the node, this is a no-op.
	     *
	     * The class name must not contain whitespace.
	     */
	    Widget.prototype.addClass = function (name) {
	        this._node.classList.add(name);
	    };
	    /**
	     * Remove a class name from the widget's DOM node.
	     *
	     * @param name - The class name to remove from the node.
	     *
	     * #### Notes
	     * If the class name is not yet added to the node, this is a no-op.
	     *
	     * The class name must not contain whitespace.
	     */
	    Widget.prototype.removeClass = function (name) {
	        this._node.classList.remove(name);
	    };
	    /**
	     * Toggle a class name on the widget's DOM node.
	     *
	     * @param name - The class name to toggle on the node.
	     *
	     * @param force - Whether to force add the class (`true`) or force
	     *   remove the class (`false`). If not provided, the presence of
	     *   the class will be toggled from its current state.
	     *
	     * @returns `true` if the class is now present, `false` otherwise.
	     *
	     * #### Notes
	     * The class name must not contain whitespace.
	     */
	    Widget.prototype.toggleClass = function (name, force) {
	        if (force === true) {
	            this._node.classList.add(name);
	            return true;
	        }
	        if (force === false) {
	            this._node.classList.remove(name);
	            return false;
	        }
	        return this._node.classList.toggle(name);
	    };
	    /**
	     * Post an `'update-request'` message to the widget.
	     *
	     * #### Notes
	     * This is a simple convenience method for posting the message.
	     */
	    Widget.prototype.update = function () {
	        messaging_1.postMessage(this, WidgetMessage.UpdateRequest);
	    };
	    /**
	     * Post a `'fit-request'` message to the widget.
	     *
	     * #### Notes
	     * This is a simple convenience method for posting the message.
	     */
	    Widget.prototype.fit = function () {
	        messaging_1.postMessage(this, WidgetMessage.FitRequest);
	    };
	    /**
	     * Post an `'activate-request'` message to the widget.
	     *
	     * #### Notes
	     * This is a simple convenience method for posting the message.
	     */
	    Widget.prototype.activate = function () {
	        messaging_1.postMessage(this, WidgetMessage.ActivateRequest);
	    };
	    /**
	     * Send a `'close-request'` message to the widget.
	     *
	     * #### Notes
	     * This is a simple convenience method for sending the message.
	     */
	    Widget.prototype.close = function () {
	        messaging_1.sendMessage(this, WidgetMessage.CloseRequest);
	    };
	    /**
	     * Show the widget and make it visible to its parent widget.
	     *
	     * #### Notes
	     * This causes the [[isHidden]] property to be `false`.
	     *
	     * If the widget is not explicitly hidden, this is a no-op.
	     */
	    Widget.prototype.show = function () {
	        if (!this.testFlag(WidgetFlag.IsHidden)) {
	            return;
	        }
	        this.clearFlag(WidgetFlag.IsHidden);
	        this.removeClass(HIDDEN_CLASS);
	        if (this.isAttached && (!this.parent || this.parent.isVisible)) {
	            messaging_1.sendMessage(this, WidgetMessage.AfterShow);
	        }
	        if (this.parent) {
	            messaging_1.sendMessage(this.parent, new ChildMessage('child-shown', this));
	        }
	    };
	    /**
	     * Hide the widget and make it hidden to its parent widget.
	     *
	     * #### Notes
	     * This causes the [[isHidden]] property to be `true`.
	     *
	     * If the widget is explicitly hidden, this is a no-op.
	     */
	    Widget.prototype.hide = function () {
	        if (this.testFlag(WidgetFlag.IsHidden)) {
	            return;
	        }
	        if (this.isAttached && (!this.parent || this.parent.isVisible)) {
	            messaging_1.sendMessage(this, WidgetMessage.BeforeHide);
	        }
	        this.setFlag(WidgetFlag.IsHidden);
	        this.addClass(HIDDEN_CLASS);
	        if (this.parent) {
	            messaging_1.sendMessage(this.parent, new ChildMessage('child-hidden', this));
	        }
	    };
	    /**
	     * Show or hide the widget according to a boolean value.
	     *
	     * @param hidden - `true` to hide the widget, or `false` to show it.
	     *
	     * #### Notes
	     * This is a convenience method for `hide()` and `show()`.
	     */
	    Widget.prototype.setHidden = function (hidden) {
	        if (hidden) {
	            this.hide();
	        }
	        else {
	            this.show();
	        }
	    };
	    /**
	     * Test whether the given widget flag is set.
	     *
	     * #### Notes
	     * This will not typically be called directly by user code.
	     */
	    Widget.prototype.testFlag = function (flag) {
	        return (this._flags & flag) !== 0;
	    };
	    /**
	     * Set the given widget flag.
	     *
	     * #### Notes
	     * This will not typically be called directly by user code.
	     */
	    Widget.prototype.setFlag = function (flag) {
	        this._flags |= flag;
	    };
	    /**
	     * Clear the given widget flag.
	     *
	     * #### Notes
	     * This will not typically be called directly by user code.
	     */
	    Widget.prototype.clearFlag = function (flag) {
	        this._flags &= ~flag;
	    };
	    /**
	     * Process a message sent to the widget.
	     *
	     * @param msg - The message sent to the widget.
	     *
	     * #### Notes
	     * Subclasses may reimplement this method as needed.
	     */
	    Widget.prototype.processMessage = function (msg) {
	        switch (msg.type) {
	            case 'resize':
	                this.notifyLayout(msg);
	                this.onResize(msg);
	                break;
	            case 'update-request':
	                this.notifyLayout(msg);
	                this.onUpdateRequest(msg);
	                break;
	            case 'after-show':
	                this.setFlag(WidgetFlag.IsVisible);
	                this.notifyLayout(msg);
	                this.onAfterShow(msg);
	                break;
	            case 'before-hide':
	                this.notifyLayout(msg);
	                this.onBeforeHide(msg);
	                this.clearFlag(WidgetFlag.IsVisible);
	                break;
	            case 'after-attach':
	                var visible = !this.isHidden && (!this.parent || this.parent.isVisible);
	                if (visible)
	                    this.setFlag(WidgetFlag.IsVisible);
	                this.setFlag(WidgetFlag.IsAttached);
	                this.notifyLayout(msg);
	                this.onAfterAttach(msg);
	                break;
	            case 'before-detach':
	                this.notifyLayout(msg);
	                this.onBeforeDetach(msg);
	                this.clearFlag(WidgetFlag.IsVisible);
	                this.clearFlag(WidgetFlag.IsAttached);
	                break;
	            case 'activate-request':
	                this.notifyLayout(msg);
	                this.onActivateRequest(msg);
	                break;
	            case 'close-request':
	                this.notifyLayout(msg);
	                this.onCloseRequest(msg);
	                break;
	            case 'child-added':
	                this.notifyLayout(msg);
	                this.onChildAdded(msg);
	                break;
	            case 'child-removed':
	                this.notifyLayout(msg);
	                this.onChildRemoved(msg);
	                break;
	            default:
	                this.notifyLayout(msg);
	                break;
	        }
	    };
	    /**
	     * Invoke the message processing routine of the widget's layout.
	     *
	     * @param msg - The message to dispatch to the layout.
	     *
	     * #### Notes
	     * This is a no-op if the widget does not have a layout.
	     *
	     * This will not typically be called directly by user code.
	     */
	    Widget.prototype.notifyLayout = function (msg) {
	        if (this._layout)
	            this._layout.processParentMessage(msg);
	    };
	    /**
	     * A message handler invoked on a `'close-request'` message.
	     *
	     * #### Notes
	     * The default implementation unparents or detaches the widget.
	     */
	    Widget.prototype.onCloseRequest = function (msg) {
	        if (this.parent) {
	            this.parent = null;
	        }
	        else if (this.isAttached) {
	            Widget.detach(this);
	        }
	    };
	    /**
	     * A message handler invoked on a `'resize'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Widget.prototype.onResize = function (msg) { };
	    /**
	     * A message handler invoked on an `'update-request'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Widget.prototype.onUpdateRequest = function (msg) { };
	    /**
	     * A message handler invoked on an `'activate-request'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Widget.prototype.onActivateRequest = function (msg) { };
	    /**
	     * A message handler invoked on an `'after-show'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Widget.prototype.onAfterShow = function (msg) { };
	    /**
	     * A message handler invoked on a `'before-hide'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Widget.prototype.onBeforeHide = function (msg) { };
	    /**
	     * A message handler invoked on an `'after-attach'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Widget.prototype.onAfterAttach = function (msg) { };
	    /**
	     * A message handler invoked on a `'before-detach'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Widget.prototype.onBeforeDetach = function (msg) { };
	    /**
	     * A message handler invoked on a `'child-added'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Widget.prototype.onChildAdded = function (msg) { };
	    /**
	     * A message handler invoked on a `'child-removed'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Widget.prototype.onChildRemoved = function (msg) { };
	    return Widget;
	}());
	exports.Widget = Widget;
	// Define the signals for the `Widget` class.
	signaling_1.defineSignal(Widget.prototype, 'disposed');
	/**
	 * The namespace for the `Widget` class statics.
	 */
	(function (Widget) {
	    // TODO - should this be an instance method?
	    /**
	     * Attach a widget to a host DOM node.
	     *
	     * @param widget - The widget of interest.
	     *
	     * @param host - The DOM node to use as the widget's host.
	     *
	     * #### Notes
	     * This will throw an error if the widget is not a root widget, if
	     * the widget is already attached, or if the host is not attached
	     * to the DOM.
	     */
	    function attach(widget, host) {
	        if (widget.parent) {
	            throw new Error('Cannot attach child widget.');
	        }
	        if (widget.isAttached || document.body.contains(widget.node)) {
	            throw new Error('Widget already attached.');
	        }
	        if (!document.body.contains(host)) {
	            throw new Error('Host not attached.');
	        }
	        host.appendChild(widget.node);
	        messaging_1.sendMessage(widget, WidgetMessage.AfterAttach);
	    }
	    Widget.attach = attach;
	    // TODO - should this be an instance method?
	    /**
	     * Detach the widget from its host DOM node.
	     *
	     * @param widget - The widget of interest.
	     *
	     * #### Notes
	     * This will throw an error if the widget is not a root widget, or
	     * if the widget is not attached to the DOM.
	     */
	    function detach(widget) {
	        if (widget.parent) {
	            throw new Error('Cannot detach child widget.');
	        }
	        if (!widget.isAttached || !document.body.contains(widget.node)) {
	            throw new Error('Widget not attached.');
	        }
	        messaging_1.sendMessage(widget, WidgetMessage.BeforeDetach);
	        widget.node.parentNode.removeChild(widget.node);
	    }
	    Widget.detach = detach;
	    /**
	     * Prepare a widget for absolute layout geometry.
	     *
	     * @param widget - The widget of interest.
	     *
	     * #### Notes
	     * This sets the inline style position of the widget to `absolute`.
	     */
	    function prepareGeometry(widget) {
	        widget.node.style.position = 'absolute';
	    }
	    Widget.prepareGeometry = prepareGeometry;
	    /**
	     * Reset the layout geometry of a widget.
	     *
	     * @param widget - The widget of interest.
	     *
	     * #### Notes
	     * This clears the inline style position and geometry of the widget.
	     */
	    function resetGeometry(widget) {
	        var style = widget.node.style;
	        var rect = Private.rectProperty.get(widget);
	        rect.top = NaN;
	        rect.left = NaN;
	        rect.width = NaN;
	        rect.height = NaN;
	        style.position = '';
	        style.top = '';
	        style.left = '';
	        style.width = '';
	        style.height = '';
	    }
	    Widget.resetGeometry = resetGeometry;
	    /**
	     * Set the absolute layout geometry of a widget.
	     *
	     * @param widget - The widget of interest.
	     *
	     * @param left - The desired offset left position of the widget.
	     *
	     * @param top - The desired offset top position of the widget.
	     *
	     * @param width - The desired offset width of the widget.
	     *
	     * @param height - The desired offset height of the widget.
	     *
	     * #### Notes
	     * All dimensions are assumed to be pixels with coordinates relative
	     * to the origin of the widget's offset parent.
	     *
	     * The widget's node is assumed to be position `absolute`.
	     *
	     * If the widget is resized from its previous size, a `ResizeMessage`
	     * will be automatically sent to the widget.
	     */
	    function setGeometry(widget, left, top, width, height) {
	        var resized = false;
	        var style = widget.node.style;
	        var rect = Private.rectProperty.get(widget);
	        if (rect.top !== top) {
	            rect.top = top;
	            style.top = top + "px";
	        }
	        if (rect.left !== left) {
	            rect.left = left;
	            style.left = left + "px";
	        }
	        if (rect.width !== width) {
	            resized = true;
	            rect.width = width;
	            style.width = width + "px";
	        }
	        if (rect.height !== height) {
	            resized = true;
	            rect.height = height;
	            style.height = height + "px";
	        }
	        if (resized) {
	            messaging_1.sendMessage(widget, new ResizeMessage(width, height));
	        }
	    }
	    Widget.setGeometry = setGeometry;
	})(Widget = exports.Widget || (exports.Widget = {}));
	exports.Widget = Widget;
	/**
	 * An abstract base class for creating Phosphor layouts.
	 *
	 * #### Notes
	 * A layout is used to add widgets to a parent and to arrange those
	 * widgets within the parent's DOM node.
	 *
	 * This class implements the base functionality which is required of
	 * nearly all layouts. It must be subclassed in order to be useful.
	 *
	 * Notably, this class does not define a uniform interface for adding
	 * widgets to the layout. A subclass should define that API in a way
	 * which is meaningful for its intended use.
	 */
	var Layout = (function () {
	    function Layout() {
	        this._disposed = false;
	        this._parent = null;
	    }
	    /**
	     * Dispose of the resources held by the layout.
	     *
	     * #### Notes
	     * This should be reimplemented to clear and dispose of the widgets.
	     *
	     * All reimplementations should call the superclass method.
	     *
	     * This method is called automatically when the parent is disposed.
	     */
	    Layout.prototype.dispose = function () {
	        this._disposed = true;
	        this._parent = null;
	        signaling_1.clearSignalData(this);
	        properties_1.clearPropertyData(this);
	    };
	    Object.defineProperty(Layout.prototype, "isDisposed", {
	        /**
	         * Test whether the layout is disposed.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._disposed;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Layout.prototype, "parent", {
	        /**
	         * Get the parent widget of the layout.
	         */
	        get: function () {
	            return this._parent;
	        },
	        /**
	         * Set the parent widget of the layout.
	         *
	         * #### Notes
	         * This is set automatically when installing the layout on the parent
	         * widget. The parent widget should not be set directly by user code.
	         */
	        set: function (value) {
	            if (!value) {
	                throw new Error('Cannot set parent widget to null.');
	            }
	            if (this._parent === value) {
	                return;
	            }
	            if (this._parent) {
	                throw new Error('Cannot change parent widget.');
	            }
	            if (value.layout !== this) {
	                throw new Error('Invalid parent widget.');
	            }
	            this._parent = value;
	            this.init();
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Process a message sent to the parent widget.
	     *
	     * @param msg - The message sent to the parent widget.
	     *
	     * #### Notes
	     * This method is called by the parent widget to process a message.
	     *
	     * Subclasses may reimplement this method as needed.
	     */
	    Layout.prototype.processParentMessage = function (msg) {
	        switch (msg.type) {
	            case 'resize':
	                this.onResize(msg);
	                break;
	            case 'update-request':
	                this.onUpdateRequest(msg);
	                break;
	            case 'fit-request':
	                this.onFitRequest(msg);
	                break;
	            case 'after-show':
	                this.onAfterShow(msg);
	                break;
	            case 'before-hide':
	                this.onBeforeHide(msg);
	                break;
	            case 'after-attach':
	                this.onAfterAttach(msg);
	                break;
	            case 'before-detach':
	                this.onBeforeDetach(msg);
	                break;
	            case 'child-removed':
	                this.onChildRemoved(msg);
	                break;
	            case 'child-shown':
	                this.onChildShown(msg);
	                break;
	            case 'child-hidden':
	                this.onChildHidden(msg);
	                break;
	        }
	    };
	    /**
	     * Perform layout initialization which requires the parent widget.
	     *
	     * #### Notes
	     * This method is invoked immediately after the layout is installed
	     * on the parent widget.
	     *
	     * The default implementation reparents all of the widgets to the
	     * layout parent widget.
	     *
	     * Subclasses should reimplement this method and attach the child
	     * widget nodes to the parent widget's node.
	     */
	    Layout.prototype.init = function () {
	        var _this = this;
	        iteration_1.each(this, function (widget) { widget.parent = _this.parent; });
	    };
	    /**
	     * A message handler invoked on a `'resize'` message.
	     *
	     * #### Notes
	     * The layout should ensure that its widgets are resized according
	     * to the specified layout space, and that they are sent a `'resize'`
	     * message if appropriate.
	     *
	     * The default implementation of this method sends an `UnknownSize`
	     * resize message to all widgets.
	     *
	     * This may be reimplemented by subclasses as needed.
	     */
	    Layout.prototype.onResize = function (msg) {
	        iteration_1.each(this, function (widget) { messaging_1.sendMessage(widget, ResizeMessage.UnknownSize); });
	    };
	    /**
	     * A message handler invoked on an `'update-request'` message.
	     *
	     * #### Notes
	     * The layout should ensure that its widgets are resized according
	     * to the available layout space, and that they are sent a `'resize'`
	     * message if appropriate.
	     *
	     * The default implementation of this method sends an `UnknownSize`
	     * resize message to all widgets.
	     *
	     * This may be reimplemented by subclasses as needed.
	     */
	    Layout.prototype.onUpdateRequest = function (msg) {
	        iteration_1.each(this, function (widget) { messaging_1.sendMessage(widget, ResizeMessage.UnknownSize); });
	    };
	    /**
	     * A message handler invoked on an `'after-attach'` message.
	     *
	     * #### Notes
	     * The default implementation of this method forwards the message
	     * to all widgets. It assumes all widget nodes are attached to the
	     * parent widget node.
	     *
	     * This may be reimplemented by subclasses as needed.
	     */
	    Layout.prototype.onAfterAttach = function (msg) {
	        iteration_1.each(this, function (widget) { messaging_1.sendMessage(widget, msg); });
	    };
	    /**
	     * A message handler invoked on a `'before-detach'` message.
	     *
	     * #### Notes
	     * The default implementation of this method forwards the message
	     * to all widgets. It assumes all widget nodes are attached to the
	     * parent widget node.
	     *
	     * This may be reimplemented by subclasses as needed.
	     */
	    Layout.prototype.onBeforeDetach = function (msg) {
	        iteration_1.each(this, function (widget) { messaging_1.sendMessage(widget, msg); });
	    };
	    /**
	     * A message handler invoked on an `'after-show'` message.
	     *
	     * #### Notes
	     * The default implementation of this method forwards the message to
	     * all non-hidden widgets. It assumes all widget nodes are attached
	     * to the parent widget node.
	     *
	     * This may be reimplemented by subclasses as needed.
	     */
	    Layout.prototype.onAfterShow = function (msg) {
	        iteration_1.each(this, function (widget) { if (!widget.isHidden)
	            messaging_1.sendMessage(widget, msg); });
	    };
	    /**
	     * A message handler invoked on a `'before-hide'` message.
	     *
	     * #### Notes
	     * The default implementation of this method forwards the message to
	     * all non-hidden widgets. It assumes all widget nodes are attached
	     * to the parent widget node.
	     *
	     * This may be reimplemented by subclasses as needed.
	     */
	    Layout.prototype.onBeforeHide = function (msg) {
	        iteration_1.each(this, function (widget) { if (!widget.isHidden)
	            messaging_1.sendMessage(widget, msg); });
	    };
	    /**
	     * A message handler invoked on a `'child-removed'` message.
	     *
	     * #### Notes
	     * This will remove the child widget from the layout.
	     *
	     * Subclasses should **not** typically reimplement this method.
	     */
	    Layout.prototype.onChildRemoved = function (msg) {
	        this.removeWidget(msg.child);
	    };
	    /**
	     * A message handler invoked on a `'fit-request'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Layout.prototype.onFitRequest = function (msg) { };
	    /**
	     * A message handler invoked on a `'child-shown'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Layout.prototype.onChildShown = function (msg) { };
	    /**
	     * A message handler invoked on a `'child-hidden'` message.
	     *
	     * #### Notes
	     * The default implementation of this handler is a no-op.
	     */
	    Layout.prototype.onChildHidden = function (msg) { };
	    return Layout;
	}());
	exports.Layout = Layout;
	// TODO should this be in the Widget namespace?
	/**
	 * An enum of widget bit flags.
	 */
	var WidgetFlag;
	(function (WidgetFlag) {
	    /**
	     * The widget has been disposed.
	     */
	    WidgetFlag[WidgetFlag["IsDisposed"] = 1] = "IsDisposed";
	    /**
	     * The widget is attached to the DOM.
	     */
	    WidgetFlag[WidgetFlag["IsAttached"] = 2] = "IsAttached";
	    /**
	     * The widget is hidden.
	     */
	    WidgetFlag[WidgetFlag["IsHidden"] = 4] = "IsHidden";
	    /**
	     * The widget is visible.
	     */
	    WidgetFlag[WidgetFlag["IsVisible"] = 8] = "IsVisible";
	    /**
	     * A layout cannot be set on the widget.
	     */
	    WidgetFlag[WidgetFlag["DisallowLayout"] = 16] = "DisallowLayout";
	})(WidgetFlag = exports.WidgetFlag || (exports.WidgetFlag = {}));
	// TODO should this be in the Widget namespace?
	/**
	 * A collection of stateless messages related to widgets.
	 */
	var WidgetMessage;
	(function (WidgetMessage) {
	    /**
	     * A singleton `'after-show'` message.
	     *
	     * #### Notes
	     * This message is sent to a widget after it becomes visible.
	     *
	     * This message is **not** sent when the widget is being attached.
	     */
	    WidgetMessage.AfterShow = new messaging_1.Message('after-show');
	    /**
	     * A singleton `'before-hide'` message.
	     *
	     * #### Notes
	     * This message is sent to a widget before it becomes not-visible.
	     *
	     * This message is **not** sent when the widget is being detached.
	     */
	    WidgetMessage.BeforeHide = new messaging_1.Message('before-hide');
	    /**
	     * A singleton `'after-attach'` message.
	     *
	     * #### Notes
	     * This message is sent to a widget after it is attached.
	     */
	    WidgetMessage.AfterAttach = new messaging_1.Message('after-attach');
	    /**
	     * A singleton `'before-detach'` message.
	     *
	     * #### Notes
	     * This message is sent to a widget before it is detached.
	     */
	    WidgetMessage.BeforeDetach = new messaging_1.Message('before-detach');
	    /**
	     * A singleton `'parent-changed'` message.
	     *
	     * #### Notes
	     * This message is sent to a widget when its parent has changed.
	     */
	    WidgetMessage.ParentChanged = new messaging_1.Message('parent-changed');
	    /**
	     * A singleton conflatable `'update-request'` message.
	     *
	     * #### Notes
	     * This message can be dispatched to supporting widgets in order to
	     * update their content based on the current widget state. Not all
	     * widgets will respond to messages of this type.
	     *
	     * For widgets with a layout, this message will inform the layout to
	     * update the position and size of its child widgets.
	     */
	    WidgetMessage.UpdateRequest = new messaging_1.ConflatableMessage('update-request');
	    /**
	     * A singleton conflatable `'fit-request'` message.
	     *
	     * #### Notes
	     * For widgets with a layout, this message will inform the layout to
	     * recalculate its size constraints to fit the space requirements of
	     * its child widgets, and to update their position and size. Not all
	     * layouts will respond to messages of this type.
	     */
	    WidgetMessage.FitRequest = new messaging_1.ConflatableMessage('fit-request');
	    /**
	     * A singleton conflatable `'activate-request'` message.
	     *
	     * #### Notes
	     * This message should be dispatched to a widget when it should
	     * perform the actions necessary to activate the widget, which
	     * may include focusing its node or descendant node.
	     */
	    WidgetMessage.ActivateRequest = new messaging_1.ConflatableMessage('activate-request');
	    /**
	     * A singleton conflatable `'close-request'` message.
	     *
	     * #### Notes
	     * This message should be dispatched to a widget when it should close
	     * and remove itself from the widget hierarchy.
	     */
	    WidgetMessage.CloseRequest = new messaging_1.ConflatableMessage('close-request');
	})(WidgetMessage = exports.WidgetMessage || (exports.WidgetMessage = {}));
	// TODO should this be in the Widget namespace?
	/**
	 * A message class for child related messages.
	 */
	var ChildMessage = (function (_super) {
	    __extends(ChildMessage, _super);
	    /**
	     * Construct a new child message.
	     *
	     * @param type - The message type.
	     *
	     * @param child - The child widget for the message.
	     */
	    function ChildMessage(type, child) {
	        var _this = _super.call(this, type) || this;
	        _this._child = child;
	        return _this;
	    }
	    Object.defineProperty(ChildMessage.prototype, "child", {
	        /**
	         * The child widget for the message.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._child;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    return ChildMessage;
	}(messaging_1.Message));
	exports.ChildMessage = ChildMessage;
	// TODO should this be in the Widget namespace?
	/**
	 * A message class for `'resize'` messages.
	 */
	var ResizeMessage = (function (_super) {
	    __extends(ResizeMessage, _super);
	    /**
	     * Construct a new resize message.
	     *
	     * @param width - The **offset width** of the widget, or `-1` if
	     *   the width is not known.
	     *
	     * @param height - The **offset height** of the widget, or `-1` if
	     *   the height is not known.
	     */
	    function ResizeMessage(width, height) {
	        var _this = _super.call(this, 'resize') || this;
	        _this._width = width;
	        _this._height = height;
	        return _this;
	    }
	    Object.defineProperty(ResizeMessage.prototype, "width", {
	        /**
	         * The offset width of the widget.
	         *
	         * #### Notes
	         * This will be `-1` if the width is unknown.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._width;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(ResizeMessage.prototype, "height", {
	        /**
	         * The offset height of the widget.
	         *
	         * #### Notes
	         * This will be `-1` if the height is unknown.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._height;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    return ResizeMessage;
	}(messaging_1.Message));
	exports.ResizeMessage = ResizeMessage;
	/**
	 * The namespace for the `ResizeMessage` class statics.
	 */
	(function (ResizeMessage) {
	    /**
	     * A singleton `'resize'` message with an unknown size.
	     */
	    ResizeMessage.UnknownSize = new ResizeMessage(-1, -1);
	})(ResizeMessage = exports.ResizeMessage || (exports.ResizeMessage = {}));
	exports.ResizeMessage = ResizeMessage;
	/**
	 * The namespace for the private module data.
	 */
	var Private;
	(function (Private) {
	    /**
	     * A property descriptor for a widget absolute geometry rect.
	     */
	    Private.rectProperty = new properties_1.AttachedProperty({
	        name: 'rect',
	        create: function () { return ({ top: NaN, left: NaN, width: NaN, height: NaN }); },
	    });
	    /**
	     * An attached property for the widget title object.
	     */
	    Private.titleProperty = new properties_1.AttachedProperty({
	        name: 'title',
	        create: function (owner) { return new title_1.Title({ owner: owner }); },
	    });
	    /**
	     * Create a DOM node for the given widget options.
	     */
	    function createNode(options) {
	        return options.node || document.createElement('div');
	    }
	    Private.createNode = createNode;
	})(Private || (Private = {}));
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/ui/widget.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/algorithm/iteration.js **/
jupyter.define('phosphor@0.7.1/lib/algorithm/iteration.js', function (module, exports, __jupyter_require__) {
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	"use strict";
	/**
	 * Create an iterator for an iterable or array-like object.
	 *
	 * @param object - The iterable or array-like object of interest.
	 *
	 * @returns A new iterator for the given object.
	 *
	 * #### Notes
	 * This function allows iteration algorithms to operate on user-defined
	 * iterable types and builtin array-like objects in a uniform fashion.
	 */
	function iter(object) {
	    var it;
	    if (typeof object.iter === 'function') {
	        it = object.iter();
	    }
	    else {
	        it = new ArrayIterator(object, 0);
	    }
	    return it;
	}
	exports.iter = iter;
	/**
	 * Create an array from an iterable of values.
	 *
	 * @param object - The iterable or array-like object of interest.
	 *
	 * @returns A new array of values from the given object.
	 */
	function toArray(object) {
	    var value;
	    var result = [];
	    var it = iter(object);
	    while ((value = it.next()) !== void 0) {
	        result[result.length] = value;
	    }
	    return result;
	}
	exports.toArray = toArray;
	/**
	 * Create an empty iterator.
	 *
	 * @returns A new iterator which yields nothing.
	 */
	function empty() {
	    return new EmptyIterator();
	}
	exports.empty = empty;
	/**
	 * An iterator which is always empty.
	 */
	var EmptyIterator = (function () {
	    /**
	     * Construct a new empty iterator.
	     */
	    function EmptyIterator() {
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    EmptyIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the current iterator.
	     *
	     * @returns A new independent clone of the current iterator.
	     */
	    EmptyIterator.prototype.clone = function () {
	        return new EmptyIterator();
	    };
	    /**
	     * Get the next value from the iterator.
	     *
	     * @returns Always `undefined`.
	     */
	    EmptyIterator.prototype.next = function () {
	        return void 0;
	    };
	    return EmptyIterator;
	}());
	exports.EmptyIterator = EmptyIterator;
	/**
	 * An iterator for an array-like object.
	 *
	 * #### Notes
	 * This iterator can be used for any builtin JS array-like object.
	 */
	var ArrayIterator = (function () {
	    /**
	     * Construct a new array iterator.
	     *
	     * @param source - The array-like object of interest.
	     *
	     * @param start - The starting index for iteration.
	     */
	    function ArrayIterator(source, start) {
	        this._source = source;
	        this._index = start;
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    ArrayIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the current iterator.
	     *
	     * @returns A new independent clone of the current iterator.
	     *
	     * #### Notes
	     * The source array is shared among clones.
	     */
	    ArrayIterator.prototype.clone = function () {
	        return new ArrayIterator(this._source, this._index);
	    };
	    /**
	     * Get the next value from the source array.
	     *
	     * @returns The next value from the source array, or `undefined`
	     *   if the iterator is exhausted.
	     */
	    ArrayIterator.prototype.next = function () {
	        if (this._index >= this._source.length) {
	            return void 0;
	        }
	        return this._source[this._index++];
	    };
	    return ArrayIterator;
	}());
	exports.ArrayIterator = ArrayIterator;
	/**
	 * Invoke a function for each value in an iterable.
	 *
	 * @param object - The iterable or array-like object of interest.
	 *
	 * @param fn - The callback function to invoke for each value.
	 *
	 * #### Notes
	 * Iteration cannot be terminated early.
	 */
	function each(object, fn) {
	    var value;
	    var it = iter(object);
	    while ((value = it.next()) !== void 0) {
	        fn(value);
	    }
	}
	exports.each = each;
	/**
	 * Test whether all values in an iterable satisfy a predicate.
	 *
	 * @param object - The iterable or array-like object of interest.
	 *
	 * @param fn - The predicate function to invoke for each value.
	 *
	 * @returns `true` if all values pass the test, `false` otherwise.
	 *
	 * #### Notes
	 * Iteration terminates on the first `false` predicate result.
	 */
	function every(object, fn) {
	    var value;
	    var it = iter(object);
	    while ((value = it.next()) !== void 0) {
	        if (!fn(value)) {
	            return false;
	        }
	    }
	    return true;
	}
	exports.every = every;
	/**
	 * Test whether any value in an iterable satisfies a predicate.
	 *
	 * @param object - The iterable or array-like object of interest.
	 *
	 * @param fn - The predicate function to invoke for each value.
	 *
	 * @returns `true` if any value passes the test, `false` otherwise.
	 *
	 * #### Notes
	 * Iteration terminates on the first `true` predicate result.
	 */
	function some(object, fn) {
	    var value;
	    var it = iter(object);
	    while ((value = it.next()) !== void 0) {
	        if (fn(value)) {
	            return true;
	        }
	    }
	    return false;
	}
	exports.some = some;
	function reduce(object, fn, initial) {
	    // Setup the iterator and fetch the first value.
	    var it = iter(object);
	    var first = it.next();
	    // An empty iterator and no initial value is an error.
	    if (first === void 0 && initial === void 0) {
	        throw new TypeError('Reduce of empty iterable with no initial value.');
	    }
	    // If the iterator is empty, return the initial value.
	    if (first === void 0) {
	        return initial;
	    }
	    // If the iterator has a single item and no initial value, the
	    // reducer is not invoked and the first item is the return value.
	    var second = it.next();
	    if (second === void 0 && initial === void 0) {
	        return first;
	    }
	    // If iterator has a single item and an initial value is provided,
	    // the reducer is invoked and that result is the return value.
	    if (second === void 0) {
	        return fn(initial, first);
	    }
	    // Setup the initial accumulator value.
	    var accumulator;
	    if (initial === void 0) {
	        accumulator = fn(first, second);
	    }
	    else {
	        accumulator = fn(fn(initial, first), second);
	    }
	    // Iterate the rest of the values, updating the accumulator.
	    var next;
	    while ((next = it.next()) !== void 0) {
	        accumulator = fn(accumulator, next);
	    }
	    // Return the final accumulated value.
	    return accumulator;
	}
	exports.reduce = reduce;
	/**
	 * Filter an iterable for values which pass a test.
	 *
	 * @param object - The iterable or array-like object of interest.
	 *
	 * @param fn - The predicate function to invoke for each value.
	 *
	 * @returns An iterator which yields the values which pass the test.
	 */
	function filter(object, fn) {
	    return new FilterIterator(iter(object), fn);
	}
	exports.filter = filter;
	/**
	 * An iterator which yields values which pass a test.
	 */
	var FilterIterator = (function () {
	    /**
	     * Construct a new filter iterator.
	     *
	     * @param source - The iterator of values of interest.
	     *
	     * @param fn - The predicate function to invoke for each value in
	     *   the iterator. It returns whether the value passes the test.
	     */
	    function FilterIterator(source, fn) {
	        this._source = source;
	        this._fn = fn;
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    FilterIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the current iterator.
	     *
	     * @returns A new independent clone of the current iterator.
	     *
	     * #### Notes
	     * The source iterator must be cloneable.
	     *
	     * The predicate function is shared among clones.
	     */
	    FilterIterator.prototype.clone = function () {
	        return new FilterIterator(this._source.clone(), this._fn);
	    };
	    /**
	     * Get the next value which passes the test.
	     *
	     * @returns The next value from the source iterator which passes
	     *   the predicate, or `undefined` if the iterator is exhausted.
	     */
	    FilterIterator.prototype.next = function () {
	        var value;
	        var fn = this._fn;
	        var it = this._source;
	        while ((value = it.next()) !== void 0) {
	            if (fn(value)) {
	                return value;
	            }
	        }
	        return void 0;
	    };
	    return FilterIterator;
	}());
	exports.FilterIterator = FilterIterator;
	/**
	 * Transform the values of an iterable with a mapping function.
	 *
	 * @param object - The iterable or array-like object of interest.
	 *
	 * @param fn - The mapping function to invoke for each value.
	 *
	 * @returns An iterator which yields the transformed values.
	 */
	function map(object, fn) {
	    return new MapIterator(iter(object), fn);
	}
	exports.map = map;
	/**
	 * An iterator which transforms values using a mapping function.
	 */
	var MapIterator = (function () {
	    /**
	     * Construct a new map iterator.
	     *
	     * @param source - The iterator of values of interest.
	     *
	     * @param fn - The mapping function to invoke for each value in the
	     *   iterator. It returns the transformed value.
	     */
	    function MapIterator(source, fn) {
	        this._source = source;
	        this._fn = fn;
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    MapIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the current iterator.
	     *
	     * @returns A new independent clone of the current iterator.
	     *
	     * #### Notes
	     * The source iterator must be cloneable.
	     *
	     * The mapping function is shared among clones.
	     */
	    MapIterator.prototype.clone = function () {
	        return new MapIterator(this._source.clone(), this._fn);
	    };
	    /**
	     * Get the next mapped value from the source iterator.
	     *
	     * @returns The next value from the source iterator transformed
	     *   by the mapper, or `undefined` if the iterator is exhausted.
	     */
	    MapIterator.prototype.next = function () {
	        var value = this._source.next();
	        if (value === void 0) {
	            return void 0;
	        }
	        return this._fn.call(void 0, value);
	    };
	    return MapIterator;
	}());
	exports.MapIterator = MapIterator;
	/**
	 * Attach an incremental index to an iterable.
	 *
	 * @param object - The iterable or array-like object of interest.
	 *
	 * @param start - The initial value of the index. The default is zero.
	 *
	 * @returns An iterator which yields `[index, value]` tuples.
	 */
	function enumerate(object, start) {
	    if (start === void 0) { start = 0; }
	    return new EnumerateIterator(iter(object), start);
	}
	exports.enumerate = enumerate;
	/**
	 * An iterator which attaches an incremental index to a source.
	 */
	var EnumerateIterator = (function () {
	    /**
	     * Construct a new enumerate iterator.
	     *
	     * @param source - The iterator of values of interest.
	     *
	     * @param start - The initial value of the index.
	     */
	    function EnumerateIterator(source, start) {
	        this._source = source;
	        this._index = start;
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    EnumerateIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the enumerate iterator.
	     *
	     * @returns A new iterator starting with the current value.
	     *
	     * #### Notes
	     * The source iterator must be cloneable.
	     */
	    EnumerateIterator.prototype.clone = function () {
	        return new EnumerateIterator(this._source.clone(), this._index);
	    };
	    /**
	     * Get the next value from the enumeration.
	     *
	     * @returns The next value from the enumeration, or `undefined` if
	     *   the iterator is exhausted.
	     */
	    EnumerateIterator.prototype.next = function () {
	        var value = this._source.next();
	        if (value === void 0) {
	            return void 0;
	        }
	        return [this._index++, value];
	    };
	    return EnumerateIterator;
	}());
	exports.EnumerateIterator = EnumerateIterator;
	/**
	 * Create an iterator which yields a value a single time.
	 *
	 * @param value - The value to wrap in an iterator.
	 *
	 * @returns A new iterator which yields the value a single time.
	 */
	function once(value) {
	    return new RepeatIterator(value, 1);
	}
	exports.once = once;
	/**
	 * Create an iterator which repeats a value a number of times.
	 *
	 * @param value - The value to repeat.
	 *
	 * @param count - The number of times to repeat the value.
	 *
	 * @returns A new iterator which repeats the specified value.
	 */
	function repeat(value, count) {
	    return new RepeatIterator(value, count);
	}
	exports.repeat = repeat;
	/**
	 * An iterator which repeats a value a specified number of times.
	 */
	var RepeatIterator = (function () {
	    /**
	     * Construct a new repeat iterator.
	     *
	     * @param value - The value to repeat.
	     *
	     * @param count - The number of times to repeat the value.
	     */
	    function RepeatIterator(value, count) {
	        this._value = value;
	        this._count = count;
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    RepeatIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the repeat iterator.
	     *
	     * @returns A new iterator starting with the current value.
	     */
	    RepeatIterator.prototype.clone = function () {
	        return new RepeatIterator(this._value, this._count);
	    };
	    /**
	     * Get the next value from the iterator.
	     *
	     * @returns The next value from the iterator, or `undefined` if
	     *   the iterator is exhausted.
	     */
	    RepeatIterator.prototype.next = function () {
	        if (this._count <= 0) {
	            return void 0;
	        }
	        this._count--;
	        return this._value;
	    };
	    return RepeatIterator;
	}());
	exports.RepeatIterator = RepeatIterator;
	/**
	 * Chain together several iterables.
	 *
	 * @param objects - The iterables or array-like objects of interest.
	 *
	 * @returns An iterator which yields the values of the given iterables
	 *   in the order in which they are supplied.
	 */
	function chain() {
	    var objects = [];
	    for (var _i = 0; _i < arguments.length; _i++) {
	        objects[_i] = arguments[_i];
	    }
	    return new ChainIterator(map(objects, iter));
	}
	exports.chain = chain;
	/**
	 * An iterator which chains together several iterators.
	 */
	var ChainIterator = (function () {
	    /**
	     * Construct a new chain iterator.
	     *
	     * @param source - The iterator of iterators of interest.
	     */
	    function ChainIterator(source) {
	        this._cloned = false;
	        this._source = source;
	        this._active = void 0;
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    ChainIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the chain iterator.
	     *
	     * @returns A new iterator starting with the current value.
	     *
	     * #### Notes
	     * The source iterators must be cloneable.
	     */
	    ChainIterator.prototype.clone = function () {
	        var result = new ChainIterator(this._source.clone());
	        result._active = this._active && this._active.clone();
	        result._cloned = true;
	        this._cloned = true;
	        return result;
	    };
	    /**
	     * Get the next value from the iterator.
	     *
	     * @returns The next value from the iterator, or `undefined` when
	     *   all source iterators are exhausted.
	     */
	    ChainIterator.prototype.next = function () {
	        if (this._active === void 0) {
	            this._active = this._source.next();
	            if (this._active === void 0) {
	                return void 0;
	            }
	            if (this._cloned) {
	                this._active = this._active.clone();
	            }
	        }
	        var value = this._active.next();
	        if (value !== void 0) {
	            return value;
	        }
	        this._active = void 0;
	        return this.next();
	    };
	    return ChainIterator;
	}());
	exports.ChainIterator = ChainIterator;
	/**
	 * Iterate several iterables in lockstep.
	 *
	 * @param objects - The iterables or array-like objects of interest.
	 *
	 * @returns An iterator which yields successive tuples of values where
	 *   each value is taken in turn from the provided iterables. It will
	 *   be as long as the shortest provided iterable.
	 */
	function zip() {
	    var objects = [];
	    for (var _i = 0; _i < arguments.length; _i++) {
	        objects[_i] = arguments[_i];
	    }
	    return new ZipIterator(objects.map(iter));
	}
	exports.zip = zip;
	/**
	 * An iterator which iterates several sources in lockstep.
	 */
	var ZipIterator = (function () {
	    /**
	     * Construct a new zip iterator.
	     *
	     * @param source - The iterators of interest.
	     */
	    function ZipIterator(source) {
	        this._source = source;
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    ZipIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the zip iterator.
	     *
	     * @returns A new iterator starting with the current value.
	     *
	     * #### Notes
	     * The source iterators must be cloneable.
	     */
	    ZipIterator.prototype.clone = function () {
	        return new ZipIterator(this._source.map(function (it) { return it.clone(); }));
	    };
	    /**
	     * Get the next zipped value from the iterator.
	     *
	     * @returns The next zipped value from the iterator, or `undefined`
	     *   when the first source iterator is exhausted.
	     */
	    ZipIterator.prototype.next = function () {
	        var iters = this._source;
	        var result = new Array(iters.length);
	        for (var i = 0, n = iters.length; i < n; ++i) {
	            var value = iters[i].next();
	            if (value === void 0) {
	                return void 0;
	            }
	            result[i] = value;
	        }
	        return result;
	    };
	    return ZipIterator;
	}());
	exports.ZipIterator = ZipIterator;
	/**
	 * Iterate over an iterable using a stepped increment.
	 *
	 * @param object - The iterable or array-like object of interest.
	 *
	 * @param step - The distance to step on each iteration. A value
	 *   of less than `1` will behave the same as a value of `1`.
	 *
	 * @returns An iterator which traverses the iterable step-wise.
	 */
	function stride(object, step) {
	    return new StrideIterator(iter(object), step);
	}
	exports.stride = stride;
	/**
	 * An iterator which traverses a source iterator step-wise.
	 */
	var StrideIterator = (function () {
	    /**
	     * Construct a new stride iterator.
	     *
	     * @param source - The iterator of values of interest.
	     *
	     * @param step - The distance to step on each iteration. A value
	     *   of less than `1` will behave the same as a value of `1`.
	     */
	    function StrideIterator(source, step) {
	        this._source = source;
	        this._step = step;
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    StrideIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the stride iterator.
	     *
	     * @returns A new iterator starting with the current value.
	     *
	     * #### Notes
	     * The source iterator must be cloneable.
	     */
	    StrideIterator.prototype.clone = function () {
	        return new StrideIterator(this._source.clone(), this._step);
	    };
	    /**
	     * Get the next stepped value from the iterator.
	     *
	     * @returns The next stepped value from the iterator, or `undefined`
	     *   when the source iterator is exhausted.
	     */
	    StrideIterator.prototype.next = function () {
	        var value = this._source.next();
	        if (value === void 0) {
	            return void 0;
	        }
	        var step = this._step;
	        while (--step > 0) {
	            this._source.next();
	        }
	        return value;
	    };
	    return StrideIterator;
	}());
	exports.StrideIterator = StrideIterator;
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/algorithm/iteration.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/core/messaging.js **/
jupyter.define('phosphor@0.7.1/lib/core/messaging.js', function (module, exports, __jupyter_require__) {
	/* WEBPACK VAR INJECTION */(function(setImmediate) {"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var iteration_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/iteration.js');
	var queue_1 = __jupyter_require__('phosphor@0.7.1/lib/collections/queue.js');
	/**
	 * A message which can be delivered to a message handler.
	 *
	 * #### Notes
	 * This class may be subclassed to create complex message types.
	 *
	 * **See also:** [[postMessage]] and [[sendMessage]].
	 */
	var Message = (function () {
	    /**
	     * Construct a new message.
	     *
	     * @param type - The type of the message.
	     */
	    function Message(type) {
	        this._type = type;
	    }
	    Object.defineProperty(Message.prototype, "type", {
	        /**
	         * The type of the message.
	         *
	         * #### Notes
	         * This value can be used to cast the message to a derived type.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._type;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Message.prototype, "isConflatable", {
	        /**
	         * Test whether the message is conflatable.
	         *
	         * #### Notes
	         * Message conflation is an advanced topic. Most message types will
	         * not make use of this feature.
	         *
	         * If a conflatable message is posted to the event queue when another
	         * conflatable message of the same type and handler has already been
	         * posted, the `conflate()` method of the existing message will be
	         * invoked. If that method returns `true`, the new message will not
	         * be enqueued. This allows messages to be compressed, so that only
	         * a single instance of the message type is processed per cycle, no
	         * matter how many times messages of that type are posted.
	         *
	         * Custom message types may reimplement this property. The default
	         * implementation is always `false`.
	         *
	         * This is a read-only property.
	         *
	         * **See also:** [[conflateMessage]]
	         */
	        get: function () {
	            return false;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Conflate this message with another message of the same `type`.
	     *
	     * @param other - A conflatable message of the same `type`.
	     *
	     * @returns `true` if the message was successfully conflated, or
	     *   `false` otherwise.
	     *
	     * #### Notes
	     * Message conflation is an advanced topic. Most message types will
	     * not make use of this feature.
	     *
	     * This method is called automatically by the message loop when the
	     * given message is posted to the handler paired with this message.
	     * This message will already be enqueued and conflatable, and the
	     * given message will have the same `type` and also be conflatable.
	     *
	     * This method should merge the state of the other message into this
	     * message as needed so that when this message is finally delivered
	     * to the handler, it receives the most up-to-date information.
	     *
	     * If this method returns `true`, it signals that the other message
	     * was successfully conflated and it will not be enqueued.
	     *
	     * If this method returns `false`, the other message will be enqueued
	     * for normal delivery.
	     *
	     * Custom message types may reimplement this method. The default
	     * implementation always returns `false`.
	     *
	     * **See also:** [[isConflatable]]
	     */
	    Message.prototype.conflate = function (other) {
	        return false;
	    };
	    return Message;
	}());
	exports.Message = Message;
	/**
	 * A convenience message class which conflates automatically.
	 *
	 * #### Notes
	 * Message conflation is an advanced topic. Most user code will not
	 * make use of this class.
	 *
	 * This message class is useful for creating message instances which
	 * should be conflated, but which have no state other than `type`.
	 *
	 * If conflation of stateful messages is required, a custom `Message`
	 * subclass should be created.
	 */
	var ConflatableMessage = (function (_super) {
	    __extends(ConflatableMessage, _super);
	    function ConflatableMessage() {
	        return _super !== null && _super.apply(this, arguments) || this;
	    }
	    Object.defineProperty(ConflatableMessage.prototype, "isConflatable", {
	        /**
	         * Test whether the message is conflatable.
	         *
	         * #### Notes
	         * This property is always `true`.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return true;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Conflate this message with another message of the same `type`.
	     *
	     * #### Notes
	     * This method always returns `true`.
	     */
	    ConflatableMessage.prototype.conflate = function (other) {
	        return true;
	    };
	    return ConflatableMessage;
	}(Message));
	exports.ConflatableMessage = ConflatableMessage;
	/**
	 * Send a message to a message handler to process immediately.
	 *
	 * @param handler - The handler which should process the message.
	 *
	 * @param msg - The message to deliver to the handler.
	 *
	 * #### Notes
	 * The message will first be sent through any installed message hooks
	 * for the handler. If the message passes all hooks, it will then be
	 * delivered to the `processMessage` method of the handler.
	 *
	 * The message will not be conflated with pending posted messages.
	 *
	 * Exceptions in hooks and handlers will be caught and logged.
	 */
	function sendMessage(handler, msg) {
	    MessageLoop.sendMessage(handler, msg);
	}
	exports.sendMessage = sendMessage;
	/**
	 * Post a message to the message handler to process in the future.
	 *
	 * @param handler - The handler which should process the message.
	 *
	 * @param msg - The message to post to the handler.
	 *
	 * #### Notes
	 * The message will be conflated with the pending posted messages for
	 * the handler, if possible. If the message is not conflated, it will
	 * be queued for normal delivery on the next cycle of the event loop.
	 *
	 * Exceptions in hooks and handlers will be caught and logged.
	 */
	function postMessage(handler, msg) {
	    MessageLoop.postMessage(handler, msg);
	}
	exports.postMessage = postMessage;
	/**
	 * Install a message hook for a message handler.
	 *
	 * @param handler - The message handler of interest.
	 *
	 * @param hook - The message hook to install.
	 *
	 * #### Notes
	 * A message hook is invoked before a message is delivered to the
	 * handler. If the hook returns `false`, no other hooks will be
	 * invoked and the message will not be delivered to the handler.
	 *
	 * The most recently installed message hook is executed first.
	 *
	 * If the hook is already installed, it will be moved to the front.
	 *
	 * **See also:** [[removeMessageHook]]
	 */
	function installMessageHook(handler, hook) {
	    MessageLoop.installMessageHook(handler, hook);
	}
	exports.installMessageHook = installMessageHook;
	/**
	 * Remove an installed message hook for a message handler.
	 *
	 * @param handler - The message handler of interest.
	 *
	 * @param hook - The message hook to remove.
	 *
	 * #### Notes
	 * If the hook is not installed, this is a no-op.
	 *
	 * It is safe to call this function while the hook is executing.
	 */
	function removeMessageHook(handler, hook) {
	    MessageLoop.removeMessageHook(handler, hook);
	}
	exports.removeMessageHook = removeMessageHook;
	/**
	 * Clear all message data associated with a message handler.
	 *
	 * @param handler - The message handler of interest.
	 *
	 * #### Notes
	 * This will clear all pending messages and hooks for the handler.
	 */
	function clearMessageData(handler) {
	    MessageLoop.clearMessageData(handler);
	}
	exports.clearMessageData = clearMessageData;
	/**
	 * The namespace for the global singleton message loop.
	 */
	var MessageLoop;
	(function (MessageLoop) {
	    /**
	     * Send a message to a handler for immediate processing.
	     *
	     * This will first call all message hooks for the handler. If any
	     * hook rejects the message, the message will not be delivered.
	     */
	    function sendMessage(handler, msg) {
	        // Handle the common case of no message hooks.
	        var node = hooks.get(handler);
	        if (node === void 0) {
	            invokeHandler(handler, msg);
	            return;
	        }
	        // Run the message hooks and bail early if any hook returns false.
	        // A null hook indicates the hook was removed during dispatch.
	        for (; node !== null; node = node.next) {
	            if (node.hook !== null && !invokeHook(node.hook, handler, msg)) {
	                return;
	            }
	        }
	        // All message hooks returned true, so invoke the handler.
	        invokeHandler(handler, msg);
	    }
	    MessageLoop.sendMessage = sendMessage;
	    /**
	     * Post a message to a handler for processing in the future.
	     *
	     * This will first conflate the message, if possible. If it cannot
	     * be conflated, it will be queued for delivery on the next cycle
	     * of the event loop.
	     */
	    function postMessage(handler, msg) {
	        // Handle the common case a non-conflatable message first.
	        if (!msg.isConflatable) {
	            enqueueMessage(handler, msg);
	            return;
	        }
	        // Conflate message if possible.
	        var conflated = iteration_1.some(queue, function (posted) {
	            if (posted.handler !== handler) {
	                return false;
	            }
	            if (posted.msg.type !== msg.type) {
	                return false;
	            }
	            if (!posted.msg.isConflatable) {
	                return false;
	            }
	            return posted.msg.conflate(msg);
	        });
	        // If the message was not conflated, enqueue the message.
	        if (!conflated)
	            enqueueMessage(handler, msg);
	    }
	    MessageLoop.postMessage = postMessage;
	    /**
	     * Install a message hook for a handler.
	     *
	     * This will first remove the hook if it exists, then install the
	     * hook in front of other hooks for the handler.
	     */
	    function installMessageHook(handler, hook) {
	        // Remove the message hook if it's already installed.
	        removeMessageHook(handler, hook);
	        // Install the hook at the front of the list.
	        var next = hooks.get(handler) || null;
	        hooks.set(handler, { next: next, hook: hook });
	    }
	    MessageLoop.installMessageHook = installMessageHook;
	    /**
	     * Remove a message hook for a handler, if it exists.
	     */
	    function removeMessageHook(handler, hook) {
	        // Traverse the list and find the matching hook. If found, clear
	        // the reference to the hook and remove the node from the list.
	        // The node's next reference is *not* cleared so that dispatch
	        // may continue when the hook is removed during dispatch.
	        var prev = null;
	        var node = hooks.get(handler) || null;
	        for (; node !== null; prev = node, node = node.next) {
	            if (node.hook === hook) {
	                if (prev === null && node.next === null) {
	                    hooks.delete(handler);
	                }
	                else if (prev === null) {
	                    hooks.set(handler, node.next);
	                }
	                else {
	                    prev.next = node.next;
	                }
	                node.hook = null;
	                return;
	            }
	        }
	    }
	    MessageLoop.removeMessageHook = removeMessageHook;
	    /**
	     * Clear all message data for a handler.
	     *
	     * This will remove all message hooks and clear pending messages.
	     */
	    function clearMessageData(handler) {
	        // Clear all message hooks.
	        var node = hooks.get(handler) || null;
	        for (; node !== null; node = node.next) {
	            node.hook = null;
	        }
	        // Remove the handler from the hooks map.
	        hooks.delete(handler);
	        // Clear all pending messages.
	        iteration_1.each(queue, function (posted) {
	            if (posted.handler === handler) {
	                posted.handler = null;
	            }
	        });
	    }
	    MessageLoop.clearMessageData = clearMessageData;
	    /**
	     * The queue of posted message pairs.
	     */
	    var queue = new queue_1.Queue();
	    /**
	     * A mapping of handler to list of installed message hooks.
	     */
	    var hooks = new WeakMap();
	    /**
	     * A local reference to an event loop callback.
	     */
	    var defer = (function () {
	        var ok = typeof requestAnimationFrame === 'function';
	        return ok ? requestAnimationFrame : setImmediate;
	    })();
	    /**
	     * Whether a message loop cycle is pending.
	     */
	    var cyclePending = false;
	    /**
	     * Invoke a message hook with the specified handler and message.
	     *
	     * Returns the result of the hook, or `true` if the hook throws.
	     *
	     * Exceptions in the hook will be caught and logged.
	     */
	    function invokeHook(hook, handler, msg) {
	        var result;
	        try {
	            if (typeof hook === 'function') {
	                result = hook(handler, msg);
	            }
	            else {
	                result = hook.messageHook(handler, msg);
	            }
	        }
	        catch (err) {
	            result = true;
	            console.error(err);
	        }
	        return result;
	    }
	    /**
	     * Invoke a message handler with the specified message.
	     *
	     * Exceptions in the handler will be caught and logged.
	     */
	    function invokeHandler(handler, msg) {
	        try {
	            handler.processMessage(msg);
	        }
	        catch (err) {
	            console.error(err);
	        }
	    }
	    /**
	     * Add a message to the end of the message queue.
	     *
	     * This will automatically schedule a cycle of the loop.
	     */
	    function enqueueMessage(handler, msg) {
	        queue.pushBack({ handler: handler, msg: msg });
	        scheduleMessageLoop();
	    }
	    /**
	     * Schedule a message loop cycle to process any pending messages.
	     *
	     * This is a no-op if a loop cycle is already pending.
	     */
	    function scheduleMessageLoop() {
	        if (!cyclePending) {
	            defer(runMessageLoop);
	            cyclePending = true;
	        }
	    }
	    /**
	     * Run an iteration of the message loop.
	     *
	     * This will process all pending messages in the queue. If a message
	     * is added to the queue while the message loop is running, it will
	     * be processed on the next cycle of the loop.
	     */
	    function runMessageLoop() {
	        // Clear the pending flag so the next loop can be scheduled.
	        cyclePending = false;
	        // If the queue is empty, there is nothing else to do.
	        if (queue.isEmpty) {
	            return;
	        }
	        // Add a sentinel value to the end of the queue. The queue will
	        // only be processed up to the sentinel. Messages posted during
	        // this cycle will execute on the next cycle.
	        var sentinel = { handler: null, msg: null };
	        queue.pushBack(sentinel);
	        // Enter the message loop.
	        while (!queue.isEmpty) {
	            // Remove the first posted message in the queue.
	            var posted = queue.popFront();
	            // If the value is the sentinel, exit the loop.
	            if (posted === sentinel) {
	                return;
	            }
	            // Dispatch the message if the handler has not been cleared.
	            if (posted.handler !== null) {
	                sendMessage(posted.handler, posted.msg);
	            }
	        }
	    }
	})(MessageLoop || (MessageLoop = {}));
	
	/* WEBPACK VAR INJECTION */}.call(exports, __jupyter_require__('timers-browserify@2.0.2/main.js').setImmediate))
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/core/messaging.js **/


/** START DEFINE BLOCK for timers-browserify@2.0.2/main.js **/
jupyter.define('timers-browserify@2.0.2/main.js', function (module, exports, __jupyter_require__) {
	var apply = Function.prototype.apply;
	
	// DOM APIs, for completeness
	
	exports.setTimeout = function() {
	  return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
	};
	exports.setInterval = function() {
	  return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
	};
	exports.clearTimeout =
	exports.clearInterval = function(timeout) {
	  if (timeout) {
	    timeout.close();
	  }
	};
	
	function Timeout(id, clearFn) {
	  this._id = id;
	  this._clearFn = clearFn;
	}
	Timeout.prototype.unref = Timeout.prototype.ref = function() {};
	Timeout.prototype.close = function() {
	  this._clearFn.call(window, this._id);
	};
	
	// Does not start the time, just sets up the members needed.
	exports.enroll = function(item, msecs) {
	  clearTimeout(item._idleTimeoutId);
	  item._idleTimeout = msecs;
	};
	
	exports.unenroll = function(item) {
	  clearTimeout(item._idleTimeoutId);
	  item._idleTimeout = -1;
	};
	
	exports._unrefActive = exports.active = function(item) {
	  clearTimeout(item._idleTimeoutId);
	
	  var msecs = item._idleTimeout;
	  if (msecs >= 0) {
	    item._idleTimeoutId = setTimeout(function onTimeout() {
	      if (item._onTimeout)
	        item._onTimeout();
	    }, msecs);
	  }
	};
	
	// setimmediate attaches itself to the global object
	__jupyter_require__('setimmediate@^1.0.4/setImmediate.js');
	exports.setImmediate = setImmediate;
	exports.clearImmediate = clearImmediate;
	
})
/** END DEFINE BLOCK for timers-browserify@2.0.2/main.js **/


/** START DEFINE BLOCK for setimmediate@1.0.5/setImmediate.js **/
jupyter.define('setimmediate@1.0.5/setImmediate.js', function (module, exports, __jupyter_require__) {
	/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
	    "use strict";
	
	    if (global.setImmediate) {
	        return;
	    }
	
	    var nextHandle = 1; // Spec says greater than zero
	    var tasksByHandle = {};
	    var currentlyRunningATask = false;
	    var doc = global.document;
	    var registerImmediate;
	
	    function setImmediate(callback) {
	      // Callback can either be a function or a string
	      if (typeof callback !== "function") {
	        callback = new Function("" + callback);
	      }
	      // Copy function arguments
	      var args = new Array(arguments.length - 1);
	      for (var i = 0; i < args.length; i++) {
	          args[i] = arguments[i + 1];
	      }
	      // Store and register the task
	      var task = { callback: callback, args: args };
	      tasksByHandle[nextHandle] = task;
	      registerImmediate(nextHandle);
	      return nextHandle++;
	    }
	
	    function clearImmediate(handle) {
	        delete tasksByHandle[handle];
	    }
	
	    function run(task) {
	        var callback = task.callback;
	        var args = task.args;
	        switch (args.length) {
	        case 0:
	            callback();
	            break;
	        case 1:
	            callback(args[0]);
	            break;
	        case 2:
	            callback(args[0], args[1]);
	            break;
	        case 3:
	            callback(args[0], args[1], args[2]);
	            break;
	        default:
	            callback.apply(undefined, args);
	            break;
	        }
	    }
	
	    function runIfPresent(handle) {
	        // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
	        // So if we're currently running a task, we'll need to delay this invocation.
	        if (currentlyRunningATask) {
	            // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
	            // "too much recursion" error.
	            setTimeout(runIfPresent, 0, handle);
	        } else {
	            var task = tasksByHandle[handle];
	            if (task) {
	                currentlyRunningATask = true;
	                try {
	                    run(task);
	                } finally {
	                    clearImmediate(handle);
	                    currentlyRunningATask = false;
	                }
	            }
	        }
	    }
	
	    function installNextTickImplementation() {
	        registerImmediate = function(handle) {
	            process.nextTick(function () { runIfPresent(handle); });
	        };
	    }
	
	    function canUsePostMessage() {
	        // The test against `importScripts` prevents this implementation from being installed inside a web worker,
	        // where `global.postMessage` means something completely different and can't be used for this purpose.
	        if (global.postMessage && !global.importScripts) {
	            var postMessageIsAsynchronous = true;
	            var oldOnMessage = global.onmessage;
	            global.onmessage = function() {
	                postMessageIsAsynchronous = false;
	            };
	            global.postMessage("", "*");
	            global.onmessage = oldOnMessage;
	            return postMessageIsAsynchronous;
	        }
	    }
	
	    function installPostMessageImplementation() {
	        // Installs an event handler on `global` for the `message` event: see
	        // * https://developer.mozilla.org/en/DOM/window.postMessage
	        // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
	
	        var messagePrefix = "setImmediate$" + Math.random() + "$";
	        var onGlobalMessage = function(event) {
	            if (event.source === global &&
	                typeof event.data === "string" &&
	                event.data.indexOf(messagePrefix) === 0) {
	                runIfPresent(+event.data.slice(messagePrefix.length));
	            }
	        };
	
	        if (global.addEventListener) {
	            global.addEventListener("message", onGlobalMessage, false);
	        } else {
	            global.attachEvent("onmessage", onGlobalMessage);
	        }
	
	        registerImmediate = function(handle) {
	            global.postMessage(messagePrefix + handle, "*");
	        };
	    }
	
	    function installMessageChannelImplementation() {
	        var channel = new MessageChannel();
	        channel.port1.onmessage = function(event) {
	            var handle = event.data;
	            runIfPresent(handle);
	        };
	
	        registerImmediate = function(handle) {
	            channel.port2.postMessage(handle);
	        };
	    }
	
	    function installReadyStateChangeImplementation() {
	        var html = doc.documentElement;
	        registerImmediate = function(handle) {
	            // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
	            // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
	            var script = doc.createElement("script");
	            script.onreadystatechange = function () {
	                runIfPresent(handle);
	                script.onreadystatechange = null;
	                html.removeChild(script);
	                script = null;
	            };
	            html.appendChild(script);
	        };
	    }
	
	    function installSetTimeoutImplementation() {
	        registerImmediate = function(handle) {
	            setTimeout(runIfPresent, 0, handle);
	        };
	    }
	
	    // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
	    var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
	    attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
	
	    // Don't get fooled by e.g. browserify environments.
	    if ({}.toString.call(global.process) === "[object process]") {
	        // For Node.js before 0.9
	        installNextTickImplementation();
	
	    } else if (canUsePostMessage()) {
	        // For non-IE10 modern browsers
	        installPostMessageImplementation();
	
	    } else if (global.MessageChannel) {
	        // For web workers, where supported
	        installMessageChannelImplementation();
	
	    } else if (doc && "onreadystatechange" in doc.createElement("script")) {
	        // For IE 6–8
	        installReadyStateChangeImplementation();
	
	    } else {
	        // For older browsers
	        installSetTimeoutImplementation();
	    }
	
	    attachTo.setImmediate = setImmediate;
	    attachTo.clearImmediate = clearImmediate;
	}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
	
	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __jupyter_require__('process@0.11.9/browser.js')))
})
/** END DEFINE BLOCK for setimmediate@1.0.5/setImmediate.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/collections/queue.js **/
jupyter.define('phosphor@0.7.1/lib/collections/queue.js', function (module, exports, __jupyter_require__) {
	"use strict";
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var iteration_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/iteration.js');
	/**
	 * A generic FIFO queue data structure.
	 */
	var Queue = (function () {
	    /**
	     * Construct a new queue.
	     *
	     * @param values - The initial values for the queue.
	     */
	    function Queue(values) {
	        var _this = this;
	        this._length = 0;
	        this._front = null;
	        this._back = null;
	        if (values)
	            iteration_1.each(values, function (value) { _this.pushBack(value); });
	    }
	    Object.defineProperty(Queue.prototype, "isEmpty", {
	        /**
	         * Test whether the queue is empty.
	         *
	         * @returns `true` if the queue is empty, `false` otherwise.
	         *
	         * #### Notes
	         * This is a read-only property.
	         *
	         * #### Complexity
	         * Constant.
	         *
	         * #### Iterator Validity
	         * No changes.
	         */
	        get: function () {
	            return this._length === 0;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Queue.prototype, "length", {
	        /**
	         * Get the length of the queue.
	         *
	         * @return The number of values in the queue.
	         *
	         * #### Notes
	         * This is a read-only property.
	         *
	         * #### Complexity
	         * Constant.
	         *
	         * #### Iterator Validity
	         * No changes.
	         */
	        get: function () {
	            return this._length;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Queue.prototype, "front", {
	        /**
	         * Get the value at the front of the queue.
	         *
	         * @returns The value at the front of the queue, or `undefined` if
	         *   the queue is empty.
	         *
	         * #### Notes
	         * This is a read-only property.
	         *
	         * #### Complexity
	         * Constant.
	         *
	         * #### Iterator Validity
	         * No changes.
	         */
	        get: function () {
	            return this._front ? this._front.value : void 0;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Queue.prototype, "back", {
	        /**
	         * Get the value at the back of the queue.
	         *
	         * @returns The value at the back of the queue, or `undefined` if
	         *   the queue is empty.
	         *
	         * #### Notes
	         * This is a read-only property.
	         *
	         * #### Complexity
	         * Constant.
	         *
	         * #### Iterator Validity
	         * No changes.
	         */
	        get: function () {
	            return this._back ? this._back.value : void 0;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Create an iterator over the values in the queue.
	     *
	     * @returns A new iterator starting at the front of the queue.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * No changes.
	     */
	    Queue.prototype.iter = function () {
	        return new QueueIterator(this._front);
	    };
	    /**
	     * Add a value to the back of the queue.
	     *
	     * @param value - The value to add to the back of the queue.
	     *
	     * @returns The new length of the queue.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * No changes.
	     */
	    Queue.prototype.pushBack = function (value) {
	        var node = new QueueNode(value);
	        if (this._length === 0) {
	            this._front = node;
	            this._back = node;
	        }
	        else {
	            this._back.next = node;
	            this._back = node;
	        }
	        return ++this._length;
	    };
	    /**
	     * Remove and return the value at the front of the queue.
	     *
	     * @returns The value at the front of the queue, or `undefined` if
	     *   the queue is empty.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * Iterators pointing at the removed value are invalidated.
	     */
	    Queue.prototype.popFront = function () {
	        if (this._length === 0) {
	            return void 0;
	        }
	        var node = this._front;
	        if (this._length === 1) {
	            this._front = null;
	            this._back = null;
	        }
	        else {
	            this._front = node.next;
	            node.next = null;
	        }
	        this._length--;
	        return node.value;
	    };
	    /**
	     * Remove all values from the queue.
	     *
	     * #### Complexity
	     * Linear.
	     *
	     * #### Iterator Validity
	     * All current iterators are invalidated.
	     */
	    Queue.prototype.clear = function () {
	        var node = this._front;
	        while (node) {
	            var next = node.next;
	            node.next = null;
	            node = next;
	        }
	        this._length = 0;
	        this._front = null;
	        this._back = null;
	    };
	    /**
	     * Swap the contents of the queue with the contents of another.
	     *
	     * @param other - The other queue holding the contents to swap.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * All current iterators remain valid, but will now point to the
	     * contents of the other queue involved in the swap.
	     */
	    Queue.prototype.swap = function (other) {
	        var length = other._length;
	        var front = other._front;
	        var back = other._back;
	        other._length = this._length;
	        other._front = this._front;
	        other._back = this._back;
	        this._length = length;
	        this._front = front;
	        this._back = back;
	    };
	    return Queue;
	}());
	exports.Queue = Queue;
	/**
	 * An iterator for a queue.
	 */
	var QueueIterator = (function () {
	    /**
	     * Construct a new queue iterator.
	     *
	     * @param node - The node at the front of range.
	     */
	    function QueueIterator(node) {
	        this._node = node;
	    }
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A reference to `this` iterator.
	     */
	    QueueIterator.prototype.iter = function () {
	        return this;
	    };
	    /**
	     * Create an independent clone of the queue iterator.
	     *
	     * @returns A new iterator starting with the current value.
	     */
	    QueueIterator.prototype.clone = function () {
	        return new QueueIterator(this._node);
	    };
	    /**
	     * Get the next value from the queue.
	     *
	     * @returns The next value from the queue, or `undefined` if the
	     *   iterator is exhausted.
	     */
	    QueueIterator.prototype.next = function () {
	        if (!this._node) {
	            return void 0;
	        }
	        var value = this._node.value;
	        this._node = this._node.next;
	        return value;
	    };
	    return QueueIterator;
	}());
	/**
	 * The node type for a queue.
	 */
	var QueueNode = (function () {
	    /**
	     * Construct a new queue node.
	     *
	     * @param value - The value for the node.
	     */
	    function QueueNode(value) {
	        /**
	         * The next node the queue.
	         */
	        this.next = null;
	        this.value = value;
	    }
	    return QueueNode;
	}());
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/collections/queue.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/core/properties.js **/
jupyter.define('phosphor@0.7.1/lib/core/properties.js', function (module, exports, __jupyter_require__) {
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	"use strict";
	/**
	 * A class which attaches a value to an external object.
	 *
	 * #### Notes
	 * Attached properties are used to extend the state of an object with
	 * semantic data from an unrelated class. They also encapsulate value
	 * creation, coercion, and notification.
	 *
	 * Because attached property values are stored in a hash table, which
	 * in turn is stored in a WeakMap keyed on the owner object, there is
	 * non-trivial storage overhead involved in their use. The pattern is
	 * therefore best used for the storage of rare data.
	 */
	var AttachedProperty = (function () {
	    /**
	     * Construct a new attached property.
	     *
	     * @param options - The options for initializing the property.
	     */
	    function AttachedProperty(options) {
	        this._pid = nextPID();
	        this._name = options.name;
	        this._value = options.value;
	        this._create = options.create;
	        this._coerce = options.coerce;
	        this._compare = options.compare;
	        this._changed = options.changed;
	    }
	    Object.defineProperty(AttachedProperty.prototype, "name", {
	        /**
	         * Get the human readable name for the property.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._name;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Get the current value of the property for a given owner.
	     *
	     * @param owner - The property owner of interest.
	     *
	     * @returns The current value of the property.
	     *
	     * #### Notes
	     * If the value has not yet been set, the default value will be
	     * computed and assigned as the current value of the property.
	     */
	    AttachedProperty.prototype.get = function (owner) {
	        var value;
	        var map = ensureMap(owner);
	        if (this._pid in map) {
	            value = map[this._pid];
	        }
	        else {
	            value = map[this._pid] = this._createValue(owner);
	        }
	        return value;
	    };
	    /**
	     * Set the current value of the property for a given owner.
	     *
	     * @param owner - The property owner of interest.
	     *
	     * @param value - The value for the property.
	     *
	     * #### Notes
	     * If the value has not yet been set, the default value will be
	     * computed and used as the previous value for the comparison.
	     */
	    AttachedProperty.prototype.set = function (owner, value) {
	        var oldValue;
	        var map = ensureMap(owner);
	        if (this._pid in map) {
	            oldValue = map[this._pid];
	        }
	        else {
	            oldValue = map[this._pid] = this._createValue(owner);
	        }
	        var newValue = this._coerceValue(owner, value);
	        this._maybeNotify(owner, oldValue, map[this._pid] = newValue);
	    };
	    /**
	     * Explicitly coerce the current property value for a given owner.
	     *
	     * @param owner - The property owner of interest.
	     *
	     * #### Notes
	     * If the value has not yet been set, the default value will be
	     * computed and used as the previous value for the comparison.
	     */
	    AttachedProperty.prototype.coerce = function (owner) {
	        var oldValue;
	        var map = ensureMap(owner);
	        if (this._pid in map) {
	            oldValue = map[this._pid];
	        }
	        else {
	            oldValue = map[this._pid] = this._createValue(owner);
	        }
	        var newValue = this._coerceValue(owner, oldValue);
	        this._maybeNotify(owner, oldValue, map[this._pid] = newValue);
	    };
	    /**
	     * Get or create the default value for the given owner.
	     */
	    AttachedProperty.prototype._createValue = function (owner) {
	        var create = this._create;
	        return create ? create(owner) : this._value;
	    };
	    /**
	     * Coerce the value for the given owner.
	     */
	    AttachedProperty.prototype._coerceValue = function (owner, value) {
	        var coerce = this._coerce;
	        return coerce ? coerce(owner, value) : value;
	    };
	    /**
	     * Compare the old value and new value for equality.
	     */
	    AttachedProperty.prototype._compareValue = function (oldValue, newValue) {
	        var compare = this._compare;
	        return compare ? compare(oldValue, newValue) : oldValue === newValue;
	    };
	    /**
	     * Run the change notification if the given values are different.
	     */
	    AttachedProperty.prototype._maybeNotify = function (owner, oldValue, newValue) {
	        if (!this._changed || this._compareValue(oldValue, newValue)) {
	            return;
	        }
	        this._changed.call(void 0, owner, oldValue, newValue);
	    };
	    return AttachedProperty;
	}());
	exports.AttachedProperty = AttachedProperty;
	/**
	 * Clear the stored property data for the given property owner.
	 *
	 * @param owner - The property owner of interest.
	 *
	 * #### Notes
	 * This will clear all property values for the owner, but it will
	 * **not** run the change notification for any of the properties.
	 */
	function clearPropertyData(owner) {
	    ownerData.delete(owner);
	}
	exports.clearPropertyData = clearPropertyData;
	/**
	 * A weak mapping of property owner to property map.
	 */
	var ownerData = new WeakMap();
	/**
	 * A function which computes successive unique property ids.
	 */
	var nextPID = (function () {
	    var id = 0;
	    return function () {
	        var rand = Math.random();
	        var stem = ("" + rand).slice(2);
	        return "pid-" + stem + "-" + id++;
	    };
	})();
	/**
	 * Lookup the data map for the property owner.
	 *
	 * This will create the map if one does not already exist.
	 */
	function ensureMap(owner) {
	    var map = ownerData.get(owner);
	    if (map !== void 0)
	        return map;
	    map = Object.create(null);
	    ownerData.set(owner, map);
	    return map;
	}
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/core/properties.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/core/signaling.js **/
jupyter.define('phosphor@0.7.1/lib/core/signaling.js', function (module, exports, __jupyter_require__) {
	/* WEBPACK VAR INJECTION */(function(setImmediate) {/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	"use strict";
	/**
	 * Define a signal property on a prototype object.
	 *
	 * @param target - The prototype for the class of interest.
	 *
	 * @param name - The name of the signal property.
	 *
	 * #### Notes
	 * The defined signal property is read-only.
	 *
	 * #### Example
	 * ```typescript
	 * class SomeClass {
	 *   valueChanged: ISignal<SomeClass, number>;
	 * }
	 *
	 * defineSignal(SomeClass.prototype, 'valueChanged');
	 */
	function defineSignal(target, name) {
	    var token = Object.freeze({});
	    Object.defineProperty(target, name, {
	        get: function () { return new Signal(this, token); }
	    });
	}
	exports.defineSignal = defineSignal;
	/**
	 * Remove all connections where the given object is the sender.
	 *
	 * @param sender - The sender object of interest.
	 *
	 * #### Example
	 * ```typescript
	 * disconnectSender(someObject);
	 * ```
	 */
	function disconnectSender(sender) {
	    // If there are no receivers, there is nothing to do.
	    var receiverList = senderData.get(sender);
	    if (receiverList === void 0) {
	        return;
	    }
	    // Clear the connections and schedule a cleanup of the
	    // receiver's corresponding list of sender connections.
	    for (var i = 0, n = receiverList.length; i < n; ++i) {
	        var conn = receiverList[i];
	        var senderList = receiverData.get(conn.thisArg || conn.slot);
	        scheduleCleanup(senderList);
	        conn.token = null;
	    }
	    // Schedule a cleanup of the receiver list.
	    scheduleCleanup(receiverList);
	}
	exports.disconnectSender = disconnectSender;
	/**
	 * Remove all connections where the given object is the receiver.
	 *
	 * @param receiver - The receiver object of interest.
	 *
	 * #### Notes
	 * If a `thisArg` is provided when connecting a signal, that object
	 * is considered the receiver. Otherwise, the `callback` is used as
	 * the receiver.
	 *
	 * #### Example
	 * ```typescript
	 * // disconnect a regular object receiver
	 * disconnectReceiver(myObject);
	 *
	 * // disconnect a plain callback receiver
	 * disconnectReceiver(myCallback);
	 * ```
	 */
	function disconnectReceiver(receiver) {
	    // If there are no senders, there is nothing to do.
	    var senderList = receiverData.get(receiver);
	    if (senderList === void 0) {
	        return;
	    }
	    // Clear the connections and schedule a cleanup of the
	    // senders's corresponding list of receiver connections.
	    for (var i = 0, n = senderList.length; i < n; ++i) {
	        var conn = senderList[i];
	        var receiverList = senderData.get(conn.sender);
	        scheduleCleanup(receiverList);
	        conn.token = null;
	    }
	    // Schedule a cleanup of the sender list.
	    scheduleCleanup(senderList);
	}
	exports.disconnectReceiver = disconnectReceiver;
	/**
	 * Clear all signal data associated with the given object.
	 *
	 * @param obj - The object for which the signal data should be cleared.
	 *
	 * #### Notes
	 * This removes all signal connections where the object is used as
	 * either the sender or the receiver.
	 *
	 * #### Example
	 * ```typescript
	 * clearSignalData(someObject);
	 * ```
	 */
	function clearSignalData(obj) {
	    disconnectSender(obj);
	    disconnectReceiver(obj);
	}
	exports.clearSignalData = clearSignalData;
	/**
	 * A concrete implementation of `ISignal`.
	 */
	var Signal = (function () {
	    /**
	     * Construct a new signal.
	     *
	     * @param sender - The object which owns the signal.
	     *
	     * @param token - The unique token identifying the signal.
	     */
	    function Signal(sender, token) {
	        this._sender = sender;
	        this._token = token;
	    }
	    /**
	     * Connect a slot to the signal.
	     *
	     * @param slot - The slot to invoke when the signal is emitted.
	     *
	     * @param thisArg - The `this` context for the slot. If provided,
	     *   this must be a non-primitive object.
	     *
	     * @returns `true` if the connection succeeds, `false` otherwise.
	     */
	    Signal.prototype.connect = function (slot, thisArg) {
	        return connect(this._sender, this._token, slot, thisArg);
	    };
	    /**
	     * Disconnect a slot from the signal.
	     *
	     * @param slot - The slot to disconnect from the signal.
	     *
	     * @param thisArg - The `this` context for the slot. If provided,
	     *   this must be a non-primitive object.
	     *
	     * @returns `true` if the connection is removed, `false` otherwise.
	     */
	    Signal.prototype.disconnect = function (slot, thisArg) {
	        return disconnect(this._sender, this._token, slot, thisArg);
	    };
	    /**
	     * Emit the signal and invoke the connected slots.
	     *
	     * @param args - The args to pass to the connected slots.
	     */
	    Signal.prototype.emit = function (args) {
	        emit(this._sender, this._token, args);
	    };
	    return Signal;
	}());
	/**
	 * A weak mapping of sender to list of receiver connections.
	 */
	var senderData = new WeakMap();
	/**
	 * A weak mapping of receiver to list of sender connections.
	 */
	var receiverData = new WeakMap();
	/**
	 * A set of connection lists which are pending cleanup.
	 */
	var dirtySet = new Set();
	/**
	 * A local reference to an event loop callback.
	 */
	var defer = (function () {
	    var ok = typeof requestAnimationFrame === 'function';
	    return ok ? requestAnimationFrame : setImmediate;
	})();
	/**
	 * Connect a slot to a signal.
	 *
	 * @param sender - The object emitting the signal.
	 *
	 * @param token - The unique token for the signal.
	 *
	 * @param slot - The slot to connect to the signal.
	 *
	 * @param thisArg - The `this` context for the slot.
	 *
	 * @returns `true` if the connection succeeds, `false` otherwise.
	 *
	 * #### Notes
	 * Signal connections are unique. If a connection already exists for
	 * the given `slot` and `thisArg`, this function returns `false`.
	 *
	 * A newly connected slot will not be invoked until the next time the
	 * signal is emitted, even if the slot is connected while the signal
	 * is dispatching.
	 */
	function connect(sender, token, slot, thisArg) {
	    // Coerce a `null` thisArg to `undefined`.
	    thisArg = thisArg || void 0;
	    // Ensure the sender's receiver list is created.
	    var receiverList = senderData.get(sender);
	    if (receiverList === void 0) {
	        receiverList = [];
	        senderData.set(sender, receiverList);
	    }
	    // Bail if a matching connection already exists.
	    if (findConnection(receiverList, token, slot, thisArg) !== null) {
	        return false;
	    }
	    // Ensure the receiver's sender list is created.
	    var receiver = thisArg || slot;
	    var senderList = receiverData.get(receiver);
	    if (senderList === void 0) {
	        senderList = [];
	        receiverData.set(receiver, senderList);
	    }
	    // Create a new connection and add it to the end of each list.
	    var connection = { sender: sender, token: token, slot: slot, thisArg: thisArg };
	    receiverList.push(connection);
	    senderList.push(connection);
	    // Indicate a successful connection.
	    return true;
	}
	/**
	 * Disconnect a slot from a signal.
	 *
	 * @param sender - The object emitting the signal.
	 *
	 * @param token - The unique token for the signal.
	 *
	 * @param slot - The slot to disconnect from the signal.
	 *
	 * @param thisArg - The `this` context for the slot.
	 *
	 * @returns `true` if the connection is removed, `false` otherwise.
	 *
	 * #### Notes
	 * If no connection exists for the given `slot` and `thisArg`, this
	 * function returns `false`.
	 *
	 * A disconnected slot will no longer be invoked, even if the slot
	 * is disconnected while the signal is dispatching.
	 */
	function disconnect(sender, token, slot, thisArg) {
	    // Coerce a `null` thisArg to `undefined`.
	    thisArg = thisArg || void 0;
	    // Lookup the list of receivers, and bail if none exist.
	    var receiverList = senderData.get(sender);
	    if (receiverList === void 0) {
	        return false;
	    }
	    // Bail if no matching connection exits.
	    var conn = findConnection(receiverList, token, slot, thisArg);
	    if (conn === null) {
	        return false;
	    }
	    // Lookup the list of senders, which is now known to exist.
	    var senderList = receiverData.get(thisArg || slot);
	    // Clear the connection and schedule list cleanup.
	    conn.token = null;
	    scheduleCleanup(receiverList);
	    scheduleCleanup(senderList);
	    // Indicate a successful disconnection.
	    return true;
	}
	/**
	 * Emit a signal and invoke the connected slots.
	 *
	 * @param sender - The object emitting the signal.
	 *
	 * @param token - The unique token for the signal.
	 *
	 * @param args - The args to pass to the connected slots.
	 *
	 * #### Notes
	 * Connected slots are invoked synchronously, in the order in which
	 * they are connected.
	 *
	 * Exceptions thrown by connected slots will be caught and logged.
	 */
	function emit(sender, token, args) {
	    // If there are no receivers, there is nothing to do.
	    var receiverList = senderData.get(sender);
	    if (receiverList === void 0) {
	        return;
	    }
	    // Invoke the connections which match the given token.
	    for (var i = 0, n = receiverList.length; i < n; ++i) {
	        var conn = receiverList[i];
	        if (conn.token === token) {
	            invokeSlot(conn, args);
	        }
	    }
	}
	/**
	 * Safely invoke a non-empty connection.
	 *
	 * @param conn - The connection of interest
	 *
	 * @param args - The arguments to pass to the slot.
	 *
	 * #### Notes
	 * Any exception thrown by the slot will be caught and logged.
	 */
	function invokeSlot(conn, args) {
	    try {
	        conn.slot.call(conn.thisArg, conn.sender, args);
	    }
	    catch (err) {
	        console.error(err);
	    }
	}
	/**
	 * Find a connection which matches the given parameters.
	 *
	 * @param list - The list of connections to search.
	 *
	 * @param token - The unique token for the signal.
	 *
	 * @param slot - The slot of interest.
	 *
	 * @param thisArg - The `this` context for the slot.
	 *
	 * @returns The first connection which matches the supplied parameters,
	 *   or null if no matching connection is found.
	 */
	function findConnection(list, token, slot, thisArg) {
	    for (var i = 0, n = list.length; i < n; ++i) {
	        var conn = list[i];
	        if (conn.token === token &&
	            conn.slot === slot &&
	            conn.thisArg === thisArg) {
	            return conn;
	        }
	    }
	    return null;
	}
	/**
	 * Schedule a cleanup of a connection list.
	 *
	 * @param list - The list of connections to cleanup.
	 *
	 * #### Notes
	 * This will add the list to the dirty set and schedule a deferred
	 * cleanup of the list contents. On cleanup, any connection with a
	 * null token will be removed from the array.
	 */
	function scheduleCleanup(list) {
	    if (dirtySet.size === 0) {
	        defer(cleanupDirtySet);
	    }
	    dirtySet.add(list);
	}
	/**
	 * Cleanup the connection lists in the dirty set.
	 *
	 * #### Notes
	 * This function should only be invoked asynchronously, when the stack
	 * frame is guaranteed to not be on the path of a signal dispatch.
	 */
	function cleanupDirtySet() {
	    dirtySet.forEach(cleanupList);
	    dirtySet.clear();
	}
	/**
	 * Cleanup the dirty connections in a connection list.
	 *
	 * @param list - The list of connection to cleanup.
	 *
	 * #### Notes
	 * This will remove any connection with a null token from the list,
	 * while retaining the relative order of the other connections.
	 *
	 * This function should only be invoked asynchronously, when the stack
	 * frame is guaranteed to not be on the path of a signal dispatch.
	 */
	function cleanupList(list) {
	    var count = 0;
	    for (var i = 0, n = list.length; i < n; ++i) {
	        var conn = list[i];
	        if (conn.token === null) {
	            count++;
	        }
	        else {
	            list[i - count] = conn;
	        }
	    }
	    list.length -= count;
	}
	
	/* WEBPACK VAR INJECTION */}.call(exports, __jupyter_require__('timers-browserify@2.0.2/main.js').setImmediate))
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/core/signaling.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/ui/title.js **/
jupyter.define('phosphor@0.7.1/lib/ui/title.js', function (module, exports, __jupyter_require__) {
	"use strict";
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var signaling_1 = __jupyter_require__('phosphor@0.7.1/lib/core/signaling.js');
	/**
	 * An object which holds data related to a widget's title.
	 *
	 * #### Notes
	 * A title object is intended to hold the data necessary to display a
	 * header for a particular widget. A common example is the `TabPanel`,
	 * which uses the widget title to populate the tab for a child widget.
	 */
	var Title = (function () {
	    /**
	     * Construct a new title.
	     *
	     * @param options - The options for initializing the title.
	     */
	    function Title(options) {
	        if (options === void 0) { options = {}; }
	        this._label = '';
	        this._icon = '';
	        this._caption = '';
	        this._mnemonic = -1;
	        this._className = '';
	        this._closable = false;
	        this._owner = null;
	        if (options.owner !== void 0) {
	            this._owner = options.owner;
	        }
	        if (options.label !== void 0) {
	            this._label = options.label;
	        }
	        if (options.mnemonic !== void 0) {
	            this._mnemonic = options.mnemonic;
	        }
	        if (options.icon !== void 0) {
	            this._icon = options.icon;
	        }
	        if (options.caption !== void 0) {
	            this._caption = options.caption;
	        }
	        if (options.closable !== void 0) {
	            this._closable = options.closable;
	        }
	        if (options.className !== void 0) {
	            this._className = options.className;
	        }
	    }
	    Object.defineProperty(Title.prototype, "owner", {
	        /**
	         * Get the object which owns the title.
	         *
	         * #### Notes
	         * This will be `null` if the title has no owner.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._owner;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Title.prototype, "label", {
	        /**
	         * Get the label for the title.
	         *
	         * #### Notes
	         * The default value is an empty string.
	         */
	        get: function () {
	            return this._label;
	        },
	        /**
	         * Set the label for the title.
	         */
	        set: function (value) {
	            if (this._label === value) {
	                return;
	            }
	            this._label = value;
	            this.changed.emit(void 0);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Title.prototype, "mnemonic", {
	        /**
	         * Get the mnemonic index for the title.
	         *
	         * #### Notes
	         * The default value is `-1`.
	         */
	        get: function () {
	            return this._mnemonic;
	        },
	        /**
	         * Set the mnemonic index for the title.
	         */
	        set: function (value) {
	            if (this._mnemonic === value) {
	                return;
	            }
	            this._mnemonic = value;
	            this.changed.emit(void 0);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Title.prototype, "icon", {
	        /**
	         * Get the icon class name for the title.
	         *
	         * #### Notes
	         * The default value is an empty string.
	         */
	        get: function () {
	            return this._icon;
	        },
	        /**
	         * Set the icon class name for the title.
	         *
	         * #### Notes
	         * Multiple class names can be separated with whitespace.
	         */
	        set: function (value) {
	            if (this._icon === value) {
	                return;
	            }
	            this._icon = value;
	            this.changed.emit(void 0);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Title.prototype, "caption", {
	        /**
	         * Get the caption for the title.
	         *
	         * #### Notes
	         * The default value is an empty string.
	         */
	        get: function () {
	            return this._caption;
	        },
	        /**
	         * Set the caption for the title.
	         */
	        set: function (value) {
	            if (this._caption === value) {
	                return;
	            }
	            this._caption = value;
	            this.changed.emit(void 0);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Title.prototype, "className", {
	        /**
	         * Get the extra class name for the title.
	         *
	         * #### Notes
	         * The default value is an empty string.
	         */
	        get: function () {
	            return this._className;
	        },
	        /**
	         * Set the extra class name for the title.
	         *
	         * #### Notes
	         * Multiple class names can be separated with whitespace.
	         */
	        set: function (value) {
	            if (this._className === value) {
	                return;
	            }
	            this._className = value;
	            this.changed.emit(void 0);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Title.prototype, "closable", {
	        /**
	         * Get the closable state for the title.
	         *
	         * #### Notes
	         * The default value is `false`.
	         */
	        get: function () {
	            return this._closable;
	        },
	        /**
	         * Set the closable state for the title.
	         *
	         * #### Notes
	         * This controls the presence of a close icon when applicable.
	         */
	        set: function (value) {
	            if (this._closable === value) {
	                return;
	            }
	            this._closable = value;
	            this.changed.emit(void 0);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    return Title;
	}());
	exports.Title = Title;
	// Define the signals for the `Title` class.
	signaling_1.defineSignal(Title.prototype, 'changed');
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/ui/title.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_core.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_core.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	// widget_core implements some common patterns for the core widget collection
	// that are not to be used directly by third-party widget authors.
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var semver_range = '^' + __jupyter_require__('jupyter-js-widgets@2.1.4/package.json').version;
	var CoreWidgetModel = (function (_super) {
	    __extends(CoreWidgetModel, _super);
	    function CoreWidgetModel() {
	        _super.apply(this, arguments);
	    }
	    CoreWidgetModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'CoreWidgetModel',
	            _model_module_version: semver_range,
	            _view_module_version: semver_range
	        });
	    };
	    return CoreWidgetModel;
	}(widget_1.WidgetModel));
	exports.CoreWidgetModel = CoreWidgetModel;
	var CoreDOMWidgetModel = (function (_super) {
	    __extends(CoreDOMWidgetModel, _super);
	    function CoreDOMWidgetModel() {
	        _super.apply(this, arguments);
	    }
	    CoreDOMWidgetModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'CoreDOMWidgetModel',
	            _model_module_version: semver_range,
	            _view_module_version: semver_range
	        });
	    };
	    return CoreDOMWidgetModel;
	}(widget_1.DOMWidgetModel));
	exports.CoreDOMWidgetModel = CoreDOMWidgetModel;
	var CoreLabeledDOMWidgetModel = (function (_super) {
	    __extends(CoreLabeledDOMWidgetModel, _super);
	    function CoreLabeledDOMWidgetModel() {
	        _super.apply(this, arguments);
	    }
	    CoreLabeledDOMWidgetModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'CoreLabeledDOMWidgetModel',
	            _model_module_version: semver_range,
	            _view_module_version: semver_range
	        });
	    };
	    return CoreLabeledDOMWidgetModel;
	}(widget_1.LabeledDOMWidgetModel));
	exports.CoreLabeledDOMWidgetModel = CoreLabeledDOMWidgetModel;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_core.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/package.json **/
jupyter.define('jupyter-js-widgets@2.1.4/package.json', function (module, exports, __jupyter_require__) {
	module.exports = {
		"_args": [
			[
				{
					"raw": "jupyter-js-widgets@~2.1.4",
					"scope": null,
					"escapedName": "jupyter-js-widgets",
					"name": "jupyter-js-widgets",
					"rawSpec": "~2.1.4",
					"spec": ">=2.1.4 <2.2.0",
					"type": "range"
				},
				"/Users/haichit/programs/3d/nglview/js"
			]
		],
		"_from": "jupyter-js-widgets@>=2.1.4 <2.2.0",
		"_id": "jupyter-js-widgets@2.1.4",
		"_inCache": true,
		"_location": "/jupyter-js-widgets",
		"_nodeVersion": "6.9.0",
		"_npmOperationalInternal": {
			"host": "packages-12-west.internal.npmjs.com",
			"tmp": "tmp/jupyter-js-widgets-2.1.4.tgz_1488308625213_0.5537016761954874"
		},
		"_npmUser": {
			"name": "jasongrout",
			"email": "jason@jasongrout.org"
		},
		"_npmVersion": "3.10.8",
		"_phantomChildren": {},
		"_requested": {
			"raw": "jupyter-js-widgets@~2.1.4",
			"scope": null,
			"escapedName": "jupyter-js-widgets",
			"name": "jupyter-js-widgets",
			"rawSpec": "~2.1.4",
			"spec": ">=2.1.4 <2.2.0",
			"type": "range"
		},
		"_requiredBy": [
			"/",
			"/@jupyterlab/nbwidgets"
		],
		"_resolved": "https://registry.npmjs.org/jupyter-js-widgets/-/jupyter-js-widgets-2.1.4.tgz",
		"_shasum": "a2c8c19d706d79feb202e6dc3221bffc9d1d8edf",
		"_shrinkwrap": null,
		"_spec": "jupyter-js-widgets@~2.1.4",
		"_where": "/Users/haichit/programs/3d/nglview/js",
		"author": {
			"name": "Project Jupyter"
		},
		"bugs": {
			"url": "https://github.com/ipython/ipywidgets/issues"
		},
		"dependencies": {
			"@jupyterlab/services": "^0.35.0",
			"@types/backbone": "^1.3.33",
			"@types/semver": "^5.3.30",
			"ajv": "^4.9.0",
			"backbone": "1.2.0",
			"d3-format": "^0.5.1",
			"font-awesome": "^4.5.0",
			"jquery": "^3.1.1",
			"jquery-ui": "^1.12.1",
			"jupyter-widgets-schema": "^0.1.1",
			"lolex": "^1.4.0",
			"phosphor": "^0.7.0",
			"scriptjs": "^2.5.8",
			"semver": "^5.1.0",
			"underscore": "^1.8.3"
		},
		"description": "Jupyter interactive widgets",
		"devDependencies": {
			"@types/expect.js": "^0.3.29",
			"@types/mathjax": "0.0.31",
			"@types/mocha": "2.2.32",
			"@types/requirejs": "^2.1.28",
			"@types/sinon": "^1.16.31",
			"cpx": "^1.5.0",
			"css-loader": "^0.23.1",
			"es6-promise": "^3.1.2",
			"expect.js": "^0.3.1",
			"file-loader": "^0.8.5",
			"istanbul-instrumenter-loader": "^0.2.0",
			"json-loader": "^0.5.4",
			"karma": "^0.13.15",
			"karma-chrome-launcher": "^0.2.2",
			"karma-coverage": "^1.0.0",
			"karma-firefox-launcher": "^0.1.7",
			"karma-ie-launcher": "^1.0.0",
			"karma-mocha": "^0.2.1",
			"karma-mocha-reporter": "^1.1.3",
			"karma-webpack": "^1.7.0",
			"mocha": "^2.3.4",
			"npm-run-all": "^1.5.1",
			"postcss-cli": "^2.6.0",
			"postcss-cssnext": "^2.8.0",
			"postcss-import": "^8.1.2",
			"postcss-loader": "^1.3.2",
			"rimraf": "^2.4.1",
			"sinon": "^1.17.2",
			"spawn-sync": "^1.0.14",
			"style-loader": "^0.13.1",
			"typedoc": "^0.5.0",
			"typescript": "~2.0.10",
			"url-loader": "^0.5.7",
			"webpack": "^1.12.11"
		},
		"directories": {},
		"dist": {
			"shasum": "a2c8c19d706d79feb202e6dc3221bffc9d1d8edf",
			"tarball": "https://registry.npmjs.org/jupyter-js-widgets/-/jupyter-js-widgets-2.1.4.tgz"
		},
		"files": [
			"lib/**/*.d.ts",
			"lib/**/*.js",
			"css/*.css",
			"dist/"
		],
		"homepage": "https://github.com/ipython/ipywidgets#readme",
		"license": "BSD-3-Clause",
		"main": "lib/index.js",
		"maintainers": [
			{
				"name": "sylvaincorlay",
				"email": "sylvain.corlay@gmail.com"
			}
		],
		"name": "jupyter-js-widgets",
		"optionalDependencies": {},
		"readme": "ERROR: No README data found!",
		"repository": {
			"type": "git",
			"url": "git+https://github.com/ipython/ipywidgets.git"
		},
		"scripts": {
			"build": "npm run build:src && npm run build:src-embed && npm run build:css && webpack",
			"build:css": "postcss --use postcss-import --use postcss-cssnext -o css/widgets.built.css css/widgets.css",
			"build:src": "tsc --project src",
			"build:src-embed": "tsc --project src-embed",
			"build:test": "tsc --project test/src && webpack --config test/webpack.conf.js",
			"clean": "npm run clean:src && npm run clean:embed",
			"clean:embed": "rimraf lib-embed",
			"clean:src": "rimraf lib",
			"docs": "npm run docs:src && npm run docs:embed",
			"docs:embed": "typedoc --mode file --module commonjs --excludeNotExported --target es5 --moduleResolution node --out docs-embed/ src-embed",
			"docs:src": "typedoc --mode file --module commonjs --excludeNotExported --target es5 --moduleResolution node --out docs/ src",
			"postinstall": "npm dedupe",
			"prepublish": "npm run build",
			"test": "npm run test:unit && npm run test:examples",
			"test:coverage": "npm run build:test && webpack --config test/webpack-cov.conf.js && karma start test/karma-cov.conf.js",
			"test:example:web2": "cd examples/web2 && npm install && npm run test:default",
			"test:example:web3": "cd examples/web3 && npm install && npm run test:default",
			"test:example:web4": "cd examples/web4 && npm install && npm run test:default",
			"test:example:web5": "cd examples/web5 && npm install && npm run test:default",
			"test:examples": "npm run test:examples:chrome && npm run test:examples:firefox",
			"test:examples:chrome": "npm-run-all \"test:example:*\"",
			"test:examples:firefox": "npm-run-all \"test:example:* -- -- --browsers Firefox\"",
			"test:unit": "npm run test:unit:firefox && npm run test:unit:chrome",
			"test:unit:chrome": "npm run test:unit:default -- --browsers=Chrome",
			"test:unit:default": "npm run build:test && karma start test/karma.conf.js --log-level debug",
			"test:unit:firefox": "npm run test:unit:default -- --browsers=Firefox",
			"test:unit:ie": "npm run test:unit:default -- --browsers=IE"
		},
		"typings": "lib/index.d.ts",
		"version": "2.1.4"
	};
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/package.json **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_layout.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_layout.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	/**
	 * css properties exposed by the layout widget with their default values.
	 */
	var css_properties = {
	    align_content: null,
	    align_items: null,
	    align_self: null,
	    border: null,
	    bottom: null,
	    display: null,
	    flex: null,
	    flex_flow: null,
	    height: null,
	    justify_content: null,
	    left: null,
	    margin: null,
	    max_height: null,
	    max_width: null,
	    min_height: null,
	    min_width: null,
	    overflow: null,
	    overflow_x: null,
	    overflow_y: null,
	    order: null,
	    padding: null,
	    right: null,
	    top: null,
	    visibility: null,
	    width: null
	};
	var LayoutModel = (function (_super) {
	    __extends(LayoutModel, _super);
	    function LayoutModel() {
	        _super.apply(this, arguments);
	    }
	    LayoutModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'LayoutModel',
	            _view_name: 'LayoutView'
	        }, css_properties);
	    };
	    return LayoutModel;
	}(widget_core_1.CoreWidgetModel));
	exports.LayoutModel = LayoutModel;
	var LayoutView = (function (_super) {
	    __extends(LayoutView, _super);
	    function LayoutView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Public constructor
	     */
	    LayoutView.prototype.initialize = function (parameters) {
	        this._traitNames = [];
	        _super.prototype.initialize.call(this, parameters);
	        // Register the traits that live on the Python side
	        for (var _i = 0, _a = Object.keys(css_properties); _i < _a.length; _i++) {
	            var key = _a[_i];
	            this.registerTrait(key);
	        }
	    };
	    /**
	     * Register a CSS trait that is known by the model
	     * @param trait
	     */
	    LayoutView.prototype.registerTrait = function (trait) {
	        var _this = this;
	        this._traitNames.push(trait);
	        // Listen to changes, and set the value on change.
	        this.listenTo(this.model, 'change:' + trait, function (model, value) {
	            _this.handleChange(trait, value);
	        });
	        // Set the initial value on display.
	        this.handleChange(trait, this.model.get(trait));
	    };
	    /**
	     * Get the the name of the css property from the trait name
	     * @param  model attribute name
	     * @return css property name
	     */
	    LayoutView.prototype.css_name = function (trait) {
	        return trait.replace('_', '-');
	    };
	    /**
	     * Handles when a trait value changes
	     */
	    LayoutView.prototype.handleChange = function (trait, value) {
	        // should be synchronous so that we can measure later.
	        var parent = this.options.parent;
	        if (parent) {
	            if (value === null) {
	                parent.el.style.removeProperty(this.css_name(trait));
	            }
	            else {
	                parent.el.style[this.css_name(trait)] = value;
	            }
	        }
	        else {
	            console.warn('Style not applied because a parent view does not exist');
	        }
	    };
	    /**
	     * Remove the styling from the parent view.
	     */
	    LayoutView.prototype.unlayout = function () {
	        var _this = this;
	        var parent = this.options.parent;
	        this._traitNames.forEach(function (trait) {
	            if (parent) {
	                parent.el.style.removeProperty(_this.css_name(trait));
	            }
	            else {
	                console.warn('Style not removed because a parent view does not exist');
	            }
	        }, this);
	    };
	    return LayoutView;
	}(widget_1.WidgetView));
	exports.LayoutView = LayoutView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_layout.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_style.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_style.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var StyleModel = (function (_super) {
	    __extends(StyleModel, _super);
	    function StyleModel() {
	        _super.apply(this, arguments);
	    }
	    StyleModel.prototype.defaults = function () {
	        var Derived = this.constructor;
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'StyleModel',
	            _view_name: 'StyleView',
	        }, _.reduce(Object.keys(Derived.styleProperties), function (obj, key) {
	            obj[key] = Derived.styleProperties[key].default;
	            return obj;
	        }, {}));
	    };
	    StyleModel.styleProperties = {};
	    return StyleModel;
	}(widget_core_1.CoreWidgetModel));
	exports.StyleModel = StyleModel;
	var StyleView = (function (_super) {
	    __extends(StyleView, _super);
	    function StyleView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Public constructor
	     */
	    StyleView.prototype.initialize = function (parameters) {
	        this._traitNames = [];
	        _super.prototype.initialize.call(this, parameters);
	        // Register the traits that live on the Python side
	        var ModelType = this.model.constructor;
	        for (var _i = 0, _a = Object.keys(ModelType.styleProperties); _i < _a.length; _i++) {
	            var key = _a[_i];
	            this.registerTrait(key);
	        }
	    };
	    /**
	     * Register a CSS trait that is known by the model
	     * @param trait
	     */
	    StyleView.prototype.registerTrait = function (trait) {
	        var _this = this;
	        this._traitNames.push(trait);
	        // Listen to changes, and set the value on change.
	        this.listenTo(this.model, 'change:' + trait, function (model, value) {
	            _this.handleChange(trait, value);
	        });
	        // Set the initial value on display.
	        this.handleChange(trait, this.model.get(trait));
	    };
	    /**
	     * Handles when a trait value changes
	     */
	    StyleView.prototype.handleChange = function (trait, value) {
	        // should be synchronous so that we can measure later.
	        var parent = this.options.parent;
	        if (parent) {
	            var ModelType = this.model.constructor;
	            var styleProperties = ModelType.styleProperties;
	            var attribute = styleProperties[trait].attribute;
	            var selector = styleProperties[trait].selector;
	            var elements = selector ? parent.el.querySelectorAll(selector) : [parent.el];
	            if (value === null) {
	                for (var i = 0; i !== elements.length; ++i) {
	                    elements[i].style.removeProperty(attribute);
	                }
	            }
	            else {
	                for (var i = 0; i !== elements.length; ++i) {
	                    elements[i].style[attribute] = value;
	                }
	            }
	        }
	        else {
	            console.warn('Style not applied because a parent view does not exist');
	        }
	    };
	    /**
	     * Remove the styling from the parent view.
	     */
	    StyleView.prototype.unstyle = function () {
	        var parent = this.options.parent;
	        var ModelType = this.model.constructor;
	        var styleProperties = ModelType.styleProperties;
	        this._traitNames.forEach(function (trait) {
	            if (parent) {
	                var attribute = styleProperties[trait].attribute;
	                var selector = styleProperties[trait].selector;
	                var elements = selector ? parent.el.querySelectorAll(selector) : [parent.el];
	                for (var i = 0; i !== elements.length; ++i) {
	                    elements[i].style.removeProperty(attribute);
	                }
	            }
	            else {
	                console.warn('Style not removed because a parent view does not exist');
	            }
	        }, this);
	    };
	    return StyleView;
	}(widget_1.WidgetView));
	exports.StyleView = StyleView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_style.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_link.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_link.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var DirectionalLinkModel = (function (_super) {
	    __extends(DirectionalLinkModel, _super);
	    function DirectionalLinkModel() {
	        _super.apply(this, arguments);
	    }
	    DirectionalLinkModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            target: undefined,
	            source: undefined,
	            _model_name: 'DirectionalLinkModel'
	        });
	    };
	    DirectionalLinkModel.prototype.initialize = function (attributes, options) {
	        _super.prototype.initialize.call(this, attributes, options);
	        this.on('change', this.updateBindings, this);
	        this.updateBindings();
	    };
	    DirectionalLinkModel.prototype.updateValue = function (sourceModel, sourceAttr, targetModel, targetAttr) {
	        if (this._updating) {
	            return;
	        }
	        this._updating = true;
	        try {
	            if (targetModel) {
	                targetModel.set(targetAttr, sourceModel.get(sourceAttr));
	                targetModel.save_changes();
	            }
	        }
	        finally {
	            this._updating = false;
	        }
	    };
	    DirectionalLinkModel.prototype.updateBindings = function () {
	        var _this = this;
	        this.cleanup();
	        _a = this.get('source') || [null, null], this.sourceModel = _a[0], this.sourceAttr = _a[1];
	        _b = this.get('target') || [null, null], this.targetModel = _b[0], this.targetAttr = _b[1];
	        if (this.sourceModel) {
	            this.listenTo(this.sourceModel, 'change:' + this.sourceAttr, function () {
	                _this.updateValue(_this.sourceModel, _this.sourceAttr, _this.targetModel, _this.targetAttr);
	            });
	            this.updateValue(this.sourceModel, this.sourceAttr, this.targetModel, this.targetAttr);
	            this.listenToOnce(this.sourceModel, 'destroy', this.cleanup);
	        }
	        if (this.targetModel) {
	            this.listenToOnce(this.targetModel, 'destroy', this.cleanup);
	        }
	        var _a, _b;
	    };
	    DirectionalLinkModel.prototype.cleanup = function () {
	        // Stop listening to 'change' and 'destroy' events of the source and target
	        if (this.sourceModel) {
	            this.stopListening(this.sourceModel, 'change:' + this.sourceAttr, null);
	            this.stopListening(this.sourceModel, 'destroy', null);
	        }
	        if (this.targetModel) {
	            this.stopListening(this.targetModel, 'destroy', null);
	        }
	    };
	    DirectionalLinkModel.serializers = _.extend({
	        target: { deserialize: widget_1.unpack_models },
	        source: { deserialize: widget_1.unpack_models }
	    }, widget_core_1.CoreWidgetModel.serializers);
	    return DirectionalLinkModel;
	}(widget_core_1.CoreWidgetModel));
	exports.DirectionalLinkModel = DirectionalLinkModel;
	var LinkModel = (function (_super) {
	    __extends(LinkModel, _super);
	    function LinkModel() {
	        _super.apply(this, arguments);
	    }
	    LinkModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'LinkModel'
	        });
	    };
	    LinkModel.prototype.updateBindings = function () {
	        var _this = this;
	        _super.prototype.updateBindings.call(this);
	        if (this.targetModel) {
	            this.listenTo(this.targetModel, 'change:' + this.targetAttr, function () {
	                _this.updateValue(_this.targetModel, _this.targetAttr, _this.sourceModel, _this.sourceAttr);
	            });
	        }
	    };
	    LinkModel.prototype.cleanup = function () {
	        _super.prototype.cleanup.call(this);
	        if (this.targetModel) {
	            this.stopListening(this.targetModel, 'change:' + this.targetAttr, null);
	        }
	    };
	    return LinkModel;
	}(DirectionalLinkModel));
	exports.LinkModel = LinkModel;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_link.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_bool.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_bool.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var BoolModel = (function (_super) {
	    __extends(BoolModel, _super);
	    function BoolModel() {
	        _super.apply(this, arguments);
	    }
	    BoolModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            value: false,
	            disabled: false,
	            _model_name: 'BoolModel'
	        });
	    };
	    return BoolModel;
	}(widget_core_1.CoreLabeledDOMWidgetModel));
	exports.BoolModel = BoolModel;
	var CheckboxModel = (function (_super) {
	    __extends(CheckboxModel, _super);
	    function CheckboxModel() {
	        _super.apply(this, arguments);
	    }
	    CheckboxModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'CheckboxView',
	            _model_name: 'CheckboxModel'
	        });
	    };
	    return CheckboxModel;
	}(widget_core_1.CoreLabeledDOMWidgetModel));
	exports.CheckboxModel = CheckboxModel;
	var CheckboxView = (function (_super) {
	    __extends(CheckboxView, _super);
	    function CheckboxView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    CheckboxView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-checkbox');
	        this.checkbox = document.createElement('input');
	        this.checkbox.setAttribute('type', 'checkbox');
	        this.el.appendChild(this.checkbox);
	        this.update(); // Set defaults.
	    };
	    CheckboxView.prototype.events = function () {
	        return {
	            'click input[type="checkbox"]': '_handle_click'
	        };
	    };
	    /**
	     * Handles when the checkbox is clicked.
	     *
	     * Calling model.set will trigger all of the other views of the
	     * model to update.
	     */
	    CheckboxView.prototype._handle_click = function () {
	        var value = this.model.get('value');
	        this.model.set('value', !value, { updated_view: this });
	        this.touch();
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed. The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    CheckboxView.prototype.update = function (options) {
	        this.checkbox.checked = this.model.get('value');
	        if (options === undefined || options.updated_view != this) {
	            this.checkbox.disabled = this.model.get('disabled');
	        }
	        return _super.prototype.update.call(this);
	    };
	    return CheckboxView;
	}(widget_1.LabeledDOMWidgetView));
	exports.CheckboxView = CheckboxView;
	var ToggleButtonModel = (function (_super) {
	    __extends(ToggleButtonModel, _super);
	    function ToggleButtonModel() {
	        _super.apply(this, arguments);
	    }
	    ToggleButtonModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'ToggleButtonView',
	            _model_name: 'ToggleButtonModel',
	            tooltip: '',
	            icon: '',
	            button_style: ''
	        });
	    };
	    return ToggleButtonModel;
	}(BoolModel));
	exports.ToggleButtonModel = ToggleButtonModel;
	var ToggleButtonView = (function (_super) {
	    __extends(ToggleButtonView, _super);
	    function ToggleButtonView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    ToggleButtonView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.className = 'jupyter-widgets jupyter-button widget-toggle-button';
	        this.listenTo(this.model, 'change:button_style', this.update_button_style);
	        this.set_button_style();
	        this.update(); // Set defaults.
	    };
	    ToggleButtonView.prototype.update_button_style = function () {
	        this.update_mapped_classes(ToggleButtonView.class_map, 'button_style');
	    };
	    ToggleButtonView.prototype.set_button_style = function () {
	        this.set_mapped_classes(ToggleButtonView.class_map, 'button_style');
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed. The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    ToggleButtonView.prototype.update = function (options) {
	        if (this.model.get('value')) {
	            this.el.classList.add('mod-active');
	        }
	        else {
	            this.el.classList.remove('mod-active');
	        }
	        if (options === undefined || options.updated_view !== this) {
	            this.el.disabled = this.model.get('disabled');
	            this.el.setAttribute('title', this.model.get('tooltip'));
	            var description = this.model.get('description');
	            var icon = this.model.get('icon');
	            if (description.trim().length === 0 && icon.trim().length === 0) {
	                this.el.innerHTML = '&nbsp;'; // Preserve button height
	            }
	            else {
	                this.el.textContent = '';
	                if (icon.trim().length) {
	                    var i = document.createElement('i');
	                    this.el.appendChild(i);
	                    i.classList.add('fa');
	                    i.classList.add('fa-' + icon);
	                }
	                this.el.appendChild(document.createTextNode(description));
	            }
	        }
	        return _super.prototype.update.call(this);
	    };
	    ToggleButtonView.prototype.events = function () {
	        return {
	            // Dictionary of events and their handlers.
	            'click': '_handle_click'
	        };
	    };
	    /**
	     * Handles and validates user input.
	     *
	     * Calling model.set will trigger all of the other views of the
	     * model to update.
	     */
	    ToggleButtonView.prototype._handle_click = function (event) {
	        event.preventDefault();
	        var value = this.model.get('value');
	        this.model.set('value', !value, { updated_view: this });
	        this.touch();
	    };
	    Object.defineProperty(ToggleButtonView.prototype, "tagName", {
	        /**
	         * The default tag name.
	         *
	         * #### Notes
	         * This is a read-only attribute.
	         */
	        get: function () {
	            // We can't make this an attribute with a default value
	            // since it would be set after it is needed in the
	            // constructor.
	            return 'button';
	        },
	        enumerable: true,
	        configurable: true
	    });
	    ToggleButtonView.class_map = {
	        primary: ['mod-primary'],
	        success: ['mod-success'],
	        info: ['mod-info'],
	        warning: ['mod-warning'],
	        danger: ['mod-danger']
	    };
	    return ToggleButtonView;
	}(widget_1.DOMWidgetView));
	exports.ToggleButtonView = ToggleButtonView;
	var ValidModel = (function (_super) {
	    __extends(ValidModel, _super);
	    function ValidModel() {
	        _super.apply(this, arguments);
	    }
	    ValidModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            readout: 'Invalid',
	            _view_name: 'ValidView',
	            _model_name: 'ValidModel'
	        });
	    };
	    return ValidModel;
	}(BoolModel));
	exports.ValidModel = ValidModel;
	var ValidView = (function (_super) {
	    __extends(ValidView, _super);
	    function ValidView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    ValidView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-valid');
	        this.el.classList.add('widget-inline-hbox');
	        var icon = document.createElement('i');
	        this.el.appendChild(icon);
	        this.readout = document.createElement('span');
	        this.readout.classList.add('widget-valid-readout');
	        this.readout.classList.add('widget-readout');
	        this.el.appendChild(this.readout);
	        this.update();
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed.  The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    ValidView.prototype.update = function () {
	        this.el.classList.remove('mod-valid');
	        this.el.classList.remove('mod-invalid');
	        this.readout.textContent = this.model.get('readout');
	        if (this.model.get('value')) {
	            this.el.classList.add('mod-valid');
	        }
	        else {
	            this.el.classList.add('mod-invalid');
	        }
	    };
	    return ValidView;
	}(widget_1.LabeledDOMWidgetView));
	exports.ValidView = ValidView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_bool.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_button.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_button.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var widget_style_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_style.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var ButtonStyleModel = (function (_super) {
	    __extends(ButtonStyleModel, _super);
	    function ButtonStyleModel() {
	        _super.apply(this, arguments);
	    }
	    ButtonStyleModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'ButtonStyleModel',
	        });
	    };
	    ButtonStyleModel.styleProperties = {
	        button_color: {
	            selector: '',
	            attribute: 'background-color',
	            default: null
	        },
	        font_weight: {
	            selector: '',
	            attribute: 'font-weight',
	            default: ''
	        }
	    };
	    return ButtonStyleModel;
	}(widget_style_1.StyleModel));
	exports.ButtonStyleModel = ButtonStyleModel;
	var ButtonModel = (function (_super) {
	    __extends(ButtonModel, _super);
	    function ButtonModel() {
	        _super.apply(this, arguments);
	    }
	    ButtonModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            description: '',
	            tooltip: '',
	            disabled: false,
	            icon: '',
	            button_style: '',
	            _view_name: 'ButtonView',
	            _model_name: 'ButtonModel',
	            style: void 0
	        });
	    };
	    return ButtonModel;
	}(widget_core_1.CoreDOMWidgetModel));
	exports.ButtonModel = ButtonModel;
	var ButtonView = (function (_super) {
	    __extends(ButtonView, _super);
	    function ButtonView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    ButtonView.prototype.render = function () {
	        this.el.className = 'jupyter-widgets jupyter-button widget-button';
	        this.listenTo(this.model, 'change:button_style', this.update_button_style);
	        this.set_button_style();
	        this.update(); // Set defaults.
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed. The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    ButtonView.prototype.update = function () {
	        this.el.disabled = this.model.get('disabled');
	        this.el.setAttribute('title', this.model.get('tooltip'));
	        var description = this.model.get('description');
	        var icon = this.model.get('icon');
	        if (description.trim().length || icon.trim().length) {
	            this.el.textContent = '';
	            if (icon.trim().length) {
	                var i = document.createElement('i');
	                i.classList.add('fa');
	                i.classList.add('fa-' + icon);
	                if (description.trim().length === 0) {
	                    i.classList.add('center');
	                }
	                this.el.appendChild(i);
	            }
	            this.el.appendChild(document.createTextNode(description));
	        }
	        return _super.prototype.update.call(this);
	    };
	    ButtonView.prototype.update_button_style = function () {
	        this.update_mapped_classes(ButtonView.class_map, 'button_style');
	    };
	    ButtonView.prototype.set_button_style = function () {
	        this.set_mapped_classes(ButtonView.class_map, 'button_style');
	    };
	    /**
	     * Dictionary of events and handlers
	     */
	    ButtonView.prototype.events = function () {
	        // TODO: return typing not needed in Typescript later than 1.8.x
	        // See http://stackoverflow.com/questions/22077023/why-cant-i-indirectly-return-an-object-literal-to-satisfy-an-index-signature-re and https://github.com/Microsoft/TypeScript/pull/7029
	        return { 'click': '_handle_click' };
	    };
	    /**
	     * Handles when the button is clicked.
	     */
	    ButtonView.prototype._handle_click = function (event) {
	        event.preventDefault();
	        this.send({ event: 'click' });
	    };
	    Object.defineProperty(ButtonView.prototype, "tagName", {
	        /**
	         * The default tag name.
	         *
	         * #### Notes
	         * This is a read-only attribute.
	         */
	        get: function () {
	            // We can't make this an attribute with a default value
	            // since it would be set after it is needed in the
	            // constructor.
	            return 'button';
	        },
	        enumerable: true,
	        configurable: true
	    });
	    ButtonView.class_map = {
	        primary: ['mod-primary'],
	        success: ['mod-success'],
	        info: ['mod-info'],
	        warning: ['mod-warning'],
	        danger: ['mod-danger']
	    };
	    return ButtonView;
	}(widget_1.DOMWidgetView));
	exports.ButtonView = ButtonView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_button.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_box.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_box.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var utils_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/utils.js');
	var searching_1 = __jupyter_require__('phosphor@^0.7.0/lib/algorithm/searching.js');
	var messaging_1 = __jupyter_require__('phosphor@^0.7.0/lib/core/messaging.js');
	var panel_1 = __jupyter_require__('phosphor@^0.7.0/lib/ui/panel.js');
	var widget_2 = __jupyter_require__('phosphor@^0.7.0/lib/ui/widget.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var $ = __jupyter_require__('jquery@^3.1.1/dist/jquery.js');
	var JupyterPhosphorPanelWidget = (function (_super) {
	    __extends(JupyterPhosphorPanelWidget, _super);
	    function JupyterPhosphorPanelWidget(options) {
	        var view = options.view;
	        delete options.view;
	        _super.call(this, options);
	        this._view = view;
	    }
	    /**
	     * Process the phosphor message.
	     *
	     * Any custom phosphor widget used inside a Jupyter widget should override
	     * the processMessage function like this.
	     */
	    JupyterPhosphorPanelWidget.prototype.processMessage = function (msg) {
	        _super.prototype.processMessage.call(this, msg);
	        this._view.processPhosphorMessage(msg);
	    };
	    /**
	     * Dispose the widget.
	     *
	     * This causes the view to be destroyed as well with 'remove'
	     */
	    JupyterPhosphorPanelWidget.prototype.dispose = function () {
	        if (this.isDisposed) {
	            return;
	        }
	        _super.prototype.dispose.call(this);
	        if (this._view) {
	            this._view.remove();
	        }
	        this._view = null;
	    };
	    return JupyterPhosphorPanelWidget;
	}(panel_1.Panel));
	exports.JupyterPhosphorPanelWidget = JupyterPhosphorPanelWidget;
	var BoxModel = (function (_super) {
	    __extends(BoxModel, _super);
	    function BoxModel() {
	        _super.apply(this, arguments);
	    }
	    BoxModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'BoxView',
	            _model_name: 'BoxModel',
	            children: [],
	            box_style: ''
	        });
	    };
	    BoxModel.serializers = _.extend({
	        children: { deserialize: widget_1.unpack_models }
	    }, widget_core_1.CoreDOMWidgetModel.serializers);
	    return BoxModel;
	}(widget_core_1.CoreDOMWidgetModel));
	exports.BoxModel = BoxModel;
	var HBoxModel = (function (_super) {
	    __extends(HBoxModel, _super);
	    function HBoxModel() {
	        _super.apply(this, arguments);
	    }
	    HBoxModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'HBoxView',
	            _model_name: 'HBoxModel',
	        });
	    };
	    return HBoxModel;
	}(BoxModel));
	exports.HBoxModel = HBoxModel;
	var VBoxModel = (function (_super) {
	    __extends(VBoxModel, _super);
	    function VBoxModel() {
	        _super.apply(this, arguments);
	    }
	    VBoxModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _view_name: 'VBoxView',
	            _model_name: 'VBoxModel',
	        });
	    };
	    return VBoxModel;
	}(BoxModel));
	exports.VBoxModel = VBoxModel;
	var BoxView = (function (_super) {
	    __extends(BoxView, _super);
	    function BoxView() {
	        _super.apply(this, arguments);
	    }
	    BoxView.prototype._createElement = function (tagName) {
	        this.pWidget = new JupyterPhosphorPanelWidget({ view: this });
	        return this.pWidget.node;
	    };
	    BoxView.prototype._setElement = function (el) {
	        if (this.el || el !== this.pWidget.node) {
	            // Boxes don't allow setting the element beyond the initial creation.
	            throw new Error('Cannot reset the DOM element.');
	        }
	        this.el = this.pWidget.node;
	        this.$el = $(this.pWidget.node);
	    };
	    /**
	     * Public constructor
	     */
	    BoxView.prototype.initialize = function (parameters) {
	        _super.prototype.initialize.call(this, parameters);
	        this.children_views = new widget_1.ViewList(this.add_child_model, null, this);
	        this.listenTo(this.model, 'change:children', this.update_children);
	        this.listenTo(this.model, 'change:box_style', this.update_box_style);
	        this.pWidget.addClass('jupyter-widgets');
	        this.pWidget.addClass('widget-container');
	        this.pWidget.addClass('widget-box');
	    };
	    /**
	     * Called when view is rendered.
	     */
	    BoxView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.update_children();
	        this.set_box_style();
	    };
	    BoxView.prototype.update_children = function () {
	        this.children_views.update(this.model.get('children')).then(function (views) {
	            // Notify all children that their sizes may have changed.
	            views.forEach(function (view) {
	                messaging_1.postMessage(view.pWidget, widget_2.ResizeMessage.UnknownSize);
	            });
	        });
	    };
	    BoxView.prototype.update_box_style = function () {
	        this.update_mapped_classes(BoxView.class_map, 'box_style');
	    };
	    BoxView.prototype.set_box_style = function () {
	        this.set_mapped_classes(BoxView.class_map, 'box_style');
	    };
	    BoxView.prototype.add_child_model = function (model) {
	        var _this = this;
	        // we insert a dummy element so the order is preserved when we add
	        // the rendered content later.
	        var dummy = new widget_2.Widget();
	        this.pWidget.addWidget(dummy);
	        return this.create_child_view(model).then(function (view) {
	            // replace the dummy widget with the new one.
	            var i = searching_1.indexOf(_this.pWidget.widgets, dummy);
	            _this.pWidget.insertWidget(i, view.pWidget);
	            dummy.dispose();
	            return view;
	        }).catch(utils_1.reject('Could not add child view to box', true));
	    };
	    BoxView.prototype.remove = function () {
	        this.children_views = null;
	        _super.prototype.remove.call(this);
	    };
	    BoxView.class_map = {
	        success: ['alert', 'alert-success'],
	        info: ['alert', 'alert-info'],
	        warning: ['alert', 'alert-warning'],
	        danger: ['alert', 'alert-danger']
	    };
	    return BoxView;
	}(widget_1.DOMWidgetView));
	exports.BoxView = BoxView;
	var HBoxView = (function (_super) {
	    __extends(HBoxView, _super);
	    function HBoxView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Public constructor
	     */
	    HBoxView.prototype.initialize = function (parameters) {
	        _super.prototype.initialize.call(this, parameters);
	        this.pWidget.addClass('widget-hbox');
	    };
	    return HBoxView;
	}(BoxView));
	exports.HBoxView = HBoxView;
	var VBoxView = (function (_super) {
	    __extends(VBoxView, _super);
	    function VBoxView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Public constructor
	     */
	    VBoxView.prototype.initialize = function (parameters) {
	        _super.prototype.initialize.call(this, parameters);
	        this.pWidget.addClass('widget-vbox');
	    };
	    return VBoxView;
	}(BoxView));
	exports.VBoxView = VBoxView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_box.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/algorithm/searching.js **/
jupyter.define('phosphor@0.7.1/lib/algorithm/searching.js', function (module, exports, __jupyter_require__) {
	"use strict";
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var iteration_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/iteration.js');
	var sequence_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/sequence.js');
	/**
	 * Find the first value in an iterable which matches a predicate.
	 *
	 * @param object - The iterable or array-like object to search.
	 *
	 * @param fn - The predicate function to apply to the values.
	 *
	 * @returns The first matching value, or `undefined` if no matching
	 *   value is found.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Example
	 * ```typescript
	 * import { find } from 'phosphor/lib/algorithm/searching';
	 *
	 * interface IAnimal { species: string, name: string };
	 *
	 * function isCat(value: IAnimal): boolean {
	 *   return value.species === 'cat';
	 * }
	 *
	 * let data: IAnimal[] = [
	 *   { species: 'dog', name: 'spot' },
	 *   { species: 'cat', name: 'fluffy' },
	 *   { species: 'alligator', name: 'pocho' },
	 * ];
	 *
	 * find(data, isCat).name;  // 'fluffy'
	 * ```
	 */
	function find(object, fn) {
	    var value;
	    var it = iteration_1.iter(object);
	    while ((value = it.next()) !== void 0) {
	        if (fn(value)) {
	            return value;
	        }
	    }
	    return void 0;
	}
	exports.find = find;
	/**
	 * Test whether an iterable contains a specific value.
	 *
	 * @param object - The iterable or array-like object to search.
	 *
	 * @param value - The value to search for in the iterable. Values
	 *   are compared using strict `===` equality.
	 *
	 * @returns `true` if the value is found, `false` otherwise.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Example
	 * ```typescript
	 * import { contains } from 'phosphor/lib/algorithm/searching';
	 *
	 * let data: number[] = [5, 7, 0, -2, 9];
	 *
	 * contains(data, -2);  // true
	 * contains(data, 3);   // false
	 * ```
	 */
	function contains(object, value) {
	    var temp;
	    var it = iteration_1.iter(object);
	    while ((temp = it.next()) !== void 0) {
	        if (temp === value) {
	            return true;
	        }
	    }
	    return false;
	}
	exports.contains = contains;
	/**
	 * Find the minimum value in an iterable.
	 *
	 * @param object - The iterable or array-like object to search.
	 *
	 * @param fn - The 3-way comparison function to apply to the values.
	 *   It should return `< 0` if the first value is less than the second.
	 *   `0` if the values are equivalent, or `> 0` if the first value is
	 *   greater than the second.
	 *
	 * @returns The minimum value in the iterable. If multiple values are
	 *   equivalent to the minimum, the left-most value is returned. If
	 *   the iterable is empty, this returns `undefined`.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Example
	 * ```typescript
	 * import { min } from 'phosphor/lib/algorithm/searching';
	 *
	 * function numberCmp(a: number, b: number): number {
	 *   return a - b;
	 * }
	 *
	 * min([7, 4, 0, 3, 9, 4], numberCmp);  // 0
	 * ```
	 */
	function min(object, fn) {
	    var it = iteration_1.iter(object);
	    var result = it.next();
	    if (result === void 0) {
	        return void 0;
	    }
	    var value;
	    while ((value = it.next()) !== void 0) {
	        if (fn(value, result) < 0) {
	            result = value;
	        }
	    }
	    return result;
	}
	exports.min = min;
	/**
	 * Find the maximum value in an iterable.
	 *
	 * @param object - The iterable or array-like object to search.
	 *
	 * @param fn - The 3-way comparison function to apply to the values.
	 *   It should return `< 0` if the first value is less than the second.
	 *   `0` if the values are equivalent, or `> 0` if the first value is
	 *   greater than the second.
	 *
	 * @returns The maximum value in the iterable. If multiple values are
	 *   equivalent to the maximum, the left-most value is returned. If
	 *   the iterable is empty, this returns `undefined`.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Example
	 * ```typescript
	 * import { max } from 'phosphor/lib/algorithm/searching';
	 *
	 * function numberCmp(a: number, b: number): number {
	 *   return a - b;
	 * }
	 *
	 * max([7, 4, 0, 3, 9, 4], numberCmp);  // 9
	 * ```
	 */
	function max(object, fn) {
	    var it = iteration_1.iter(object);
	    var result = it.next();
	    if (result === void 0) {
	        return void 0;
	    }
	    var value;
	    while ((value = it.next()) !== void 0) {
	        if (fn(value, result) > 0) {
	            result = value;
	        }
	    }
	    return result;
	}
	exports.max = max;
	/**
	 * Find the index of the first occurrence of a value in a sequence.
	 *
	 * @param object - The sequence or array-like object to search.
	 *
	 * @param value - The value to locate in the sequence. Values are
	 *   compared using strict `===` equality.
	 *
	 * @param fromIndex - The starting index of the search. The default
	 *   value is `0`.
	 *
	 * @returns The index of the first occurrence of the value, or `-1`
	 *   if the value is not found.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Undefined Behavior
	 * A `fromIndex` which is non-integral or `< 0`.
	 *
	 * #### Example
	 * ```typescript
	 * import { indexOf } from 'phosphor/lib/algorithm/searching';
	 *
	 * let data = ['one', 'two', 'three', 'four', 'one'];
	 * indexOf(data, 'red');     // -1
	 * indexOf(data, 'one');     // 0
	 * indexOf(data, 'one', 1);  // 4
	 * indexOf(data, 'two', 2);  // -1
	 * ```
	 */
	function indexOf(object, value, fromIndex) {
	    var length = object.length;
	    if (length === 0) {
	        return -1;
	    }
	    var start;
	    if (fromIndex === void 0) {
	        start = 0;
	    }
	    else {
	        start = fromIndex;
	    }
	    var seq = sequence_1.asSequence(object);
	    for (var i = start; i < length; ++i) {
	        if (seq.at(i) === value) {
	            return i;
	        }
	    }
	    return -1;
	}
	exports.indexOf = indexOf;
	/**
	 * Find the index of the last occurrence of a value in a sequence.
	 *
	 * @param object - The sequence or array-like object to search.
	 *
	 * @param value - The value to locate in the sequence. Values are
	 *   compared using strict `===` equality.
	 *
	 * @param fromIndex - The starting index of the search. The default
	 *   value is `length - 1`.
	 *
	 * @returns The index of the last occurrence of the value, or `-1`
	 *   if the value is not found.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Undefined Behavior
	 * A `fromIndex` which is non-integral or `>= length`.
	 *
	 * #### Example
	 * ```typescript
	 * import { lastIndexOf } from 'phosphor/lib/algorithm/searching';
	 *
	 * let data = ['one', 'two', 'three', 'four', 'one'];
	 * lastIndexOf(data, 'red');     // -1
	 * lastIndexOf(data, 'one');     // 4
	 * lastIndexOf(data, 'one', 1);  // 0
	 * lastIndexOf(data, 'two', 2);  // 1
	 * ```
	 */
	function lastIndexOf(object, value, fromIndex) {
	    var length = object.length;
	    if (length === 0) {
	        return -1;
	    }
	    var start;
	    if (fromIndex === void 0) {
	        start = length - 1;
	    }
	    else {
	        start = fromIndex;
	    }
	    var seq = sequence_1.asSequence(object);
	    for (var i = start; i >= 0; --i) {
	        if (seq.at(i) === value) {
	            return i;
	        }
	    }
	    return -1;
	}
	exports.lastIndexOf = lastIndexOf;
	/**
	 * Find the index of the first value which matches a predicate.
	 *
	 * @param object - The sequence or array-like object to search.
	 *
	 * @param fn - The predicate function to apply to the values.
	 *
	 * @param fromIndex - The starting index of the search. The default
	 *   value is `0`.
	 *
	 * @returns The index of the first matching value, or `-1` if no
	 *   matching value is found.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Undefined Behavior
	 * A `fromIndex` which is non-integral or `< 0`.
	 *
	 * Modifying the length of the sequence while searching.
	 *
	 * #### Example
	 * ```typescript
	 * import { findIndex } from 'phosphor/lib/algorithm/searching';
	 *
	 * function isEven(value: number): boolean {
	 *   return value % 2 === 0;
	 * }
	 *
	 * let data = [1, 2, 3, 4, 3, 2, 1];
	 * findIndex(data, isEven);     // 1
	 * findIndex(data, isEven, 4);  // 5
	 * findIndex(data, isEven, 6);  // -1
	 * ```
	 */
	function findIndex(object, fn, fromIndex) {
	    var length = object.length;
	    if (length === 0) {
	        return -1;
	    }
	    var start;
	    if (fromIndex === void 0) {
	        start = 0;
	    }
	    else {
	        start = fromIndex;
	    }
	    var seq = sequence_1.asSequence(object);
	    for (var i = start; i < length; ++i) {
	        if (fn(seq.at(i), i)) {
	            return i;
	        }
	    }
	    return -1;
	}
	exports.findIndex = findIndex;
	/**
	 * Find the index of the last value which matches a predicate.
	 *
	 * @param object - The sequence or array-like object to search.
	 *
	 * @param fn - The predicate function to apply to the values.
	 *
	 * @param fromIndex - The starting index of the search. The default
	 *   value is `length - 1`.
	 *
	 * @returns The index of the last matching value, or `-1` if no
	 *   matching value is found.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Undefined Behavior
	 * A `fromIndex` which is non-integral or `>= length`.
	 *
	 * Modifying the length of the sequence while searching.
	 *
	 * #### Example
	 * ```typescript
	 * import { findLastIndex } from 'phosphor/lib/algorithm/searching';
	 *
	 * function isEven(value: number): boolean {
	 *   return value % 2 === 0;
	 * }
	 *
	 * let data = [1, 2, 3, 4, 3, 2, 1];
	 * findLastIndex(data, isEven);     // 5
	 * findLastIndex(data, isEven, 4);  // 3
	 * findLastIndex(data, isEven, 0);  // -1
	 * ```
	 */
	function findLastIndex(object, fn, fromIndex) {
	    var length = object.length;
	    if (length === 0) {
	        return -1;
	    }
	    var start;
	    if (fromIndex === void 0) {
	        start = length - 1;
	    }
	    else {
	        start = fromIndex;
	    }
	    var seq = sequence_1.asSequence(object);
	    for (var i = start; i >= 0; --i) {
	        if (fn(seq.at(i), i)) {
	            return i;
	        }
	    }
	    return -1;
	}
	exports.findLastIndex = findLastIndex;
	/**
	 * Find the index of the first element which compares `>=` to a value.
	 *
	 * @param sequence - The sequence or array-like object to search.
	 *   It must be sorted in ascending order.
	 *
	 * @param value - The value to locate in the sequence.
	 *
	 * @param fn - The 3-way comparison function to apply to the values.
	 *   It should return `< 0` if an element is less than a value, `0` if
	 *   an element is equal to a value, or `> 0` if an element is greater
	 *   than a value.
	 *
	 * @returns The index of the first element which compares `>=` to the
	 *   value, or `length` if there is no such element.
	 *
	 * #### Complexity
	 * Logarithmic.
	 *
	 * #### Undefined Behavior
	 * A sequence which is not sorted in ascending order.
	 *
	 * Modifying the length of the sequence while searching.
	 *
	 * #### Example
	 * ```typescript
	 * import { lowerBound } from 'phosphor/lib/algorithm/searching';
	 *
	 * function numberCmp(a: number, b: number): number {
	 *   return a - b;
	 * }
	 *
	 * let data = [0, 3, 4, 7, 7, 9];
	 * lowerBound(data, 0, numberCmp);   // 0
	 * lowerBound(data, 6, numberCmp);   // 3
	 * lowerBound(data, 7, numberCmp);   // 3
	 * lowerBound(data, -1, numberCmp);  // 0
	 * lowerBound(data, 10, numberCmp);  // 6
	 * ```
	 */
	function lowerBound(object, value, fn) {
	    var n = object.length;
	    if (n === 0) {
	        return 0;
	    }
	    var begin = 0;
	    var half;
	    var middle;
	    var seq = sequence_1.asSequence(object);
	    while (n > 0) {
	        half = n / 2 | 0;
	        middle = begin + half;
	        if (fn(seq.at(middle), value) < 0) {
	            begin = middle + 1;
	            n -= half + 1;
	        }
	        else {
	            n = half;
	        }
	    }
	    return begin;
	}
	exports.lowerBound = lowerBound;
	/**
	 * Find the index of the first element which compares `>` than a value.
	 *
	 * @param sequence - The sequence or array-like object to search.
	 *   It must be sorted in ascending order.
	 *
	 * @param value - The value to locate in the sequence.
	 *
	 * @param fn - The 3-way comparison function to apply to the values.
	 *   It should return `< 0` if an element is less than a value, `0` if
	 *   an element is equal to a value, or `> 0` if an element is greater
	 *   than a value.
	 *
	 * @returns The index of the first element which compares `>` than the
	 *   value, or `length` if there is no such element.
	 *
	 * #### Complexity
	 * Logarithmic.
	 *
	 * #### Undefined Behavior
	 * A sequence which is not sorted in ascending order.
	 *
	 * Modifying the length of the sequence while searching.
	 *
	 * #### Example
	 * ```typescript
	 * import { upperBound } from 'phosphor/lib/algorithm/searching';
	 *
	 * function numberCmp(a: number, b: number): number {
	 *   return a - b;
	 * }
	 *
	 * let data = [0, 3, 4, 7, 7, 9];
	 * upperBound(data, 0, numberCmp);   // 1
	 * upperBound(data, 6, numberCmp);   // 3
	 * upperBound(data, 7, numberCmp);   // 5
	 * upperBound(data, -1, numberCmp);  // 0
	 * upperBound(data, 10, numberCmp);  // 6
	 * ```
	 */
	function upperBound(object, value, fn) {
	    var n = object.length;
	    if (n === 0) {
	        return 0;
	    }
	    var begin = 0;
	    var half;
	    var middle;
	    var seq = sequence_1.asSequence(object);
	    while (n > 0) {
	        half = n / 2 | 0;
	        middle = begin + half;
	        if (fn(seq.at(middle), value) > 0) {
	            n = half;
	        }
	        else {
	            begin = middle + 1;
	            n -= half + 1;
	        }
	    }
	    return begin;
	}
	exports.upperBound = upperBound;
	/**
	 * A namespace which holds string searching functionality.
	 */
	var StringSearch;
	(function (StringSearch) {
	    /**
	     * Compute the sum-of-squares match for the given search text.
	     *
	     * @param sourceText - The text which should be searched.
	     *
	     * @param queryText - The query text to locate in the source text.
	     *
	     * @returns The match result object, or `null` if there is no match.
	     *
	     * #### Complexity
	     * Linear on `sourceText`.
	     *
	     * #### Notes
	     * This scoring algorithm uses a sum-of-squares approach to determine
	     * the score. In order for there to be a match, all of the characters
	     * in `queryText` **must** appear in `sourceText` in order. The index
	     * of each matching character is squared and added to the score. This
	     * means that early and consecutive character matches are preferred.
	     *
	     * The character match is performed with strict equality. It is case
	     * sensitive and does not ignore whitespace. If those behaviors are
	     * required, the text should be transformed before scoring.
	     */
	    function sumOfSquares(sourceText, queryText) {
	        var score = 0;
	        var indices = new Array(queryText.length);
	        for (var i = 0, j = 0, n = queryText.length; i < n; ++i, ++j) {
	            j = sourceText.indexOf(queryText[i], j);
	            if (j === -1) {
	                return null;
	            }
	            indices[i] = j;
	            score += j * j;
	        }
	        return { score: score, indices: indices };
	    }
	    StringSearch.sumOfSquares = sumOfSquares;
	    /**
	     * Highlight the matched characters of a source string.
	     *
	     * @param source - The text which should be highlighted.
	     *
	     * @param indices - The indices of the matched characters. They must
	     *   appear in increasing order and must be in bounds of the source.
	     *
	     * @returns A string with interpolated `<mark>` tags.
	     */
	    function highlight(sourceText, indices) {
	        var k = 0;
	        var last = 0;
	        var result = '';
	        var n = indices.length;
	        while (k < n) {
	            var i = indices[k];
	            var j = indices[k];
	            while (++k < n && indices[k] === j + 1) {
	                j++;
	            }
	            var head = sourceText.slice(last, i);
	            var chunk = sourceText.slice(i, j + 1);
	            result += head + "<mark>" + chunk + "</mark>";
	            last = j + 1;
	        }
	        return result + sourceText.slice(last);
	    }
	    StringSearch.highlight = highlight;
	})(StringSearch = exports.StringSearch || (exports.StringSearch = {}));
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/algorithm/searching.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/algorithm/sequence.js **/
jupyter.define('phosphor@0.7.1/lib/algorithm/sequence.js', function (module, exports, __jupyter_require__) {
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var iteration_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/iteration.js');
	/**
	 * Cast a sequence or array-like object to a sequence.
	 *
	 * @param object - The sequence or array-like object of interest.
	 *
	 * @returns A sequence for the given object.
	 *
	 * #### Notes
	 * This function allows sequence algorithms to operate on user-defined
	 * sequence types and builtin array-like objects in a uniform fashion.
	 */
	function asSequence(object) {
	    var seq;
	    if (typeof object.at === 'function') {
	        seq = object;
	    }
	    else {
	        seq = new ArraySequence(object);
	    }
	    return seq;
	}
	exports.asSequence = asSequence;
	/**
	 * Cast a mutable sequence or array-like object to a mutable sequence.
	 *
	 * @param object - The sequence or array-like object of interest.
	 *
	 * @returns A mutable sequence for the given object.
	 *
	 * #### Notes
	 * This function allows sequence algorithms to operate on user-defined
	 * sequence types and builtin array-like objects in a uniform fashion.
	 */
	function asMutableSequence(object) {
	    var seq;
	    if (typeof object.set === 'function') {
	        seq = object;
	    }
	    else {
	        seq = new MutableArraySequence(object);
	    }
	    return seq;
	}
	exports.asMutableSequence = asMutableSequence;
	/**
	 * A sequence for an array-like object.
	 *
	 * #### Notes
	 * This sequence can be used for any builtin JS array-like object.
	 */
	var ArraySequence = (function () {
	    /**
	     * Construct a new array sequence.
	     *
	     * @param source - The array-like object of interest.
	     */
	    function ArraySequence(source) {
	        this._source = source;
	    }
	    Object.defineProperty(ArraySequence.prototype, "length", {
	        /**
	         * The length of the sequence.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._source.length;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Create an iterator over the object's values.
	     *
	     * @returns A new iterator which traverses the object's values.
	     */
	    ArraySequence.prototype.iter = function () {
	        return new iteration_1.ArrayIterator(this._source, 0);
	    };
	    /**
	     * Get the value at the specified index.
	     *
	     * @param index - The positive integer index of interest.
	     *
	     * @returns The value at the specified index.
	     *
	     * #### Undefined Behavior
	     * An `index` which is non-integral or out of range.
	     */
	    ArraySequence.prototype.at = function (index) {
	        return this._source[index];
	    };
	    return ArraySequence;
	}());
	exports.ArraySequence = ArraySequence;
	/**
	 * A sequence for a mutable array-like object.
	 *
	 * #### Notes
	 * This sequence can be used for any builtin JS array-like object.
	 */
	var MutableArraySequence = (function (_super) {
	    __extends(MutableArraySequence, _super);
	    function MutableArraySequence() {
	        return _super !== null && _super.apply(this, arguments) || this;
	    }
	    /**
	     * Set the value at the specified index.
	     *
	     * @param index - The positive integer index of interest.
	     *
	     * @param value - The value to set at the specified index.
	     *
	     * #### Undefined Behavior
	     * An `index` which is non-integral or out of range.
	     */
	    MutableArraySequence.prototype.set = function (index, value) {
	        this._source[index] = value;
	    };
	    return MutableArraySequence;
	}(ArraySequence));
	exports.MutableArraySequence = MutableArraySequence;
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/algorithm/sequence.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/ui/panel.js **/
jupyter.define('phosphor@0.7.1/lib/ui/panel.js', function (module, exports, __jupyter_require__) {
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var iteration_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/iteration.js');
	var mutation_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/mutation.js');
	var searching_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/searching.js');
	var vector_1 = __jupyter_require__('phosphor@0.7.1/lib/collections/vector.js');
	var messaging_1 = __jupyter_require__('phosphor@0.7.1/lib/core/messaging.js');
	var widget_1 = __jupyter_require__('phosphor@0.7.1/lib/ui/widget.js');
	/**
	 * The class name added to Panel instances.
	 */
	var PANEL_CLASS = 'p-Panel';
	/**
	 * A simple and convenient panel widget class.
	 *
	 * #### Notes
	 * This class is suitable as a base class for implementing a variety of
	 * convenience panel widgets, but can also be used directly with CSS to
	 * arrange a collection of widgets.
	 *
	 * This class provides a convenience wrapper around a [[PanelLayout]].
	 */
	var Panel = (function (_super) {
	    __extends(Panel, _super);
	    /**
	     * Construct a new panel.
	     *
	     * @param options - The options for initializing the panel.
	     */
	    function Panel(options) {
	        if (options === void 0) { options = {}; }
	        var _this = _super.call(this) || this;
	        _this.addClass(PANEL_CLASS);
	        _this.layout = Private.createLayout(options);
	        return _this;
	    }
	    Object.defineProperty(Panel.prototype, "widgets", {
	        /**
	         * A read-only sequence of the widgets in the panel.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this.layout.widgets;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Add a widget to the end of the panel.
	     *
	     * @param widget - The widget to add to the panel.
	     *
	     * #### Notes
	     * If the is already contained in the panel, it will be moved.
	     */
	    Panel.prototype.addWidget = function (widget) {
	        this.layout.addWidget(widget);
	    };
	    /**
	     * Insert a widget at the specified index.
	     *
	     * @param index - The index at which to insert the widget.
	     *
	     * @param widget - The widget to insert into to the panel.
	     *
	     * #### Notes
	     * If the widget is already contained in the panel, it will be moved.
	     */
	    Panel.prototype.insertWidget = function (index, widget) {
	        this.layout.insertWidget(index, widget);
	    };
	    return Panel;
	}(widget_1.Widget));
	exports.Panel = Panel;
	/**
	 * A concrete layout implementation suitable for many use cases.
	 *
	 * #### Notes
	 * This class is suitable as a base class for implementing a variety of
	 * layouts, but can also be used directly with standard CSS to layout a
	 * collection of widgets.
	 */
	var PanelLayout = (function (_super) {
	    __extends(PanelLayout, _super);
	    function PanelLayout() {
	        var _this = _super !== null && _super.apply(this, arguments) || this;
	        _this._widgets = new vector_1.Vector();
	        return _this;
	    }
	    /**
	     * Dispose of the resources held by the layout.
	     *
	     * #### Notes
	     * This will clear and dispose all widgets in the layout.
	     *
	     * All reimplementations should call the superclass method.
	     *
	     * This method is called automatically when the parent is disposed.
	     */
	    PanelLayout.prototype.dispose = function () {
	        while (this._widgets.length > 0) {
	            this._widgets.popBack().dispose();
	        }
	        _super.prototype.dispose.call(this);
	    };
	    Object.defineProperty(PanelLayout.prototype, "widgets", {
	        /**
	         * A read-only sequence of the widgets in the layout.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._widgets;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Create an iterator over the widgets in the layout.
	     *
	     * @returns A new iterator over the widgets in the layout.
	     */
	    PanelLayout.prototype.iter = function () {
	        return this._widgets.iter();
	    };
	    /**
	     * Add a widget to the end of the layout.
	     *
	     * @param widget - The widget to add to the layout.
	     *
	     * #### Notes
	     * If the widget is already contained in the layout, it will be moved.
	     */
	    PanelLayout.prototype.addWidget = function (widget) {
	        this.insertWidget(this._widgets.length, widget);
	    };
	    /**
	     * Insert a widget into the layout at the specified index.
	     *
	     * @param index - The index at which to insert the widget.
	     *
	     * @param widget - The widget to insert into the layout.
	     *
	     * #### Notes
	     * The index will be clamped to the bounds of the widgets.
	     *
	     * If the widget is already added to the layout, it will be moved.
	     */
	    PanelLayout.prototype.insertWidget = function (index, widget) {
	        // Remove the widget from its current parent. This is a no-op
	        // if the widget's parent is already the layout parent widget.
	        widget.parent = this.parent;
	        // Look up the current index of the widget.
	        var i = searching_1.indexOf(this._widgets, widget);
	        // Clamp the insert index to the vector bounds.
	        var j = Math.max(0, Math.min(Math.floor(index), this._widgets.length));
	        // If the widget is not in the vector, insert it.
	        if (i === -1) {
	            // Insert the widget into the vector.
	            this._widgets.insert(j, widget);
	            // If the layout is parented, attach the widget to the DOM.
	            if (this.parent)
	                this.attachWidget(j, widget);
	            // There is nothing more to do.
	            return;
	        }
	        // Otherwise, the widget exists in the vector and should be moved.
	        // Adjust the index if the location is at the end of the vector.
	        if (j === this._widgets.length)
	            j--;
	        // Bail if there is no effective move.
	        if (i === j)
	            return;
	        // Move the widget to the new location.
	        mutation_1.move(this._widgets, i, j);
	        // If the layout is parented, move the widget in the DOM.
	        if (this.parent)
	            this.moveWidget(i, j, widget);
	    };
	    /**
	     * Remove a widget from the layout.
	     *
	     * @param widget - The widget to remove from the layout.
	     *
	     * #### Notes
	     * A widget is automatically removed from the layout when its `parent`
	     * is set to `null`. This method should only be invoked directly when
	     * removing a widget from a layout which has yet to be installed on a
	     * parent widget.
	     *
	     * This method does *not* modify the widget's `parent`.
	     */
	    PanelLayout.prototype.removeWidget = function (widget) {
	        this.removeWidgetAt(searching_1.indexOf(this._widgets, widget));
	    };
	    /**
	     * Remove the widget at a given index from the layout.
	     *
	     * @param index - The index of the widget to remove.
	     *
	     * #### Notes
	     * A widget is automatically removed from the layout when its `parent`
	     * is set to `null`. This method should only be invoked directly when
	     * removing a widget from a layout which has yet to be installed on a
	     * parent widget.
	     *
	     * This method does *not* modify the widget's `parent`.
	     */
	    PanelLayout.prototype.removeWidgetAt = function (index) {
	        // Bail if the index is out of range.
	        var i = Math.floor(index);
	        if (i < 0 || i >= this._widgets.length) {
	            return;
	        }
	        // Remove the widget from the vector.
	        var widget = this._widgets.removeAt(i);
	        // If the layout is parented, detach the widget from the DOM.
	        if (this.parent)
	            this.detachWidget(i, widget);
	    };
	    /**
	     * Perform layout initialization which requires the parent widget.
	     */
	    PanelLayout.prototype.init = function () {
	        var _this = this;
	        _super.prototype.init.call(this);
	        var index = 0;
	        iteration_1.each(this, function (widget) { _this.attachWidget(index++, widget); });
	    };
	    /**
	     * Attach a widget to the parent's DOM node.
	     *
	     * @param index - The current index of the widget in the layout.
	     *
	     * @param widget - The widget to attach to the parent.
	     *
	     * #### Notes
	     * This method is called automatically by the panel layout at the
	     * appropriate time. It should not be called directly by user code.
	     *
	     * The default implementation adds the widgets's node to the parent's
	     * node at the proper location, and sends an `'after-attach'` message
	     * to the widget if the parent is attached to the DOM.
	     *
	     * Subclasses may reimplement this method to control how the widget's
	     * node is added to the parent's node, but the reimplementation must
	     * send an `'after-attach'` message to the widget if the parent is
	     * attached to the DOM.
	     */
	    PanelLayout.prototype.attachWidget = function (index, widget) {
	        // Look up the next sibling reference node.
	        var ref = this.parent.node.children[index];
	        // Insert the widget's node before the sibling.
	        this.parent.node.insertBefore(widget.node, ref);
	        // Send an `'after-attach'` message if the parent is attached.
	        if (this.parent.isAttached)
	            messaging_1.sendMessage(widget, widget_1.WidgetMessage.AfterAttach);
	    };
	    /**
	     * Move a widget in the parent's DOM node.
	     *
	     * @param fromIndex - The previous index of the widget in the layout.
	     *
	     * @param toIndex - The current index of the widget in the layout.
	     *
	     * @param widget - The widget to move in the parent.
	     *
	     * #### Notes
	     * This method is called automatically by the panel layout at the
	     * appropriate time. It should not be called directly by user code.
	     *
	     * The default implementation moves the widget's node to the proper
	     * location in the parent's node and sends both a `'before-detach'`
	     * and an `'after-attach'` message to the widget if the parent is
	     * attached to the DOM.
	     *
	     * Subclasses may reimplement this method to control how the widget's
	     * node is moved in the parent's node, but the reimplementation must
	     * send both a `'before-detach'` and an `'after-attach'` message to
	     * the widget if the parent is attached to the DOM.
	     */
	    PanelLayout.prototype.moveWidget = function (fromIndex, toIndex, widget) {
	        // Send a `'before-detach'` message if the parent is attached.
	        if (this.parent.isAttached)
	            messaging_1.sendMessage(widget, widget_1.WidgetMessage.BeforeDetach);
	        // Remove the widget's node from the parent.
	        this.parent.node.removeChild(widget.node);
	        // Look up the next sibling reference node.
	        var ref = this.parent.node.children[toIndex];
	        // Insert the widget's node before the sibling.
	        this.parent.node.insertBefore(widget.node, ref);
	        // Send an `'after-attach'` message if the parent is attached.
	        if (this.parent.isAttached)
	            messaging_1.sendMessage(widget, widget_1.WidgetMessage.AfterAttach);
	    };
	    /**
	     * Detach a widget from the parent's DOM node.
	     *
	     * @param index - The previous index of the widget in the layout.
	     *
	     * @param widget - The widget to detach from the parent.
	     *
	     * #### Notes
	     * This method is called automatically by the panel layout at the
	     * appropriate time. It should not be called directly by user code.
	     *
	     * The default implementation removes the widget's node from the
	     * parent's node, and sends a `'before-detach'` message to the widget
	     * if the parent is attached to the DOM.
	     *
	     * Subclasses may reimplement this method to control how the widget's
	     * node is removed from the parent's node, but the reimplementation
	     * must send a `'before-detach'` message to the widget if the parent
	     * is attached to the DOM.
	     */
	    PanelLayout.prototype.detachWidget = function (index, widget) {
	        // Send a `'before-detach'` message if the parent is attached.
	        if (this.parent.isAttached)
	            messaging_1.sendMessage(widget, widget_1.WidgetMessage.BeforeDetach);
	        // Remove the widget's node from the parent.
	        this.parent.node.removeChild(widget.node);
	    };
	    return PanelLayout;
	}(widget_1.Layout));
	exports.PanelLayout = PanelLayout;
	/**
	 * The namespace for the private module data.
	 */
	var Private;
	(function (Private) {
	    /**
	     * Create a panel layout for the given panel options.
	     */
	    function createLayout(options) {
	        return options.layout || new PanelLayout();
	    }
	    Private.createLayout = createLayout;
	})(Private || (Private = {}));
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/ui/panel.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/algorithm/mutation.js **/
jupyter.define('phosphor@0.7.1/lib/algorithm/mutation.js', function (module, exports, __jupyter_require__) {
	"use strict";
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var sequence_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/sequence.js');
	/**
	 * Move an element in a sequence from one index to another.
	 *
	 * @param object - The sequence or array-like object to mutate.
	 *
	 * @param fromIndex - The index of the element to move.
	 *
	 * @param toIndex - The target index of the element.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Undefined Behavior
	 * A `fromIndex` which is non-integral or out of range.
	 *
	 * A `toIndex` which is non-integral or out of range.
	 *
	 * #### Example
	 * ```typescript
	 * import { move } from 'phosphor/lib/algorithm/mutation';
	 *
	 * let data = [0, 1, 2, 3, 4];
	 * move(data, 1, 2);  // [0, 2, 1, 3, 4]
	 * move(data, 4, 2);  // [0, 2, 4, 1, 3]
	 * ```
	 */
	function move(object, fromIndex, toIndex) {
	    if (object.length <= 1 || fromIndex === toIndex) {
	        return;
	    }
	    var d = fromIndex < toIndex ? 1 : -1;
	    var seq = sequence_1.asMutableSequence(object);
	    var value = seq.at(fromIndex);
	    for (var i = fromIndex; i !== toIndex; i += d) {
	        seq.set(i, seq.at(i + d));
	    }
	    seq.set(toIndex, value);
	}
	exports.move = move;
	/**
	 * Reverse a sequence in-place subject to an optional range.
	 *
	 * @param object - The sequence or array-like object to mutate.
	 *
	 * @param first - The index of the first element of the range. This
	 *   should be `<=` the `last` index. The default is `0`.
	 *
	 * @param last - The index of the last element of the range. This
	 *   should be `>=` the `first` index. The default is `length - 1`.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Undefined Behavior
	 * A `first` index which is non-integral or out of range.
	 *
	 * A `last` index which is non-integral or out of range.
	 *
	 * #### Example
	 * ```typescript
	 * import { reverse } from 'phosphor/lib/algorithm/mutation';
	 *
	 * let data = [0, 1, 2, 3, 4];
	 * reverse(data, 1, 3);  // [0, 3, 2, 1, 4]
	 * reverse(data, 3);     // [0, 3, 2, 4, 1]
	 * reverse(data);        // [1, 4, 2, 3, 0]
	 * ```
	 */
	function reverse(object, first, last) {
	    var length = object.length;
	    if (length <= 1) {
	        return;
	    }
	    if (first === void 0) {
	        first = 0;
	    }
	    if (last === void 0) {
	        last = length - 1;
	    }
	    if (first >= last) {
	        return;
	    }
	    var seq = sequence_1.asMutableSequence(object);
	    while (first < last) {
	        var front = seq.at(first);
	        var back = seq.at(last);
	        seq.set(first++, back);
	        seq.set(last--, front);
	    }
	}
	exports.reverse = reverse;
	/**
	 * Rotate the elements of a sequence by a positive or negative amount.
	 *
	 * @param object - The sequence or array-like object to mutate.
	 *
	 * @param delta - The amount of rotation to apply to the elements. A
	 *   positive value will rotate the elements to the left. A negative
	 *   value will rotate the elements to the right.
	 *
	 * #### Complexity
	 * Linear.
	 *
	 * #### Undefined Behavior
	 * A `delta` amount which is non-integral.
	 *
	 * #### Example
	 * ```typescript
	 * import { rotate } from 'phosphor/lib/algorithm/mutation';
	 *
	 * let data = [0, 1, 2, 3, 4];
	 * rotate(data, 2);   // [2, 3, 4, 0, 1]
	 * rotate(data, -2);  // [0, 1, 2, 3, 4]
	 * rotate(data, 10);  // [0, 1, 2, 3, 4]
	 * rotate(data, 9);   // [4, 0, 1, 2, 3]
	 * ```
	 */
	function rotate(object, delta) {
	    var length = object.length;
	    if (length <= 1) {
	        return;
	    }
	    if (delta > 0) {
	        delta = delta % length;
	    }
	    else if (delta < 0) {
	        delta = ((delta % length) + length) % length;
	    }
	    if (delta === 0) {
	        return;
	    }
	    var seq = sequence_1.asMutableSequence(object);
	    reverse(seq, 0, delta - 1);
	    reverse(seq, delta, length - 1);
	    reverse(seq, 0, length - 1);
	}
	exports.rotate = rotate;
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/algorithm/mutation.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/collections/vector.js **/
jupyter.define('phosphor@0.7.1/lib/collections/vector.js', function (module, exports, __jupyter_require__) {
	"use strict";
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var iteration_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/iteration.js');
	/**
	 * A generic vector data structure.
	 */
	var Vector = (function () {
	    /**
	     * Construct a new vector.
	     *
	     * @param values - The initial values for the vector.
	     */
	    function Vector(values) {
	        var _this = this;
	        this._array = [];
	        if (values)
	            iteration_1.each(values, function (value) { _this.pushBack(value); });
	    }
	    Object.defineProperty(Vector.prototype, "isEmpty", {
	        /**
	         * Test whether the vector is empty.
	         *
	         * @returns `true` if the vector is empty, `false` otherwise.
	         *
	         * #### Notes
	         * This is a read-only property.
	         *
	         * #### Complexity
	         * Constant.
	         *
	         * #### Iterator Validity
	         * No changes.
	         */
	        get: function () {
	            return this._array.length === 0;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Vector.prototype, "length", {
	        /**
	         * Get the length of the vector.
	         *
	         * @return The number of values in the vector.
	         *
	         * #### Notes
	         * This is a read-only property.
	         *
	         * #### Complexity
	         * Constant.
	         *
	         * #### Iterator Validity
	         * No changes.
	         */
	        get: function () {
	            return this._array.length;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Vector.prototype, "front", {
	        /**
	         * Get the value at the front of the vector.
	         *
	         * @returns The value at the front of the vector, or `undefined` if
	         *   the vector is empty.
	         *
	         * #### Notes
	         * This is a read-only property.
	         *
	         * #### Complexity
	         * Constant.
	         *
	         * #### Iterator Validity
	         * No changes.
	         */
	        get: function () {
	            return this._array[0];
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Vector.prototype, "back", {
	        /**
	         * Get the value at the back of the vector.
	         *
	         * @returns The value at the back of the vector, or `undefined` if
	         *   the vector is empty.
	         *
	         * #### Notes
	         * This is a read-only property.
	         *
	         * #### Complexity
	         * Constant.
	         *
	         * #### Iterator Validity
	         * No changes.
	         */
	        get: function () {
	            return this._array[this._array.length - 1];
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Create an iterator over the values in the vector.
	     *
	     * @returns A new iterator starting at the front of the vector.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * No changes.
	     */
	    Vector.prototype.iter = function () {
	        return new iteration_1.ArrayIterator(this._array, 0);
	    };
	    /**
	     * Get the value at the specified index.
	     *
	     * @param index - The positive integer index of interest.
	     *
	     * @returns The value at the specified index.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * No changes.
	     *
	     * #### Undefined Behavior
	     * An `index` which is non-integral or out of range.
	     */
	    Vector.prototype.at = function (index) {
	        return this._array[index];
	    };
	    /**
	     * Set the value at the specified index.
	     *
	     * @param index - The positive integer index of interest.
	     *
	     * @param value - The value to set at the specified index.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * No changes.
	     *
	     * #### Undefined Behavior
	     * An `index` which is non-integral or out of range.
	     */
	    Vector.prototype.set = function (index, value) {
	        this._array[index] = value;
	    };
	    /**
	     * Add a value to the back of the vector.
	     *
	     * @param value - The value to add to the back of the vector.
	     *
	     * @returns The new length of the vector.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * No changes.
	     */
	    Vector.prototype.pushBack = function (value) {
	        return this._array.push(value);
	    };
	    /**
	     * Remove and return the value at the back of the vector.
	     *
	     * @returns The value at the back of the vector, or `undefined` if
	     *   the vector is empty.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * Iterators pointing at the removed value are invalidated.
	     */
	    Vector.prototype.popBack = function () {
	        return this._array.pop();
	    };
	    /**
	     * Insert a value into the vector at a specific index.
	     *
	     * @param index - The index at which to insert the value.
	     *
	     * @param value - The value to set at the specified index.
	     *
	     * @returns The new length of the vector.
	     *
	     * #### Complexity
	     * Linear.
	     *
	     * #### Iterator Validity
	     * No changes.
	     *
	     * #### Notes
	     * The `index` will be clamped to the bounds of the vector.
	     *
	     * #### Undefined Behavior
	     * An `index` which is non-integral.
	     */
	    Vector.prototype.insert = function (index, value) {
	        var array = this._array;
	        var n = array.length;
	        index = Math.max(0, Math.min(index, n));
	        for (var i = n; i > index; --i) {
	            array[i] = array[i - 1];
	        }
	        array[index] = value;
	        return n + 1;
	    };
	    /**
	     * Remove the first occurrence of a value from the vector.
	     *
	     * @param value - The value of interest.
	     *
	     * @returns The index of the removed value, or `-1` if the value
	     *   is not contained in the vector.
	     *
	     * #### Complexity
	     * Linear.
	     *
	     * #### Iterator Validity
	     * Iterators pointing at the removed value and beyond are invalidated.
	     *
	     * #### Notes
	     * Comparison is performed using strict `===` equality.
	     */
	    Vector.prototype.remove = function (value) {
	        var index = this._array.indexOf(value);
	        if (index !== -1)
	            this.removeAt(index);
	        return index;
	    };
	    /**
	     * Remove and return the value at a specific index.
	     *
	     * @param index - The index of the value of interest.
	     *
	     * @returns The value at the specified index, or `undefined` if the
	     *   index is out of range.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * Iterators pointing at the removed value and beyond are invalidated.
	     *
	     * #### Undefined Behavior
	     * An `index` which is non-integral.
	     */
	    Vector.prototype.removeAt = function (index) {
	        var array = this._array;
	        var n = array.length;
	        if (index < 0 || index >= n) {
	            return void 0;
	        }
	        var value = array[index];
	        for (var i = index + 1; i < n; ++i) {
	            array[i - 1] = array[i];
	        }
	        array.length = n - 1;
	        return value;
	    };
	    /**
	     * Remove all values from the vector.
	     *
	     * #### Complexity
	     * Linear.
	     *
	     * #### Iterator Validity
	     * All current iterators are invalidated.
	     */
	    Vector.prototype.clear = function () {
	        this._array.length = 0;
	    };
	    /**
	     * Swap the contents of the vector with the contents of another.
	     *
	     * @param other - The other vector holding the contents to swap.
	     *
	     * #### Complexity
	     * Constant.
	     *
	     * #### Iterator Validity
	     * All current iterators remain valid, but will now point to the
	     * contents of the other vector involved in the swap.
	     */
	    Vector.prototype.swap = function (other) {
	        var array = other._array;
	        other._array = this._array;
	        this._array = array;
	    };
	    return Vector;
	}());
	exports.Vector = Vector;
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/collections/vector.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_image.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_image.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var ImageModel = (function (_super) {
	    __extends(ImageModel, _super);
	    function ImageModel() {
	        _super.apply(this, arguments);
	    }
	    ImageModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'ImageModel',
	            _view_name: 'ImageView',
	            format: 'png',
	            width: '',
	            height: '',
	            _b64value: ''
	        });
	    };
	    return ImageModel;
	}(widget_core_1.CoreDOMWidgetModel));
	exports.ImageModel = ImageModel;
	var ImageView = (function (_super) {
	    __extends(ImageView, _super);
	    function ImageView() {
	        _super.apply(this, arguments);
	    }
	    ImageView.prototype.render = function () {
	        /**
	         * Called when view is rendered.
	         */
	        this.pWidget.addClass('jupyter-widgets');
	        this.pWidget.addClass('widget-image');
	        this.update(); // Set defaults.
	    };
	    ImageView.prototype.update = function () {
	        /**
	         * Update the contents of this view
	         *
	         * Called when the model is changed.  The model may have been
	         * changed by another view or by a state update from the back-end.
	         */
	        var image_src = 'data:image/' + this.model.get('format') + ';base64,' + this.model.get('_b64value');
	        this.el.setAttribute('src', image_src);
	        var width = this.model.get('width');
	        if (width !== undefined && width.length > 0) {
	            this.el.setAttribute('width', width);
	        }
	        else {
	            this.el.removeAttribute('width');
	        }
	        var height = this.model.get('height');
	        if (height !== undefined && height.length > 0) {
	            this.el.setAttribute('height', height);
	        }
	        else {
	            this.el.removeAttribute('height');
	        }
	        return _super.prototype.update.call(this);
	    };
	    Object.defineProperty(ImageView.prototype, "tagName", {
	        /**
	         * The default tag name.
	         *
	         * #### Notes
	         * This is a read-only attribute.
	         */
	        get: function () {
	            // We can't make this an attribute with a default value
	            // since it would be set after it is needed in the
	            // constructor.
	            return 'img';
	        },
	        enumerable: true,
	        configurable: true
	    });
	    return ImageView;
	}(widget_1.DOMWidgetView));
	exports.ImageView = ImageView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_image.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_color.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_color.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var ColorPickerModel = (function (_super) {
	    __extends(ColorPickerModel, _super);
	    function ColorPickerModel() {
	        _super.apply(this, arguments);
	    }
	    ColorPickerModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            value: 'black',
	            concise: false,
	            _model_name: 'ColorPickerModel',
	            _view_name: 'ColorPickerView'
	        });
	    };
	    return ColorPickerModel;
	}(widget_core_1.CoreLabeledDOMWidgetModel));
	exports.ColorPickerModel = ColorPickerModel;
	var ColorPickerView = (function (_super) {
	    __extends(ColorPickerView, _super);
	    function ColorPickerView() {
	        _super.apply(this, arguments);
	    }
	    ColorPickerView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-colorpicker');
	        this._color_container = document.createElement('div');
	        this._color_container.className = 'widget-inline-hbox widget-colorpicker-input';
	        this.el.appendChild(this._color_container);
	        this._textbox = document.createElement('input');
	        this._textbox.setAttribute('type', 'text');
	        this._color_container.appendChild(this._textbox);
	        this._textbox.value = this.model.get('value');
	        this._colorpicker = document.createElement('input');
	        this._colorpicker.setAttribute('type', 'color');
	        this._color_container.appendChild(this._colorpicker);
	        this.listenTo(this.model, 'change:value', this._update_value);
	        this.listenTo(this.model, 'change:concise', this._update_concise);
	        this._update_concise();
	        this._update_value();
	    };
	    ColorPickerView.prototype.events = function () {
	        return {
	            'change [type="color"]': '_picker_change',
	            'change [type="text"]': '_text_change'
	        };
	    };
	    ColorPickerView.prototype._update_value = function () {
	        var value = this.model.get('value');
	        this._colorpicker.value = color2hex(value);
	        this._textbox.value = value;
	    };
	    ColorPickerView.prototype._update_concise = function () {
	        var concise = this.model.get('concise');
	        if (concise) {
	            this.el.classList.add('concise');
	            this._textbox.style.display = 'none';
	        }
	        else {
	            this.el.classList.remove('concise');
	            this._textbox.style.display = '';
	        }
	    };
	    ColorPickerView.prototype._picker_change = function () {
	        this.model.set('value', this._colorpicker.value);
	        this.touch();
	    };
	    ColorPickerView.prototype._text_change = function () {
	        var value = this._validate_color(this._textbox.value, this.model.get('value'));
	        this.model.set('value', value);
	        this.touch();
	    };
	    ColorPickerView.prototype._validate_color = function (color, fallback) {
	        return color.match(/#[a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?$/) ||
	            named_colors[color.toLowerCase()] ? color : fallback;
	    };
	    return ColorPickerView;
	}(widget_1.LabeledDOMWidgetView));
	exports.ColorPickerView = ColorPickerView;
	var named_colors = { aliceblue: '#f0f8ff', antiquewhite: '#faebd7', aqua: '#00ffff', aquamarine: '#7fffd4', azure: '#f0ffff', beige: '#f5f5dc', bisque: '#ffe4c4', black: '#000000', blanchedalmond: '#ffebcd', blue: '#0000ff', blueviolet: '#8a2be2', brown: '#a52a2a', burlywood: '#deb887', cadetblue: '#5f9ea0', chartreuse: '#7fff00', chocolate: '#d2691e', coral: '#ff7f50', cornflowerblue: '#6495ed', cornsilk: '#fff8dc', crimson: '#dc143c', cyan: '#00ffff', darkblue: '#00008b', darkcyan: '#008b8b', darkgoldenrod: '#b8860b', darkgray: '#a9a9a9', darkgrey: '#a9a9a9', darkgreen: '#006400', 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: '#ff00ff', gainsboro: '#dcdcdc', ghostwhite: '#f8f8ff', gold: '#ffd700', goldenrod: '#daa520', gray: '#808080', grey: '#808080', green: '#008000', greenyellow: '#adff2f', 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', lightgreen: '#90ee90', lightgray: '#d3d3d3', lightgrey: '#d3d3d3', lightpink: '#ffb6c1', lightsalmon: '#ffa07a', lightseagreen: '#20b2aa', lightskyblue: '#87cefa', lightslategray: '#778899', lightslategrey: '#778899', lightsteelblue: '#b0c4de', lightyellow: '#ffffe0', lime: '#00ff00', limegreen: '#32cd32', linen: '#faf0e6', magenta: '#ff00ff', 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', red: '#ff0000', 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: '#ffffff', whitesmoke: '#f5f5f5', yellow: '#ffff00', yellowgreen: '#9acd32', };
	/*
	 * From a valid html color (named color, 6-digits or 3-digits hex format)
	 * return a 6-digits hexadecimal color #rrggbb.
	 */
	function color2hex(color) {
	    return named_colors[color.toLowerCase()] || rgb3_to_rgb6(color);
	}
	function rgb3_to_rgb6(rgb) {
	    if (rgb.length === 7) {
	        return rgb;
	    }
	    else {
	        return '#' + rgb.charAt(1) + rgb.charAt(1) +
	            rgb.charAt(2) + rgb.charAt(2) +
	            rgb.charAt(3) + rgb.charAt(3);
	    }
	}
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_color.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_date.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_date.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	function serialize_datetime(value, manager) {
	    if (value === null) {
	        return null;
	    }
	    else {
	        value = new Date(value);
	        return {
	            year: value.getFullYear(),
	            month: value.getMonth(),
	            date: value.getDate(),
	            hours: value.getHours(),
	            minutes: value.getMinutes(),
	            seconds: value.getSeconds(),
	            milliseconds: value.getMilliseconds()
	        };
	    }
	}
	exports.serialize_datetime = serialize_datetime;
	;
	function deserialize_datetime(value, manager) {
	    if (value === null) {
	        return null;
	    }
	    else {
	        return new Date(value.year, value.month, value.date, value.hours, value.minutes, value.seconds, value.milliseconds);
	    }
	}
	exports.deserialize_datetime = deserialize_datetime;
	;
	function createDateAsUTC(date) {
	    if (date === null) {
	        return null;
	    }
	    else {
	        return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
	    }
	}
	function convertDateToUTC(date) {
	    if (date === null) {
	        return null;
	    }
	    else {
	        return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());
	    }
	}
	var DatePickerModel = (function (_super) {
	    __extends(DatePickerModel, _super);
	    function DatePickerModel() {
	        _super.apply(this, arguments);
	    }
	    DatePickerModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            value: null,
	            _model_name: 'DatePickerModel',
	            _view_name: 'DatePickerView'
	        });
	    };
	    DatePickerModel.serializers = _.extend({
	        value: {
	            serialize: serialize_datetime,
	            deserialize: deserialize_datetime
	        }
	    }, widget_core_1.CoreLabeledDOMWidgetModel.serializers);
	    return DatePickerModel;
	}(widget_core_1.CoreLabeledDOMWidgetModel));
	exports.DatePickerModel = DatePickerModel;
	var DatePickerView = (function (_super) {
	    __extends(DatePickerView, _super);
	    function DatePickerView() {
	        _super.apply(this, arguments);
	    }
	    DatePickerView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-datepicker');
	        this._datepicker = document.createElement('input');
	        this._datepicker.setAttribute('type', 'date');
	        this.el.appendChild(this._datepicker);
	        this.listenTo(this.model, 'change:value', this._update_value);
	        this._update_value();
	    };
	    DatePickerView.prototype.events = function () {
	        return {
	            'change [type="date"]': '_picker_change',
	        };
	    };
	    DatePickerView.prototype._update_value = function () {
	        var value = this.model.get('value');
	        this._datepicker.valueAsDate = createDateAsUTC(value);
	    };
	    DatePickerView.prototype._picker_change = function () {
	        this.model.set('value', convertDateToUTC(this._datepicker.valueAsDate));
	        this.touch();
	    };
	    return DatePickerView;
	}(widget_1.LabeledDOMWidgetView));
	exports.DatePickerView = DatePickerView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_date.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/services-shim.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/services-shim.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var utils = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/utils.js');
	var shims;
	(function (shims) {
	    var services;
	    (function (services) {
	        /**
	         * Public constructor
	         * @param jsServicesKernel - @jupyterlab/services Kernel.IKernel instance
	         */
	        var CommManager = (function () {
	            function CommManager(jsServicesKernel) {
	                /**
	                 * Register a comm in the mapping
	                 */
	                this.register_comm = function (comm) {
	                    this.comms[comm.comm_id] = Promise.resolve(comm);
	                    comm.kernel = this.kernel;
	                    return comm.comm_id;
	                };
	                this.targets = Object.create(null);
	                this.comms = Object.create(null);
	                this.kernel = null;
	                this.jsServicesKernel = null;
	                this.init_kernel(jsServicesKernel);
	            }
	            ;
	            /**
	             * Hookup kernel events.
	             * @param  {Kernel.IKernel} jsServicesKernel - @jupyterlab/services Kernel.IKernel instance
	             */
	            CommManager.prototype.init_kernel = function (jsServicesKernel) {
	                this.kernel = jsServicesKernel; // These aren't really the same.
	                this.jsServicesKernel = jsServicesKernel;
	            };
	            ;
	            /**
	             * Creates a new connected comm
	             * @param  {string} target_name
	             * @param  {object} data
	             * @param  {object} callbacks
	             * @param  {object} metadata
	             * @param  {string} comm_id
	             * @return {Comm}
	             */
	            CommManager.prototype.new_comm = function (target_name, data, callbacks, metadata, comm_id) {
	                var comm = new Comm(this.jsServicesKernel.connectToComm(target_name, comm_id));
	                this.register_comm(comm);
	                comm.open(data, callbacks, metadata);
	                return comm;
	            };
	            ;
	            /**
	             * Register a comm target
	             * @param  {string} target_name
	             * @param  {(Comm, object) => void} f - callback that is called when the
	             *                         comm is made.  Signature of f(comm, msg).
	             */
	            CommManager.prototype.register_target = function (target_name, f) {
	                var _this = this;
	                var handle = this.jsServicesKernel.registerCommTarget(target_name, function (jsServicesComm, msg) {
	                    // Create the comm.
	                    var comm = new Comm(jsServicesComm);
	                    _this.register_comm(comm);
	                    // Call the callback for the comm.
	                    try {
	                        return f(comm, msg);
	                    }
	                    catch (e) {
	                        comm.close();
	                        var wrapped_error = new utils.WrappedError('Exception opening new comm', e);
	                        console.error(wrapped_error);
	                        return;
	                    }
	                });
	                this.targets[target_name] = handle;
	            };
	            ;
	            /**
	             * Unregisters a comm target
	             * @param  {string} target_name
	             */
	            CommManager.prototype.unregister_target = function (target_name, f) {
	                var handle = this.targets[target_name];
	                handle.dispose();
	                delete this.targets[target_name];
	            };
	            ;
	            return CommManager;
	        }());
	        services.CommManager = CommManager;
	        /**
	         * Public constructor
	         * @param  {IComm} jsServicesComm - @jupyterlab/services IComm instance
	         */
	        var Comm = (function () {
	            function Comm(jsServicesComm) {
	                this.jsServicesComm = null;
	                this.jsServicesComm = jsServicesComm;
	            }
	            Object.defineProperty(Comm.prototype, "comm_id", {
	                /**
	                 * Comm id
	                 * @return {string}
	                 */
	                get: function () {
	                    return this.jsServicesComm.commId;
	                },
	                enumerable: true,
	                configurable: true
	            });
	            Object.defineProperty(Comm.prototype, "target_name", {
	                /**
	                 * Target name
	                 * @return {string}
	                 */
	                get: function () {
	                    return this.jsServicesComm.targetName;
	                },
	                enumerable: true,
	                configurable: true
	            });
	            /**
	             * Opens a sibling comm in the backend
	             * @param  data
	             * @param  callbacks
	             * @param  metadata
	             * @return msg id
	             */
	            Comm.prototype.open = function (data, callbacks, metadata) {
	                var future = this.jsServicesComm.open(data, metadata);
	                this._hookupCallbacks(future, callbacks);
	                return future.msg.header.msg_id;
	            };
	            ;
	            /**
	             * Sends a message to the sibling comm in the backend
	             * @param  data
	             * @param  callbacks
	             * @param  metadata
	             * @param  buffers
	             * @return message id
	             */
	            Comm.prototype.send = function (data, callbacks, metadata, buffers) {
	                var future = this.jsServicesComm.send(data, metadata, buffers);
	                this._hookupCallbacks(future, callbacks);
	                return future.msg.header.msg_id;
	            };
	            ;
	            /**
	             * Closes the sibling comm in the backend
	             * @param  data
	             * @param  callbacks
	             * @param  metadata
	             * @return msg id
	             */
	            Comm.prototype.close = function (data, callbacks, metadata) {
	                var future = this.jsServicesComm.close(data, metadata);
	                this._hookupCallbacks(future, callbacks);
	                return future.msg.header.msg_id;
	            };
	            ;
	            /**
	             * Register a message handler
	             * @param  callback, which is given a message
	             */
	            Comm.prototype.on_msg = function (callback) {
	                this.jsServicesComm.onMsg = callback.bind(this);
	            };
	            ;
	            /**
	             * Register a handler for when the comm is closed by the backend
	             * @param  callback, which is given a message
	             */
	            Comm.prototype.on_close = function (callback) {
	                this.jsServicesComm.onClose = callback.bind(this);
	            };
	            ;
	            /**
	             * Hooks callback object up with @jupyterlab/services IKernelFuture
	             * @param  @jupyterlab/services IKernelFuture instance
	             * @param  callbacks
	             */
	            Comm.prototype._hookupCallbacks = function (future, callbacks) {
	                if (callbacks) {
	                    future.onReply = function (msg) {
	                        if (callbacks.shell && callbacks.shell.reply)
	                            callbacks.shell.reply(msg);
	                        // TODO: Handle payloads.  See https://github.com/jupyter/notebook/blob/master/notebook/static/services/kernels/kernel.js#L923-L947
	                    };
	                    future.onStdin = function (msg) {
	                        if (callbacks.input)
	                            callbacks.input(msg);
	                    };
	                    future.onIOPub = function (msg) {
	                        if (callbacks.iopub) {
	                            if (callbacks.iopub.status && msg.header.msg_type === 'status') {
	                                callbacks.iopub.status(msg);
	                            }
	                            else if (callbacks.iopub.clear_output && msg.header.msg_type === 'clear_output') {
	                                callbacks.iopub.clear_output(msg);
	                            }
	                            else if (callbacks.iopub.output) {
	                                switch (msg.header.msg_type) {
	                                    case 'display_data':
	                                    case 'execute_result':
	                                        callbacks.iopub.output(msg);
	                                        break;
	                                }
	                                ;
	                            }
	                        }
	                    };
	                }
	            };
	            ;
	            return Comm;
	        }());
	        services.Comm = Comm;
	    })(services = shims.services || (shims.services = {}));
	})(shims = exports.shims || (exports.shims = {}));
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/services-shim.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_int.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_int.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_style_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_style.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var $ = __jupyter_require__('jquery@^3.1.1/dist/jquery.js');
	__jupyter_require__('jquery-ui@^1.12.1/ui/widgets/slider.js');
	var d3format = __jupyter_require__('d3-format@^0.5.1/build/d3-format.js').format;
	var IntModel = (function (_super) {
	    __extends(IntModel, _super);
	    function IntModel() {
	        _super.apply(this, arguments);
	    }
	    IntModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'IntModel',
	            value: 0,
	            disabled: false,
	        });
	    };
	    return IntModel;
	}(widget_core_1.CoreLabeledDOMWidgetModel));
	exports.IntModel = IntModel;
	var BoundedIntModel = (function (_super) {
	    __extends(BoundedIntModel, _super);
	    function BoundedIntModel() {
	        _super.apply(this, arguments);
	    }
	    BoundedIntModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'BoundedIntModel',
	            step: 1,
	            max: 100,
	            min: 0
	        });
	    };
	    return BoundedIntModel;
	}(IntModel));
	exports.BoundedIntModel = BoundedIntModel;
	var SliderStyleModel = (function (_super) {
	    __extends(SliderStyleModel, _super);
	    function SliderStyleModel() {
	        _super.apply(this, arguments);
	    }
	    SliderStyleModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'SliderStyleModel',
	        });
	    };
	    SliderStyleModel.styleProperties = {
	        handle_color: {
	            selector: '.ui-slider-handle',
	            attribute: 'background-color',
	            default: null
	        }
	    };
	    return SliderStyleModel;
	}(widget_style_1.StyleModel));
	exports.SliderStyleModel = SliderStyleModel;
	var IntSliderModel = (function (_super) {
	    __extends(IntSliderModel, _super);
	    function IntSliderModel() {
	        _super.apply(this, arguments);
	    }
	    IntSliderModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'IntSliderModel',
	            _view_name: 'IntSliderView',
	            orientation: 'horizontal',
	            _range: false,
	            readout: true,
	            readout_format: 'd',
	            continuous_update: true,
	            style: void 0
	        });
	    };
	    IntSliderModel.prototype.initialize = function (attributes, options) {
	        _super.prototype.initialize.call(this, attributes, options);
	        this.on('change:readout_format', this.update_readout_format, this);
	        this.update_readout_format();
	    };
	    IntSliderModel.prototype.update_readout_format = function () {
	        this.readout_formatter = d3format(this.get('readout_format'));
	    };
	    return IntSliderModel;
	}(BoundedIntModel));
	exports.IntSliderModel = IntSliderModel;
	var IntSliderView = (function (_super) {
	    __extends(IntSliderView, _super);
	    function IntSliderView() {
	        _super.apply(this, arguments);
	        this._parse_value = parseInt;
	        this._range_regex = /^\s*([+-]?\d+)\s*[-:]\s*([+-]?\d+)/;
	    }
	    IntSliderView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-slider');
	        this.el.classList.add('widget-hslider');
	        (this.$slider = $('<div />'))
	            .slider({
	            slide: this.handleSliderChange.bind(this),
	            stop: this.handleSliderChanged.bind(this)
	        })
	            .addClass('slider');
	        // Put the slider in a container
	        this.slider_container = document.createElement('div');
	        this.slider_container.classList.add('slider-container');
	        this.slider_container.appendChild(this.$slider[0]);
	        this.el.appendChild(this.slider_container);
	        this.readout = document.createElement('div');
	        this.el.appendChild(this.readout);
	        this.readout.classList.add('widget-readout');
	        this.readout.contentEditable = 'true';
	        this.readout.style.display = 'none';
	        // Set defaults.
	        this.update();
	    };
	    IntSliderView.prototype.update = function (options) {
	        /**
	         * Update the contents of this view
	         *
	         * Called when the model is changed.  The model may have been
	         * changed by another view or by a state update from the back-end.
	         */
	        if (options === undefined || options.updated_view != this) {
	            // JQuery slider option keys.  These keys happen to have a
	            // one-to-one mapping with the corresponding keys of the model.
	            var jquery_slider_keys = ['step', 'disabled'];
	            var that = this;
	            that.$slider.slider({});
	            _.each(jquery_slider_keys, function (key, i) {
	                var model_value = that.model.get(key);
	                if (model_value !== undefined) {
	                    that.$slider.slider('option', key, model_value);
	                }
	            });
	            var max = this.model.get('max');
	            var min = this.model.get('min');
	            if (min <= max) {
	                if (max !== undefined)
	                    this.$slider.slider('option', 'max', max);
	                if (min !== undefined)
	                    this.$slider.slider('option', 'min', min);
	            }
	            var range_value = this.model.get('_range');
	            if (range_value !== undefined) {
	                this.$slider.slider('option', 'range', range_value);
	            }
	            // WORKAROUND FOR JQUERY SLIDER BUG.
	            // The horizontal position of the slider handle
	            // depends on the value of the slider at the time
	            // of orientation change.  Before applying the new
	            // workaround, we set the value to the minimum to
	            // make sure that the horizontal placement of the
	            // handle in the vertical slider is always
	            // consistent.
	            var orientation = this.model.get('orientation');
	            var min = this.model.get('min');
	            var max = this.model.get('max');
	            if (this.model.get('_range')) {
	                this.$slider.slider('option', 'values', [min, min]);
	            }
	            else {
	                this.$slider.slider('option', 'value', min);
	            }
	            this.$slider.slider('option', 'orientation', orientation);
	            var value = this.model.get('value');
	            if (this.model.get('_range')) {
	                // values for the range case are validated python-side in
	                // _Bounded{Int,Float}RangeWidget._validate
	                this.$slider.slider('option', 'values', value);
	                this.readout.textContent = this.valueToString(value);
	            }
	            else {
	                if (value > max) {
	                    value = max;
	                }
	                else if (value < min) {
	                    value = min;
	                }
	                this.$slider.slider('option', 'value', value);
	                this.readout.textContent = this.valueToString(value);
	            }
	            if (this.model.get('value') != value) {
	                this.model.set('value', value, { updated_view: this });
	                this.touch();
	            }
	            // Use the right CSS classes for vertical & horizontal sliders
	            if (orientation == 'vertical') {
	                this.el.classList.remove('widget-hslider');
	                this.el.classList.add('widget-vslider');
	                this.el.classList.remove('widget-inline-hbox');
	                this.el.classList.add('widget-inline-vbox');
	            }
	            else {
	                this.el.classList.remove('widget-vslider');
	                this.el.classList.add('widget-hslider');
	                this.el.classList.remove('widget-inline-vbox');
	                this.el.classList.add('widget-inline-hbox');
	            }
	            var readout = this.model.get('readout');
	            if (readout) {
	                this.readout.style.display = '';
	                this.displayed.then(function () {
	                    if (that.readout_overflow()) {
	                        that.readout.classList.add('overflow');
	                    }
	                    else {
	                        that.readout.classList.remove('overflow');
	                    }
	                });
	            }
	            else {
	                this.readout.style.display = 'none';
	            }
	        }
	        return _super.prototype.update.call(this);
	    };
	    /**
	     * Returns true if the readout box content overflows.
	     */
	    IntSliderView.prototype.readout_overflow = function () {
	        return this.readout.scrollWidth > this.readout.clientWidth;
	    };
	    /**
	     * Write value to a string
	     * @param  {number|number[]} value
	     * @return {string}
	     */
	    IntSliderView.prototype.valueToString = function (value) {
	        var format = this.model.readout_formatter;
	        if (this.model.get('_range')) {
	            return value.map(function (v) {
	                return format(v);
	            }).join(' – ');
	        }
	        else {
	            return format(value);
	        }
	    };
	    /**
	     * Parse value from a string
	     * @param  {string} text
	     * @return {number|number[]} value
	     */
	    IntSliderView.prototype.stringToValue = function (text) {
	        if (this.model.get('_range')) {
	            // range case
	            // ranges can be expressed either 'val-val' or 'val:val' (+spaces)
	            var match = this._range_regex.exec(text);
	            if (match) {
	                return [this._parse_value(match[1]), this._parse_value(match[2])];
	            }
	            else {
	                return null;
	            }
	        }
	        else {
	            return this._parse_value(text);
	        }
	    };
	    IntSliderView.prototype.events = function () {
	        return {
	            // Dictionary of events and their handlers.
	            'slide': 'handleSliderChange',
	            'slidestop': 'handleSliderChanged',
	            'blur [contentEditable=true]': 'handleTextChange',
	            'keydown [contentEditable=true]': 'handleKeyDown'
	        };
	    };
	    IntSliderView.prototype.handleKeyDown = function (e) {
	        if (e.keyCode == 13) {
	            e.preventDefault();
	            this.handleTextChange();
	        }
	    };
	    IntSliderView.prototype.handleTextChange = function () {
	        /**
	         * this handles the entry of text into the contentEditable label
	         * first, the value is checked if it contains a parseable number
	         *      (or pair of numbers, for the _range case)
	         * then it is clamped within the min-max range of the slider
	         * finally, the model is updated if the value is to be changed
	         *
	         * if any of these conditions are not met, the text is reset
	         *
	         * the step size is not enforced
	         */
	        var value = this.stringToValue(this.readout.textContent);
	        var vmin = this.model.get('min');
	        var vmax = this.model.get('max');
	        if (this.model.get('_range')) {
	            // reject input where NaN or lower > upper
	            if (value === null ||
	                isNaN(value[0]) ||
	                isNaN(value[1]) ||
	                (value[0] > value[1])) {
	                this.readout.textContent = this.valueToString(this.model.get('value'));
	            }
	            else {
	                // clamp to range
	                value = [Math.max(Math.min(value[0], vmax), vmin),
	                    Math.max(Math.min(value[1], vmax), vmin)];
	                if ((value[0] != this.model.get('value')[0]) ||
	                    (value[1] != this.model.get('value')[1])) {
	                    this.readout.textContent = this.valueToString(value);
	                    this.model.set('value', value, { updated_view: this });
	                    this.touch();
	                }
	                else {
	                    this.readout.textContent = this.valueToString(this.model.get('value'));
	                }
	            }
	        }
	        else {
	            // single value case
	            if (isNaN(value)) {
	                this.readout.textContent = this.valueToString(this.model.get('value'));
	            }
	            else {
	                value = Math.max(Math.min(value, vmax), vmin);
	                if (value != this.model.get('value')) {
	                    this.readout.textContent = this.valueToString(value);
	                    this.model.set('value', value, { updated_view: this });
	                    this.touch();
	                }
	                else {
	                    this.readout.textContent = this.valueToString(this.model.get('value'));
	                }
	            }
	        }
	    };
	    /**
	     * Called when the slider value is changing.
	     */
	    IntSliderView.prototype.handleSliderChange = function (e, ui) {
	        var actual_value;
	        if (this.model.get('_range')) {
	            actual_value = ui.values.map(this._validate_slide_value);
	            this.readout.textContent = this.valueToString(actual_value);
	        }
	        else {
	            actual_value = this._validate_slide_value(ui.value);
	            this.readout.textContent = this.valueToString(actual_value);
	        }
	        // Only persist the value while sliding if the continuous_update
	        // trait is set to true.
	        if (this.model.get('continuous_update')) {
	            this.handleSliderChanged(e, ui);
	        }
	    };
	    /**
	     * Called when the slider value has changed.
	     *
	     * Calling model.set will trigger all of the other views of the
	     * model to update.
	     */
	    IntSliderView.prototype.handleSliderChanged = function (e, ui) {
	        var actual_value;
	        if (this.model.get('_range')) {
	            actual_value = ui.values.map(this._validate_slide_value);
	        }
	        else {
	            actual_value = this._validate_slide_value(ui.value);
	        }
	        this.model.set('value', actual_value, { updated_view: this });
	        this.touch();
	    };
	    IntSliderView.prototype._validate_slide_value = function (x) {
	        /**
	         * Validate the value of the slider before sending it to the back-end
	         * and applying it to the other views on the page.
	         */
	        return Math.floor(x);
	    };
	    return IntSliderView;
	}(widget_1.LabeledDOMWidgetView));
	exports.IntSliderView = IntSliderView;
	var IntTextModel = (function (_super) {
	    __extends(IntTextModel, _super);
	    function IntTextModel() {
	        _super.apply(this, arguments);
	    }
	    IntTextModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'IntTextModel',
	            _view_name: 'IntTextView'
	        });
	    };
	    return IntTextModel;
	}(IntModel));
	exports.IntTextModel = IntTextModel;
	var IntTextView = (function (_super) {
	    __extends(IntTextView, _super);
	    function IntTextView() {
	        _super.apply(this, arguments);
	        this._parse_value = parseInt;
	    }
	    IntTextView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-text');
	        this.textbox = document.createElement('input');
	        this.textbox.setAttribute('type', 'text');
	        this.el.appendChild(this.textbox);
	        this.update(); // Set defaults.
	    };
	    IntTextView.prototype.update = function (options) {
	        /**
	         * Update the contents of this view
	         *
	         * Called when the model is changed.  The model may have been
	         * changed by another view or by a state update from the back-end.
	         */
	        if (options === undefined || options.updated_view != this) {
	            var value = this.model.get('value');
	            if (this._parse_value(this.textbox.value) !== value) {
	                this.textbox.value = value.toString();
	            }
	            var disabled = this.model.get('disabled');
	            if (disabled) {
	                this.textbox.setAttribute('disabled', disabled);
	            }
	            else {
	                this.textbox.removeAttribute('disabled');
	            }
	        }
	        return _super.prototype.update.call(this);
	    };
	    IntTextView.prototype.events = function () {
	        return {
	            // Dictionary of events and their handlers.
	            'keydown input': 'handleKeyDown',
	            'keypress input': 'handleKeypress',
	            'keyup input': 'handleChanging',
	            'paste input': 'handleChanging',
	            'cut input': 'handleChanging',
	            // Fires only when control is validated or looses focus.
	            'change input': 'handleChanged'
	        };
	    };
	    /**
	     * Handle key down
	     *
	     * Stop propagation so the event isn't sent to the application.
	     */
	    IntTextView.prototype.handleKeyDown = function (e) {
	        e.stopPropagation();
	    };
	    /**
	     * Handles key press
	     *
	     * Stop propagation so the event isn't sent to the application.
	     */
	    IntTextView.prototype.handleKeypress = function (e) {
	        e.stopPropagation();
	    };
	    IntTextView.prototype.handleChanging = function (e) {
	        /**
	         * Handles and validates user input.
	         *
	         * Try to parse value as an int.
	         */
	        var numericalValue = 0;
	        var trimmed = e.target.value.trim();
	        if (trimmed === '') {
	            return;
	        }
	        else {
	            if (!(['-', '-.', '.', '+.', '+'].indexOf(trimmed) >= 0)) {
	                numericalValue = this._parse_value(e.target.value);
	            }
	        }
	        // If parse failed, reset value to value stored in model.
	        if (isNaN(numericalValue)) {
	            e.target.value = this.model.get('value');
	        }
	        else if (!isNaN(numericalValue)) {
	            if (this.model.get('max') !== undefined) {
	                numericalValue = Math.min(this.model.get('max'), numericalValue);
	            }
	            if (this.model.get('min') !== undefined) {
	                numericalValue = Math.max(this.model.get('min'), numericalValue);
	            }
	            // Apply the value if it has changed.
	            if (numericalValue != this.model.get('value')) {
	                // Calling model.set will trigger all of the other views of the
	                // model to update.
	                this.model.set('value', numericalValue, { updated_view: this });
	                this.touch();
	            }
	        }
	    };
	    IntTextView.prototype.handleChanged = function (e) {
	        /**
	         * Applies validated input.
	         */
	        if (e.target.value.trim() === '' || e.target.value !== this.model.get('value')) {
	            e.target.value = this.model.get('value');
	        }
	    };
	    return IntTextView;
	}(widget_1.LabeledDOMWidgetView));
	exports.IntTextView = IntTextView;
	var ProgressStyleModel = (function (_super) {
	    __extends(ProgressStyleModel, _super);
	    function ProgressStyleModel() {
	        _super.apply(this, arguments);
	    }
	    ProgressStyleModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'ProgressStyleModel',
	        });
	    };
	    ProgressStyleModel.styleProperties = {
	        bar_color: {
	            selector: '.progress-bar',
	            attribute: 'background-color',
	            default: null
	        }
	    };
	    return ProgressStyleModel;
	}(widget_style_1.StyleModel));
	exports.ProgressStyleModel = ProgressStyleModel;
	var ProgressModel = (function (_super) {
	    __extends(ProgressModel, _super);
	    function ProgressModel() {
	        _super.apply(this, arguments);
	    }
	    ProgressModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'ProgressModel',
	            _view_name: 'ProgressView',
	            orientation: 'horizontal',
	            bar_style: '',
	            style: void 0
	        });
	    };
	    return ProgressModel;
	}(BoundedIntModel));
	exports.ProgressModel = ProgressModel;
	var ProgressView = (function (_super) {
	    __extends(ProgressView, _super);
	    function ProgressView() {
	        _super.apply(this, arguments);
	    }
	    ProgressView.prototype.initialize = function (parameters) {
	        _super.prototype.initialize.call(this, parameters);
	        this.listenTo(this.model, 'change:bar_style', this.update_bar_style);
	        this.pWidget.addClass('jupyter-widgets');
	    };
	    ProgressView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        var orientation = this.model.get('orientation');
	        var className = orientation === 'horizontal' ?
	            'widget-hprogress' : 'widget-vprogress';
	        this.el.classList.add(className);
	        this.progress = document.createElement('div');
	        this.progress.classList.add('progress');
	        this.progress.style.position = 'relative';
	        this.el.appendChild(this.progress);
	        this.bar = document.createElement('div');
	        this.bar.classList.add('progress-bar');
	        this.bar.style.position = 'absolute';
	        this.bar.style.bottom = '0px';
	        this.bar.style.left = '0px';
	        this.progress.appendChild(this.bar);
	        // Set defaults.
	        this.update();
	        this.set_bar_style();
	    };
	    ProgressView.prototype.update = function () {
	        /**
	         * Update the contents of this view
	         *
	         * Called when the model is changed.  The model may have been
	         * changed by another view or by a state update from the back-end.
	         */
	        var value = this.model.get('value');
	        var max = this.model.get('max');
	        var min = this.model.get('min');
	        var orientation = this.model.get('orientation');
	        var percent = 100.0 * (value - min) / (max - min);
	        if (orientation === 'horizontal') {
	            this.el.classList.remove('widget-inline-vbox');
	            this.el.classList.remove('widget-vprogress');
	            this.el.classList.add('widget-inline-hbox');
	            this.el.classList.add('widget-hprogress');
	            this.bar.style.width = percent + '%';
	            this.bar.style.height = '100%';
	        }
	        else {
	            this.el.classList.remove('widget-inline-hbox');
	            this.el.classList.remove('widget-hprogress');
	            this.el.classList.add('widget-inline-vbox');
	            this.el.classList.add('widget-vprogress');
	            this.bar.style.width = '100%';
	            this.bar.style.height = percent + '%';
	        }
	        return _super.prototype.update.call(this);
	    };
	    ProgressView.prototype.update_bar_style = function () {
	        this.update_mapped_classes(ProgressView.class_map, 'bar_style', this.bar);
	    };
	    ProgressView.prototype.set_bar_style = function () {
	        this.set_mapped_classes(ProgressView.class_map, 'bar_style', this.bar);
	    };
	    ProgressView.class_map = {
	        success: ['progress-bar-success'],
	        info: ['progress-bar-info'],
	        warning: ['progress-bar-warning'],
	        danger: ['progress-bar-danger']
	    };
	    return ProgressView;
	}(widget_1.LabeledDOMWidgetView));
	exports.ProgressView = ProgressView;
	var PlayModel = (function (_super) {
	    __extends(PlayModel, _super);
	    function PlayModel() {
	        _super.apply(this, arguments);
	    }
	    PlayModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'PlayModel',
	            _view_name: 'PlayView',
	            _playing: false,
	            interval: 100
	        });
	    };
	    PlayModel.prototype.initialize = function (attributes, options) {
	        _super.prototype.initialize.call(this, attributes, options);
	        this.on('change:_playing', function () {
	            if (this.get('_playing')) {
	                this.loop();
	            }
	        }, this);
	    };
	    PlayModel.prototype.loop = function () {
	        if (this.get('_playing')) {
	            var next_value = this.get('value') + this.get('step');
	            if (next_value < this.get('max')) {
	                this.set('value', next_value);
	                window.setTimeout(this.loop.bind(this), this.get('interval'));
	            }
	            else {
	                this.set('value', this.get('min'));
	                this.set('_playing', false);
	            }
	            this.save_changes();
	        }
	    };
	    PlayModel.prototype.stop = function () {
	        this.set('_playing', false);
	        this.set('value', this.get('min'));
	        this.save_changes();
	    };
	    PlayModel.prototype.pause = function () {
	        this.set('_playing', false);
	        this.save_changes();
	    };
	    PlayModel.prototype.play = function () {
	        this.set('_playing', true);
	        this.save_changes();
	    };
	    return PlayModel;
	}(BoundedIntModel));
	exports.PlayModel = PlayModel;
	var PlayView = (function (_super) {
	    __extends(PlayView, _super);
	    function PlayView() {
	        _super.apply(this, arguments);
	    }
	    PlayView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-play');
	        this.playButton = document.createElement('button');
	        this.pauseButton = document.createElement('button');
	        this.stopButton = document.createElement('button');
	        this.playButton.className = 'jupyter-button';
	        this.pauseButton.className = 'jupyter-button';
	        this.stopButton.className = 'jupyter-button';
	        this.el.appendChild(this.playButton); // Toggle button with playing
	        this.el.appendChild(this.pauseButton); // Disable if not playing
	        this.el.appendChild(this.stopButton); // Disable if not playing
	        var playIcon = document.createElement('i');
	        playIcon.className = 'fa fa-play';
	        this.playButton.appendChild(playIcon);
	        var pauseIcon = document.createElement('i');
	        pauseIcon.className = 'fa fa-pause';
	        this.pauseButton.appendChild(pauseIcon);
	        var stopIcon = document.createElement('i');
	        stopIcon.className = 'fa fa-stop';
	        this.stopButton.appendChild(stopIcon);
	        this.playButton.onclick = this.model.play.bind(this.model);
	        this.pauseButton.onclick = this.model.pause.bind(this.model);
	        this.stopButton.onclick = this.model.stop.bind(this.model);
	        this.listenTo(this.model, 'change:_playing', this.update_playing);
	        this.update_playing();
	    };
	    PlayView.prototype.update_playing = function () {
	        var playing = this.model.get('_playing');
	        if (playing) {
	            this.pauseButton.disabled = false;
	            this.playButton.classList.add('mod-active');
	        }
	        else {
	            this.pauseButton.disabled = true;
	            this.playButton.classList.remove('mod-active');
	        }
	    };
	    return PlayView;
	}(widget_1.DOMWidgetView));
	exports.PlayView = PlayView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_int.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/slider.js **/
jupyter.define('jquery-ui@1.12.1/ui/widgets/slider.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Slider 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Slider
	//>>group: Widgets
	//>>description: Displays a flexible slider with ranges and accessibility via keyboard.
	//>>docs: http://api.jqueryui.com/slider/
	//>>demos: http://jqueryui.com/slider/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/slider.css
	//>>css.theme: ../../themes/base/theme.css
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
				__jupyter_require__('jquery@2.2.4/dist/jquery.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widgets/mouse.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/keycode.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/version.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widget.js')
			], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	
	return $.widget( "ui.slider", $.ui.mouse, {
		version: "1.12.1",
		widgetEventPrefix: "slide",
	
		options: {
			animate: false,
			classes: {
				"ui-slider": "ui-corner-all",
				"ui-slider-handle": "ui-corner-all",
	
				// Note: ui-widget-header isn't the most fittingly semantic framework class for this
				// element, but worked best visually with a variety of themes
				"ui-slider-range": "ui-corner-all ui-widget-header"
			},
			distance: 0,
			max: 100,
			min: 0,
			orientation: "horizontal",
			range: false,
			step: 1,
			value: 0,
			values: null,
	
			// Callbacks
			change: null,
			slide: null,
			start: null,
			stop: null
		},
	
		// Number of pages in a slider
		// (how many times can you page up/down to go through the whole range)
		numPages: 5,
	
		_create: function() {
			this._keySliding = false;
			this._mouseSliding = false;
			this._animateOff = true;
			this._handleIndex = null;
			this._detectOrientation();
			this._mouseInit();
			this._calculateNewMax();
	
			this._addClass( "ui-slider ui-slider-" + this.orientation,
				"ui-widget ui-widget-content" );
	
			this._refresh();
	
			this._animateOff = false;
		},
	
		_refresh: function() {
			this._createRange();
			this._createHandles();
			this._setupEvents();
			this._refreshValue();
		},
	
		_createHandles: function() {
			var i, handleCount,
				options = this.options,
				existingHandles = this.element.find( ".ui-slider-handle" ),
				handle = "<span tabindex='0'></span>",
				handles = [];
	
			handleCount = ( options.values && options.values.length ) || 1;
	
			if ( existingHandles.length > handleCount ) {
				existingHandles.slice( handleCount ).remove();
				existingHandles = existingHandles.slice( 0, handleCount );
			}
	
			for ( i = existingHandles.length; i < handleCount; i++ ) {
				handles.push( handle );
			}
	
			this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
	
			this._addClass( this.handles, "ui-slider-handle", "ui-state-default" );
	
			this.handle = this.handles.eq( 0 );
	
			this.handles.each( function( i ) {
				$( this )
					.data( "ui-slider-handle-index", i )
					.attr( "tabIndex", 0 );
			} );
		},
	
		_createRange: function() {
			var options = this.options;
	
			if ( options.range ) {
				if ( options.range === true ) {
					if ( !options.values ) {
						options.values = [ this._valueMin(), this._valueMin() ];
					} else if ( options.values.length && options.values.length !== 2 ) {
						options.values = [ options.values[ 0 ], options.values[ 0 ] ];
					} else if ( $.isArray( options.values ) ) {
						options.values = options.values.slice( 0 );
					}
				}
	
				if ( !this.range || !this.range.length ) {
					this.range = $( "<div>" )
						.appendTo( this.element );
	
					this._addClass( this.range, "ui-slider-range" );
				} else {
					this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" );
	
					// Handle range switching from true to min/max
					this.range.css( {
						"left": "",
						"bottom": ""
					} );
				}
				if ( options.range === "min" || options.range === "max" ) {
					this._addClass( this.range, "ui-slider-range-" + options.range );
				}
			} else {
				if ( this.range ) {
					this.range.remove();
				}
				this.range = null;
			}
		},
	
		_setupEvents: function() {
			this._off( this.handles );
			this._on( this.handles, this._handleEvents );
			this._hoverable( this.handles );
			this._focusable( this.handles );
		},
	
		_destroy: function() {
			this.handles.remove();
			if ( this.range ) {
				this.range.remove();
			}
	
			this._mouseDestroy();
		},
	
		_mouseCapture: function( event ) {
			var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
				that = this,
				o = this.options;
	
			if ( o.disabled ) {
				return false;
			}
	
			this.elementSize = {
				width: this.element.outerWidth(),
				height: this.element.outerHeight()
			};
			this.elementOffset = this.element.offset();
	
			position = { x: event.pageX, y: event.pageY };
			normValue = this._normValueFromMouse( position );
			distance = this._valueMax() - this._valueMin() + 1;
			this.handles.each( function( i ) {
				var thisDistance = Math.abs( normValue - that.values( i ) );
				if ( ( distance > thisDistance ) ||
					( distance === thisDistance &&
						( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) {
					distance = thisDistance;
					closestHandle = $( this );
					index = i;
				}
			} );
	
			allowed = this._start( event, index );
			if ( allowed === false ) {
				return false;
			}
			this._mouseSliding = true;
	
			this._handleIndex = index;
	
			this._addClass( closestHandle, null, "ui-state-active" );
			closestHandle.trigger( "focus" );
	
			offset = closestHandle.offset();
			mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
			this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
				left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
				top: event.pageY - offset.top -
					( closestHandle.height() / 2 ) -
					( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) -
					( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) +
					( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 )
			};
	
			if ( !this.handles.hasClass( "ui-state-hover" ) ) {
				this._slide( event, index, normValue );
			}
			this._animateOff = true;
			return true;
		},
	
		_mouseStart: function() {
			return true;
		},
	
		_mouseDrag: function( event ) {
			var position = { x: event.pageX, y: event.pageY },
				normValue = this._normValueFromMouse( position );
	
			this._slide( event, this._handleIndex, normValue );
	
			return false;
		},
	
		_mouseStop: function( event ) {
			this._removeClass( this.handles, null, "ui-state-active" );
			this._mouseSliding = false;
	
			this._stop( event, this._handleIndex );
			this._change( event, this._handleIndex );
	
			this._handleIndex = null;
			this._clickOffset = null;
			this._animateOff = false;
	
			return false;
		},
	
		_detectOrientation: function() {
			this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
		},
	
		_normValueFromMouse: function( position ) {
			var pixelTotal,
				pixelMouse,
				percentMouse,
				valueTotal,
				valueMouse;
	
			if ( this.orientation === "horizontal" ) {
				pixelTotal = this.elementSize.width;
				pixelMouse = position.x - this.elementOffset.left -
					( this._clickOffset ? this._clickOffset.left : 0 );
			} else {
				pixelTotal = this.elementSize.height;
				pixelMouse = position.y - this.elementOffset.top -
					( this._clickOffset ? this._clickOffset.top : 0 );
			}
	
			percentMouse = ( pixelMouse / pixelTotal );
			if ( percentMouse > 1 ) {
				percentMouse = 1;
			}
			if ( percentMouse < 0 ) {
				percentMouse = 0;
			}
			if ( this.orientation === "vertical" ) {
				percentMouse = 1 - percentMouse;
			}
	
			valueTotal = this._valueMax() - this._valueMin();
			valueMouse = this._valueMin() + percentMouse * valueTotal;
	
			return this._trimAlignValue( valueMouse );
		},
	
		_uiHash: function( index, value, values ) {
			var uiHash = {
				handle: this.handles[ index ],
				handleIndex: index,
				value: value !== undefined ? value : this.value()
			};
	
			if ( this._hasMultipleValues() ) {
				uiHash.value = value !== undefined ? value : this.values( index );
				uiHash.values = values || this.values();
			}
	
			return uiHash;
		},
	
		_hasMultipleValues: function() {
			return this.options.values && this.options.values.length;
		},
	
		_start: function( event, index ) {
			return this._trigger( "start", event, this._uiHash( index ) );
		},
	
		_slide: function( event, index, newVal ) {
			var allowed, otherVal,
				currentValue = this.value(),
				newValues = this.values();
	
			if ( this._hasMultipleValues() ) {
				otherVal = this.values( index ? 0 : 1 );
				currentValue = this.values( index );
	
				if ( this.options.values.length === 2 && this.options.range === true ) {
					newVal =  index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal );
				}
	
				newValues[ index ] = newVal;
			}
	
			if ( newVal === currentValue ) {
				return;
			}
	
			allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) );
	
			// A slide can be canceled by returning false from the slide callback
			if ( allowed === false ) {
				return;
			}
	
			if ( this._hasMultipleValues() ) {
				this.values( index, newVal );
			} else {
				this.value( newVal );
			}
		},
	
		_stop: function( event, index ) {
			this._trigger( "stop", event, this._uiHash( index ) );
		},
	
		_change: function( event, index ) {
			if ( !this._keySliding && !this._mouseSliding ) {
	
				//store the last changed value index for reference when handles overlap
				this._lastChangedValue = index;
				this._trigger( "change", event, this._uiHash( index ) );
			}
		},
	
		value: function( newValue ) {
			if ( arguments.length ) {
				this.options.value = this._trimAlignValue( newValue );
				this._refreshValue();
				this._change( null, 0 );
				return;
			}
	
			return this._value();
		},
	
		values: function( index, newValue ) {
			var vals,
				newValues,
				i;
	
			if ( arguments.length > 1 ) {
				this.options.values[ index ] = this._trimAlignValue( newValue );
				this._refreshValue();
				this._change( null, index );
				return;
			}
	
			if ( arguments.length ) {
				if ( $.isArray( arguments[ 0 ] ) ) {
					vals = this.options.values;
					newValues = arguments[ 0 ];
					for ( i = 0; i < vals.length; i += 1 ) {
						vals[ i ] = this._trimAlignValue( newValues[ i ] );
						this._change( null, i );
					}
					this._refreshValue();
				} else {
					if ( this._hasMultipleValues() ) {
						return this._values( index );
					} else {
						return this.value();
					}
				}
			} else {
				return this._values();
			}
		},
	
		_setOption: function( key, value ) {
			var i,
				valsLength = 0;
	
			if ( key === "range" && this.options.range === true ) {
				if ( value === "min" ) {
					this.options.value = this._values( 0 );
					this.options.values = null;
				} else if ( value === "max" ) {
					this.options.value = this._values( this.options.values.length - 1 );
					this.options.values = null;
				}
			}
	
			if ( $.isArray( this.options.values ) ) {
				valsLength = this.options.values.length;
			}
	
			this._super( key, value );
	
			switch ( key ) {
				case "orientation":
					this._detectOrientation();
					this._removeClass( "ui-slider-horizontal ui-slider-vertical" )
						._addClass( "ui-slider-" + this.orientation );
					this._refreshValue();
					if ( this.options.range ) {
						this._refreshRange( value );
					}
	
					// Reset positioning from previous orientation
					this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
					break;
				case "value":
					this._animateOff = true;
					this._refreshValue();
					this._change( null, 0 );
					this._animateOff = false;
					break;
				case "values":
					this._animateOff = true;
					this._refreshValue();
	
					// Start from the last handle to prevent unreachable handles (#9046)
					for ( i = valsLength - 1; i >= 0; i-- ) {
						this._change( null, i );
					}
					this._animateOff = false;
					break;
				case "step":
				case "min":
				case "max":
					this._animateOff = true;
					this._calculateNewMax();
					this._refreshValue();
					this._animateOff = false;
					break;
				case "range":
					this._animateOff = true;
					this._refresh();
					this._animateOff = false;
					break;
			}
		},
	
		_setOptionDisabled: function( value ) {
			this._super( value );
	
			this._toggleClass( null, "ui-state-disabled", !!value );
		},
	
		//internal value getter
		// _value() returns value trimmed by min and max, aligned by step
		_value: function() {
			var val = this.options.value;
			val = this._trimAlignValue( val );
	
			return val;
		},
	
		//internal values getter
		// _values() returns array of values trimmed by min and max, aligned by step
		// _values( index ) returns single value trimmed by min and max, aligned by step
		_values: function( index ) {
			var val,
				vals,
				i;
	
			if ( arguments.length ) {
				val = this.options.values[ index ];
				val = this._trimAlignValue( val );
	
				return val;
			} else if ( this._hasMultipleValues() ) {
	
				// .slice() creates a copy of the array
				// this copy gets trimmed by min and max and then returned
				vals = this.options.values.slice();
				for ( i = 0; i < vals.length; i += 1 ) {
					vals[ i ] = this._trimAlignValue( vals[ i ] );
				}
	
				return vals;
			} else {
				return [];
			}
		},
	
		// Returns the step-aligned value that val is closest to, between (inclusive) min and max
		_trimAlignValue: function( val ) {
			if ( val <= this._valueMin() ) {
				return this._valueMin();
			}
			if ( val >= this._valueMax() ) {
				return this._valueMax();
			}
			var step = ( this.options.step > 0 ) ? this.options.step : 1,
				valModStep = ( val - this._valueMin() ) % step,
				alignValue = val - valModStep;
	
			if ( Math.abs( valModStep ) * 2 >= step ) {
				alignValue += ( valModStep > 0 ) ? step : ( -step );
			}
	
			// Since JavaScript has problems with large floats, round
			// the final value to 5 digits after the decimal point (see #4124)
			return parseFloat( alignValue.toFixed( 5 ) );
		},
	
		_calculateNewMax: function() {
			var max = this.options.max,
				min = this._valueMin(),
				step = this.options.step,
				aboveMin = Math.round( ( max - min ) / step ) * step;
			max = aboveMin + min;
			if ( max > this.options.max ) {
	
				//If max is not divisible by step, rounding off may increase its value
				max -= step;
			}
			this.max = parseFloat( max.toFixed( this._precision() ) );
		},
	
		_precision: function() {
			var precision = this._precisionOf( this.options.step );
			if ( this.options.min !== null ) {
				precision = Math.max( precision, this._precisionOf( this.options.min ) );
			}
			return precision;
		},
	
		_precisionOf: function( num ) {
			var str = num.toString(),
				decimal = str.indexOf( "." );
			return decimal === -1 ? 0 : str.length - decimal - 1;
		},
	
		_valueMin: function() {
			return this.options.min;
		},
	
		_valueMax: function() {
			return this.max;
		},
	
		_refreshRange: function( orientation ) {
			if ( orientation === "vertical" ) {
				this.range.css( { "width": "", "left": "" } );
			}
			if ( orientation === "horizontal" ) {
				this.range.css( { "height": "", "bottom": "" } );
			}
		},
	
		_refreshValue: function() {
			var lastValPercent, valPercent, value, valueMin, valueMax,
				oRange = this.options.range,
				o = this.options,
				that = this,
				animate = ( !this._animateOff ) ? o.animate : false,
				_set = {};
	
			if ( this._hasMultipleValues() ) {
				this.handles.each( function( i ) {
					valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() -
						that._valueMin() ) * 100;
					_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
					$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
					if ( that.options.range === true ) {
						if ( that.orientation === "horizontal" ) {
							if ( i === 0 ) {
								that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
									left: valPercent + "%"
								}, o.animate );
							}
							if ( i === 1 ) {
								that.range[ animate ? "animate" : "css" ]( {
									width: ( valPercent - lastValPercent ) + "%"
								}, {
									queue: false,
									duration: o.animate
								} );
							}
						} else {
							if ( i === 0 ) {
								that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
									bottom: ( valPercent ) + "%"
								}, o.animate );
							}
							if ( i === 1 ) {
								that.range[ animate ? "animate" : "css" ]( {
									height: ( valPercent - lastValPercent ) + "%"
								}, {
									queue: false,
									duration: o.animate
								} );
							}
						}
					}
					lastValPercent = valPercent;
				} );
			} else {
				value = this.value();
				valueMin = this._valueMin();
				valueMax = this._valueMax();
				valPercent = ( valueMax !== valueMin ) ?
						( value - valueMin ) / ( valueMax - valueMin ) * 100 :
						0;
				_set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
				this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
	
				if ( oRange === "min" && this.orientation === "horizontal" ) {
					this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
						width: valPercent + "%"
					}, o.animate );
				}
				if ( oRange === "max" && this.orientation === "horizontal" ) {
					this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
						width: ( 100 - valPercent ) + "%"
					}, o.animate );
				}
				if ( oRange === "min" && this.orientation === "vertical" ) {
					this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
						height: valPercent + "%"
					}, o.animate );
				}
				if ( oRange === "max" && this.orientation === "vertical" ) {
					this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
						height: ( 100 - valPercent ) + "%"
					}, o.animate );
				}
			}
		},
	
		_handleEvents: {
			keydown: function( event ) {
				var allowed, curVal, newVal, step,
					index = $( event.target ).data( "ui-slider-handle-index" );
	
				switch ( event.keyCode ) {
					case $.ui.keyCode.HOME:
					case $.ui.keyCode.END:
					case $.ui.keyCode.PAGE_UP:
					case $.ui.keyCode.PAGE_DOWN:
					case $.ui.keyCode.UP:
					case $.ui.keyCode.RIGHT:
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.LEFT:
						event.preventDefault();
						if ( !this._keySliding ) {
							this._keySliding = true;
							this._addClass( $( event.target ), null, "ui-state-active" );
							allowed = this._start( event, index );
							if ( allowed === false ) {
								return;
							}
						}
						break;
				}
	
				step = this.options.step;
				if ( this._hasMultipleValues() ) {
					curVal = newVal = this.values( index );
				} else {
					curVal = newVal = this.value();
				}
	
				switch ( event.keyCode ) {
					case $.ui.keyCode.HOME:
						newVal = this._valueMin();
						break;
					case $.ui.keyCode.END:
						newVal = this._valueMax();
						break;
					case $.ui.keyCode.PAGE_UP:
						newVal = this._trimAlignValue(
							curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages )
						);
						break;
					case $.ui.keyCode.PAGE_DOWN:
						newVal = this._trimAlignValue(
							curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) );
						break;
					case $.ui.keyCode.UP:
					case $.ui.keyCode.RIGHT:
						if ( curVal === this._valueMax() ) {
							return;
						}
						newVal = this._trimAlignValue( curVal + step );
						break;
					case $.ui.keyCode.DOWN:
					case $.ui.keyCode.LEFT:
						if ( curVal === this._valueMin() ) {
							return;
						}
						newVal = this._trimAlignValue( curVal - step );
						break;
				}
	
				this._slide( event, index, newVal );
			},
			keyup: function( event ) {
				var index = $( event.target ).data( "ui-slider-handle-index" );
	
				if ( this._keySliding ) {
					this._keySliding = false;
					this._stop( event, index );
					this._change( event, index );
					this._removeClass( $( event.target ), null, "ui-state-active" );
				}
			}
		}
	} );
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/slider.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/mouse.js **/
jupyter.define('jquery-ui@1.12.1/ui/widgets/mouse.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Mouse 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Mouse
	//>>group: Widgets
	//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
	//>>docs: http://api.jqueryui.com/mouse/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
				__jupyter_require__('jquery@2.2.4/dist/jquery.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/ie.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/version.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widget.js')
			], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	
	var mouseHandled = false;
	$( document ).on( "mouseup", function() {
		mouseHandled = false;
	} );
	
	return $.widget( "ui.mouse", {
		version: "1.12.1",
		options: {
			cancel: "input, textarea, button, select, option",
			distance: 1,
			delay: 0
		},
		_mouseInit: function() {
			var that = this;
	
			this.element
				.on( "mousedown." + this.widgetName, function( event ) {
					return that._mouseDown( event );
				} )
				.on( "click." + this.widgetName, function( event ) {
					if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
						$.removeData( event.target, that.widgetName + ".preventClickEvent" );
						event.stopImmediatePropagation();
						return false;
					}
				} );
	
			this.started = false;
		},
	
		// TODO: make sure destroying one instance of mouse doesn't mess with
		// other instances of mouse
		_mouseDestroy: function() {
			this.element.off( "." + this.widgetName );
			if ( this._mouseMoveDelegate ) {
				this.document
					.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
					.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
			}
		},
	
		_mouseDown: function( event ) {
	
			// don't let more than one widget handle mouseStart
			if ( mouseHandled ) {
				return;
			}
	
			this._mouseMoved = false;
	
			// We may have missed mouseup (out of window)
			( this._mouseStarted && this._mouseUp( event ) );
	
			this._mouseDownEvent = event;
	
			var that = this,
				btnIsLeft = ( event.which === 1 ),
	
				// event.target.nodeName works around a bug in IE 8 with
				// disabled inputs (#7620)
				elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
					$( event.target ).closest( this.options.cancel ).length : false );
			if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
				return true;
			}
	
			this.mouseDelayMet = !this.options.delay;
			if ( !this.mouseDelayMet ) {
				this._mouseDelayTimer = setTimeout( function() {
					that.mouseDelayMet = true;
				}, this.options.delay );
			}
	
			if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
				this._mouseStarted = ( this._mouseStart( event ) !== false );
				if ( !this._mouseStarted ) {
					event.preventDefault();
					return true;
				}
			}
	
			// Click event may never have fired (Gecko & Opera)
			if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
				$.removeData( event.target, this.widgetName + ".preventClickEvent" );
			}
	
			// These delegates are required to keep context
			this._mouseMoveDelegate = function( event ) {
				return that._mouseMove( event );
			};
			this._mouseUpDelegate = function( event ) {
				return that._mouseUp( event );
			};
	
			this.document
				.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
				.on( "mouseup." + this.widgetName, this._mouseUpDelegate );
	
			event.preventDefault();
	
			mouseHandled = true;
			return true;
		},
	
		_mouseMove: function( event ) {
	
			// Only check for mouseups outside the document if you've moved inside the document
			// at least once. This prevents the firing of mouseup in the case of IE<9, which will
			// fire a mousemove event if content is placed under the cursor. See #7778
			// Support: IE <9
			if ( this._mouseMoved ) {
	
				// IE mouseup check - mouseup happened when mouse was out of window
				if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
						!event.button ) {
					return this._mouseUp( event );
	
				// Iframe mouseup check - mouseup occurred in another document
				} else if ( !event.which ) {
	
					// Support: Safari <=8 - 9
					// Safari sets which to 0 if you press any of the following keys
					// during a drag (#14461)
					if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
							event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
						this.ignoreMissingWhich = true;
					} else if ( !this.ignoreMissingWhich ) {
						return this._mouseUp( event );
					}
				}
			}
	
			if ( event.which || event.button ) {
				this._mouseMoved = true;
			}
	
			if ( this._mouseStarted ) {
				this._mouseDrag( event );
				return event.preventDefault();
			}
	
			if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
				this._mouseStarted =
					( this._mouseStart( this._mouseDownEvent, event ) !== false );
				( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) );
			}
	
			return !this._mouseStarted;
		},
	
		_mouseUp: function( event ) {
			this.document
				.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
				.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
	
			if ( this._mouseStarted ) {
				this._mouseStarted = false;
	
				if ( event.target === this._mouseDownEvent.target ) {
					$.data( event.target, this.widgetName + ".preventClickEvent", true );
				}
	
				this._mouseStop( event );
			}
	
			if ( this._mouseDelayTimer ) {
				clearTimeout( this._mouseDelayTimer );
				delete this._mouseDelayTimer;
			}
	
			this.ignoreMissingWhich = false;
			mouseHandled = false;
			event.preventDefault();
		},
	
		_mouseDistanceMet: function( event ) {
			return ( Math.max(
					Math.abs( this._mouseDownEvent.pageX - event.pageX ),
					Math.abs( this._mouseDownEvent.pageY - event.pageY )
				) >= this.options.distance
			);
		},
	
		_mouseDelayMet: function( /* event */ ) {
			return this.mouseDelayMet;
		},
	
		// These are placeholder methods, to be overriden by extending plugin
		_mouseStart: function( /* event */ ) {},
		_mouseDrag: function( /* event */ ) {},
		_mouseStop: function( /* event */ ) {},
		_mouseCapture: function( /* event */ ) { return true; }
	} );
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/mouse.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/ie.js **/
jupyter.define('jquery-ui@1.12.1/ui/ie.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	// This file is deprecated
	return $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/ie.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/version.js **/
jupyter.define('jquery-ui@1.12.1/ui/version.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	$.ui = $.ui || {};
	
	return $.ui.version = "1.12.1";
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/version.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/widget.js **/
jupyter.define('jquery-ui@1.12.1/ui/widget.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Widget 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Widget
	//>>group: Core
	//>>description: Provides a factory for creating stateful widgets with a common API.
	//>>docs: http://api.jqueryui.com/jQuery.widget/
	//>>demos: http://jqueryui.com/widget/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	
	var widgetUuid = 0;
	var widgetSlice = Array.prototype.slice;
	
	$.cleanData = ( function( orig ) {
		return function( elems ) {
			var events, elem, i;
			for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
				try {
	
					// Only trigger remove when necessary to save time
					events = $._data( elem, "events" );
					if ( events && events.remove ) {
						$( elem ).triggerHandler( "remove" );
					}
	
				// Http://bugs.jquery.com/ticket/8235
				} catch ( e ) {}
			}
			orig( elems );
		};
	} )( $.cleanData );
	
	$.widget = function( name, base, prototype ) {
		var existingConstructor, constructor, basePrototype;
	
		// ProxiedPrototype allows the provided prototype to remain unmodified
		// so that it can be used as a mixin for multiple widgets (#8876)
		var proxiedPrototype = {};
	
		var namespace = name.split( "." )[ 0 ];
		name = name.split( "." )[ 1 ];
		var fullName = namespace + "-" + name;
	
		if ( !prototype ) {
			prototype = base;
			base = $.Widget;
		}
	
		if ( $.isArray( prototype ) ) {
			prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
		}
	
		// Create selector for plugin
		$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
			return !!$.data( elem, fullName );
		};
	
		$[ namespace ] = $[ namespace ] || {};
		existingConstructor = $[ namespace ][ name ];
		constructor = $[ namespace ][ name ] = function( options, element ) {
	
			// Allow instantiation without "new" keyword
			if ( !this._createWidget ) {
				return new constructor( options, element );
			}
	
			// Allow instantiation without initializing for simple inheritance
			// must use "new" keyword (the code above always passes args)
			if ( arguments.length ) {
				this._createWidget( options, element );
			}
		};
	
		// Extend with the existing constructor to carry over any static properties
		$.extend( constructor, existingConstructor, {
			version: prototype.version,
	
			// Copy the object used to create the prototype in case we need to
			// redefine the widget later
			_proto: $.extend( {}, prototype ),
	
			// Track widgets that inherit from this widget in case this widget is
			// redefined after a widget inherits from it
			_childConstructors: []
		} );
	
		basePrototype = new base();
	
		// We need to make the options hash a property directly on the new instance
		// otherwise we'll modify the options hash on the prototype that we're
		// inheriting from
		basePrototype.options = $.widget.extend( {}, basePrototype.options );
		$.each( prototype, function( prop, value ) {
			if ( !$.isFunction( value ) ) {
				proxiedPrototype[ prop ] = value;
				return;
			}
			proxiedPrototype[ prop ] = ( function() {
				function _super() {
					return base.prototype[ prop ].apply( this, arguments );
				}
	
				function _superApply( args ) {
					return base.prototype[ prop ].apply( this, args );
				}
	
				return function() {
					var __super = this._super;
					var __superApply = this._superApply;
					var returnValue;
	
					this._super = _super;
					this._superApply = _superApply;
	
					returnValue = value.apply( this, arguments );
	
					this._super = __super;
					this._superApply = __superApply;
	
					return returnValue;
				};
			} )();
		} );
		constructor.prototype = $.widget.extend( basePrototype, {
	
			// TODO: remove support for widgetEventPrefix
			// always use the name + a colon as the prefix, e.g., draggable:start
			// don't prefix for widgets that aren't DOM-based
			widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name
		}, proxiedPrototype, {
			constructor: constructor,
			namespace: namespace,
			widgetName: name,
			widgetFullName: fullName
		} );
	
		// If this widget is being redefined then we need to find all widgets that
		// are inheriting from it and redefine all of them so that they inherit from
		// the new version of this widget. We're essentially trying to replace one
		// level in the prototype chain.
		if ( existingConstructor ) {
			$.each( existingConstructor._childConstructors, function( i, child ) {
				var childPrototype = child.prototype;
	
				// Redefine the child widget using the same prototype that was
				// originally used, but inherit from the new version of the base
				$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,
					child._proto );
			} );
	
			// Remove the list of existing child constructors from the old constructor
			// so the old child constructors can be garbage collected
			delete existingConstructor._childConstructors;
		} else {
			base._childConstructors.push( constructor );
		}
	
		$.widget.bridge( name, constructor );
	
		return constructor;
	};
	
	$.widget.extend = function( target ) {
		var input = widgetSlice.call( arguments, 1 );
		var inputIndex = 0;
		var inputLength = input.length;
		var key;
		var value;
	
		for ( ; inputIndex < inputLength; inputIndex++ ) {
			for ( key in input[ inputIndex ] ) {
				value = input[ inputIndex ][ key ];
				if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
	
					// Clone objects
					if ( $.isPlainObject( value ) ) {
						target[ key ] = $.isPlainObject( target[ key ] ) ?
							$.widget.extend( {}, target[ key ], value ) :
	
							// Don't extend strings, arrays, etc. with objects
							$.widget.extend( {}, value );
	
					// Copy everything else by reference
					} else {
						target[ key ] = value;
					}
				}
			}
		}
		return target;
	};
	
	$.widget.bridge = function( name, object ) {
		var fullName = object.prototype.widgetFullName || name;
		$.fn[ name ] = function( options ) {
			var isMethodCall = typeof options === "string";
			var args = widgetSlice.call( arguments, 1 );
			var returnValue = this;
	
			if ( isMethodCall ) {
	
				// If this is an empty collection, we need to have the instance method
				// return undefined instead of the jQuery instance
				if ( !this.length && options === "instance" ) {
					returnValue = undefined;
				} else {
					this.each( function() {
						var methodValue;
						var instance = $.data( this, fullName );
	
						if ( options === "instance" ) {
							returnValue = instance;
							return false;
						}
	
						if ( !instance ) {
							return $.error( "cannot call methods on " + name +
								" prior to initialization; " +
								"attempted to call method '" + options + "'" );
						}
	
						if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
							return $.error( "no such method '" + options + "' for " + name +
								" widget instance" );
						}
	
						methodValue = instance[ options ].apply( instance, args );
	
						if ( methodValue !== instance && methodValue !== undefined ) {
							returnValue = methodValue && methodValue.jquery ?
								returnValue.pushStack( methodValue.get() ) :
								methodValue;
							return false;
						}
					} );
				}
			} else {
	
				// Allow multiple hashes to be passed on init
				if ( args.length ) {
					options = $.widget.extend.apply( null, [ options ].concat( args ) );
				}
	
				this.each( function() {
					var instance = $.data( this, fullName );
					if ( instance ) {
						instance.option( options || {} );
						if ( instance._init ) {
							instance._init();
						}
					} else {
						$.data( this, fullName, new object( options, this ) );
					}
				} );
			}
	
			return returnValue;
		};
	};
	
	$.Widget = function( /* options, element */ ) {};
	$.Widget._childConstructors = [];
	
	$.Widget.prototype = {
		widgetName: "widget",
		widgetEventPrefix: "",
		defaultElement: "<div>",
	
		options: {
			classes: {},
			disabled: false,
	
			// Callbacks
			create: null
		},
	
		_createWidget: function( options, element ) {
			element = $( element || this.defaultElement || this )[ 0 ];
			this.element = $( element );
			this.uuid = widgetUuid++;
			this.eventNamespace = "." + this.widgetName + this.uuid;
	
			this.bindings = $();
			this.hoverable = $();
			this.focusable = $();
			this.classesElementLookup = {};
	
			if ( element !== this ) {
				$.data( element, this.widgetFullName, this );
				this._on( true, this.element, {
					remove: function( event ) {
						if ( event.target === element ) {
							this.destroy();
						}
					}
				} );
				this.document = $( element.style ?
	
					// Element within the document
					element.ownerDocument :
	
					// Element is window or document
					element.document || element );
				this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
			}
	
			this.options = $.widget.extend( {},
				this.options,
				this._getCreateOptions(),
				options );
	
			this._create();
	
			if ( this.options.disabled ) {
				this._setOptionDisabled( this.options.disabled );
			}
	
			this._trigger( "create", null, this._getCreateEventData() );
			this._init();
		},
	
		_getCreateOptions: function() {
			return {};
		},
	
		_getCreateEventData: $.noop,
	
		_create: $.noop,
	
		_init: $.noop,
	
		destroy: function() {
			var that = this;
	
			this._destroy();
			$.each( this.classesElementLookup, function( key, value ) {
				that._removeClass( value, key );
			} );
	
			// We can probably remove the unbind calls in 2.0
			// all event bindings should go through this._on()
			this.element
				.off( this.eventNamespace )
				.removeData( this.widgetFullName );
			this.widget()
				.off( this.eventNamespace )
				.removeAttr( "aria-disabled" );
	
			// Clean up events and states
			this.bindings.off( this.eventNamespace );
		},
	
		_destroy: $.noop,
	
		widget: function() {
			return this.element;
		},
	
		option: function( key, value ) {
			var options = key;
			var parts;
			var curOption;
			var i;
	
			if ( arguments.length === 0 ) {
	
				// Don't return a reference to the internal hash
				return $.widget.extend( {}, this.options );
			}
	
			if ( typeof key === "string" ) {
	
				// Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
				options = {};
				parts = key.split( "." );
				key = parts.shift();
				if ( parts.length ) {
					curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
					for ( i = 0; i < parts.length - 1; i++ ) {
						curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
						curOption = curOption[ parts[ i ] ];
					}
					key = parts.pop();
					if ( arguments.length === 1 ) {
						return curOption[ key ] === undefined ? null : curOption[ key ];
					}
					curOption[ key ] = value;
				} else {
					if ( arguments.length === 1 ) {
						return this.options[ key ] === undefined ? null : this.options[ key ];
					}
					options[ key ] = value;
				}
			}
	
			this._setOptions( options );
	
			return this;
		},
	
		_setOptions: function( options ) {
			var key;
	
			for ( key in options ) {
				this._setOption( key, options[ key ] );
			}
	
			return this;
		},
	
		_setOption: function( key, value ) {
			if ( key === "classes" ) {
				this._setOptionClasses( value );
			}
	
			this.options[ key ] = value;
	
			if ( key === "disabled" ) {
				this._setOptionDisabled( value );
			}
	
			return this;
		},
	
		_setOptionClasses: function( value ) {
			var classKey, elements, currentElements;
	
			for ( classKey in value ) {
				currentElements = this.classesElementLookup[ classKey ];
				if ( value[ classKey ] === this.options.classes[ classKey ] ||
						!currentElements ||
						!currentElements.length ) {
					continue;
				}
	
				// We are doing this to create a new jQuery object because the _removeClass() call
				// on the next line is going to destroy the reference to the current elements being
				// tracked. We need to save a copy of this collection so that we can add the new classes
				// below.
				elements = $( currentElements.get() );
				this._removeClass( currentElements, classKey );
	
				// We don't use _addClass() here, because that uses this.options.classes
				// for generating the string of classes. We want to use the value passed in from
				// _setOption(), this is the new value of the classes option which was passed to
				// _setOption(). We pass this value directly to _classes().
				elements.addClass( this._classes( {
					element: elements,
					keys: classKey,
					classes: value,
					add: true
				} ) );
			}
		},
	
		_setOptionDisabled: function( value ) {
			this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
	
			// If the widget is becoming disabled, then nothing is interactive
			if ( value ) {
				this._removeClass( this.hoverable, null, "ui-state-hover" );
				this._removeClass( this.focusable, null, "ui-state-focus" );
			}
		},
	
		enable: function() {
			return this._setOptions( { disabled: false } );
		},
	
		disable: function() {
			return this._setOptions( { disabled: true } );
		},
	
		_classes: function( options ) {
			var full = [];
			var that = this;
	
			options = $.extend( {
				element: this.element,
				classes: this.options.classes || {}
			}, options );
	
			function processClassString( classes, checkOption ) {
				var current, i;
				for ( i = 0; i < classes.length; i++ ) {
					current = that.classesElementLookup[ classes[ i ] ] || $();
					if ( options.add ) {
						current = $( $.unique( current.get().concat( options.element.get() ) ) );
					} else {
						current = $( current.not( options.element ).get() );
					}
					that.classesElementLookup[ classes[ i ] ] = current;
					full.push( classes[ i ] );
					if ( checkOption && options.classes[ classes[ i ] ] ) {
						full.push( options.classes[ classes[ i ] ] );
					}
				}
			}
	
			this._on( options.element, {
				"remove": "_untrackClassesElement"
			} );
	
			if ( options.keys ) {
				processClassString( options.keys.match( /\S+/g ) || [], true );
			}
			if ( options.extra ) {
				processClassString( options.extra.match( /\S+/g ) || [] );
			}
	
			return full.join( " " );
		},
	
		_untrackClassesElement: function( event ) {
			var that = this;
			$.each( that.classesElementLookup, function( key, value ) {
				if ( $.inArray( event.target, value ) !== -1 ) {
					that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
				}
			} );
		},
	
		_removeClass: function( element, keys, extra ) {
			return this._toggleClass( element, keys, extra, false );
		},
	
		_addClass: function( element, keys, extra ) {
			return this._toggleClass( element, keys, extra, true );
		},
	
		_toggleClass: function( element, keys, extra, add ) {
			add = ( typeof add === "boolean" ) ? add : extra;
			var shift = ( typeof element === "string" || element === null ),
				options = {
					extra: shift ? keys : extra,
					keys: shift ? element : keys,
					element: shift ? this.element : element,
					add: add
				};
			options.element.toggleClass( this._classes( options ), add );
			return this;
		},
	
		_on: function( suppressDisabledCheck, element, handlers ) {
			var delegateElement;
			var instance = this;
	
			// No suppressDisabledCheck flag, shuffle arguments
			if ( typeof suppressDisabledCheck !== "boolean" ) {
				handlers = element;
				element = suppressDisabledCheck;
				suppressDisabledCheck = false;
			}
	
			// No element argument, shuffle and use this.element
			if ( !handlers ) {
				handlers = element;
				element = this.element;
				delegateElement = this.widget();
			} else {
				element = delegateElement = $( element );
				this.bindings = this.bindings.add( element );
			}
	
			$.each( handlers, function( event, handler ) {
				function handlerProxy() {
	
					// Allow widgets to customize the disabled handling
					// - disabled as an array instead of boolean
					// - disabled class as method for disabling individual parts
					if ( !suppressDisabledCheck &&
							( instance.options.disabled === true ||
							$( this ).hasClass( "ui-state-disabled" ) ) ) {
						return;
					}
					return ( typeof handler === "string" ? instance[ handler ] : handler )
						.apply( instance, arguments );
				}
	
				// Copy the guid so direct unbinding works
				if ( typeof handler !== "string" ) {
					handlerProxy.guid = handler.guid =
						handler.guid || handlerProxy.guid || $.guid++;
				}
	
				var match = event.match( /^([\w:-]*)\s*(.*)$/ );
				var eventName = match[ 1 ] + instance.eventNamespace;
				var selector = match[ 2 ];
	
				if ( selector ) {
					delegateElement.on( eventName, selector, handlerProxy );
				} else {
					element.on( eventName, handlerProxy );
				}
			} );
		},
	
		_off: function( element, eventName ) {
			eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
				this.eventNamespace;
			element.off( eventName ).off( eventName );
	
			// Clear the stack to avoid memory leaks (#10056)
			this.bindings = $( this.bindings.not( element ).get() );
			this.focusable = $( this.focusable.not( element ).get() );
			this.hoverable = $( this.hoverable.not( element ).get() );
		},
	
		_delay: function( handler, delay ) {
			function handlerProxy() {
				return ( typeof handler === "string" ? instance[ handler ] : handler )
					.apply( instance, arguments );
			}
			var instance = this;
			return setTimeout( handlerProxy, delay || 0 );
		},
	
		_hoverable: function( element ) {
			this.hoverable = this.hoverable.add( element );
			this._on( element, {
				mouseenter: function( event ) {
					this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
				},
				mouseleave: function( event ) {
					this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
				}
			} );
		},
	
		_focusable: function( element ) {
			this.focusable = this.focusable.add( element );
			this._on( element, {
				focusin: function( event ) {
					this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
				},
				focusout: function( event ) {
					this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
				}
			} );
		},
	
		_trigger: function( type, event, data ) {
			var prop, orig;
			var callback = this.options[ type ];
	
			data = data || {};
			event = $.Event( event );
			event.type = ( type === this.widgetEventPrefix ?
				type :
				this.widgetEventPrefix + type ).toLowerCase();
	
			// The original event may come from any element
			// so we need to reset the target on the new event
			event.target = this.element[ 0 ];
	
			// Copy original event properties over to the new event
			orig = event.originalEvent;
			if ( orig ) {
				for ( prop in orig ) {
					if ( !( prop in event ) ) {
						event[ prop ] = orig[ prop ];
					}
				}
			}
	
			this.element.trigger( event, data );
			return !( $.isFunction( callback ) &&
				callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
				event.isDefaultPrevented() );
		}
	};
	
	$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
		$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
			if ( typeof options === "string" ) {
				options = { effect: options };
			}
	
			var hasOptions;
			var effectName = !options ?
				method :
				options === true || typeof options === "number" ?
					defaultEffect :
					options.effect || defaultEffect;
	
			options = options || {};
			if ( typeof options === "number" ) {
				options = { duration: options };
			}
	
			hasOptions = !$.isEmptyObject( options );
			options.complete = callback;
	
			if ( options.delay ) {
				element.delay( options.delay );
			}
	
			if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
				element[ method ]( options );
			} else if ( effectName !== method && element[ effectName ] ) {
				element[ effectName ]( options.duration, options.easing, callback );
			} else {
				element.queue( function( next ) {
					$( this )[ method ]();
					if ( callback ) {
						callback.call( element[ 0 ] );
					}
					next();
				} );
			}
		};
	} );
	
	return $.widget;
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/widget.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/keycode.js **/
jupyter.define('jquery-ui@1.12.1/ui/keycode.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Keycode 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Keycode
	//>>group: Core
	//>>description: Provide keycodes as keynames
	//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	return $.ui.keyCode = {
		BACKSPACE: 8,
		COMMA: 188,
		DELETE: 46,
		DOWN: 40,
		END: 35,
		ENTER: 13,
		ESCAPE: 27,
		HOME: 36,
		LEFT: 37,
		PAGE_DOWN: 34,
		PAGE_UP: 33,
		PERIOD: 190,
		RIGHT: 39,
		SPACE: 32,
		TAB: 9,
		UP: 38
	};
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/keycode.js **/


/** START DEFINE BLOCK for d3-format@0.5.1/build/d3-format.js **/
jupyter.define('d3-format@0.5.1/build/d3-format.js', function (module, exports, __jupyter_require__) {
	(function (global, factory) {
	   true ? factory(exports) :
	  typeof define === 'function' && define.amd ? define(['exports'], factory) :
	  (factory((global.d3_format = {})));
	}(this, function (exports) { 'use strict';
	
	  // Computes the decimal coefficient and exponent of the specified number x with
	  // significant digits p, where x is positive and p is in [1, 21] or undefined.
	  // For example, formatDecimal(1.23) returns ["123", 0].
	  function formatDecimal(x, p) {
	    if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
	    var i, coefficient = x.slice(0, i);
	
	    // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
	    // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
	    return [
	      coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
	      +x.slice(i + 1)
	    ];
	  }
	
	  function exponent(x) {
	    return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;
	  }
	
	  function formatGroup(grouping, thousands) {
	    return function(value, width) {
	      var i = value.length,
	          t = [],
	          j = 0,
	          g = grouping[0],
	          length = 0;
	
	      while (i > 0 && g > 0) {
	        if (length + g + 1 > width) g = Math.max(1, width - length);
	        t.push(value.substring(i -= g, i + g));
	        if ((length += g + 1) > width) break;
	        g = grouping[j = (j + 1) % grouping.length];
	      }
	
	      return t.reverse().join(thousands);
	    };
	  }
	
	  function formatDefault(x, p) {
	    x = x.toPrecision(p);
	
	    out: for (var n = x.length, i = 1, i0 = -1, i1; i < n; ++i) {
	      switch (x[i]) {
	        case ".": i0 = i1 = i; break;
	        case "0": if (i0 === 0) i0 = i; i1 = i; break;
	        case "e": break out;
	        default: if (i0 > 0) i0 = 0; break;
	      }
	    }
	
	    return i0 > 0 ? x.slice(0, i0) + x.slice(i1 + 1) : x;
	  }
	
	  var prefixExponent;
	
	  function formatPrefixAuto(x, p) {
	    var d = formatDecimal(x, p);
	    if (!d) return x + "";
	    var coefficient = d[0],
	        exponent = d[1],
	        i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
	        n = coefficient.length;
	    return i === n ? coefficient
	        : i > n ? coefficient + new Array(i - n + 1).join("0")
	        : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
	        : "0." + new Array(1 - i).join("0") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!
	  }
	
	  function formatRounded(x, p) {
	    var d = formatDecimal(x, p);
	    if (!d) return x + "";
	    var coefficient = d[0],
	        exponent = d[1];
	    return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
	        : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
	        : coefficient + new Array(exponent - coefficient.length + 2).join("0");
	  }
	
	  var formatTypes = {
	    "": formatDefault,
	    "%": function(x, p) { return (x * 100).toFixed(p); },
	    "b": function(x) { return Math.round(x).toString(2); },
	    "c": function(x) { return x + ""; },
	    "d": function(x) { return Math.round(x).toString(10); },
	    "e": function(x, p) { return x.toExponential(p); },
	    "f": function(x, p) { return x.toFixed(p); },
	    "g": function(x, p) { return x.toPrecision(p); },
	    "o": function(x) { return Math.round(x).toString(8); },
	    "p": function(x, p) { return formatRounded(x * 100, p); },
	    "r": formatRounded,
	    "s": formatPrefixAuto,
	    "X": function(x) { return Math.round(x).toString(16).toUpperCase(); },
	    "x": function(x) { return Math.round(x).toString(16); }
	  };
	
	  // [[fill]align][sign][symbol][0][width][,][.precision][type]
	  var re = /^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;
	
	  function formatSpecifier(specifier) {
	    return new FormatSpecifier(specifier);
	  }
	
	  function FormatSpecifier(specifier) {
	    if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
	
	    var match,
	        fill = match[1] || " ",
	        align = match[2] || ">",
	        sign = match[3] || "-",
	        symbol = match[4] || "",
	        zero = !!match[5],
	        width = match[6] && +match[6],
	        comma = !!match[7],
	        precision = match[8] && +match[8].slice(1),
	        type = match[9] || "";
	
	    // The "n" type is an alias for ",g".
	    if (type === "n") comma = true, type = "g";
	
	    // Map invalid types to the default format.
	    else if (!formatTypes[type]) type = "";
	
	    // If zero fill is specified, padding goes after sign and before digits.
	    if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
	
	    this.fill = fill;
	    this.align = align;
	    this.sign = sign;
	    this.symbol = symbol;
	    this.zero = zero;
	    this.width = width;
	    this.comma = comma;
	    this.precision = precision;
	    this.type = type;
	  }
	
	  FormatSpecifier.prototype.toString = function() {
	    return this.fill
	        + this.align
	        + this.sign
	        + this.symbol
	        + (this.zero ? "0" : "")
	        + (this.width == null ? "" : Math.max(1, this.width | 0))
	        + (this.comma ? "," : "")
	        + (this.precision == null ? "" : "." + Math.max(0, this.precision | 0))
	        + this.type;
	  };
	
	  var prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];
	
	  function identity(x) {
	    return x;
	  }
	
	  function locale(locale) {
	    var group = locale.grouping && locale.thousands ? formatGroup(locale.grouping, locale.thousands) : identity,
	        currency = locale.currency,
	        decimal = locale.decimal;
	
	    function newFormat(specifier) {
	      specifier = formatSpecifier(specifier);
	
	      var fill = specifier.fill,
	          align = specifier.align,
	          sign = specifier.sign,
	          symbol = specifier.symbol,
	          zero = specifier.zero,
	          width = specifier.width,
	          comma = specifier.comma,
	          precision = specifier.precision,
	          type = specifier.type;
	
	      // Compute the prefix and suffix.
	      // For SI-prefix, the suffix is lazily computed.
	      var prefix = symbol === "$" ? currency[0] : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
	          suffix = symbol === "$" ? currency[1] : /[%p]/.test(type) ? "%" : "";
	
	      // What format function should we use?
	      // Is this an integer type?
	      // Can this type generate exponential notation?
	      var formatType = formatTypes[type],
	          maybeSuffix = !type || /[defgprs%]/.test(type);
	
	      // Set the default precision if not specified,
	      // or clamp the specified precision to the supported range.
	      // For significant precision, it must be in [1, 21].
	      // For fixed precision, it must be in [0, 20].
	      precision = precision == null ? (type ? 6 : 12)
	          : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
	          : Math.max(0, Math.min(20, precision));
	
	      function format(value) {
	        var valuePrefix = prefix,
	            valueSuffix = suffix,
	            i, n, c;
	
	        if (type === "c") {
	          valueSuffix = formatType(value) + valueSuffix;
	          value = "";
	        } else {
	          value = +value;
	
	          // Convert negative to positive, and compute the prefix.
	          // Note that -0 is not less than 0, but 1 / -0 is!
	          var valueNegative = (value < 0 || 1 / value < 0) && (value *= -1, true);
	
	          // Perform the initial formatting.
	          value = formatType(value, precision);
	
	          // If the original value was negative, it may be rounded to zero during
	          // formatting; treat this as (positive) zero.
	          if (valueNegative) {
	            i = -1, n = value.length;
	            valueNegative = false;
	            while (++i < n) {
	              if (c = value.charCodeAt(i), (48 < c && c < 58)
	                  || (type === "x" && 96 < c && c < 103)
	                  || (type === "X" && 64 < c && c < 71)) {
	                valueNegative = true;
	                break;
	              }
	            }
	          }
	
	          // Compute the prefix and suffix.
	          valuePrefix = (valueNegative ? (sign === "(" ? sign : "-") : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
	          valueSuffix = valueSuffix + (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + (valueNegative && sign === "(" ? ")" : "");
	
	          // Break the formatted value into the integer “value” part that can be
	          // grouped, and fractional or exponential “suffix” part that is not.
	          if (maybeSuffix) {
	            i = -1, n = value.length;
	            while (++i < n) {
	              if (c = value.charCodeAt(i), 48 > c || c > 57) {
	                valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
	                value = value.slice(0, i);
	                break;
	              }
	            }
	          }
	        }
	
	        // If the fill character is not "0", grouping is applied before padding.
	        if (comma && !zero) value = group(value, Infinity);
	
	        // Compute the padding.
	        var length = valuePrefix.length + value.length + valueSuffix.length,
	            padding = length < width ? new Array(width - length + 1).join(fill) : "";
	
	        // If the fill character is "0", grouping is applied after padding.
	        if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
	
	        // Reconstruct the final output based on the desired alignment.
	        switch (align) {
	          case "<": return valuePrefix + value + valueSuffix + padding;
	          case "=": return valuePrefix + padding + value + valueSuffix;
	          case "^": return padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
	        }
	        return padding + valuePrefix + value + valueSuffix;
	      }
	
	      format.toString = function() {
	        return specifier + "";
	      };
	
	      return format;
	    }
	
	    function formatPrefix(specifier, value) {
	      var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
	          e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
	          k = Math.pow(10, -e),
	          prefix = prefixes[8 + e / 3];
	      return function(value) {
	        return f(k * value) + prefix;
	      };
	    }
	
	    return {
	      format: newFormat,
	      formatPrefix: formatPrefix
	    };
	  }
	
	  var defaultLocale = locale({
	    decimal: ".",
	    thousands: ",",
	    grouping: [3],
	    currency: ["$", ""]
	  });
	
	  var caES = locale({
	    decimal: ",",
	    thousands: ".",
	    grouping: [3],
	    currency: ["", "\xa0€"]
	  });
	
	  var csCZ = locale({
	    decimal: ",",
	    thousands: "\xa0",
	    grouping: [3],
	    currency: ["", "\xa0Kč"]
	  });
	
	  var deCH = locale({
	    decimal: ",",
	    thousands: "'",
	    grouping: [3],
	    currency: ["", "\xa0CHF"]
	  });
	
	  var deDE = locale({
	    decimal: ",",
	    thousands: ".",
	    grouping: [3],
	    currency: ["", "\xa0€"]
	  });
	
	  var enCA = locale({
	    decimal: ".",
	    thousands: ",",
	    grouping: [3],
	    currency: ["$", ""]
	  });
	
	  var enGB = locale({
	    decimal: ".",
	    thousands: ",",
	    grouping: [3],
	    currency: ["£", ""]
	  });
	
	  var esES = locale({
	    decimal: ",",
	    thousands: ".",
	    grouping: [3],
	    currency: ["", "\xa0€"]
	  });
	
	  var fiFI = locale({
	    decimal: ",",
	    thousands: "\xa0",
	    grouping: [3],
	    currency: ["", "\xa0€"]
	  });
	
	  var frCA = locale({
	    decimal: ",",
	    thousands: "\xa0",
	    grouping: [3],
	    currency: ["", "$"]
	  });
	
	  var frFR = locale({
	    decimal: ",",
	    thousands: ".",
	    grouping: [3],
	    currency: ["", "\xa0€"]
	  });
	
	  var heIL = locale({
	    decimal: ".",
	    thousands: ",",
	    grouping: [3],
	    currency: ["₪", ""]
	  });
	
	  var huHU = locale({
	    decimal: ",",
	    thousands: "\xa0",
	    grouping: [3],
	    currency: ["", "\xa0Ft"]
	  });
	
	  var itIT = locale({
	    decimal: ",",
	    thousands: ".",
	    grouping: [3],
	    currency: ["€", ""]
	  });
	
	  var jaJP = locale({
	    decimal: ".",
	    thousands: ",",
	    grouping: [3],
	    currency: ["", "円"]
	  });
	
	  var koKR = locale({
	    decimal: ".",
	    thousands: ",",
	    grouping: [3],
	    currency: ["₩", ""]
	  });
	
	  var mkMK = locale({
	    decimal: ",",
	    thousands: ".",
	    grouping: [3],
	    currency: ["", "\xa0ден."]
	  });
	
	  var nlNL = locale({
	    decimal: ",",
	    thousands: ".",
	    grouping: [3],
	    currency: ["€\xa0", ""]
	  });
	
	  var plPL = locale({
	    decimal: ",",
	    thousands: ".",
	    grouping: [3],
	    currency: ["", "zł"]
	  });
	
	  var ptBR = locale({
	    decimal: ",",
	    thousands: ".",
	    grouping: [3],
	    currency: ["R$", ""]
	  });
	
	  var ruRU = locale({
	    decimal: ",",
	    thousands: "\xa0",
	    grouping: [3],
	    currency: ["", "\xa0руб."]
	  });
	
	  var svSE = locale({
	    decimal: ",",
	    thousands: "\xa0",
	    grouping: [3],
	    currency: ["", "SEK"]
	  });
	
	  var zhCN = locale({
	    decimal: ".",
	    thousands: ",",
	    grouping: [3],
	    currency: ["¥", ""]
	  });
	
	  function precisionFixed(step) {
	    return Math.max(0, -exponent(Math.abs(step)));
	  }
	
	  function precisionPrefix(step, value) {
	    return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
	  }
	
	  function precisionRound(step, max) {
	    step = Math.abs(step), max = Math.abs(max) - step;
	    return Math.max(0, exponent(max) - exponent(step)) + 1;
	  }
	
	  var format = defaultLocale.format;
	  var formatPrefix = defaultLocale.formatPrefix;
	
	  var version = "0.5.1";
	
	  exports.version = version;
	  exports.format = format;
	  exports.formatPrefix = formatPrefix;
	  exports.formatLocale = locale;
	  exports.formatCaEs = caES;
	  exports.formatCsCz = csCZ;
	  exports.formatDeCh = deCH;
	  exports.formatDeDe = deDE;
	  exports.formatEnCa = enCA;
	  exports.formatEnGb = enGB;
	  exports.formatEnUs = defaultLocale;
	  exports.formatEsEs = esES;
	  exports.formatFiFi = fiFI;
	  exports.formatFrCa = frCA;
	  exports.formatFrFr = frFR;
	  exports.formatHeIl = heIL;
	  exports.formatHuHu = huHU;
	  exports.formatItIt = itIT;
	  exports.formatJaJp = jaJP;
	  exports.formatKoKr = koKR;
	  exports.formatMkMk = mkMK;
	  exports.formatNlNl = nlNL;
	  exports.formatPlPl = plPL;
	  exports.formatPtBr = ptBR;
	  exports.formatRuRu = ruRU;
	  exports.formatSvSe = svSE;
	  exports.formatZhCn = zhCN;
	  exports.formatSpecifier = formatSpecifier;
	  exports.precisionFixed = precisionFixed;
	  exports.precisionPrefix = precisionPrefix;
	  exports.precisionRound = precisionRound;
	
	}));
})
/** END DEFINE BLOCK for d3-format@0.5.1/build/d3-format.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_float.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_float.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var widget_int_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_int.js');
	var d3format = __jupyter_require__('d3-format@^0.5.1/build/d3-format.js').format;
	var FloatModel = (function (_super) {
	    __extends(FloatModel, _super);
	    function FloatModel() {
	        _super.apply(this, arguments);
	    }
	    FloatModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: "FloatModel",
	            value: 0,
	            disabled: false,
	        });
	    };
	    return FloatModel;
	}(widget_core_1.CoreLabeledDOMWidgetModel));
	exports.FloatModel = FloatModel;
	var BoundedFloatModel = (function (_super) {
	    __extends(BoundedFloatModel, _super);
	    function BoundedFloatModel() {
	        _super.apply(this, arguments);
	    }
	    BoundedFloatModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: "BoundedFloatModel",
	            step: 1.0,
	            max: 100.0,
	            min: 0.0
	        });
	    };
	    return BoundedFloatModel;
	}(FloatModel));
	exports.BoundedFloatModel = BoundedFloatModel;
	var FloatSliderModel = (function (_super) {
	    __extends(FloatSliderModel, _super);
	    function FloatSliderModel() {
	        _super.apply(this, arguments);
	    }
	    FloatSliderModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: "FloatSliderModel",
	            _view_name: "FloatSliderView",
	            orientation: "horizontal",
	            _range: false,
	            readout: true,
	            readout_format: '.2f',
	            slider_color: null,
	            continuous_update: true
	        });
	    };
	    FloatSliderModel.prototype.initialize = function (attributes, options) {
	        _super.prototype.initialize.call(this, attributes, options);
	        this.on('change:readout_format', this.update_readout_format, this);
	        this.update_readout_format();
	    };
	    FloatSliderModel.prototype.update_readout_format = function () {
	        this.readout_formatter = d3format(this.get('readout_format'));
	    };
	    return FloatSliderModel;
	}(BoundedFloatModel));
	exports.FloatSliderModel = FloatSliderModel;
	var FloatSliderView = (function (_super) {
	    __extends(FloatSliderView, _super);
	    function FloatSliderView() {
	        _super.apply(this, arguments);
	        this._parse_value = parseFloat;
	        // matches: whitespace?, float, whitespace?, [-:], whitespace?, float
	        this._range_regex = /^\s*([+-]?(?:\d*\.?\d+|\d+\.)(?:[eE][+-]?\d+)?)\s*[-:]\s*([+-]?(?:\d*\.?\d+|\d+\.)(?:[eE][+-]?\d+)?)/;
	    }
	    /**
	     * Validate the value of the slider before sending it to the back-end
	     * and applying it to the other views on the page.
	     */
	    FloatSliderView.prototype._validate_slide_value = function (x) {
	        return x;
	    };
	    return FloatSliderView;
	}(widget_int_1.IntSliderView));
	exports.FloatSliderView = FloatSliderView;
	var FloatTextModel = (function (_super) {
	    __extends(FloatTextModel, _super);
	    function FloatTextModel() {
	        _super.apply(this, arguments);
	    }
	    FloatTextModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: "FloatTextModel",
	            _view_name: "FloatTextView"
	        });
	    };
	    return FloatTextModel;
	}(FloatModel));
	exports.FloatTextModel = FloatTextModel;
	var FloatTextView = (function (_super) {
	    __extends(FloatTextView, _super);
	    function FloatTextView() {
	        _super.apply(this, arguments);
	        this._parse_value = parseFloat;
	    }
	    return FloatTextView;
	}(widget_int_1.IntTextView));
	exports.FloatTextView = FloatTextView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_float.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_controller.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_controller.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var utils = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/utils.js');
	var ControllerButtonModel = (function (_super) {
	    __extends(ControllerButtonModel, _super);
	    function ControllerButtonModel() {
	        _super.apply(this, arguments);
	    }
	    ControllerButtonModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'ControllerButtonModel',
	            _view_name: 'ControllerButtonView',
	            value: 0.0,
	            pressed: false
	        });
	    };
	    return ControllerButtonModel;
	}(widget_core_1.CoreDOMWidgetModel));
	exports.ControllerButtonModel = ControllerButtonModel;
	/**
	 * Very simple view for a gamepad button.
	 */
	var ControllerButtonView = (function (_super) {
	    __extends(ControllerButtonView, _super);
	    function ControllerButtonView() {
	        _super.apply(this, arguments);
	    }
	    ControllerButtonView.prototype.render = function () {
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-controller-button');
	        this.support = document.createElement('div');
	        this.support.style.position = 'relative';
	        this.support.style.margin = '1px';
	        this.support.style.width = '16px';
	        this.support.style.height = '16px';
	        this.support.style.border = '1px solid black';
	        this.support.style.background = 'lightgray';
	        this.el.appendChild(this.support);
	        this.bar = document.createElement('div');
	        this.bar.style.position = 'absolute';
	        this.bar.style.width = '100%';
	        this.bar.style.bottom = '0px';
	        this.bar.style.background = 'gray';
	        this.support.appendChild(this.bar);
	        this.update();
	        this.label = document.createElement('div');
	        this.label.textContent = this.model.get('description');
	        this.label.style.textAlign = 'center';
	        this.el.appendChild(this.label);
	    };
	    ControllerButtonView.prototype.update = function () {
	        this.bar.style.height = (100 * this.model.get('value')) + '%';
	    };
	    return ControllerButtonView;
	}(widget_1.DOMWidgetView));
	exports.ControllerButtonView = ControllerButtonView;
	var ControllerAxisModel = (function (_super) {
	    __extends(ControllerAxisModel, _super);
	    function ControllerAxisModel() {
	        _super.apply(this, arguments);
	    }
	    ControllerAxisModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'ControllerAxisModel',
	            _view_name: 'ControllerAxisView',
	            value: 0.0
	        });
	    };
	    return ControllerAxisModel;
	}(widget_core_1.CoreDOMWidgetModel));
	exports.ControllerAxisModel = ControllerAxisModel;
	/**
	 * Very simple view for a gamepad axis.
	 */
	var ControllerAxisView = (function (_super) {
	    __extends(ControllerAxisView, _super);
	    function ControllerAxisView() {
	        _super.apply(this, arguments);
	    }
	    ControllerAxisView.prototype.render = function () {
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-controller-axis');
	        this.el.style.width = '16px';
	        this.el.style.padding = '4px';
	        this.support = document.createElement('div');
	        this.support.style.position = 'relative';
	        this.support.style.margin = '1px';
	        this.support.style.width = '4px';
	        this.support.style.height = '64px';
	        this.support.style.border = '1px solid black';
	        this.support.style.background = 'lightgray';
	        this.bullet = document.createElement('div');
	        this.bullet.style.position = 'absolute';
	        this.bullet.style.margin = '-4px';
	        this.bullet.style.width = '10px';
	        this.bullet.style.height = '10px';
	        this.bullet.style.background = 'gray';
	        this.label = document.createElement('div');
	        this.label.textContent = this.model.get('description');
	        this.label.style.textAlign = 'center';
	        this.support.appendChild(this.bullet);
	        this.el.appendChild(this.support);
	        this.el.appendChild(this.label);
	        this.update();
	    };
	    ControllerAxisView.prototype.update = function () {
	        this.bullet.style.top = (50 * (this.model.get('value') + 1)) + '%';
	    };
	    return ControllerAxisView;
	}(widget_1.DOMWidgetView));
	exports.ControllerAxisView = ControllerAxisView;
	var ControllerModel = (function (_super) {
	    __extends(ControllerModel, _super);
	    function ControllerModel() {
	        _super.apply(this, arguments);
	    }
	    ControllerModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'ControllerModel',
	            _view_name: 'ControllerView',
	            index: 0,
	            name: '',
	            mapping: '',
	            connected: false,
	            timestamp: 0,
	            buttons: [],
	            axes: []
	        });
	    };
	    ControllerModel.prototype.initialize = function (attributes, options) {
	        _super.prototype.initialize.call(this, attributes, options);
	        if (navigator.getGamepads === void 0) {
	            // Checks if the browser supports the gamepad API
	            this.readout = 'This browser does not support gamepads.';
	            console.error(this.readout);
	        }
	        else {
	            // Start the wait loop, and listen to updates of the only
	            // user-provided attribute, the gamepad index.
	            this.readout = 'Connect gamepad and press any button.';
	            if (this.get('connected')) {
	                // No need to re-create Button and Axis widgets, re-use
	                // the models provided by the backend which may already
	                // be wired to other things.
	                this.update_loop();
	            }
	            else {
	                // Wait for a gamepad to be connected.
	                this.wait_loop();
	            }
	        }
	    };
	    /**
	     * Waits for a gamepad to be connected at the provided index.
	     * Once one is connected, it will start the update loop, which
	     * populates the update of axes and button values.
	     */
	    ControllerModel.prototype.wait_loop = function () {
	        var index = this.get('index');
	        var pad = navigator.getGamepads()[index];
	        if (pad) {
	            var that = this;
	            this.setup(pad).then(function (controls) {
	                that.set(controls);
	                that.save_changes();
	                window.requestAnimationFrame(that.update_loop.bind(that));
	            });
	        }
	        else {
	            window.requestAnimationFrame(this.wait_loop.bind(this));
	        }
	    };
	    /**
	     * Given a native gamepad object, returns a promise for a dictionary of
	     * controls, of the form
	     * {
	     *     buttons: list of Button models,
	     *     axes: list of Axis models,
	     * }
	     */
	    ControllerModel.prototype.setup = function (pad) {
	        // Set up the main gamepad attributes
	        this.set({
	            name: pad.id,
	            mapping: pad.mapping,
	            connected: pad.connected,
	            timestamp: pad.timestamp
	        });
	        // Create buttons and axes. When done, start the update loop
	        var that = this;
	        return utils.resolvePromisesDict({
	            buttons: Promise.all(pad.buttons.map(function (btn, index) {
	                return that._create_button_model(index);
	            })),
	            axes: Promise.all(pad.axes.map(function (axis, index) {
	                return that._create_axis_model(index);
	            })),
	        });
	    };
	    /**
	     * Update axes and buttons values, until the gamepad is disconnected.
	     * When the gamepad is disconnected, this.reset_gamepad is called.
	     */
	    ControllerModel.prototype.update_loop = function () {
	        var index = this.get('index');
	        var id = this.get('name');
	        var pad = navigator.getGamepads()[index];
	        if (pad && index === pad.index && id === pad.id) {
	            this.set({
	                timestamp: pad.timestamp,
	                connected: pad.connected
	            });
	            this.save_changes();
	            this.get('buttons').forEach(function (model, index) {
	                model.set({
	                    value: pad.buttons[index].value,
	                    pressed: pad.buttons[index].pressed
	                });
	                model.save_changes();
	            });
	            this.get('axes').forEach(function (model, index) {
	                model.set('value', pad.axes[index]);
	                model.save_changes();
	            });
	            window.requestAnimationFrame(this.update_loop.bind(this));
	        }
	        else {
	            this.reset_gamepad();
	        }
	    };
	    /**
	     * Resets the gamepad attributes, and start the wait_loop.
	     */
	    ControllerModel.prototype.reset_gamepad = function () {
	        this.get('buttons').forEach(function (button) {
	            button.close();
	        });
	        this.get('axes').forEach(function (axis) {
	            axis.close();
	        });
	        this.set({
	            name: '',
	            mapping: '',
	            connected: false,
	            timestamp: 0.0,
	            buttons: [],
	            axes: []
	        });
	        this.save_changes();
	        window.requestAnimationFrame(this.wait_loop.bind(this));
	    };
	    /**
	     * Creates a gamepad button widget.
	     */
	    ControllerModel.prototype._create_button_model = function (index) {
	        return this.widget_manager.new_widget({
	            model_name: 'ControllerButtonModel',
	            model_module: 'jupyter-js-widgets',
	            model_module_version: this.get('_model_module_version'),
	            widget_class: 'Jupyter.ControllerButton',
	        }).then(function (model) {
	            model.set('description', index);
	            return model;
	        });
	    };
	    /**
	     * Creates a gamepad axis widget.
	     */
	    ControllerModel.prototype._create_axis_model = function (index) {
	        return this.widget_manager.new_widget({
	            model_name: 'ControllerAxisModel',
	            model_module: 'jupyter-js-widgets',
	            model_module_version: this.get('_model_module_version'),
	            widget_class: 'Jupyter.ControllerAxis',
	        }).then(function (model) {
	            model.set('description', index);
	            return model;
	        });
	    };
	    ControllerModel.serializers = _.extend({
	        buttons: { deserialize: widget_1.unpack_models },
	        axes: { deserialize: widget_1.unpack_models }
	    }, widget_core_1.CoreDOMWidgetModel.serializers);
	    return ControllerModel;
	}(widget_core_1.CoreDOMWidgetModel));
	exports.ControllerModel = ControllerModel;
	/**
	 * A simple view for a gamepad.
	 */
	var ControllerView = (function (_super) {
	    __extends(ControllerView, _super);
	    function ControllerView() {
	        _super.apply(this, arguments);
	    }
	    ControllerView.prototype.initialize = function (parameters) {
	        _super.prototype.initialize.call(this, parameters);
	        this.button_views = new widget_1.ViewList(this.add_button, null, this);
	        this.listenTo(this.model, 'change:buttons', function (model, value) {
	            this.button_views.update(value);
	        });
	        this.axis_views = new widget_1.ViewList(this.add_axis, null, this);
	        this.listenTo(this.model, 'change:axes', function (model, value) {
	            this.axis_views.update(value);
	        });
	        this.listenTo(this.model, 'change:name', this.update_label);
	    };
	    ControllerView.prototype.render = function () {
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-controller');
	        this.box = this.el;
	        this.label = document.createElement('div');
	        this.box.appendChild(this.label);
	        this.axis_box = document.createElement('div');
	        this.axis_box.style.display = 'flex';
	        this.box.appendChild(this.axis_box);
	        this.button_box = document.createElement('div');
	        this.button_box.style.display = 'flex';
	        this.box.appendChild(this.button_box);
	        this.button_views.update(this.model.get('buttons'));
	        this.axis_views.update(this.model.get('axes'));
	        this.update_label();
	    };
	    ControllerView.prototype.update_label = function () {
	        this.label.textContent = this.model.get('name') || this.model.readout;
	    };
	    ControllerView.prototype.add_button = function (model) {
	        var that = this;
	        var dummy = document.createElement('div');
	        that.button_box.appendChild(dummy);
	        return this.create_child_view(model).then(function (view) {
	            that.button_box.replaceChild(view.el, dummy);
	            that.displayed.then(function () {
	                view.trigger('displayed', that);
	            });
	            return view;
	        }).catch(utils.reject('Could not add button view', true));
	    };
	    ControllerView.prototype.add_axis = function (model) {
	        var that = this;
	        var dummy = document.createElement('div');
	        that.axis_box.appendChild(dummy);
	        return this.create_child_view(model).then(function (view) {
	            that.axis_box.replaceChild(view.el, dummy);
	            that.displayed.then(function () {
	                view.trigger('displayed', that);
	            });
	            return view;
	        }).catch(utils.reject('Could not add axis view', true));
	    };
	    ControllerView.prototype.remove = function () {
	        _super.prototype.remove.call(this);
	        this.button_views.remove();
	        this.axis_views.remove();
	    };
	    return ControllerView;
	}(widget_1.DOMWidgetView));
	exports.ControllerView = ControllerView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_controller.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_selection.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_selection.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_core_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_core.js');
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var utils = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/utils.js');
	var $ = __jupyter_require__('jquery@^3.1.1/dist/jquery.js');
	function scrollIfNeeded(area, elem) {
	    var ar = area.getBoundingClientRect();
	    var er = elem.getBoundingClientRect();
	    if (er.top < ar.top) {
	        area.scrollTop -= ar.top - er.top;
	    }
	    else if (er.bottom > ar.bottom) {
	        area.scrollTop += er.bottom - ar.bottom;
	    }
	}
	var SelectionModel = (function (_super) {
	    __extends(SelectionModel, _super);
	    function SelectionModel() {
	        _super.apply(this, arguments);
	    }
	    SelectionModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'SelectionModel',
	            value: '',
	            _options_labels: [],
	            disabled: false,
	        });
	    };
	    return SelectionModel;
	}(widget_core_1.CoreLabeledDOMWidgetModel));
	exports.SelectionModel = SelectionModel;
	var SelectModel = (function (_super) {
	    __extends(SelectModel, _super);
	    function SelectModel() {
	        _super.apply(this, arguments);
	    }
	    SelectModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'SelectModel',
	            _view_name: 'SelectView'
	        });
	    };
	    return SelectModel;
	}(SelectionModel));
	exports.SelectModel = SelectModel;
	var SelectView = (function (_super) {
	    __extends(SelectView, _super);
	    function SelectView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Public constructor.
	     */
	    SelectView.prototype.initialize = function (parameters) {
	        var _this = this;
	        _super.prototype.initialize.call(this, parameters);
	        this.listenTo(this.model, 'change:_options_labels', function () { return _this._updateOptions(); });
	    };
	    /**
	     * Called when view is rendered.
	     */
	    SelectView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-select');
	        this.listbox = document.createElement('select');
	        this.el.appendChild(this.listbox);
	        this._updateOptions();
	        this.update();
	    };
	    /**
	     * Update the contents of this view
	     */
	    SelectView.prototype.update = function () {
	        // Disable listbox if needed
	        this.listbox.disabled = this.model.get('disabled');
	        // Select the correct element
	        var value = this.model.get('value');
	        this.listbox.selectedIndex = this.model.get('_options_labels').indexOf(value);
	        return _super.prototype.update.call(this);
	    };
	    SelectView.prototype._updateOptions = function () {
	        this.listbox.textContent = '';
	        var items = this.model.get('_options_labels');
	        for (var i = 0; i < items.length; i++) {
	            var item = items[i];
	            var option = document.createElement('option');
	            option.textContent = item.replace(/ /g, '\xa0'); // space -> &nbsp;
	            option.setAttribute('data-value', encodeURIComponent(item));
	            option.value = item;
	            this.listbox.appendChild(option);
	        }
	    };
	    SelectView.prototype.events = function () {
	        return {
	            'change select': '_handle_change'
	        };
	    };
	    /**
	     * Handle when a new value is selected.
	     */
	    SelectView.prototype._handle_change = function () {
	        var value = this.listbox.options[this.listbox.selectedIndex].value;
	        this.model.set('value', value);
	        this.touch();
	    };
	    return SelectView;
	}(widget_1.LabeledDOMWidgetView));
	exports.SelectView = SelectView;
	var DropdownModel = (function (_super) {
	    __extends(DropdownModel, _super);
	    function DropdownModel() {
	        _super.apply(this, arguments);
	    }
	    DropdownModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'DropdownModel',
	            _view_name: 'DropdownView',
	            button_style: ''
	        });
	    };
	    return DropdownModel;
	}(SelectionModel));
	exports.DropdownModel = DropdownModel;
	// TODO: Make a phosphor dropdown control, wrapped in DropdownView. Also, fix
	// bugs in keyboard handling. See
	// https://github.com/ipython/ipywidgets/issues/1055 and
	// https://github.com/ipython/ipywidgets/issues/1049
	// For now, we subclass SelectView to provide DropdownView
	// For the old code, see commit f68bfbc566f3a78a8f3350b438db8ed523ce3642
	var DropdownView = (function (_super) {
	    __extends(DropdownView, _super);
	    function DropdownView() {
	        _super.apply(this, arguments);
	    }
	    return DropdownView;
	}(SelectView));
	exports.DropdownView = DropdownView;
	var RadioButtonsModel = (function (_super) {
	    __extends(RadioButtonsModel, _super);
	    function RadioButtonsModel() {
	        _super.apply(this, arguments);
	    }
	    RadioButtonsModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'RadioButtonsModel',
	            _view_name: 'RadioButtonsView',
	            tooltips: [],
	            icons: [],
	            button_style: ''
	        });
	    };
	    return RadioButtonsModel;
	}(SelectionModel));
	exports.RadioButtonsModel = RadioButtonsModel;
	var RadioButtonsView = (function (_super) {
	    __extends(RadioButtonsView, _super);
	    function RadioButtonsView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    RadioButtonsView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-radio');
	        this.container = document.createElement('div');
	        this.el.appendChild(this.container);
	        this.container.classList.add('widget-radio-box');
	        this.update();
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed.  The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    RadioButtonsView.prototype.update = function (options) {
	        var view = this;
	        var items = this.model.get('_options_labels');
	        var radios = _.pluck(this.container.querySelectorAll('input[type="radio"]'), 'value');
	        var stale = false;
	        for (var i = 0, len = items.length; i < len; ++i) {
	            if (radios[i] !== items[i]) {
	                stale = true;
	                break;
	            }
	        }
	        if (stale && (options === undefined || options.updated_view !== this)) {
	            // Add items to the DOM.
	            this.container.textContent = '';
	            _.each(items, function (item) {
	                var label = document.createElement('label');
	                label.textContent = item;
	                view.container.appendChild(label);
	                var radio = document.createElement('input');
	                radio.setAttribute('type', 'radio');
	                radio.value = item;
	                radio.setAttribute('data-value', encodeURIComponent(item));
	                label.appendChild(radio);
	            });
	        }
	        _.each(items, function (item) {
	            var item_query = 'input[data-value="' +
	                encodeURIComponent(item) + '"]';
	            var radio = view.container.querySelectorAll(item_query);
	            if (radio.length > 0) {
	                var radio_el = radio[0];
	                radio_el.checked = view.model.get('value') === item;
	                radio_el.disabled = view.model.get('disabled');
	            }
	        });
	        return _super.prototype.update.call(this, options);
	    };
	    RadioButtonsView.prototype.events = function () {
	        return {
	            'click input[type="radio"]': '_handle_click'
	        };
	    };
	    /**
	     * Handle when a value is clicked.
	     *
	     * Calling model.set will trigger all of the other views of the
	     * model to update.
	     */
	    RadioButtonsView.prototype._handle_click = function (event) {
	        var value = event.target.value;
	        this.model.set('value', value, { updated_view: this });
	        this.touch();
	    };
	    return RadioButtonsView;
	}(widget_1.LabeledDOMWidgetView));
	exports.RadioButtonsView = RadioButtonsView;
	var ToggleButtonsModel = (function (_super) {
	    __extends(ToggleButtonsModel, _super);
	    function ToggleButtonsModel() {
	        _super.apply(this, arguments);
	    }
	    ToggleButtonsModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'ToggleButtonsModel',
	            _view_name: 'ToggleButtonsView'
	        });
	    };
	    return ToggleButtonsModel;
	}(SelectionModel));
	exports.ToggleButtonsModel = ToggleButtonsModel;
	var ToggleButtonsView = (function (_super) {
	    __extends(ToggleButtonsView, _super);
	    function ToggleButtonsView() {
	        _super.apply(this, arguments);
	    }
	    ToggleButtonsView.prototype.initialize = function (options) {
	        this._css_state = {};
	        _super.prototype.initialize.call(this, options);
	        this.listenTo(this.model, 'change:button_style', this.update_button_style);
	    };
	    /**
	     * Called when view is rendered.
	     */
	    ToggleButtonsView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-toggle-buttons');
	        this.buttongroup = document.createElement('div');
	        this.el.appendChild(this.buttongroup);
	        this.update();
	        this.set_button_style();
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed.  The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    ToggleButtonsView.prototype.update = function (options) {
	        var view = this;
	        var items = this.model.get('_options_labels');
	        var icons = this.model.get('icons') || [];
	        var previous_icons = this.model.previous('icons') || [];
	        var previous_bstyle = ToggleButtonsView.classMap[this.model.previous('button_style')] || '';
	        var tooltips = view.model.get('tooltips') || [];
	        var disabled = this.model.get('disabled');
	        var buttons = this.buttongroup.querySelectorAll('button');
	        var values = _.pluck(buttons, 'value');
	        var stale = false;
	        for (var i = 0, len = items.length; i < len; ++i) {
	            if (values[i] !== items[i] || icons[i] !== previous_icons[i]) {
	                stale = true;
	                break;
	            }
	        }
	        if (stale && options === undefined || options.updated_view !== this) {
	            // Add items to the DOM.
	            this.buttongroup.textContent = '';
	            _.each(items, function (item, index) {
	                var item_html;
	                var empty = item.trim().length === 0 &&
	                    (!icons[index] || icons[index].trim().length === 0);
	                if (empty) {
	                    item_html = '&nbsp;';
	                }
	                else {
	                    item_html = utils.escape_html(item);
	                }
	                var icon = document.createElement('i');
	                var button = document.createElement('button');
	                if (icons[index]) {
	                    icon.className = 'fa fa-' + icons[index];
	                }
	                button.setAttribute('type', 'button');
	                button.className = 'widget-toggle-button jupyter-button';
	                if (previous_bstyle) {
	                    button.classList.add(previous_bstyle);
	                }
	                button.innerHTML = item_html;
	                button.setAttribute('data-value', encodeURIComponent(item));
	                button.setAttribute('value', item);
	                button.appendChild(icon);
	                button.disabled = disabled;
	                if (tooltips[index]) {
	                    button.setAttribute('title', tooltips[index]);
	                }
	                view.update_style_traits(button);
	                view.buttongroup.appendChild(button);
	            });
	        }
	        // Select active button.
	        _.each(items, function (item) {
	            var item_query = '[data-value="' + encodeURIComponent(item) + '"]';
	            var button = view.buttongroup.querySelector(item_query);
	            if (view.model.get('value') === item) {
	                button.classList.add('mod-active');
	            }
	            else {
	                button.classList.remove('mod-active');
	            }
	        });
	        return _super.prototype.update.call(this, options);
	    };
	    ToggleButtonsView.prototype.update_style_traits = function (button) {
	        for (var name in this._css_state) {
	            if (this._css_state.hasOwnProperty(name)) {
	                if (name === 'margin') {
	                    this.buttongroup.style[name] = this._css_state[name];
	                }
	                else if (name !== 'width') {
	                    if (button) {
	                        button.style[name] = this._css_state[name];
	                    }
	                    else {
	                        var buttons = this.buttongroup
	                            .querySelectorAll('button');
	                        if (buttons.length) {
	                            buttons[0].style[name] = this._css_state[name];
	                        }
	                    }
	                }
	            }
	        }
	    };
	    ToggleButtonsView.prototype.update_button_style = function () {
	        var _this = this;
	        var buttons = this.buttongroup.querySelectorAll('button');
	        _.each(buttons, function (button) {
	            _this.update_mapped_classes(ToggleButtonsView.classMap, 'button_style', button);
	        });
	    };
	    ToggleButtonsView.prototype.set_button_style = function () {
	        var _this = this;
	        var buttons = this.buttongroup.querySelectorAll('button');
	        _.each(buttons, function (button) {
	            _this.set_mapped_classes(ToggleButtonsView.classMap, 'button_style', button);
	        });
	    };
	    ToggleButtonsView.prototype.events = function () {
	        return {
	            'click button': '_handle_click'
	        };
	    };
	    /**
	     * Handle when a value is clicked.
	     *
	     * Calling model.set will trigger all of the other views of the
	     * model to update.
	     */
	    ToggleButtonsView.prototype._handle_click = function (event) {
	        var value = event.target.value;
	        this.model.set('value', value, { updated_view: this });
	        this.touch();
	    };
	    return ToggleButtonsView;
	}(widget_1.LabeledDOMWidgetView));
	exports.ToggleButtonsView = ToggleButtonsView;
	var ToggleButtonsView;
	(function (ToggleButtonsView) {
	    ToggleButtonsView.classMap = {
	        primary: ['mod-primary'],
	        success: ['mod-success'],
	        info: ['mod-info'],
	        warning: ['mod-warning'],
	        danger: ['mod-danger']
	    };
	})(ToggleButtonsView = exports.ToggleButtonsView || (exports.ToggleButtonsView = {}));
	var SelectionSliderModel = (function (_super) {
	    __extends(SelectionSliderModel, _super);
	    function SelectionSliderModel() {
	        _super.apply(this, arguments);
	    }
	    SelectionSliderModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'SelectionSliderModel',
	            _view_name: 'SelectionSliderView',
	            orientation: 'horizontal',
	            readout: true,
	            continuous_update: true
	        });
	    };
	    return SelectionSliderModel;
	}(SelectionModel));
	exports.SelectionSliderModel = SelectionSliderModel;
	var SelectionSliderView = (function (_super) {
	    __extends(SelectionSliderView, _super);
	    function SelectionSliderView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Called when view is rendered.
	     */
	    SelectionSliderView.prototype.render = function () {
	        var _this = this;
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-hslider');
	        this.el.classList.add('widget-slider');
	        (this.$slider = $('<div />'))
	            .slider({
	            slide: this.handleSliderChange.bind(this),
	            stop: this.handleSliderChanged.bind(this)
	        })
	            .addClass('slider');
	        // Put the slider in a container
	        this.slider_container = document.createElement('div');
	        this.slider_container.classList.add('slider-container');
	        this.slider_container.appendChild(this.$slider[0]);
	        this.el.appendChild(this.slider_container);
	        this.readout = document.createElement('div');
	        this.el.appendChild(this.readout);
	        this.readout.classList.add('widget-readout');
	        this.readout.style.display = 'none';
	        this.listenTo(this.model, 'change:slider_color', function (sender, value) {
	            _this.$slider.find('a').css('background', value);
	        });
	        this.$slider.find('a').css('background', this.model.get('slider_color'));
	        // Set defaults.
	        this.update();
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed.  The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    SelectionSliderView.prototype.update = function (options) {
	        if (options === undefined || options.updated_view != this) {
	            var labels = this.model.get('_options_labels');
	            var max = labels.length - 1;
	            var min = 0;
	            this.$slider.slider('option', 'step', 1);
	            this.$slider.slider('option', 'max', max);
	            this.$slider.slider('option', 'min', min);
	            // WORKAROUND FOR JQUERY SLIDER BUG.
	            // The horizontal position of the slider handle
	            // depends on the value of the slider at the time
	            // of orientation change.  Before applying the new
	            // workaround, we set the value to the minimum to
	            // make sure that the horizontal placement of the
	            // handle in the vertical slider is always
	            // consistent.
	            var orientation = this.model.get('orientation');
	            this.$slider.slider('option', 'value', min);
	            this.$slider.slider('option', 'orientation', orientation);
	            var value = this.model.get('value');
	            var index = labels.indexOf(value);
	            this.$slider.slider('option', 'value', index);
	            this.readout.textContent = value;
	            // Use the right CSS classes for vertical & horizontal sliders
	            if (orientation === 'vertical') {
	                this.el.classList.remove('widget-hslider');
	                this.el.classList.remove('widget-inline-hbox');
	                this.el.classList.add('widget-vslider');
	                this.el.classList.add('widget-inline-vbox');
	            }
	            else {
	                this.el.classList.remove('widget-vslider');
	                this.el.classList.remove('widget-inline-vbox');
	                this.el.classList.add('widget-hslider');
	                this.el.classList.add('widget-inline-hbox');
	            }
	            var readout = this.model.get('readout');
	            if (readout) {
	                // this.$readout.show();
	                this.readout.style.display = '';
	            }
	            else {
	                // this.$readout.hide();
	                this.readout.style.display = 'none';
	            }
	        }
	        return _super.prototype.update.call(this, options);
	    };
	    SelectionSliderView.prototype.events = function () {
	        return {
	            'slide': 'handleSliderChange',
	            'slidestop': 'handleSliderChanged'
	        };
	    };
	    /**
	     * Called when the slider value is changing.
	     */
	    SelectionSliderView.prototype.handleSliderChange = function (e, ui) {
	        var actual_value = this._validate_slide_value(ui.value);
	        var selected_label = this.model.get('_options_labels')[actual_value];
	        this.readout.textContent = selected_label;
	        // Only persist the value while sliding if the continuous_update
	        // trait is set to true.
	        if (this.model.get('continuous_update')) {
	            this.handleSliderChanged(e, ui);
	        }
	    };
	    /**
	     * Called when the slider value has changed.
	     *
	     * Calling model.set will trigger all of the other views of the
	     * model to update.
	     */
	    SelectionSliderView.prototype.handleSliderChanged = function (e, ui) {
	        var actual_value = this._validate_slide_value(ui.value);
	        var selected_label = this.model.get('_options_labels')[actual_value];
	        this.readout.textContent = selected_label;
	        this.model.set('value', selected_label, { updated_view: this });
	        this.touch();
	    };
	    SelectionSliderView.prototype._validate_slide_value = function (x) {
	        /**
	         * Validate the value of the slider before sending it to the back-end
	         * and applying it to the other views on the page.
	         */
	        return Math.floor(x);
	    };
	    return SelectionSliderView;
	}(widget_1.LabeledDOMWidgetView));
	exports.SelectionSliderView = SelectionSliderView;
	var MultipleSelectionModel = (function (_super) {
	    __extends(MultipleSelectionModel, _super);
	    function MultipleSelectionModel() {
	        _super.apply(this, arguments);
	    }
	    MultipleSelectionModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'MultipleSelectionModel',
	        });
	    };
	    return MultipleSelectionModel;
	}(SelectionModel));
	exports.MultipleSelectionModel = MultipleSelectionModel;
	var SelectMultipleModel = (function (_super) {
	    __extends(SelectMultipleModel, _super);
	    function SelectMultipleModel() {
	        _super.apply(this, arguments);
	    }
	    SelectMultipleModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'SelectMultipleModel',
	            _view_name: 'SelectMultipleView'
	        });
	    };
	    return SelectMultipleModel;
	}(MultipleSelectionModel));
	exports.SelectMultipleModel = SelectMultipleModel;
	var SelectMultipleView = (function (_super) {
	    __extends(SelectMultipleView, _super);
	    function SelectMultipleView() {
	        _super.apply(this, arguments);
	    }
	    /**
	     * Public constructor.
	     */
	    SelectMultipleView.prototype.initialize = function (parameters) {
	        var _this = this;
	        _super.prototype.initialize.call(this, parameters);
	        this.listenTo(this.model, 'change:_options_labels', function () { return _this._updateOptions(); });
	    };
	    /**
	     * Called when view is rendered.
	     */
	    SelectMultipleView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        this.el.classList.add('jupyter-widgets');
	        this.el.classList.add('widget-inline-hbox');
	        this.el.classList.add('widget-select-multiple');
	        this.listbox = document.createElement('select');
	        this.listbox.multiple = true;
	        this.el.appendChild(this.listbox);
	        this._updateOptions();
	        this.update();
	    };
	    /**
	     * Update the contents of this view
	     */
	    SelectMultipleView.prototype.update = function () {
	        _super.prototype.update.call(this);
	        this.listbox.disabled = this.model.get('disabled');
	        // Set selected values
	        var selected = this.model.get('value') || [];
	        var values = _.map(selected, encodeURIComponent);
	        var options = this.listbox.options;
	        for (var i = 0, len = options.length; i < len; ++i) {
	            var value = options[i].getAttribute('data-value');
	            options[i].selected = _.contains(values, value);
	        }
	    };
	    SelectMultipleView.prototype._updateOptions = function () {
	        this.listbox.textContent = '';
	        var items = this.model.get('_options_labels');
	        for (var i = 0; i < items.length; i++) {
	            var item = items[i];
	            var option = document.createElement('option');
	            option.textContent = item.replace(/ /g, '\xa0'); // space -> &nbsp;
	            option.setAttribute('data-value', encodeURIComponent(item));
	            option.value = item;
	            this.listbox.appendChild(option);
	        }
	    };
	    SelectMultipleView.prototype.events = function () {
	        return {
	            'change select': '_handle_change'
	        };
	    };
	    /**
	     * Handle when a new value is selected.
	     */
	    SelectMultipleView.prototype._handle_change = function () {
	        // In order to preserve type information correctly, we need to map
	        // the selected indices to the options list.
	        var items = this.model.get('_options_labels');
	        var values = Array.prototype.map
	            .call(this.listbox.selectedOptions || [], function (option) {
	            return items[option.index];
	        });
	        this.model.set('value', values);
	        this.touch();
	    };
	    return SelectMultipleView;
	}(widget_1.LabeledDOMWidgetView));
	exports.SelectMultipleView = SelectMultipleView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_selection.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_selectioncontainer.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/widget_selectioncontainer.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var widget_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget.js');
	var widget_box_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/widget_box.js');
	var tabpanel_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/phosphor/tabpanel.js');
	var accordion_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/phosphor/accordion.js');
	var widget_2 = __jupyter_require__('phosphor@^0.7.0/lib/ui/widget.js');
	var iteration_1 = __jupyter_require__('phosphor@^0.7.0/lib/algorithm/iteration.js');
	var mutation_1 = __jupyter_require__('phosphor@^0.7.0/lib/algorithm/mutation.js');
	var searching_1 = __jupyter_require__('phosphor@^0.7.0/lib/algorithm/searching.js');
	var messaging_1 = __jupyter_require__('phosphor@^0.7.0/lib/core/messaging.js');
	var _ = __jupyter_require__('underscore@^1.8.3/underscore.js');
	var utils = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/utils.js');
	var $ = __jupyter_require__('jquery@^3.1.1/dist/jquery.js');
	var SelectionContainerModel = (function (_super) {
	    __extends(SelectionContainerModel, _super);
	    function SelectionContainerModel() {
	        _super.apply(this, arguments);
	    }
	    SelectionContainerModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'SelectionContainerModel',
	            selected_index: 0,
	            _titles: {}
	        });
	    };
	    return SelectionContainerModel;
	}(widget_box_1.BoxModel));
	exports.SelectionContainerModel = SelectionContainerModel;
	var AccordionModel = (function (_super) {
	    __extends(AccordionModel, _super);
	    function AccordionModel() {
	        _super.apply(this, arguments);
	    }
	    AccordionModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'AccordionModel',
	            _view_name: 'AccordionView'
	        });
	    };
	    return AccordionModel;
	}(SelectionContainerModel));
	exports.AccordionModel = AccordionModel;
	// We implement our own tab widget since Phoshpor's TabPanel uses an absolute
	// positioning BoxLayout, but we want a more an html/css-based Panel layout.
	var JupyterPhosphorAccordionWidget = (function (_super) {
	    __extends(JupyterPhosphorAccordionWidget, _super);
	    function JupyterPhosphorAccordionWidget(options) {
	        var view = options.view;
	        delete options.view;
	        _super.call(this, options);
	        this._view = view;
	    }
	    /**
	     * Process the phosphor message.
	     *
	     * Any custom phosphor widget used inside a Jupyter widget should override
	     * the processMessage function like this.
	     */
	    JupyterPhosphorAccordionWidget.prototype.processMessage = function (msg) {
	        _super.prototype.processMessage.call(this, msg);
	        this._view.processPhosphorMessage(msg);
	    };
	    /**
	     * Dispose the widget.
	     *
	     * This causes the view to be destroyed as well with 'remove'
	     */
	    JupyterPhosphorAccordionWidget.prototype.dispose = function () {
	        if (this.isDisposed) {
	            return;
	        }
	        _super.prototype.dispose.call(this);
	        if (this._view) {
	            this._view.remove();
	        }
	        this._view = null;
	    };
	    return JupyterPhosphorAccordionWidget;
	}(accordion_1.Accordion));
	exports.JupyterPhosphorAccordionWidget = JupyterPhosphorAccordionWidget;
	var AccordionView = (function (_super) {
	    __extends(AccordionView, _super);
	    function AccordionView() {
	        _super.apply(this, arguments);
	    }
	    AccordionView.prototype._createElement = function (tagName) {
	        this.pWidget = new JupyterPhosphorAccordionWidget({ view: this });
	        return this.pWidget.node;
	    };
	    AccordionView.prototype._setElement = function (el) {
	        if (this.el || el !== this.pWidget.node) {
	            // Accordions don't allow setting the element beyond the initial creation.
	            throw new Error('Cannot reset the DOM element.');
	        }
	        this.el = this.pWidget.node;
	        this.$el = $(this.pWidget.node);
	    };
	    AccordionView.prototype.initialize = function (parameters) {
	        var _this = this;
	        _super.prototype.initialize.call(this, parameters);
	        this.children_views = new widget_1.ViewList(this.add_child_view, this.remove_child_view, this);
	        this.listenTo(this.model, 'change:children', function () { return _this.updateChildren(); });
	        this.listenTo(this.model, 'change:selected_index', function () { return _this.update_selected_index(); });
	        this.listenTo(this.model, 'change:_titles', function () { return _this.update_titles(); });
	    };
	    /**
	     * Called when view is rendered.
	     */
	    AccordionView.prototype.render = function () {
	        var _this = this;
	        _super.prototype.render.call(this);
	        var accordion = this.pWidget;
	        accordion.addClass('jupyter-widgets');
	        accordion.addClass('widget-accordion');
	        accordion.addClass('widget-container');
	        accordion.selection.selectionChanged.connect(function (sender) {
	            if (!_this.updatingChildren) {
	                _this.model.set('selected_index', accordion.selection.index);
	                _this.touch();
	            }
	        });
	        this.children_views.update(this.model.get('children'));
	        this.update_titles();
	        this.update_selected_index();
	    };
	    /**
	     * Update children
	     */
	    AccordionView.prototype.updateChildren = function () {
	        // While we are updating, the index may not be valid, so deselect the
	        // tabs before updating so we don't get spurious changes in the index,
	        // which would then set off another sync cycle.
	        this.updatingChildren = true;
	        this.pWidget.selection.index = -1;
	        this.children_views.update(this.model.get('children'));
	        this.update_selected_index();
	        this.updatingChildren = false;
	    };
	    /**
	     * Set header titles
	     */
	    AccordionView.prototype.update_titles = function () {
	        var widgets = this.pWidget.widgets;
	        var titles = this.model.get('_titles');
	        for (var i = 0; i < widgets.length; i++) {
	            if (titles[i] !== void 0) {
	                widgets.at(i).title.label = titles[i];
	            }
	        }
	    };
	    /**
	     * Make the rendering and selected index consistent.
	     */
	    AccordionView.prototype.update_selected_index = function () {
	        this.pWidget.selection.index = this.model.get('selected_index');
	    };
	    /**
	     * Called when a child is removed from children list.
	     */
	    AccordionView.prototype.remove_child_view = function (view) {
	        this.pWidget.removeWidget(view.pWidget);
	        view.remove();
	    };
	    /**
	     * Called when a child is added to children list.
	     */
	    AccordionView.prototype.add_child_view = function (model, index) {
	        // Placeholder widget to keep our position in the tab panel while we create the view.
	        var accordion = this.pWidget;
	        var placeholder = new widget_2.Widget();
	        placeholder.title.label = this.model.get('_titles')[index] || '';
	        ;
	        accordion.addWidget(placeholder);
	        return this.create_child_view(model).then(function (view) {
	            var widget = view.pWidget;
	            widget.title.label = placeholder.title.label;
	            var collapse = accordion.collapseWidgets.at(accordion.indexOf(placeholder));
	            collapse.widget = widget;
	            placeholder.dispose();
	            return view;
	        }).catch(utils.reject('Could not add child view to box', true));
	    };
	    AccordionView.prototype.remove = function () {
	        this.children_views = null;
	        _super.prototype.remove.call(this);
	    };
	    return AccordionView;
	}(widget_1.DOMWidgetView));
	exports.AccordionView = AccordionView;
	var TabModel = (function (_super) {
	    __extends(TabModel, _super);
	    function TabModel() {
	        _super.apply(this, arguments);
	    }
	    TabModel.prototype.defaults = function () {
	        return _.extend(_super.prototype.defaults.call(this), {
	            _model_name: 'TabModel',
	            _view_name: 'TabView'
	        });
	    };
	    return TabModel;
	}(SelectionContainerModel));
	exports.TabModel = TabModel;
	// We implement our own tab widget since Phoshpor's TabPanel uses an absolute
	// positioning BoxLayout, but we want a more an html/css-based Panel layout.
	var JupyterPhosphorTabPanelWidget = (function (_super) {
	    __extends(JupyterPhosphorTabPanelWidget, _super);
	    function JupyterPhosphorTabPanelWidget(options) {
	        var _this = this;
	        var view = options.view;
	        delete options.view;
	        _super.call(this, options);
	        this._view = view;
	        // We want the view's messages to be the messages the tabContents panel
	        // gets.
	        messaging_1.installMessageHook(this.tabContents, function (handler, msg) {
	            // There may be times when we want the view's handler to be called
	            // *after* the message has been processed by the widget, in which
	            // case we'll need to revisit using a message hook.
	            _this._view.processPhosphorMessage(msg);
	            return true;
	        });
	    }
	    /**
	     * Dispose the widget.
	     *
	     * This causes the view to be destroyed as well with 'remove'
	     */
	    JupyterPhosphorTabPanelWidget.prototype.dispose = function () {
	        if (this.isDisposed) {
	            return;
	        }
	        _super.prototype.dispose.call(this);
	        if (this._view) {
	            this._view.remove();
	        }
	        this._view = null;
	    };
	    return JupyterPhosphorTabPanelWidget;
	}(tabpanel_1.TabPanel));
	exports.JupyterPhosphorTabPanelWidget = JupyterPhosphorTabPanelWidget;
	var TabView = (function (_super) {
	    __extends(TabView, _super);
	    function TabView() {
	        _super.apply(this, arguments);
	        this.updatingTabs = false;
	    }
	    TabView.prototype._createElement = function (tagName) {
	        this.pWidget = new JupyterPhosphorTabPanelWidget({
	            view: this,
	        });
	        return this.pWidget.node;
	    };
	    TabView.prototype._setElement = function (el) {
	        if (this.el || el !== this.pWidget.node) {
	            // TabViews don't allow setting the element beyond the initial creation.
	            throw new Error('Cannot reset the DOM element.');
	        }
	        this.el = this.pWidget.node;
	        this.$el = $(this.pWidget.node);
	    };
	    /**
	     * Public constructor.
	     */
	    TabView.prototype.initialize = function (parameters) {
	        var _this = this;
	        _super.prototype.initialize.call(this, parameters);
	        this.childrenViews = new widget_1.ViewList(this.addChildView, function (view) { view.remove(); }, this);
	        this.listenTo(this.model, 'change:children', function () { return _this.updateTabs(); });
	        this.listenTo(this.model, 'change:_titles', function () { return _this.updateTitles(); });
	    };
	    /**
	     * Called when view is rendered.
	     */
	    TabView.prototype.render = function () {
	        _super.prototype.render.call(this);
	        var tabs = this.pWidget;
	        tabs.addClass('jupyter-widgets');
	        tabs.addClass('widget-container');
	        tabs.addClass('widget-tab');
	        tabs.tabBar.insertBehavior = 'none'; // needed for insert behavior, see below.
	        tabs.tabBar.currentChanged.connect(this._onTabChanged, this);
	        tabs.tabBar.tabMoved.connect(this._onTabMoved, this);
	        tabs.tabBar.addClass('widget-tab-bar');
	        tabs.tabContents.addClass('widget-tab-contents');
	        // TODO: expose this option in python
	        tabs.tabBar.tabsMovable = false;
	        this.updateTabs();
	        this.update();
	    };
	    /**
	     * Render tab views based on the current model's children.
	     */
	    TabView.prototype.updateTabs = function () {
	        // While we are updating, the index may not be valid, so deselect the
	        // tabs before updating so we don't get spurious changes in the index,
	        // which would then set off another sync cycle.
	        this.updatingTabs = true;
	        this.pWidget.currentIndex = -1;
	        this.childrenViews.update(this.model.get('children'));
	        this.pWidget.currentIndex = this.model.get('selected_index');
	        this.updatingTabs = false;
	    };
	    /**
	     * Called when a child is added to children list.
	     */
	    TabView.prototype.addChildView = function (model, index) {
	        // Placeholder widget to keep our position in the tab panel while we create the view.
	        var label = this.model.get('_titles')[index] || '';
	        var tabs = this.pWidget;
	        var placeholder = new widget_2.Widget();
	        placeholder.title.label = label;
	        tabs.addWidget(placeholder);
	        return this.create_child_view(model).then(function (view) {
	            var widget = view.pWidget;
	            widget.title.label = placeholder.title.label;
	            widget.title.closable = true;
	            var i = searching_1.indexOf(tabs.widgets, placeholder);
	            // insert after placeholder so that if placholder is selected, the
	            // real widget will be selected now (this depends on the tab bar
	            // insert behavior)
	            tabs.insertWidget(i + 1, widget);
	            placeholder.dispose();
	            return view;
	        }).catch(utils.reject('Could not add child view to box', true));
	    };
	    /**
	     * Update the contents of this view
	     *
	     * Called when the model is changed.  The model may have been
	     * changed by another view or by a state update from the back-end.
	     */
	    TabView.prototype.update = function () {
	        // Update the selected index in the overall update method because it
	        // should be run after the tabs have been updated. Otherwise the
	        // selected index may not be a valid tab in the tab bar.
	        this.updateSelectedIndex();
	        return _super.prototype.update.call(this);
	    };
	    /**
	     * Updates the tab page titles.
	     */
	    TabView.prototype.updateTitles = function () {
	        var titles = this.model.get('_titles') || {};
	        iteration_1.each(iteration_1.enumerate(this.pWidget.widgets), function (_a) {
	            var i = _a[0], widget = _a[1];
	            widget.title.label = titles[i] || '';
	        });
	    };
	    /**
	     * Updates the selected index.
	     */
	    TabView.prototype.updateSelectedIndex = function () {
	        this.pWidget.currentIndex = this.model.get('selected_index');
	    };
	    TabView.prototype.remove = function () {
	        this.childrenViews = null;
	        _super.prototype.remove.call(this);
	    };
	    TabView.prototype._onTabChanged = function (sender, args) {
	        if (!this.updatingTabs) {
	            this.model.set('selected_index', args.currentIndex);
	            this.touch();
	        }
	    };
	    /**
	     * Handle the `tabMoved` signal from the tab bar.
	     */
	    TabView.prototype._onTabMoved = function (sender, args) {
	        var children = this.model.get('children').slice();
	        mutation_1.move(children, args.fromIndex, args.toIndex);
	        this.model.set('children', children);
	        this.touch();
	    };
	    return TabView;
	}(widget_1.DOMWidgetView));
	exports.TabView = TabView;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/widget_selectioncontainer.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/phosphor/tabpanel.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/phosphor/tabpanel.js', function (module, exports, __jupyter_require__) {
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var signaling_1 = __jupyter_require__('phosphor@^0.7.0/lib/core/signaling.js');
	var panel_1 = __jupyter_require__('phosphor@^0.7.0/lib/ui/panel.js');
	var tabbar_1 = __jupyter_require__('phosphor@^0.7.0/lib/ui/tabbar.js');
	var widget_1 = __jupyter_require__('phosphor@^0.7.0/lib/ui/widget.js');
	/**
	 * The class name added to TabPanel instances.
	 */
	var TAB_PANEL_CLASS = 'p-TabPanel';
	/**
	 * The class name added to a TabPanel's tab bar.
	 */
	var TAB_BAR_CLASS = 'p-TabPanel-tabBar';
	/**
	 * The class name added to a TabPanel's stacked panel.
	 */
	var TAB_CONTENTS_CLASS = 'p-TabPanel-tabContents';
	/**
	 * The class name added to a StackedPanel child.
	 */
	var CHILD_CLASS = 'p-TabPanel-child';
	/**
	 * A panel where visible widgets are stacked atop one another.
	 *
	 * #### Notes
	 * This class provides a convenience wrapper around a [[StackedLayout]].
	 */
	var EventedPanel = (function (_super) {
	    __extends(EventedPanel, _super);
	    /**
	     * Construct a new stacked panel.
	     *
	     * @param options - The options for initializing the panel.
	     */
	    function EventedPanel(options) {
	        if (options === void 0) { options = {}; }
	        _super.call(this);
	        this.addClass(TAB_CONTENTS_CLASS);
	    }
	    /**
	     * A message handler invoked on a `'child-added'` message.
	     */
	    EventedPanel.prototype.onChildAdded = function (msg) {
	        msg.child.addClass(CHILD_CLASS);
	    };
	    /**
	     * A message handler invoked on a `'child-removed'` message.
	     */
	    EventedPanel.prototype.onChildRemoved = function (msg) {
	        msg.child.removeClass(CHILD_CLASS);
	        this.widgetRemoved.emit(msg.child);
	    };
	    return EventedPanel;
	}(panel_1.Panel));
	exports.EventedPanel = EventedPanel;
	// Define the signals for the `EventedPanel` class.
	signaling_1.defineSignal(EventedPanel.prototype, 'widgetRemoved');
	/**
	 * A widget which combines a `TabBar` and a `EventedPanel`.
	 *
	 * #### Notes
	 * This is a simple panel which handles the common case of a tab bar
	 * placed next to a content area. The selected tab controls the widget
	 * which is shown in the content area.
	 *
	 * For use cases which require more control than is provided by this
	 * panel, the `TabBar` widget may be used independently.
	 *
	 * TODO: Support setting the direction??
	 */
	var TabPanel = (function (_super) {
	    __extends(TabPanel, _super);
	    /**
	     * Construct a new tab panel.
	     *
	     * @param options - The options for initializing the tab panel.
	     */
	    function TabPanel(options) {
	        if (options === void 0) { options = {}; }
	        _super.call(this);
	        this.addClass(TAB_PANEL_CLASS);
	        // Create the tab bar and stacked panel.
	        this._tabBar = new tabbar_1.TabBar(options);
	        this._tabBar.tabsMovable = true;
	        this._tabBar.addClass(TAB_BAR_CLASS);
	        this._tabContents = new EventedPanel();
	        this._tabContents.addClass(TAB_CONTENTS_CLASS);
	        // Connect the tab bar signal handlers.
	        this._tabBar.tabMoved.connect(this._onTabMoved, this);
	        this._tabBar.currentChanged.connect(this._onCurrentChanged, this);
	        this._tabBar.tabCloseRequested.connect(this._onTabCloseRequested, this);
	        // Connect the stacked panel signal handlers.
	        this._tabContents.widgetRemoved.connect(this._onWidgetRemoved, this);
	        // Get the data related to the placement.
	        this._tabPlacement = options.tabPlacement || 'top';
	        var direction = Private.directionFromPlacement(this._tabPlacement);
	        var orientation = Private.orientationFromPlacement(this._tabPlacement);
	        // Configure the tab bar for the placement.
	        this._tabBar.orientation = orientation;
	        this._tabBar.addClass("p-mod-" + this._tabPlacement);
	        // Create the box layout.
	        var layout = new panel_1.PanelLayout();
	        // Add the child widgets to the layout.
	        layout.addWidget(this._tabBar);
	        layout.addWidget(this._tabContents);
	        // Install the layout on the tab panel.
	        this.layout = layout;
	    }
	    /**
	     * Dispose of the resources held by the widget.
	     */
	    TabPanel.prototype.dispose = function () {
	        this._tabBar = null;
	        this._tabContents = null;
	        _super.prototype.dispose.call(this);
	    };
	    Object.defineProperty(TabPanel.prototype, "currentIndex", {
	        /**
	         * Get the index of the currently selected tab.
	         *
	         * #### Notes
	         * This will be `-1` if no tab is selected.
	         */
	        get: function () {
	            return this._tabBar.currentIndex;
	        },
	        /**
	         * Set the index of the currently selected tab.
	         *
	         * #### Notes
	         * If the index is out of range, it will be set to `-1`.
	         */
	        set: function (value) {
	            this._tabBar.currentIndex = value;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabPanel.prototype, "currentWidget", {
	        /**
	         * Get the currently selected widget.
	         *
	         * #### Notes
	         * This will be `null` if there is no selected tab.
	         */
	        get: function () {
	            var title = this._tabBar.currentTitle;
	            return title ? title.owner : null;
	        },
	        /**
	         * Set the currently selected widget.
	         *
	         * #### Notes
	         * If the widget is not in the panel, it will be set to `null`.
	         */
	        set: function (value) {
	            this._tabBar.currentTitle = value ? value.title : null;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabPanel.prototype, "tabsMovable", {
	        /**
	         * Get the whether the tabs are movable by the user.
	         *
	         * #### Notes
	         * Tabs can always be moved programmatically.
	         */
	        get: function () {
	            return this._tabBar.tabsMovable;
	        },
	        /**
	         * Set the whether the tabs are movable by the user.
	         *
	         * #### Notes
	         * Tabs can always be moved programmatically.
	         */
	        set: function (value) {
	            this._tabBar.tabsMovable = value;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabPanel.prototype, "tabPlacement", {
	        /**
	         * Get the tab placement for the tab panel.
	         *
	         * #### Notes
	         * This controls the position of the tab bar relative to the content.
	         */
	        get: function () {
	            return this._tabPlacement;
	        },
	        /**
	         * Set the tab placement for the tab panel.
	         *
	         * #### Notes
	         * This controls the position of the tab bar relative to the content.
	         */
	        set: function (value) {
	            // Bail if the placement does not change.
	            if (this._tabPlacement === value) {
	                return;
	            }
	            // Swap the internal values.
	            var old = this._tabPlacement;
	            this._tabPlacement = value;
	            // Get the values related to the placement.
	            var direction = Private.directionFromPlacement(value);
	            var orientation = Private.orientationFromPlacement(value);
	            // Configure the tab bar for the placement.
	            this._tabBar.orientation = orientation;
	            this._tabBar.removeClass("p-mod-" + old);
	            this._tabBar.addClass("p-mod-" + value);
	            // Update the layout direction.
	            this.layout.direction = direction;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabPanel.prototype, "tabBar", {
	        /**
	         * The tab bar associated with the tab panel.
	         *
	         * #### Notes
	         * Modifying the tab bar directly can lead to undefined behavior.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._tabBar;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabPanel.prototype, "tabContents", {
	        /**
	         * The stacked panel associated with the tab panel.
	         *
	         * #### Notes
	         * Modifying the stack directly can lead to undefined behavior.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._tabContents;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabPanel.prototype, "widgets", {
	        /**
	         * A read-only sequence of the widgets in the panel.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._tabContents.widgets;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Add a widget to the end of the tab panel.
	     *
	     * @param widget - The widget to add to the tab panel.
	     *
	     * #### Notes
	     * If the widget is already contained in the panel, it will be moved.
	     *
	     * The widget's `title` is used to populate the tab.
	     */
	    TabPanel.prototype.addWidget = function (widget) {
	        this.insertWidget(this.widgets.length, widget);
	    };
	    /**
	     * Insert a widget into the tab panel at a specified index.
	     *
	     * @param index - The index at which to insert the widget.
	     *
	     * @param widget - The widget to insert into to the tab panel.
	     *
	     * #### Notes
	     * If the widget is already contained in the panel, it will be moved.
	     *
	     * The widget's `title` is used to populate the tab.
	     */
	    TabPanel.prototype.insertWidget = function (index, widget) {
	        if (widget !== this.currentWidget) {
	            widget.hide();
	        }
	        this._tabContents.insertWidget(index, widget);
	        this._tabBar.insertTab(index, widget.title);
	    };
	    /**
	     * Handle the `currentChanged` signal from the tab bar.
	     */
	    TabPanel.prototype._onCurrentChanged = function (sender, args) {
	        // Extract the previous and current title from the args.
	        var previousIndex = args.previousIndex, previousTitle = args.previousTitle, currentIndex = args.currentIndex, currentTitle = args.currentTitle;
	        // Extract the widgets from the titles.
	        var previousWidget = previousTitle ? previousTitle.owner : null;
	        var currentWidget = currentTitle ? currentTitle.owner : null;
	        // Hide the previous widget.
	        if (previousWidget) {
	            previousWidget.hide();
	        }
	        // Show the current widget.
	        if (currentWidget) {
	            currentWidget.show();
	        }
	        // Emit the `currentChanged` signal for the tab panel.
	        this.currentChanged.emit({
	            previousIndex: previousIndex, previousWidget: previousWidget, currentIndex: currentIndex, currentWidget: currentWidget
	        });
	    };
	    /**
	     * Handle the `tabActivateRequested` signal from the tab bar.
	     */
	    TabPanel.prototype._onTabActivateRequested = function (sender, args) {
	        args.title.owner.activate();
	    };
	    /**
	     * Handle the `tabCloseRequested` signal from the tab bar.
	     */
	    TabPanel.prototype._onTabCloseRequested = function (sender, args) {
	        args.title.owner.close();
	    };
	    /**
	     * Handle the `tabMoved` signal from the tab bar.
	     */
	    TabPanel.prototype._onTabMoved = function (sender, args) {
	        this._tabContents.insertWidget(args.toIndex, args.title.owner);
	    };
	    /**
	     * Handle the `widgetRemoved` signal from the stacked panel.
	     */
	    TabPanel.prototype._onWidgetRemoved = function (sender, widget) {
	        this._tabBar.removeTab(widget.title);
	    };
	    return TabPanel;
	}(widget_1.Widget));
	exports.TabPanel = TabPanel;
	// Define the signals for the `TabPanel` class.
	signaling_1.defineSignal(TabPanel.prototype, 'currentChanged');
	/**
	 * The namespace for the private module data.
	 */
	var Private;
	(function (Private) {
	    /**
	     * Convert a tab placement to tab bar orientation.
	     */
	    function orientationFromPlacement(plc) {
	        return placementToOrientationMap[plc];
	    }
	    Private.orientationFromPlacement = orientationFromPlacement;
	    /**
	     * Convert a tab placement to a box layout direction.
	     */
	    function directionFromPlacement(plc) {
	        return placementToDirectionMap[plc];
	    }
	    Private.directionFromPlacement = directionFromPlacement;
	    /**
	     * A mapping of tab placement to tab bar orientation.
	     */
	    var placementToOrientationMap = {
	        'top': 'horizontal',
	        'left': 'vertical',
	        'right': 'vertical',
	        'bottom': 'horizontal'
	    };
	    /**
	     * A mapping of tab placement to box layout direction.
	     */
	    var placementToDirectionMap = {
	        'top': 'top-to-bottom',
	        'left': 'left-to-right',
	        'right': 'right-to-left',
	        'bottom': 'bottom-to-top'
	    };
	})(Private || (Private = {}));
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/phosphor/tabpanel.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/ui/tabbar.js **/
jupyter.define('phosphor@0.7.1/lib/ui/tabbar.js', function (module, exports, __jupyter_require__) {
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var iteration_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/iteration.js');
	var mutation_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/mutation.js');
	var searching_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/searching.js');
	var vector_1 = __jupyter_require__('phosphor@0.7.1/lib/collections/vector.js');
	var messaging_1 = __jupyter_require__('phosphor@0.7.1/lib/core/messaging.js');
	var signaling_1 = __jupyter_require__('phosphor@0.7.1/lib/core/signaling.js');
	var cursor_1 = __jupyter_require__('phosphor@0.7.1/lib/dom/cursor.js');
	var query_1 = __jupyter_require__('phosphor@0.7.1/lib/dom/query.js');
	var title_1 = __jupyter_require__('phosphor@0.7.1/lib/ui/title.js');
	var vdom_1 = __jupyter_require__('phosphor@0.7.1/lib/ui/vdom.js');
	var widget_1 = __jupyter_require__('phosphor@0.7.1/lib/ui/widget.js');
	/**
	 * The class name added to TabBar instances.
	 */
	var TAB_BAR_CLASS = 'p-TabBar';
	/**
	 * The class name added to a tab bar content node.
	 */
	var CONTENT_CLASS = 'p-TabBar-content';
	/**
	 * The class name added to a tab bar tab.
	 */
	var TAB_CLASS = 'p-TabBar-tab';
	/**
	 * The class name added to a tab label node.
	 */
	var LABEL_CLASS = 'p-TabBar-tabLabel';
	/**
	 * The class name added to a tab icon node.
	 */
	var ICON_CLASS = 'p-TabBar-tabIcon';
	/**
	 * The class name added to a tab close icon node.
	 */
	var CLOSE_ICON_CLASS = 'p-TabBar-tabCloseIcon';
	/**
	 * The class name added to a tab bar and tab when dragging.
	 */
	var DRAGGING_CLASS = 'p-mod-dragging';
	/**
	 * The class name added to the current tab.
	 */
	var CURRENT_CLASS = 'p-mod-current';
	/**
	 * The class name added to a closable tab.
	 */
	var CLOSABLE_CLASS = 'p-mod-closable';
	/**
	 * The start drag distance threshold.
	 */
	var DRAG_THRESHOLD = 5;
	/**
	 * The detach distance threshold.
	 */
	var DETACH_THRESHOLD = 20;
	/**
	 * The DOM structure for a TabBar.
	 */
	var TAB_BAR_NODE = (vdom_1.h.div(vdom_1.h.ul({ className: CONTENT_CLASS })));
	/**
	 * A widget which displays titles as a single row or column of tabs.
	 *
	 * #### Notes
	 * If CSS transforms are used to rotate nodes for vertically oriented
	 * text, then tab dragging will not work correctly. The `tabsMovable`
	 * property should be set to `false` when rotating nodes from CSS.
	 */
	var TabBar = (function (_super) {
	    __extends(TabBar, _super);
	    /**
	     * Construct a new tab bar.
	     *
	     * @param options - The options for initializing the tab bar.
	     */
	    function TabBar(options) {
	        if (options === void 0) { options = {}; }
	        var _this = _super.call(this, { node: vdom_1.realize(TAB_BAR_NODE) }) || this;
	        _this._currentIndex = -1;
	        _this._previousTitle = null;
	        _this._titles = new vector_1.Vector();
	        _this._dragData = null;
	        _this.addClass(TAB_BAR_CLASS);
	        _this.setFlag(widget_1.WidgetFlag.DisallowLayout);
	        _this._tabsMovable = options.tabsMovable || false;
	        _this._allowDeselect = options.allowDeselect || false;
	        _this._orientation = options.orientation || 'horizontal';
	        _this._renderer = options.renderer || TabBar.defaultRenderer;
	        _this._insertBehavior = options.insertBehavior || 'select-tab-if-needed';
	        _this._removeBehavior = options.removeBehavior || 'select-tab-after';
	        _this.addClass("p-mod-" + _this._orientation);
	        return _this;
	    }
	    /**
	     * Dispose of the resources held by the widget.
	     */
	    TabBar.prototype.dispose = function () {
	        this._releaseMouse();
	        this._titles.clear();
	        this._renderer = null;
	        this._previousTitle = null;
	        _super.prototype.dispose.call(this);
	    };
	    Object.defineProperty(TabBar.prototype, "contentNode", {
	        /**
	         * Get the tab bar content node.
	         *
	         * #### Notes
	         * This is the node which holds the tab nodes.
	         *
	         * Modifying this node directly can lead to undefined behavior.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return this.node.getElementsByClassName(CONTENT_CLASS)[0];
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabBar.prototype, "titles", {
	        /**
	         * A read-only sequence of the titles in the tab bar.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._titles;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabBar.prototype, "currentTitle", {
	        /**
	         * Get the currently selected title.
	         *
	         * #### Notes
	         * This will be `null` if no tab is selected.
	         */
	        get: function () {
	            var i = this._currentIndex;
	            return i !== -1 ? this._titles.at(i) : null;
	        },
	        /**
	         * Set the currently selected title.
	         *
	         * #### Notes
	         * If the title does not exist, the title will be set to `null`.
	         */
	        set: function (value) {
	            this.currentIndex = searching_1.indexOf(this._titles, value);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabBar.prototype, "currentIndex", {
	        /**
	         * Get the index of the currently selected tab.
	         *
	         * #### Notes
	         * This will be `-1` if no tab is selected.
	         */
	        get: function () {
	            return this._currentIndex;
	        },
	        /**
	         * Set the index of the currently selected tab.
	         *
	         * #### Notes
	         * If the value is out of range, the index will be set to `-1`.
	         */
	        set: function (value) {
	            // Coerce the value to an index.
	            var i = Math.floor(value);
	            if (i < 0 || i >= this._titles.length) {
	                i = -1;
	            }
	            // Bail early if the index will not change.
	            if (this._currentIndex === i) {
	                return;
	            }
	            // Look up the previous index and title.
	            var pi = this._currentIndex;
	            var pt = pi === -1 ? null : this._titles.at(pi);
	            // Look up the current index and title.
	            var ci = i;
	            var ct = ci === -1 ? null : this._titles.at(ci);
	            // Update the current index and previous title.
	            this._currentIndex = ci;
	            this._previousTitle = pt;
	            // Emit the current changed signal.
	            this.currentChanged.emit({
	                previousIndex: pi, previousTitle: pt,
	                currentIndex: ci, currentTitle: ct
	            });
	            // Schedule an update of the tabs.
	            this.update();
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabBar.prototype, "orientation", {
	        /**
	         * Get the orientation of the tab bar.
	         *
	         * #### Notes
	         * This controls whether the tabs are arranged in a row or column.
	         */
	        get: function () {
	            return this._orientation;
	        },
	        /**
	         * Set the orientation of the tab bar.
	         *
	         * #### Notes
	         * This controls whether the tabs are arranged in a row or column.
	         */
	        set: function (value) {
	            // Do nothing if the orientation does not change.
	            if (this._orientation === value) {
	                return;
	            }
	            // Release the mouse before making any changes.
	            this._releaseMouse();
	            // Swap the orientation values.
	            var old = this._orientation;
	            this._orientation = value;
	            // Toggle the orientation classes.
	            this.removeClass("p-mod-" + old);
	            this.addClass("p-mod-" + value);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabBar.prototype, "tabsMovable", {
	        /**
	         * Get whether the tabs are movable by the user.
	         *
	         * #### Notes
	         * Tabs can always be moved programmatically.
	         */
	        get: function () {
	            return this._tabsMovable;
	        },
	        /**
	         * Set whether the tabs are movable by the user.
	         *
	         * #### Notes
	         * Tabs can always be moved programmatically.
	         */
	        set: function (value) {
	            this._tabsMovable = value;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabBar.prototype, "allowDeselect", {
	        /**
	         * Get whether a tab can be deselected by the user.
	         *
	         * #### Notes
	         * Tabs can be always be deselected programmatically.
	         */
	        get: function () {
	            return this._allowDeselect;
	        },
	        /**
	         * Set whether a tab can be deselected by the user.
	         *
	         * #### Notes
	         * Tabs can be always be deselected programmatically.
	         */
	        set: function (value) {
	            this._allowDeselect = value;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabBar.prototype, "insertBehavior", {
	        /**
	         * Get the selection behavior when inserting a tab.
	         */
	        get: function () {
	            return this._insertBehavior;
	        },
	        /**
	         * Set the selection behavior when inserting a tab.
	         */
	        set: function (value) {
	            this._insertBehavior = value;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabBar.prototype, "removeBehavior", {
	        /**
	         * Get the selection behavior when removing a tab.
	         */
	        get: function () {
	            return this._removeBehavior;
	        },
	        /**
	         * Set the selection behavior when removing a tab.
	         */
	        set: function (value) {
	            this._removeBehavior = value;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(TabBar.prototype, "renderer", {
	        /**
	         * The renderer used by the tab bar.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._renderer;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Add a tab to the end of the tab bar.
	     *
	     * @param value - The title which holds the data for the tab,
	     *   or an options object to convert to a title.
	     *
	     * @returns The title object added to the tab bar.
	     *
	     * #### Notes
	     * If the title is already added to the tab bar, it will be moved.
	     */
	    TabBar.prototype.addTab = function (value) {
	        return this.insertTab(this._titles.length, value);
	    };
	    /**
	     * Insert a tab into the tab bar at the specified index.
	     *
	     * @param index - The index at which to insert the tab.
	     *
	     * @param value - The title which holds the data for the tab,
	     *   or an options object to convert to a title.
	     *
	     * @returns The title object added to the tab bar.
	     *
	     * #### Notes
	     * The index will be clamped to the bounds of the tabs.
	     *
	     * If the title is already added to the tab bar, it will be moved.
	     */
	    TabBar.prototype.insertTab = function (index, value) {
	        // Release the mouse before making any changes.
	        this._releaseMouse();
	        // Coerce the value to a title.
	        var title = Private.asTitle(value);
	        // Look up the index of the title.
	        var i = searching_1.indexOf(this._titles, title);
	        // Clamp the insert index to the vector bounds.
	        var j = Math.max(0, Math.min(Math.floor(index), this._titles.length));
	        // If the title is not in the vector, insert it.
	        if (i === -1) {
	            // Insert the title into the vector.
	            this._titles.insert(j, title);
	            // Connect to the title changed signal.
	            title.changed.connect(this._onTitleChanged, this);
	            // Adjust the current index for the insert.
	            this._adjustCurrentForInsert(j, title);
	            // Schedule an update of the tabs.
	            this.update();
	            // Return the title added to the tab bar.
	            return title;
	        }
	        // Otherwise, the title exists in the vector and should be moved.
	        // Adjust the index if the location is at the end of the vector.
	        if (j === this._titles.length)
	            j--;
	        // Bail if there is no effective move.
	        if (i === j)
	            return title;
	        // Move the title to the new location.
	        mutation_1.move(this._titles, i, j);
	        // Adjust the current index for the move.
	        this._adjustCurrentForMove(i, j);
	        // Schedule an update of the tabs.
	        this.update();
	        // Return the title added to the tab bar.
	        return title;
	    };
	    /**
	     * Remove a tab from the tab bar.
	     *
	     * @param title - The title for the tab to remove.
	     *
	     * @returns The index occupied by the tab, or `-1` if the tab
	     *   was not contained in the tab bar.
	     */
	    TabBar.prototype.removeTab = function (title) {
	        var index = searching_1.indexOf(this._titles, title);
	        if (index !== -1)
	            this.removeTabAt(index);
	        return index;
	    };
	    /**
	     * Remove the tab at a given index from the tab bar.
	     *
	     * @param index - The index of the tab to remove.
	     *
	     * @returns The title occupying the index, or `null` if the index
	     *   is out of range.
	     */
	    TabBar.prototype.removeTabAt = function (index) {
	        // Bail if the index is out of range.
	        var i = Math.floor(index);
	        if (i < 0 || i >= this._titles.length) {
	            return null;
	        }
	        // Release the mouse before making any changes.
	        this._releaseMouse();
	        // Remove the title from the vector.
	        var title = this._titles.removeAt(i);
	        // Disconnect from the title changed signal.
	        title.changed.disconnect(this._onTitleChanged, this);
	        // Clear the previous title if it's being removed.
	        if (title === this._previousTitle) {
	            this._previousTitle = null;
	        }
	        // Adjust the current index for the remove.
	        this._adjustCurrentForRemove(i, title);
	        // Schedule an update of the tabs.
	        this.update();
	        // Return the removed title.
	        return title;
	    };
	    /**
	     * Remove all tabs from the tab bar.
	     */
	    TabBar.prototype.clearTabs = function () {
	        var _this = this;
	        // Bail if there is nothing to remove.
	        if (this._titles.length === 0) {
	            return;
	        }
	        // Release the mouse before making any changes.
	        this._releaseMouse();
	        // Disconnect from the title changed signals.
	        iteration_1.each(this._titles, function (title) {
	            title.changed.disconnect(_this._onTitleChanged, _this);
	        });
	        // Get the current index and title.
	        var pi = this.currentIndex;
	        var pt = this.currentTitle;
	        // Reset the current index and previous title.
	        this._currentIndex = -1;
	        this._previousTitle = null;
	        // Clear the title vector.
	        this._titles.clear();
	        // Schedule an update of the tabs.
	        this.update();
	        // If no tab was selected, there's nothing else to do.
	        if (pi === -1) {
	            return;
	        }
	        // Emit the current changed signal.
	        this.currentChanged.emit({
	            previousIndex: pi, previousTitle: pt,
	            currentIndex: -1, currentTitle: null
	        });
	    };
	    /**
	     * Release the mouse and restore the non-dragged tab positions.
	     *
	     * #### Notes
	     * This will cause the tab bar to stop handling mouse events and to
	     * restore the tabs to their non-dragged positions.
	     */
	    TabBar.prototype.releaseMouse = function () {
	        this._releaseMouse();
	    };
	    /**
	     * Handle the DOM events for the tab bar.
	     *
	     * @param event - The DOM event sent to the tab bar.
	     *
	     * #### Notes
	     * This method implements the DOM `EventListener` interface and is
	     * called in response to events on the tab bar's DOM node.
	     *
	     * This should not be called directly by user code.
	     */
	    TabBar.prototype.handleEvent = function (event) {
	        switch (event.type) {
	            case 'click':
	                this._evtClick(event);
	                break;
	            case 'mousedown':
	                this._evtMouseDown(event);
	                break;
	            case 'mousemove':
	                this._evtMouseMove(event);
	                break;
	            case 'mouseup':
	                this._evtMouseUp(event);
	                break;
	            case 'keydown':
	                this._evtKeyDown(event);
	                break;
	            case 'contextmenu':
	                event.preventDefault();
	                event.stopPropagation();
	                break;
	        }
	    };
	    /**
	     * A message handler invoked on an `'after-attach'` message.
	     */
	    TabBar.prototype.onAfterAttach = function (msg) {
	        this.node.addEventListener('click', this);
	        this.node.addEventListener('mousedown', this);
	    };
	    /**
	     * A message handler invoked on a `'before-detach'` message.
	     */
	    TabBar.prototype.onBeforeDetach = function (msg) {
	        this.node.removeEventListener('click', this);
	        this.node.removeEventListener('mousedown', this);
	        this._releaseMouse();
	    };
	    /**
	     * A message handler invoked on an `'update-request'` message.
	     */
	    TabBar.prototype.onUpdateRequest = function (msg) {
	        var content = [];
	        var titles = this._titles;
	        var renderer = this._renderer;
	        var currentTitle = this.currentTitle;
	        for (var i = 0, n = titles.length; i < n; ++i) {
	            var title = titles.at(i);
	            var current = title === currentTitle;
	            var zIndex = current ? n : n - i - 1;
	            content.push(renderer.renderTab({ title: title, current: current, zIndex: zIndex }));
	        }
	        vdom_1.render(content, this.contentNode);
	    };
	    /**
	     * Handle the `'keydown'` event for the tab bar.
	     */
	    TabBar.prototype._evtKeyDown = function (event) {
	        // Stop all input events during drag.
	        event.preventDefault();
	        event.stopPropagation();
	        // Release the mouse if `Escape` is pressed.
	        if (event.keyCode === 27)
	            this._releaseMouse();
	    };
	    /**
	     * Handle the `'click'` event for the tab bar.
	     */
	    TabBar.prototype._evtClick = function (event) {
	        // Do nothing if it's not a left click.
	        if (event.button !== 0) {
	            return;
	        }
	        // Do nothing if a drag is in progress.
	        if (this._dragData) {
	            return;
	        }
	        // Lookup the tab nodes.
	        var tabs = this.contentNode.children;
	        // Do nothing if the click is not on a tab.
	        var x = event.clientX;
	        var y = event.clientY;
	        var i = searching_1.findIndex(tabs, function (tab) { return query_1.hitTest(tab, x, y); });
	        if (i < 0) {
	            return;
	        }
	        // Clicking on a tab stops the event propagation.
	        event.preventDefault();
	        event.stopPropagation();
	        // Ignore the click if the title is not closable.
	        var title = this._titles.at(i);
	        if (!title.closable) {
	            return;
	        }
	        // Ignore the click if it was not on a close icon.
	        var icon = tabs[i].querySelector(this._renderer.closeIconSelector);
	        if (!icon || !icon.contains(event.target)) {
	            return;
	        }
	        // Emit the tab close requested signal.
	        this.tabCloseRequested.emit({ index: i, title: title });
	    };
	    /**
	     * Handle the `'mousedown'` event for the tab bar.
	     */
	    TabBar.prototype._evtMouseDown = function (event) {
	        // Do nothing if it's not a left mouse press.
	        if (event.button !== 0) {
	            return;
	        }
	        // Do nothing if a drag is in progress.
	        if (this._dragData) {
	            return;
	        }
	        // Lookup the tab nodes.
	        var tabs = this.contentNode.children;
	        // Do nothing if the press is not on a tab.
	        var x = event.clientX;
	        var y = event.clientY;
	        var i = searching_1.findIndex(tabs, function (tab) { return query_1.hitTest(tab, x, y); });
	        if (i < 0) {
	            return;
	        }
	        // Pressing on a tab stops the event propagation.
	        event.preventDefault();
	        event.stopPropagation();
	        // Ignore the press if it was on a close icon.
	        var icon = tabs[i].querySelector(this._renderer.closeIconSelector);
	        if (icon && icon.contains(event.target)) {
	            return;
	        }
	        // Setup the drag data if the tabs are movable.
	        if (this._tabsMovable) {
	            this._dragData = new Private.DragData();
	            this._dragData.index = i;
	            this._dragData.tab = tabs[i];
	            this._dragData.pressX = event.clientX;
	            this._dragData.pressY = event.clientY;
	            document.addEventListener('mousemove', this, true);
	            document.addEventListener('mouseup', this, true);
	            document.addEventListener('keydown', this, true);
	            document.addEventListener('contextmenu', this, true);
	        }
	        // Update the current index as appropriate.
	        if (this._allowDeselect && this._currentIndex === i) {
	            this.currentIndex = -1;
	        }
	        else {
	            this.currentIndex = i;
	        }
	        // Do nothing else if there is no current tab.
	        if (this._currentIndex === -1) {
	            return;
	        }
	        // Emit the tab activate request signal.
	        this.tabActivateRequested.emit({
	            index: this.currentIndex,
	            title: this.currentTitle
	        });
	    };
	    /**
	     * Handle the `'mousemove'` event for the tab bar.
	     */
	    TabBar.prototype._evtMouseMove = function (event) {
	        // Do nothing if no drag is in progress.
	        if (!this._dragData) {
	            return;
	        }
	        // Suppress the event during a drag.
	        event.preventDefault();
	        event.stopPropagation();
	        // Lookup the tab nodes.
	        var tabs = this.contentNode.children;
	        // Check the threshold if the drag is not active.
	        var data = this._dragData;
	        if (!data.dragActive) {
	            // Bail if the drag threshold is not exceeded.
	            var dx = Math.abs(event.clientX - data.pressX);
	            var dy = Math.abs(event.clientY - data.pressY);
	            if (dx < DRAG_THRESHOLD && dy < DRAG_THRESHOLD) {
	                return;
	            }
	            // Fill in the rest of the drag data measurements.
	            var tabRect = data.tab.getBoundingClientRect();
	            if (this._orientation === 'horizontal') {
	                data.tabPos = data.tab.offsetLeft;
	                data.tabSize = tabRect.width;
	                data.tabPressPos = data.pressX - tabRect.left;
	            }
	            else {
	                data.tabPos = data.tab.offsetTop;
	                data.tabSize = tabRect.height;
	                data.tabPressPos = data.pressY - tabRect.top;
	            }
	            data.tabLayout = Private.snapTabLayout(tabs, this._orientation);
	            data.contentRect = this.contentNode.getBoundingClientRect();
	            data.override = cursor_1.overrideCursor('default');
	            // Add the dragging style classes.
	            data.tab.classList.add(DRAGGING_CLASS);
	            this.addClass(DRAGGING_CLASS);
	            // Mark the drag as active.
	            data.dragActive = true;
	        }
	        // Emit the detach requested signal if the threshold is exceeded.
	        if (!data.detachRequested && Private.detachExceeded(data, event)) {
	            // Only emit the signal once per drag cycle.
	            data.detachRequested = true;
	            // Setup the arguments for the signal.
	            var index = data.index;
	            var clientX = event.clientX;
	            var clientY = event.clientY;
	            var tab = tabs[index];
	            var title = this._titles.at(index);
	            // Emit the tab detach requested signal.
	            this.tabDetachRequested.emit({ index: index, title: title, tab: tab, clientX: clientX, clientY: clientY });
	            // Bail if the signal handler aborted the drag.
	            if (data.dragAborted) {
	                return;
	            }
	        }
	        // Update the positions of the tabs.
	        Private.layoutTabs(tabs, data, event, this._orientation);
	    };
	    /**
	     * Handle the `'mouseup'` event for the tab bar.
	     */
	    TabBar.prototype._evtMouseUp = function (event) {
	        var _this = this;
	        // Do nothing if it's not a left mouse release.
	        if (event.button !== 0) {
	            return;
	        }
	        // Do nothing if no drag is in progress.
	        if (!this._dragData) {
	            return;
	        }
	        // Suppress the event during a drag operation.
	        event.preventDefault();
	        event.stopPropagation();
	        // Remove the extra mouse event listeners.
	        document.removeEventListener('mousemove', this, true);
	        document.removeEventListener('mouseup', this, true);
	        document.removeEventListener('keydown', this, true);
	        document.removeEventListener('contextmenu', this, true);
	        // Bail early if the drag is not active.
	        var data = this._dragData;
	        if (!data.dragActive) {
	            this._dragData = null;
	            return;
	        }
	        // Position the tab at its final resting position.
	        Private.finalizeTabPosition(data, this._orientation);
	        // Remove the dragging class from the tab so it can be transitioned.
	        data.tab.classList.remove(DRAGGING_CLASS);
	        // Parse the transition duration for releasing the tab.
	        var duration = Private.parseTransitionDuration(data.tab);
	        // Complete the release on a timer to allow the tab to transition.
	        setTimeout(function () {
	            // Do nothing if the drag has been aborted.
	            if (data.dragAborted) {
	                return;
	            }
	            // Clear the drag data reference.
	            _this._dragData = null;
	            // Reset the positions of the tabs.
	            Private.resetTabPositions(_this.contentNode.children, _this._orientation);
	            // Clear the cursor grab.
	            data.override.dispose();
	            // Remove the remaining dragging style.
	            _this.removeClass(DRAGGING_CLASS);
	            // If the tab was not moved, there is nothing else to do.
	            var i = data.index;
	            var j = data.targetIndex;
	            if (j === -1 || i === j) {
	                return;
	            }
	            // Move the title to the new locations.
	            mutation_1.move(_this._titles, i, j);
	            // Adjust the current index for the move.
	            _this._adjustCurrentForMove(i, j);
	            // Emit the tab moved signal.
	            _this.tabMoved.emit({
	                fromIndex: i, toIndex: j, title: _this._titles.at(j)
	            });
	            // Update the tabs immediately to prevent flicker.
	            messaging_1.sendMessage(_this, widget_1.WidgetMessage.UpdateRequest);
	        }, duration);
	    };
	    /**
	     * Release the mouse and restore the non-dragged tab positions.
	     */
	    TabBar.prototype._releaseMouse = function () {
	        // Do nothing if no drag is in progress.
	        if (!this._dragData) {
	            return;
	        }
	        // Remove the extra mouse listeners.
	        document.removeEventListener('mousemove', this, true);
	        document.removeEventListener('mouseup', this, true);
	        document.removeEventListener('keydown', this, true);
	        document.removeEventListener('contextmenu', this, true);
	        // Clear the drag data reference.
	        var data = this._dragData;
	        this._dragData = null;
	        // Indicate the drag has been aborted. This allows the mouse
	        // event handlers to return early when the drag is canceled.
	        data.dragAborted = true;
	        // If the drag is not active, there's nothing more to do.
	        if (!data.dragActive) {
	            return;
	        }
	        // Reset the tabs to their non-dragged positions.
	        Private.resetTabPositions(this.contentNode.children, this._orientation);
	        // Clear the cursor override.
	        data.override.dispose();
	        // Clear the dragging style classes.
	        data.tab.classList.remove(DRAGGING_CLASS);
	        this.removeClass(DRAGGING_CLASS);
	    };
	    /**
	     * Adjust the current index for a tab insert operation.
	     *
	     * This method accounts for the tab bar's insertion behavior when
	     * adjusting the current index and emitting the changed signal.
	     */
	    TabBar.prototype._adjustCurrentForInsert = function (i, title) {
	        // Lookup commonly used variables.
	        var ct = this.currentTitle;
	        var ci = this._currentIndex;
	        var bh = this._insertBehavior;
	        // Handle the behavior where the new tab is always selected,
	        // or the behavior where the new tab is selected if needed.
	        if (bh === 'select-tab' || (bh === 'select-tab-if-needed' && ci === -1)) {
	            this._currentIndex = i;
	            this._previousTitle = ct;
	            this.currentChanged.emit({
	                previousIndex: ci, previousTitle: ct,
	                currentIndex: i, currentTitle: title
	            });
	            return;
	        }
	        // Otherwise, silently adjust the current index if needed.
	        if (ci >= i)
	            this._currentIndex++;
	    };
	    /**
	     * Adjust the current index for a tab move operation.
	     *
	     * This method will not cause the actual current tab to change.
	     * It silently adjusts the index to account for the given move.
	     */
	    TabBar.prototype._adjustCurrentForMove = function (i, j) {
	        if (this._currentIndex === i) {
	            this._currentIndex = j;
	        }
	        else if (this._currentIndex < i && this._currentIndex >= j) {
	            this._currentIndex++;
	        }
	        else if (this._currentIndex > i && this._currentIndex <= j) {
	            this._currentIndex--;
	        }
	    };
	    /**
	     * Adjust the current index for a tab remove operation.
	     *
	     * This method accounts for the tab bar's remove behavior when
	     * adjusting the current index and emitting the changed signal.
	     */
	    TabBar.prototype._adjustCurrentForRemove = function (i, title) {
	        // Lookup commonly used variables.
	        var ci = this._currentIndex;
	        var bh = this._removeBehavior;
	        // Silently adjust the index if the current tab is not removed.
	        if (ci !== i) {
	            if (ci > i)
	                this._currentIndex--;
	            return;
	        }
	        // No tab gets selected if the tab bar is empty.
	        if (this._titles.length === 0) {
	            this._currentIndex = -1;
	            this.currentChanged.emit({
	                previousIndex: i, previousTitle: title,
	                currentIndex: -1, currentTitle: null
	            });
	            return;
	        }
	        // Handle behavior where the next sibling tab is selected.
	        if (bh === 'select-tab-after') {
	            this._currentIndex = Math.min(i, this._titles.length - 1);
	            this.currentChanged.emit({
	                previousIndex: i, previousTitle: title,
	                currentIndex: this._currentIndex, currentTitle: this.currentTitle
	            });
	            return;
	        }
	        // Handle behavior where the previous sibling tab is selected.
	        if (bh === 'select-tab-before') {
	            this._currentIndex = Math.max(0, i - 1);
	            this.currentChanged.emit({
	                previousIndex: i, previousTitle: title,
	                currentIndex: this._currentIndex, currentTitle: this.currentTitle
	            });
	            return;
	        }
	        // Handle behavior where the previous history tab is selected.
	        if (bh === 'select-previous-tab') {
	            if (this._previousTitle) {
	                this._currentIndex = searching_1.indexOf(this._titles, this._previousTitle);
	                this._previousTitle = null;
	            }
	            else {
	                this._currentIndex = Math.min(i, this._titles.length - 1);
	            }
	            this.currentChanged.emit({
	                previousIndex: i, previousTitle: title,
	                currentIndex: this._currentIndex, currentTitle: this.currentTitle
	            });
	            return;
	        }
	        // Otherwise, no tab gets selected.
	        this._currentIndex = -1;
	        this.currentChanged.emit({
	            previousIndex: i, previousTitle: title,
	            currentIndex: -1, currentTitle: null
	        });
	    };
	    /**
	     * Handle the `changed` signal of a title object.
	     */
	    TabBar.prototype._onTitleChanged = function (sender) {
	        this.update();
	    };
	    return TabBar;
	}(widget_1.Widget));
	exports.TabBar = TabBar;
	// Define the signals for the `TabBar` class.
	signaling_1.defineSignal(TabBar.prototype, 'currentChanged');
	signaling_1.defineSignal(TabBar.prototype, 'tabMoved');
	signaling_1.defineSignal(TabBar.prototype, 'tabActivateRequested');
	signaling_1.defineSignal(TabBar.prototype, 'tabCloseRequested');
	signaling_1.defineSignal(TabBar.prototype, 'tabDetachRequested');
	/**
	 * The namespace for the `TabBar` class statics.
	 */
	(function (TabBar) {
	    /**
	     * The default implementation of `IRenderer`.
	     */
	    var Renderer = (function () {
	        /**
	         * Construct a new renderer.
	         *
	         * @param options - The options for initializing the renderer.
	         */
	        function Renderer(options) {
	            if (options === void 0) { options = {}; }
	            this._tabID = 0;
	            this._tabKeys = new WeakMap();
	            this._extraTabClass = options.extraTabClass || '';
	        }
	        Object.defineProperty(Renderer.prototype, "closeIconSelector", {
	            /**
	             * A selector which matches the close icon node in a tab.
	             *
	             * #### Notes
	             * This is a read-only property.
	             */
	            get: function () {
	                return "." + CLOSE_ICON_CLASS;
	            },
	            enumerable: true,
	            configurable: true
	        });
	        /**
	         * Render the node for the a tab.
	         *
	         * @param data - The data to use for rendering the tab.
	         *
	         * @returns A virtual DOM node representing the tab.
	         */
	        Renderer.prototype.renderTab = function (data) {
	            var _a = data.title, label = _a.label, caption = _a.caption;
	            var key = this.createTabKey(data);
	            var style = this.createTabStyle(data);
	            var tabClass = this.createTabClass(data);
	            var iconClass = this.createIconClass(data);
	            return (vdom_1.h.li({ key: key, className: tabClass, title: caption, style: style }, vdom_1.h.div({ className: iconClass }), vdom_1.h.div({ className: LABEL_CLASS }, label), vdom_1.h.div({ className: CLOSE_ICON_CLASS })));
	        };
	        /**
	         * Create a unique render key for the tab.
	         *
	         * @param data - The data to use for the tab.
	         *
	         * @returns The unique render key for the tab.
	         *
	         * #### Notes
	         * This method caches the key against the tab title the first time
	         * the key is generated. This enables efficient rendering of moved
	         * tabs and avoids subtle hover style artifacts.
	         */
	        Renderer.prototype.createTabKey = function (data) {
	            var key = this._tabKeys.get(data.title);
	            if (key === void 0) {
	                key = "tab-key-" + this._tabID++;
	                this._tabKeys.set(data.title, key);
	            }
	            return key;
	        };
	        /**
	         * Create the inline style object for a tab.
	         *
	         * @param data - The data to use for the tab.
	         *
	         * @returns The inline style data for the tab.
	         */
	        Renderer.prototype.createTabStyle = function (data) {
	            return { zIndex: "" + data.zIndex };
	        };
	        /**
	         * Create the class name for the tab.
	         *
	         * @param data - The data to use for the tab.
	         *
	         * @returns The full class name for the tab.
	         */
	        Renderer.prototype.createTabClass = function (data) {
	            var title = data.title, current = data.current;
	            var name = TAB_CLASS;
	            if (title.className) {
	                name += " " + title.className;
	            }
	            if (title.closable) {
	                name += " " + CLOSABLE_CLASS;
	            }
	            if (current) {
	                name += " " + CURRENT_CLASS;
	            }
	            if (this._extraTabClass) {
	                name += " " + this._extraTabClass;
	            }
	            return name;
	        };
	        /**
	         * Create the class name for the tab icon.
	         *
	         * @param data - The data to use for the tab.
	         *
	         * @returns The full class name for the tab icon.
	         */
	        Renderer.prototype.createIconClass = function (data) {
	            var title = data.title;
	            var name = ICON_CLASS;
	            if (title.icon) {
	                name += " " + title.icon;
	            }
	            return name;
	        };
	        return Renderer;
	    }());
	    TabBar.Renderer = Renderer;
	    /**
	     * The default `Renderer` instance.
	     */
	    TabBar.defaultRenderer = new Renderer();
	})(TabBar = exports.TabBar || (exports.TabBar = {}));
	exports.TabBar = TabBar;
	/**
	 * The namespace for the private module data.
	 */
	var Private;
	(function (Private) {
	    /**
	     * A struct which holds the drag data for a tab bar.
	     */
	    var DragData = (function () {
	        function DragData() {
	            /**
	             * The tab node being dragged.
	             */
	            this.tab = null;
	            /**
	             * The index of the tab being dragged.
	             */
	            this.index = -1;
	            /**
	             * The offset left/top of the tab being dragged.
	             */
	            this.tabPos = -1;
	            /**
	             * The offset width/height of the tab being dragged.
	             */
	            this.tabSize = -1;
	            /**
	             * The original mouse X/Y position in tab coordinates.
	             */
	            this.tabPressPos = -1;
	            /**
	             * The tab target index upon mouse release.
	             */
	            this.targetIndex = -1;
	            /**
	             * The array of tab layout objects snapped at drag start.
	             */
	            this.tabLayout = null;
	            /**
	             * The mouse press client X position.
	             */
	            this.pressX = -1;
	            /**
	             * The mouse press client Y position.
	             */
	            this.pressY = -1;
	            /**
	             * The bounding client rect of the tab bar content node.
	             */
	            this.contentRect = null;
	            /**
	             * The disposable to clean up the cursor override.
	             */
	            this.override = null;
	            /**
	             * Whether the drag is currently active.
	             */
	            this.dragActive = false;
	            /**
	             * Whether the drag has been aborted.
	             */
	            this.dragAborted = false;
	            /**
	             * Whether a detach request as been made.
	             */
	            this.detachRequested = false;
	        }
	        return DragData;
	    }());
	    Private.DragData = DragData;
	    /**
	     * Coerce a title or options into a real title.
	     */
	    function asTitle(value) {
	        return value instanceof title_1.Title ? value : new title_1.Title(value);
	    }
	    Private.asTitle = asTitle;
	    /**
	     * Parse the transition duration for a tab node.
	     */
	    function parseTransitionDuration(tab) {
	        var style = window.getComputedStyle(tab);
	        return 1000 * (parseFloat(style.transitionDuration) || 0);
	    }
	    Private.parseTransitionDuration = parseTransitionDuration;
	    /**
	     * Get a snapshot of the current tab layout values.
	     */
	    function snapTabLayout(tabs, orientation) {
	        var layout = new Array(tabs.length);
	        if (orientation === 'horizontal') {
	            for (var i = 0, n = tabs.length; i < n; ++i) {
	                var node = tabs[i];
	                var pos = node.offsetLeft;
	                var size = node.offsetWidth;
	                var cstyle = window.getComputedStyle(node);
	                var margin = parseInt(cstyle.marginLeft, 10) || 0;
	                layout[i] = { margin: margin, pos: pos, size: size };
	            }
	        }
	        else {
	            for (var i = 0, n = tabs.length; i < n; ++i) {
	                var node = tabs[i];
	                var pos = node.offsetTop;
	                var size = node.offsetHeight;
	                var cstyle = window.getComputedStyle(node);
	                var margin = parseInt(cstyle.marginTop, 10) || 0;
	                layout[i] = { margin: margin, pos: pos, size: size };
	            }
	        }
	        return layout;
	    }
	    Private.snapTabLayout = snapTabLayout;
	    /**
	     * Test if the event exceeds the drag detach threshold.
	     */
	    function detachExceeded(data, event) {
	        var rect = data.contentRect;
	        return ((event.clientX < rect.left - DETACH_THRESHOLD) ||
	            (event.clientX >= rect.right + DETACH_THRESHOLD) ||
	            (event.clientY < rect.top - DETACH_THRESHOLD) ||
	            (event.clientY >= rect.bottom + DETACH_THRESHOLD));
	    }
	    Private.detachExceeded = detachExceeded;
	    /**
	     * Update the relative tab positions and computed target index.
	     */
	    function layoutTabs(tabs, data, event, orientation) {
	        // Compute the orientation-sensitive values.
	        var pressPos;
	        var localPos;
	        var clientPos;
	        var clientSize;
	        if (orientation === 'horizontal') {
	            pressPos = data.pressX;
	            localPos = event.clientX - data.contentRect.left;
	            clientPos = event.clientX;
	            clientSize = data.contentRect.width;
	        }
	        else {
	            pressPos = data.pressY;
	            localPos = event.clientY - data.contentRect.top;
	            clientPos = event.clientY;
	            clientSize = data.contentRect.height;
	        }
	        // Compute the target data.
	        var targetIndex = data.index;
	        var targetPos = localPos - data.tabPressPos;
	        var targetEnd = targetPos + data.tabSize;
	        // Update the relative tab positions.
	        for (var i = 0, n = tabs.length; i < n; ++i) {
	            var pxPos = void 0;
	            var layout = data.tabLayout[i];
	            var threshold = layout.pos + (layout.size >> 1);
	            if (i < data.index && targetPos < threshold) {
	                pxPos = data.tabSize + data.tabLayout[i + 1].margin + "px";
	                targetIndex = Math.min(targetIndex, i);
	            }
	            else if (i > data.index && targetEnd > threshold) {
	                pxPos = -data.tabSize - layout.margin + "px";
	                targetIndex = Math.max(targetIndex, i);
	            }
	            else if (i === data.index) {
	                var ideal = clientPos - pressPos;
	                var limit = clientSize - (data.tabPos + data.tabSize);
	                pxPos = Math.max(-data.tabPos, Math.min(ideal, limit)) + "px";
	            }
	            else {
	                pxPos = '';
	            }
	            if (orientation === 'horizontal') {
	                tabs[i].style.left = pxPos;
	            }
	            else {
	                tabs[i].style.top = pxPos;
	            }
	        }
	        // Update the computed target index.
	        data.targetIndex = targetIndex;
	    }
	    Private.layoutTabs = layoutTabs;
	    /**
	     * Position the drag tab at its final resting relative position.
	     */
	    function finalizeTabPosition(data, orientation) {
	        // Compute the orientation-sensitive client size.
	        var clientSize;
	        if (orientation === 'horizontal') {
	            clientSize = data.contentRect.width;
	        }
	        else {
	            clientSize = data.contentRect.height;
	        }
	        // Compute the ideal final tab position.
	        var ideal;
	        if (data.targetIndex === data.index) {
	            ideal = 0;
	        }
	        else if (data.targetIndex > data.index) {
	            var tgt = data.tabLayout[data.targetIndex];
	            ideal = tgt.pos + tgt.size - data.tabSize - data.tabPos;
	        }
	        else {
	            var tgt = data.tabLayout[data.targetIndex];
	            ideal = tgt.pos - data.tabPos;
	        }
	        // Compute the tab position limit.
	        var limit = clientSize - (data.tabPos + data.tabSize);
	        var final = Math.max(-data.tabPos, Math.min(ideal, limit));
	        // Set the final orientation-sensitive position.
	        if (orientation === 'horizontal') {
	            data.tab.style.left = final + "px";
	        }
	        else {
	            data.tab.style.top = final + "px";
	        }
	    }
	    Private.finalizeTabPosition = finalizeTabPosition;
	    /**
	     * Reset the relative positions of the given tabs.
	     */
	    function resetTabPositions(tabs, orientation) {
	        if (orientation === 'horizontal') {
	            iteration_1.each(tabs, function (tab) { tab.style.left = ''; });
	        }
	        else {
	            iteration_1.each(tabs, function (tab) { tab.style.top = ''; });
	        }
	    }
	    Private.resetTabPositions = resetTabPositions;
	})(Private || (Private = {}));
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/ui/tabbar.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/dom/cursor.js **/
jupyter.define('phosphor@0.7.1/lib/dom/cursor.js', function (module, exports, __jupyter_require__) {
	"use strict";
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var disposable_1 = __jupyter_require__('phosphor@0.7.1/lib/core/disposable.js');
	/**
	 * The class name added to the document body during cursor override.
	 */
	var OVERRIDE_CURSOR_CLASS = 'p-mod-override-cursor';
	/**
	 * Override the cursor for the entire document.
	 *
	 * @param cursor - The string representing the cursor style.
	 *
	 * @returns A disposable which will clear the override when disposed.
	 *
	 * #### Notes
	 * The most recent call to `overrideCursor` takes precedence. Disposing
	 * an old override is a no-op and will not effect the current override.
	 *
	 * #### Example
	 * ```typescript
	 * import { overrideCursor } from 'phosphor/lib/dom/cursor';
	 *
	 * // force the cursor to be 'wait' for the entire document
	 * let override = overrideCursor('wait');
	 *
	 * // clear the override by disposing the return value
	 * override.dispose();
	 * ```
	 */
	function overrideCursor(cursor) {
	    var id = ++Private.cursorID;
	    var body = document.body;
	    body.style.cursor = cursor;
	    body.classList.add(OVERRIDE_CURSOR_CLASS);
	    return new disposable_1.DisposableDelegate(function () {
	        if (id === Private.cursorID) {
	            body.style.cursor = '';
	            body.classList.remove(OVERRIDE_CURSOR_CLASS);
	        }
	    });
	}
	exports.overrideCursor = overrideCursor;
	/**
	 * The namespace for the private module data.
	 */
	var Private;
	(function (Private) {
	    /**
	     * The id for the active cursor override.
	     */
	    Private.cursorID = 0;
	})(Private || (Private = {}));
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/dom/cursor.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/core/disposable.js **/
jupyter.define('phosphor@0.7.1/lib/core/disposable.js', function (module, exports, __jupyter_require__) {
	"use strict";
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	var iteration_1 = __jupyter_require__('phosphor@0.7.1/lib/algorithm/iteration.js');
	/**
	 * A disposable object which delegates to a callback function.
	 */
	var DisposableDelegate = (function () {
	    /**
	     * Construct a new disposable delegate.
	     *
	     * @param callback - The function to invoke on dispose.
	     */
	    function DisposableDelegate(callback) {
	        this._callback = callback || null;
	    }
	    Object.defineProperty(DisposableDelegate.prototype, "isDisposed", {
	        /**
	         * Test whether the delegate has been disposed.
	         *
	         * #### Notes
	         * This is a read-only property which is always safe to access.
	         */
	        get: function () {
	            return this._callback === null;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Dispose of the delegate and invoke the callback function.
	     *
	     * #### Notes
	     * All calls to this method after the first will be a no-op.
	     */
	    DisposableDelegate.prototype.dispose = function () {
	        if (this._callback === null) {
	            return;
	        }
	        var callback = this._callback;
	        this._callback = null;
	        callback();
	    };
	    return DisposableDelegate;
	}());
	exports.DisposableDelegate = DisposableDelegate;
	/**
	 * An object which manages a collection of disposable items.
	 */
	var DisposableSet = (function () {
	    /**
	     * Construct a new disposable set.
	     *
	     * @param items - The initial disposable items.
	     */
	    function DisposableSet(items) {
	        var _this = this;
	        this._set = new Set();
	        if (items)
	            iteration_1.each(items, function (item) { _this._set.add(item); });
	    }
	    Object.defineProperty(DisposableSet.prototype, "isDisposed", {
	        /**
	         * Test whether the set has been disposed.
	         *
	         * #### Notes
	         * This is a read-only property which is always safe to access.
	         */
	        get: function () {
	            return this._set === null;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Dispose of the set and the disposable items it contains.
	     *
	     * #### Notes
	     * Items are disposed in the order they are added to the set.
	     *
	     * It is unsafe to use the set after it has been disposed.
	     *
	     * All calls to this method after the first will be a no-op.
	     */
	    DisposableSet.prototype.dispose = function () {
	        if (this._set === null) {
	            return;
	        }
	        var set = this._set;
	        this._set = null;
	        set.forEach(function (item) { item.dispose(); });
	    };
	    /**
	     * Add a disposable item to the set.
	     *
	     * @param item - The disposable item to add to the set. If the item
	     *   is already contained in the set, this is a no-op.
	     *
	     * @throws An error if the set has been disposed.
	     */
	    DisposableSet.prototype.add = function (item) {
	        if (this._set === null) {
	            throw new Error('Object is disposed');
	        }
	        this._set.add(item);
	    };
	    /**
	     * Remove a disposable item from the set.
	     *
	     * @param item - The disposable item to remove from the set. If the
	     *   item does not exist in the set, this is a no-op.
	     *
	     * @throws An error if the set has been disposed.
	     */
	    DisposableSet.prototype.remove = function (item) {
	        if (this._set === null) {
	            throw new Error('Object is disposed');
	        }
	        this._set.delete(item);
	    };
	    /**
	     * Remove all disposable items from the set.
	     *
	     * @throws An error if the set has been disposed.
	     */
	    DisposableSet.prototype.clear = function () {
	        if (this._set === null) {
	            throw new Error('Object is disposed');
	        }
	        this._set.clear();
	    };
	    return DisposableSet;
	}());
	exports.DisposableSet = DisposableSet;
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/core/disposable.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/dom/query.js **/
jupyter.define('phosphor@0.7.1/lib/dom/query.js', function (module, exports, __jupyter_require__) {
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	"use strict";
	/**
	 * Test whether a client position lies within a node.
	 *
	 * @param node - The DOM node of interest.
	 *
	 * @param clientX - The client X coordinate of interest.
	 *
	 * @param clientY - The client Y coordinate of interest.
	 *
	 * @returns `true` if the node covers the position, `false` otherwise.
	 *
	 * #### Example
	 * ```typescript
	 * import { hitTest } from 'phosphor/lib/dom/query';
	 *
	 * let div = document.createElement('div');
	 * div.style.position = 'absolute';
	 * div.style.left = '0px';
	 * div.style.top = '0px';
	 * div.style.width = '100px';
	 * div.style.height = '100px';
	 * document.body.appendChild(div);
	 *
	 * hitTest(div, 50, 50);   // true
	 * hitTest(div, 150, 150); // false
	 * ```
	 */
	function hitTest(node, clientX, clientY) {
	    var rect = node.getBoundingClientRect();
	    return (clientX >= rect.left &&
	        clientX < rect.right &&
	        clientY >= rect.top &&
	        clientY < rect.bottom);
	}
	exports.hitTest = hitTest;
	/**
	 * Vertically scroll an element into view if needed.
	 *
	 * @param area - The scroll area element.
	 *
	 * @param elem - The element of interest.
	 *
	 * #### Notes
	 * This follows the "nearest" behavior of the native `scrollIntoView`
	 * method, which is not supported by all browsers.
	 * https://drafts.csswg.org/cssom-view/#element-scrolling-members
	 *
	 * If the element fully covers the visible area or is fully contained
	 * within the visible area, no scrolling will take place. Otherwise,
	 * the nearest edges of the area and element are aligned.
	 *
	 * #### Example
	 * ```typescript
	 * import { scrollIntoViewIfNeeded } from 'phosphor/lib/dom/query';
	 *
	 * let area = document.createElement('div');
	 * let elem = document.createElement('div');
	 *
	 * // Style the scrollable area with a small height and a black border.
	 * area.style.height = '100px';
	 * area.style.overflow = 'auto';
	 * area.style.border = '1px solid black';
	 *
	 * // Style the element of interest with a red border and some content.
	 * elem.style.border = '1px solid red';
	 * elem.textContent = 'visible content';
	 *
	 * // Add enough whitespace to to guarantee scrolling.
	 * for (let i = 0; i < 50; i++) {
	 *   area.appendChild(document.createElement('br'));
	 * }
	 *
	 * // Attach the nodes to the DOM.
	 * area.appendChild(elem);
	 * document.body.appendChild(area);
	 *
	 * // Scroll to the element of interest.
	 * scrollIntoViewIfNeeded(area, elem);
	 * ```
	 */
	function scrollIntoViewIfNeeded(area, elem) {
	    var ar = area.getBoundingClientRect();
	    var er = elem.getBoundingClientRect();
	    if (er.top <= ar.top && er.bottom >= ar.bottom) {
	        return;
	    }
	    if (er.top < ar.top && er.height <= ar.height) {
	        area.scrollTop -= ar.top - er.top;
	        return;
	    }
	    if (er.bottom > ar.bottom && er.height >= ar.height) {
	        area.scrollTop -= ar.top - er.top;
	        return;
	    }
	    if (er.top < ar.top && er.height > ar.height) {
	        area.scrollTop -= ar.bottom - er.bottom;
	        return;
	    }
	    if (er.bottom > ar.bottom && er.height < ar.height) {
	        area.scrollTop -= ar.bottom - er.bottom;
	        return;
	    }
	}
	exports.scrollIntoViewIfNeeded = scrollIntoViewIfNeeded;
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/dom/query.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/ui/vdom.js **/
jupyter.define('phosphor@0.7.1/lib/ui/vdom.js', function (module, exports, __jupyter_require__) {
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	"use strict";
	/**
	 * A node in a virtual DOM hierarchy.
	 *
	 * #### Notes
	 * User code will not usually instantiate an node directly. Rather, the
	 * `h()` function will be called to create a node in a type-safe manner.
	 *
	 * A node *must* be treated as immutable. Mutating the state of a node
	 * **will** result in undefined rendering behavior.
	 */
	var VNode = (function () {
	    /**
	     * Construct a new virtual DOM node.
	     *
	     * @param type - The type of the node.
	     *
	     * @param tag - The node tag.
	     *
	     * @param attrs - The node attributes.
	     *
	     * @param children - The node children.
	     */
	    function VNode(type, tag, attrs, children) {
	        this.type = type;
	        this.tag = tag;
	        this.attrs = attrs;
	        this.children = children;
	    }
	    return VNode;
	}());
	exports.VNode = VNode;
	function h(tag, first) {
	    // Setup the variables to hold the parsed data.
	    var attrs;
	    var children;
	    // Parse the first variadic argument.
	    if (first) {
	        if (typeof first === 'string') {
	            children = [first];
	        }
	        else if (first instanceof VNode) {
	            children = [first];
	        }
	        else if (first instanceof Array) {
	            children = first.slice();
	        }
	        else {
	            attrs = first;
	        }
	    }
	    // Parse the rest of the variadic arguments.
	    if (arguments.length > 2) {
	        children = children || [];
	        for (var i = 2, n = arguments.length; i < n; ++i) {
	            var child = arguments[i];
	            if (child instanceof Array) {
	                for (var j = 0, k = child.length; j < k; ++j) {
	                    if (child[j])
	                        children.push(child[j]);
	                }
	            }
	            else if (child) {
	                children.push(child);
	            }
	        }
	    }
	    // Convert string literal children into text nodes.
	    if (children) {
	        for (var i = 0, n = children.length; i < n; ++i) {
	            var child = children[i];
	            if (typeof child === 'string') {
	                children[i] = Private.createTextVNode(child);
	            }
	        }
	    }
	    // Return a new virtual DOM node.
	    return Private.createElementVNode(tag, attrs, children);
	}
	exports.h = h;
	/**
	 * The namespace for the `h()` function statics.
	 */
	(function (h) {
	    h.a = h.bind(void 0, 'a');
	    h.abbr = h.bind(void 0, 'abbr');
	    h.address = h.bind(void 0, 'address');
	    h.area = h.bind(void 0, 'area');
	    h.article = h.bind(void 0, 'article');
	    h.aside = h.bind(void 0, 'aside');
	    h.audio = h.bind(void 0, 'audio');
	    h.b = h.bind(void 0, 'b');
	    h.bdi = h.bind(void 0, 'bdi');
	    h.bdo = h.bind(void 0, 'bdo');
	    h.blockquote = h.bind(void 0, 'blockquote');
	    h.br = h.bind(void 0, 'br');
	    h.button = h.bind(void 0, 'button');
	    h.canvas = h.bind(void 0, 'canvas');
	    h.caption = h.bind(void 0, 'caption');
	    h.cite = h.bind(void 0, 'cite');
	    h.code = h.bind(void 0, 'code');
	    h.col = h.bind(void 0, 'col');
	    h.colgroup = h.bind(void 0, 'colgroup');
	    h.data = h.bind(void 0, 'data');
	    h.datalist = h.bind(void 0, 'datalist');
	    h.dd = h.bind(void 0, 'dd');
	    h.del = h.bind(void 0, 'del');
	    h.dfn = h.bind(void 0, 'dfn');
	    h.div = h.bind(void 0, 'div');
	    h.dl = h.bind(void 0, 'dl');
	    h.dt = h.bind(void 0, 'dt');
	    h.em = h.bind(void 0, 'em');
	    h.embed = h.bind(void 0, 'embed');
	    h.fieldset = h.bind(void 0, 'fieldset');
	    h.figcaption = h.bind(void 0, 'figcaption');
	    h.figure = h.bind(void 0, 'figure');
	    h.footer = h.bind(void 0, 'footer');
	    h.form = h.bind(void 0, 'form');
	    h.h1 = h.bind(void 0, 'h1');
	    h.h2 = h.bind(void 0, 'h2');
	    h.h3 = h.bind(void 0, 'h3');
	    h.h4 = h.bind(void 0, 'h4');
	    h.h5 = h.bind(void 0, 'h5');
	    h.h6 = h.bind(void 0, 'h6');
	    h.header = h.bind(void 0, 'header');
	    h.hr = h.bind(void 0, 'hr');
	    h.i = h.bind(void 0, 'i');
	    h.iframe = h.bind(void 0, 'iframe');
	    h.img = h.bind(void 0, 'img');
	    h.input = h.bind(void 0, 'input');
	    h.ins = h.bind(void 0, 'ins');
	    h.kbd = h.bind(void 0, 'kbd');
	    h.label = h.bind(void 0, 'label');
	    h.legend = h.bind(void 0, 'legend');
	    h.li = h.bind(void 0, 'li');
	    h.main = h.bind(void 0, 'main');
	    h.map = h.bind(void 0, 'map');
	    h.mark = h.bind(void 0, 'mark');
	    h.meter = h.bind(void 0, 'meter');
	    h.nav = h.bind(void 0, 'nav');
	    h.noscript = h.bind(void 0, 'noscript');
	    h.object = h.bind(void 0, 'object');
	    h.ol = h.bind(void 0, 'ol');
	    h.optgroup = h.bind(void 0, 'optgroup');
	    h.option = h.bind(void 0, 'option');
	    h.output = h.bind(void 0, 'output');
	    h.p = h.bind(void 0, 'p');
	    h.param = h.bind(void 0, 'param');
	    h.pre = h.bind(void 0, 'pre');
	    h.progress = h.bind(void 0, 'progress');
	    h.q = h.bind(void 0, 'q');
	    h.rp = h.bind(void 0, 'rp');
	    h.rt = h.bind(void 0, 'rt');
	    h.ruby = h.bind(void 0, 'ruby');
	    h.s = h.bind(void 0, 's');
	    h.samp = h.bind(void 0, 'samp');
	    h.section = h.bind(void 0, 'section');
	    h.select = h.bind(void 0, 'select');
	    h.small = h.bind(void 0, 'small');
	    h.source = h.bind(void 0, 'source');
	    h.span = h.bind(void 0, 'span');
	    h.strong = h.bind(void 0, 'strong');
	    h.sub = h.bind(void 0, 'sub');
	    h.summary = h.bind(void 0, 'summary');
	    h.sup = h.bind(void 0, 'sup');
	    h.table = h.bind(void 0, 'table');
	    h.tbody = h.bind(void 0, 'tbody');
	    h.td = h.bind(void 0, 'td');
	    h.textarea = h.bind(void 0, 'textarea');
	    h.tfoot = h.bind(void 0, 'tfoot');
	    h.th = h.bind(void 0, 'th');
	    h.thead = h.bind(void 0, 'thead');
	    h.time = h.bind(void 0, 'time');
	    h.title = h.bind(void 0, 'title');
	    h.tr = h.bind(void 0, 'tr');
	    h.track = h.bind(void 0, 'track');
	    h.u = h.bind(void 0, 'u');
	    h.ul = h.bind(void 0, 'ul');
	    h.var_ = h.bind(void 0, 'var');
	    h.video = h.bind(void 0, 'video');
	    h.wbr = h.bind(void 0, 'wbr');
	})(h = exports.h || (exports.h = {}));
	/**
	 * Create a real DOM node from a virtual DOM node.
	 *
	 * @param content - The virtual DOM content to realize.
	 *
	 * @returns A new DOM node for the given virtual DOM tree.
	 *
	 * #### Notes
	 * The content node is assumed to be of the `'element'` type.
	 *
	 * This creates a brand new *real* DOM node with a structure which
	 * matches the given virtual DOM node.
	 *
	 * If virtual diffing is desired, use the `render` function instead.
	 */
	function realize(content) {
	    return Private.realizeImpl(content);
	}
	exports.realize = realize;
	/**
	 * Render virtual DOM content into a host element.
	 *
	 * @param content - The virtual DOM content to render.
	 *
	 * @param host - The host element for the rendered content.
	 *
	 * #### Notes
	 * This renders the delta from the previous rendering. It assumes that
	 * the content of the host element is not manipulated by external code.
	 *
	 * Providing `null` content will clear the rendering.
	 *
	 * Externally modifying the provided content or the host element will
	 * result in undefined rendering behavior.
	 */
	function render(content, host) {
	    Private.renderImpl(content, host);
	}
	exports.render = render;
	/**
	 * The namespace for the private module data.
	 */
	var Private;
	(function (Private) {
	    /**
	     * Create a virtual text node for the given string.
	     */
	    function createTextVNode(text) {
	        return new VNode('text', text, emptyObject, emptyArray);
	    }
	    Private.createTextVNode = createTextVNode;
	    /**
	     * Create a virtual element node for the given parameters.
	     */
	    function createElementVNode(tag, attrs, children) {
	        attrs = attrs || emptyObject;
	        children = children || emptyArray;
	        return new VNode('element', tag, attrs, children);
	    }
	    Private.createElementVNode = createElementVNode;
	    /**
	     * The internal `realize` entry point.
	     */
	    function realizeImpl(content) {
	        return createDOMNode(content);
	    }
	    Private.realizeImpl = realizeImpl;
	    /**
	     * The internal `render` entry point.
	     */
	    function renderImpl(content, host) {
	        var oldContent = hostMap.get(host) || emptyArray;
	        var newContent = asVNodeArray(content);
	        hostMap.set(host, newContent);
	        updateContent(host, oldContent, newContent);
	    }
	    Private.renderImpl = renderImpl;
	    /**
	     * A shared frozen empty array.
	     */
	    var emptyArray = Object.freeze([]);
	    /**
	     * A shared frozen empty object.
	     */
	    var emptyObject = Object.freeze({});
	    /**
	     * A weak mapping of host element to virtual DOM content.
	     */
	    var hostMap = new WeakMap();
	    /**
	     * Coerce content into a virtual node array.
	     *
	     * Null content will be coerced to an empty array.
	     */
	    function asVNodeArray(content) {
	        if (content instanceof Array) {
	            return content;
	        }
	        if (content) {
	            return [content];
	        }
	        return emptyArray;
	    }
	    /**
	     * Update a host element with the delta of the virtual content.
	     *
	     * This is the core "diff" algorithm. There is no explicit "patch"
	     * phase. The host is patched at each step as the diff progresses.
	     */
	    function updateContent(host, oldContent, newContent) {
	        // Bail early if the content is identical. This can occur when an
	        // node has no children or if the user is rendering cached content.
	        if (oldContent === newContent) {
	            return;
	        }
	        // Collect the old keyed elems into a mapping.
	        var oldKeyed = collectKeys(host, oldContent);
	        // Create a copy of the old content which can be modified in-place.
	        var oldCopy = oldContent.slice();
	        // Update the host with the new content. The diff always proceeds
	        // forward and never modifies a previously visited index. The old
	        // copy array is modified in-place to reflect the changes made to
	        // the host children. This causes the stale nodes to be pushed to
	        // the end of the host node and removed at the end of the loop.
	        var currNode = host.firstChild;
	        var newCount = newContent.length;
	        for (var i = 0; i < newCount; ++i) {
	            // If the old elems are exhausted, create a new node.
	            if (i >= oldCopy.length) {
	                host.appendChild(createDOMNode(newContent[i]));
	                continue;
	            }
	            // Cache a reference to the old and new elems.
	            var oldVNode = oldCopy[i];
	            var newVNode = newContent[i];
	            // If the new elem is keyed, move an old keyed elem to the proper
	            // location before proceeding with the diff. The search can start
	            // at the current index, since the unmatched old keyed elems are
	            // pushed forward in the old copy array.
	            var newKey = newVNode.attrs.key;
	            if (newKey && newKey in oldKeyed) {
	                var pair = oldKeyed[newKey];
	                if (pair.vNode !== oldVNode) {
	                    arrayMove(oldCopy, oldCopy.indexOf(pair.vNode), i);
	                    host.insertBefore(pair.element, currNode);
	                    oldVNode = pair.vNode;
	                    currNode = pair.element;
	                }
	            }
	            // If both elements are identical, there is nothing to do.
	            // This can occur when the user renders cached content.
	            if (oldVNode === newVNode) {
	                currNode = currNode.nextSibling;
	                continue;
	            }
	            // If the old elem is keyed and does not match the new elem key,
	            // create a new node. This is necessary since the old keyed elem
	            // may be matched at a later point in the diff.
	            var oldKey = oldVNode.attrs.key;
	            if (oldKey && oldKey !== newKey) {
	                arrayInsert(oldCopy, i, newVNode);
	                host.insertBefore(createDOMNode(newVNode), currNode);
	                continue;
	            }
	            // If the elements have different types, create a new node.
	            if (oldVNode.type !== newVNode.type) {
	                arrayInsert(oldCopy, i, newVNode);
	                host.insertBefore(createDOMNode(newVNode), currNode);
	                continue;
	            }
	            // If the element is a text node, update its text content.
	            if (newVNode.type === 'text') {
	                currNode.textContent = newVNode.tag;
	                currNode = currNode.nextSibling;
	                continue;
	            }
	            // At this point, the node is an 'element' type. If the tags
	            // are different, create a new node.
	            if (oldVNode.tag !== newVNode.tag) {
	                arrayInsert(oldCopy, i, newVNode);
	                host.insertBefore(createDOMNode(newVNode), currNode);
	                continue;
	            }
	            // The element tags match, update the element in place.
	            updateAttrs(currNode, oldVNode.attrs, newVNode.attrs);
	            updateContent(currNode, oldVNode.children, newVNode.children);
	            currNode = currNode.nextSibling;
	        }
	        // Dispose of the old nodes pushed to the end of the host.
	        for (var i = oldCopy.length - 1; i >= newCount; --i) {
	            host.removeChild(host.lastChild);
	        }
	    }
	    /**
	     * Add attributes to a newly created DOM node.
	     */
	    function addAttrs(node, attrs) {
	        // Set the known attributes defined in the attr table.
	        for (var name_1 in attrs) {
	            var mode = attrModeTable[name_1];
	            if (mode === 0 /* Property */ || mode === 2 /* Event */) {
	                node[name_1] = attrs[name_1];
	            }
	            else if (mode === 1 /* Attribute */) {
	                node.setAttribute(name_1.toLowerCase(), attrs[name_1]);
	            }
	        }
	        // Handle the dataset values.
	        var dataset = attrs.dataset;
	        if (dataset) {
	            for (var name_2 in dataset) {
	                node.setAttribute("data-" + name_2, dataset[name_2]);
	            }
	        }
	        // Handle the inline styles.
	        var styles = attrs.style;
	        if (styles) {
	            var nodeStyle = node.style;
	            for (var name_3 in styles) {
	                nodeStyle[name_3] = styles[name_3];
	            }
	        }
	    }
	    /**
	     * Update the node attributes with the delta of attribute objects.
	     */
	    function updateAttrs(node, oldAttrs, newAttrs) {
	        // Do nothing if the attrs are the same object.
	        if (oldAttrs === newAttrs) {
	            return;
	        }
	        // Remove attributes which no longer exist.
	        for (var name_4 in oldAttrs) {
	            if (!(name_4 in newAttrs)) {
	                var mode = attrModeTable[name_4];
	                if (mode === 0 /* Property */) {
	                    node.removeAttribute(name_4);
	                }
	                else if (mode === 1 /* Attribute */) {
	                    node.removeAttribute(name_4.toLowerCase());
	                }
	                else if (mode === 2 /* Event */) {
	                    node[name_4] = null;
	                }
	            }
	        }
	        // Add new attributes an update existing ones.
	        for (var name_5 in newAttrs) {
	            var value = newAttrs[name_5];
	            if (oldAttrs[name_5] !== value) {
	                var mode = attrModeTable[name_5];
	                if (mode === 0 /* Property */ || mode === 2 /* Event */) {
	                    node[name_5] = value;
	                }
	                else if (mode === 1 /* Attribute */) {
	                    node.setAttribute(name_5.toLowerCase(), value);
	                }
	            }
	        }
	        // Handle the dataset values.
	        var oldDataset = oldAttrs.dataset || emptyObject;
	        var newDataset = newAttrs.dataset || emptyObject;
	        if (oldDataset !== newDataset) {
	            for (var name_6 in oldDataset) {
	                if (!(name_6 in newDataset)) {
	                    node.removeAttribute('data-' + name_6);
	                }
	            }
	            for (var name_7 in newDataset) {
	                var value = newDataset[name_7];
	                if (oldDataset[name_7] !== value) {
	                    node.setAttribute('data-' + name_7, value);
	                }
	            }
	        }
	        // Handle the inline styles.
	        var oldStyle = oldAttrs.style || emptyObject;
	        var newStyle = newAttrs.style || emptyObject;
	        if (oldStyle !== newStyle) {
	            var nodeStyle = node.style;
	            for (var name_8 in oldStyle) {
	                if (!(name_8 in newStyle)) {
	                    nodeStyle[name_8] = '';
	                }
	            }
	            for (var name_9 in newStyle) {
	                var value = newStyle[name_9];
	                if (oldStyle[name_9] !== value) {
	                    nodeStyle[name_9] = value;
	                }
	            }
	        }
	    }
	    /**
	     * Collect a mapping of keyed elements for the host content.
	     */
	    function collectKeys(host, content) {
	        var node = host.firstChild;
	        var keyed = Object.create(null);
	        for (var i = 0, n = content.length; i < n; ++i) {
	            var vNode = content[i];
	            if (vNode.type === 'element') {
	                var key = vNode.attrs.key;
	                if (key)
	                    keyed[key] = { vNode: vNode, element: node };
	            }
	            node = node.nextSibling;
	        }
	        return keyed;
	    }
	    /**
	     * Create and return a new DOM node for a virtual element.
	     */
	    function createDOMNode(elem) {
	        var node;
	        if (elem.type === 'text') {
	            node = document.createTextNode(elem.tag);
	        }
	        else {
	            node = document.createElement(elem.tag);
	            addAttrs(node, elem.attrs);
	            addContent(node, elem.children);
	        }
	        return node;
	    }
	    /**
	     * Create and add child content to a newly created DOM node.
	     */
	    function addContent(node, content) {
	        for (var i = 0, n = content.length; i < n; ++i) {
	            node.appendChild(createDOMNode(content[i]));
	        }
	    }
	    /**
	     * A mapping of attribute name to attribute mode.
	     */
	    var attrModeTable = {
	        accept: 0 /* Property */,
	        acceptCharset: 0 /* Property */,
	        accessKey: 0 /* Property */,
	        action: 0 /* Property */,
	        allowFullscreen: 1 /* Attribute */,
	        alt: 0 /* Property */,
	        autocomplete: 0 /* Property */,
	        autofocus: 0 /* Property */,
	        autoplay: 0 /* Property */,
	        checked: 0 /* Property */,
	        cite: 0 /* Property */,
	        className: 0 /* Property */,
	        colSpan: 0 /* Property */,
	        cols: 0 /* Property */,
	        contentEditable: 0 /* Property */,
	        controls: 0 /* Property */,
	        coords: 0 /* Property */,
	        crossOrigin: 0 /* Property */,
	        data: 0 /* Property */,
	        dateTime: 0 /* Property */,
	        default: 0 /* Property */,
	        dir: 0 /* Property */,
	        dirName: 0 /* Property */,
	        disabled: 0 /* Property */,
	        download: 0 /* Property */,
	        draggable: 0 /* Property */,
	        enctype: 0 /* Property */,
	        form: 1 /* Attribute */,
	        formAction: 0 /* Property */,
	        formEnctype: 0 /* Property */,
	        formMethod: 0 /* Property */,
	        formNoValidate: 0 /* Property */,
	        formTarget: 0 /* Property */,
	        headers: 0 /* Property */,
	        height: 0 /* Property */,
	        hidden: 0 /* Property */,
	        high: 0 /* Property */,
	        href: 0 /* Property */,
	        hreflang: 0 /* Property */,
	        htmlFor: 0 /* Property */,
	        id: 0 /* Property */,
	        inputMode: 0 /* Property */,
	        isMap: 0 /* Property */,
	        kind: 0 /* Property */,
	        label: 0 /* Property */,
	        lang: 0 /* Property */,
	        list: 1 /* Attribute */,
	        loop: 0 /* Property */,
	        low: 0 /* Property */,
	        max: 0 /* Property */,
	        maxLength: 0 /* Property */,
	        media: 1 /* Attribute */,
	        mediaGroup: 0 /* Property */,
	        method: 0 /* Property */,
	        min: 0 /* Property */,
	        minLength: 0 /* Property */,
	        multiple: 0 /* Property */,
	        muted: 0 /* Property */,
	        name: 0 /* Property */,
	        noValidate: 0 /* Property */,
	        optimum: 0 /* Property */,
	        pattern: 0 /* Property */,
	        placeholder: 0 /* Property */,
	        poster: 0 /* Property */,
	        preload: 0 /* Property */,
	        readOnly: 0 /* Property */,
	        rel: 0 /* Property */,
	        required: 0 /* Property */,
	        reversed: 0 /* Property */,
	        rowSpan: 0 /* Property */,
	        rows: 0 /* Property */,
	        sandbox: 0 /* Property */,
	        scope: 0 /* Property */,
	        seamless: 1 /* Attribute */,
	        selected: 0 /* Property */,
	        shape: 0 /* Property */,
	        size: 0 /* Property */,
	        sizes: 1 /* Attribute */,
	        sorted: 0 /* Property */,
	        span: 0 /* Property */,
	        spellcheck: 0 /* Property */,
	        src: 0 /* Property */,
	        srcdoc: 0 /* Property */,
	        srclang: 0 /* Property */,
	        srcset: 1 /* Attribute */,
	        start: 0 /* Property */,
	        step: 0 /* Property */,
	        tabIndex: 0 /* Property */,
	        target: 0 /* Property */,
	        title: 0 /* Property */,
	        type: 0 /* Property */,
	        typeMustMatch: 0 /* Property */,
	        useMap: 0 /* Property */,
	        value: 0 /* Property */,
	        volume: 0 /* Property */,
	        width: 0 /* Property */,
	        wrap: 0 /* Property */,
	        onabort: 2 /* Event */,
	        onbeforecopy: 2 /* Event */,
	        onbeforecut: 2 /* Event */,
	        onbeforepaste: 2 /* Event */,
	        onblur: 2 /* Event */,
	        oncanplay: 2 /* Event */,
	        oncanplaythrough: 2 /* Event */,
	        onchange: 2 /* Event */,
	        onclick: 2 /* Event */,
	        oncontextmenu: 2 /* Event */,
	        oncopy: 2 /* Event */,
	        oncuechange: 2 /* Event */,
	        oncut: 2 /* Event */,
	        ondblclick: 2 /* Event */,
	        ondrag: 2 /* Event */,
	        ondragend: 2 /* Event */,
	        ondragenter: 2 /* Event */,
	        ondragleave: 2 /* Event */,
	        ondragover: 2 /* Event */,
	        ondragstart: 2 /* Event */,
	        ondrop: 2 /* Event */,
	        ondurationchange: 2 /* Event */,
	        onended: 2 /* Event */,
	        onemptied: 2 /* Event */,
	        onerror: 2 /* Event */,
	        onfocus: 2 /* Event */,
	        onhelp: 2 /* Event */,
	        oninput: 2 /* Event */,
	        onkeydown: 2 /* Event */,
	        onkeypress: 2 /* Event */,
	        onkeyup: 2 /* Event */,
	        onload: 2 /* Event */,
	        onloadeddata: 2 /* Event */,
	        onloadedmetadata: 2 /* Event */,
	        onloadstart: 2 /* Event */,
	        onmousedown: 2 /* Event */,
	        onmouseenter: 2 /* Event */,
	        onmouseleave: 2 /* Event */,
	        onmousemove: 2 /* Event */,
	        onmouseout: 2 /* Event */,
	        onmouseover: 2 /* Event */,
	        onmouseup: 2 /* Event */,
	        onmousewheel: 2 /* Event */,
	        onpaste: 2 /* Event */,
	        onpause: 2 /* Event */,
	        onplay: 2 /* Event */,
	        onplaying: 2 /* Event */,
	        onprogress: 2 /* Event */,
	        onratechange: 2 /* Event */,
	        onreadystatechange: 2 /* Event */,
	        onreset: 2 /* Event */,
	        onscroll: 2 /* Event */,
	        onseeked: 2 /* Event */,
	        onseeking: 2 /* Event */,
	        onselect: 2 /* Event */,
	        onselectstart: 2 /* Event */,
	        onstalled: 2 /* Event */,
	        onsubmit: 2 /* Event */,
	        onsuspend: 2 /* Event */,
	        ontimeupdate: 2 /* Event */,
	        onvolumechange: 2 /* Event */,
	        onwaiting: 2 /* Event */
	    };
	    /**
	     * Insert an element into an array at a specified index.
	     */
	    function arrayInsert(array, i, value) {
	        for (var k = array.length; k > i; --k) {
	            array[k] = array[k - 1];
	        }
	        array[i] = value;
	    }
	    /**
	     * Move an element in an array from one index to another.
	     */
	    function arrayMove(array, i, j) {
	        if (i === j) {
	            return;
	        }
	        var value = array[i];
	        var d = i < j ? 1 : -1;
	        for (var k = i; k !== j; k += d) {
	            array[k] = array[k + d];
	        }
	        array[j] = value;
	    }
	})(Private || (Private = {}));
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/ui/vdom.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/phosphor/accordion.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/phosphor/accordion.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var signaling_1 = __jupyter_require__('phosphor@^0.7.0/lib/core/signaling.js');
	var panel_1 = __jupyter_require__('phosphor@^0.7.0/lib/ui/panel.js');
	var widget_1 = __jupyter_require__('phosphor@^0.7.0/lib/ui/widget.js');
	var currentselection_1 = __jupyter_require__('jupyter-js-widgets@2.1.4/lib/phosphor/currentselection.js');
	var searching_1 = __jupyter_require__('phosphor@^0.7.0/lib/algorithm/searching.js');
	/**
	 * The class name added to Collapse instances.
	 */
	var COLLAPSE_CLASS = 'p-Collapse';
	/**
	 * The class name added to a Collapse's header.
	 */
	var COLLAPSE_HEADER_CLASS = 'p-Collapse-header';
	/**
	 * The class name added to a Collapse's contents.
	 */
	var COLLAPSE_CONTENTS_CLASS = 'p-Collapse-contents';
	/**
	 * The class name added to a Collapse when it is opened
	 */
	var COLLAPSE_CLASS_OPEN = 'p-Collapse-open';
	/**
	 * A panel that supports a collapsible header, made from the widget's title.
	 * Clicking on the title expands or contracts the widget.
	 */
	var Collapse = (function (_super) {
	    __extends(Collapse, _super);
	    function Collapse(options) {
	        _super.call(this, options);
	        this.addClass(COLLAPSE_CLASS);
	        this._header = new widget_1.Widget();
	        this._header.addClass(COLLAPSE_HEADER_CLASS);
	        this._header.node.addEventListener('click', this);
	        this._content = new panel_1.Panel();
	        this._content.addClass(COLLAPSE_CONTENTS_CLASS);
	        var layout = new panel_1.PanelLayout();
	        this.layout = layout;
	        layout.addWidget(this._header);
	        layout.addWidget(this._content);
	        if (options.widget) {
	            this.widget = options.widget;
	        }
	        this.collapsed = false;
	    }
	    Collapse.prototype.dispose = function () {
	        if (this.isDisposed) {
	            return;
	        }
	        _super.prototype.dispose.call(this);
	        this._header = null;
	        this._widget = null;
	        this._content = null;
	    };
	    Object.defineProperty(Collapse.prototype, "widget", {
	        get: function () {
	            return this._widget;
	        },
	        set: function (widget) {
	            var oldWidget = this._widget;
	            if (oldWidget) {
	                oldWidget.disposed.disconnect(this._onChildDisposed, this);
	                oldWidget.title.changed.disconnect(this._onTitleChanged, this);
	                oldWidget.parent = null;
	            }
	            this._widget = widget;
	            widget.disposed.connect(this._onChildDisposed, this);
	            widget.title.changed.connect(this._onTitleChanged, this);
	            this._onTitleChanged(widget.title);
	            this._content.addWidget(widget);
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Collapse.prototype, "collapsed", {
	        get: function () {
	            return this._collapsed;
	        },
	        set: function (value) {
	            // TODO: should we have this check here?
	            if (value === this._collapsed) {
	                return;
	            }
	            if (value) {
	                this._collapse();
	            }
	            else {
	                this._uncollapse();
	            }
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Collapse.prototype.toggle = function () {
	        this.collapsed = !this.collapsed;
	    };
	    Collapse.prototype._collapse = function () {
	        this._collapsed = true;
	        if (this._content) {
	            this._content.hide();
	        }
	        this.removeClass(COLLAPSE_CLASS_OPEN);
	        this.collapseChanged.emit(void 0);
	    };
	    Collapse.prototype._uncollapse = function () {
	        this._collapsed = false;
	        if (this._content) {
	            this._content.show();
	        }
	        this.addClass(COLLAPSE_CLASS_OPEN);
	        this.collapseChanged.emit(void 0);
	    };
	    /**
	     * Handle the DOM events for the Collapse widget.
	     *
	     * @param event - The DOM event sent to the panel.
	     *
	     * #### Notes
	     * This method implements the DOM `EventListener` interface and is
	     * called in response to events on the panel's DOM node. It should
	     * not be called directly by user code.
	     */
	    Collapse.prototype.handleEvent = function (event) {
	        switch (event.type) {
	            case 'click':
	                this._evtClick(event);
	                break;
	            default:
	                break;
	        }
	    };
	    Collapse.prototype._evtClick = function (event) {
	        this.toggle();
	    };
	    /**
	     * Handle the `changed` signal of a title object.
	     */
	    Collapse.prototype._onTitleChanged = function (sender) {
	        this._header.node.textContent = this._widget.title.label;
	    };
	    Collapse.prototype._onChildDisposed = function (sender) {
	        this.dispose();
	    };
	    return Collapse;
	}(widget_1.Widget));
	exports.Collapse = Collapse;
	// Define the signals for the `Widget` class.
	signaling_1.defineSignal(Collapse.prototype, 'collapseChanged');
	/**
	 * The class name added to Accordion instances.
	 */
	var ACCORDION_CLASS = 'p-Accordion';
	/**
	 * The class name added to an Accordion child.
	 */
	var ACCORDION_CHILD_CLASS = 'p-Accordion-child';
	var ACCORDION_CHILD_ACTIVE_CLASS = 'p-Accordion-child-active';
	/**
	 * A panel that supports a collapsible header, made from the widget's title.
	 * Clicking on the title expands or contracts the widget.
	 */
	var Accordion = (function (_super) {
	    __extends(Accordion, _super);
	    function Accordion(options) {
	        _super.call(this, options);
	        this._selection = new currentselection_1.Selection(this.widgets);
	        this._selection.selectionChanged.connect(this._onSelectionChanged, this);
	        this.addClass(ACCORDION_CLASS);
	    }
	    Object.defineProperty(Accordion.prototype, "collapseWidgets", {
	        /**
	         * A read-only sequence of the widgets in the panel.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        /*  get widgets(): ISequence<Widget> {
	            return new ArraySequence(toArray(map((this.layout as PanelLayout).widgets, (w: Collapse) => w.widget)));
	          }
	        */
	        get: function () {
	            return this.layout.widgets;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Accordion.prototype, "selection", {
	        get: function () {
	            return this._selection;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Accordion.prototype.indexOf = function (widget) {
	        return searching_1.findIndex(this.collapseWidgets, function (w) { return w.widget === widget; });
	    };
	    /**
	     * Add a widget to the end of the accordion.
	     *
	     * @param widget - The widget to add to the accordion.
	     *
	     * @returns The Collapse widget wrapping the added widget.
	     * #### Notes
	     * The widget will be wrapped in a CollapsedWidget.
	     */
	    Accordion.prototype.addWidget = function (widget) {
	        var collapse = this._wrapWidget(widget);
	        collapse.collapsed = true;
	        _super.prototype.addWidget.call(this, collapse);
	        this._selection.adjustSelectionForInsert(this.widgets.length - 1, collapse);
	        return collapse;
	    };
	    /**
	     * Insert a widget at the specified index.
	     *
	     * @param index - The index at which to insert the widget.
	     *
	     * @param widget - The widget to insert into to the accordion.
	     *
	     * #### Notes
	     * If the widget is already contained in the panel, it will be moved.
	     */
	    Accordion.prototype.insertWidget = function (index, widget) {
	        var collapse = this._wrapWidget(widget);
	        collapse.collapsed = true;
	        _super.prototype.insertWidget.call(this, index, collapse);
	        this._selection.adjustSelectionForInsert(index, collapse);
	    };
	    Accordion.prototype.removeWidget = function (widget) {
	        var index = this.indexOf(widget);
	        if (index >= 0) {
	            var collapse = this.collapseWidgets.at(index);
	            widget.parent = null;
	            collapse.dispose();
	            this._selection.adjustSelectionForRemove(index, null);
	        }
	    };
	    Accordion.prototype._wrapWidget = function (widget) {
	        var collapse = new Collapse({ widget: widget });
	        collapse.addClass(ACCORDION_CHILD_CLASS);
	        collapse.collapseChanged.connect(this._onCollapseChange, this);
	        return collapse;
	    };
	    Accordion.prototype._onCollapseChange = function (sender) {
	        if (!sender.collapsed) {
	            this._selection.value = sender;
	        }
	        else if (this._selection.value === sender && sender.collapsed) {
	            this._selection.value = null;
	        }
	    };
	    Accordion.prototype._onSelectionChanged = function (sender, change) {
	        // Collapse previous widget, open current widget
	        var pv = change.previousValue;
	        var cv = change.currentValue;
	        if (pv) {
	            pv.collapsed = true;
	            pv.removeClass(ACCORDION_CHILD_ACTIVE_CLASS);
	        }
	        if (cv) {
	            cv.collapsed = false;
	            cv.addClass(ACCORDION_CHILD_ACTIVE_CLASS);
	        }
	    };
	    return Accordion;
	}(panel_1.Panel));
	exports.Accordion = Accordion;
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/phosphor/accordion.js **/


/** START DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/phosphor/currentselection.js **/
jupyter.define('jupyter-js-widgets@2.1.4/lib/phosphor/currentselection.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	/**
	 * A variety of convenience methods for maintaining a current selection
	 */
	var searching_1 = __jupyter_require__('phosphor@^0.7.0/lib/algorithm/searching.js');
	var signaling_1 = __jupyter_require__('phosphor@^0.7.0/lib/core/signaling.js');
	var Selection = (function () {
	    function Selection(sequence, options) {
	        if (options === void 0) { options = {}; }
	        this._sequence = null;
	        this._value = null;
	        this._previousValue = null;
	        this._sequence = sequence;
	        this._insertBehavior = options.insertBehavior || 'select-item-if-needed';
	        this._removeBehavior = options.removeBehavior || 'select-item-after';
	    }
	    /**
	     * Adjust for setting an item.
	     *
	     * This should be called *after* the set.
	     *
	     * @param index - The index set.
	     * @param oldValue - The old value at the index.
	     */
	    Selection.prototype.adjustSelectionForSet = function (index) {
	        // We just need to send a signal if the currentValue changed.
	        // Get the current index and value.
	        var pi = this.index;
	        var pv = this.value;
	        // Exit early if this doesn't affect the selection
	        if (index !== pi) {
	            return;
	        }
	        this._updateSelectedValue();
	        var cv = this.value;
	        // The previous item is now null, since it is no longer in the array.
	        this._previousValue = null;
	        // Send signal if there was a change
	        if (pv !== cv) {
	            // Emit the current changed signal.
	            this.selectionChanged.emit({
	                previousIndex: pi, previousValue: pv,
	                currentIndex: pi, currentValue: cv
	            });
	        }
	    };
	    Object.defineProperty(Selection.prototype, "value", {
	        /**
	         * Get the currently selected item.
	         *
	         * #### Notes
	         * This will be `null` if no item is selected.
	         */
	        get: function () {
	            return this._value;
	        },
	        /**
	         * Set the currently selected item.
	         *
	         * #### Notes
	         * If the item does not exist in the vector, the currentValue will be set to
	         * `null`. This selects the first entry equal to the desired item.
	         */
	        set: function (value) {
	            if (value === null) {
	                this.index = -1;
	            }
	            else {
	                this.index = searching_1.indexOf(this._sequence, value);
	            }
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Selection.prototype, "index", {
	        /**
	         * Get the index of the currently selected item.
	         *
	         * #### Notes
	         * This will be `-1` if no item is selected.
	         */
	        get: function () {
	            return this._index;
	        },
	        /**
	         * Set the index of the currently selected tab.
	         *
	         * @param index - The index to select.
	         *
	         * #### Notes
	         * If the value is out of range, the index will be set to `-1`, which
	         * indicates no item is selected.
	         */
	        set: function (index) {
	            // Coerce the value to an index.
	            var i = Math.floor(index);
	            if (i < 0 || i >= this._sequence.length) {
	                i = -1;
	            }
	            // Bail early if the index will not change.
	            if (this._index === i) {
	                return;
	            }
	            // Look up the previous index and item.
	            var pi = this._index;
	            var pv = this._value;
	            // Update the state
	            this._index = i;
	            this._updateSelectedValue();
	            this._previousValue = pv;
	            // Emit the current changed signal.
	            this.selectionChanged.emit({
	                previousIndex: pi, previousValue: pv,
	                currentIndex: i, currentValue: this._value
	            });
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Selection.prototype, "insertBehavior", {
	        /**
	         * Get the selection behavior when inserting a tab.
	         */
	        get: function () {
	            return this._insertBehavior;
	        },
	        /**
	         * Set the selection behavior when inserting a tab.
	         */
	        set: function (value) {
	            this._insertBehavior = value;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(Selection.prototype, "removeBehavior", {
	        /**
	         * Get the selection behavior when removing a tab.
	         */
	        get: function () {
	            return this._removeBehavior;
	        },
	        /**
	         * Set the selection behavior when removing a tab.
	         */
	        set: function (value) {
	            this._removeBehavior = value;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Adjust the current index for a tab insert operation.
	     *
	     * @param i - The new index of the inserted item.
	     * @param j - The inserted item.
	     *
	     * #### Notes
	     * This method accounts for the tab bar's insertion behavior when adjusting
	     * the current index and emitting the changed signal. This should be called
	     * after the insertion.
	     */
	    Selection.prototype.adjustSelectionForInsert = function (i, item) {
	        // Lookup commonly used variables.
	        var cv = this._value;
	        var ci = this._index;
	        var bh = this._insertBehavior;
	        // Handle the behavior where the new item is always selected,
	        // or the behavior where the new item is selected if needed.
	        if (bh === 'select-item' || (bh === 'select-item-if-needed' && ci === -1)) {
	            this._index = i;
	            this._value = item;
	            this._previousValue = cv;
	            this.selectionChanged.emit({
	                previousIndex: ci, previousValue: cv,
	                currentIndex: i, currentValue: item
	            });
	            return;
	        }
	        // Otherwise, silently adjust the current index if needed.
	        if (ci >= i) {
	            this._index++;
	        }
	    };
	    /**
	     * Adjust the current index for move operation.
	     *
	     * @param i - The previous index of the item.
	     * @param j - The new index of the item.
	     *
	     * #### Notes
	     * This method will not cause the actual current item to change. It silently
	     * adjusts the current index to account for the given move.
	     */
	    Selection.prototype.adjustSelectionForMove = function (i, j) {
	        if (this._index === i) {
	            this._index = j;
	        }
	        else if (this._index < i && this._index >= j) {
	            this._index++;
	        }
	        else if (this._index > i && this._index <= j) {
	            this._index--;
	        }
	    };
	    /**
	     * Clear the selection and history.
	     */
	    Selection.prototype.clearSelection = function () {
	        // Get the current index and item.
	        var pi = this._index;
	        var pv = this._value;
	        // Reset the current index and previous item.
	        this._index = -1;
	        this._value = null;
	        this._previousValue = null;
	        // If no item was selected, there's nothing else to do.
	        if (pi === -1) {
	            return;
	        }
	        // Emit the current changed signal.
	        this.selectionChanged.emit({
	            previousIndex: pi, previousValue: pv,
	            currentIndex: -1, currentValue: null
	        });
	    };
	    /**
	     * Adjust the current index for an item remove operation.
	     *
	     * @param i - The former index of the removed item.
	     * @param item - The removed item.
	     *
	     * #### Notes
	     * This method accounts for the remove behavior when adjusting the current
	     * index and emitting the changed signal. It should be called after the item
	     * is removed.
	     */
	    Selection.prototype.adjustSelectionForRemove = function (i, item) {
	        // Lookup commonly used variables.
	        var ci = this._index;
	        var bh = this._removeBehavior;
	        // Silently adjust the index if the current item is not removed.
	        if (ci !== i) {
	            if (ci > i) {
	                this._index--;
	            }
	            return;
	        }
	        // No item gets selected if the vector is empty.
	        if (this._sequence.length === 0) {
	            // Reset the current index and previous item.
	            this._index = -1;
	            this._value = null;
	            this._previousValue = null;
	            this.selectionChanged.emit({
	                previousIndex: i, previousValue: item,
	                currentIndex: -1, currentValue: null
	            });
	            return;
	        }
	        // Handle behavior where the next sibling item is selected.
	        if (bh === 'select-item-after') {
	            this._index = Math.min(i, this._sequence.length - 1);
	            this._updateSelectedValue();
	            this._previousValue = null;
	            this.selectionChanged.emit({
	                previousIndex: i, previousValue: item,
	                currentIndex: this._index, currentValue: this._value
	            });
	            return;
	        }
	        // Handle behavior where the previous sibling item is selected.
	        if (bh === 'select-item-before') {
	            this._index = Math.max(0, i - 1);
	            this._updateSelectedValue();
	            this._previousValue = null;
	            this.selectionChanged.emit({
	                previousIndex: i, previousValue: item,
	                currentIndex: this._index, currentValue: this._value
	            });
	            return;
	        }
	        // Handle behavior where the previous history item is selected.
	        if (bh === 'select-previous-item') {
	            if (this._previousValue) {
	                this.value = this._previousValue;
	            }
	            else {
	                this._index = Math.min(i, this._sequence.length - 1);
	                this._updateSelectedValue();
	            }
	            this._previousValue = null;
	            this.selectionChanged.emit({
	                previousIndex: i, previousValue: item,
	                currentIndex: this._index, currentValue: this.value
	            });
	            return;
	        }
	        // Otherwise, no item gets selected.
	        this._index = -1;
	        this._value = null;
	        this._previousValue = null;
	        this.selectionChanged.emit({
	            previousIndex: i, previousValue: item,
	            currentIndex: -1, currentValue: null
	        });
	    };
	    /**
	     * Set the current value based on the current index.
	     */
	    Selection.prototype._updateSelectedValue = function () {
	        var i = this._index;
	        this._value = i !== -1 ? this._sequence.at(i) : null;
	    };
	    return Selection;
	}());
	exports.Selection = Selection;
	// Define the signals for the `TabBar` class.
	signaling_1.defineSignal(Selection.prototype, 'selectionChanged');
	
})
/** END DEFINE BLOCK for jupyter-js-widgets@2.1.4/lib/phosphor/currentselection.js **/


/** START DEFINE BLOCK for ngl@0.10.0-dev.9/dist/ngl.js **/
jupyter.define('ngl@0.10.0-dev.9/dist/ngl.js', function (module, exports, __jupyter_require__) {
	/* WEBPACK VAR INJECTION */(function(setImmediate) {!function(t,e){ true?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.NGL=t.NGL||{})}(this,function(t){"use strict";function e(){}function i(t,e){return function(){t.apply(e,arguments)}}function r(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],u(t,this)}function n(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void Ac(function(){var i=1===t._state?e.onFulfilled:e.onRejected;if(null===i)return void(1===t._state?o:a)(e.promise,t._value);var r;try{r=i(t._value)}catch(t){return void a(e.promise,t)}o(e.promise,r)}))}function o(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof r)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void u(i(n,e),t)}t._state=1,t._value=e,s(t)}catch(e){a(t,e)}}function a(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&Ac(function(){t._handled||Mc(t._value)});for(var e=0,i=t._deferreds.length;e<i;e++)n(t,t._deferreds[e]);t._deferreds=null}function c(t,e,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=i}function u(t,e){var i=!1;try{t(function(t){i||(i=!0,o(e,t))},function(t){i||(i=!0,a(e,t))})}catch(t){if(i)return;i=!0,a(e,t)}}function l(){}function h(t,e){this.x=t||0,this.y=e||0}function d(t,e,i,r,n,o,a,s,c,u){Object.defineProperty(this,"id",{value:f()}),this.uuid=Fl.generateUUID(),this.name="",this.sourceFile="",this.image=void 0!==t?t:d.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:d.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:Du,this.wrapT=void 0!==r?r:Du,this.magFilter=void 0!==n?n:zu,this.minFilter=void 0!==o?o:ju,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:il,this.type=void 0!==s?s:$u,this.offset=new h(0,0),this.repeat=new h(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:Tl,this.version=0,this.onUpdate=null}function f(){return Bl++}function p(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function m(t,e,i,r){this._x=t||0,this._y=e||0,this._z=i||0,this._w=void 0!==r?r:1}function g(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0}function v(t,e){function i(){var t=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),e=new Uint16Array([0,1,2,0,2,3]);o=h.createBuffer(),a=h.createBuffer(),h.bindBuffer(h.ARRAY_BUFFER,o),h.bufferData(h.ARRAY_BUFFER,t,h.STATIC_DRAW),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,a),h.bufferData(h.ELEMENT_ARRAY_BUFFER,e,h.STATIC_DRAW),s=r(),c={position:h.getAttribLocation(s,"position"),uv:h.getAttribLocation(s,"uv")},u={uvOffset:h.getUniformLocation(s,"uvOffset"),uvScale:h.getUniformLocation(s,"uvScale"),rotation:h.getUniformLocation(s,"rotation"),scale:h.getUniformLocation(s,"scale"),color:h.getUniformLocation(s,"color"),map:h.getUniformLocation(s,"map"),opacity:h.getUniformLocation(s,"opacity"),modelViewMatrix:h.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:h.getUniformLocation(s,"projectionMatrix"),fogType:h.getUniformLocation(s,"fogType"),fogDensity:h.getUniformLocation(s,"fogDensity"),fogNear:h.getUniformLocation(s,"fogNear"),fogFar:h.getUniformLocation(s,"fogFar"),fogColor:h.getUniformLocation(s,"fogColor"),alphaTest:h.getUniformLocation(s,"alphaTest")};var i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");i.width=8,i.height=8;var n=i.getContext("2d");n.fillStyle="white",n.fillRect(0,0,8,8),l=new d(i),l.needsUpdate=!0}function r(){var e=h.createProgram(),i=h.createShader(h.VERTEX_SHADER),r=h.createShader(h.FRAGMENT_SHADER);return h.shaderSource(i,["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")),h.shaderSource(r,["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;","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")),h.compileShader(i),h.compileShader(r),h.attachShader(e,i),h.attachShader(e,r),h.linkProgram(e),e}function n(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}var o,a,s,c,u,l,h=t.context,f=t.state,p=new g,v=new m,y=new g;this.render=function(r,d){if(0!==e.length){void 0===s&&i(),h.useProgram(s),f.initAttributes(),f.enableAttribute(c.position),f.enableAttribute(c.uv),f.disableUnusedAttributes(),f.disable(h.CULL_FACE),f.enable(h.BLEND),h.bindBuffer(h.ARRAY_BUFFER,o),h.vertexAttribPointer(c.position,2,h.FLOAT,!1,16,0),h.vertexAttribPointer(c.uv,2,h.FLOAT,!1,16,8),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,a),h.uniformMatrix4fv(u.projectionMatrix,!1,d.projectionMatrix.elements),f.activeTexture(h.TEXTURE0),h.uniform1i(u.map,0);var m=0,g=0,b=r.fog;b?(h.uniform3f(u.fogColor,b.color.r,b.color.g,b.color.b),b&&b.isFog?(h.uniform1f(u.fogNear,b.near),h.uniform1f(u.fogFar,b.far),h.uniform1i(u.fogType,1),m=1,g=1):b&&b.isFogExp2&&(h.uniform1f(u.fogDensity,b.density),h.uniform1i(u.fogType,2),m=2,g=2)):(h.uniform1i(u.fogType,0),m=0,g=0);for(var x=0,_=e.length;x<_;x++){var w=e[x];w.modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,w.matrixWorld),w.z=-w.modelViewMatrix.elements[14]}e.sort(n);for(var S=[],x=0,_=e.length;x<_;x++){var w=e[x],A=w.material;if(A.visible!==!1){h.uniform1f(u.alphaTest,A.alphaTest),h.uniformMatrix4fv(u.modelViewMatrix,!1,w.modelViewMatrix.elements),w.matrixWorld.decompose(p,v,y),S[0]=y.x,S[1]=y.y;var M=0;r.fog&&A.fog&&(M=g),m!==M&&(h.uniform1i(u.fogType,M),m=M),null!==A.map?(h.uniform2f(u.uvOffset,A.map.offset.x,A.map.offset.y),h.uniform2f(u.uvScale,A.map.repeat.x,A.map.repeat.y)):(h.uniform2f(u.uvOffset,0,0),h.uniform2f(u.uvScale,1,1)),h.uniform1f(u.opacity,A.opacity),h.uniform3f(u.color,A.color.r,A.color.g,A.color.b),h.uniform1f(u.rotation,A.rotation),h.uniform2fv(u.scale,S),f.setBlending(A.blending,A.blendEquation,A.blendSrc,A.blendDst),f.setDepthTest(A.depthTest),f.setDepthWrite(A.depthWrite),A.map?t.setTexture2D(A.map,0):t.setTexture2D(l,0),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0)}}f.enable(h.CULL_FACE),t.resetGLState()}}}function y(t,e){this.min=void 0!==t?t:new h(+(1/0),+(1/0)),this.max=void 0!==e?e:new h(-(1/0),-(1/0))}function b(t,e){function i(){var t=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),e=new Uint16Array([0,1,2,0,2,3]);n=f.createBuffer(),o=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,n),f.bufferData(f.ARRAY_BUFFER,t,f.STATIC_DRAW),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,o),f.bufferData(f.ELEMENT_ARRAY_BUFFER,e,f.STATIC_DRAW),l=f.createTexture(),d=f.createTexture(),p.bindTexture(f.TEXTURE_2D,l),f.texImage2D(f.TEXTURE_2D,0,f.RGB,16,16,0,f.RGB,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),p.bindTexture(f.TEXTURE_2D,d),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,16,16,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),a={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")},s=r(a),c={vertex:f.getAttribLocation(s,"position"),uv:f.getAttribLocation(s,"uv")},u={renderType:f.getUniformLocation(s,"renderType"),map:f.getUniformLocation(s,"map"),occlusionMap:f.getUniformLocation(s,"occlusionMap"),opacity:f.getUniformLocation(s,"opacity"),color:f.getUniformLocation(s,"color"),scale:f.getUniformLocation(s,"scale"),rotation:f.getUniformLocation(s,"rotation"),screenPosition:f.getUniformLocation(s,"screenPosition")}}function r(e){var i=f.createProgram(),r=f.createShader(f.FRAGMENT_SHADER),n=f.createShader(f.VERTEX_SHADER),o="precision "+t.getPrecision()+" float;\n";return f.shaderSource(r,o+e.fragmentShader),f.shaderSource(n,o+e.vertexShader),f.compileShader(r),f.compileShader(n),f.attachShader(i,r),f.attachShader(i,n),f.linkProgram(i),i}var n,o,a,s,c,u,l,d,f=t.context,p=t.state;this.render=function(r,a,m){if(0!==e.length){var v=new g,b=m.w/m.z,x=.5*m.z,_=.5*m.w,w=16/m.w,S=new h(w*b,w),A=new g(1,1,0),M=new h(1,1),P=new y;P.min.set(0,0),P.max.set(m.z-16,m.w-16),void 0===s&&i(),f.useProgram(s),p.initAttributes(),p.enableAttribute(c.vertex),p.enableAttribute(c.uv),p.disableUnusedAttributes(),f.uniform1i(u.occlusionMap,0),f.uniform1i(u.map,1),f.bindBuffer(f.ARRAY_BUFFER,n),f.vertexAttribPointer(c.vertex,2,f.FLOAT,!1,16,0),f.vertexAttribPointer(c.uv,2,f.FLOAT,!1,16,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,o),p.disable(f.CULL_FACE),p.setDepthWrite(!1);for(var C=0,T=e.length;C<T;C++){w=16/m.w,S.set(w*b,w);var E=e[C];if(v.set(E.matrixWorld.elements[12],E.matrixWorld.elements[13],E.matrixWorld.elements[14]),v.applyMatrix4(a.matrixWorldInverse),v.applyProjection(a.projectionMatrix),A.copy(v),M.x=m.x+A.x*x+x-8,M.y=m.y+A.y*_+_-8,P.containsPoint(M)===!0){p.activeTexture(f.TEXTURE0),p.bindTexture(f.TEXTURE_2D,null),p.activeTexture(f.TEXTURE1),p.bindTexture(f.TEXTURE_2D,l),f.copyTexImage2D(f.TEXTURE_2D,0,f.RGB,M.x,M.y,16,16,0),f.uniform1i(u.renderType,0),f.uniform2f(u.scale,S.x,S.y),f.uniform3f(u.screenPosition,A.x,A.y,A.z),p.disable(f.BLEND),p.enable(f.DEPTH_TEST),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),p.activeTexture(f.TEXTURE0),p.bindTexture(f.TEXTURE_2D,d),f.copyTexImage2D(f.TEXTURE_2D,0,f.RGBA,M.x,M.y,16,16,0),f.uniform1i(u.renderType,1),p.disable(f.DEPTH_TEST),p.activeTexture(f.TEXTURE1),p.bindTexture(f.TEXTURE_2D,l),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),E.positionScreen.copy(A),E.customUpdateCallback?E.customUpdateCallback(E):E.updateLensFlares(),f.uniform1i(u.renderType,2),p.enable(f.BLEND);for(var I=0,L=E.lensFlares.length;I<L;I++){var R=E.lensFlares[I];R.opacity>.001&&R.scale>.001&&(A.x=R.x,A.y=R.y,A.z=R.z,w=R.size*R.scale/m.w,S.x=w*b,S.y=w,f.uniform3f(u.screenPosition,A.x,A.y,A.z),f.uniform2f(u.scale,S.x,S.y),f.uniform1f(u.rotation,R.rotation),f.uniform1f(u.opacity,R.opacity),f.uniform3f(u.color,R.color.r,R.color.g,R.color.b),p.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),t.setTexture2D(R.texture,1),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0))}}}p.enable(f.CULL_FACE),p.enable(f.DEPTH_TEST),p.setDepthWrite(!0),t.resetGLState()}}}function x(t,e,i,r,n,o,a,s,c,u){t=void 0!==t?t:[],e=void 0!==e?e:Pu,d.call(this,t,e,i,r,n,o,a,s,c,u),this.flipY=!1}function _(){this.seq=[],this.map={}}function w(t,e,i){var r=t[0];if(r<=0||r>0)return t;var n=e*i,o=jl[n];if(void 0===o&&(o=new Float32Array(n),jl[n]=o),0!==e){r.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=i,t[a].toArray(o,s)}return o}function S(t,e){var i=$l[e];void 0===i&&(i=new Int32Array(e),$l[e]=i);for(var r=0;r!==e;++r)i[r]=t.allocTextureUnit();return i}function A(t,e){t.uniform1f(this.addr,e)}function M(t,e){t.uniform1i(this.addr,e)}function P(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)}function C(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)}function T(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function E(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)}function I(t,e){t.uniformMatrix3fv(this.addr,!1,e.elements||e)}function L(t,e){t.uniformMatrix4fv(this.addr,!1,e.elements||e)}function R(t,e,i){var r=i.allocTextureUnit();t.uniform1i(this.addr,r),i.setTexture2D(e||zl,r)}function O(t,e,i){var r=i.allocTextureUnit();t.uniform1i(this.addr,r),i.setTextureCube(e||Ul,r)}function D(t,e){t.uniform2iv(this.addr,e)}function N(t,e){t.uniform3iv(this.addr,e)}function k(t,e){t.uniform4iv(this.addr,e)}function F(t){switch(t){case 5126:return A;case 35664:return P;case 35665:return C;case 35666:return T;case 35674:return E;case 35675:return I;case 35676:return L;case 35678:return R;case 35680:return O;case 5124:case 35670:return M;case 35667:case 35671:return D;case 35668:case 35672:return N;case 35669:case 35673:return k}}function B(t,e){t.uniform1fv(this.addr,e)}function z(t,e){t.uniform1iv(this.addr,e)}function U(t,e){t.uniform2fv(this.addr,w(e,this.size,2))}function j(t,e){t.uniform3fv(this.addr,w(e,this.size,3))}function $(t,e){t.uniform4fv(this.addr,w(e,this.size,4))}function V(t,e){t.uniformMatrix2fv(this.addr,!1,w(e,this.size,4))}function G(t,e){t.uniformMatrix3fv(this.addr,!1,w(e,this.size,9))}function H(t,e){t.uniformMatrix4fv(this.addr,!1,w(e,this.size,16))}function W(t,e,i){var r=e.length,n=S(i,r);t.uniform1iv(this.addr,n);for(var o=0;o!==r;++o)i.setTexture2D(e[o]||zl,n[o])}function X(t,e,i){var r=e.length,n=S(i,r);t.uniform1iv(this.addr,n);for(var o=0;o!==r;++o)i.setTextureCube(e[o]||Ul,n[o])}function q(t){switch(t){case 5126:return B;case 35664:return U;case 35665:return j;case 35666:return $;case 35674:return V;case 35675:return G;case 35676:return H;case 35678:return W;case 35680:return X;case 5124:case 35670:return z;case 35667:case 35671:return D;case 35668:case 35672:return N;case 35669:case 35673:return k}}function Y(t,e,i){this.id=t,this.addr=i,this.setValue=F(e.type)}function Z(t,e,i){this.id=t,this.addr=i,this.size=e.size,this.setValue=q(e.type)}function K(t){this.id=t,_.call(this)}function Q(t,e){t.seq.push(e),t.map[e.id]=e}function J(t,e,i){var r=t.name,n=r.length;for(Vl.lastIndex=0;;){var o=Vl.exec(r),a=Vl.lastIndex,s=o[1],c="]"===o[2],u=o[3];if(c&&(s=0|s),void 0===u||"["===u&&a+2===n){Q(i,void 0===u?new Y(s,t,e):new Z(s,t,e));break}var l=i.map,h=l[s];void 0===h&&(h=new K(s),Q(i,h)),i=h}}function tt(t,e,i){var r=this;_.call(this),this.renderer=i;for(var n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),o=0;o!==n;++o){var a=t.getActiveUniform(e,o),s=a.name,c=t.getUniformLocation(e,s);J(a,c,r)}}function et(t,e,i,r,n,o,a){function s(t,e){if(t.width>e||t.height>e){var i=e/Math.max(t.width,t.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=Math.floor(t.width*i),r.height=Math.floor(t.height*i);var n=r.getContext("2d");return n.drawImage(t,0,0,t.width,t.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+r.width+"x"+r.height,t),r}return t}function c(t){return Fl.isPowerOfTwo(t.width)&&Fl.isPowerOfTwo(t.height)}function u(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");e.width=Fl.nearestPowerOfTwo(t.width),e.height=Fl.nearestPowerOfTwo(t.height);var i=e.getContext("2d");return i.drawImage(t,0,0,e.width,e.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+e.width+"x"+e.height,t),e}return t}function l(t){return t.wrapS!==Du||t.wrapT!==Du||t.minFilter!==ku&&t.minFilter!==zu}function h(e){return e===ku||e===Fu||e===Bu?t.NEAREST:t.LINEAR}function d(t){var e=t.target;e.removeEventListener("dispose",d),p(e),C.textures--}function f(t){var e=t.target;e.removeEventListener("dispose",f),m(e),C.textures--}function p(e){var i=r.get(e);if(e.image&&i.__image__webglTextureCube)t.deleteTexture(i.__image__webglTextureCube);else{if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture)}r.delete(e)}function m(e){var i=r.get(e),n=r.get(e.texture);if(e){if(void 0!==n.__webglTexture&&t.deleteTexture(n.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e&&e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(i.__webglFramebuffer[o]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[o]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer);r.delete(e.texture),r.delete(e)}}function g(e,n){var o=r.get(e);if(e.version>0&&o.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e);else{if(a.complete!==!1)return void x(o,e,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e)}}i.activeTexture(t.TEXTURE0+n),i.bindTexture(t.TEXTURE_2D,o.__webglTexture)}function v(e,a){var u=r.get(e);if(6===e.image.length)if(e.version>0&&u.__version!==e.version){u.__image__webglTextureCube||(e.addEventListener("dispose",d),u.__image__webglTextureCube=t.createTexture(),C.textures++),i.activeTexture(t.TEXTURE0+a),i.bindTexture(t.TEXTURE_CUBE_MAP,u.__image__webglTextureCube),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var l=e&&e.isCompressedTexture,h=e.image[0]&&e.image[0].isDataTexture,f=[],p=0;p<6;p++)l||h?f[p]=h?e.image[p].image:e.image[p]:f[p]=s(e.image[p],n.maxCubemapSize);var m=f[0],g=c(m),v=o(e.format),y=o(e.type);b(t.TEXTURE_CUBE_MAP,e,g);for(var p=0;p<6;p++)if(l)for(var x,_=f[p].mipmaps,w=0,S=_.length;w<S;w++)x=_[w],e.format!==il&&e.format!==el?i.getCompressedTextureFormats().indexOf(v)>-1?i.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+p,w,v,x.width,x.height,0,x.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+p,w,v,x.width,x.height,0,v,y,x.data);else h?i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,v,f[p].width,f[p].height,0,v,y,f[p].data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,v,v,y,f[p]);e.generateMipmaps&&g&&t.generateMipmap(t.TEXTURE_CUBE_MAP),u.__version=e.version,e.onUpdate&&e.onUpdate(e)}else i.activeTexture(t.TEXTURE0+a),i.bindTexture(t.TEXTURE_CUBE_MAP,u.__image__webglTextureCube)}function y(e,n){i.activeTexture(t.TEXTURE0+n),i.bindTexture(t.TEXTURE_CUBE_MAP,r.get(e).__webglTexture)}function b(i,a,s){var c;if(s?(t.texParameteri(i,t.TEXTURE_WRAP_S,o(a.wrapS)),t.texParameteri(i,t.TEXTURE_WRAP_T,o(a.wrapT)),t.texParameteri(i,t.TEXTURE_MAG_FILTER,o(a.magFilter)),t.texParameteri(i,t.TEXTURE_MIN_FILTER,o(a.minFilter))):(t.texParameteri(i,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(i,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),a.wrapS===Du&&a.wrapT===Du||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",a),t.texParameteri(i,t.TEXTURE_MAG_FILTER,h(a.magFilter)),t.texParameteri(i,t.TEXTURE_MIN_FILTER,h(a.minFilter)),a.minFilter!==ku&&a.minFilter!==zu&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",a)),c=e.get("EXT_texture_filter_anisotropic")){if(a.type===qu&&null===e.get("OES_texture_float_linear"))return;if(a.type===Yu&&null===e.get("OES_texture_half_float_linear"))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(t.texParameterf(i,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,n.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function x(e,r,a){void 0===e.__webglInit&&(e.__webglInit=!0,r.addEventListener("dispose",d),e.__webglTexture=t.createTexture(),C.textures++),i.activeTexture(t.TEXTURE0+a),i.bindTexture(t.TEXTURE_2D,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,r.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,r.unpackAlignment);var h=s(r.image,n.maxTextureSize);l(r)&&c(h)===!1&&(h=u(h));var f=c(h),p=o(r.format),m=o(r.type);b(t.TEXTURE_2D,r,f);var g,v=r.mipmaps;if(r&&r.isDepthTexture){var y=t.DEPTH_COMPONENT;if(r.type===qu){if(!T)throw new Error("Float Depth Texture only supported in WebGL2.0");y=t.DEPTH_COMPONENT32F}else T&&(y=t.DEPTH_COMPONENT16);r.format===al&&(y=t.DEPTH_STENCIL),i.texImage2D(t.TEXTURE_2D,0,y,h.width,h.height,0,p,m,null)}else if(r&&r.isDataTexture)if(v.length>0&&f){for(var x=0,_=v.length;x<_;x++)g=v[x],i.texImage2D(t.TEXTURE_2D,x,p,g.width,g.height,0,p,m,g.data);r.generateMipmaps=!1}else i.texImage2D(t.TEXTURE_2D,0,p,h.width,h.height,0,p,m,h.data);else if(r&&r.isCompressedTexture)for(var x=0,_=v.length;x<_;x++)g=v[x],r.format!==il&&r.format!==el?i.getCompressedTextureFormats().indexOf(p)>-1?i.compressedTexImage2D(t.TEXTURE_2D,x,p,g.width,g.height,0,g.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(t.TEXTURE_2D,x,p,g.width,g.height,0,p,m,g.data);else if(v.length>0&&f){for(var x=0,_=v.length;x<_;x++)g=v[x],i.texImage2D(t.TEXTURE_2D,x,p,p,m,g);r.generateMipmaps=!1}else i.texImage2D(t.TEXTURE_2D,0,p,p,m,h);r.generateMipmaps&&f&&t.generateMipmap(t.TEXTURE_2D),e.__version=r.version,r.onUpdate&&r.onUpdate(r)}function _(e,n,a,s){var c=o(n.texture.format),u=o(n.texture.type);i.texImage2D(s,0,c,n.width,n.height,0,c,u,null),t.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,a,s,r.get(n.texture).__webglTexture,0),t.bindFramebuffer(t.FRAMEBUFFER,null)}function w(e,i){t.bindRenderbuffer(t.RENDERBUFFER,e),i.depthBuffer&&!i.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,i.width,i.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)):i.depthBuffer&&i.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,i.width,i.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)):t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,i.width,i.height),t.bindRenderbuffer(t.RENDERBUFFER,null)}function S(e,i){var n=i&&i.isWebGLRenderTargetCube;if(n)throw new Error("Depth Texture with cube render targets is not supported!");if(t.bindFramebuffer(t.FRAMEBUFFER,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),g(i.depthTexture,0);var o=r.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===ol)t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,o,0);else{if(i.depthTexture.format!==al)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,o,0)}}function A(e){var i=r.get(e),n=e&&e.isWebGLRenderTargetCube;if(e.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");S(i.__webglFramebuffer,e)}else if(n){i.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer[o]),i.__webglDepthbuffer[o]=t.createRenderbuffer(),w(i.__webglDepthbuffer[o],e)}else t.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),w(i.__webglDepthbuffer,e);t.bindFramebuffer(t.FRAMEBUFFER,null)}function M(e){var n=r.get(e),o=r.get(e.texture);e.addEventListener("dispose",f),o.__webglTexture=t.createTexture(),C.textures++;var a=e&&e.isWebGLRenderTargetCube,s=c(e);if(a){n.__webglFramebuffer=[];for(var u=0;u<6;u++)n.__webglFramebuffer[u]=t.createFramebuffer()}else n.__webglFramebuffer=t.createFramebuffer();if(a){i.bindTexture(t.TEXTURE_CUBE_MAP,o.__webglTexture),b(t.TEXTURE_CUBE_MAP,e.texture,s);for(var u=0;u<6;u++)_(n.__webglFramebuffer[u],e,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+u);e.texture.generateMipmaps&&s&&t.generateMipmap(t.TEXTURE_CUBE_MAP),i.bindTexture(t.TEXTURE_CUBE_MAP,null)}else i.bindTexture(t.TEXTURE_2D,o.__webglTexture),b(t.TEXTURE_2D,e.texture,s),_(n.__webglFramebuffer,e,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),e.texture.generateMipmaps&&s&&t.generateMipmap(t.TEXTURE_2D),i.bindTexture(t.TEXTURE_2D,null);e.depthBuffer&&A(e)}function P(e){var n=e.texture;if(n.generateMipmaps&&c(e)&&n.minFilter!==ku&&n.minFilter!==zu){var o=e&&e.isWebGLRenderTargetCube?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=r.get(n).__webglTexture;i.bindTexture(o,a),t.generateMipmap(o),i.bindTexture(o,null)}}var C=a.memory,T="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext;this.setTexture2D=g,this.setTextureCube=v,this.setTextureCubeDynamic=y,this.setupRenderTarget=M,this.updateRenderTargetMipmap=P}function it(t,e,i,r){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==r?r:1}function rt(t,e,i){function r(){var e=!1,i=new it,r=null,n=new it;return{setMask:function(i){r===i||e||(t.colorMask(i,i,i,i),r=i)},setLocked:function(t){e=t},setClear:function(e,r,o,a){i.set(e,r,o,a),n.equals(i)===!1&&(t.clearColor(e,r,o,a),n.copy(i))},reset:function(){e=!1,r=null,n.set(0,0,0,1)}}}function n(){var e=!1,i=null,r=null,n=null;return{setTest:function(e){e?d(t.DEPTH_TEST):f(t.DEPTH_TEST)},setMask:function(r){i===r||e||(t.depthMask(r),i=r)},setFunc:function(e){if(r!==e){if(e)switch(e){case uu:t.depthFunc(t.NEVER);break;case lu:t.depthFunc(t.ALWAYS);break;case hu:t.depthFunc(t.LESS);break;case du:t.depthFunc(t.LEQUAL);break;case fu:t.depthFunc(t.EQUAL);break;case pu:t.depthFunc(t.GEQUAL);break;case mu:t.depthFunc(t.GREATER);break;case gu:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);r=e}},setLocked:function(t){e=t},setClear:function(e){n!==e&&(t.clearDepth(e),n=e)},reset:function(){e=!1,i=null,r=null,n=null}}}function o(){var e=!1,i=null,r=null,n=null,o=null,a=null,s=null,c=null,u=null;return{setTest:function(e){e?d(t.STENCIL_TEST):f(t.STENCIL_TEST)},setMask:function(r){i===r||e||(t.stencilMask(r),i=r)},setFunc:function(e,i,a){r===e&&n===i&&o===a||(t.stencilFunc(e,i,a),r=e,n=i,o=a)},setOp:function(e,i,r){a===e&&s===i&&c===r||(t.stencilOp(e,i,r),a=e,s=i,c=r)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,i=null,r=null,n=null,o=null,a=null,s=null,c=null,u=null}}}function a(e,i,r){var n=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(var a=0;a<r;a++)t.texImage2D(i+a,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,n);return o}function s(){D(0,0,0,1),N(1),k(0),d(t.DEPTH_TEST),b(du),A(!1),M(Tc),d(t.CULL_FACE),d(t.BLEND),m($c)}function c(){for(var t=0,e=G.length;t<e;t++)G[t]=0}function u(i){if(G[i]=1,0===H[i]&&(t.enableVertexAttribArray(i),H[i]=1),0!==W[i]){var r=e.get("ANGLE_instanced_arrays");r.vertexAttribDivisorANGLE(i,0),W[i]=0}}function l(e,i,r){G[e]=1,0===H[e]&&(t.enableVertexAttribArray(e),H[e]=1),W[e]!==i&&(r.vertexAttribDivisorANGLE(e,i),W[e]=i)}function h(){for(var e=0,i=H.length;e!==i;++e)H[e]!==G[e]&&(t.disableVertexAttribArray(e),H[e]=0)}function d(e){X[e]!==!0&&(t.enable(e),X[e]=!0)}function f(e){X[e]!==!1&&(t.disable(e),X[e]=!1)}function p(){if(null===q&&(q=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var i=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),r=0;r<i.length;r++)q.push(i[r]);return q}function m(e,r,n,o,a,s,c,u){return e===jc?(f(t.BLEND),void(Y=e)):(d(t.BLEND),e===Y&&u===rt||(e===Vc?u?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)):e===Gc?u?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR)):e===Hc?u?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR)):u?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)),Y=e,rt=u),void(e===Wc?(a=a||r,s=s||n,c=c||o,r===Z&&a===J||(t.blendEquationSeparate(i(r),i(a)),Z=r,J=a),n===K&&o===Q&&s===tt&&c===et||(t.blendFuncSeparate(i(n),i(o),i(s),i(c)),K=n,Q=o,tt=s,et=c)):(Z=null,K=null,Q=null,J=null,tt=null,et=null)))}function g(t){U.setMask(t)}function v(t){j.setTest(t)}function y(t){j.setMask(t)}function b(t){j.setFunc(t)}function x(t){$.setTest(t)}function _(t){$.setMask(t)}function w(t,e,i){$.setFunc(t,e,i)}function S(t,e,i){$.setOp(t,e,i)}function A(e){nt!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),nt=e)}function M(e){e!==Cc?(d(t.CULL_FACE),e!==ot&&(e===Tc?t.cullFace(t.BACK):e===Ec?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):f(t.CULL_FACE),ot=e}function P(e){e!==at&&(t.lineWidth(e),at=e)}function C(e,i,r){e?(d(t.POLYGON_OFFSET_FILL),st===i&&ct===r||(t.polygonOffset(i,r),st=i,ct=r)):f(t.POLYGON_OFFSET_FILL)}function T(){return ut}
	function E(e){ut=e,e?d(t.SCISSOR_TEST):f(t.SCISSOR_TEST)}function I(e){void 0===e&&(e=t.TEXTURE0+lt-1),ht!==e&&(t.activeTexture(e),ht=e)}function L(e,i){null===ht&&I();var r=dt[ht];void 0===r&&(r={type:void 0,texture:void 0},dt[ht]=r),r.type===e&&r.texture===i||(t.bindTexture(e,i||mt[e]),r.type=e,r.texture=i)}function R(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error(t)}}function O(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error(t)}}function D(t,e,i,r){U.setClear(t,e,i,r)}function N(t){j.setClear(t)}function k(t){$.setClear(t)}function F(e){ft.equals(e)===!1&&(t.scissor(e.x,e.y,e.z,e.w),ft.copy(e))}function B(e){pt.equals(e)===!1&&(t.viewport(e.x,e.y,e.z,e.w),pt.copy(e))}function z(){for(var e=0;e<H.length;e++)1===H[e]&&(t.disableVertexAttribArray(e),H[e]=0);X={},q=null,ht=null,dt={},Y=null,nt=null,ot=null,U.reset(),j.reset(),$.reset()}var U=new r,j=new n,$=new o,V=t.getParameter(t.MAX_VERTEX_ATTRIBS),G=new Uint8Array(V),H=new Uint8Array(V),W=new Uint8Array(V),X={},q=null,Y=null,Z=null,K=null,Q=null,J=null,tt=null,et=null,rt=!1,nt=null,ot=null,at=null,st=null,ct=null,ut=null,lt=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),ht=null,dt={},ft=new it,pt=new it,mt={};return mt[t.TEXTURE_2D]=a(t.TEXTURE_2D,t.TEXTURE_2D,1),mt[t.TEXTURE_CUBE_MAP]=a(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),{buffers:{color:U,depth:j,stencil:$},init:s,initAttributes:c,enableAttribute:u,enableAttributeAndDivisor:l,disableUnusedAttributes:h,enable:d,disable:f,getCompressedTextureFormats:p,setBlending:m,setColorWrite:g,setDepthTest:v,setDepthWrite:y,setDepthFunc:b,setStencilTest:x,setStencilWrite:_,setStencilFunc:w,setStencilOp:S,setFlipSided:A,setCullFace:M,setLineWidth:P,setPolygonOffset:C,getScissorTest:T,setScissorTest:E,activeTexture:I,bindTexture:L,compressedTexImage2D:R,texImage2D:O,clearColor:D,clearDepth:N,clearStencil:k,scissor:F,viewport:B,reset:z}}function nt(t,e,i){this.uuid=Fl.generateUUID(),this.width=t,this.height=e,this.scissor=new it(0,0,t,e),this.scissorTest=!1,this.viewport=new it(0,0,t,e),i=i||{},void 0===i.minFilter&&(i.minFilter=zu),this.texture=new d(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function ot(){Object.defineProperty(this,"id",{value:at()}),this.uuid=Fl.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=$c,this.side=Oc,this.shading=Fc,this.vertexColors=Bc,this.opacity=1,this.transparent=!1,this.blendSrc=iu,this.blendDst=ru,this.blendEquation=Xc,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=du,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0}function at(){return Gl++}function st(t){ot.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function ct(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}function ut(t){ot.call(this),this.type="MeshDepthMaterial",this.depthPacking=Nl,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function lt(t,e){this.min=void 0!==t?t:new g(+(1/0),+(1/0),+(1/0)),this.max=void 0!==e?e:new g(-(1/0),-(1/0),-(1/0))}function ht(t,e){this.center=void 0!==t?t:new g,this.radius=void 0!==e?e:0}function dt(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function ft(t,e){this.normal=void 0!==t?t:new g(1,0,0),this.constant=void 0!==e?e:0}function pt(t,e,i,r,n,o){this.planes=[void 0!==t?t:new ft,void 0!==e?e:new ft,void 0!==i?i:new ft,void 0!==r?r:new ft,void 0!==n?n:new ft,void 0!==o?o:new ft]}function mt(t,e,i,r){function n(e,i,r,n){var o=e.geometry,a=null,s=w,c=e.customDepthMaterial;if(r&&(s=S,c=e.customDistanceMaterial),c)a=c;else{var u=!1;i.morphTargets&&(o&&o.isBufferGeometry?u=o.morphAttributes&&o.morphAttributes.position&&o.morphAttributes.position.length>0:o&&o.isGeometry&&(u=o.morphTargets&&o.morphTargets.length>0));var l=e.isSkinnedMesh&&i.skinning,h=0;u&&(h|=b),l&&(h|=x),a=s[h]}if(t.localClippingEnabled&&i.clipShadows===!0&&0!==i.clippingPlanes.length){var d=a.uuid,f=i.uuid,p=A[d];void 0===p&&(p={},A[d]=p);var m=p[f];void 0===m&&(m=a.clone(),p[f]=m),a=m}a.visible=i.visible,a.wireframe=i.wireframe;var g=i.side;return k.renderSingleSided&&g==Nc&&(g=Oc),k.renderReverseSided&&(g===Oc?g=Dc:g===Dc&&(g=Oc)),a.side=g,a.clipShadows=i.clipShadows,a.clippingPlanes=i.clippingPlanes,a.wireframeLinewidth=i.wireframeLinewidth,a.linewidth=i.linewidth,r&&void 0!==a.uniforms.lightPos&&a.uniforms.lightPos.value.copy(n),a}function o(t,e,i){if(t.visible!==!1){var r=0!==(t.layers.mask&e.layers.mask);if(r&&(t.isMesh||t.isLine||t.isPoints)&&t.castShadow&&(t.frustumCulled===!1||c.intersectsObject(t)===!0)){var n=t.material;n.visible===!0&&(t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),y.push(t))}for(var a=t.children,s=0,u=a.length;s<u;s++)o(a[s],e,i)}}var a=t.context,s=t.state,c=new pt,u=new p,l=e.shadows,d=new h,f=new h(r.maxTextureSize,r.maxTextureSize),m=new g,v=new g,y=[],b=1,x=2,_=(b|x)+1,w=new Array(_),S=new Array(_),A={},M=[new g(1,0,0),new g(-1,0,0),new g(0,0,1),new g(0,0,-1),new g(0,1,0),new g(0,-1,0)],P=[new g(0,1,0),new g(0,1,0),new g(0,1,0),new g(0,1,0),new g(0,0,1),new g(0,0,-1)],C=[new it,new it,new it,new it,new it,new it],T=new ut;T.depthPacking=kl,T.clipping=!0;for(var E=Wd.distanceRGBA,I=Hl.clone(E.uniforms),L=0;L!==_;++L){var R=0!==(L&b),O=0!==(L&x),D=T.clone();D.morphTargets=R,D.skinning=O,w[L]=D;var N=new st({defines:{USE_SHADOWMAP:""},uniforms:I,vertexShader:E.vertexShader,fragmentShader:E.fragmentShader,morphTargets:R,skinning:O,clipping:!0});S[L]=N}var k=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Lc,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(e,r){if(k.enabled!==!1&&(k.autoUpdate!==!1||k.needsUpdate!==!1)&&0!==l.length){s.clearColor(1,1,1,1),s.disable(a.BLEND),s.setDepthTest(!0),s.setScissorTest(!1);for(var h,p,g=0,b=l.length;g<b;g++){var x=l[g],_=x.shadow;if(void 0!==_){var w=_.camera;if(d.copy(_.mapSize),d.min(f),x&&x.isPointLight){h=6,p=!0;var S=d.x,A=d.y;C[0].set(2*S,A,S,A),C[1].set(0,A,S,A),C[2].set(3*S,A,S,A),C[3].set(S,A,S,A),C[4].set(3*S,0,S,A),C[5].set(S,0,S,A),d.x*=4,d.y*=2}else h=1,p=!1;if(null===_.map){var T={minFilter:ku,magFilter:ku,format:il};_.map=new nt(d.x,d.y,T),w.updateProjectionMatrix()}_&&_.isSpotLightShadow&&_.update(x);var E=_.map,I=_.matrix;v.setFromMatrixPosition(x.matrixWorld),w.position.copy(v),t.setRenderTarget(E),t.clear();for(var L=0;L<h;L++){if(p){m.copy(w.position),m.add(M[L]),w.up.copy(P[L]),w.lookAt(m);var R=C[L];s.viewport(R)}else m.setFromMatrixPosition(x.target.matrixWorld),w.lookAt(m);w.updateMatrixWorld(),w.matrixWorldInverse.getInverse(w.matrixWorld),I.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),I.multiply(w.projectionMatrix),I.multiply(w.matrixWorldInverse),u.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse),c.setFromMatrix(u),y.length=0,o(e,r,w);for(var O=0,D=y.length;O<D;O++){var N=y[O],F=i.update(N),B=N.material;if(B&&B.isMultiMaterial)for(var z=F.groups,U=B.materials,j=0,$=z.length;j<$;j++){var V=z[j],G=U[V.materialIndex];if(G.visible===!0){var H=n(N,G,p,v);t.renderBufferDirect(w,null,F,H,N,V)}}else{var H=n(N,B,p,v);t.renderBufferDirect(w,null,F,H,N,null)}}}}else console.warn("THREE.WebGLShadowMap:",x,"has no shadow.")}var W=t.getClearColor(),X=t.getClearAlpha();t.setClearColor(W,X),k.needsUpdate=!1}}}function gt(t){for(var e=t.split("\n"),i=0;i<e.length;i++)e[i]=i+1+": "+e[i];return e.join("\n")}function vt(t,e,i){var r=t.createShader(e);return t.shaderSource(r,i),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(r),gt(i)),r}function yt(){var t={};return{get:function(e){var i=e.uuid,r=t[i];return void 0===r&&(r={},t[i]=r),r},delete:function(e){delete t[e.uuid]},clear:function(){t={}}}}function bt(t){switch(t){case Tl:return["Linear","( value )"];case El:return["sRGB","( value )"];case Ll:return["RGBE","( value )"];case Rl:return["RGBM","( value, 7.0 )"];case Ol:return["RGBM","( value, 16.0 )"];case Dl:return["RGBD","( value, 256.0 )"];case Il:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function xt(t,e){var i=bt(e);return"vec4 "+t+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function _t(t,e){var i=bt(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function wt(t,e){var i;switch(e){case _u:i="Linear";break;case wu:i="Reinhard";break;case Su:i="Uncharted2";break;case Au:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function St(t,e,i){t=t||{};var r=[t.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return r.filter(Pt).join("\n")}function At(t){var e=[];for(var i in t){var r=t[i];r!==!1&&e.push("#define "+i+" "+r)}return e.join("\n")}function Mt(t,e,i){for(var r={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),o=0;o<n;o++){var a=t.getActiveAttrib(e,o),s=a.name;r[s]=t.getAttribLocation(e,s)}return r}function Pt(t){return""!==t}function Ct(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function Tt(t){function e(t,e){var i=Vd[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return Tt(i)}var i=/#include +<([\w\d.]+)>/g;return t.replace(i,e)}function Et(t){function e(t,e,i,r){for(var n="",o=parseInt(e);o<parseInt(i);o++)n+=r.replace(/\[ i \]/g,"[ "+o+" ]");return n}var i=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return t.replace(i,e)}function It(t,e,i,r){var n=t.context,o=i.extensions,a=i.defines,s=i.__webglShader.vertexShader,c=i.__webglShader.fragmentShader,u="SHADOWMAP_TYPE_BASIC";r.shadowMapType===Lc?u="SHADOWMAP_TYPE_PCF":r.shadowMapType===Rc&&(u="SHADOWMAP_TYPE_PCF_SOFT");var l="ENVMAP_TYPE_CUBE",h="ENVMAP_MODE_REFLECTION",d="ENVMAP_BLENDING_MULTIPLY";if(r.envMap){switch(i.envMap.mapping){case Pu:case Cu:l="ENVMAP_TYPE_CUBE";break;case Lu:case Ru:l="ENVMAP_TYPE_CUBE_UV";break;case Tu:case Eu:l="ENVMAP_TYPE_EQUIREC";break;case Iu:l="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case Cu:case Eu:h="ENVMAP_MODE_REFRACTION"}switch(i.combine){case vu:d="ENVMAP_BLENDING_MULTIPLY";break;case yu:d="ENVMAP_BLENDING_MIX";break;case bu:d="ENVMAP_BLENDING_ADD"}}var f,p,m=t.gammaFactor>0?t.gammaFactor:1,g=St(o,r,t.extensions),v=At(a),y=n.createProgram();i.isRawShaderMaterial?(f=[v,"\n"].filter(Pt).join("\n"),p=[g,v,"\n"].filter(Pt).join("\n")):(f=["precision "+r.precision+" float;","precision "+r.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,v,r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+r.maxBones,r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&r.flatShading===!1?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+r.numClippingPlanes,r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+u:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","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;","#ifdef USE_COLOR","   attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","   attribute vec3 morphTarget0;","   attribute vec3 morphTarget1;","   attribute vec3 morphTarget2;","   attribute vec3 morphTarget3;","   #ifdef USE_MORPHNORMALS","       attribute vec3 morphNormal0;","       attribute vec3 morphNormal1;","       attribute vec3 morphNormal2;","       attribute vec3 morphNormal3;","   #else","       attribute vec3 morphTarget4;","       attribute vec3 morphTarget5;","       attribute vec3 morphTarget6;","       attribute vec3 morphTarget7;","   #endif","#endif","#ifdef USE_SKINNING","   attribute vec4 skinIndex;","   attribute vec4 skinWeight;","#endif","\n"].filter(Pt).join("\n"),p=[g,"precision "+r.precision+" float;","precision "+r.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,v,r.alphaTest?"#define ALPHATEST "+r.alphaTest:"","#define GAMMA_FACTOR "+m,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+l:"",r.envMap?"#define "+h:"",r.envMap?"#define "+d:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+r.numClippingPlanes,r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+u:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",r.envMap&&t.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",r.toneMapping!==xu?"#define TONE_MAPPING":"",r.toneMapping!==xu?Vd.tonemapping_pars_fragment:"",r.toneMapping!==xu?wt("toneMapping",r.toneMapping):"",r.outputEncoding||r.mapEncoding||r.envMapEncoding||r.emissiveMapEncoding?Vd.encodings_pars_fragment:"",r.mapEncoding?xt("mapTexelToLinear",r.mapEncoding):"",r.envMapEncoding?xt("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMapEncoding?xt("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.outputEncoding?_t("linearToOutputTexel",r.outputEncoding):"",r.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Pt).join("\n")),s=Tt(s,r),s=Ct(s,r),c=Tt(c,r),c=Ct(c,r),i.isShaderMaterial||(s=Et(s),c=Et(c));var b=f+s,x=p+c,_=vt(n,n.VERTEX_SHADER,b),w=vt(n,n.FRAGMENT_SHADER,x);n.attachShader(y,_),n.attachShader(y,w),void 0!==i.index0AttributeName?n.bindAttribLocation(y,0,i.index0AttributeName):r.morphTargets===!0&&n.bindAttribLocation(y,0,"position"),n.linkProgram(y);var S=n.getProgramInfoLog(y),A=n.getShaderInfoLog(_),M=n.getShaderInfoLog(w),P=!0,C=!0;n.getProgramParameter(y,n.LINK_STATUS)===!1?(P=!1,console.error("THREE.WebGLProgram: shader error: ",n.getError(),"gl.VALIDATE_STATUS",n.getProgramParameter(y,n.VALIDATE_STATUS),"gl.getProgramInfoLog",S,A,M)):""!==S?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",S):""!==A&&""!==M||(C=!1),C&&(this.diagnostics={runnable:P,material:i,programLog:S,vertexShader:{log:A,prefix:f},fragmentShader:{log:M,prefix:p}}),n.deleteShader(_),n.deleteShader(w);var T;this.getUniforms=function(){return void 0===T&&(T=new tt(n,y,t)),T};var E;return this.getAttributes=function(){return void 0===E&&(E=Mt(n,y)),E},this.destroy=function(){n.deleteProgram(y),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=Xd++,this.code=e,this.usedTimes=1,this.program=y,this.vertexShader=_,this.fragmentShader=w,this}function Lt(t,e){function i(t){if(e.floatVertexTextures&&t&&t.skeleton&&t.skeleton.useVertexTexture)return 1024;var i=e.maxVertexUniforms,r=Math.floor((i-20)/4),n=r;return void 0!==t&&t&&t.isSkinnedMesh&&(n=Math.min(t.skeleton.bones.length,n),n<t.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+t.skeleton.bones.length+", this GPU supports just "+n+" (try OpenGL instead of ANGLE)")),n}function r(t,e){var i;return t?t&&t.isTexture?i=t.encoding:t&&t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=t.texture.encoding):i=Tl,i===Tl&&e&&(i=Il),i}var n=[],o={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},a=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","depthPacking"];this.getParameters=function(n,a,s,c,u){var l=o[n.type],h=i(u),d=t.getPrecision();null!==n.precision&&(d=e.getMaxPrecision(n.precision),d!==n.precision&&console.warn("THREE.WebGLProgram.getParameters:",n.precision,"not supported, using",d,"instead."));var f=t.getCurrentRenderTarget(),p={shaderID:l,precision:d,supportsVertexTextures:e.vertexTextures,outputEncoding:r(f?f.texture:null,t.gammaOutput),map:!!n.map,mapEncoding:r(n.map,t.gammaInput),envMap:!!n.envMap,envMapMode:n.envMap&&n.envMap.mapping,envMapEncoding:r(n.envMap,t.gammaInput),envMapCubeUV:!!n.envMap&&(n.envMap.mapping===Lu||n.envMap.mapping===Ru),lightMap:!!n.lightMap,aoMap:!!n.aoMap,emissiveMap:!!n.emissiveMap,emissiveMapEncoding:r(n.emissiveMap,t.gammaInput),bumpMap:!!n.bumpMap,normalMap:!!n.normalMap,displacementMap:!!n.displacementMap,roughnessMap:!!n.roughnessMap,metalnessMap:!!n.metalnessMap,specularMap:!!n.specularMap,alphaMap:!!n.alphaMap,combine:n.combine,vertexColors:n.vertexColors,fog:!!s,useFog:n.fog,fogExp:s&&s.isFogExp2,flatShading:n.shading===kc,sizeAttenuation:n.sizeAttenuation,logarithmicDepthBuffer:e.logarithmicDepthBuffer,skinning:n.skinning,maxBones:h,useVertexTexture:e.floatVertexTextures&&u&&u.skeleton&&u.skeleton.useVertexTexture,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numHemiLights:a.hemi.length,numClippingPlanes:c,shadowMapEnabled:t.shadowMap.enabled&&u.receiveShadow&&a.shadows.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:n.side===Nc,flipSided:n.side===Dc,depthPacking:void 0!==n.depthPacking&&n.depthPacking};return p},this.getProgramCode=function(t,e){var i=[];if(e.shaderID?i.push(e.shaderID):(i.push(t.fragmentShader),i.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)i.push(r),i.push(t.defines[r]);for(var n=0;n<a.length;n++)i.push(e[a[n]]);return i.join()},this.acquireProgram=function(e,i,r){for(var o,a=0,s=n.length;a<s;a++){var c=n[a];if(c.code===r){o=c,++o.usedTimes;break}}return void 0===o&&(o=new It(t,r,e,i),n.push(o)),o},this.releaseProgram=function(t){if(0===--t.usedTimes){var e=n.indexOf(t);n[e]=n[n.length-1],n.pop(),t.destroy()}},this.programs=n}function Rt(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=Fl.generateUUID(),this.array=t,this.itemSize=e,this.normalized=i===!0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Ot(t,e){return new Rt(new Float32Array(t),e)}function Dt(t,e,i,r,n,o){this.a=t,this.b=e,this.c=i,this.normal=r&&r.isVector3?r:new g,this.vertexNormals=Array.isArray(r)?r:[],this.color=n&&n.isColor?n:new ct,this.vertexColors=Array.isArray(n)?n:[],this.materialIndex=void 0!==o?o:0}function Nt(t,e,i,r){this._x=t||0,this._y=e||0,this._z=i||0,this._order=r||Nt.DefaultOrder}function kt(){this.mask=1}function Ft(){function t(){n.setFromEuler(r,!1)}function e(){r.setFromQuaternion(n,void 0,!1)}Object.defineProperty(this,"id",{value:Bt()}),this.uuid=Fl.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Ft.DefaultUp.clone();var i=new g,r=new Nt,n=new m,o=new g(1,1,1);r.onChange(t),n.onChange(e),Object.defineProperties(this,{position:{enumerable:!0,value:i},rotation:{enumerable:!0,value:r},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:o},modelViewMatrix:{value:new p},normalMatrix:{value:new dt}}),this.matrix=new p,this.matrixWorld=new p,this.matrixAutoUpdate=Ft.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new kt,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function Bt(){return qd++}function zt(){Object.defineProperty(this,"id",{value:Ut()}),this.uuid=Fl.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Ut(){return Yd++}function jt(){Object.defineProperty(this,"id",{value:Ut()}),this.uuid=Fl.generateUUID(),this.name="",this.type="DirectGeometry",this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function $t(){Object.defineProperty(this,"id",{value:Ut()}),this.uuid=Fl.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function Vt(t,e,i){function r(t){var n=t.target,s=c[n.id];null!==s.index&&o(s.index),a(s.attributes),n.removeEventListener("dispose",r),delete c[n.id];var u=e.get(n);u.wireframe&&o(u.wireframe),e.delete(n);var l=e.get(s);l.wireframe&&o(l.wireframe),e.delete(s),i.memory.geometries--}function n(t){return t.isInterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer}function o(e){var i=n(e);void 0!==i&&(t.deleteBuffer(i),s(e))}function a(t){for(var e in t)o(t[e])}function s(t){t.isInterleavedBufferAttribute?e.delete(t.data):e.delete(t)}var c={};return{get:function(t){var e=t.geometry;if(void 0!==c[e.id])return c[e.id];e.addEventListener("dispose",r);var n;return e.isBufferGeometry?n=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new $t).setFromObject(t)),n=e._bufferGeometry),c[e.id]=n,i.memory.geometries++,n}}}function Gt(t,e,i){function r(e){var i=l.get(e);e.geometry.isGeometry&&i.updateFromObject(e);var r=i.index,o=i.attributes;null!==r&&n(r,t.ELEMENT_ARRAY_BUFFER);for(var a in o)n(o[a],t.ARRAY_BUFFER);var s=i.morphAttributes;for(var a in s)for(var c=s[a],u=0,h=c.length;u<h;u++)n(c[u],t.ARRAY_BUFFER);return i}function n(t,i){var r=t.isInterleavedBufferAttribute?t.data:t,n=e.get(r);void 0===n.__webglBuffer?o(n,r,i):n.version!==r.version&&a(n,r,i)}function o(e,i,r){e.__webglBuffer=t.createBuffer(),t.bindBuffer(r,e.__webglBuffer);var n=i.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW;t.bufferData(r,i.array,n),e.version=i.version}function a(e,i,r){t.bindBuffer(r,e.__webglBuffer),i.dynamic===!1||i.updateRange.count===-1?t.bufferSubData(r,0,i.array):0===i.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(r,i.updateRange.offset*i.array.BYTES_PER_ELEMENT,i.array.subarray(i.updateRange.offset,i.updateRange.offset+i.updateRange.count)),i.updateRange.count=0),e.version=i.version}function s(t){return t.isInterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer}function c(i){var r=e.get(i);if(void 0!==r.wireframe)return r.wireframe;var o=[],a=i.index,s=i.attributes,c=s.position;if(null!==a)for(var l={},h=a.array,d=0,f=h.length;d<f;d+=3){var p=h[d+0],m=h[d+1],g=h[d+2];u(l,p,m)&&o.push(p,m),u(l,m,g)&&o.push(m,g),u(l,g,p)&&o.push(g,p)}else for(var h=s.position.array,d=0,f=h.length/3-1;d<f;d+=3){var p=d+0,m=d+1,g=d+2;o.push(p,m,m,g,g,p)}var v=c.count>65535?Uint32Array:Uint16Array,y=new Rt(new v(o),1);return n(y,t.ELEMENT_ARRAY_BUFFER),r.wireframe=y,y}function u(t,e,i){if(e>i){var r=e;e=i,i=r}var n=t[e];return void 0===n?(t[e]=[i],!0):n.indexOf(i)===-1&&(n.push(i),!0)}var l=new Vt(t,e,i);return{getAttributeBuffer:s,getWireframeAttribute:c,update:r}}function Ht(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var i;switch(e.type){case"DirectionalLight":i={direction:new g,color:new ct,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new h};break;case"SpotLight":i={position:new g,direction:new g,color:new ct,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new h};break;case"PointLight":i={position:new g,color:new ct,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new h};break;case"HemisphereLight":i={direction:new g,skyColor:new ct,groundColor:new ct}}return t[e.id]=i,i}}}function Wt(t,e,i){function r(){if(void 0!==o)return o;var i=e.get("EXT_texture_filter_anisotropic");return o=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function n(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o,a=void 0!==i.precision?i.precision:"highp",s=n(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var c=i.logarithmicDepthBuffer===!0&&!!e.get("EXT_frag_depth"),u=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),l=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_TEXTURE_SIZE),d=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),g=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=l>0,y=!!e.get("OES_texture_float"),b=v&&y;return{getMaxAnisotropy:r,getMaxPrecision:n,precision:a,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:l,maxTextureSize:h,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:b}}function Xt(t){var e={};return{get:function(i){if(void 0!==e[i])return e[i];var r;switch(i){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=t.getExtension("WEBGL_compressed_texture_etc1");break;default:r=t.getExtension(i)}return null===r&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),e[i]=r,r}}}function qt(t,e,i){function r(t){s=t}function n(i){i.array instanceof Uint32Array&&e.get("OES_element_index_uint")?(c=t.UNSIGNED_INT,u=4):(c=t.UNSIGNED_SHORT,u=2)}function o(e,r){t.drawElements(s,r,c,e*u),i.calls++,i.vertices+=r,s===t.TRIANGLES&&(i.faces+=r/3)}function a(r,n,o){var a=e.get("ANGLE_instanced_arrays");return null===a?void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(a.drawElementsInstancedANGLE(s,o,c,n*u,r.maxInstancedCount),i.calls++,i.vertices+=o*r.maxInstancedCount,void(s===t.TRIANGLES&&(i.faces+=r.maxInstancedCount*o/3)))}var s,c,u;return{setMode:r,setIndex:n,render:o,renderInstances:a}}function Yt(){function t(){u.value!==r&&(u.value=r,u.needsUpdate=n>0),i.numPlanes=n;
	}function e(t,e,r,n){var o=null!==t?t.length:0,a=null;if(0!==o){if(a=u.value,n!==!0||null===a){var l=r+4*o,h=e.matrixWorldInverse;c.getNormalMatrix(h),(null===a||a.length<l)&&(a=new Float32Array(l));for(var d=0,f=r;d!==o;++d,f+=4)s.copy(t[d]).applyMatrix4(h,c),s.normal.toArray(a,f),a[f+3]=s.constant}u.value=a,u.needsUpdate=!0}return i.numPlanes=o,a}var i=this,r=null,n=0,o=!1,a=!1,s=new ft,c=new dt,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.init=function(t,i,a){var s=0!==t.length||i||0!==n||o;return o=i,r=e(t,a,0),n=t.length,s},this.beginShadows=function(){a=!0,e(null)},this.endShadows=function(){a=!1,t()},this.setState=function(i,s,c,l,h){if(!o||null===i||0===i.length||a&&!s)a?e(null):t();else{var d=a?0:n,f=4*d,p=l.clippingState||null;u.value=p,p=e(i,c,f,h);for(var m=0;m!==f;++m)p[m]=r[m];l.clippingState=p,this.numPlanes+=d}}}function Zt(t,e,i){function r(t){a=t}function n(e,r){t.drawArrays(a,e,r),i.calls++,i.vertices+=r,a===t.TRIANGLES&&(i.faces+=r/3)}function o(r){var n=e.get("ANGLE_instanced_arrays");if(null===n)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var o=r.attributes.position,s=0;o&&o.isInterleavedBufferAttribute?(s=o.data.count,n.drawArraysInstancedANGLE(a,0,s,r.maxInstancedCount)):(s=o.count,n.drawArraysInstancedANGLE(a,0,s,r.maxInstancedCount)),i.calls++,i.vertices+=s*r.maxInstancedCount,a===t.TRIANGLES&&(i.faces+=r.maxInstancedCount*s/3)}var a;return{setMode:r,render:n,renderInstances:o}}function Kt(t,e,i,r,n,o){function a(t,e,i){var r=0;return r+=(t+1)*(e+1)*2,r+=(t+1)*(i+1)*2,r+=(i+1)*(e+1)*2}function s(t,e,i){var r=0;return r+=t*e*2,r+=t*i*2,r+=i*e*2,6*r}function c(t,e,i,r,n,o,a,s,c,l,h){for(var w=o/c,S=a/l,A=o/2,M=a/2,P=s/2,C=c+1,T=l+1,E=0,I=0,L=new g,R=0;R<T;R++)for(var O=R*S-M,D=0;D<C;D++){var N=D*w-A;L[t]=N*r,L[e]=O*n,L[i]=P,f[v]=L.x,f[v+1]=L.y,f[v+2]=L.z,L[t]=0,L[e]=0,L[i]=s>0?1:-1,p[v]=L.x,p[v+1]=L.y,p[v+2]=L.z,m[y]=D/c,m[y+1]=1-R/l,v+=3,y+=2,E+=1}for(R=0;R<l;R++)for(D=0;D<c;D++){var k=x+D+C*R,F=x+D+C*(R+1),B=x+(D+1)+C*(R+1),z=x+(D+1)+C*R;d[b]=k,d[b+1]=F,d[b+2]=z,d[b+3]=F,d[b+4]=B,d[b+5]=z,b+=6,I+=6}u.addGroup(_,I,h),_+=I,x+=E}$t.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:n,depthSegments:o};var u=this;r=Math.floor(r)||1,n=Math.floor(n)||1,o=Math.floor(o)||1;var l=a(r,n,o),h=s(r,n,o),d=new(h>65535?Uint32Array:Uint16Array)(h),f=new Float32Array(3*l),p=new Float32Array(3*l),m=new Float32Array(2*l),v=0,y=0,b=0,x=0,_=0;c("z","y","x",-1,-1,i,e,t,o,n,0),c("z","y","x",1,-1,i,e,-t,o,n,1),c("x","z","y",1,1,t,i,e,r,o,2),c("x","z","y",1,-1,t,i,-e,r,o,3),c("x","y","z",1,-1,t,e,i,r,n,4),c("x","y","z",-1,-1,t,e,-i,r,n,5),this.setIndex(new Rt(d,1)),this.addAttribute("position",new Rt(f,3)),this.addAttribute("normal",new Rt(p,3)),this.addAttribute("uv",new Rt(m,2))}function Qt(t,e){this.origin=void 0!==t?t:new g,this.direction=void 0!==e?e:new g}function Jt(t,e){this.start=void 0!==t?t:new g,this.end=void 0!==e?e:new g}function te(t,e,i){this.a=void 0!==t?t:new g,this.b=void 0!==e?e:new g,this.c=void 0!==i?i:new g}function ee(t){ot.call(this),this.type="MeshBasicMaterial",this.color=new ct(16777215),this.map=null,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=vu,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function ie(t,e){Ft.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new $t,this.material=void 0!==e?e:new ee({color:16777215*Math.random()}),this.drawMode=Ml,this.updateMorphTargets()}function re(t,e,i,r){$t.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r};for(var n=t/2,o=e/2,a=Math.floor(i)||1,s=Math.floor(r)||1,c=a+1,u=s+1,l=t/a,h=e/s,d=new Float32Array(c*u*3),f=new Float32Array(c*u*3),p=new Float32Array(c*u*2),m=0,g=0,v=0;v<u;v++)for(var y=v*h-o,b=0;b<c;b++){var x=b*l-n;d[m]=x,d[m+1]=-y,f[m+2]=1,p[g]=b/a,p[g+1]=1-v/s,m+=3,g+=2}m=0;for(var _=new(d.length/3>65535?Uint32Array:Uint16Array)(a*s*6),v=0;v<s;v++)for(var b=0;b<a;b++){var w=b+c*v,S=b+c*(v+1),A=b+1+c*(v+1),M=b+1+c*v;_[m]=w,_[m+1]=S,_[m+2]=M,_[m+3]=S,_[m+4]=A,_[m+5]=M,m+=6}this.setIndex(new Rt(_,1)),this.addAttribute("position",new Rt(d,3)),this.addAttribute("normal",new Rt(f,3)),this.addAttribute("uv",new Rt(p,2))}function ne(){Ft.call(this),this.type="Camera",this.matrixWorldInverse=new p,this.projectionMatrix=new p}function oe(t,e,i,r){ne.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function ae(t,e,i,r,n,o){ne.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=void 0!==n?n:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function se(t){function e(){return null===lt?Ct:1}function i(t,e,i,r){W===!0&&(t*=r,e*=r,i*=r),te.clearColor(t,e,i,r)}function r(){te.init(),te.scissor(bt.copy(Tt).multiplyScalar(Ct)),te.viewport(_t.copy(It).multiplyScalar(Ct)),i(St.r,St.g,St.b,At)}function n(){ut=null,vt=null,gt="",ft=-1,te.reset()}function o(t){t.preventDefault(),n(),r(),ne.clear()}function a(t){var e=t.target;e.removeEventListener("dispose",a),s(e)}function s(t){c(t),ne.delete(t)}function c(t){var e=ne.get(t).program;t.program=void 0,void 0!==e&&ue.releaseProgram(e)}function u(t,e,i,r){var n;if(i&&i.isInstancedBufferGeometry&&(n=Qt.get("ANGLE_instanced_arrays"),null===n))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0),te.initAttributes();var o=i.attributes,a=e.getAttributes(),s=t.defaultAttributeValues;for(var c in a){var u=a[c];if(u>=0){var l=o[c];if(void 0!==l){var h=jt.FLOAT,d=l.array,f=l.normalized;d instanceof Float32Array?h=jt.FLOAT:d instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):d instanceof Uint16Array?h=jt.UNSIGNED_SHORT:d instanceof Int16Array?h=jt.SHORT:d instanceof Uint32Array?h=jt.UNSIGNED_INT:d instanceof Int32Array?h=jt.INT:d instanceof Int8Array?h=jt.BYTE:d instanceof Uint8Array&&(h=jt.UNSIGNED_BYTE);var p=l.itemSize,m=ce.getAttributeBuffer(l);if(l&&l.isInterleavedBufferAttribute){var g=l.data,v=g.stride,y=l.offset;g&&g.isInstancedInterleavedBuffer?(te.enableAttributeAndDivisor(u,g.meshPerAttribute,n),void 0===i.maxInstancedCount&&(i.maxInstancedCount=g.meshPerAttribute*g.count)):te.enableAttribute(u),jt.bindBuffer(jt.ARRAY_BUFFER,m),jt.vertexAttribPointer(u,p,h,f,v*g.array.BYTES_PER_ELEMENT,(r*v+y)*g.array.BYTES_PER_ELEMENT)}else l&&l.isInstancedBufferAttribute?(te.enableAttributeAndDivisor(u,l.meshPerAttribute,n),void 0===i.maxInstancedCount&&(i.maxInstancedCount=l.meshPerAttribute*l.count)):te.enableAttribute(u),jt.bindBuffer(jt.ARRAY_BUFFER,m),jt.vertexAttribPointer(u,p,h,f,0,r*p*l.array.BYTES_PER_ELEMENT)}else if(void 0!==s){var b=s[c];if(void 0!==b)switch(b.length){case 2:jt.vertexAttrib2fv(u,b);break;case 3:jt.vertexAttrib3fv(u,b);break;case 4:jt.vertexAttrib4fv(u,b);break;default:jt.vertexAttrib1fv(u,b)}}}}te.disableUnusedAttributes()}function l(t,e){return Math.abs(e[0])-Math.abs(t[0])}function h(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.material.program&&e.material.program&&t.material.program!==e.material.program?t.material.program.id-e.material.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function d(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function f(t,e,i,r,n){var o,a;i.transparent?(o=K,a=++Q):(o=Y,a=++Z);var s=o[a];void 0!==s?(s.id=t.id,s.object=t,s.geometry=e,s.material=i,s.z=Bt.z,s.group=n):(s={id:t.id,object:t,geometry:e,material:i,z:Bt.z,group:n},o.push(s))}function m(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),kt.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),x(kt)}function y(t){return kt.center.set(0,0,0),kt.radius=.7071067811865476,kt.applyMatrix4(t.matrixWorld),x(kt)}function x(t){if(!Rt.intersectsSphere(t))return!1;var e=Ot.numPlanes;if(0===e)return!0;var i=at.clippingPlanes,r=t.center,n=-t.radius,o=0;do if(i[o].distanceToPoint(r)<n)return!1;while(++o!==e);return!0}function _(t,e){if(t.visible!==!1){var i=0!==(t.layers.mask&e.layers.mask);if(i)if(t.isLight)q.push(t);else if(t.isSprite)t.frustumCulled!==!1&&y(t)!==!0||nt.push(t);else if(t.isLensFlare)ot.push(t);else if(t.isImmediateRenderObject)at.sortObjects===!0&&(Bt.setFromMatrixPosition(t.matrixWorld),Bt.applyProjection(Ft)),f(t,null,t.material,Bt.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),t.frustumCulled===!1||m(t)===!0)){var r=t.material;if(r.visible===!0){at.sortObjects===!0&&(Bt.setFromMatrixPosition(t.matrixWorld),Bt.applyProjection(Ft));var n=ce.update(t);if(r.isMultiMaterial)for(var o=n.groups,a=r.materials,s=0,c=o.length;s<c;s++){var u=o[s],l=a[u.materialIndex];l.visible===!0&&f(t,n,l,Bt.z,u)}else f(t,n,r,Bt.z,null)}}for(var h=t.children,s=0,c=h.length;s<c;s++)_(h[s],e)}}function w(t,e,i,r){for(var n=0,o=t.length;n<o;n++){var a=t[n],s=a.object,c=a.geometry,u=void 0===r?a.material:r,l=a.group;if(s.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,s.matrixWorld),s.normalMatrix.getNormalMatrix(s.modelViewMatrix),s.isImmediateRenderObject){A(u);var h=M(e,i,u,s);gt="",s.render(function(t){at.renderBufferImmediate(t,h,u)})}else at.renderBufferDirect(e,i,c,u,s,l)}}function S(t,e,i){var r=ne.get(t),n=ue.getParameters(t,zt,e,Ot.numPlanes,i),o=ue.getProgramCode(t,n),s=r.program,u=!0;if(void 0===s)t.addEventListener("dispose",a);else if(s.code!==o)c(t);else{if(void 0!==n.shaderID)return;u=!1}if(u){if(n.shaderID){var l=Wd[n.shaderID];r.__webglShader={name:t.type,uniforms:Hl.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}else r.__webglShader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.__webglShader=r.__webglShader,s=ue.acquireProgram(t,n,o),r.program=s,t.program=s}var h=s.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var d=0;d<at.maxMorphTargets;d++)h["morphTarget"+d]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(var d=0;d<at.maxMorphNormals;d++)h["morphNormal"+d]>=0&&t.numSupportedMorphNormals++}var f=r.__webglShader.uniforms;!t.isShaderMaterial&&!t.isRawShaderMaterial|t.clipping===!0&&(r.numClippingPlanes=Ot.numPlanes,f.clippingPlanes=Ot.uniform),r.fog=e,r.lightsHash=zt.hash,t.lights&&(f.ambientLightColor.value=zt.ambient,f.directionalLights.value=zt.directional,f.spotLights.value=zt.spot,f.pointLights.value=zt.point,f.hemisphereLights.value=zt.hemi,f.directionalShadowMap.value=zt.directionalShadowMap,f.directionalShadowMatrix.value=zt.directionalShadowMatrix,f.spotShadowMap.value=zt.spotShadowMap,f.spotShadowMatrix.value=zt.spotShadowMatrix,f.pointShadowMap.value=zt.pointShadowMap,f.pointShadowMatrix.value=zt.pointShadowMatrix);var p=r.program.getUniforms(),m=tt.seqWithValue(p.seq,f);r.uniformsList=m,r.dynamicUniforms=tt.splitDynamic(m,f)}function A(t){t.side===Nc?te.disable(jt.CULL_FACE):te.enable(jt.CULL_FACE),te.setFlipSided(t.side===Dc),t.transparent===!0?te.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):te.setBlending(jc),te.setDepthFunc(t.depthFunc),te.setDepthTest(t.depthTest),te.setDepthWrite(t.depthWrite),te.setColorWrite(t.colorWrite),te.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function M(t,e,i,r){wt=0;var n=ne.get(i);if(Dt&&(Nt||t!==vt)){var o=t===vt&&i.id===ft;Ot.setState(i.clippingPlanes,i.clipShadows,t,n,o)}i.needsUpdate===!1&&(void 0===n.program?i.needsUpdate=!0:i.fog&&n.fog!==e?i.needsUpdate=!0:i.lights&&n.lightsHash!==zt.hash?i.needsUpdate=!0:void 0!==n.numClippingPlanes&&n.numClippingPlanes!==Ot.numPlanes&&(i.needsUpdate=!0)),i.needsUpdate&&(S(i,e,r),i.needsUpdate=!1);var a=!1,s=!1,c=!1,u=n.program,l=u.getUniforms(),h=n.__webglShader.uniforms;if(u.id!==ut&&(jt.useProgram(u.program),ut=u.id,a=!0,s=!0,c=!0),i.id!==ft&&(ft=i.id,s=!0),a||t!==vt){if(l.set(jt,t,"projectionMatrix"),Jt.logarithmicDepthBuffer&&l.setValue(jt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),t!==vt&&(vt=t,s=!0,c=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap){var d=l.map.cameraPosition;void 0!==d&&d.setValue(jt,Bt.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&l.setValue(jt,"viewMatrix",t.matrixWorldInverse),l.set(jt,at,"toneMappingExposure"),l.set(jt,at,"toneMappingWhitePoint")}if(i.skinning){l.setOptional(jt,r,"bindMatrix"),l.setOptional(jt,r,"bindMatrixInverse");var f=r.skeleton;f&&(Jt.floatVertexTextures&&f.useVertexTexture?(l.set(jt,f,"boneTexture"),l.set(jt,f,"boneTextureWidth"),l.set(jt,f,"boneTextureHeight")):l.setOptional(jt,f,"boneMatrices"))}s&&(i.lights&&N(h,c),e&&i.fog&&I(h,e),(i.isMeshBasicMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshDepthMaterial)&&P(h,i),i.isLineBasicMaterial?C(h,i):i.isLineDashedMaterial?(C(h,i),T(h,i)):i.isPointsMaterial?E(h,i):i.isMeshLambertMaterial?L(h,i):i.isMeshPhongMaterial?R(h,i):i.isMeshPhysicalMaterial?D(h,i):i.isMeshStandardMaterial?O(h,i):i.isMeshDepthMaterial?i.displacementMap&&(h.displacementMap.value=i.displacementMap,h.displacementScale.value=i.displacementScale,h.displacementBias.value=i.displacementBias):i.isMeshNormalMaterial&&(h.opacity.value=i.opacity),tt.upload(jt,n.uniformsList,h,at)),l.set(jt,r,"modelViewMatrix"),l.set(jt,r,"normalMatrix"),l.setValue(jt,"modelMatrix",r.matrixWorld);var p=n.dynamicUniforms;return null!==p&&(tt.evalDynamic(p,h,r,t),tt.upload(jt,p,h,at)),u}function P(t,e){t.opacity.value=e.opacity,t.diffuse.value=e.color,e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),t.map.value=e.map,t.specularMap.value=e.specularMap,t.alphaMap.value=e.alphaMap,e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity);var i;if(e.map?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i){i.isWebGLRenderTarget&&(i=i.texture);var r=i.offset,n=i.repeat;t.offsetRepeat.value.set(r.x,r.y,n.x,n.y)}t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap&&e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio}function C(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function T(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function E(t,e){if(t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*Ct,t.scale.value=.5*U.clientHeight,t.map.value=e.map,null!==e.map){var i=e.map.offset,r=e.map.repeat;t.offsetRepeat.value.set(i.x,i.y,r.x,r.y)}}function I(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function L(t,e){e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function R(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function O(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function D(t,e){t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness,O(t,e)}function N(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function k(t){for(var e=0,i=0,r=t.length;i<r;i++){var n=t[i];n.castShadow&&(zt.shadows[e++]=n)}zt.shadows.length=e}function F(t,e){var i,r,n,o,a,s,c,u=0,l=0,h=0,d=e.matrixWorldInverse,f=0,m=0,g=0,v=0;for(i=0,r=t.length;i<r;i++)if(n=t[i],o=n.color,a=n.intensity,s=n.distance,c=n.shadow&&n.shadow.map?n.shadow.map.texture:null,n.isAmbientLight)u+=o.r*a,l+=o.g*a,h+=o.b*a;else if(n.isDirectionalLight){var y=le.get(n);y.color.copy(n.color).multiplyScalar(n.intensity),y.direction.setFromMatrixPosition(n.matrixWorld),Bt.setFromMatrixPosition(n.target.matrixWorld),y.direction.sub(Bt),y.direction.transformDirection(d),y.shadow=n.castShadow,n.castShadow&&(y.shadowBias=n.shadow.bias,y.shadowRadius=n.shadow.radius,y.shadowMapSize=n.shadow.mapSize),zt.directionalShadowMap[f]=c,zt.directionalShadowMatrix[f]=n.shadow.matrix,zt.directional[f++]=y}else if(n.isSpotLight){var y=le.get(n);y.position.setFromMatrixPosition(n.matrixWorld),y.position.applyMatrix4(d),y.color.copy(o).multiplyScalar(a),y.distance=s,y.direction.setFromMatrixPosition(n.matrixWorld),Bt.setFromMatrixPosition(n.target.matrixWorld),y.direction.sub(Bt),y.direction.transformDirection(d),y.coneCos=Math.cos(n.angle),y.penumbraCos=Math.cos(n.angle*(1-n.penumbra)),y.decay=0===n.distance?0:n.decay,y.shadow=n.castShadow,n.castShadow&&(y.shadowBias=n.shadow.bias,y.shadowRadius=n.shadow.radius,y.shadowMapSize=n.shadow.mapSize),zt.spotShadowMap[g]=c,zt.spotShadowMatrix[g]=n.shadow.matrix,zt.spot[g++]=y}else if(n.isPointLight){var y=le.get(n);y.position.setFromMatrixPosition(n.matrixWorld),y.position.applyMatrix4(d),y.color.copy(n.color).multiplyScalar(n.intensity),y.distance=n.distance,y.decay=0===n.distance?0:n.decay,y.shadow=n.castShadow,n.castShadow&&(y.shadowBias=n.shadow.bias,y.shadowRadius=n.shadow.radius,y.shadowMapSize=n.shadow.mapSize),zt.pointShadowMap[m]=c,void 0===zt.pointShadowMatrix[m]&&(zt.pointShadowMatrix[m]=new p),Bt.setFromMatrixPosition(n.matrixWorld).negate(),zt.pointShadowMatrix[m].identity().setPosition(Bt),zt.point[m++]=y}else if(n.isHemisphereLight){var y=le.get(n);y.direction.setFromMatrixPosition(n.matrixWorld),y.direction.transformDirection(d),y.direction.normalize(),y.skyColor.copy(n.color).multiplyScalar(a),y.groundColor.copy(n.groundColor).multiplyScalar(a),zt.hemi[v++]=y}zt.ambient[0]=u,zt.ambient[1]=l,zt.ambient[2]=h,zt.directional.length=f,zt.spot.length=g,zt.point.length=m,zt.hemi.length=v,zt.hash=f+","+m+","+g+","+v+","+zt.shadows.length}function B(){var t=wt;return t>=Jt.maxTextures&&console.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+Jt.maxTextures),wt+=1,t}function z(t){var e;if(t===Ou)return jt.REPEAT;if(t===Du)return jt.CLAMP_TO_EDGE;if(t===Nu)return jt.MIRRORED_REPEAT;if(t===ku)return jt.NEAREST;if(t===Fu)return jt.NEAREST_MIPMAP_NEAREST;if(t===Bu)return jt.NEAREST_MIPMAP_LINEAR;if(t===zu)return jt.LINEAR;if(t===Uu)return jt.LINEAR_MIPMAP_NEAREST;if(t===ju)return jt.LINEAR_MIPMAP_LINEAR;if(t===$u)return jt.UNSIGNED_BYTE;if(t===Zu)return jt.UNSIGNED_SHORT_4_4_4_4;if(t===Ku)return jt.UNSIGNED_SHORT_5_5_5_1;if(t===Qu)return jt.UNSIGNED_SHORT_5_6_5;if(t===Vu)return jt.BYTE;if(t===Gu)return jt.SHORT;if(t===Hu)return jt.UNSIGNED_SHORT;if(t===Wu)return jt.INT;if(t===Xu)return jt.UNSIGNED_INT;if(t===qu)return jt.FLOAT;if(e=Qt.get("OES_texture_half_float"),null!==e&&t===Yu)return e.HALF_FLOAT_OES;if(t===tl)return jt.ALPHA;if(t===el)return jt.RGB;if(t===il)return jt.RGBA;if(t===rl)return jt.LUMINANCE;if(t===nl)return jt.LUMINANCE_ALPHA;if(t===ol)return jt.DEPTH_COMPONENT;if(t===al)return jt.DEPTH_STENCIL;if(t===Xc)return jt.FUNC_ADD;if(t===qc)return jt.FUNC_SUBTRACT;if(t===Yc)return jt.FUNC_REVERSE_SUBTRACT;if(t===Qc)return jt.ZERO;if(t===Jc)return jt.ONE;if(t===tu)return jt.SRC_COLOR;if(t===eu)return jt.ONE_MINUS_SRC_COLOR;if(t===iu)return jt.SRC_ALPHA;if(t===ru)return jt.ONE_MINUS_SRC_ALPHA;if(t===nu)return jt.DST_ALPHA;if(t===ou)return jt.ONE_MINUS_DST_ALPHA;if(t===au)return jt.DST_COLOR;if(t===su)return jt.ONE_MINUS_DST_COLOR;if(t===cu)return jt.SRC_ALPHA_SATURATE;if(e=Qt.get("WEBGL_compressed_texture_s3tc"),null!==e){if(t===sl)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===cl)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===ul)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===ll)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e=Qt.get("WEBGL_compressed_texture_pvrtc"),null!==e){if(t===hl)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===dl)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===fl)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===pl)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e=Qt.get("WEBGL_compressed_texture_etc1"),null!==e&&t===ml)return e.COMPRESSED_RGB_ETC1_WEBGL;if(e=Qt.get("EXT_blend_minmax"),null!==e){if(t===Zc)return e.MIN_EXT;if(t===Kc)return e.MAX_EXT}return e=Qt.get("WEBGL_depth_texture"),null!==e&&t===Ju?e.UNSIGNED_INT_24_8_WEBGL:0}console.log("THREE.WebGLRenderer",Pc),t=t||{};var U=void 0!==t.canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),j=void 0!==t.context?t.context:null,$=void 0!==t.alpha&&t.alpha,V=void 0===t.depth||t.depth,G=void 0===t.stencil||t.stencil,H=void 0!==t.antialias&&t.antialias,W=void 0===t.premultipliedAlpha||t.premultipliedAlpha,X=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,q=[],Y=[],Z=-1,K=[],Q=-1,J=new Float32Array(8),nt=[],ot=[];this.domElement=U,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=_u,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var at=this,ut=null,lt=null,dt=null,ft=-1,gt="",vt=null,bt=new it,xt=null,_t=new it,wt=0,St=new ct(0),At=0,Mt=U.width,Pt=U.height,Ct=1,Tt=new it(0,0,Mt,Pt),Et=!1,It=new it(0,0,Mt,Pt),Rt=new pt,Ot=new Yt,Dt=!1,Nt=!1,kt=new ht,Ft=new p,Bt=new g,zt={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},Ut={calls:0,vertices:0,faces:0,points:0};this.info={render:Ut,memory:{geometries:0,textures:0},programs:null};var jt;try{var Vt={alpha:$,depth:V,stencil:G,antialias:H,premultipliedAlpha:W,preserveDrawingBuffer:X};if(jt=j||U.getContext("webgl",Vt)||U.getContext("experimental-webgl",Vt),null===jt)throw null!==U.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===jt.getShaderPrecisionFormat&&(jt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),U.addEventListener("webglcontextlost",o,!1)}catch(t){console.error("THREE.WebGLRenderer: "+t)}var Qt=new Xt(jt);Qt.get("WEBGL_depth_texture"),Qt.get("OES_texture_float"),Qt.get("OES_texture_float_linear"),Qt.get("OES_texture_half_float"),Qt.get("OES_texture_half_float_linear"),Qt.get("OES_standard_derivatives"),Qt.get("ANGLE_instanced_arrays"),Qt.get("OES_element_index_uint")&&($t.MaxIndex=4294967296);var Jt=new Wt(jt,Qt,t),te=new rt(jt,Qt,z),ne=new yt,se=new et(jt,Qt,te,ne,Jt,z,this.info),ce=new Gt(jt,ne,this.info),ue=new Lt(this,Jt),le=new Ht;this.info.programs=ue.programs;var he=new Zt(jt,Qt,Ut),de=new qt(jt,Qt,Ut),fe=new ae(-1,1,1,-1,0,1),pe=new oe,me=new ie(new re(2,2),new ee({depthTest:!1,depthWrite:!1,fog:!1})),ge=Wd.cube,ve=new ie(new Kt(5,5,5),new st({uniforms:ge.uniforms,vertexShader:ge.vertexShader,fragmentShader:ge.fragmentShader,side:Dc,depthTest:!1,depthWrite:!1,fog:!1}));r(),this.context=jt,this.capabilities=Jt,this.extensions=Qt,this.properties=ne,this.state=te;var ye=new mt(this,zt,ce,Jt);this.shadowMap=ye;var be=new v(this,nt),xe=new b(this,ot);this.getContext=function(){return jt},this.getContextAttributes=function(){return jt.getContextAttributes()},this.forceContextLoss=function(){Qt.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){return Jt.getMaxAnisotropy()},this.getPrecision=function(){return Jt.precision},this.getPixelRatio=function(){return Ct},this.setPixelRatio=function(t){void 0!==t&&(Ct=t,this.setSize(It.z,It.w,!1))},this.getSize=function(){return{width:Mt,height:Pt}},this.setSize=function(t,e,i){Mt=t,Pt=e,U.width=t*Ct,U.height=e*Ct,i!==!1&&(U.style.width=t+"px",U.style.height=e+"px"),this.setViewport(0,0,t,e)},this.setViewport=function(t,e,i,r){te.viewport(It.set(t,e,i,r))},this.setScissor=function(t,e,i,r){te.scissor(Tt.set(t,e,i,r))},this.setScissorTest=function(t){te.setScissorTest(Et=t)},this.getClearColor=function(){return St},this.setClearColor=function(t,e){St.set(t),At=void 0!==e?e:1,i(St.r,St.g,St.b,At)},this.getClearAlpha=function(){return At},this.setClearAlpha=function(t){At=t,i(St.r,St.g,St.b,At)},this.clear=function(t,e,i){var r=0;(void 0===t||t)&&(r|=jt.COLOR_BUFFER_BIT),(void 0===e||e)&&(r|=jt.DEPTH_BUFFER_BIT),(void 0===i||i)&&(r|=jt.STENCIL_BUFFER_BIT),jt.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,i,r){this.setRenderTarget(t),this.clear(e,i,r)},this.resetGLState=n,this.dispose=function(){K=[],Q=-1,Y=[],Z=-1,U.removeEventListener("webglcontextlost",o,!1)},this.renderBufferImmediate=function(t,e,i){te.initAttributes();var r=ne.get(t);t.hasPositions&&!r.position&&(r.position=jt.createBuffer()),t.hasNormals&&!r.normal&&(r.normal=jt.createBuffer()),t.hasUvs&&!r.uv&&(r.uv=jt.createBuffer()),t.hasColors&&!r.color&&(r.color=jt.createBuffer());var n=e.getAttributes();if(t.hasPositions&&(jt.bindBuffer(jt.ARRAY_BUFFER,r.position),jt.bufferData(jt.ARRAY_BUFFER,t.positionArray,jt.DYNAMIC_DRAW),te.enableAttribute(n.position),jt.vertexAttribPointer(n.position,3,jt.FLOAT,!1,0,0)),t.hasNormals){if(jt.bindBuffer(jt.ARRAY_BUFFER,r.normal),!i.isMeshPhongMaterial&&!i.isMeshStandardMaterial&&i.shading===kc)for(var o=0,a=3*t.count;o<a;o+=9){var s=t.normalArray,c=(s[o+0]+s[o+3]+s[o+6])/3,u=(s[o+1]+s[o+4]+s[o+7])/3,l=(s[o+2]+s[o+5]+s[o+8])/3;s[o+0]=c,s[o+1]=u,s[o+2]=l,s[o+3]=c,s[o+4]=u,s[o+5]=l,s[o+6]=c,s[o+7]=u,s[o+8]=l}jt.bufferData(jt.ARRAY_BUFFER,t.normalArray,jt.DYNAMIC_DRAW),te.enableAttribute(n.normal),jt.vertexAttribPointer(n.normal,3,jt.FLOAT,!1,0,0)}t.hasUvs&&i.map&&(jt.bindBuffer(jt.ARRAY_BUFFER,r.uv),jt.bufferData(jt.ARRAY_BUFFER,t.uvArray,jt.DYNAMIC_DRAW),te.enableAttribute(n.uv),jt.vertexAttribPointer(n.uv,2,jt.FLOAT,!1,0,0)),t.hasColors&&i.vertexColors!==Bc&&(jt.bindBuffer(jt.ARRAY_BUFFER,r.color),jt.bufferData(jt.ARRAY_BUFFER,t.colorArray,jt.DYNAMIC_DRAW),te.enableAttribute(n.color),jt.vertexAttribPointer(n.color,3,jt.FLOAT,!1,0,0)),te.disableUnusedAttributes(),jt.drawArrays(jt.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,i,r,n,o,a){A(n);var s=M(t,i,n,o),c=!1,h=r.id+"_"+s.id+"_"+n.wireframe;h!==gt&&(gt=h,c=!0);var d=o.morphTargetInfluences;if(void 0!==d){for(var f=[],p=0,m=d.length;p<m;p++){var g=d[p];f.push([g,p])}f.sort(l),f.length>8&&(f.length=8);for(var v=r.morphAttributes,p=0,m=f.length;p<m;p++){var g=f[p];if(J[p]=g[0],0!==g[0]){var y=g[1];n.morphTargets===!0&&v.position&&r.addAttribute("morphTarget"+p,v.position[y]),n.morphNormals===!0&&v.normal&&r.addAttribute("morphNormal"+p,v.normal[y])}else n.morphTargets===!0&&r.removeAttribute("morphTarget"+p),n.morphNormals===!0&&r.removeAttribute("morphNormal"+p)}s.getUniforms().setValue(jt,"morphTargetInfluences",J),c=!0}var y=r.index,b=r.attributes.position;n.wireframe===!0&&(y=ce.getWireframeAttribute(r));var x;null!==y?(x=de,x.setIndex(y)):x=he,c&&(u(n,s,r),null!==y&&jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,ce.getAttributeBuffer(y)));var _=0,w=1/0;null!==y?w=y.count:void 0!==b&&(w=b.count);var S=r.drawRange.start,P=r.drawRange.count,C=null!==a?a.start:0,T=null!==a?a.count:1/0,E=Math.max(_,S,C),I=Math.min(_+w,S+P,C+T)-1,L=Math.max(0,I-E+1);if(o.isMesh)if(n.wireframe===!0)te.setLineWidth(n.wireframeLinewidth*e()),x.setMode(jt.LINES);else switch(o.drawMode){case Ml:x.setMode(jt.TRIANGLES);break;case Pl:x.setMode(jt.TRIANGLE_STRIP);break;case Cl:x.setMode(jt.TRIANGLE_FAN)}else if(o.isLine){var R=n.linewidth;void 0===R&&(R=1),te.setLineWidth(R*e()),o.isLineSegments?x.setMode(jt.LINES):x.setMode(jt.LINE_STRIP)}else o.isPoints&&x.setMode(jt.POINTS);r&&r.isInstancedBufferGeometry?r.maxInstancedCount>0&&x.renderInstances(r,E,L):x.render(E,L)},this.render=function(t,e,r,n){if((e&&e.isCamera)===!1)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");var o=t.fog;gt="",ft=-1,vt=null,t.autoUpdate===!0&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.matrixWorldInverse.getInverse(e.matrixWorld),Ft.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Rt.setFromMatrix(Ft),q.length=0,Z=-1,Q=-1,nt.length=0,ot.length=0,Nt=this.localClippingEnabled,Dt=Ot.init(this.clippingPlanes,Nt,e),_(t,e),Y.length=Z+1,K.length=Q+1,at.sortObjects===!0&&(Y.sort(h),K.sort(d)),Dt&&Ot.beginShadows(),k(q),ye.render(t,e),F(q,e),Dt&&Ot.endShadows(),Ut.calls=0,Ut.vertices=0,Ut.faces=0,Ut.points=0,void 0===r&&(r=null),this.setRenderTarget(r);var a=t.background;if(null===a?i(St.r,St.g,St.b,At):a&&a.isColor&&(i(a.r,a.g,a.b,1),n=!0),(this.autoClear||n)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),a&&a.isCubeTexture?(pe.projectionMatrix.copy(e.projectionMatrix),pe.matrixWorld.extractRotation(e.matrixWorld),pe.matrixWorldInverse.getInverse(pe.matrixWorld),ve.material.uniforms.tCube.value=a,ve.modelViewMatrix.multiplyMatrices(pe.matrixWorldInverse,ve.matrixWorld),ce.update(ve),at.renderBufferDirect(pe,null,ve.geometry,ve.material,ve,null)):a&&a.isTexture&&(me.material.map=a,ce.update(me),at.renderBufferDirect(fe,null,me.geometry,me.material,me,null)),t.overrideMaterial){var s=t.overrideMaterial;w(Y,e,o,s),w(K,e,o,s)}else te.setBlending(jc),w(Y,e,o),w(K,e,o);be.render(t,e),xe.render(t,e,_t),r&&se.updateRenderTargetMipmap(r),te.setDepthTest(!0),te.setDepthWrite(!0),te.setColorWrite(!0)},this.setFaceCulling=function(t,e){te.setCullFace(t),te.setFlipSided(e===Ic)},this.allocTextureUnit=B,this.setTexture2D=function(){var t=!1;return function(e,i){e&&e.isWebGLRenderTarget&&(t||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),se.setTexture2D(e,i)}}(),this.setTexture=function(){var t=!1;return function(e,i){t||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),t=!0),se.setTexture2D(e,i)}}(),this.setTextureCube=function(){
	var t=!1;return function(e,i){e&&e.isWebGLRenderTargetCube&&(t||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?se.setTextureCube(e,i):se.setTextureCubeDynamic(e,i)}}(),this.getCurrentRenderTarget=function(){return lt},this.setRenderTarget=function(t){lt=t,t&&void 0===ne.get(t).__webglFramebuffer&&se.setupRenderTarget(t);var e,i=t&&t.isWebGLRenderTargetCube;if(t){var r=ne.get(t);e=i?r.__webglFramebuffer[t.activeCubeFace]:r.__webglFramebuffer,bt.copy(t.scissor),xt=t.scissorTest,_t.copy(t.viewport)}else e=null,bt.copy(Tt).multiplyScalar(Ct),xt=Et,_t.copy(It).multiplyScalar(Ct);if(dt!==e&&(jt.bindFramebuffer(jt.FRAMEBUFFER,e),dt=e),te.scissor(bt),te.setScissorTest(xt),te.viewport(_t),i){var n=ne.get(t.texture);jt.framebufferTexture2D(jt.FRAMEBUFFER,jt.COLOR_ATTACHMENT0,jt.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,n.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,i,r,n,o){if((t&&t.isWebGLRenderTarget)===!1)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var a=ne.get(t).__webglFramebuffer;if(a){var s=!1;a!==dt&&(jt.bindFramebuffer(jt.FRAMEBUFFER,a),s=!0);try{var c=t.texture,u=c.format,l=c.type;if(u!==il&&z(u)!==jt.getParameter(jt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(l===$u||z(l)===jt.getParameter(jt.IMPLEMENTATION_COLOR_READ_TYPE)||l===qu&&(Qt.get("OES_texture_float")||Qt.get("WEBGL_color_buffer_float"))||l===Yu&&Qt.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");jt.checkFramebufferStatus(jt.FRAMEBUFFER)===jt.FRAMEBUFFER_COMPLETE?e>=0&&e<=t.width-r&&i>=0&&i<=t.height-n&&jt.readPixels(e,i,r,n,z(u),z(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&jt.bindFramebuffer(jt.FRAMEBUFFER,dt)}}}}function ce(t,e){this.name="",this.color=new ct(t),this.density=void 0!==e?e:25e-5}function ue(t,e,i){this.name="",this.color=new ct(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}function le(){Ft.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function he(t,e,i,r,n){Ft.call(this),this.lensFlares=[],this.positionScreen=new g,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,i,r,n)}function de(t){ot.call(this),this.type="SpriteMaterial",this.color=new ct(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(t)}function fe(t){Ft.call(this),this.type="Sprite",this.material=void 0!==t?t:new de}function pe(){Ft.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function me(t,e,i,r,n,o,a,s,c,u,l,h){d.call(this,null,o,a,s,c,u,r,n,l,h),this.image={data:t,width:e,height:i},this.magFilter=void 0!==c?c:ku,this.minFilter=void 0!==u?u:ku,this.flipY=!1,this.generateMipmaps=!1}function ge(t,e,i){var r=this;if(this.useVertexTexture=void 0===i||i,this.identityMatrix=new p,t=t||[],this.bones=t.slice(0),this.useVertexTexture){var n=Math.sqrt(4*this.bones.length);n=Fl.nextPowerOfTwo(Math.ceil(n)),n=Math.max(n,4),this.boneTextureWidth=n,this.boneTextureHeight=n,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new me(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,il,qu)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var o=0,a=this.bones.length;o<a;o++)r.boneInverses.push(new p)}}function ve(t){Ft.call(this),this.type="Bone",this.skin=t}function ye(t,e,i){var r=this;ie.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new p,this.bindMatrixInverse=new p;var n=[];if(this.geometry&&void 0!==this.geometry.bones){for(var o,a,s=0,c=this.geometry.bones.length;s<c;++s)a=r.geometry.bones[s],o=new ve(r),n.push(o),o.name=a.name,o.position.fromArray(a.pos),o.quaternion.fromArray(a.rotq),void 0!==a.scl&&o.scale.fromArray(a.scl);for(var s=0,c=this.geometry.bones.length;s<c;++s)a=r.geometry.bones[s],a.parent!==-1&&null!==a.parent&&void 0!==n[a.parent]?n[a.parent].add(n[s]):r.add(n[s])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new ge(n,void 0,i),this.matrixWorld)}function be(t){ot.call(this),this.type="LineBasicMaterial",this.color=new ct(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function xe(t,e,i){return 1===i?(console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new _e(t,e)):(Ft.call(this),this.type="Line",this.geometry=void 0!==t?t:new $t,void(this.material=void 0!==e?e:new be({color:16777215*Math.random()})))}function _e(t,e){xe.call(this,t,e),this.type="LineSegments"}function we(t){ot.call(this),this.type="PointsMaterial",this.color=new ct(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(t)}function Se(t,e){Ft.call(this),this.type="Points",this.geometry=void 0!==t?t:new $t,this.material=void 0!==e?e:new we({color:16777215*Math.random()})}function Ae(){Ft.call(this),this.type="Group"}function Me(t,e,i,r,n,o,a,s,c,u,l,h){d.call(this,null,o,a,s,c,u,r,n,l,h),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Pe(t,e,i,r,n,o,a,s,c){d.call(this,t,e,i,r,n,o,a,s,c),this.needsUpdate=!0}function Ce(t,e,i){var r=this,n=!1,o=0,a=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){a++,n===!1&&void 0!==r.onStart&&r.onStart(t,o,a),n=!0},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,a),o===a&&(n=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)}}function Te(t){this.manager=void 0!==t?t:Kd}function Ee(t){this.manager=void 0!==t?t:Kd,this._parser=null}function Ie(t){this.manager=void 0!==t?t:Kd,this._parser=null}function Le(t){this.manager=void 0!==t?t:Kd}function Re(t){this.manager=void 0!==t?t:Kd}function Oe(t){this.manager=void 0!==t?t:Kd}function De(t,e){Ft.call(this),this.type="Light",this.color=new ct(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Ne(t,e,i){De.call(this,t,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Ft.DefaultUp),this.updateMatrix(),this.groundColor=new ct(e)}function ke(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new h(512,512),this.map=null,this.matrix=new p}function Fe(){ke.call(this,new oe(50,1,.5,500))}function Be(t,e,i,r,n,o){De.call(this,t,e),this.type="SpotLight",this.position.copy(Ft.DefaultUp),this.updateMatrix(),this.target=new Ft,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==n?n:0,this.decay=void 0!==o?o:1,this.shadow=new Fe}function ze(t,e,i,r){De.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==r?r:1,this.shadow=new ke(new oe(90,1,.5,500))}function Ue(t){ke.call(this,new ae(-5,5,5,-5,.5,500))}function je(t,e){De.call(this,t,e),this.type="DirectionalLight",this.position.copy(Ft.DefaultUp),this.updateMatrix(),this.target=new Ft,this.shadow=new Ue}function $e(t,e){De.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Ve(t,e,i,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(i),this.sampleValues=e,this.valueSize=i}function Ge(t,e,i,r){Ve.call(this,t,e,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function He(t,e,i,r){Ve.call(this,t,e,i,r)}function We(t,e,i,r){Ve.call(this,t,e,i,r)}function Xe(t,e,i,r){if(void 0===t)throw new Error("track name is undefined");if(void 0===e||0===e.length)throw new Error("no keyframes in track named "+t);this.name=t,this.times=Qd.convertArray(e,this.TimeBufferType),this.values=Qd.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function qe(t,e,i,r){Xe.call(this,t,e,i,r)}function Ye(t,e,i,r){Ve.call(this,t,e,i,r)}function Ze(t,e,i,r){Xe.call(this,t,e,i,r)}function Ke(t,e,i,r){Xe.call(this,t,e,i,r)}function Qe(t,e,i,r){Xe.call(this,t,e,i,r)}function Je(t,e,i){Xe.call(this,t,e,i)}function ti(t,e,i,r){Xe.call(this,t,e,i,r)}function ei(t,e,i,r){Xe.apply(this,arguments)}function ii(t,e,i){this.name=t,this.tracks=i,this.duration=void 0!==e?e:-1,this.uuid=Fl.generateUUID(),this.duration<0&&this.resetDuration(),this.trim(),this.optimize()}function ri(t){this.manager=void 0!==t?t:Kd,this.textures={}}function ni(t){this.manager=void 0!==t?t:Kd}function oi(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function ai(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:Kd,this.withCredentials=!1}function si(t){this.manager=void 0!==t?t:Kd,this.texturePath=""}function ci(){}function ui(t,e){this.v1=t,this.v2=e}function li(){this.curves=[],this.autoClose=!1}function hi(t,e,i,r,n,o,a,s){this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0}function di(t){this.points=void 0===t?[]:t}function fi(t,e,i,r){this.v0=t,this.v1=e,this.v2=i,this.v3=r}function pi(t,e,i){this.v0=t,this.v1=e,this.v2=i}function mi(t,e,i,r,n,o){function a(t,e,i){return R.vertices.push(new g(t,e,i))-1}var s=this;zt.call(this),this.type="TubeGeometry",this.parameters={path:t,segments:e,radius:i,radialSegments:r,closed:n,taper:o},e=e||64,i=i||1,r=r||8,n=n||!1,o=o||mi.NoTaper;var c,u,l,d,f,p,m,v,y,b,x,_,w,S,A,M,P,C,T,E,I,L=[],R=this,O=e+1,D=new g,N=new mi.FrenetFrames(t,e,n),k=N.tangents,F=N.normals,B=N.binormals;for(this.tangents=k,this.normals=F,this.binormals=B,b=0;b<O;b++)for(L[b]=[],d=b/(O-1),y=t.getPointAt(d),c=k[b],u=F[b],l=B[b],p=i*o(d),x=0;x<r;x++)f=x/r*2*Math.PI,m=-p*Math.cos(f),v=p*Math.sin(f),D.copy(y),D.x+=m*u.x+v*l.x,D.y+=m*u.y+v*l.y,D.z+=m*u.z+v*l.z,L[b][x]=a(D.x,D.y,D.z);for(b=0;b<e;b++)for(x=0;x<r;x++)_=n?(b+1)%e:b+1,w=(x+1)%r,S=L[b][x],A=L[_][x],M=L[_][w],P=L[b][w],C=new h(b/e,x/r),T=new h((b+1)/e,x/r),E=new h((b+1)/e,(x+1)/r),I=new h(b/e,(x+1)/r),s.faces.push(new Dt(S,A,P)),s.faceVertexUvs[0].push([C,T,I]),s.faces.push(new Dt(A,M,P)),s.faceVertexUvs[0].push([T.clone(),E,I.clone()]);this.computeFaceNormals(),this.computeVertexNormals()}function gi(t,e){return"undefined"==typeof t?void(t=[]):(zt.call(this),this.type="ExtrudeGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),void this.computeFaceNormals())}function vi(t,e){zt.call(this),this.type="ShapeGeometry",Array.isArray(t)===!1&&(t=[t]),this.addShapeList(t,e),this.computeFaceNormals()}function yi(){bi.apply(this,arguments),this.holes=[]}function bi(t){li.call(this),this.currentPoint=new h,t&&this.fromPoints(t)}function xi(){this.subPaths=[],this.currentPath=null}function _i(t){this.data=t}function wi(t){this.manager=void 0!==t?t:Kd}function Si(){return void 0===nf&&(nf=new(window.AudioContext||window.webkitAudioContext)),nf}function Ai(t){this.manager=void 0!==t?t:Kd}function Mi(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new oe,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new oe,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Pi(){Ft.call(this),this.type="AudioListener",this.context=Si(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Ci(t){Ft.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(t.getInput()),this.autoplay=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Ti(t){Ci.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Ei(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Ii(t,e,i){this.binding=t,this.valueSize=i;var r,n=Float64Array;switch(e){case"quaternion":r=this._slerp;break;case"string":case"bool":n=Array,r=this._select;break;default:r=this._lerp}this.buffer=new n(4*i),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Li(t,e,i){this.path=e,this.parsedPath=i||Li.parseTrackName(e),this.node=Li.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Ri(t,e,i){this._mixer=t,this._clip=e,this._localRoot=i||null;for(var r=e.tracks,n=r.length,o=new Array(n),a={endingStart:wl,endingEnd:wl},s=0;s!==n;++s){var c=r[s].createInterpolant(null);o[s]=c,c.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(n),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=vl,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Oi(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Di(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t,this.dynamic=!1}function Ni(t,e,i,r){this.object=t,this.size=void 0!==e?e:1;var n=void 0!==i?i:16711680,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var c=new $t,u=new Ot(2*a*3,3);c.addAttribute("position",u),_e.call(this,c,new be({color:n,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function ki(t,e,i,r){this.object=t,this.size=void 0!==e?e:1;var n=void 0!==i?i:16776960,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new $t,u=new Ot(2*a*3,3);c.addAttribute("position",u),_e.call(this,c,new be({color:n,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function Fi(t){function e(t,e,r){i(t,r),i(e,r)}function i(t,e){r.vertices.push(new g),r.colors.push(new ct(e)),void 0===o[t]&&(o[t]=[]),o[t].push(r.vertices.length-1)}var r=new zt,n=new be({color:16777215,vertexColors:zc}),o={},a=16755200,s=16711680,c=43775,u=16777215,l=3355443;e("n1","n2",a),e("n2","n4",a),e("n4","n3",a),e("n3","n1",a),e("f1","f2",a),e("f2","f4",a),e("f4","f3",a),e("f3","f1",a),e("n1","f1",a),e("n2","f2",a),e("n3","f3",a),e("n4","f4",a),e("p","n1",s),e("p","n2",s),e("p","n3",s),e("p","n4",s),e("u1","u2",c),e("u2","u3",c),e("u3","u1",c),e("c","t",u),e("p","c",l),e("cn1","cn2",l),e("cn3","cn4",l),e("cf1","cf2",l),e("cf3","cf4",l),_e.call(this,r,n),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function Bi(t,e,i,r,n,o,a,s){function c(){var t=(r+1)*(n+1);return o===!1&&(t+=(r+1)*p+r*p),t}function u(){var t=r*n*2*3;return o===!1&&(t+=r*p*3),t}function l(){var o,c,u=new g,l=new g,h=0,d=(e-t)/i;for(c=0;c<=n;c++){var p=[],m=c/n,v=m*(e-t)+t;for(o=0;o<=r;o++){var C=o/r;l.x=v*Math.sin(C*s+a),l.y=-m*i+M,l.z=v*Math.cos(C*s+a),b.setXYZ(w,l.x,l.y,l.z),u.copy(l),(0===t&&0===c||0===e&&c===n)&&(u.x=Math.sin(C*s+a),u.z=Math.cos(C*s+a)),u.setY(Math.sqrt(u.x*u.x+u.z*u.z)*d).normalize(),x.setXYZ(w,u.x,u.y,u.z),_.setXY(w,C,1-m),p.push(w),w++}A.push(p)}for(o=0;o<r;o++)for(c=0;c<n;c++){var T=A[c][o],E=A[c+1][o],I=A[c+1][o+1],L=A[c][o+1];y.setX(S,T),S++,y.setX(S,E),S++,y.setX(S,L),S++,y.setX(S,E),S++,y.setX(S,I),S++,y.setX(S,L),S++,h+=6}f.addGroup(P,h,0),P+=h}function d(i){var n,o,c,u=new h,l=new g,d=0,p=i===!0?t:e,m=i===!0?1:-1;for(o=w,n=1;n<=r;n++)b.setXYZ(w,0,M*m,0),x.setXYZ(w,0,m,0),u.x=.5,u.y=.5,_.setXY(w,u.x,u.y),w++;for(c=w,n=0;n<=r;n++){var v=n/r,A=v*s+a,C=Math.cos(A),T=Math.sin(A);l.x=p*T,l.y=M*m,l.z=p*C,b.setXYZ(w,l.x,l.y,l.z),x.setXYZ(w,0,m,0),u.x=.5*C+.5,u.y=.5*T*m+.5,_.setXY(w,u.x,u.y),w++}for(n=0;n<r;n++){var E=o+n,I=c+n;i===!0?(y.setX(S,I),S++,y.setX(S,I+1),S++,y.setX(S,E),S++):(y.setX(S,I+1),S++,y.setX(S,I),S++,y.setX(S,E),S++),d+=3}f.addGroup(P,d,i===!0?1:2),P+=d}$t.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:r,heightSegments:n,openEnded:o,thetaStart:a,thetaLength:s};var f=this;t=void 0!==t?t:20,e=void 0!==e?e:20,i=void 0!==i?i:100,r=Math.floor(r)||8,n=Math.floor(n)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var p=0;o===!1&&(t>0&&p++,e>0&&p++);var m=c(),v=u(),y=new Rt(new(v>65535?Uint32Array:Uint16Array)(v),1),b=new Rt(new Float32Array(3*m),3),x=new Rt(new Float32Array(3*m),3),_=new Rt(new Float32Array(2*m),2),w=0,S=0,A=[],M=i/2,P=0;l(),o===!1&&(t>0&&d(!0),e>0&&d(!1)),this.setIndex(y),this.addAttribute("position",b),this.addAttribute("normal",x),this.addAttribute("uv",_)}function zi(t,e,i,r){function n(t){var e=t.normalize().clone();e.index=d.vertices.push(e)-1;var i=s(t)/2/Math.PI+.5,r=c(t)/Math.PI+.5;return e.uv=new h(i,1-r),e}function o(t,e,i){var r=new Dt(t.index,e.index,i.index,[t.clone(),e.clone(),i.clone()]);d.faces.push(r),w.copy(t).add(e).add(i).divideScalar(3);var n=s(w);d.faceVertexUvs[0].push([u(t.uv,t,n),u(e.uv,e,n),u(i.uv,i,n)])}function a(t,e){for(var i=Math.pow(2,e),r=n(d.vertices[t.a]),a=n(d.vertices[t.b]),s=n(d.vertices[t.c]),c=[],u=0;u<=i;u++){c[u]=[];for(var l=n(r.clone().lerp(s,u/i)),h=n(a.clone().lerp(s,u/i)),f=i-u,p=0;p<=f;p++)0===p&&u===i?c[u][p]=l:c[u][p]=n(l.clone().lerp(h,p/f))}for(var u=0;u<i;u++)for(var p=0;p<2*(i-u)-1;p++){var m=Math.floor(p/2);p%2===0?o(c[u][m+1],c[u+1][m],c[u][m]):o(c[u][m+1],c[u+1][m+1],c[u+1][m])}}function s(t){return Math.atan2(t.z,-t.x)}function c(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}function u(t,e,i){return i<0&&1===t.x&&(t=new h(t.x-1,t.y)),0===e.x&&0===e.z&&(t=new h(i/2/Math.PI+.5,t.y)),t.clone()}var l=this;zt.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:r},i=i||1,r=r||0;for(var d=this,f=0,p=t.length;f<p;f+=3)n(new g(t[f],t[f+1],t[f+2]));for(var m=this.vertices,v=[],f=0,y=0,p=e.length;f<p;f+=3,y++){var b=m[e[f]],x=m[e[f+1]],_=m[e[f+2]];v[y]=new Dt(b.index,x.index,_.index,[b.clone(),x.clone(),_.clone()])}for(var w=new g,f=0,p=v.length;f<p;f++)a(v[f],r);for(var f=0,p=this.faceVertexUvs[0].length;f<p;f++){var S=l.faceVertexUvs[0][f],A=S[0].x,M=S[1].x,P=S[2].x,C=Math.max(A,M,P),T=Math.min(A,M,P);C>.9&&T<.1&&(A<.2&&(S[0].x+=1),M<.2&&(S[1].x+=1),P<.2&&(S[2].x+=1))}for(var f=0,p=this.vertices.length;f<p;f++)l.vertices[f].multiplyScalar(i);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new ht(new g,i)}function Ui(t,e){var i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],n=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];zi.call(this,r,n,t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}function ji(t,e,i,r){zt.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r},this.fromBufferGeometry(new re(t,e,i,r))}function $i(t,e,i,r,n,o,a){Bi.call(this,0,t,e,i,r,n,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:r,thetaStart:o,thetaLength:a}}function Vi(t){if("undefined"!=typeof window){var e=new RegExp(t+"=([^&#=]*)"),i=e.exec(window.location.search);return i?decodeURIComponent(i[1]):void 0}}function Gi(t){return!!t&&("string"!=typeof t||/^1|true|t|yes|y$/i.test(t))}function Hi(t,e){return void 0!==t?t:e}function Wi(){var t=window.location.protocol;return null===t.match(/http(s)?:/gi)?"http:":t}function Xi(){if("undefined"==typeof window)return!1;var t=window.navigator.userAgent;return/Opera|OPR/.test(t)?"Opera":/Chrome/i.test(t)?"Chrome":/Firefox/i.test(t)?"Firefox":/Mobile(\/.*)? Safari/i.test(t)?"Mobile Safari":/MSIE/i.test(t)?"Internet Explorer":!!/Safari/i.test(t)&&"Safari"}function qi(t){var e=window.location,i=e.pathname,r=i.substring(0,i.lastIndexOf("/")+1);return e.origin+r+t}function Yi(t,e){function i(t){var e=window.open(t,"_blank");e||(window.location.href=t)}function r(t){i(o?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"))}if(t){e=e||"download";var n="Safari"===Xi(),o=/CriOS\/[\d]+/.test(window.navigator.userAgent),a=document.createElement("a");if("undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(t,e);else if((n||o)&&window.FileReader)if(t instanceof Blob){var s=new FileReader;s.onloadend=function(){r(s.result)},s.readAsDataURL(t)}else r(t);else t instanceof Blob&&(t=URL.createObjectURL(t)),"download"in a?(a.style.display="hidden",document.body.appendChild(a),a.href=t,a.download=e,a.target="_blank",a.click(),document.body.removeChild(a)):i(t),t instanceof Blob&&URL.revokeObjectURL(t)}}function Zi(t){var e,i,r,n=["gz"];e="undefined"!=typeof File&&t instanceof File||"undefined"!=typeof Blob&&t instanceof Blob?t.name||"":t;var o=e.lastIndexOf("?");e=e.substring(0,o===-1?e.length:o);var a=e.replace(/^.*[\\\/]/,""),s=a.substring(0,a.lastIndexOf(".")),c=a.split("."),u=c.length>1?c.pop().toLowerCase():"",l=e.match(/^(.+):\/\/(.+)$/);l&&(r=l[1].toLowerCase(),e=l[2]);var h=e.substring(0,e.lastIndexOf("/")+1);if(n.includes(u)){i=u;var d=e.length-u.length-1;u=e.substr(0,d).split(".").pop().toLowerCase();var f=s.length-u.length-1;s=s.substr(0,f)}else i=!1;return{path:e,name:a,ext:u,base:s,dir:h,compressed:i,protocol:r,src:t}}function Ki(t,e,i){var r,n,o,a=null,s=0;i||(i={});var c=function(){s=i.leading===!1?0:Date.now(),a=null,o=t.apply(r,n),a||(r=n=null)};return function(){var u=Date.now();s||i.leading!==!1||(s=u);var l=e-(u-s);return r=this,n=arguments,l<=0||l>e?(a&&(clearTimeout(a),a=null),s=u,o=t.apply(r,n),a||(r=n=null)):a||i.trailing===!1||(a=setTimeout(c,l)),o}}function Qi(t,e){return t<e?-1:t>e?1:0}function Ji(t,e,i){void 0===i&&(i=Qi);for(var r=0,n=t.length-1;r<=n;){var o=r+n>>1,a=i(e,t[o]);if(a>0)r=o+1;else{if(!(a<0))return o;n=o-1}}return-r-1}function tr(t,e){var i=t.length-1;if(t[i]<e)return-1;for(var r=0;r<=i;){var n=r+i>>1;t[n]>=e?i=n-1:r=n+1}return i+1}function er(t,e){if(t[0]>e)return-1;for(var i=0,r=t.length-1;i<=r;){var n=i+r>>1;t[n]>e?r=n-1:i=n+1}return i-1}function ir(t,e,i){var r=tr(t,e),n=er(t,i);return r===-1||n===-1||r>n?0:n-r+1}function rr(t){return t.sort().filter(function(t,e,i){return 0===e||t!==i[e-1]})}function nr(t){var e=28672;if(t.length>e){for(var i=[],r=0;r<t.length;r+=e)i.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return i.join("")}return String.fromCharCode.apply(null,t)}function or(t,e,i){e=void 0!==e?e:10485760,i=void 0!==i?i:"\n";for(var r="",n=[],o=0;o<t.length;o+=e){var a=nr(t.subarray(o,o+e)),s=a.lastIndexOf(i);if(s===-1)r+=a;else{var c=r+a.substr(0,s);n=n.concat(c.split(i)),r=s===a.length-i.length?"":a.substr(s+i.length)}}return""!==r&&n.push(r),n}function ar(t,e){switch(t){case"int8":return new Int8Array(e);case"int16":return new Int16Array(e);case"int32":return new Int32Array(e);case"uint8":return new Uint8Array(e);case"uint16":return new Uint16Array(e);case"uint32":return new Uint32Array(e);case"float32":return new Float32Array(e);default:throw"arrayType unknown: "+t}}function sr(t){return t instanceof g?t:(new g).fromArray(t)}function cr(t){return t instanceof p?t:(new p).fromArray(t)}function ur(t){return t instanceof m?t:(new m).fromArray(t)}function lr(t){return Hi(t,"").toString().toLowerCase()}function hr(t){var e=t;return t.forEach(function(t){t.__deps&&Array.prototype.push.apply(e,hr(t.__deps))}),e}function dr(t){var e=rr(hr(t));return e.map(function(t){return t.toString()}).join("\n\n\n")}function fr(t){var e=t.data.__name,i=t.data.__postId;if(void 0===e)console.error("message __name undefined");else if(void 0===self.func)console.error("worker func undefined",e);else{var r=function(t,e){t=t||{},void 0!==i&&(t.__postId=i);try{self.postMessage(t,e)}catch(e){console.error("self.postMessage:",e),self.postMessage(t)}};self.func(t,r)}}function pr(t,e){var i="'use strict';\n\n"+dr(e);return i+="\n\n\nself.func = "+t.toString()+";",i+="\n\n\nself.onmessage = "+fr.toString()+";",new Blob([i],{type:"application/javascript"})}function mr(t){return.01745*t}function gr(t){return 57.29578*t}function vr(){for(var t,e=0,i=0;i<36;i++)8===i||13===i||18===i||23===i?Np[i]="-":14===i?Np[i]="4":(e<=2&&(e=33554432+16777216*Math.random()|0),t=15&e,e>>=4,Np[i]=Dp[19===i?3&t|8:t]);return Np.join("")}function yr(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),16843009*(t+(t>>4)&252645135)>>24}function br(t,e,i){return(t-e)/(i-e)}function xr(t,e,i){return Math.max(e,Math.min(i,t))}function _r(t){return xr(t,0,1)}function wr(t,e,i){return t+(e-t)*i}function Sr(t,e,i,r,n,o){var a=(i-t)*o,s=(r-e)*o,c=n*n,u=n*c;return(2*e-2*i+a+s)*u+(-3*e+3*i-2*a-s)*c+a*n+e}function Ar(t,e,i){return i=_r(br(i,t,e)),i*i*(3-2*i)}function Mr(t,e,i,r,n){this._listener=e,this._isOnce=i,this.context=r,this._signal=t,this._priority=n||0}function Pr(t,e){if("function"!=typeof t)throw new Error("listener is a required param of {fn}() and should be a Function.".replace("{fn}",e))}function Cr(){this._bindings=[],this._prevParams=null;var t=this;this.dispatch=function(){Cr.prototype.dispatch.apply(t,arguments)}}function Tr(t){this.signals={stringChanged:new Cr},this.setString(t)}function Er(t){Wp=t}function Ir(t){Xp=t}function Lr(e){t.Debug=e}function Rr(t,e){var i=e||{};this.compressed=Hi(i.compressed,!1),this.binary=Hi(i.binary,!1),this.json=Hi(i.json,!1),this.xml=Hi(i.xml,!1),this.src=t,this.chunkSize=10485760,this.newline="\n",this.__pointer=0,this.__partialLine="",this.__srcName&&(this[this.__srcName]=t)}function Or(t,e){Rr.call(this,t,e)}function Dr(t,e){Rr.call(this,t,e)}function Nr(t){var e=Zi(t),i=Qp.get(e.protocol);return i&&(e=Zi(i.getUrl(e.src)),!e.ext&&i.getExt&&(e.ext=i.getExt(t))),e}function kr(t,e){var i,r=Object.assign(Nr(t),e);if(tm.names.includes(r.ext)?i=cm:"ngl"===r.ext?i=hm:"plugin"===r.ext&&(i=dm),i){var n=new i(r.src,r);return n.load()}return Promise.reject("autoLoad: ext '"+r.ext+"' unknown")}function Fr(){var t=arguments[0],e=Fr.cache;return e[t]&&e.hasOwnProperty(t)||(e[t]=Fr.parse(t)),Fr.format.call(null,e[t],arguments)}function Br(t){return"number"==typeof t?"number":"string"==typeof t?"string":Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function zr(t,e){return e>=0&&e<=7&&pm[t]?pm[t][e]:Array(e+1).join(t)}function Ur(t,e){function i(){f=[],n(),o(),a()}function r(t,e){return void 0!==t?t:e}function n(){f.push(Fr("TITEL %-74s",t.name))}function o(){d.forEach(function(t){f.push(Fr("REMARK %-73s",t))}),t.trajectory&&(f.push(Fr("REMARK %-73s","Trajectory '"+t.trajectory.name+"'")),f.push(Fr("REMARK %-73s","Frame "+t.trajectory.frame)))}function a(){var e=1,i=1;t.eachModel(function(t){f.push(Fr("MODEL %-74d",i++)),t.eachAtom(function(t){var i=t.hetero?m:p,n=h?e:t.serial,o=t.atomname;1===o.length&&(o=" "+o),f.push(Fr(i,n,o,t.resname,r(t.chainname," "),t.resno,t.x,t.y,t.z,r(t.occurence,1),r(t.bfactor,0),r(t.segid,""),r(t.element,""))),e+=1}),f.push(Fr("%-80s","ENDMDL")),i+=1}),f.push(Fr("%-80s","END"))}function s(){return i(),f.join("\n")}function c(){return new Blob([s()],{type:"text/plain"})}function u(t,e){t=t||"structure",e=e||"pdb";var i=t+"."+e,r=c();Yi(r,i)}var l=Object.assign({},e),h=void 0===l.renumberSerial||l.renumberSerial,d=l.remarks||[];Array.isArray(d)||(d=[d]);var f,p="ATOM  %5d %-4s %3s %1s%4d    %8.3f%8.3f%8.3f%6.2f%6.2f      %4s%2s",m="HETATM%5d %-4s %3s %1s%4d    %8.3f%8.3f%8.3f%6.2f%6.2f      %4s%2s";this.getString=s,this.getBlob=c,this.download=u}function jr(){this.signals={updated:new Cr},this.begin(),this.maxDuration=-(1/0),this.minDuration=1/0,this.avgDuration=14,this.lastDuration=1/0,this.prevFpsTime=0,this.lastFps=1/0,this.lastFrames=1,this.frames=0,this.count=0}function $r(t){if(void 0===t)return"";var e=[];for(var i in t){var r=t[i];r!==!1&&e.push("#define "+i+" "+r)}return e.join("\n")+"\n"}function Vr(t,e){e=e||{};var i=t+"|";for(var r in e)i+=r+":"+e[r];if(!ym[i]){var n=$r(e),o=em.get("shader/"+t);if(!o)throw"empty shader, '"+t+"'";o=o.replace(vm,function(t,e){var i="shader/chunk/"+e+".glsl",r=em.get(i)||Vd[e];return r?r:""}),ym[i]=n+o}return ym[i]}function Gr(t,e,i,r){function n(e){var r=e%u,n=Math.floor(e/u),o=r*m,a=n*g;i.camera.setViewOffset(m*u,g*u,o,a,m,g),i.render(),l?v.drawImage(t.domElement,Math.floor(o/2),Math.floor(a/2),Math.ceil(m/2),Math.ceil(g/2)):v.drawImage(t.domElement,Math.floor(o),Math.floor(a),Math.ceil(m),Math.ceil(g)),"function"==typeof h&&h(e+1,f,!1)}function o(){i.setSampling(y),i.camera.view=null,"function"==typeof d&&d(f+1,f,!1)}function a(){for(var t=0;t<=f;++t)t===f?o():n(t)}function s(){function t(){e===f?o():n(e),e+=1}for(var e=0,i=0;i<=f;++i)setTimeout(t,0,i)}var c=r||{},u=void 0!==c.factor?c.factor:2,l=void 0!==c.antialias&&c.antialias,h=c.onProgress,d=c.onFinish;l&&(u*=2);var f=u*u,p=document.createElement("canvas"),m=i.width,g=i.height;l?(p.width=m*u/2,p.height=g*u/2):(p.width=m*u,p.height=g*u);var v=p.getContext("2d"),y=i.sampleLevel;i.setSampling(-1),this.render=a,this.renderAsync=s,this.canvas=p}function Hr(t,e,i,r,n){i=i||1,r=r||0;var o,a,s,c=n?n.length:t.length/i,u=0,l=0;if(n)for(a=0;a<c;++a)s=(t[n[a]*i+r]+e)%e,o=s/e*Mm-Math.PI,u+=Math.cos(o),l+=Math.sin(o);else for(a=r;a<c;a+=i)s=(t[a]+e)%e,o=s/e*Mm-Math.PI,u+=Math.cos(o),l+=Math.sin(o);u/=c,l/=c;var h=Math.atan2(l,u),d=(h+Math.PI)/Mm*e;return d}function Wr(t,e,i,r){var n=t.length;i=i||new Float32Array(n),r=r||0;for(var o=0;o<n;o+=3)i[r+o+0]=(t[o+0]+e[o+0])/2,i[r+o+1]=(t[o+1]+e[o+1])/2,i[r+o+2]=(t[o+2]+e[o+2])/2;return i}function Xr(t,e){for(var i=new Float32Array(t),r=0;r<t;++r)i[r]=e;return i}function qr(t,e,i,r){for(var n,o=new Float32Array(3*t),a=0;a<t;++a)n=3*a,o[n+0]=e,o[n+1]=i,o[n+2]=r;return o}function Yr(t,e){void 0===e&&(e=0);for(var i=new Float32Array(t),r=0;r<t;++r)i[r]=e+r;return i}function Zr(t,e){for(var i=t.length,r=new Float32Array(i),n=0;n<i;n++)r[n]=Math.min(t[n],e[n]);return r}function Kr(t,e,i,r,n){for(var o=0;o<n;++o)e[r+o]=t[i+o]}function Qr(t,e,i,r){Kr(t,t,e,i,r)}function Jr(t,e,i,r){function n(e,i){d=t[e],t[e]=t[i],t[i]=d}e=e||function(t,e){return t>e?1:t<e?-1:0},i=i||0,r=(r||t.length)-1;for(var o,a,s=[],c=-1,u=i,l=r,h=0,d=0;;)if(l-u<=25){for(a=u+1;a<=l;++a){for(h=t[a],o=a-1;o>=u&&e(t[o],h)>0;)t[o+1]=t[o],--o;t[o+1]=h}if(c===-1)break;l=s[c--],u=s[c--]}else{var f=u+l>>1;for(o=u+1,a=l,n(f,o),e(t[u],t[l])>0&&n(u,l),e(t[o],t[l])>0&&n(o,l),e(t[u],t[o])>0&&n(u,o),h=t[o];;){do o++;while(e(t[o],h)<0);do a--;while(e(t[a],h)>0);if(a<o)break;n(o,a)}t[u+1]=t[a],t[a]=h,l-o+1>=a-u?(s[++c]=o,s[++c]=l,l=a-1):(s[++c]=u,s[++c]=a-1,u=o)}return t}function tn(t,e,i,r,n){var o,a,s,c,u=t.height,l=t.width,h=t.getContext("2d"),d=h.getImageData(0,0,l,u).data;for(s=!1,a=0;a<u;a++){for(o=0;o<l;o++)if(c=4*(a*l+o),d[c]!==e||d[c+1]!==i||d[c+2]!==r||d[c+3]!==n){
	s=!0;break}if(s)break}var f=a;for(s=!1,o=0;o<l;o++){for(a=0;a<u;a++)if(c=4*(a*l+o),d[c]!==e||d[c+1]!==i||d[c+2]!==r||d[c+3]!==n){s=!0;break}if(s)break}var p=o;for(s=!1,a=u-1;a>=0;a--){for(o=l-1;o>=0;o--)if(c=4*(a*l+o),d[c]!==e||d[c+1]!==i||d[c+2]!==r||d[c+3]!==n){s=!0;break}if(s)break}var m=a;for(s=!1,o=l-1;o>=0;o--){for(a=u-1;a>=0;a--)if(c=4*(a*l+o),d[c]!==e||d[c+1]!==i||d[c+2]!==r||d[c+3]!==n){s=!0;break}if(s)break}var g=o,v=document.createElement("canvas");v.width=g-p,v.height=m-f;var y=v.getContext("2d");return y.drawImage(t,p,f,v.width,v.height,0,0,v.width,v.height),v}function en(t,e){function i(e){var i=s;c&&(i*=2),e&&(i=1/i),t.scene.traverse(function(t){var e=t.material;e&&e.linewidth&&(e.linewidth*=i),e&&e.uniforms&&e.uniforms.size&&void 0===e.uniforms.size.__seen&&(e.uniforms.size.value*=i,e.uniforms.size.__seen=!0)}),t.scene.traverse(function(t){var e=t.material;e&&e.uniforms&&e.uniforms.size&&delete e.uniforms.size.__seen})}function r(t){if(a){var e=f,i=0|(u?0:255*e.r),r=0|(u?0:255*e.g),n=0|(u?0:255*e.b),o=0|(u?0:255);return tn(t,i,r,n,o)}return t}function n(t,e,i){"function"==typeof o.onProgress&&o.onProgress(t,e,i)}var o=e||{},a=void 0!==o.trim&&o.trim,s=void 0!==o.factor?o.factor:1,c=void 0!==o.antialias&&o.antialias,u=void 0!==o.transparent&&o.transparent,l=t.renderer,h=t.camera,d=l.getClearAlpha(),f=l.getClearColor();return new Promise(function(e){function o(o,s){var c=r(a.canvas);c.toBlob(function(r){l.setClearAlpha(d),i(!0),t.requestRender(),n(s,s,!0),e(r)},"image/png")}var a=new Gr(l,h,t,{factor:s,antialias:c,onProgress:n,onFinish:o});l.setClearAlpha(u?0:1),i(),a.renderAsync()})}function rn(t,e){var i;t.traverseVisible(function(t){if(t instanceof Se&&t.sortParticles){var r=t.geometry.attributes,n=r.position.count;if(0!==n){Cm.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),Tm.multiplyMatrices(e.projectionMatrix,Cm);var o,a,s,c;for(t.userData.sortData?(o=t.userData.sortData,s=o.__zArray,a=o.__sortArray,c=o.__cmpFn):(s=new Float32Array(n),a=new Uint32Array(n),c=function(t,e){var i=s[t],r=s[e];return i>r?1:i<r?-1:0},o={__zArray:s,__sortArray:a,__cmpFn:c},t.userData.sortData=o),i=0;i<n;++i)Pm.fromArray(r.position.array,3*i),Pm.applyProjection(Tm),s[i]=-Pm.z,a[i]=i;Jr(a,c);var u,l,h,d;for(var f in r){var p=r[f],m=p.array,g=p.itemSize;for(o[f]||(o[f]=new Float32Array(g*n)),d=o[f],o[f]=m,i=0;i<n;++i){u=a[i];for(var v=0;v<g;++v)l=u*g+v,h=i*g+v,d[h]=m[l]}r[f].array=d,r[f].needsUpdate=!0}}}})}function nn(t,e,i,r,n){var o=i.getSize().height,a=i.getPixelRatio(),s="OrthographicCamera"===e.type;Em.getInverse(e.projectionMatrix),Im.copy(e.projectionMatrix).transpose(),t.traverse(function(t){var e=t.material;if(e){var i=t.material.uniforms;if(i){if(e.clipNear){var c=(50-e.clipNear)/50,u=r-n*c;i.nearClip.value=u}i.canvasHeight&&(i.canvasHeight.value=o),i.pixelRatio&&(i.pixelRatio.value=a),i.projectionMatrixInverse&&i.projectionMatrixInverse.value.copy(Em),i.projectionMatrixTranspose&&i.projectionMatrixTranspose.value.copy(Im),i.ortho&&(i.ortho.value=s)}}})}function on(e){function i(){Y={fogColor:new ct(0),fogNear:50,fogFar:100,backgroundColor:new ct(0),cameraType:"perspective",cameraFov:40,cameraZ:-80,clipNear:0,clipFar:100,clipDist:10,lightColor:new ct(14540253),lightIntensity:1,ambientColor:new ct(14540253),ambientIntensity:.2,sampleLevel:0}}function r(){var t=new g(0,0,0);K=new oe(Y.cameraFov,U/j),K.position.z=Y.cameraZ,K.lookAt(t),Q=new ae(U/-2,U/2,j/2,j/-2),Q.position.z=Y.cameraZ,Q.lookAt(t),J="orthographic"===Y.cameraType?Q:K,J.updateProjectionMatrix()}function n(){var t=window.devicePixelRatio;try{ft=new se({preserveDrawingBuffer:!0,alpha:!0,antialias:!0})}catch(t){return B.innerHTML=Yp,!1}ft.setPixelRatio(t),ft.setSize(U,j),ft.autoClear=!1,ft.sortObjects=!0,Ir(ft.extensions.get("EXT_frag_depth")),ft.extensions.get("OES_element_index_uint"),Er(ft.extensions.get("OES_texture_float")&&ft.extensions.get("WEBGL_color_buffer_float")||"Chrome"===Gp&&ft.extensions.get("OES_texture_float")),B.appendChild(ft.domElement);var e=U*t,i=j*t;ft.extensions.get("OES_texture_float"),pt=ft.extensions.get("OES_texture_half_float"),ft.extensions.get("WEBGL_color_buffer_float"),mt=new nt(e,i,{minFilter:ku,magFilter:ku,stencilBuffer:!1,format:il,type:Wp?qu:$u}),mt.texture.generateMipmaps=!1,gt=new nt(e,i,{minFilter:ku,magFilter:ku,format:il}),vt=new nt(e,i,{minFilter:ku,magFilter:ku,format:il,type:Hp?$u:pt?Yu:Wp?qu:$u}),yt={tForeground:{type:"t",value:null},scale:{type:"f",value:1}},bt=new st({uniforms:yt,vertexShader:Vr("Quad.vert"),fragmentShader:Vr("Quad.frag"),premultipliedAlpha:!0,transparent:!0,blending:Vc,depthTest:!1,depthWrite:!1}),xt=new ae(-1,1,1,-1,0,1),_t=(new le).add(new ie(new ji(2,2),bt))}function o(){tt||(tt=new le),rt=new Ae,rt.name="rotationGroup",tt.add(rt),ot=new Ae,ot.name="translationGroup",rt.add(ot),at=new Ae,at.name="modelGroup",ot.add(at),ut=new Ae,ut.name="pickingGroup",ot.add(ut),ht=new Ae,ht.name="backgroundGroup",ot.add(ht),dt=new Ae,dt.name="helperGroup",ot.add(dt),tt.fog=new ue,et=new Be(Y.lightColor,Y.lightIntensity),tt.add(et),it=new $e(Y.ambientLight,Y.ambientIntensity),tt.add(it)}function a(){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new Float32Array(24),i=new $t;i.setIndex(new Rt(t,1)),i.addAttribute("position",new Rt(e,3));var r=new st({uniforms:{uColor:{value:new ct("skyblue")}},vertexShader:Vr("BasicLine.vert"),fragmentShader:Vr("BasicLine.frag"),linewidth:2});wt=new _e(i,r),dt.add(wt)}function s(){var t=wt.geometry.attributes.position,e=t.array,i=St.min,r=St.max;e[0]=r.x,e[1]=r.y,e[2]=r.z,e[3]=i.x,e[4]=r.y,e[5]=r.z,e[6]=i.x,e[7]=i.y,e[8]=r.z,e[9]=r.x,e[10]=i.y,e[11]=r.z,e[12]=r.x,e[13]=r.y,e[14]=i.z,e[15]=i.x,e[16]=r.y,e[17]=i.z,e[18]=i.x,e[19]=i.y,e[20]=i.z,e[21]=r.x,e[22]=i.y,e[23]=i.z,t.needsUpdate=!0,St.isEmpty()||wt.geometry.computeBoundingSphere()}function c(){Z=new jr}function u(e,i){i?i.forEach(function(t){l(e,t)}):l(e),e.background?(ht.add(e.group),ht.add(e.wireframeGroup)):(at.add(e.group),at.add(e.wireframeGroup)),e.pickable&&ut.add(e.pickingGroup),t.Debug&&s()}function l(t,e){function i(t){"Group"===t.type?t.children.forEach(function(t){t.userData.instance=e}):t.userData.instance=e}var r=t.getMesh();r.userData.buffer=t,e&&(r.applyMatrix(e.matrix),i(r)),t.group.add(r);var n=t.getWireframeMesh();if(n.userData.buffer=t,e&&(n.matrix.copy(r.matrix),n.position.copy(r.position),n.quaternion.copy(r.quaternion),n.scale.copy(r.scale),i(n)),t.wireframeGroup.add(n),t.pickable){var o=t.getPickingMesh();o.userData.buffer=t,e&&(o.matrix.copy(r.matrix),o.position.copy(r.position),o.quaternion.copy(r.quaternion),o.scale.copy(r.scale),i(o)),t.pickingGroup.add(o)}e?d(t.geometry,e.matrix):d(t.geometry)}function h(e){ot.children.forEach(function(t){t.remove(e.group),t.remove(e.wireframeGroup)}),e.pickable&&ut.remove(e.pickingGroup),d(),t.Debug&&s()}function d(t,e){function i(t,e){if(0!==t.attributes.position.count){t.boundingBox||t.computeBoundingBox();var i;e?(i=t.boundingBox.clone(),i.applyMatrix4(e)):i=t.boundingBox,i.min.equals(i.max)&&i.expandByScalar(5),St.expandByPoint(i.min),St.expandByPoint(i.max)}}function r(t){if(void 0!==t.geometry){var e;t.userData.instance&&(e=t.userData.instance.matrix),i(t.geometry,e)}}t?Array.isArray(t)?t.forEach(function(t){i(t,e)}):i(t,e):(St.makeEmpty(),at.traverse(r),ht.traverse(r)),St.size(At),Mt=At.length()}function f(){return new Promise(function(t){ft.domElement.toBlob(t,"image/png")})}function p(t){return en(this,t)}function m(t,e,i,r){var n=Y;void 0!==t&&n.lightColor.set(t),void 0!==e&&(n.lightIntensity=e),void 0!==i&&n.ambientColor.set(i),void 0!==r&&(n.ambientIntensity=r),C()}function v(t,e,i){var r=Y;void 0!==t&&r.fogColor.set(t),void 0!==e&&(r.fogNear=e),void 0!==i&&(r.fogFar=i),C()}function y(t){var e=Y;t&&e.backgroundColor.set(t),v(e.backgroundColor),ft.setClearColor(e.backgroundColor,0),ft.domElement.style.backgroundColor=e.backgroundColor.getStyle(),C()}function b(t){void 0!==t&&(Y.sampleLevel=t,H=t),C()}function x(t,e){var i=Y;t&&(i.cameraType=t),e&&(i.cameraFov=e),"orthographic"===i.cameraType?J!==Q&&(J=Q,J.position.copy(K.position),J.up.copy(K.up),T()):J!==K&&(J=K,J.position.copy(Q.position),J.up.copy(Q.up)),K.fov=i.cameraFov,J.updateProjectionMatrix(),C()}function _(t,e,i){var r=Y;void 0!==t&&(r.clipNear=t),void 0!==e&&(r.clipFar=e),void 0!==i&&(r.clipDist=i),C()}function w(t,e){U=t||1,j=e||1,K.aspect=U/j,Q.left=-U/2,Q.right=U/2,Q.top=j/2,Q.bottom=-j/2,J.updateProjectionMatrix();var i=window.devicePixelRatio;ft.setPixelRatio(i),ft.setSize(U,j);var r=U*i,n=j*i;mt.setSize(r,n),gt.setSize(r,n),vt.setSize(r,n),C()}function S(){if(B===document.body)w(window.innerWidth,window.innerHeight);else{var t=B.getBoundingClientRect();w(t.width,t.height)}}function A(t){var e=Ct.memory,i=Ct.render;if(t)e.programs=0,e.geometries=0,e.textures=0,i.calls=0,i.vertices=0,i.faces=0,i.points=0;else{var r=ft.info,n=r.memory,o=r.render;e.programs=n.programs,e.geometries=n.geometries,e.textures=n.textures,i.calls+=o.calls,i.vertices+=o.vertices,i.faces+=o.faces,i.points+=o.points}}function M(){z.ticked.dispatch(Z);var e=performance.now()-Z.startTime;if(e>500&&!W&&H<3&&H!==-1){var i=H;H=3,G=!0,k(),W=!0,H=i,t.Debug&&qp.log("rendered still frame")}requestAnimationFrame(M)}function P(t,e){t*=window.devicePixelRatio,e*=window.devicePixelRatio;var i,r,n,o=Wp?Lm:Rm;return k(!0),ft.readRenderTargetPixels(mt,t,e,1,1,o),i=Wp?Math.round(255*o[0])<<16&16711680|Math.round(255*o[1])<<8&65280|255&Math.round(255*o[2]):o[0]<<16|o[1]<<8|o[2],r=ut.getObjectById(Math.round(o[3])),r&&r.userData.instance&&(n=r.userData.instance),{gid:i,instance:n}}function C(){G||(performance.now()-Z.startTime>22&&(Z.begin(),W=!1),G=!0,requestAnimationFrame(function(){k(),Z.update()}))}function T(){var t=mr(K.fov),e=2*Math.tan(t/2)*-J.position.z;Q.zoom=j/e}function E(){var t=Y;X=Pt.copy(J.position).length(),X||(J.position.set(0,0,t.cameraZ),X=Math.abs(t.cameraZ)),q=Math.max(10,.5*Mt),q+=St.center(Pt).length(),(q===1/0||q===-(1/0)||isNaN(q))&&(q=50);var e=(50-t.clipNear)/50,i=-(50-t.clipFar)/50;J.near=X-q*e,J.far=X+q*i;var r=(50-t.fogNear)/50,n=-(50-t.fogFar)/50,o=tt.fog;o.color.set(t.fogColor),o.near=X-q*r,o.far=X+q*n,"PerspectiveCamera"===J.type?(J.near=Math.max(.1,t.clipDist,J.near),J.far=Math.max(1,J.far),o.near=Math.max(.1,o.near),o.far=Math.max(1,o.far)):"OrthographicCamera"===J.type&&0===t.clipNear&&t.clipDist>0&&X+J.zoom>2*-t.clipDist&&(J.near+=J.zoom+t.clipDist)}function I(){J.updateMatrix(),J.updateMatrixWorld(!0),J.matrixWorldInverse.getInverse(J.matrixWorld),J.updateProjectionMatrix(),nn(tt,J,ft,X,q),rn(tt,J)}function L(t,e,i,r){at.visible=t,ut.visible=e,ht.visible=i,dt.visible=r}function R(){Pt.copy(J.position).setLength(100*Mt),et.position.copy(J.position).add(Pt),et.color.set(Y.lightColor),et.intensity=Y.lightIntensity,it.color.set(Y.ambientColor),it.intensity=Y.ambientIntensity}function O(){ft.clearTarget(mt),L(!1,!0,!1,!1),ft.render(tt,J,mt),A(),ft.setRenderTarget(null)}function D(e){e?ft.clearTarget(e):ft.clear(),L(!1,!1,!0,!1),ft.render(tt,J,e),e?ft.clearTarget(e,!1,!0,!1):ft.clearDepth(),A(),L(!0,!1,!1,t.Debug),ft.render(tt,J,e),A()}function N(){var t=Am[Math.max(0,Math.min(H,5))],e=1/t.length,i=1/32;yt.tForeground.value=gt.texture;for(var r=gt.width,n=gt.height,o=0;o<t.length;++o){var a=t[o];J.setViewOffset(r,n,a[0],a[1],r,n),I();var s=e,c=-.5+(o+.5)/t.length;s+=i*c,yt.scale.value=s,D(gt),ft.render(_t,xt,vt,0===o)}yt.scale.value=1,yt.tForeground.value=vt.texture,ft.render(_t,xt,null,!0),J.view=null}function k(t){return V?void qp.warn("tried to call 'render' from within 'render'"):(V=!0,E(),I(),R(),A(!0),t?O():H>0?N():D(),V=!1,void(G=!1))}function F(){qp.log("scene cleared"),tt.remove(rt),o(),ft.clear()}var B,z={ticked:new Cr};B="string"==typeof e?document.getElementById(e):e instanceof Element?e:document.createElement("div");var U,j;if(B===document.body)U=window.innerWidth||1,j=window.innerHeight||1;else{var $=B.getBoundingClientRect();U=$.width||1,j=$.height||1}var V,G,H,W,X,q,Y;i();var Z;c();var K,Q,J;r();var tt,et,it,rt,ot,at,ut,ht,dt;o();var ft,pt,mt,gt,vt,yt,bt,xt,_t;if(n()===!1)return this.container=B,void qp.error("Viewer: could not initialize renderer");var wt,St=new lt,At=new g,Mt=0;a(),y(),v();var Pt=new g,Ct={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};this.container=B,this.stats=Z,this.signals=z,this.rotationGroup=rt,this.translationGroup=ot,this.add=u,this.remove=h,this.clear=F,this.getImage=f,this.makeImage=p,this.setLight=m,this.setFog=v,this.setBackground=y,this.setSampling=b,this.setCamera=x,this.setClip=_,this.setSize=w,this.handleResize=S,this.pick=P,this.requestRender=C,this.render=k,this.animate=M,this.updateZoom=T,this.updateHelper=s,this.renderer=ft,this.scene=tt,this.perspectiveCamera=K,this.boundingBox=St,Object.defineProperties(this,{camera:{get:function(){return J}},width:{get:function(){return U}},height:{get:function(){return j}},sampleLevel:{get:function(){return H}}})}function an(t,e){this.count=0,this.words=new Uint32Array(8),this.resize(t),e&&this.flip_all()}function sn(t,e){this.type=t,this.scale=e||1,this.max=10}function cn(t){var e,i=t.length,r=t.length/3,n=0,o=0,a=0;for(e=0;e<i;e+=3)n+=t[e+0],o+=t[e+1],a+=t[e+2];return new g(n/r,o/r,a/r)}function un(t,e,i){return i?t.sub(i).projectOnVector(e).add(i):t.projectOnVector(e),t}function ln(t){for(var e=+(1/0),i=+(1/0),r=+(1/0),n=-(1/0),o=-(1/0),a=-(1/0),s=0,c=t.length;s<c;s+=3){var u=t[s],l=t[s+1],h=t[s+2];u<e&&(e=u),l<i&&(i=l),h<r&&(r=h),u>n&&(n=u),l>o&&(o=l),h>a&&(a=h)}return[pn([e,i,r]),pn([n,o,a])]}function hn(t,e){for(var i=0,r=e.length;i<r;i+=3){var n=e[i],o=e[i+1],a=e[i+2];e[i]=t[0]*n+t[4]*o+t[8]*a+t[12],e[i+1]=t[1]*n+t[5]*o+t[9]*a+t[13],e[i+2]=t[2]*n+t[6]*o+t[10]*a+t[14]}}function dn(t,e){for(var i=0,r=e.length;i<r;i+=3){var n=e[i],o=e[i+1],a=e[i+2];e[i]=t[0]*n+t[3]*o+t[6]*a,e[i+1]=t[1]*n+t[4]*o+t[7]*a,e[i+2]=t[2]*n+t[5]*o+t[8]*a}}function fn(t){for(var e=0,i=t.length;e<i;e+=3){var r=t[e],n=t[e+1],o=t[e+2],a=1/Math.sqrt(r*r+n*n+o*o);t[e]=r*a,t[e+1]=n*a,t[e+2]=o*a}}function pn(t){return new Float32Array(t||3)}function mn(t,e,i){var r=e[0],n=e[1],o=e[2],a=i[0],s=i[1],c=i[2];t[0]=n*c-o*s,t[1]=o*a-r*c,t[2]=r*s-n*a}function gn(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2]}function vn(t,e,i){t[0]=e[i],t[1]=e[i+1],t[2]=e[i+2]}function yn(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}function bn(t,e,i){xn(t,e,1/i)}function xn(t,e,i){t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i}function _n(t,e){xn(t,e,1/yn(e))}function wn(t,e,i){t[0]=e[0]-i,t[1]=e[1]-i,t[2]=e[2]-i}function Sn(t,e,i){t[0]=e[0]+i,t[1]=e[1]+i,t[2]=e[2]+i}function An(t,e){t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2])}function Mn(t,e){t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2])}function Pn(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2]}function Cn(t,e){this.cols=t,this.rows=e,this.size=this.cols*this.rows,this.data=new Float32Array(this.size)}function Tn(t,e){for(var i=0,r=0,n=e.rows,o=e.cols,a=0,s=0,c=0,u=e.data,l=t.data;i<n;s+=1,a+=o,i++)for(c=s,r=0;r<o;c+=n,r++)l[c]=u[a+r]}function En(t,e,i){for(var r=0,n=0,o=0,a=0,s=0,c=0,u=0,l=e.cols,h=e.rows,d=i.rows,f=e.data,p=i.data,m=t.data,g=0;r<h;a+=l,r++)for(c=0,n=0;n<d;u++,n++){for(s=a,g=0,o=0;o<l;s++,c++,o++)g+=f[s]*p[c];m[u]=g}}function In(t,e){var i=t.data,r=e.data,n=i[4],o=i[8],a=i[5],s=i[7],c=i[0],u=c*n,l=c*a,h=i[3],d=i[1],f=h*d,p=i[2],m=h*p,g=i[6],v=g*d,y=g*p,b=1/(u*o-l*s-f*o+m*s+v*a-y*n);r[0]=(n*o-a*s)*b,r[1]=-(d*o-p*s)*b,r[2]=-(-d*a+p*n)*b,r[3]=-(h*o-a*g)*b,r[4]=(c*o-y)*b,r[5]=-(l-m)*b,r[6]=-(-h*s+n*g)*b,r[7]=-(c*s-v)*b,r[8]=(u-f)*b}function Ln(t){var e=t.data;return e[0]*e[4]*e[8]-e[0]*e[5]*e[7]-e[3]*e[1]*e[8]+e[3]*e[2]*e[7]+e[6]*e[1]*e[5]-e[6]*e[2]*e[4]}function Rn(t,e,i){var r=t.data,n=e.data,o=i.data,a=n[0],s=n[1],c=n[2],u=n[3],l=n[4],h=n[5],d=n[6],f=n[7],p=n[8],m=o[0],g=o[1],v=o[2],y=o[3],b=o[4],x=o[5],_=o[6],w=o[7],S=o[8];r[0]=a*m+s*y+c*_,r[1]=a*g+s*b+c*w,r[2]=a*v+s*x+c*S,r[3]=u*m+l*y+h*_,r[4]=u*g+l*b+h*w,r[5]=u*v+l*x+h*S,r[6]=d*m+f*y+p*_,r[7]=d*g+f*b+p*w,r[8]=d*v+f*x+p*S}function On(t){var e,i,r=0,n=t.rows,o=t.cols,a=t.data,s=new Array(o);for(i=0;i<o;++i)s[i]=0;for(e=0;e<n;++e)for(i=0;i<o;++i,++r)s[i]+=a[r];for(i=0;i<o;++i)s[i]/=n;return s}function Dn(t,e){var i,r,n=0,o=t.rows,a=t.cols,s=t.data;for(i=0;i<o;++i)for(r=0;r<a;++r,++n)s[n]-=e[r]}function Nn(t,e){var i,r,n=0,o=t.rows,a=t.cols,s=t.data;for(i=0;i<o;++i)for(r=0;r<a;++r,++n)s[n]+=e[r]}function kn(t,e,i,r){r=t[e],t[e]=t[i],t[i]=r}function Fn(t,e){return t=Math.abs(t),e=Math.abs(e),t>e?(e/=t,t*Math.sqrt(1+e*e)):e>0?(t/=e,e*Math.sqrt(1+t*t)):0}function Bn(t,e,i,r,n,o,a,s){for(var c=2*Qg,u=Jg,l=0,h=0,d=0,f=0,p=Math.max(o,30),m=0,g=0,v=0,y=0,b=0,x=0,_=0,w=0,S=0,A=0,M=0,P=0,C=0,T=0,E=0,I=0,L=0,R=4660,O=0,D=0,N=0,k=new Float64Array(a<<3);l<a;l++){for(d=0,M=0;d<o;d++)w=t[l*e+d],M+=w*w;if(k[l]=M,r){for(d=0;d<a;d++)r[l*n+d]=0;r[l*n+l]=1}}for(;f<p;f++){for(b=0,l=0;l<a-1;l++)for(h=l+1;h<a;h++){for(m=l*e|0,g=h*e|0,E=k[l],I=0,L=k[h],d=2,I+=t[m]*t[g],I+=t[m+1]*t[g+1];d<o;d++)I+=t[m+d]*t[g+d];if(!(Math.abs(I)<=c*Math.sqrt(E*L))){for(I*=2,P=E-L,C=Fn(I,P),P<0?(T=.5*(C-P),_=Math.sqrt(T/C),x=I/(C*_*2)):(x=Math.sqrt((C+P)/(2*C)),_=I/(C*x*2)),E=0,L=0,d=2,S=x*t[m]+_*t[g],A=-_*t[m]+x*t[g],t[m]=S,t[g]=A,E+=S*S,L+=A*A,S=x*t[m+1]+_*t[g+1],A=-_*t[m+1]+x*t[g+1],t[m+1]=S,t[g+1]=A,E+=S*S,L+=A*A;d<o;d++)S=x*t[m+d]+_*t[g+d],A=-_*t[m+d]+x*t[g+d],t[m+d]=S,t[g+d]=A,E+=S*S,L+=A*A;if(k[l]=E,k[h]=L,b=1,r)for(v=l*n|0,y=h*n|0,d=2,S=x*r[v]+_*r[y],A=-_*r[v]+x*r[y],r[v]=S,r[y]=A,S=x*r[v+1]+_*r[y+1],A=-_*r[v+1]+x*r[y+1],r[v+1]=S,r[y+1]=A;d<a;d++)S=x*r[v+d]+_*r[y+d],A=-_*r[v+d]+x*r[y+d],r[v+d]=S,r[y+d]=A}}if(0===b)break}for(l=0;l<a;l++){for(d=0,M=0;d<o;d++)w=t[l*e+d],M+=w*w;k[l]=Math.sqrt(M)}for(l=0;l<a-1;l++){for(h=l,d=l+1;d<a;d++)k[h]<k[d]&&(h=d);if(l!=h&&(kn(k,l,h,M),r)){for(d=0;d<o;d++)kn(t,l*e+d,h*e+d,w);for(d=0;d<a;d++)kn(r,l*n+d,h*n+d,w)}}for(l=0;l<a;l++)i[l]=k[l];if(r)for(l=0;l<s;l++){for(M=l<a?k[l]:0;M<=u;){for(D=1/o,d=0;d<o;d++)R=214013*R+2531011,O=0!==(R>>16&32767&256)?D:-D,t[l*e+d]=O;for(f=0;f<2;f++)for(h=0;h<l;h++){for(M=0,d=0;d<o;d++)M+=t[l*e+d]*t[h*e+d];for(N=0,d=0;d<o;d++)w=t[l*e+d]-M*t[h*e+d],t[l*e+d]=w,N+=Math.abs(w);for(N=N?1/N:0,d=0;d<o;d++)t[l*e+d]*=N}for(M=0,d=0;d<o;d++)w=t[l*e+d],M+=w*w;M=Math.sqrt(M)}for(_=1/M,d=0;d<o;d++)t[l*e+d]*=_}}function zn(t,e,i,r){var n=0,o=0,a=t.rows,s=t.cols,c=a,u=s;c<u&&(n=1,o=c,c=u,u=o);var l=new Cn(c,c),h=new Cn(1,u),d=new Cn(u,u);if(0===n)Tn(l,t);else{for(o=0;o<s*a;o++)l.data[o]=t.data[o];for(;o<u*c;o++)l.data[o]=0}if(Bn(l.data,c,h.data,d.data,u,c,u,c),e){for(o=0;o<u;o++)e.data[o]=h.data[o];for(;o<s;o++)e.data[o]=0}0===n?(i&&Tn(i,l),r&&Tn(r,d)):(i&&Tn(i,d),r&&Tn(r,l))}function Un(){return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}function jn(t,e,i,r,n,o,a,s,c,u,l,h,d,f,p,m,g){t[0]=e,t[4]=i,t[8]=r,t[12]=n,t[1]=o,t[5]=a,t[9]=s,t[13]=c,t[2]=u,t[6]=l,t[10]=h,t[14]=d,t[3]=f,t[7]=p,t[11]=m,t[15]=g}function $n(t,e,i){var r=e[0],n=e[4],o=e[8],a=e[12],s=e[1],c=e[5],u=e[9],l=e[13],h=e[2],d=e[6],f=e[10],p=e[14],m=e[3],g=e[7],v=e[11],y=e[15],b=i[0],x=i[4],_=i[8],w=i[12],S=i[1],A=i[5],M=i[9],P=i[13],C=i[2],T=i[6],E=i[10],I=i[14],L=i[3],R=i[7],O=i[11],D=i[15];t[0]=r*b+n*S+o*C+a*L,t[4]=r*x+n*A+o*T+a*R,t[8]=r*_+n*M+o*E+a*O,t[12]=r*w+n*P+o*I+a*D,t[1]=s*b+c*S+u*C+l*L,t[5]=s*x+c*A+u*T+l*R,t[9]=s*_+c*M+u*E+l*O,t[13]=s*w+c*P+u*I+l*D,t[2]=h*b+d*S+f*C+p*L,t[6]=h*x+d*A+f*T+p*R,t[10]=h*_+d*M+f*E+p*O,t[14]=h*w+d*P+f*I+p*D,t[3]=m*b+g*S+v*C+y*L,t[7]=m*x+g*A+v*T+y*R,t[11]=m*_+g*M+v*E+y*O,t[15]=m*w+g*P+v*I+y*D}function Vn(t,e,i,r){jn(t,e,0,0,0,0,i,0,0,0,0,r,0,0,0,0,1)}function Gn(t,e,i,r){jn(t,1,0,0,e,0,1,0,i,0,0,1,r,0,0,0,1)}function Hn(t,e){var i=Math.cos(e),r=Math.sin(e);jn(t,i,0,r,0,0,1,0,0,-r,0,i,0,0,0,0,1)}function Wn(){return new Float32Array([1,0,0,0,1,0,0,0,1])}function Xn(t,e){var i=pn([e[0],e[1],e[2]]),r=pn([e[4],e[5],e[6]]),n=pn([e[8],e[9],e[10]]),o=pn();mn(o,r,n),t[0]=o[0],t[1]=o[1],t[2]=o[2],mn(o,n,i),t[3]=o[0],t[4]=o[1],t[5]=o[2],mn(o,i,r),t[6]=o[0],t[7]=o[1],t[8]=o[2]}function qn(t,e){function i(t,e,i,r){for(var n=r*r,a=Math.max(0,t-r-s>>o),f=Math.max(0,e-r-c>>o),p=Math.max(0,i-r-u>>o),y=Math.min(l,t+r-s>>o),x=Math.min(h,e+r-c>>o),_=Math.min(d,i+r-u>>o),w=[],S=a;S<=y;++S)for(var A=f;A<=x;++A)for(var P=p;P<=_;++P){var T=(S*h+A)*d+P,I=b[T];if(I>0)for(var L=I-1,R=C[L],O=M[L],D=R+O,N=R;N<D;++N){var k=E[N],F=m[k]-t,B=g[k]-e,z=v[k]-i;F*F+B*B+z*z<=n&&w.push(k)}}return w}var r,n,o=3,a=e,s=a.min.x,c=a.min.y,u=a.min.z,l=(a.max.x-s>>o)+1,h=(a.max.y-c>>o)+1,d=(a.max.z-u>>o)+1,f=l*h*d,p=t.count,m=t.x,g=t.y,v=t.z,y=0,b=new Uint32Array(f),x=new Int32Array(p);for(r=0;r<p;++r){var _=m[r]-s>>o,w=g[r]-c>>o,S=v[r]-u>>o,A=(_*h+w)*d+S;1===(b[A]+=1)&&(y+=1),x[r]=A}var M=new Uint16Array(y);for(r=0,n=0;r<f;++r){var P=b[r];P>0&&(b[r]=n+1,M[n]=P,n+=1)}var C=new Uint32Array(y);for(r=1;r<y;++r)C[r]+=C[r-1]+M[r-1];var T=new Uint16Array(y),E=new Int32Array(p);for(r=0;r<p;++r){var I=b[x[r]];if(I>0){var L=I-1;E[C[L]+T[L]]=r,T[L]+=1}}this.within=i}function Yn(e,i){t.Debug&&qp.time("BondHash init");var r,n=e.count,o=e.atomIndex1,a=e.atomIndex2,s=new Uint8Array(i),c=new Int32Array(i);for(r=0;r<n;++r)s[o[r]]+=1,s[a[r]]+=1;for(r=1;r<i;++r)c[r]+=c[r-1]+s[r-1];for(var u=2*n,l=new Int32Array(u),h=0;h<u;++h)l[h]=-1;for(r=0;r<n;++r){for(var d=o[r],f=a[r],p=c[d];l[p]!==-1;)p+=1;l[p]=r;for(var m=c[f];l[m]!==-1;)m+=1;l[m]=r}t.Debug&&qp.timeEnd("BondHash init"),this.countArray=s,this.offsetArray=c,this.indexArray=l}function Zn(t){Number.isInteger(t)?this.init(t):this.init(0)}function Kn(t){Zn.call(this,t)}function Qn(t){Zn.call(this,t)}function Jn(t){Zn.call(this,t)}function to(t){Zn.call(this,t)}function eo(t){Zn.call(this,t)}function io(t){this.polymer=t,this.size=t.residueCount}function ro(t){this.polymer=t,this.helixorient=new io(t),this.position=this.helixorient.getPosition()}function no(t){this.content=[],this.scoreFunction=t}function oo(t,e){function i(e,r,n,o){e>s&&(s=e);var a=o-n;if(0===a)return-1;var u=4*h;if(h+=1,1===a)return l[u]=n,l[u+1]=-1,l[u+2]=-1,l[u+3]=r,u;var f=n+Math.floor(a/2);d=e%3;for(var p,m,g,v,y,b=n,x=o-1;x>b;){for(g=b+x>>1,v=t[3*c[g]+d],m=c[g],c[g]=c[x],c[x]=m,y=b,p=b;p<x;++p)t[3*c[p]+d]<v&&(m=c[y],c[y]=c[p],c[p]=m,++y);if(m=c[x],c[x]=c[y],c[y]=m,g=y,f===g)break;f<g?x=g-1:b=g+1}return l[u]=f,l[u+1]=i(e+1,u,n,f),l[u+2]=i(e+1,u,f+1,o),l[u+3]=r,u}function r(t){var e=l[t+3];return e===-1?0:r(e)+1}function n(i,n,o){function a(u){function h(t,e){s.push([t,e]),s.size()>n&&s.pop()}var d,f,p=r(u)%3,m=3*c[l[u]],g=[t[m+0],t[m+1],t[m+2]],v=e(i,g),y=l[u+1],b=l[u+2];if(b===-1&&y===-1)return void((s.size()<n||v<s.peek()[1])&&v<=o&&h(u,v));d=b===-1?y:y===-1?b:i[p]<=t[m+p]?y:b,a(d),(s.size()<n||v<s.peek()[1])&&v<=o&&h(u,v);for(var x=[],_=0;_<3;_+=1)_===p?x[_]=i[_]:x[_]=t[m+_];var w=e(x,g);(s.size()<n||Math.abs(w)<s.peek()[1])&&Math.abs(w)<=o&&(f=d===y?b:y,f!==-1&&a(f))}var s=new no(function(t){return-t[1]});a(f);for(var u=[],h=0,d=Math.min(s.size(),n);h<d;h+=1)u.push(s.content[h]);return u}function o(e,i){var r=1;if(void 0===e&&(e=f,i=0),e===-1)throw"node is null";var n=i%3,a=l[e+1],s=l[e+2];if(a!==-1){if(t[3*c[l[a]]+n]>t[3*c[l[e]]+n])throw"left child is > parent!";r+=o(a,i+1)}if(s!==-1){if(t[3*c[l[s]]+n]<t[3*c[l[e]]+n])throw"right child is < parent!";r+=o(s,i+1)}return r}for(var a=t.length/3,s=0,c=new Uint32Array(a),u=0;u<a;++u)c[u]=u;var l=new Int32Array(4*a),h=0,d=0,f=i(0,-1,0,a);this.rootIndex=f,this.maxDepth=s,this.nearest=n,this.indices=c,this.nodes=l,this.verify=o}function ao(e,i){t.Debug&&qp.time("Kdtree build");var r;r=i?function(t,e){var i=t[0]-e[0],r=t[1]-e[1],n=t[2]-e[2];return i*i+r*r+n*n}:function(t,e){var i=t[0]-e[0],r=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(i*i+r*r+n*n)};var n=new Float32Array(3*e.atomCount),o=new Uint32Array(e.atomCount),a=0;e.eachAtom(function(t){n[a+0]=t.x,n[a+1]=t.y,n[a+2]=t.z,o[a/3]=t.index,a+=3}),this.atomIndices=o,this.points=n,this.kdtree=new oo(n,r),t.Debug&&qp.timeEnd("Kdtree build")}function so(t){var e=nv[t],i={};if(void 0===e)return console.warn("getSymmetryOperations: spacegroup '"+t+"' not found in symop library"),i;for(var r=[],n=0,o=e.length;n<o;n+=3){for(var a=[],s=0;s<3;++s)a.push(rv[e[n+s]]);r.push(a)}var c=/^[1-9]$/;return r.forEach(function(t){var e=0,r=(new p).set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1),n=r.elements;i[t]=r,t.forEach(function(t){for(var i=!1,r=!1,o=0,a=t.length;o<a;++o){var s=t[o];if("-"===s)i=!0;else if("+"===s)i=!1;else if("/"===s)r=!0;else if("X"===s)n[0+e]=i?-1:1;else if("Y"===s)n[4+e]=i?-1:1;else if("Z"===s)n[8+e]=i?-1:1;else if(c.test(s)){var u=parseInt(s);r?n[12+e]/=u:n[12+e]=u}else qp.warn("getSymmetryOperations: unknown token '"+s+"'")}e+=1})}),i}function co(t){var e="";return t.length>0&&(e=":"+rr(t).join(" OR :")),new Tr(e)}function uo(e,i){if(i){t.Debug&&qp.time("assignSecondaryStructure");var r=[];e.eachModel(function(t){t.eachChain(function(t){r.push(t.chainname)})});var n=r.slice().sort(),o=[];n.forEach(function(t){o.push(r.indexOf(t))});var a=i.helices;a=a.filter(function(t){return Ji(n,t[0])>=0}),a.sort(function(t,e){var i=t[0],r=e[0],a=t[1],s=e[1];if(i===r)return a===s?0:a<s?-1:1;var c=Ji(n,i),u=Ji(n,r);return o[c]<o[u]?-1:1});var s=e.residueStore;e.eachModel(function(t){var e=0,i=a.length;if(0!==i){var r=a[e],n=!1,o=!1;t.eachChain(function(t){var c=!1;if(t.chainname===r[0])for(var u=t.residueCount,l=t.residueOffset,h=l+u,d=l;d<h;++d)if(s.resno[d]===r[1]&&s.getInscode(d)===r[2]&&(n=!0),n&&(s.sstruc[d]=r[6],s.resno[d]===r[4]&&s.getInscode(d)===r[5]&&(n=!1,e+=1,e<i?(d=l-1,r=a[e],c=t.chainname!==r[0]):o=!0)),c||o)return})}});var c=i.sheets;c=c.filter(function(t){return Ji(n,t[0])>=0}),c.sort(function(t,e){var i=t[0],r=e[0];if(i===r)return 0;var a=Ji(n,i),s=Ji(n,r);return o[a]<o[s]?-1:1});var u="e".charCodeAt(0);e.eachModel(function(t){var e=0,i=c.length;if(0!==i){var r=c[e],n=!1,o=!1;t.eachChain(function(t){var a=!1;if(t.chainname===r[0])for(var l=t.residueCount,h=t.residueOffset,d=h+l,f=h;f<d;++f)if(s.resno[f]===r[1]&&s.getInscode(f)===r[2]&&(n=!0),n&&(s.sstruc[f]=u,s.resno[f]===r[4]&&s.getInscode(f)===r[5]&&(n=!1,e+=1,e<i?(f=h-1,r=c[e],a=t.chainname!==r[0]):o=!0)),a||o)return})}}),t.Debug&&qp.timeEnd("assignSecondaryStructure")}}function lo(e){t.Debug&&qp.time("calculateChainnames");var i=!0;if(e.eachChain(function(t){t.chainname&&(i=!1)}),i){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=r.length,o=e.modelStore,a=e.chainStore,s=e.residueStore,c=function(t,e,i,r){for(var n=a.count,c=0;c<r;++c)s.chainIndex[i+c]=n;a.growIfFull(),a.modelIndex[n]=t,a.setChainname(n,e),a.setChainid(n,e),a.residueOffset[n]=i,a.residueCount[n]=r,a.count+=1,o.chainCount[t]+=1},u=function(t){for(var e=t,i=0,o=r[e%n];e>=n;)e=Math.floor(e/n),o+=r[e%n],i+=1;return i>=5&&qp.warn("chainname overflow"),o},l=e.getAtomProxy(),h=e.getAtomProxy(),d=0,f=0,p=0,m=0,g=[];1===s.count?g.push({mIndex:0,chainname:"A",rStart:0,rCount:1}):e.eachResidueN(2,function(t,e){var i=!1,r=t.backboneType,n=e.backboneType,o=_g;m=t.index,t.modelIndex!==e.modelIndex?i=!0:t.moleculeType!==e.moleculeType?i=!0:r!==o&&r===n&&(l.index=t.backboneEndAtomIndex,h.index=e.backboneStartAtomIndex,l.connectedTo(h)||(i=!0)),i||e.index!==s.count-1||(i=!0,m=e.index),i&&(g.push({mIndex:f,chainname:u(d),rStart:p,rCount:m-p+1}),d+=1,t.modelIndex!==e.modelIndex&&(d=0,f+=1),e.index===s.count-1&&m!==e.index&&g.push({mIndex:f,chainname:u(d),rStart:s.count-1,rCount:1}),p=e.index,m=e.index)}),a.count=0,g.forEach(function(t){c(t.mIndex,t.chainname,t.rStart,t.rCount)});var v=0;e.eachModel(function(t){o.chainOffset[t.index]=v,o.chainCount[t.index]-=1,v+=o.chainCount[t.index]})}t.Debug&&qp.timeEnd("calculateChainnames")}function ho(e){t.Debug&&qp.time("calculateBonds"),mo(e),go(e),t.Debug&&qp.timeEnd("calculateBonds")}function fo(e){var i=e.structure,r=i.getAtomProxy(),n=i.getAtomProxy(),o=e.atomCount,a=e.atomOffset,s=a+o,c=s-1;if(o>500)return void(t.Debug&&qp.warn("more than 500 atoms, skip residue for auto-bonding",e.qualifiedName()));var u,l,h=[],d=[],f=[];if(o>50){var p=new ao(e,!0),m=e.isCg()?1.2:2.3;for(u=a;u<c;++u){r.index=u;var g=r.covalent+m+.3,v=p.nearest(r,1/0,g*g),y=v.length;for(l=0;l<y;++l)n.index=v[l].index,r.index<n.index&&r.connectedTo(n)&&(h.push(r.index-a),d.push(n.index-a),f.push(1))}}else for(u=a;u<c;++u)for(r.index=u,l=u+1;l<=c;++l)n.index=l,r.connectedTo(n)&&(h.push(u-a),d.push(l-a),f.push(1));return{atomIndices1:h,atomIndices2:d,bondOrders:f}}function po(e){t.Debug&&qp.time("calculateAtomBondMap");var i=[];return e.eachBond(function(t){var e=t.atomIndex1,r=t.atomIndex2;void 0===i[e]&&(i[e]=[]),i[e][r]=t.index}),t.Debug&&qp.timeEnd("calculateAtomBondMap"),i}function mo(e,i){t.Debug&&qp.time("calculateBondsWithin");var r=e.bondStore,n=e.rungBondStore,o=e.getAtomSet(!1),a=e.getAtomProxy(),s=e.getAtomProxy(),c=e.getBondProxy(),u=i?null:po(e);e.eachResidue(function(t){if(!i){var e=t.atomCount,l=t.atomOffset;if(e>500)return void qp.warn("more than 500 atoms, skip residue for auto-bonding",t.qualifiedName());for(var h=t.getBonds(),d=h.atomIndices1,f=h.atomIndices2,p=h.bondOrders,m=d.length,g=0;g<m;++g){var v=d[g]+l,y=f[g]+l,b=u[v];if(void 0!==b&&void 0!==(b=b[y])){c.index=b;var x=t.residueType.getBondIndex(v,y);p[x]=c.bondOrder}else a.index=v,s.index=y,r.addBond(a,s,p[g])}}var _=t.residueType.traceAtomIndex,w=t.residueType.rungEndAtomIndex;_!==-1&&w!==-1&&(a.index=t.traceAtomIndex,s.index=t.rungEndAtomIndex,n.addBond(a,s),o.add_unsafe(a.index),o.add_unsafe(s.index))}),e.atomSetDict.rung=o,t.Debug&&qp.timeEnd("calculateBondsWithin")}function go(e,i){function r(t,e){var r=t.backboneType,u=e.backboneType;r!==_g&&r===u&&(s.index=t.backboneEndAtomIndex,c.index=e.backboneStartAtomIndex,s.connectedTo(c)&&(i||n.addBond(s,c,1),s.index=t.traceAtomIndex,c.index=e.traceAtomIndex,o.addBond(s,c),a.add_unsafe(s.index),a.add_unsafe(c.index)))}t.Debug&&qp.time("calculateBondsBetween");var n=e.bondStore,o=e.backboneBondStore,a=e.getAtomSet(!1),s=e.getAtomProxy(),c=e.getAtomProxy();0===o.count&&o.resize(e.residueStore.count),e.eachResidueN(2,r);var u=e.getResidueProxy(),l=e.getResidueProxy();e.eachChain(function(t){0!==t.residueCount&&(u.index=t.residueOffset,l.index=t.residueOffset+t.residueCount-1,r(l,u))}),e.atomSetDict.backbone=a,t.Debug&&qp.timeEnd("calculateBondsBetween")}function vo(e){function i(t){var e=[];return Object.keys(o).forEach(function(i){var u=o[i].clone();s.copy(n).applyMatrix4(u),c.setFromMatrixPosition(u),c.sub(a),s.x>1&&(c.x-=1),s.x<0&&(c.x+=1),s.y>1&&(c.y-=1),s.y<0&&(c.y+=1),s.z>1&&(c.z-=1),s.z<0&&(c.z+=1),t&&c.add(t),u.setPosition(c),u.multiplyMatrices(r.fracToCart,u),u.multiply(r.cartToFrac),e.push(u)}),e}if(e.unitcell){t.Debug&&qp.time("buildUnitcellAssembly");var r=e.unitcell,n=e.center.clone().applyMatrix4(r.cartToFrac),o=so(r.spacegroup),a=new g,s=new g,c=new g;n.x>1&&(a.x-=1),n.x<0&&(a.x+=1),n.y>1&&(a.y-=1),n.y<0&&(a.y+=1),n.z>1&&(a.z-=1),n.z<0&&(a.z+=1);var u,l=new ov("UNITCELL"),h=i();if(e.biomolDict.NCS){u=[new p].concat(e.biomolDict.NCS.partList[0].matrixList);var d=[];h.forEach(function(t){u.forEach(function(e){d.push(t.clone().multiply(e))})}),l.addPart(d)}else l.addPart(h);var f=new g,m=new ov("SUPERCELL"),v=Array.prototype.concat.call(i(),i(f.set(1,1,1)),i(f.set(-1,-1,-1)),i(f.set(1,0,0)),i(f.set(1,1,0)),i(f.set(1,0,1)),i(f.set(0,1,0)),i(f.set(0,1,1)),i(f.set(0,0,1)),i(f.set(-1,0,0)),i(f.set(-1,-1,0)),i(f.set(-1,0,-1)),i(f.set(0,-1,0)),i(f.set(0,-1,-1)),i(f.set(0,0,-1)),i(f.set(1,-1,-1)),i(f.set(1,1,-1)),i(f.set(1,-1,1)),i(f.set(-1,1,1)),i(f.set(-1,-1,1)),i(f.set(-1,1,-1)),i(f.set(0,1,-1)),i(f.set(0,-1,1)),i(f.set(1,0,-1)),i(f.set(-1,0,1)),i(f.set(1,-1,0)),i(f.set(-1,1,0)));if(e.biomolDict.NCS){var y=[];v.forEach(function(t){u.forEach(function(e){y.push(t.clone().multiply(e))})}),m.addPart(y)}else m.addPart(v);e.biomolDict.UNITCELL=l,e.biomolDict.SUPERCELL=m,t.Debug&&qp.timeEnd("buildUnitcellAssembly")}}function yo(t){var e=t.trim().toUpperCase();parseInt(e.charAt(0))&&(e=e.substr(1)),parseInt(e.charAt(0))&&(e=e.substr(1));var i=e.length;if(0===i)return"";if(1===i)return e;if(2===i){if(hv.indexOf(e)!==-1)return e;if(lv.indexOf(e[0])!==-1)return e[0]}return i>=3&&lv.indexOf(e[0])!==-1?e[0]:"";
	}function bo(t){var e=t.bondHash,i=e.countArray,r=e.offsetArray,n=e.indexArray,o=t.getBondProxy();t.eachResidue(function(t){var e=t.residueType;if(void 0===e.bonds){var a=t.atomOffset,s=[],c=[],u=[],l={};t.eachAtom(function(t){for(var e=t.index,h=r[e],d=i[e],f=0,p=d;f<p;++f){o.index=n[h+f];var m=o.atomIndex1,g=o.atomIndex2;if(m>g){var v=g;g=m,m=v}var y=m+"|"+g;void 0===l[y]&&(l[y]=!0,s.push(m-a),c.push(g-a),u.push(o.bondOrder))}}),e.bonds={atomIndices1:s,atomIndices2:c,bondOrders:u}}})}function xo(t,e,i){this.structure=t,i=i||yo(e),this.atomname=e,this.element=i,this.vdw=Ng[i],this.covalent=Fg[i]}function _o(t){function e(t,e){return t+"|"+e}function i(i,r){r=r||yo(i);var a=e(i,r),s=n[a];if(void 0===s){var c=new xo(t,i,r);s=o.length,n[a]=s,o.push(c)}return s}function r(t){return o[t]}var n={},o=[];this.add=i,this.get=r,this.list=o,this.dict=n,this.toJSON=function(){var t={metadata:{version:.1,type:"AtomMap",generator:"AtomMapExporter"},idDict:n,typeList:o.map(function(t){return t.toJSON()})};return t},this.fromJSON=function(e){n=e.idDict,o=e.typeList.map(function(e){return new xo(t,e.atomname,e.element)}),this.list=o,this.dict=n}}function wo(t,e,i,r,n,o){this.structure=t,this.resname=e,this.atomTypeIdList=i,this.hetero=r?1:0,this.chemCompType=n,this.bonds=o,this.rings=void 0,this.atomCount=i.length,this.moleculeType=this.getMoleculeType(),this.backboneType=this.getBackboneType(0),this.backboneEndType=this.getBackboneType(-1),this.backboneStartType=this.getBackboneType(1),this.backboneIndexList=this.getBackboneIndexList();var a=Kg[this.backboneType],s=Kg[this.backboneStartType],c=Kg[this.backboneEndType],u=this.getAtomIndexByName(a.trace);this.traceAtomIndex=void 0!==u?u:-1;var l=this.getAtomIndexByName(a.direction1);this.direction1AtomIndex=void 0!==l?l:-1;var h=this.getAtomIndexByName(a.direction2);this.direction2AtomIndex=void 0!==h?h:-1;var d=this.getAtomIndexByName(s.backboneStart);this.backboneStartAtomIndex=void 0!==d?d:-1;var f=this.getAtomIndexByName(c.backboneEnd);this.backboneEndAtomIndex=void 0!==f?f:-1;var p;p=Hg.includes(e)?this.getAtomIndexByName("N1"):this.getAtomIndexByName("N3"),this.rungEndAtomIndex=void 0!==p?p:-1,this.bondReferenceAtomIndices=[]}function So(t){function e(t,e,i,r){return t+"|"+e.join(",")+"|"+(i?1:0)+"|"+(r?r:"")}function i(i,r,a,s,c){i=i.toUpperCase();var u=e(i,r,a,s),l=n[u];if(void 0===l){var h=new wo(t,i,r,a,s,c);l=o.length,n[u]=l,o.push(h)}return l}function r(t){return o[t]}var n={},o=[];this.add=i,this.get=r,this.list=o,this.dict=n}function Ao(t,e){this.structure=t,this.bondStore=t.bondStore,this.index=e,this._v12=new g,this._v13=new g,this._ap1=this.structure.getAtomProxy(),this._ap2=this.structure.getAtomProxy(),this._ap3=this.structure.getAtomProxy()}function Mo(t,e){this.structure=t,this.chainStore=t.chainStore,this.residueStore=t.residueStore,this.atomStore=t.atomStore,this.residueMap=t.residueMap,this.atomMap=t.atomMap,this.bondHash=t.bondHash,this.index=e}function Po(t,e){this.structure=t,this.chainStore=t.chainStore,this.residueStore=t.residueStore,this.atomStore=t.atomStore,this.residueMap=t.residueMap,this.atomMap=t.atomMap,this.index=e}function Co(t,e,i){this.structure=t,this.chainStore=t.chainStore,this.residueStore=t.residueStore,this.atomStore=t.atomStore,this.residueIndexStart=e,this.residueIndexEnd=i,this.residueCount=i-e+1;var r=this.structure.getResidueProxy(this.residueIndexStart),n=this.structure.getResidueProxy(this.residueIndexEnd);this.isPrevConnected=void 0!==r.getPreviousConnectedResidue();var o=n.getNextConnectedResidue();this.isNextConnected=void 0!==o,this.isNextNextConnected=this.isNextConnected&&void 0!==o.getNextConnectedResidue(),this.isCyclic=n.connectedTo(r),this.__residueProxy=this.structure.getResidueProxy()}function To(t,e){this.structure=t,this.chainStore=t.chainStore,this.residueStore=t.residueStore,this.index=e,this.__residueProxy=this.structure.getResidueProxy()}function Eo(t,e){this.structure=t,this.modelStore=t.modelStore,this.chainStore=t.chainStore,this.residueStore=t.residueStore,this.index=e}function Io(t,e){this.signals={refreshed:new Cr},this.name=t,this.path=e,this.title="",this.id="",this.header={},this.atomSetCache=void 0,this.atomSetDict={},this.biomolDict={},this.entityList=[],this.unitcell=void 0,this.frames=[],this.boxes=[],this.validation=void 0,this.bondStore=new Kn(0),this.backboneBondStore=new Kn(0),this.rungBondStore=new Kn(0),this.atomStore=new Qn(0),this.residueStore=new Jn(0),this.chainStore=new to(0),this.modelStore=new eo(0),this.atomMap=new _o(this),this.residueMap=new So(this),this.bondHash=void 0,this.spatialHash=void 0,this.atomSet=void 0,this.bondSet=void 0,this.center=void 0,this.boundingBox=void 0,this._bp=this.getBondProxy(),this._ap=this.getAtomProxy(),this._rp=this.getResidueProxy(),this._cp=this.getChainProxy()}function Lo(t,e,i){this.name=t,this.path=e,this.info={},this.center=new g,this.boundingBox=new lt,i instanceof zt||i instanceof $t||i instanceof Ae?this.fromGeometry(i):i&&this.set(i.position,i.index,i.normal,i.color,i.atomindex,i.contour)}function Ro(e){var i=0,r=0,n={},o={},a=URL.createObjectURL(Zp.get(e)),s=new window.Worker(a);Zp.activeWorkerCount+=1,s.onmessage=function(r){i-=1;var a=r.data.__postId;t.Debug&&qp.timeEnd("Worker.postMessage "+e+" #"+a),n[a]&&n[a].call(s,r),delete n[a],delete o[a]},s.onerror=function(t){if(i-=1,t.data){var r=t.data.__postId;o[r]?o[r].call(s,t):qp.error("Worker.onerror",r,e,t),delete n[r],delete o[r]}else qp.error("Worker.onerror",e,t)},this.name=e,this.post=function(a,c,u,l){n[r]=u,o[r]=l,a=a||{},a.__name=e,a.__postId=r,a.__debug=t.Debug,t.Debug&&qp.time("Worker.postMessage "+e+" #"+r);try{s.postMessage(a,c)}catch(t){qp.error("worker.post:",t),s.postMessage(a)}return i+=1,r+=1,this},this.terminate=function(){s?(s.terminate(),URL.revokeObjectURL(a),Zp.activeWorkerCount-=1):qp.log("no worker to terminate")},Object.defineProperties(this,{postCount:{get:function(){return r}},pending:{get:function(){return i}}})}function Oo(t,e){e=Math.min(8,e||2);var i=[],r=0;this.name=t,this.maxCount=e,this.post=function(t,e,i,r){var n=this.getNextWorker();return n.post(t,e,i,r),this},this.terminate=function(){i.forEach(function(t){t.terminate()})},this.getNextWorker=function(){for(var n,o=1/0,a=0;a<e;++a){if(a>=r){n=new Ro(t),i.push(n),r+=1;break}var s=i[a];if(0===s.pending){o=s.pending,n=s;break}s.pending<o&&(o=s.pending,n=s)}return n},Object.defineProperties(this,{count:{get:function(){return r}}})}function Do(){return new Uint32Array([0,265,515,778,1030,1295,1541,1804,2060,2309,2575,2822,3082,3331,3593,3840,400,153,915,666,1430,1183,1941,1692,2460,2197,2975,2710,3482,3219,3993,3728,560,825,51,314,1590,1855,1077,1340,2620,2869,2111,2358,3642,3891,3129,3376,928,681,419,170,1958,1711,1445,1196,2988,2725,2479,2214,4010,3747,3497,3232,1120,1385,1635,1898,102,367,613,876,3180,3429,3695,3942,2154,2403,2665,2912,1520,1273,2035,1786,502,255,1013,764,3580,3317,4095,3830,2554,2291,3065,2800,1616,1881,1107,1370,598,863,85,348,3676,3925,3167,3414,2650,2899,2137,2384,1984,1737,1475,1226,966,719,453,204,4044,3781,3535,3270,3018,2755,2505,2240,2240,2505,2755,3018,3270,3535,3781,4044,204,453,719,966,1226,1475,1737,1984,2384,2137,2899,2650,3414,3167,3925,3676,348,85,863,598,1370,1107,1881,1616,2800,3065,2291,2554,3830,4095,3317,3580,764,1013,255,502,1786,2035,1273,1520,2912,2665,2403,2154,3942,3695,3429,3180,876,613,367,102,1898,1635,1385,1120,3232,3497,3747,4010,2214,2479,2725,2988,1196,1445,1711,1958,170,419,681,928,3376,3129,3891,3642,2358,2111,2869,2620,1340,1077,1855,1590,314,51,825,560,3728,3993,3219,3482,2710,2975,2197,2460,1692,1941,1183,1430,666,915,153,400,3840,3593,3331,3082,2822,2575,2309,2060,1804,1541,1295,1030,778,515,265,0])}function No(){return new Int32Array([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,9,8,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,2,10,0,2,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,8,3,2,10,8,10,9,8,-1,-1,-1,-1,-1,-1,-1,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,8,11,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,11,2,1,9,11,9,8,11,-1,-1,-1,-1,-1,-1,-1,3,10,1,11,10,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,10,1,0,8,10,8,11,10,-1,-1,-1,-1,-1,-1,-1,3,9,0,3,11,9,11,10,9,-1,-1,-1,-1,-1,-1,-1,9,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,7,3,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,1,9,4,7,1,7,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,8,4,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,4,7,3,0,4,1,2,10,-1,-1,-1,-1,-1,-1,-1,9,2,10,9,0,2,8,4,7,-1,-1,-1,-1,-1,-1,-1,2,10,9,2,9,7,2,7,3,7,9,4,-1,-1,-1,-1,8,4,7,3,11,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,4,7,11,2,4,2,0,4,-1,-1,-1,-1,-1,-1,-1,9,0,1,8,4,7,2,3,11,-1,-1,-1,-1,-1,-1,-1,4,7,11,9,4,11,9,11,2,9,2,1,-1,-1,-1,-1,3,10,1,3,11,10,7,8,4,-1,-1,-1,-1,-1,-1,-1,1,11,10,1,4,11,1,0,4,7,11,4,-1,-1,-1,-1,4,7,8,9,0,11,9,11,10,11,0,3,-1,-1,-1,-1,4,7,11,4,11,9,9,11,10,-1,-1,-1,-1,-1,-1,-1,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,5,4,1,5,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,5,4,8,3,5,3,1,5,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,10,4,9,5,-1,-1,-1,-1,-1,-1,-1,5,2,10,5,4,2,4,0,2,-1,-1,-1,-1,-1,-1,-1,2,10,5,3,2,5,3,5,4,3,4,8,-1,-1,-1,-1,9,5,4,2,3,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,11,2,0,8,11,4,9,5,-1,-1,-1,-1,-1,-1,-1,0,5,4,0,1,5,2,3,11,-1,-1,-1,-1,-1,-1,-1,2,1,5,2,5,8,2,8,11,4,8,5,-1,-1,-1,-1,10,3,11,10,1,3,9,5,4,-1,-1,-1,-1,-1,-1,-1,4,9,5,0,8,1,8,10,1,8,11,10,-1,-1,-1,-1,5,4,0,5,0,11,5,11,10,11,0,3,-1,-1,-1,-1,5,4,8,5,8,10,10,8,11,-1,-1,-1,-1,-1,-1,-1,9,7,8,5,7,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,3,0,9,5,3,5,7,3,-1,-1,-1,-1,-1,-1,-1,0,7,8,0,1,7,1,5,7,-1,-1,-1,-1,-1,-1,-1,1,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,7,8,9,5,7,10,1,2,-1,-1,-1,-1,-1,-1,-1,10,1,2,9,5,0,5,3,0,5,7,3,-1,-1,-1,-1,8,0,2,8,2,5,8,5,7,10,5,2,-1,-1,-1,-1,2,10,5,2,5,3,3,5,7,-1,-1,-1,-1,-1,-1,-1,7,9,5,7,8,9,3,11,2,-1,-1,-1,-1,-1,-1,-1,9,5,7,9,7,2,9,2,0,2,7,11,-1,-1,-1,-1,2,3,11,0,1,8,1,7,8,1,5,7,-1,-1,-1,-1,11,2,1,11,1,7,7,1,5,-1,-1,-1,-1,-1,-1,-1,9,5,8,8,5,7,10,1,3,10,3,11,-1,-1,-1,-1,5,7,0,5,0,9,7,11,0,1,0,10,11,10,0,-1,11,10,0,11,0,3,10,5,0,8,0,7,5,7,0,-1,11,10,5,7,11,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,0,1,5,10,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,8,3,1,9,8,5,10,6,-1,-1,-1,-1,-1,-1,-1,1,6,5,2,6,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,6,5,1,2,6,3,0,8,-1,-1,-1,-1,-1,-1,-1,9,6,5,9,0,6,0,2,6,-1,-1,-1,-1,-1,-1,-1,5,9,8,5,8,2,5,2,6,3,2,8,-1,-1,-1,-1,2,3,11,10,6,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,0,8,11,2,0,10,6,5,-1,-1,-1,-1,-1,-1,-1,0,1,9,2,3,11,5,10,6,-1,-1,-1,-1,-1,-1,-1,5,10,6,1,9,2,9,11,2,9,8,11,-1,-1,-1,-1,6,3,11,6,5,3,5,1,3,-1,-1,-1,-1,-1,-1,-1,0,8,11,0,11,5,0,5,1,5,11,6,-1,-1,-1,-1,3,11,6,0,3,6,0,6,5,0,5,9,-1,-1,-1,-1,6,5,9,6,9,11,11,9,8,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,3,0,4,7,3,6,5,10,-1,-1,-1,-1,-1,-1,-1,1,9,0,5,10,6,8,4,7,-1,-1,-1,-1,-1,-1,-1,10,6,5,1,9,7,1,7,3,7,9,4,-1,-1,-1,-1,6,1,2,6,5,1,4,7,8,-1,-1,-1,-1,-1,-1,-1,1,2,5,5,2,6,3,0,4,3,4,7,-1,-1,-1,-1,8,4,7,9,0,5,0,6,5,0,2,6,-1,-1,-1,-1,7,3,9,7,9,4,3,2,9,5,9,6,2,6,9,-1,3,11,2,7,8,4,10,6,5,-1,-1,-1,-1,-1,-1,-1,5,10,6,4,7,2,4,2,0,2,7,11,-1,-1,-1,-1,0,1,9,4,7,8,2,3,11,5,10,6,-1,-1,-1,-1,9,2,1,9,11,2,9,4,11,7,11,4,5,10,6,-1,8,4,7,3,11,5,3,5,1,5,11,6,-1,-1,-1,-1,5,1,11,5,11,6,1,0,11,7,11,4,0,4,11,-1,0,5,9,0,6,5,0,3,6,11,6,3,8,4,7,-1,6,5,9,6,9,11,4,7,9,7,11,9,-1,-1,-1,-1,10,4,9,6,4,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,10,6,4,9,10,0,8,3,-1,-1,-1,-1,-1,-1,-1,10,0,1,10,6,0,6,4,0,-1,-1,-1,-1,-1,-1,-1,8,3,1,8,1,6,8,6,4,6,1,10,-1,-1,-1,-1,1,4,9,1,2,4,2,6,4,-1,-1,-1,-1,-1,-1,-1,3,0,8,1,2,9,2,4,9,2,6,4,-1,-1,-1,-1,0,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,3,2,8,2,4,4,2,6,-1,-1,-1,-1,-1,-1,-1,10,4,9,10,6,4,11,2,3,-1,-1,-1,-1,-1,-1,-1,0,8,2,2,8,11,4,9,10,4,10,6,-1,-1,-1,-1,3,11,2,0,1,6,0,6,4,6,1,10,-1,-1,-1,-1,6,4,1,6,1,10,4,8,1,2,1,11,8,11,1,-1,9,6,4,9,3,6,9,1,3,11,6,3,-1,-1,-1,-1,8,11,1,8,1,0,11,6,1,9,1,4,6,4,1,-1,3,11,6,3,6,0,0,6,4,-1,-1,-1,-1,-1,-1,-1,6,4,8,11,6,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,10,6,7,8,10,8,9,10,-1,-1,-1,-1,-1,-1,-1,0,7,3,0,10,7,0,9,10,6,7,10,-1,-1,-1,-1,10,6,7,1,10,7,1,7,8,1,8,0,-1,-1,-1,-1,10,6,7,10,7,1,1,7,3,-1,-1,-1,-1,-1,-1,-1,1,2,6,1,6,8,1,8,9,8,6,7,-1,-1,-1,-1,2,6,9,2,9,1,6,7,9,0,9,3,7,3,9,-1,7,8,0,7,0,6,6,0,2,-1,-1,-1,-1,-1,-1,-1,7,3,2,6,7,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,11,10,6,8,10,8,9,8,6,7,-1,-1,-1,-1,2,0,7,2,7,11,0,9,7,6,7,10,9,10,7,-1,1,8,0,1,7,8,1,10,7,6,7,10,2,3,11,-1,11,2,1,11,1,7,10,6,1,6,7,1,-1,-1,-1,-1,8,9,6,8,6,7,9,1,6,11,6,3,1,3,6,-1,0,9,1,11,6,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,8,0,7,0,6,3,11,0,11,6,0,-1,-1,-1,-1,7,11,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,8,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,9,11,7,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,1,9,8,3,1,11,7,6,-1,-1,-1,-1,-1,-1,-1,10,1,2,6,11,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,10,3,0,8,6,11,7,-1,-1,-1,-1,-1,-1,-1,2,9,0,2,10,9,6,11,7,-1,-1,-1,-1,-1,-1,-1,6,11,7,2,10,3,10,8,3,10,9,8,-1,-1,-1,-1,7,2,3,6,2,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,0,8,7,6,0,6,2,0,-1,-1,-1,-1,-1,-1,-1,2,7,6,2,3,7,0,1,9,-1,-1,-1,-1,-1,-1,-1,1,6,2,1,8,6,1,9,8,8,7,6,-1,-1,-1,-1,10,7,6,10,1,7,1,3,7,-1,-1,-1,-1,-1,-1,-1,10,7,6,1,7,10,1,8,7,1,0,8,-1,-1,-1,-1,0,3,7,0,7,10,0,10,9,6,10,7,-1,-1,-1,-1,7,6,10,7,10,8,8,10,9,-1,-1,-1,-1,-1,-1,-1,6,8,4,11,8,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,6,11,3,0,6,0,4,6,-1,-1,-1,-1,-1,-1,-1,8,6,11,8,4,6,9,0,1,-1,-1,-1,-1,-1,-1,-1,9,4,6,9,6,3,9,3,1,11,3,6,-1,-1,-1,-1,6,8,4,6,11,8,2,10,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,3,0,11,0,6,11,0,4,6,-1,-1,-1,-1,4,11,8,4,6,11,0,2,9,2,10,9,-1,-1,-1,-1,10,9,3,10,3,2,9,4,3,11,3,6,4,6,3,-1,8,2,3,8,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,0,4,2,4,6,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,9,0,2,3,4,2,4,6,4,3,8,-1,-1,-1,-1,1,9,4,1,4,2,2,4,6,-1,-1,-1,-1,-1,-1,-1,8,1,3,8,6,1,8,4,6,6,10,1,-1,-1,-1,-1,10,1,0,10,0,6,6,0,4,-1,-1,-1,-1,-1,-1,-1,4,6,3,4,3,8,6,10,3,0,3,9,10,9,3,-1,10,9,4,6,10,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,5,7,6,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,5,11,7,6,-1,-1,-1,-1,-1,-1,-1,5,0,1,5,4,0,7,6,11,-1,-1,-1,-1,-1,-1,-1,11,7,6,8,3,4,3,5,4,3,1,5,-1,-1,-1,-1,9,5,4,10,1,2,7,6,11,-1,-1,-1,-1,-1,-1,-1,6,11,7,1,2,10,0,8,3,4,9,5,-1,-1,-1,-1,7,6,11,5,4,10,4,2,10,4,0,2,-1,-1,-1,-1,3,4,8,3,5,4,3,2,5,10,5,2,11,7,6,-1,7,2,3,7,6,2,5,4,9,-1,-1,-1,-1,-1,-1,-1,9,5,4,0,8,6,0,6,2,6,8,7,-1,-1,-1,-1,3,6,2,3,7,6,1,5,0,5,4,0,-1,-1,-1,-1,6,2,8,6,8,7,2,1,8,4,8,5,1,5,8,-1,9,5,4,10,1,6,1,7,6,1,3,7,-1,-1,-1,-1,1,6,10,1,7,6,1,0,7,8,7,0,9,5,4,-1,4,0,10,4,10,5,0,3,10,6,10,7,3,7,10,-1,7,6,10,7,10,8,5,4,10,4,8,10,-1,-1,-1,-1,6,9,5,6,11,9,11,8,9,-1,-1,-1,-1,-1,-1,-1,3,6,11,0,6,3,0,5,6,0,9,5,-1,-1,-1,-1,0,11,8,0,5,11,0,1,5,5,6,11,-1,-1,-1,-1,6,11,3,6,3,5,5,3,1,-1,-1,-1,-1,-1,-1,-1,1,2,10,9,5,11,9,11,8,11,5,6,-1,-1,-1,-1,0,11,3,0,6,11,0,9,6,5,6,9,1,2,10,-1,11,8,5,11,5,6,8,0,5,10,5,2,0,2,5,-1,6,11,3,6,3,5,2,10,3,10,5,3,-1,-1,-1,-1,5,8,9,5,2,8,5,6,2,3,8,2,-1,-1,-1,-1,9,5,6,9,6,0,0,6,2,-1,-1,-1,-1,-1,-1,-1,1,5,8,1,8,0,5,6,8,3,8,2,6,2,8,-1,1,5,6,2,1,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,6,1,6,10,3,8,6,5,6,9,8,9,6,-1,10,1,0,10,0,6,9,5,0,5,6,0,-1,-1,-1,-1,0,3,8,5,6,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,5,6,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,7,5,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,5,10,11,7,5,8,3,0,-1,-1,-1,-1,-1,-1,-1,5,11,7,5,10,11,1,9,0,-1,-1,-1,-1,-1,-1,-1,10,7,5,10,11,7,9,8,1,8,3,1,-1,-1,-1,-1,11,1,2,11,7,1,7,5,1,-1,-1,-1,-1,-1,-1,-1,0,8,3,1,2,7,1,7,5,7,2,11,-1,-1,-1,-1,9,7,5,9,2,7,9,0,2,2,11,7,-1,-1,-1,-1,7,5,2,7,2,11,5,9,2,3,2,8,9,8,2,-1,2,5,10,2,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,8,2,0,8,5,2,8,7,5,10,2,5,-1,-1,-1,-1,9,0,1,5,10,3,5,3,7,3,10,2,-1,-1,-1,-1,9,8,2,9,2,1,8,7,2,10,2,5,7,5,2,-1,1,3,5,3,7,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,8,7,0,7,1,1,7,5,-1,-1,-1,-1,-1,-1,-1,9,0,3,9,3,5,5,3,7,-1,-1,-1,-1,-1,-1,-1,9,8,7,5,9,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,5,8,4,5,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,5,0,4,5,11,0,5,10,11,11,3,0,-1,-1,-1,-1,0,1,9,8,4,10,8,10,11,10,4,5,-1,-1,-1,-1,10,11,4,10,4,5,11,3,4,9,4,1,3,1,4,-1,2,5,1,2,8,5,2,11,8,4,5,8,-1,-1,-1,-1,0,4,11,0,11,3,4,5,11,2,11,1,5,1,11,-1,0,2,5,0,5,9,2,11,5,4,5,8,11,8,5,-1,9,4,5,2,11,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,5,10,3,5,2,3,4,5,3,8,4,-1,-1,-1,-1,5,10,2,5,2,4,4,2,0,-1,-1,-1,-1,-1,-1,-1,3,10,2,3,5,10,3,8,5,4,5,8,0,1,9,-1,5,10,2,5,2,4,1,9,2,9,4,2,-1,-1,-1,-1,8,4,5,8,5,3,3,5,1,-1,-1,-1,-1,-1,-1,-1,0,4,5,1,0,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,4,5,8,5,3,9,0,5,0,3,5,-1,-1,-1,-1,9,4,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,11,7,4,9,11,9,10,11,-1,-1,-1,-1,-1,-1,-1,0,8,3,4,9,7,9,11,7,9,10,11,-1,-1,-1,-1,1,10,11,1,11,4,1,4,0,7,4,11,-1,-1,-1,-1,3,1,4,3,4,8,1,10,4,7,4,11,10,11,4,-1,4,11,7,9,11,4,9,2,11,9,1,2,-1,-1,-1,-1,9,7,4,9,11,7,9,1,11,2,11,1,0,8,3,-1,11,7,4,11,4,2,2,4,0,-1,-1,-1,-1,-1,-1,-1,11,7,4,11,4,2,8,3,4,3,2,4,-1,-1,-1,-1,2,9,10,2,7,9,2,3,7,7,4,9,-1,-1,-1,-1,9,10,7,9,7,4,10,2,7,8,7,0,2,0,7,-1,3,7,10,3,10,2,7,4,10,1,10,0,4,0,10,-1,1,10,2,8,7,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,7,1,3,-1,-1,-1,-1,-1,-1,-1,4,9,1,4,1,7,0,8,1,8,7,1,-1,-1,-1,-1,4,0,3,7,4,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,8,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,10,8,10,11,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,11,9,10,-1,-1,-1,-1,-1,-1,-1,0,1,10,0,10,8,8,10,11,-1,-1,-1,-1,-1,-1,-1,3,1,10,11,3,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,2,11,1,11,9,9,11,8,-1,-1,-1,-1,-1,-1,-1,3,0,9,3,9,11,1,2,9,2,11,9,-1,-1,-1,-1,0,2,11,8,0,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3,2,11,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,10,8,9,-1,-1,-1,-1,-1,-1,-1,9,10,2,0,9,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,3,8,2,8,10,0,1,8,1,10,8,-1,-1,-1,-1,1,10,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,3,8,9,1,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,9,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,3,8,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}function ko(){return[[0,4,4,4,2,0,0,0,2,2,0,0],[4,0,4,4,0,8,0,0,0,8,8,0],[4,4,0,4,0,0,8,0,0,0,8,8],[4,4,4,0,0,0,0,1,1,0,0,1],[2,0,0,0,0,8,8,8,2,2,0,0],[0,8,0,0,8,0,8,8,0,8,8,0],[0,0,8,0,8,8,0,8,0,0,8,8],[0,0,0,1,8,8,8,0,1,0,0,1],[2,0,0,1,2,0,0,1,0,2,0,1],[2,8,0,0,2,8,0,0,2,0,8,0],[0,8,8,0,0,8,8,0,0,8,0,8],[0,0,8,1,0,0,8,1,1,0,8,0]]}function Fo(t,e,i,r,n){function o(t,e,i){return t+(e-t)*i}function a(t,e,i,r,a,s,c){var u=y?3*t:t;if(f[u]<0){var l=(g-s)/(c-s),h=d,m=3*p;if(S[m+0]=i+l,S[m+1]=r,S[m+2]=a,!v){var b=3*t;A[m]=-o(h[b],h[b+3],l),A[m+1]=-o(h[b+1],h[b+4],l),A[m+2]=-o(h[b+2],h[b+5],l)}n&&(P[p]=n[t+Math.round(l)]),f[u]=p,w[e]=p,p+=1}else w[e]=f[u]}function s(t,e,i,r,a,s,c){var u=y?3*t+1:t;if(f[u]<0){var l=(g-s)/(c-s),h=d,m=3*p;if(S[m]=i,S[m+1]=r+l,S[m+2]=a,!v){var b=3*t,_=b+3*x;A[m]=-o(h[b],h[_],l),A[m+1]=-o(h[b+1],h[_+1],l),A[m+2]=-o(h[b+2],h[_+2],l)}n&&(P[p]=n[t+Math.round(l)*x]),f[u]=p,w[e]=p,p+=1}else w[e]=f[u]}function c(t,e,i,r,a,s,c){var u=y?3*t+2:t;if(f[u]<0){var l=(g-s)/(c-s),h=d,m=3*p;if(S[m]=i,S[m+1]=r,S[m+2]=a+l,!v){var b=3*t,x=b+3*_;A[m]=-o(h[b],h[x],l),A[m+1]=-o(h[b+1],h[x+1],l),A[m+2]=-o(h[b+2],h[x+2],l)}n&&(P[p]=n[t+Math.round(l)*_]),f[u]=p,w[e]=p,p+=1}else w[e]=f[u]}function u(e){var i=3*e;0===d[i]&&(d[i]=t[e-1]-t[e+1],d[i+1]=t[e-x]-t[e+x],d[i+2]=t[e-_]-t[e+_])}function l(e,i,r,n,o){var l=n+1,h=n+x,d=n+_,f=l+x,p=l+_,b=n+x+_,S=l+x+_,A=0,P=t[n],I=t[l],L=t[h],R=t[f],O=t[d],D=t[p],N=t[b],k=t[S];P<g&&(A|=1),I<g&&(A|=2),L<g&&(A|=8),R<g&&(A|=4),O<g&&(A|=16),D<g&&(A|=32),N<g&&(A|=128),k<g&&(A|=64);var F=C[A];if(0===F)return 0;var B=e+1,z=i+1,U=r+1;1&F&&(v||(u(n),u(l)),a(n,0,e,i,r,P,I)),2&F&&(v||(u(l),u(f)),s(l,1,B,i,r,I,R)),4&F&&(v||(u(h),u(f)),a(h,2,e,z,r,L,R)),8&F&&(v||(u(n),u(h)),s(n,3,e,i,r,P,L)),16&F&&(v||(u(d),u(p)),a(d,4,e,i,U,O,D)),32&F&&(v||(u(p),u(S)),s(p,5,B,i,U,D,k)),64&F&&(v||(u(b),u(S)),a(b,6,e,z,U,N,k)),128&F&&(v||(u(d),u(b)),s(d,7,e,i,U,O,N)),256&F&&(v||(u(n),u(d)),c(n,8,e,i,r,P,O)),512&F&&(v||(u(l),u(p)),c(l,9,B,i,r,I,D)),1024&F&&(v||(u(f),u(S)),c(f,10,B,z,r,R,k)),2048&F&&(v||(u(h),u(b)),c(h,11,e,z,r,L,N));for(var j,$,V,G=A<<4,H=0;T[G+H]!=-1;)j=T[G+H],$=T[G+H+1],V=T[G+H+2],y?(E[j][$]&o&&(M[m++]=w[j],M[m++]=w[$]),E[$][V]&o&&(M[m++]=w[$],M[m++]=w[V]),E[j][V]&o&&(M[m++]=w[j],M[m++]=w[V])):(M[m++]=w[$],M[m++]=w[j],M[m++]=w[V]),H+=3}function h(n,o,a,s,c,u){var h,d,p,m,b,w;n=void 0!==n?n:0,o=void 0!==o?o:0,a=void 0!==a?a:0,s=void 0!==s?s:e-1,c=void 0!==c?c:i-1,u=void 0!==u?u:r-1,v?(n=Math.max(0,n),o=Math.max(0,o),a=Math.max(0,a),s=Math.min(e-1,s),c=Math.min(i-1,c),u=Math.min(r-1,u)):(n=Math.max(1,n),o=Math.max(1,o),a=Math.max(1,a),s=Math.min(e-2,s),c=Math.min(i-2,c),u=Math.min(r-2,u));var S=Math.max(0,n-2),A=Math.max(0,o-2),M=Math.max(0,a-2),P=Math.min(e,s+2),C=Math.min(i,c+2),T=Math.min(r,u+2);for(m=M;m<T;++m)for(w=_*m,p=A;p<C;++p)for(b=w+x*p,d=S;d<P;++d)y?(h=3*(b+d),f[h]=-1,f[h+1]=-1,f[h+2]=-1):(h=b+d,f[h]=-1);var E,I=n,L=o,R=a,O=s,D=c,N=u;for(E=!1,m=a;m<u;++m){for(p=o;p<c;++p){for(d=n;d<s;++d)if(h=e*i*m+e*p+d,t[h]>=g){R=m,E=!0;break}if(E)break}if(E)break}for(E=!1,p=o;p<c;++p){for(m=R;m<u;++m){for(d=n;d<s;++d)if(h=e*i*m+e*p+d,t[h]>=g){L=p,E=!0;break}if(E)break}if(E)break}for(E=!1,d=n;d<s;++d){for(p=L;p<c;++p){for(m=R;m<u;++m)if(h=e*i*m+e*p+d,t[h]>=g){I=d,E=!0;break}if(E)break}if(E)break}for(E=!1,m=u;m>=a;--m){for(p=c;p>=o;--p){for(d=s;d>=n;--d)if(h=e*i*m+e*p+d,t[h]>=g){N=m,E=!0;break}if(E)break}if(E)break}for(E=!1,p=c;p>=o;--p){for(m=N;m>=a;--m){for(d=s;d>=n;--d)if(h=e*i*m+e*p+d,t[h]>=g){D=p,E=!0;break}if(E)break}if(E)break}for(E=!1,d=s;d>=n;--d){for(p=D;p>=o;--p){for(m=N;m>=a;--m)if(h=e*i*m+e*p+d,t[h]>=g){O=d,E=!0;break}if(E)break}if(E)break}v?(n=Math.max(0,I-1),o=Math.max(0,L-1),a=Math.max(0,R-1),s=Math.min(e-1,O+1),c=Math.min(i-1,D+1),u=Math.min(r-1,N+1)):(n=Math.max(1,I-1),o=Math.max(1,L-1),a=Math.max(1,R-1),s=Math.min(e-2,O+1),c=Math.min(i-2,D+1),u=Math.min(r-2,N+1));var k=15;for(m=a;m<u;++m,k&=-5)for(w=_*m,k|=2,p=o;p<c;++p,k&=-3)for(b=w+x*p,k|=1,d=n;d<s;++d,k&=-2)h=b+d,l(d,p,m,h,k)}var d,f,p,m,g=0,v=!1,y=!1,b=e*i*r,x=e,_=e*i,w=new Int32Array(12),S=[],A=[],M=[],P=[],C=Do(),T=No(),E=ko();this.triangulate=function(t,e,i,r){if(g=t,y=r,v=e||y,v||d||(d=new Float32Array(3*b)),f||(f=new Int32Array(y?3*b:b)),p=0,m=0,void 0!==i){var o=i[0].map(Math.round),a=i[1].map(Math.round);h(o[0],o[1],o[2],a[0],a[1],a[2])}else h();S.length=3*p,v||(A.length=3*p),M.length=m,n&&(P.length=p);var s=S.length/3>65535?Uint32Array:Uint16Array;return{position:new Float32Array(S),normal:v?void 0:new Float32Array(A),index:new s(M),atomindex:n?new Int32Array(P):void 0,contour:y}}}function Bo(t,e,i,r){i=i||1,r=r||!0;var n,o=t.length/3,a=e.length/3;r&&(n=new Float32Array(3*o));var s,c=new Float32Array(3*o),u=20,l=new Array(u);for(s=0;s<u;++s)l[s]=new Uint32Array(o);for(s=0;s<o;++s)l[0][s]=0;var h,d,f;for(s=0;s<a;++s){var p=3*s,m=3*s+1,g=3*s+2;for(f=!0,h=0,d=l[0][e[p]];h<d;++h)if(e[m]==l[h+1][e[p]]){f=!1;break}for(f&&(l[0][e[p]]++,l[l[0][e[p]]][e[p]]=e[m]),f=!0,h=0,d=l[0][e[p]];h<d;++h)if(e[g]==l[h+1][e[p]]){f=!1;break}for(f&&(l[0][e[p]]++,l[l[0][e[p]]][e[p]]=e[g]),f=!0,h=0,d=l[0][e[m]];h<d;++h)if(e[p]==l[h+1][e[m]]){f=!1;break}for(f&&(l[0][e[m]]++,l[l[0][e[m]]][e[m]]=e[p]),f=!0,h=0,d=l[0][e[m]];h<d;++h)if(e[g]==l[h+1][e[m]]){f=!1;break}for(f&&(l[0][e[m]]++,l[l[0][e[m]]][e[m]]=e[g]),f=!0,h=0;h<l[0][e[g]];++h)if(e[p]==l[h+1][e[g]]){f=!1;break}for(f&&(l[0][e[g]]++,l[l[0][e[g]]][e[g]]=e[p]),f=!0,h=0,d=l[0][e[g]];h<d;++h)if(e[m]==l[h+1][e[g]]){f=!1;break}f&&(l[0][e[g]]++,l[l[0][e[g]]][e[g]]=e[m])}for(var v,y,b,x,_,w=1,S=.5,A=-1,M=1,P=.75/(M+3.5),C=0;C<i;++C){for(s=0;s<o;++s)if(v=3*s,b=l[0][s],b<3)c[v]=t[v],c[v+1]=t[v+1],c[v+2]=t[v+2];else if(3===b||4===b){for(c[v]=0,c[v+1]=0,c[v+2]=0,h=0;h<b;++h)y=3*l[h+1][s],c[v]+=t[y],c[v+1]+=t[y+1],c[v+2]+=t[y+2];c[v]+=S*t[v],c[v+1]+=S*t[v+1],c[v+2]+=S*t[v+2],_=S+b,c[v]/=_,c[v+1]/=_,c[v+2]/=_}else{for(c[v]=0,c[v+1]=0,c[v+2]=0,h=0;h<b;++h)y=3*l[h+1][s],c[v]+=t[y],c[v+1]+=t[y+1],c[v+2]+=t[y+2];c[v]+=w*t[v],c[v+1]+=w*t[v+1],c[v+2]+=w*t[v+2],x=w+b,c[v]/=x,c[v+1]/=x,c[v+2]/=x}if(t.set(c),r){zo(t,e,n);var T=3*o;for(v=0;v<T;v+=3)t[v]+=A*P*n[v],t[v+1]+=A*P*n[v+1],t[v+2]+=A*P*n[v+2]}}}function zo(t,e,i){var r,n;if(void 0===i)i=new Float32Array(t.length);else for(r=0,n=i.length;r<n;r++)i[r]=0;var o=new Float32Array(3),a=new Float32Array(3),s=new Float32Array(3),c=new Float32Array(3),u=new Float32Array(3);if(e)for(r=0,n=e.length;r<n;r+=3){var l=3*e[r],h=3*e[r+1],d=3*e[r+2];vn(o,t,l),vn(a,t,h),vn(s,t,d),gn(c,s,a),gn(u,o,a),mn(c,c,u),i[l]+=c[0],i[l+1]+=c[1],i[l+2]+=c[2],i[h]+=c[0],i[h+1]+=c[1],i[h+2]+=c[2],i[d]+=c[0],i[d+1]+=c[1],i[d+2]+=c[2]}else for(r=0,n=t.length;r<n;r+=9)vn(o,t,r),vn(a,t,r+3),vn(s,t,r+6),gn(c,s,a),gn(u,o,a),mn(c,c,u),i[r]=c[0],i[r+1]=c[1],i[r+2]=c[2],i[r+3]=c[0],i[r+4]=c[1],i[r+5]=c[2],i[r+6]=c[0],i[r+7]=c[1],i[r+8]=c[2];return fn(i),i}function Uo(t){for(var e={},i=0,r=t.length;i<r;++i)e[t[i]]=!0;return e}function jo(t,e,i,r,n){var o=1/r*3;o+=i,wn(t,t,n+o),Sn(e,e,n+o),xn(t,t,r),An(t,t),bn(t,t,r),xn(e,e,r),Mn(e,e),bn(e,e,r);var a=new Float32Array(3);gn(a,e,t),xn(a,a,r),Mn(a,a),Sn(a,a,1);var s=256*Math.pow(10,6),c=a[0]*a[1]*a[2]*3;s<=c&&(r*=Math.pow(s/c,1/3),xn(t,t,r),An(t,t),bn(t,t,r),xn(e,e,r),Mn(e,e),bn(e,e,r),gn(a,e,t),xn(a,a,r),Mn(a,a),Sn(a,a,1));var u=new Float32Array(t);Pn(u,u);var l=Un(),h=Un();Hn(h,mr(90)),$n(l,l,h);var d=Un();Vn(d,-1/r,1/r,1/r),$n(l,l,d);var f=Un();return Gn(f,-r*u[2],-r*u[1],-r*u[0]),$n(l,l,f),{dim:a,tran:u,matrix:l,scaleFactor:r}}function $o(t,e,i,r,n){function o(t,e,i,r,n){var o=a.triangulate(t,e,i,n);if(e&&(Bo(o.position,o.index,e,!0),o.normal=zo(o.position,o.index)),r&&(hn(r,o.position),o.normal)){var s=Wn();Xn(s,r),dn(s,o.normal)}return o}var a=new Fo(t,e,i,r,n);this.getSurface=o}function Vo(t,e,i,r,n,o,a){this.name=t,this.path=e,this.matrix=new p,this.normalMatrix=new dt,this.inverseMatrix=new p,this.center=new g,this.boundingBox=new lt,this.setData(i,r,n,o,a)}function Go(t,e){function i(e){t(e,r)}function r(){var t=n.shift();void 0!==t?(o=!0,setTimeout(function(){i(t)})):o=!1}var n=[],o=!1;if(e){for(var a=0,s=e.length;a<s;++a)n.push(e[a]);r()}this.push=function(t){n.push(t),o||r()},this.kill=function(){n.length=0},this.length=function(){return n.length}}function Ho(t,e,i){if(0!==i[0]&&0!==i[8]&&0!==i[4]){var r,n=t.length,o=i[0],a=i[1],s=i[2],c=e[0],u=e[1],l=e[2],h=-c+o+o/2,d=-u+a+a/2,f=-l+s+s/2;for(r=0;r<n;r+=3)t[r+0]=(t[r+0]+h)%o,t[r+1]=(t[r+1]+d)%a,t[r+2]=(t[r+2]+f)%s}}function Wo(t,e){if(0!==e[0]&&0!==e[8]&&0!==e[4]){var i,r,n,o,a=t.length;for(i=3;i<a;i+=3)for(r=0;r<3;++r)if(o=t[i+r]-t[i-3+r],Math.abs(o)>.9*e[3*r+r])if(o>0)for(n=0;n<3;++n)t[i+n]-=e[3*r+n];else for(n=0;n<3;++n)t[i+n]+=e[3*r+n];return t}}function Xo(t){return"front"===t?Oc:"back"===t?Dc:"double"===t?Nc:Nc}function qo(t){for(var e,i,r=t.vertices,n=r.length,o=new Float32Array(3*n),a=0;a<n;a++)e=3*a,i=r[a],o[e+0]=i.x,o[e+1]=i.y,o[e+2]=i.z;return o}function Yo(t){for(var e,i,r=t.faces,n=r.length,o=3*n>65535?Uint32Array:Uint16Array,a=new o(3*n),s=0;s<n;s++)e=3*s,i=r[s],a[e+0]=i.a,a[e+1]=i.b,a[e+2]=i.c;return a}function Zo(t){for(var e,i,r,n,o,a,s=t.faces,c=t.vertices.length,u=s.length,l=new Float32Array(3*c),h=0;h<u;h++)i=s[h],r=i.vertexNormals,n=r[0],o=r[1],a=r[2],e=3*i.a,l[e+0]=n.x,l[e+1]=n.y,l[e+2]=n.z,e=3*i.b,l[e+0]=o.x,l[e+1]=o.y,l[e+2]=o.z,e=3*i.c,l[e+0]=a.x,l[e+1]=a.y,l[e+2]=a.z;return l}function Ko(t,e){return!Xp||e&&e.disableImpostor?new wv(t,e):new Cv(t,e)}function Qo(t,e){return new Rv(t,e)}function Jo(t,e){return!Xp||e&&e.disableImpostor?new Fv(t,e):new jv(t,e)}function ta(t,e){return new Wv(t,e)}function ea(t,e){function i(t,e){void 0!==t.toArray?t=t.toArray():void 0!==t.x?t=[t.x,t.y,t.z]:void 0!==t.r&&(t=[t.r,t.g,t.b]),e.push.apply(e,t)}function r(t){S.push(t)}function n(t,e,i,r){if(Array.isArray(t)&&(t=new Float32Array(t)),Array.isArray(e)&&(e=new Float32Array(e)),Array.isArray(i)){var n=(t&&t.length)>65535?Uint32Array:Uint16Array;i=new n(i)}Array.isArray(r)&&(r=new Float32Array(r));var o=new vv({position:t,color:e,index:i,normal:r});S.push(o),w.setFromArray(t),x.union(w)}function o(t,e,r){i(t,A),i(e,M),P.push(r),x.expandByPoint(_.fromArray(t))}function a(t,e,r,n,o){i(t,C),i(e,T),E.push(r),i(n,I),i(o,L),x.expandByPoint(_.fromArray(t))}function s(t,e,r,n){i(t,R),i(e,O),i(r,D),N.push(n),x.expandByPoint(_.fromArray(t)),x.expandByPoint(_.fromArray(e))}function c(t,e,r,n){i(t,k),i(e,F),i(r,B),z.push(n),x.expandByPoint(_.fromArray(t)),x.expandByPoint(_.fromArray(e))}function u(t,e,r,n){i(t,U),i(e,j),i(r,$),V.push(n),x.expandByPoint(_.fromArray(t)),x.expandByPoint(_.fromArray(e))}function l(){var t=[];if(A.length){var e=new Ko({position:new Float32Array(A),color:new Float32Array(M),radius:new Float32Array(P)},{sphereDetail:p,disableImpostor:v});t.push(e)}if(C.length){var i=new Qo({position:new Float32Array(C),color:new Float32Array(T),radius:new Float32Array(E),majorAxis:new Float32Array(I),minorAxis:new Float32Array(L)},{sphereDetail:p,disableImpostor:v});t.push(i)}if(R.length){var r=new Jo({position1:new Float32Array(R),position2:new Float32Array(O),color:new Float32Array(D),color2:new Float32Array(D),radius:new Float32Array(N)},{radialSegments:m,disableImpostor:v,openEnded:y});t.push(r)}if(k.length){var n=new ta({position1:new Float32Array(k),position2:new Float32Array(F),color:new Float32Array(B),radius:new Float32Array(z)},{radialSegments:m,disableImpostor:v,openEnded:y});t.push(n)}if(U.length){var o=new Xv({position1:new Float32Array(U),position2:new Float32Array(j),color:new Float32Array($),radius:new Float32Array(V)},{aspectRatio:f,radialSegments:m,disableImpostor:v,openEnded:y});t.push(o)}return S.concat(t)}function h(){S.forEach(function(t){t.dispose()}),S.length=0,A.length=0,M.length=0,P.length=0,C.length=0,T.length=0,E.length=0,I.length=0,L.length=0,R.length=0,O.length=0,D.length=0,N.length=0,k.length=0,F.length=0,B.length=0,z.length=0,U.length=0,j.length=0,$.length=0,V.length=0}this.name=Hi(t,"shape");var d=e||{},f=Hi(d.aspectRatio,1.5),p=Hi(d.sphereDetail,2),m=Hi(d.radialSegments,50),v=Hi(d.disableImpostor,!1),y=Hi(d.openEnded,!1),b=new g,x=new lt,_=new g,w=new lt,S=[],A=[],M=[],P=[],C=[],T=[],E=[],I=[],L=[],R=[],O=[],D=[],N=[],k=[],F=[],B=[],z=[],U=[],j=[],$=[],V=[];Object.defineProperties(this,{center:{get:function(){return x.center(b)}}}),this.boundingBox=x,this.addBuffer=r,this.addMesh=n,this.addSphere=o,this.addEllipsoid=a,this.addCylinder=s,this.addCone=c,this.addArrow=u,this.getBufferList=l,this.dispose=h}function ia(t,e,i){this.viewer=e,this.gidPool=i?i.gidPool:void 0,this.tasks=new mm,this.queue=new Go(this.make.bind(this)),this.bufferList=[],this.parameters.colorScheme&&(this.parameters.colorScheme.options=Kp.getSchemes()),this.init(i)}function ra(t,e,i){Array.isArray(t)||(t=[t]),ia.call(this,t,e,i),this.buffer=t,this.build()}function na(t){t.visible=!0}function oa(t){t.visible=!1}function aa(t,e,i){ia.call(this,t,e,i),t instanceof Vo?(this.surface=void 0,this.volume=t):(this.surface=t,this.volume=void 0),this.boxCenter=new g,this.__boxCenter=new g,this.box=new lt,this.__box=new lt,this._position=new g,this.setBox=function(){this._position.copy(e.translationGroup.position).negate(),this._position.equals(this.boxCenter)||this.setParameters({boxCenter:this._position})},this.viewer.signals.ticked.add(this.setBox,this),this.build()}function sa(t){function e(t,e,i){return Math.min(Math.max(t,e),i)}function i(t,e,i,r){var n=i-t,o=r-e;return Math.sqrt(n*n+o*o)}function r(t,i,r){return r=e((r-t)/(i-t),0,1),r*r*(3-2*r)}for(var n=Object.assign({},t),o=Hi(n.width,256),a=Hi(n.height,256),s=[o/2,a/2],c=Math.min(o/2,a/2),u=Hi(n.delta,1/(c+1))*c,l=0,h=0,d=new Uint8Array(o*a*4),f=0,p=d.length;f<p;f+=4){var m=i(l,h,s[0],s[1]),g=1-r(c-u,c,m);d[f]=255*g,d[f+1]=255*g,d[f+2]=255*g,d[f+3]=255*g,++l===o&&(l=0,h++)}var v=new me(d,o,a);return v.needsUpdate=!0,v}function ca(t,e,i){ia.call(this,t,e,i),t instanceof Vo?(this.surface=void 0,this.volume=t):(this.surface=t,this.volume=void 0),this.build()}function ua(t,e,i){ia.call(this,t,e,i),this.volume=t,this.build()}function la(t,e,i){var r=i||{};if(this.selection=new Tr(r.sele),
	this.dataList=[],this.structure=t,this.structureView=this.structure.getView(this.selection),ia.call(this,t,e,r),t.biomolDict){var n={default:"default","":t.unitcell?"AU":"FULL"};Object.keys(t.biomolDict).forEach(function(t){n[t]=t}),this.parameters.assembly={type:"select",options:n,rebuild:!0}}else this.parameters.assembly=null;this.selection.signals.stringChanged.add(function(){this.build()}.bind(this)),this.build()}function ha(t,e,i){this.manualAttach=!0,this.trajectory=t,la.call(this,t.structure,e,i)}function da(t){qp.error("makeRepresentation: representation type "+t+" unknown")}function fa(e,i,r,n){t.Debug&&qp.time("makeRepresentation "+e);var o;if(i instanceof Io){if(o=Jp.get(e),!o)return void da(e)}else if(i instanceof Lo)if("surface"===e)o=aa;else{if("dot"!==e)return void da(e);o=ca}else if(i instanceof Vo)if("surface"===e)o=aa;else if("dot"===e)o=ca;else{if("slice"!==e)return void da(e);o=ua}else if(i instanceof fv)o=ha;else if(i instanceof ea)o=ra,i=i.getBufferList();else{if("buffer"!==e)return void qp.error("makeRepresentation: object "+i+" unknown");o=ra}var a=new o(i,r,n);return t.Debug&&qp.timeEnd("makeRepresentation "+e),a}function pa(t,e){return t instanceof RegExp?null!==e.name.match(t):e.name===t}function ma(t,e){var i,r=0,n={};return e.forEach(function(e){i=0;var o={};e.forEach(function(e){o[t[i++]]=e}),n[t[r++]]=o}),n}function ga(t,e,i,r,n){i=Hi(i,!1),r=Hi(r,""),n=Hi(n,"");var o,a,s,c,u;if(i){var l=t,h=e;r&&n&&(l=t.getView(new Tr(r)),h=e.getView(new Tr(n)));var d=l.getSequence(),f=h.getSequence(),p=new yy(d.join(""),f.join(""));p.calc(),p.trace();var m,g,v,y,b;o=0,a=0,s=p.ali1.length;var x=[],_=[];for(m=0;m<s;++m)y=p.ali1[m],b=p.ali2[m],g=0,v=0,"-"===y?_[a]=!1:(_[a]=!0,g=1),"-"===b?x[o]=!1:(x[o]=!0,v=1),o+=g,a+=v;var w=[],S=[],A=l.getAtomProxy(),M=h.getAtomProxy();o=0,l.eachResidue(function(t){void 0!==t.traceAtomIndex&&t.traceAtomIndex===t.getAtomIndexByName("CA")&&(x[o]&&(A.index=t.getAtomIndexByName("CA"),w.push(A.x,A.y,A.z)),o+=1)}),o=0,h.eachResidue(function(t){void 0!==t.traceAtomIndex&&t.traceAtomIndex===t.getAtomIndexByName("CA")&&(_[o]&&(M.index=t.getAtomIndexByName("CA"),S.push(M.x,M.y,M.z)),o+=1)}),c=new Float32Array(w),u=new Float32Array(S)}else{var P=t.getView(new Tr(r+" and .CA")),C=e.getView(new Tr(n+" and .CA"));c=P,u=C}var T=new dv(c,u);T.transform(t),t.refreshPosition()}function va(t,e,i){var r;return r=t&&"Frames"===t.type?new Ky(t,e,i):!t&&e.frames?new Qy(t,e,i):new Jy(t,e,i)}function ya(t,e){this.signals={refreshed:new Cr},this.structure=t,this.selection=e,this.center=new g,this.boundingBox=new lt,this.init(),this.refresh()}function ba(t,e,i){la.call(this,t,e,i)}function xa(t,e,i){la.call(this,t,e,i)}function _a(t,e,i){xa.call(this,t,e,i)}function wa(t,e,i){xa.call(this,t,e,i)}function Sa(t,e){function i(t,i,r,n,o,a,s){a[s+0]=Sr(t.x,i.x,r.x,n.x,o,e),a[s+1]=Sr(t.y,i.y,r.y,n.y,o,e),a[s+2]=Sr(t.z,i.z,r.z,n.z,o,e)}function r(t,i,r,n,o,a){a.x=Sr(t.x,i.x,r.x,n.x,o,e),a.y=Sr(t.y,i.y,r.y,n.y,o,e),a.z=Sr(t.z,i.z,r.z,n.z,o,e)}function n(e,r,n,o,a,s){for(var c=0;c<t;++c){var u=s+3*c,l=h*c;i(e,r,n,o,l,a,u)}}function o(e,i,n,o,a,s){for(var c=0;c<t;++c){var u=h*c,l=u-d,m=u+d,g=s+3*c;l<0&&(l=0),m>1&&(m=1),r(e,i,n,o,l,f),r(e,i,n,o,m,p),p.sub(f).normalize(),p.toArray(a,g)}}function a(e,i,r,n,o){for(var a,s=i.next(),c=i.next(),u=i.next(),l=i.size,h=l-1,d=n||0,f=0;f<h;++f)a=s,s=c,c=u,u=i.next(),e(a,s,c,u,r,d),d+=3*t;o&&(a=i.get(l-2),s=i.get(l-1),c=i.get(0),u=i.get(1),e(a,s,c,u,r,d),d+=3*t)}function s(e,i,n,o,a,s,c,u,l,d,g,_,w){for(var S=0;S<t;++S){var A=_+3*S;w&&(A+=3*x);var M=h*S;r(e,i,n,o,M,f),r(a,s,c,u,M,p),m.subVectors(p,f).normalize(),v.fromArray(l,A),b.crossVectors(m,v).normalize(),b.toArray(g,A),y.crossVectors(v,b).normalize(),y.toArray(d,A)}}function c(e,i,r,n,o){for(var a=0;a<t;++a){var s=o+3*a;e.copy(y),v.fromArray(i,s),b.crossVectors(e,v).normalize(),b.toArray(n,s),y.crossVectors(v,b).normalize(),y.toArray(r,s)}}function u(e,i,r,n,o,a,s){var c,u;for(c=0;c<x;++c)u=s+3*c,r(e,o,u),n(e,a,u);for(c=x;c<t;++c)u=s+3*c,r(i,o,u),n(i,a,u)}function l(e,i,r,n,o){for(var a=r(e),s=r(i),c=0;c<t;++c){var u=c/t;n[o+c]=(1-u)*a+u*s}}var h=1/t,d=1e-4,f=new g,p=new g;this.getPosition=function(e,i,r,o){e.reset(),a(n,e,i,r,o);var s=e.size-1,c=s*t*3;o&&(c+=3*t);var u=e.get(o?0:s);i[c]=u.x,i[c+1]=u.y,i[c+2]=u.z},this.getTangent=function(e,i,r,n){e.reset(),a(o,e,i,r,n);var s=e.size-1,c=s*t*3;n&&(c+=3*t),Kr(i,i,c-3,c,3)};var m=new g,v=new g,y=new g,b=new g,x=Math.ceil(t/2);this.getNormal=function(e,i,r,n,o,a){y.set(0,0,1);for(var s=e,u=s-1,l=o||0,h=0;h<u;++h)c(m,i,r,n,l),l+=3*t;a&&(c(m,i,r,n,l),l+=3*t),b.toArray(n,l),y.toArray(r,l)},this.getNormalDir=function(e,i,r,n,o,a,c,u){e.reset(),i.reset();var l=new g,h=new g,d=new g,f=new g,p=new g,m=(new g).copy(e.next()),v=(new g).copy(e.next()),_=(new g).copy(e.next()),w=new g,S=(new g).copy(i.next()),A=(new g).copy(i.next()),M=(new g).copy(i.next());y.set(0,0,1);for(var P=e.size,C=P-1,T=a||0,E=0;E<C;++E)p.copy(m),m.copy(v),v.copy(_),_.copy(e.next()),w.copy(S),S.copy(A),A.copy(M),M.copy(i.next()),0===E?(l.subVectors(w,p),h.subVectors(S,m),l.dot(h)<0&&(h.multiplyScalar(-1),S.addVectors(m,h)),d.subVectors(A,v),h.dot(d)<0&&(d.multiplyScalar(-1),A.addVectors(v,d))):d.copy(f),f.subVectors(M,_),d.dot(f)<0&&(f.multiplyScalar(-1),M.addVectors(_,f)),s(p,m,v,_,w,S,A,M,r,n,o,T,u),T+=3*t;if(c&&(p.copy(e.get(P-2)),m.copy(e.get(P-1)),v.copy(e.get(0)),_.copy(e.get(1)),w.copy(i.get(P-2)),S.copy(i.get(P-1)),A.copy(i.get(0)),M.copy(i.get(1)),d.copy(f),f.subVectors(M,_),d.dot(f)<0&&(f.multiplyScalar(-1),M.addVectors(_,f)),s(p,m,v,_,w,S,A,M,r,n,o,T,u),T+=3*t),u){b.fromArray(o,3*x),y.fromArray(n,3*x);for(var I=0;I<x;++I)b.toArray(o,3*I),y.toArray(n,3*I)}else b.toArray(o,T),y.toArray(n,T)},this.getColor=function(e,i,r,n,o,a,s){e.reset();for(var c=e.next(),l=e.next(),h=e.size,d=h-1,f=a||0,p=0;p<d;++p)c=l,l=e.next(),u(c,l,i,r,n,o,f),f+=3*t;s&&(c=e.get(h-1),l=e.get(0),u(c,l,i,r,n,o,f),f+=3*t),n[f]=n[f-3],n[f+1]=n[f-2],n[f+2]=n[f-1],o[f]=o[f-3],o[f+1]=o[f-2],o[f+2]=o[f-1]},this.getSize=function(e,i,r,n,o){e.reset();for(var a=e.next(),s=e.next(),c=e.size,u=c-1,h=n||0,d=0;d<u;++d)a=s,s=e.next(),l(a,s,i,r,h),h+=t;o&&(a=e.get(c-1),s=e.get(0),l(a,s,i,r,h),h+=t),r[h]=r[h-1]}}function Aa(t,e){this.polymer=t,this.size=t.residueCount;var i=e||{};this.directional=i.directional||!1,this.positionIterator=i.positionIterator||!1,this.subdiv=i.subdiv||1,this.smoothSheet=i.smoothSheet||!1,isNaN(i.tension)?this.tension=this.polymer.isNucleic()?.5:.9:this.tension=i.tension||.5,this.interpolator=new Sa(this.subdiv,this.tension)}function Ma(t,e,i){la.call(this,t,e,i)}function Pa(t,e){this.sview1=t,this.sview2=e,this.kdtree2=new ao(e)}function Ca(t,e,i){e=e||3.5,i=i||40;for(var r=new Tr("( ARG and ( .NE or .NH1 or .NH2 ) ) or ( ASP and .ND2 ) or ( GLN and .NE2 ) or ( HIS and ( .ND1 or .NE2 ) ) or ( LYS and .NZ ) or ( SER and .OG ) or ( THR and .OG1 ) or ( TRP and .NE1 ) or ( TYR and .OH ) or ( PROTEIN and .N )"),n=new Tr("( ASN and .OD1 ) or ( ASP and ( OD1 or .OD2 ) ) or ( GLN and .OE1 ) or ( GLU and ( .OE1 or .OE2 ) ) or ( HIS and ( .ND1 or .NE2 ) ) or ( SER and .OG ) or ( THR and .OG1 ) or ( TYR and .OH ) or ( PROTEIN and .O )"),o=t.getView(r),a=t.getView(n),s=new Pa(o,a),c=s.within(e),u=c.bondStore,l=t.getAtomProxy(),h=t.getAtomProxy(),d=t.getAtomProxy(),f=t.getAtomProxy(),p=t.getResidueProxy(),m=t.getResidueProxy(),v=new g,y=new g,b=function(t,e,r,n){var o,a;t.atomname===r?(o=t,a=e):(o=e,a=t),p.index=o.residueIndex;var s=p.getAtomIndexByName(n);return v.subVectors(s,o),y.subVectors(s,a),gr(v.angleTo(y))<i},x=0,_=u.count;x<_;++x)if(l.index=u.atomIndex1[x],h.index=u.atomIndex2[x],"O"===l.atomname&&"N"===h.atomname||"N"===l.atomname&&"O"===h.atomname)c.bondSet.flip_unsafe(x);else if("N"===l.atomname||"N"===h.atomname){var w,S;if("N"===l.atomname?(w=l,S=h):(w=h,S=l),p.index=w.residueIndex,d.index=p.getAtomIndexByName("CA"),void 0===d.index)continue;var A=p.getPreviousConnectedResidue(m);if(void 0===A)continue;if(f.index=A.getAtomIndexByName("C"),void 0===f.index)continue;v.subVectors(w,f),y.subVectors(w,d),v.add(y).multiplyScalar(.5),y.subVectors(S,w),gr(v.angleTo(y))>i&&c.bondSet.flip_unsafe(x)}else("OH"===l.atomname&&"TYR"===l.resname||"OH"===h.atomname&&"TYR"===h.resname)&&(b(l,h,"OH","CZ")||c.bondSet.flip_unsafe(x));return{atomSet:c.atomSet,bondSet:c.bondSet,bondStore:c.bondStore}}function Ta(t,e,i){e=e||3.5,i=i||40;for(var r=new Tr("( PROTEIN and .N )"),n=new Tr("( PROTEIN and .O )"),o=t.getView(r),a=t.getView(n),s=new Pa(o,a),c=s.within(e),u=c.bondStore,l=t.getAtomProxy(),h=t.getAtomProxy(),d=t.getAtomProxy(),f=t.getAtomProxy(),p=t.getResidueProxy(),m=t.getResidueProxy(),v=new g,y=new g,b=0,x=u.count;b<x;++b){l.index=u.atomIndex1[b],h.index=u.atomIndex2[b];var _,w;if("N"===l.atomname?(_=l,w=h):(_=h,w=l),p.index=_.residueIndex,d.index=p.getAtomIndexByName("CA"),void 0!==d.index){var S=p.getPreviousConnectedResidue(m);void 0!==S&&(f.index=S.getAtomIndexByName("C"),void 0!==f.index&&(v.subVectors(_,f),y.subVectors(_,d),v.add(y).multiplyScalar(.5),y.subVectors(w,_),gr(v.angleTo(y))>i&&c.bondSet.flip_unsafe(b)))}}return{atomSet:c.atomSet,bondSet:c.bondSet,bondStore:c.bondStore}}function Ea(t,e,i){la.call(this,t,e,i)}function Ia(t){var e=JSON.stringify(t);return void 0===sb[e]&&(sb[e]=new cb(t)),sb[e]}function La(t,e,i){la.call(this,t,e,i)}function Ra(t,e,i){la.call(this,t,e,i)}function Oa(t,e,i){xa.call(this,t,e,i)}function Da(t,e){var i=t.material.uniforms;i.modelViewMatrixInverse&&i.modelViewMatrixInverse.value.getInverse(t.modelViewMatrix),i.modelViewMatrixInverseTranspose&&(i.modelViewMatrixInverse?i.modelViewMatrixInverseTranspose.value.copy(i.modelViewMatrixInverse.value).transpose():i.modelViewMatrixInverseTranspose.value.getInverse(t.modelViewMatrix).transpose()),i.modelViewProjectionMatrix&&i.modelViewProjectionMatrix.value.multiplyMatrices(e.projectionMatrix,t.modelViewMatrix),i.modelViewProjectionMatrixInverse&&(i.modelViewProjectionMatrix?(pb.copy(i.modelViewProjectionMatrix.value),i.modelViewProjectionMatrixInverse.value.getInverse(pb)):(pb.multiplyMatrices(e.projectionMatrix,t.modelViewMatrix),i.modelViewProjectionMatrixInverse.value.getInverse(pb)))}function Na(t,e){return!Xp||e&&e.disableImpostor?(t.radius=Zr(t.radius1,t.radius2),new Fv(t,e)):new mb(t,e)}function ka(t,e,i){Oa.call(this,t,e,i),this.defaultScale.vdw=.2}function Fa(t,e){this.type=t,this.text=e||{}}function Ba(t,e,i){la.call(this,t,e,i)}function za(t,e,i){la.call(this,t,e,i)}function Ua(t,e,i,r,n){function o(t,r,o){return((t*e+r)*i+o)*n}r=r||Int32Array,n=n||1;var a,s=new r(t*e*i*n);this.data=s,this.index=o,this.set=function(t,e,i){var r=arguments,c=o(t,e,i);for(a=0;a<n;++a)s[c+a]=r[3+a]},this.toArray=function(t,e,i,r,c){var u=o(t,e,i);for(void 0===r&&(r=[]),void 0===c&&(c=0),a=0;a<n;++a)r[a]=s[u+a]},this.fromArray=function(t,e,i,r,c){var u=o(t,e,i);for(void 0===c&&(c=0),a=0;a<n;++a)s[u+a]=r[c+a]},this.copy=function(t){this.data.set(t.data)},this.clone=function(){return new Ua(t,e,i,r,n).copy(this)}}function ja(t,e,i){function r(t,e,i,r,o){m=e||1.4,g=i||2,P=o||!0;var a=0;for(var s in f)a=Math.max(a,s);var c=jo(I,L,a,g,t?m:0);y=c.dim[0],b=c.dim[1],x=c.dim[2],_=c.matrix,w=c.tran,g=c.scaleFactor,S={},A={},n(t),M=m*g,v=r?r:m/g,C=new Uint8Array(y*b*x),t&&(T=new Float64Array(y*b*x)),P&&(E=new Int32Array(y*b*x))}function n(t){var e,i,r,n,o,a,s,c,u,l;for(var h in f)if(e=f[h],!S[h]){for(s=t?(e+m)*g+.5:e*g+.5,a=s*s,c=Math.floor(s)+1,u=new Int32Array(c*c),l=0,i=0;i<c;++i)for(r=0;r<c;++r)n=i*i+r*r,n>a?u[l]=-1:(o=Math.sqrt(a-n),u[l]=Math.floor(o)),++l;A[h]=c,S[h]=u}}function o(i){var r,n,o,a,s,c,u,l,h,d,f,p,m,v,_,M,T,I,L=3*i,O=i;r=Math.floor(.5+g*(t[L]+w[0])),n=Math.floor(.5+g*(t[L+1]+w[1])),o=Math.floor(.5+g*(t[L+2]+w[2]));var D,N=e[O],k=S[N],F=0,B=b*x,z=A[N];for(d=0;d<z;++d)for(f=0;f<z;++f){if(D=k[F],D!=-1)for(M=-1;M<2;++M)for(T=-1;T<2;++T)for(I=-1;I<2;++I)if(0!==M&&0!==T&&0!==I)for(u=M*d,h=I*f,p=0;p<=D;++p)if(l=p*T,m=r+u,v=n+l,_=o+h,!(m<0||v<0||_<0||m>=y||v>=b||_>=x)){var U=m*B+v*x+_;if(P)if(C[U]&R){if(C[U]&R){var j=E[U];j!==L&&(a=r+u-Math.floor(.5+g*(t[j]+w[0])),s=n+l-Math.floor(.5+g*(t[j+1]+w[1])),c=o+h-Math.floor(.5+g*(t[j+2]+w[2])),u*u+l*l+h*h<a*a+s*s+c*c&&(E[U]=i))}}else C[U]|=R,E[U]=i;else C[U]|=R}F++}}function a(e){console.time("EDTSurface fillvoxels");var i,r;for(i=0,r=C.length;i<r;++i)C[i]=0,e&&(T[i]=-1),P&&(E[i]=-1);for(i=0,r=t.length/3;i<r;++i)o(i);for(i=0,r=C.length;i<r;++i)C[i]&R&&(C[i]|=O);console.timeEnd("EDTSurface fillvoxels")}function s(i){var r,n,o,a,s,c,u,l,h,d,f,p,m,v,_,M,T,I,L,R=3*i,D=i,N=0;r=Math.floor(.5+g*(t[R]+w[0])),n=Math.floor(.5+g*(t[R+1]+w[1])),o=Math.floor(.5+g*(t[R+2]+w[2]));var k=e[D],F=b*x;for(m=0,L=A[k];m<L;++m)for(v=0;v<L;++v){if(S[k][N]!=-1)for(M=-1;M<2;++M)for(T=-1;T<2;++T)for(I=-1;I<2;++I)if(0!==M&&0!==T&&0!==I)for(u=M*m,h=I*v,_=0;_<=S[k][N];++_)if(l=_*T,d=r+u,f=n+l,p=o+h,!(d<0||f<0||p<0||d>=y||f>=b||p>=x)){var B=d*F+f*x+p;if(C[B]&O){if(P){var z=E[B];a=Math.floor(.5+g*(t[z]+w[0])),s=Math.floor(.5+g*(t[z+1]+w[1])),c=Math.floor(.5+g*(t[z+2]+w[2])),u*u+l*l+h*h<a*a+s*s+c*c&&(E[B]=i)}}else C[B]|=O,P&&(E[B]=i)}N++}}function c(){var e,i;for(e=0,i=C.length;e<i;++e)C[e]&=~O;for(e=0,i=t.length/3;e<i;++e)s(e)}function u(){var t,e,i,r=b*x;for(t=0;t<y;++t)for(e=0;e<x;++e)for(i=0;i<b;++i){var n=t*r+i*x+e;if(C[n]&R)for(var o=0;o<26;){var a=t+N[o][0],s=e+N[o][2],c=i+N[o][1];if(a>-1&&a<y&&c>-1&&c<b&&s>-1&&s<x&&!(C[a*r+c*x+s]&R)){C[n]|=D;break}o++}}}function l(){console.time("EDTSurface fastdistancemap");var t,e,i,r,n,o=new Ua(y,b,x,Uint16Array,3),a=b*x,s=M*M,c=0;for(t=0;t<y;++t)for(e=0;e<b;++e)for(i=0;i<x;++i)n=t*a+e*x+i,C[n]&=~O,C[n]&R&&C[n]&D&&(o.set(t,e,i,t,e,i),T[n]=0,C[n]|=O,c+=1);var u=new Int32Array(3*c),l=0,d=new Int32Array(3*c),f=0;for(t=0;t<y;++t)for(e=0;e<b;++e)for(i=0;i<x;++i)n=t*a+e*x+i,C[n]&D&&(u[l]=t,u[l+1]=e,u[l+2]=i,l+=3,C[n]&=~D);do for(f=h(u,o,l,d),l=0,t=0,r=f;t<r;t+=3)n=a*d[t]+x*d[t+1]+d[t+2],C[n]&=~D,T[n]<=1.0404*s&&(u[l]=d[t],u[l+1]=d[t+1],u[l+2]=d[t+2],l+=3);while(l>0);var p,m=v*v,g=new Uint16Array(3);for(t=0;t<y;++t)for(e=0;e<b;++e)for(i=0;i<x;++i)n=t*a+e*x+i,C[n]&=~D,C[n]&R&&(C[n]&O&&!(C[n]&O&&T[n]>=m)||(C[n]|=D,P&&C[n]&O&&(o.toArray(t,e,i,g),p=g[0]*a+g[1]*x+g[2],E[n]=E[p])));console.timeEnd("EDTSurface fastdistancemap")}function h(t,e,i,r){var n,o,a,s,c,u,l,h,d,f,p,m,g=new Uint16Array(3),v=0;if(0===i)return v;var _=-1,w=-1,S=-1,A=b*x;for(l=0,d=i;l<d;l+=3)for(n=t[l],o=t[l+1],a=t[l+2],e.toArray(n,o,a,g),h=0;h<6;++h)m=N[h],_=n+m[0],w=o+m[1],S=a+m[2],_<y&&_>-1&&w<b&&w>-1&&S<x&&S>-1&&(p=_*A+x*w+S,C[p]&R&&!(C[p]&O)?(e.fromArray(_,w,S,g),s=_-g[0],c=w-g[1],u=S-g[2],f=s*s+c*c+u*u,T[p]=f,C[p]|=O,C[p]|=D,r[v]=_,r[v+1]=w,r[v+2]=S,v+=3):C[p]&R&&C[p]&O&&(s=_-g[0],c=w-g[1],u=S-g[2],f=s*s+c*c+u*u,f<T[p]&&(e.fromArray(_,w,S,g),T[p]=f,C[p]&D||(C[p]|=D,r[v]=_,r[v+1]=w,r[v+2]=S,v+=3))));for(l=0,d=i;l<d;l+=3)for(n=t[l],o=t[l+1],a=t[l+2],e.toArray(n,o,a,g),h=6;h<18;h++)m=N[h],_=n+m[0],w=o+m[1],S=a+m[2],_<y&&_>-1&&w<b&&w>-1&&S<x&&S>-1&&(p=_*A+x*w+S,C[p]&R&&!(C[p]&O)?(e.fromArray(_,w,S,g),s=_-g[0],c=w-g[1],u=S-g[2],f=s*s+c*c+u*u,T[p]=f,C[p]|=O,C[p]|=D,r[v]=_,r[v+1]=w,r[v+2]=S,v+=3):C[p]&R&&C[p]&O&&(s=_-g[0],c=w-g[1],u=S-g[2],f=s*s+c*c+u*u,f<T[p]&&(e.fromArray(_,w,S,g),T[p]=f,C[p]&D||(C[p]|=D,r[v]=_,r[v+1]=w,r[v+2]=S,v+=3))));for(l=0,d=i;l<d;l+=3)for(n=t[l],o=t[l+1],a=t[l+2],e.toArray(n,o,a,g),h=18;h<26;h++)m=N[h],_=n+m[0],w=o+m[1],S=a+m[2],_<y&&_>-1&&w<b&&w>-1&&S<x&&S>-1&&(p=_*A+x*w+S,C[p]&R&&!(C[p]&O)?(e.fromArray(_,w,S,g),s=_-g[0],c=w-g[1],u=S-g[2],f=s*s+c*c+u*u,T[p]=f,C[p]|=O,C[p]|=D,r[v]=_,r[v+1]=w,r[v+2]=S,v+=3):C[p]&R&&C[p]&O&&(s=_-g[0],c=w-g[1],u=S-g[2],f=s*s+c*c+u*u,f<T[p]&&(e.fromArray(_,w,S,g),T[p]=f,C[p]&D||(C[p]|=D,r[v]=_,r[v+1]=w,r[v+2]=S,v+=3))));return v}function d(t){var e,i=C.length;if("vws"===t)for(e=0;e<i;++e)C[e]&=~D,C[e]=C[e]&O?1:0;else if("ms"===t)for(e=0;e<i;++e)C[e]&=~O,C[e]&D&&(C[e]|=O),C[e]&=~D,C[e]=C[e]&O?1:0;else if("ses"===t)for(e=0;e<i;++e)C[e]&D&&C[e]&O?C[e]&=~D:C[e]&D&&!(C[e]&O)&&(C[e]|=O),C[e]=C[e]&O?1:0;else if("sas"===t)for(e=0;e<i;++e)C[e]&=~D,C[e]=C[e]&O?1:0}var f=Uo(e),p=ln(t);0===t.length&&(p[0].set([0,0,0]),p[1].set([0,0,0]));var m,g,v,y,b,x,_,w,S,A,M,P,C,T,E,I=p[0],L=p[1],R=1,O=2,D=4,N=[new Int32Array([1,0,0]),new Int32Array([-1,0,0]),new Int32Array([0,1,0]),new Int32Array([0,-1,0]),new Int32Array([0,0,1]),new Int32Array([0,0,-1]),new Int32Array([1,1,0]),new Int32Array([1,-1,0]),new Int32Array([-1,1,0]),new Int32Array([-1,-1,0]),new Int32Array([1,0,1]),new Int32Array([1,0,-1]),new Int32Array([-1,0,1]),new Int32Array([-1,0,-1]),new Int32Array([0,1,1]),new Int32Array([0,1,-1]),new Int32Array([0,-1,1]),new Int32Array([0,-1,-1]),new Int32Array([1,1,1]),new Int32Array([1,1,-1]),new Int32Array([1,-1,1]),new Int32Array([-1,1,1]),new Int32Array([1,-1,-1]),new Int32Array([-1,-1,1]),new Int32Array([-1,1,-1]),new Int32Array([-1,-1,-1])];this.getVolume=function(t,e,o,s,h){console.time("EDTSurface.getVolume");var f="vws"!==t;r(f,e,o,s,h),a(f),u(),"ms"!==t&&"ses"!==t||l(),"ses"===t&&(n(!1),c()),d(t);for(var p=0,m=E.length;p<m;++p)E[p]=i[E[p]];return console.timeEnd("EDTSurface.getVolume"),{data:C,nx:x,ny:b,nz:y,atomindex:E}},this.getSurface=function(t,e,i,r,n,o,a){var s=this.getVolume(t,e,i,r,n),c=new $o(s.data,s.nx,s.ny,s.nz,s.atomindex);return c.getSurface(1,o,void 0,_,a)}}function $a(t,e,i,r,n,o,a){function s(t,e){return Math.floor((t-e)/a)}for(var c=t.length,u=n[0],l=n[1],h=n[2],d=o[0],f=o[1],p=o[2],m=s(d,u)+1,g=s(f,l)+1,v=s(p,h)+1,y=m*g*v,b=g*v,x=function(t,e,i){return(s(t,u)*g+s(e,l))*v+s(i,h)},_=[],w=0;w<c;w++){var S=x(t[w],e[w],i[w]);void 0===_[S]?_[S]=[w]:_[S].push(w)}var A=new Uint32Array(y),M=new Uint16Array(y),P=new Uint32Array(c),C=0,T=0;for(w=0;w<y;w++){var E=A[w]=C,I=_[w];if(void 0!==I)for(var L=0;L<I.length;L++)P[C]=I[L],C++;var R=C-E;M[w]=R,R>T&&(T=R)}this.neighbourListLength=27*T+1,this.withinRadii=function(n,o,a,c,d){for(var f=0,p=s(n,u),y=s(o,l),x=s(a,h),_=Math.max(0,p-1),w=Math.max(0,y-1),S=Math.max(0,x-1),C=Math.min(m,p+1),T=Math.min(g,y+1),E=Math.min(v,x+1),I=_;I<=C;++I)for(var L=I*b,R=w;R<=T;++R)for(var O=R*v,D=S;D<=E;++D)for(var N=L+O+D,k=A[N],F=k+M[N],B=k;B<F;B++){var z=P[B],U=t[z]-n,j=e[z]-o,$=i[z]-a,V=r[z]+c;U*U+j*j+$*$<=V*V&&(d[f++]=P[B])}d[f]=-1}}function Va(t,e,i){function r(t,i,r,n){C=Hi(t,1.4),T=Hi(i,2),E=Hi(r,!0),I=Hi(n,30),A=new Float32Array(v),M=new Float32Array(v);for(var c=0;c<A.length;++c){var u=e[c]+C;A[c]=u,M[c]=u*u}P=0;for(var l=0;l<A.length;++l)A[l]>P&&(P=A[l]);o(),a(),s(),H=-1}function n(t,e,i){for(var r=0;r<t.length;r++)t[r]=e+i*r}function o(){var t=jo(V,G,P,T,0);T=t.scaleFactor,L=t.dim,R=t.matrix,$=Math.min(5,2+Math.floor(C*T)),O=Xr(L[0]*L[1]*L[2],-1001),D=new Int32Array(O.length),N=new Float32Array(L[0]),k=new Float32Array(L[1]),F=new Float32Array(L[2]),n(N,V[0],1/T),n(k,V[1],1/T),n(F,V[2],1/T)}function a(){var t=0,e=2*Math.PI/I;z=new Float32Array(I),B=new Float32Array(I);for(var i=0;i<I;i++)z[i]=Math.cos(t),B[i]=Math.sin(t),t+=e}function s(){U=new $a(y,b,x,A,V,G,2.01*P),j=new Int32Array(U.neighbourListLength)}function c(t,e,i,r,n){var o;if(H!==-1){if(o=H,o!==r&&o!==n&&u(o,t,e,i))return o;H=-1}var a=0;for(o=j[a];o>=0;){if(o!==r&&o!==n&&u(o,t,e,i))return H=o,o;o=j[++a]}return H=-1,-1}function u(e,i,r,n){var o=3*e,a=M[e],s=t[o]-i,c=t[o+1]-r,u=t[o+2]-n,l=s*s+c*c+u*u;return l<a}function l(){for(var t=0;t<v;t++){var e=y[t],i=b[t],r=x[t],n=A[t],o=M[t];U.withinRadii(e,i,r,n,j);for(var a=Math.ceil(n*T),s=Math.floor(T*(e-V[0])),u=Math.floor(T*(i-V[1])),l=Math.floor(T*(r-V[2])),h=Math.max(0,s-a),d=Math.max(0,u-a),f=Math.max(0,l-a),p=Math.min(L[0],s+a+2),m=Math.min(L[1],u+a+2),g=Math.min(L[2],l+a+2),_=h;_<p;_++)for(var w=N[_]-e,S=L[1]*L[2]*_,P=d;P<m;P++)for(var C=k[P]-i,I=w*w+C*C,R=S+L[2]*P,B=f;B<g;B++){var z=F[B]-r,$=I+z*z;if($<o){var G=B+R;O[G]<0&&(O[G]=-O[G]);var H=Math.sqrt($),W=n/H,X=w*W,q=C*W,Y=z*W;if(X+=e,q+=i,Y+=r,c(X,q,Y,t,-1)===-1){var Z=n-H;Z<O[G]&&(O[G]=Z,E&&(D[G]=t))}}}}}function h(){for(var t=0;t<v;t++){U.withinRadii(y[t],b[t],x[t],A[t],j);for(var e=0,i=j[e];i>=0;)t<i&&d(t,i),i=j[++e]}}function d(t,e){var i=A[t],r=A[e],n=W[0]=y[e]-y[t],o=W[1]=b[e]-b[t],a=W[2]=x[e]-x[t],s=n*n+o*o+a*a,u=Math.sqrt(s),l=(i*i+u*u-r*r)/(2*i*u),h=i*l;_n(W,W),f(X,W),_n(X,X),mn(q,W,X),_n(q,q);var d=Math.sqrt(i*i-h*h);xn(X,X,d),xn(q,q,d),xn(W,W,h),W[0]+=y[t],W[1]+=b[t],W[2]+=x[t],H=-1;for(var p=$,m=0;m<I;m++){var g=z[m],v=B[m],_=W[0]+g*X[0]+v*q[0],w=W[1]+g*X[1]+v*q[1],S=W[2]+g*X[2]+v*q[2];if(c(_,w,S,t,e)==-1)for(var M=Math.floor(T*(_-V[0])),P=Math.floor(T*(w-V[1])),C=Math.floor(T*(S-V[2])),R=Math.max(0,M-p),U=Math.max(0,P-p),j=Math.max(0,C-p),G=Math.min(L[0],M+p+2),Y=Math.min(L[1],P+p+2),Z=Math.min(L[2],C+p+2),K=R;K<G;K++){n=_-N[K];for(var Q=L[1]*L[2]*K,J=U;J<Y;J++){o=w-k[J];for(var tt=n*n+o*o,et=Q+L[2]*J,it=j;it<Z;it++){a=S-F[it],s=tt+a*a;var rt=it+et,nt=O[rt];nt>0&&s<nt*nt&&(O[rt]=Math.sqrt(s),E&&(D[rt]=t))}}}}}function f(t,e){return t[0]=t[1]=t[2]=1,0!=e[0]?t[0]=(e[1]+e[2])/-e[0]:0!=e[1]?t[1]=(e[0]+e[2])/-e[1]:0!=e[2]&&(t[2]=(e[0]+e[1])/-e[2]),t}function p(){for(var t=0;t<O.length;t++)O[t]<0&&(O[t]=0)}function m(){for(var t=0;t<D.length;t++)D[t]=i[D[t]]}function g(t,e,i){console.time("AVSurface.getVolume"),console.time("AVSurface.init"),r(t,e,i),console.timeEnd("AVSurface.init"),console.time("AVSurface.projectPoints"),l(),console.timeEnd("AVSurface.projectPoints"),console.time("AVSurface.projectTorii"),h(),console.timeEnd("AVSurface.projectTorii"),p(),m(),console.timeEnd("AVSurface.getVolume")}for(var v=e.length,y=new Float32Array(v),b=new Float32Array(v),x=new Float32Array(v),_=0;_<v;_++){var w=3*_;y[_]=t[w],b[_]=t[w+1],x[_]=t[w+2]}var S=ln(t);0===t.length&&(S[0].set([0,0,0]),S[1].set([0,0,0]));var A,M,P,C,T,E,I,L,R,O,D,N,k,F,B,z,U,j,$,V=S[0],G=S[1],H=-1,W=new Float32Array([0,0,0]),X=new Float32Array([0,0,0]),q=new Float32Array([0,0,0]);this.getSurface=function(t,e,i,r,n,o,a){g(e,i,n);var s=new $o(O,L[2],L[1],L[0],D);return s.getSurface(e,!1,void 0,R,a)}}function Ga(t){this.structure=t}function Ha(t,e,i){this.__infoList=[],la.call(this,t,e,i),this.structure.signals.refreshed.add(function(){this.__forceNewMolsurf=!0},this)}function Wa(t,e,i){la.call(this,t,e,i)}function Xa(t,e,i){la.call(this,t,e,i),this.defaultScale.sstruc*=3}function qa(t,e,i){this.helixbundleList=[],la.call(this,t,e,i)}function Ya(t,e,i){Ma.call(this,t,e,i)}function Za(t,e,i){la.call(this,t,e,i)}function Ka(t,e,i){la.call(this,t,e,i)}function Qa(t,e,i){Ma.call(this,t,e,i)}function Ja(t,e,i){la.call(this,t,e,i)}function ts(t){function e(t){for(var e=h.atomCount[t],n=h.atomOffset[t],o=new Array(e),a=0;a<e;++a)o[a]=l.atomTypeId[n+a];h.residueTypeId[t]=p.add(i,o,r)}var i,r,n=null,o=null,a=null,s=null,c=null,u=null,l=t.atomStore,h=t.residueStore,d=t.chainStore,f=t.modelStore,p=t.residueMap,m=-1,g=-1,v=-1,y=-1;this.addAtom=function(t,p,b,x,_,w,S,A){var M=!1,P=!1,C=!1;n!==t?(M=!0,P=!0,C=!0,y+=1,v+=1,g+=1):o!==b?(P=!0,C=!0,v+=1,g+=1):s===_&&a===x&&c===A||(C=!0,g+=1),m+=1,M&&(f.growIfFull(),f.chainOffset[y]=v,f.chainCount[y]=0,f.count+=1,d.modelIndex[v]=y),P&&(d.growIfFull(),d.setChainname(v,p),d.setChainid(v,b),d.residueOffset[v]=g,d.residueCount[v]=0,d.count+=1,d.modelIndex[v]=y,f.chainCount[y]+=1,h.chainIndex[g]=v),C&&(i=a,r=u,g>0&&e(g-1),h.growIfFull(),h.resno[g]=_,void 0!==S&&(h.sstruc[g]=S.charCodeAt(0)),void 0!==A&&(h.inscode[g]=A.charCodeAt(0)),h.atomOffset[g]=m,h.atomCount[g]=0,h.count+=1,h.chainIndex[g]=v,d.residueCount[v]+=1),l.count+=1,l.residueIndex[m]=g,h.atomCount[g]+=1,n=t,o=b,a=x,s=_,c=A,u=w},this.finalize=function(){i=a,r=u,g>-1&&e(g)}}function es(t){switch(t=t.toLowerCase()){case"polymer":return lg;case"non-polymer":return hg;case"macrolide":return dg;case"water":return fg;default:return ug}}function is(t,e){Array.isArray(t[e])||Object.keys(t).forEach(function(e){t[e]=[t[e]]})}function rs(t){return"?"!==t}function ns(t,e){return rs(t)?t:e}function os(t){switch(t.toLowerCase()){case"?":case"sing":return 1;case"doub":return 2;case"trip":return 3;case"quad":return 4}return 0}function as(t,e,i){var r,n,o=e.atomStore,a=e.atomMap,s=t.chem_comp,c=t.chem_comp_atom,u=t.chem_comp_bond;s&&(s.name&&(e.title=s.name.trim().replace(Db,"")),s.id&&(e.id=s.id.trim().replace(Db,"")));var l={};if(c){var h,d,f,p;for(n=c.comp_id.length,r=0;r<n;++r)o.growIfFull(),h=c.atom_id[r].replace(Ob,""),d=c.type_symbol[r],l[h]=r,o.atomTypeId[r]=a.add(h,d),o.x[r]=c.model_Cartn_x[r],o.y[r]=c.model_Cartn_y[r],o.z[r]=c.model_Cartn_z[r],o.serial[r]=r,f=c.pdbx_component_comp_id[r],p=c.pdbx_residue_numbering?c.pdbx_residue_numbering[r]:1,i.addAtom(0,"","",f,p,1);for(r=0;r<n;++r){var m=r+n;o.growIfFull(),h=c.atom_id[r].replace(Ob,""),d=c.type_symbol[r],o.atomTypeId[m]=a.add(h,d),o.x[m]=c.pdbx_model_Cartn_x_ideal[r],o.y[m]=c.pdbx_model_Cartn_y_ideal[r],o.z[m]=c.pdbx_model_Cartn_z_ideal[r],o.serial[m]=m,f=c.pdbx_component_comp_id[r],p=c.pdbx_residue_numbering?c.pdbx_residue_numbering[r]:1,i.addAtom(1,"","",f,p,1)}}if(c&&u){var g,v,y;n=u.comp_id.length;var b=c.comp_id.length,x=e.getAtomProxy(),_=e.getAtomProxy();for(r=0;r<n;++r)g=u.atom_id_1[r].replace(Ob,""),v=u.atom_id_2[r].replace(Ob,""),y=os(u.value_order[r]),x.index=l[g],_.index=l[v],e.bondStore.growIfFull(),e.bondStore.addBond(x,_,y),x.index+=b,_.index+=b,e.bondStore.growIfFull(),e.bondStore.addBond(x,_,y)}}function ss(t,e,i){var r,n,o,a,s=[],c=[],u=t.struct_conf;if(u)for(is(u,"id"),r=0,n=u.beg_auth_seq_id.length;r<n;++r){var l=parseInt(u.pdbx_PDB_helix_class[r]);Number.isNaN(l)||(o=u.pdbx_beg_PDB_ins_code[r],a=u.pdbx_end_PDB_ins_code[r],s.push([i[u.beg_label_asym_id[r]],parseInt(u.beg_auth_seq_id[r]),ns(o,""),i[u.end_label_asym_id[r]],parseInt(u.end_auth_seq_id[r]),ns(a,""),(Tb[l]||Tb[""]).charCodeAt(0)]))}var h=t.struct_sheet_range;if(h)for(is(h,"id"),r=0,n=h.beg_auth_seq_id.length;r<n;++r)o=h.pdbx_beg_PDB_ins_code[r],a=h.pdbx_end_PDB_ins_code[r],c.push([i[h.beg_label_asym_id[r]],parseInt(h.beg_auth_seq_id[r]),ns(o,""),i[h.end_label_asym_id[r]],parseInt(h.end_auth_seq_id[r]),ns(a,"")]);return!(!u&&!h)&&{helices:s,sheets:c}}function cs(t,e,i){var r={},n=e.biomolDict;if(t.pdbx_struct_oper_list){var o=t.pdbx_struct_oper_list;is(o,"id"),o.id.forEach(function(t,e){var i=new p,n=i.elements;n[0]=parseFloat(o["matrix[1][1]"][e]),n[1]=parseFloat(o["matrix[1][2]"][e]),n[2]=parseFloat(o["matrix[1][3]"][e]),n[4]=parseFloat(o["matrix[2][1]"][e]),n[5]=parseFloat(o["matrix[2][2]"][e]),n[6]=parseFloat(o["matrix[2][3]"][e]),n[8]=parseFloat(o["matrix[3][1]"][e]),n[9]=parseFloat(o["matrix[3][2]"][e]),n[10]=parseFloat(o["matrix[3][3]"][e]),n[3]=parseFloat(o["vector[1]"][e]),n[7]=parseFloat(o["vector[2]"][e]),n[11]=parseFloat(o["vector[3]"][e]),i.transpose(),r[t]=i})}if(t.pdbx_struct_assembly_gen){var a=t.pdbx_struct_assembly_gen;is(a,"assembly_id");var s=function(t){var e={},i=t.replace(/[\(\)']/g,"").split(",");return i.forEach(function(t){if(t.includes("-"))for(var i=t.split("-"),n=parseInt(i[0]),o=parseInt(i[1]);n<=o;++n)e[n]=r[n];else e[t]=r[t]}),e};a.assembly_id.forEach(function(t,e){var r={},o=a.oper_expression[e].replace(/'\(|'/g,"");if(o.includes(")(")||o.indexOf("(")>0){o=o.split("(");var c=s(o[0]),u=s(o[1]);Object.keys(c).forEach(function(t){Object.keys(u).forEach(function(e){var i=new p;i.multiplyMatrices(c[t],u[e]),r[t+"x"+e]=i})})}else r=s(o);var l=[];for(var h in r)l.push(r[h]);var d=t;/^(0|[1-9][0-9]*)$/.test(d)&&(d="BU"+d);for(var f=a.asym_id_list[e].split(","),m=0,g=f.length;m<g;++m)f[m]=i[f[m]];void 0===n[d]&&(n[d]=new ov(d)),n[d].addPart(l,f)})}if(t.struct_ncs_oper){var c=t.struct_ncs_oper;is(c,"id");var u="NCS";n[u]=new ov(u);var l=n[u].addPart();c.id.forEach(function(t,e){if("given"!==c.code[e]){var i=new p,r=i.elements;r[0]=parseFloat(c["matrix[1][1]"][e]),r[1]=parseFloat(c["matrix[1][2]"][e]),r[2]=parseFloat(c["matrix[1][3]"][e]),r[4]=parseFloat(c["matrix[2][1]"][e]),r[5]=parseFloat(c["matrix[2][2]"][e]),r[6]=parseFloat(c["matrix[2][3]"][e]),r[8]=parseFloat(c["matrix[3][1]"][e]),r[9]=parseFloat(c["matrix[3][2]"][e]),r[10]=parseFloat(c["matrix[3][3]"][e]),r[3]=parseFloat(c["vector[1]"][e]),r[7]=parseFloat(c["vector[2]"][e]),r[11]=parseFloat(c["vector[3]"][e]),i.transpose(),l.matrixList.push(i)}}),0===l.matrixList.length&&delete n[u]}var h={};if(t.cell){var d=t.cell,f=parseFloat(d.length_a),m=parseFloat(d.length_b),g=parseFloat(d.length_c),v=new Float32Array(9);v[0]=f,v[4]=m,v[8]=g,e.boxes.push(v),h.a=f,h.b=m,h.c=g,h.alpha=parseFloat(d.angle_alpha),h.beta=parseFloat(d.angle_beta),h.gamma=parseFloat(d.angle_gamma)}if(t.symmetry){var y=t.symmetry,b=y["space_group_name_H-M"];b[0]!==b[b.length-1]||"'"!==b[0]&&'"'!==b[0]||(b=b.substring(1,b.length-1)),h.spacegroup=b}var x=new p;if(t.database_PDB_matrix){var _=t.database_PDB_matrix,w=x.elements;w[0]=parseFloat(_["origx[1][1]"]),w[1]=parseFloat(_["origx[1][2]"]),w[2]=parseFloat(_["origx[1][3]"]),w[4]=parseFloat(_["origx[2][1]"]),w[5]=parseFloat(_["origx[2][2]"]),w[6]=parseFloat(_["origx[2][3]"]),w[8]=parseFloat(_["origx[3][1]"]),w[9]=parseFloat(_["origx[3][2]"]),w[10]=parseFloat(_["origx[3][3]"]),w[3]=parseFloat(_["origx_vector[1]"]),w[7]=parseFloat(_["origx_vector[2]"]),w[11]=parseFloat(_["origx_vector[3]"]),x.transpose(),h.origx=x}var S=new p;if(t.atom_sites){var A=t.atom_sites,M=S.elements;M[0]=parseFloat(A["fract_transf_matrix[1][1]"]),M[1]=parseFloat(A["fract_transf_matrix[1][2]"]),M[2]=parseFloat(A["fract_transf_matrix[1][3]"]),M[4]=parseFloat(A["fract_transf_matrix[2][1]"]),M[5]=parseFloat(A["fract_transf_matrix[2][2]"]),M[6]=parseFloat(A["fract_transf_matrix[2][3]"]),M[8]=parseFloat(A["fract_transf_matrix[3][1]"]),M[9]=parseFloat(A["fract_transf_matrix[3][2]"]),M[10]=parseFloat(A["fract_transf_matrix[3][3]"]),M[3]=parseFloat(A["fract_transf_vector[1]"]),M[7]=parseFloat(A["fract_transf_vector[2]"]),M[11]=parseFloat(A["fract_transf_vector[3]"]),S.transpose(),h.scale=S}void 0!==h.a?e.unitcell=new Ab(h):e.unitcell=void 0}function us(t,e,i){var r=t.struct_conn;if(r){is(r,"id");for(var n=/"/g,o=e.getAtomProxy(),a=e.getAtomProxy(),s={},c=0,u=r.id.length;c<u;++c){var l=r.conn_type_id[c];if("hydrog"!==l&&"mismat"!==l&&"saltbr"!==l&&"1_555"===r.ptnr1_symmetry[c]&&"1_555"===r.ptnr2_symmetry[c]){var h=r.pdbx_ptnr1_PDB_ins_code[c],d=r.pdbx_ptnr1_label_alt_id[c],f=r.ptnr1_auth_seq_id[c]+(rs(h)?"^"+h:"")+":"+i[r.ptnr1_label_asym_id[c]]+"."+r.ptnr1_label_atom_id[c].replace(n,"")+(rs(d)?"%"+d:""),p=s[f];if(!p){var m=new Tr(f);if(m.selection.error){qp.warn("invalid selection for connection",f);continue}p=e.getAtomIndices(m),s[f]=p}var g=r.pdbx_ptnr2_PDB_ins_code[c],v=r.pdbx_ptnr2_label_alt_id[c],y=r.ptnr2_auth_seq_id[c]+(rs(g)?"^"+g:"")+":"+i[r.ptnr2_label_asym_id[c]]+"."+r.ptnr2_label_atom_id[c].replace(n,"")+(rs(v)?"%"+v:""),b=s[y];if(!b){var x=new Tr(y);if(x.selection.error){qp.warn("invalid selection for connection",y);continue}b=e.getAtomIndices(x),s[y]=b}var _=p.length,w=b.length;if(_>w){var S=_;_=w,w=S;var A=p;p=b,b=A}if(0!==_&&0!==w)for(var M=0;M<w;++M)o.index=p[M%_],a.index=b[M],o&&a?e.bondStore.addBond(o,a,os(r.pdbx_value_order[c])):qp.log("atoms for connection not found");else qp.warn("no atoms found for",f,y)}}}}function ls(t,e,i){if(t.entity){is(t.entity,"id");for(var r=t.entity,n=r.id.length,o=0;o<n;++o){var a=r.pdbx_description[o],s=r.type[o],c=Array.from(i[r.id[o]]);e.entityList[o]=new Pb(e,o,a,s,c)}}}function hs(t,e,i){return e?new t(e.buffer,e.byteOffset,e.byteLength/(i||1)):void 0}function ds(t){return hs(DataView,t)}function fs(t){return hs(Uint8Array,t)}function ps(t){return hs(Int8Array,t)}function ms(t){return hs(Int32Array,t,4)}function gs(t){return hs(Float32Array,t,4)}function vs(t,e){var i=t.length/2;e||(e=new Int16Array(i));for(var r=0,n=0;r<i;++r,n+=2)e[r]=t[n]<<8^t[n+1]<<0;return e}function ys(t,e){var i=t.length/4;e||(e=new Int32Array(i));for(var r=0,n=0;r<i;++r,n+=4)e[r]=t[n]<<24^t[n+1]<<16^t[n+2]<<8^t[n+3]<<0;return e}function bs(t,e){var i=t.length;e||(e=new Float32Array(i/4));for(var r=ds(e),n=ds(t),o=0,a=0,s=i/4;o<s;++o,a+=4)r.setFloat32(a,n.getFloat32(a),!0);return e}function xs(t,e,i){var r=t.length,n=1/e;i||(i=new Float32Array(r));for(var o=0;o<r;++o)i[o]=t[o]*n;return i}function _s(t,e){var i,r;if(!e){var n=0;for(i=0,r=t.length;i<r;i+=2)n+=t[i+1];e=new t.constructor(n);
	}var o=0;for(i=0,r=t.length;i<r;i+=2)for(var a=t[i],s=t[i+1],c=0;c<s;++c)e[o]=a,++o;return e}function ws(t,e){var i=t.length;e||(e=new t.constructor(i)),i&&(e[0]=t[0]);for(var r=1;r<i;++r)e[r]=t[r]+e[r-1];return e}function Ss(t,e){var i,r,n=t instanceof Int8Array?127:32767,o=-n-1,a=t.length;if(!e){var s=0;for(i=0;i<a;++i)t[i]<n&&t[i]>o&&++s;e=new Int32Array(s)}for(i=0,r=0;i<a;){for(var c=0;t[i]===n||t[i]===o;)c+=t[i],++i;c+=t[i],++i,e[r]=c,++r}return e}function As(t,e){return ws(_s(t),e)}function Ms(t,e,i){return xs(_s(t,ms(i)),e,i)}function Ps(t,e,i){return xs(ws(t,ms(i)),e,i)}function Cs(t,e,i){return xs(Ss(t,ms(i)),e,i)}function Ts(t,e,i){var r=Ss(t,ms(i));return Ps(r,e,gs(r))}function Es(t){var e=ds(t),i=e.getInt32(0),r=e.getInt32(4),n=t.subarray(8,12),t=t.subarray(12);return[i,t,r,n]}function Is(t){function e(t){for(var e={},i=0;i<t;i++){var r=o();e[r]=o()}return e}function i(e){var i=t.subarray(a,a+e);return a+=e,i}function r(e){var i=t.subarray(a,a+e);a+=e;var r=65535;if(e>r){for(var n=[],o=0;o<i.length;o+=r)n.push(String.fromCharCode.apply(null,i.subarray(o,o+r)));return n.join("")}return String.fromCharCode.apply(null,i)}function n(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=o();return e}function o(){var o,c,u=t[a];if(0===(128&u))return a++,u;if(128===(240&u))return c=15&u,a++,e(c);if(144===(240&u))return c=15&u,a++,n(c);if(160===(224&u))return c=31&u,a++,r(c);if(224===(224&u))return o=s.getInt8(a),a++,o;switch(u){case 192:return a++,null;case 194:return a++,!1;case 195:return a++,!0;case 196:return c=s.getUint8(a+1),a+=2,i(c);case 197:return c=s.getUint16(a+1),a+=3,i(c);case 198:return c=s.getUint32(a+1),a+=5,i(c);case 202:return o=s.getFloat32(a+1),a+=5,o;case 203:return o=s.getFloat64(a+1),a+=9,o;case 204:return o=t[a+1],a+=2,o;case 205:return o=s.getUint16(a+1),a+=3,o;case 206:return o=s.getUint32(a+1),a+=5,o;case 208:return o=s.getInt8(a+1),a+=2,o;case 209:return o=s.getInt16(a+1),a+=3,o;case 210:return o=s.getInt32(a+1),a+=5,o;case 217:return c=s.getUint8(a+1),a+=2,r(c);case 218:return c=s.getUint16(a+1),a+=3,r(c);case 219:return c=s.getUint32(a+1),a+=5,r(c);case 220:return c=s.getUint16(a+1),a+=3,n(c);case 221:return c=s.getUint32(a+1),a+=5,n(c);case 222:return c=s.getUint16(a+1),a+=3,e(c);case 223:return c=s.getUint32(a+1),a+=5,e(c)}throw new Error("Unknown type 0x"+u.toString(16))}var a=0,s=new DataView(t.buffer);return o()}function Ls(t,e,i,r){switch(t){case 1:return bs(e);case 2:return ps(e);case 3:return vs(e);case 4:return ys(e);case 5:return fs(e);case 6:return _s(ys(e),new Uint8Array(i));case 7:return _s(ys(e));case 8:return As(ys(e));case 9:return Ms(ys(e),ys(r)[0]);case 10:return Ts(vs(e),ys(r)[0]);case 11:return xs(vs(e),ys(r)[0]);case 12:return Cs(vs(e),ys(r)[0]);case 13:return Cs(ps(e),ys(r)[0]);case 14:return Ss(vs(e));case 15:return Ss(ps(e))}}function Rs(t,e){e=e||{};var i=e.ignoreFields,r={};return Ub.forEach(function(e){var n=!!i&&i.indexOf(e)!==-1,o=t[e];n||void 0===o||(o instanceof Uint8Array?r[e]=Ls.apply(null,Es(o)):r[e]=o)}),r}function Os(){this.propertyNameMapping={}}function Ds(){this.regexp={vertex_pattern:/^v\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,normal_pattern:/^vn\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,uv_pattern:/^vt\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,face_vertex:/^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/,face_vertex_uv:/^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/,face_vertex_uv_normal:/^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/,face_vertex_normal:/^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/,object_pattern:/^[og]\s*(.+)?/,smoothing_pattern:/^s\s+(\d+|on|off)/,material_library_pattern:/^mtllib /,material_use_pattern:/^usemtl /}}function Ns(t){return t.replace(ax,"")}function ks(t){function e(){return{declaration:i(),root:r()}}function i(){var t=a(/^<\?xml\s*/);if(t){for(var e={attributes:{}};!s()&&!c("?>");){var i=o();if(!i)return e;e.attributes[i.name]=i.value}return a(/\?>\s*/),e}}function r(){var t=a(sx);if(t){for(var e={name:t[1],attributes:{},children:[]};!(s()||c(">")||c("?>")||c("/>"));){var i=o();if(!i)return e;e.attributes[i.name]=i.value}if(a(/^\s*\/>\s*/))return e;a(/\??>\s*/),e.content=n();for(var u;u=r();)e.children.push(u);return a(/^<\/[\w-:.]+>\s*/),e}}function n(){var t=a(cx);return t?t[1]:""}function o(){var t=a(ux);if(t)return{name:t[1],value:Ns(t[2])}}function a(e){var i=t.match(e);if(i)return t=t.slice(i[0].length),i}function s(){return 0===t.length}function c(e){return 0===t.indexOf(e)}return t=t.trim().replace(/<!--[\s\S]*?-->/g,""),e()}function Fs(t,e,i){var r=t.icode.value,n=t.chain.value,o=t.altcode.value,a=t.resnum.value;return r.trim()&&(a+="^"+r),n.trim()&&(a+=":"+n),e&&(a+="."+e),i&&o.trim()&&(a+="%"+o),a+="/"+(parseInt(t.model.value)-1)}function Bs(t,e,i){void 0===t[e]?t[e]=i:t[e]|=i}function zs(t,e){return void 0!==t&&t.value===e}function Us(t){var e=t.inscode,i=t.chainname,r=t.atomname,n=t.altloc,o=t.resno;return e&&(o+="^"+e),i&&(o+=":"+i),r&&(o+="."+r),n&&(o+="%"+n),o+="/"+t.modelIndex}function js(t,e,i){for(var r=0,n=e.getElementsByTagName("clash"),o=0,a=n.length;o<a;++o)if(t[n[o].attributes.cid.value]){r+=1;break}var s=e.getElementsByTagName("angle-outlier");s.length>0&&(r+=1);var c=e.getElementsByTagName("bond-outlier");c.length>0&&(r+=1);var u=e.getElementsByTagName("plane-outlier");return u.length>0&&(r+=1),zs(i.rota,"OUTLIER")&&(r+=1),zs(i.rama,"OUTLIER")&&(r+=1),zs(i.RNApucker,"outlier")&&(r+=1),r}function $s(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}}return t}function Vs(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)}function Gs(t,e,i,r,n){if(e.subarray&&t.subarray)return void t.set(e.subarray(i,i+r),n);for(var o=0;o<r;o++)t[n+o]=e[i+o]}function Hs(t){var e,i,r,n,o,a;for(r=0,e=0,i=t.length;e<i;e++)r+=t[e].length;for(a=new Uint8Array(r),n=0,e=0,i=t.length;e<i;e++)o=t[e],a.set(o,n),n+=o.length;return a}function Ws(t,e,i,r){for(var n=65535&t|0,o=t>>>16&65535|0,a=0;0!==i;){a=i>2e3?2e3:i,i-=a;do n=n+e[r++]|0,o=o+n|0;while(--a);n%=65521,o%=65521}return n|o<<16|0}function Xs(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}function qs(t,e,i,r){var n=mx,o=r+i;t^=-1;for(var a=r;a<o;a++)t=t>>>8^n[255&(t^e[a])];return t^-1}function Ys(t,e){var i,r,n,o,a,s,c,u,l,h,d,f,p,m,g,v,y,b,x,_,w,S,A,M,P;i=t.state,r=t.next_in,M=t.input,n=r+(t.avail_in-5),o=t.next_out,P=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),c=i.dmax,u=i.wsize,l=i.whave,h=i.wnext,d=i.window,f=i.hold,p=i.bits,m=i.lencode,g=i.distcode,v=(1<<i.lenbits)-1,y=(1<<i.distbits)-1;t:do{p<15&&(f+=M[r++]<<p,p+=8,f+=M[r++]<<p,p+=8),b=m[f&v];e:for(;;){if(x=b>>>24,f>>>=x,p-=x,x=b>>>16&255,0===x)P[o++]=65535&b;else{if(!(16&x)){if(0===(64&x)){b=m[(65535&b)+(f&(1<<x)-1)];continue e}if(32&x){i.mode=vx;break t}t.msg="invalid literal/length code",i.mode=gx;break t}_=65535&b,x&=15,x&&(p<x&&(f+=M[r++]<<p,p+=8),_+=f&(1<<x)-1,f>>>=x,p-=x),p<15&&(f+=M[r++]<<p,p+=8,f+=M[r++]<<p,p+=8),b=g[f&y];i:for(;;){if(x=b>>>24,f>>>=x,p-=x,x=b>>>16&255,!(16&x)){if(0===(64&x)){b=g[(65535&b)+(f&(1<<x)-1)];continue i}t.msg="invalid distance code",i.mode=gx;break t}if(w=65535&b,x&=15,p<x&&(f+=M[r++]<<p,p+=8,p<x&&(f+=M[r++]<<p,p+=8)),w+=f&(1<<x)-1,w>c){t.msg="invalid distance too far back",i.mode=gx;break t}if(f>>>=x,p-=x,x=o-a,w>x){if(x=w-x,x>l&&i.sane){t.msg="invalid distance too far back",i.mode=gx;break t}if(S=0,A=d,0===h){if(S+=u-x,x<_){_-=x;do P[o++]=d[S++];while(--x);S=o-w,A=P}}else if(h<x){if(S+=u+h-x,x-=h,x<_){_-=x;do P[o++]=d[S++];while(--x);if(S=0,h<_){x=h,_-=x;do P[o++]=d[S++];while(--x);S=o-w,A=P}}}else if(S+=h-x,x<_){_-=x;do P[o++]=d[S++];while(--x);S=o-w,A=P}for(;_>2;)P[o++]=A[S++],P[o++]=A[S++],P[o++]=A[S++],_-=3;_&&(P[o++]=A[S++],_>1&&(P[o++]=A[S++]))}else{S=o-w;do P[o++]=P[S++],P[o++]=P[S++],P[o++]=P[S++],_-=3;while(_>2);_&&(P[o++]=P[S++],_>1&&(P[o++]=P[S++]))}break}}break}}while(r<n&&o<s);_=p>>3,r-=_,p-=_<<3,f&=(1<<p)-1,t.next_in=r,t.next_out=o,t.avail_in=r<n?5+(n-r):5-(r-n),t.avail_out=o<s?257+(s-o):257-(o-s),i.hold=f,i.bits=p}function Zs(t,e,i,r,n,o,a,s){var c,u,l,h,d,f,p,m,g,v=s.bits,y=0,b=0,x=0,_=0,w=0,S=0,A=0,M=0,P=0,C=0,T=null,E=0,I=new Uint16Array(yx+1),L=new Uint16Array(yx+1),R=null,O=0;for(y=0;y<=yx;y++)I[y]=0;for(b=0;b<r;b++)I[e[i+b]]++;for(w=v,_=yx;_>=1&&0===I[_];_--);if(w>_&&(w=_),0===_)return n[o++]=20971520,n[o++]=20971520,s.bits=1,0;for(x=1;x<_&&0===I[x];x++);for(w<x&&(w=x),M=1,y=1;y<=yx;y++)if(M<<=1,M-=I[y],M<0)return-1;if(M>0&&(t===_x||1!==_))return-1;for(L[1]=0,y=1;y<yx;y++)L[y+1]=L[y]+I[y];for(b=0;b<r;b++)0!==e[i+b]&&(a[L[e[i+b]]++]=b);if(t===_x?(T=R=a,f=19):t===wx?(T=Ax,E-=257,R=Mx,O-=257,f=256):(T=Px,R=Cx,f=-1),C=0,b=0,y=x,d=o,S=w,A=0,l=-1,P=1<<w,h=P-1,t===wx&&P>bx||t===Sx&&P>xx)return 1;for(var D=0;;){D++,p=y-A,a[b]<f?(m=0,g=a[b]):a[b]>f?(m=R[O+a[b]],g=T[E+a[b]]):(m=96,g=0),c=1<<y-A,u=1<<S,x=u;do u-=c,n[d+(C>>A)+u]=p<<24|m<<16|g|0;while(0!==u);for(c=1<<y-1;C&c;)c>>=1;if(0!==c?(C&=c-1,C+=c):C=0,b++,0===--I[y]){if(y===_)break;y=e[i+a[b]]}if(y>w&&(C&h)!==l){for(0===A&&(A=w),d+=x,S=y-A,M=1<<S;S+A<_&&(M-=I[S+A],!(M<=0));)S++,M<<=1;if(P+=1<<S,t===wx&&P>bx||t===Sx&&P>xx)return 1;l=C&h,n[l]=w<<24|S<<16|d-o|0}}return 0!==C&&(n[d+C]=y-A<<24|64<<16|0),s.bits=w,0}function Ks(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function Qs(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Js(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=$x,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(x_),e.distcode=e.distdyn=new Int32Array(__),e.sane=1,e.back=-1,Dx):Fx}function tc(t){var e;return t&&t.state?(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,Js(t)):Fx}function ec(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15)?Fx:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,tc(t))):Fx}function ic(t,e){var i,r;return t?(r=new Qs,t.state=r,r.window=null,i=ec(t,e),i!==Dx&&(t.state=null),i):Fx}function rc(t){if(w_){var e;for(fx=new Int32Array(512),px=new Int32Array(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Zs(Ex,t.lens,0,288,fx,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Zs(Ix,t.lens,0,32,px,0,t.work,{bits:5}),w_=!1}t.lencode=fx,t.lenbits=9,t.distcode=px,t.distbits=5}function nc(t,e,i,r){var n,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(Gs(o.window,e,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>r&&(n=r),Gs(o.window,e,i-r,n,o.wnext),r-=n,r?(Gs(o.window,e,i-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}function oc(t,e){var i,r,n,o,a,s,c,u,l,h,d,f,p,m,g,v,y,b,x,_,w,S,A,M,P=0,C=new Uint8Array(4),T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return Fx;i=t.state,i.mode===Jx&&(i.mode=t_),a=t.next_out,n=t.output,c=t.avail_out,o=t.next_in,r=t.input,s=t.avail_in,u=i.hold,l=i.bits,h=s,d=c,S=Dx;t:for(;;)switch(i.mode){case $x:if(0===i.wrap){i.mode=t_;break}for(;l<16;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if(2&i.wrap&&35615===u){i.check=0,C[0]=255&u,C[1]=u>>>8&255,i.check=qs(i.check,C,2,0),u=0,l=0,i.mode=Vx;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&u)<<8)+(u>>8))%31){t.msg="incorrect header check",i.mode=v_;break}if((15&u)!==jx){t.msg="unknown compression method",i.mode=v_;break}if(u>>>=4,l-=4,w=(15&u)+8,0===i.wbits)i.wbits=w;else if(w>i.wbits){t.msg="invalid window size",i.mode=v_;break}i.dmax=1<<w,t.adler=i.check=1,i.mode=512&u?Kx:Jx,u=0,l=0;break;case Vx:for(;l<16;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if(i.flags=u,(255&i.flags)!==jx){t.msg="unknown compression method",i.mode=v_;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=v_;break}i.head&&(i.head.text=u>>8&1),512&i.flags&&(C[0]=255&u,C[1]=u>>>8&255,i.check=qs(i.check,C,2,0)),u=0,l=0,i.mode=Gx;case Gx:for(;l<32;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}i.head&&(i.head.time=u),512&i.flags&&(C[0]=255&u,C[1]=u>>>8&255,C[2]=u>>>16&255,C[3]=u>>>24&255,i.check=qs(i.check,C,4,0)),u=0,l=0,i.mode=Hx;case Hx:for(;l<16;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}i.head&&(i.head.xflags=255&u,i.head.os=u>>8),512&i.flags&&(C[0]=255&u,C[1]=u>>>8&255,i.check=qs(i.check,C,2,0)),u=0,l=0,i.mode=Wx;case Wx:if(1024&i.flags){for(;l<16;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}i.length=u,i.head&&(i.head.extra_len=u),512&i.flags&&(C[0]=255&u,C[1]=u>>>8&255,i.check=qs(i.check,C,2,0)),u=0,l=0}else i.head&&(i.head.extra=null);i.mode=Xx;case Xx:if(1024&i.flags&&(f=i.length,f>s&&(f=s),f&&(i.head&&(w=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),Gs(i.head.extra,r,o,f,w)),512&i.flags&&(i.check=qs(i.check,r,f,o)),s-=f,o+=f,i.length-=f),i.length))break t;i.length=0,i.mode=qx;case qx:if(2048&i.flags){if(0===s)break t;f=0;do w=r[o+f++],i.head&&w&&i.length<65536&&(i.head.name+=String.fromCharCode(w));while(w&&f<s);if(512&i.flags&&(i.check=qs(i.check,r,f,o)),s-=f,o+=f,w)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=Yx;case Yx:if(4096&i.flags){if(0===s)break t;f=0;do w=r[o+f++],i.head&&w&&i.length<65536&&(i.head.comment+=String.fromCharCode(w));while(w&&f<s);if(512&i.flags&&(i.check=qs(i.check,r,f,o)),s-=f,o+=f,w)break t}else i.head&&(i.head.comment=null);i.mode=Zx;case Zx:if(512&i.flags){for(;l<16;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if(u!==(65535&i.check)){t.msg="header crc mismatch",i.mode=v_;break}u=0,l=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=Jx;break;case Kx:for(;l<32;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}t.adler=i.check=Ks(u),u=0,l=0,i.mode=Qx;case Qx:if(0===i.havedict)return t.next_out=a,t.avail_out=c,t.next_in=o,t.avail_in=s,i.hold=u,i.bits=l,kx;t.adler=i.check=1,i.mode=Jx;case Jx:if(e===Rx||e===Ox)break t;case t_:if(i.last){u>>>=7&l,l-=7&l,i.mode=p_;break}for(;l<3;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}switch(i.last=1&u,u>>>=1,l-=1,3&u){case 0:i.mode=e_;break;case 1:if(rc(i),i.mode=s_,e===Ox){u>>>=2,l-=2;break t}break;case 2:i.mode=n_;break;case 3:t.msg="invalid block type",i.mode=v_}u>>>=2,l-=2;break;case e_:for(u>>>=7&l,l-=7&l;l<32;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if((65535&u)!==(u>>>16^65535)){t.msg="invalid stored block lengths",i.mode=v_;break}if(i.length=65535&u,u=0,l=0,i.mode=i_,e===Ox)break t;case i_:i.mode=r_;case r_:if(f=i.length){if(f>s&&(f=s),f>c&&(f=c),0===f)break t;Gs(n,r,o,f,a),s-=f,o+=f,c-=f,a+=f,i.length-=f;break}i.mode=Jx;break;case n_:for(;l<14;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if(i.nlen=(31&u)+257,u>>>=5,l-=5,i.ndist=(31&u)+1,u>>>=5,l-=5,i.ncode=(15&u)+4,u>>>=4,l-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=v_;break}i.have=0,i.mode=o_;case o_:for(;i.have<i.ncode;){for(;l<3;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}i.lens[T[i.have++]]=7&u,u>>>=3,l-=3}for(;i.have<19;)i.lens[T[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,A={bits:i.lenbits},S=Zs(Tx,i.lens,0,19,i.lencode,0,i.work,A),i.lenbits=A.bits,S){t.msg="invalid code lengths set",i.mode=v_;break}i.have=0,i.mode=a_;case a_:for(;i.have<i.nlen+i.ndist;){for(;P=i.lencode[u&(1<<i.lenbits)-1],g=P>>>24,v=P>>>16&255,y=65535&P,!(g<=l);){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if(y<16)u>>>=g,l-=g,i.lens[i.have++]=y;else{if(16===y){for(M=g+2;l<M;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if(u>>>=g,l-=g,0===i.have){t.msg="invalid bit length repeat",i.mode=v_;break}w=i.lens[i.have-1],f=3+(3&u),u>>>=2,l-=2}else if(17===y){for(M=g+3;l<M;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}u>>>=g,l-=g,w=0,f=3+(7&u),u>>>=3,l-=3}else{for(M=g+7;l<M;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}u>>>=g,l-=g,w=0,f=11+(127&u),u>>>=7,l-=7}if(i.have+f>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=v_;break}for(;f--;)i.lens[i.have++]=w}}if(i.mode===v_)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=v_;break}if(i.lenbits=9,A={bits:i.lenbits},S=Zs(Ex,i.lens,0,i.nlen,i.lencode,0,i.work,A),i.lenbits=A.bits,S){t.msg="invalid literal/lengths set",i.mode=v_;break}if(i.distbits=6,i.distcode=i.distdyn,A={bits:i.distbits},S=Zs(Ix,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,A),i.distbits=A.bits,S){t.msg="invalid distances set",i.mode=v_;break}if(i.mode=s_,e===Ox)break t;case s_:i.mode=c_;case c_:if(s>=6&&c>=258){t.next_out=a,t.avail_out=c,t.next_in=o,t.avail_in=s,i.hold=u,i.bits=l,Ys(t,d),a=t.next_out,n=t.output,c=t.avail_out,o=t.next_in,r=t.input,s=t.avail_in,u=i.hold,l=i.bits,i.mode===Jx&&(i.back=-1);break}for(i.back=0;P=i.lencode[u&(1<<i.lenbits)-1],g=P>>>24,v=P>>>16&255,y=65535&P,!(g<=l);){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if(v&&0===(240&v)){for(b=g,x=v,_=y;P=i.lencode[_+((u&(1<<b+x)-1)>>b)],g=P>>>24,v=P>>>16&255,y=65535&P,!(b+g<=l);){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}u>>>=b,l-=b,i.back+=b}if(u>>>=g,l-=g,i.back+=g,i.length=y,0===v){i.mode=f_;break}if(32&v){i.back=-1,i.mode=Jx;break}if(64&v){t.msg="invalid literal/length code",i.mode=v_;break}i.extra=15&v,i.mode=u_;case u_:if(i.extra){for(M=i.extra;l<M;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}i.length+=u&(1<<i.extra)-1,u>>>=i.extra,l-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=l_;case l_:for(;P=i.distcode[u&(1<<i.distbits)-1],g=P>>>24,v=P>>>16&255,y=65535&P,!(g<=l);){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if(0===(240&v)){for(b=g,x=v,_=y;P=i.distcode[_+((u&(1<<b+x)-1)>>b)],g=P>>>24,v=P>>>16&255,y=65535&P,!(b+g<=l);){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}u>>>=b,l-=b,i.back+=b}if(u>>>=g,l-=g,i.back+=g,64&v){t.msg="invalid distance code",i.mode=v_;break}i.offset=y,i.extra=15&v,i.mode=h_;case h_:if(i.extra){for(M=i.extra;l<M;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}i.offset+=u&(1<<i.extra)-1,u>>>=i.extra,l-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=v_;break}i.mode=d_;case d_:if(0===c)break t;if(f=d-c,i.offset>f){if(f=i.offset-f,f>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=v_;break}f>i.wnext?(f-=i.wnext,p=i.wsize-f):p=i.wnext-f,f>i.length&&(f=i.length),m=i.window}else m=n,p=a-i.offset,f=i.length;f>c&&(f=c),c-=f,i.length-=f;do n[a++]=m[p++];while(--f);0===i.length&&(i.mode=c_);break;case f_:if(0===c)break t;n[a++]=i.length,c--,i.mode=c_;break;case p_:if(i.wrap){for(;l<32;){if(0===s)break t;s--,u|=r[o++]<<l,l+=8}if(d-=c,t.total_out+=d,i.total+=d,d&&(t.adler=i.check=i.flags?qs(i.check,n,d,a-d):Ws(i.check,n,d,a-d)),d=c,(i.flags?u:Ks(u))!==i.check){t.msg="incorrect data check",i.mode=v_;break}u=0,l=0}i.mode=m_;case m_:if(i.wrap&&i.flags){for(;l<32;){if(0===s)break t;s--,u+=r[o++]<<l,l+=8}if(u!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=v_;break}u=0,l=0}i.mode=g_;case g_:S=Nx;break t;case v_:S=Bx;break t;case y_:return zx;case b_:default:return Fx}return t.next_out=a,t.avail_out=c,t.next_in=o,t.avail_in=s,i.hold=u,i.bits=l,(i.wsize||d!==t.avail_out&&i.mode<v_&&(i.mode<p_||e!==Lx))&&nc(t,t.output,t.next_out,d-t.avail_out)?(i.mode=y_,zx):(h-=t.avail_in,d-=t.avail_out,t.total_in+=h,t.total_out+=d,i.total+=d,i.wrap&&d&&(t.adler=i.check=i.flags?qs(i.check,n,d,t.next_out-d):Ws(i.check,n,d,t.next_out-d)),t.data_type=i.bits+(i.last?64:0)+(i.mode===Jx?128:0)+(i.mode===s_||i.mode===i_?256:0),(0===h&&0===d||e===Lx)&&S===Dx&&(S=Ux),S)}function ac(t){if(!t||!t.state)return Fx;var e=t.state;return e.window&&(e.window=null),t.state=null,Dx}function sc(t,e){var i;return t&&t.state?(i=t.state,0===(2&i.wrap)?Fx:(i.head=e,e.done=!1,Dx)):Fx}function cc(t,e){var i,r,n,o=e.length;return t&&t.state?(i=t.state,0!==i.wrap&&i.mode!==Qx?Fx:i.mode===Qx&&(r=1,r=Ws(r,e,o,0),r!==i.check)?Bx:(n=nc(t,e,o,o))?(i.mode=y_,zx):(i.havedict=1,Dx)):Fx}function uc(t){var e,i,r,n,o,a=t.length,s=0;for(n=0;n<a;n++)i=t.charCodeAt(n),55296===(64512&i)&&n+1<a&&(r=t.charCodeAt(n+1),56320===(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),s+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(s),o=0,n=0;o<s;n++)i=t.charCodeAt(n),55296===(64512&i)&&n+1<a&&(r=t.charCodeAt(n+1),56320===(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),n++)),i<128?e[o++]=i:i<2048?(e[o++]=192|i>>>6,e[o++]=128|63&i):i<65536?(e[o++]=224|i>>>12,e[o++]=128|i>>>6&63,e[o++]=128|63&i):(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63,e[o++]=128|i>>>6&63,e[o++]=128|63&i);return e}function lc(t,e){if(e<65537&&(t.subarray&&A_||!t.subarray&&S_))return String.fromCharCode.apply(null,Vs(t,e));for(var i="",r=0;r<e;r++)i+=String.fromCharCode(t[r]);return i}function hc(t){for(var e=new Uint8Array(t.length),i=0,r=e.length;i<r;i++)e[i]=t.charCodeAt(i);return e}function dc(t,e){var i,r,n,o,a=e||t.length,s=new Array(2*a);for(r=0,i=0;i<a;)if(n=t[i++],n<128)s[r++]=n;else if(o=M_[n],o>4)s[r++]=65533,i+=o-1;else{for(n&=2===o?31:3===o?15:7;o>1&&i<a;)n=n<<6|63&t[i++],o--;o>1?s[r++]=65533:n<65536?s[r++]=n:(n-=65536,s[r++]=55296|n>>10&1023,s[r++]=56320|1023&n)}return lc(s,r)}function fc(t,e){var i;for(e=e||t.length,e>t.length&&(e=t.length),i=e-1;i>=0&&128===(192&t[i]);)i--;return i<0?e:0===i?e:i+M_[t[i]]>e?i:e}function pc(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function mc(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}function gc(t){if(!(this instanceof gc))return new gc(t);this.options=$s({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0===(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pc,this.strm.avail_out=0;var i=ic(this.strm,e.windowBits);if(i!==I_)throw new Error(D_[i]);this.header=new mc,sc(this.strm,this.header)}function vc(t,e){var i=new gc(e);if(i.push(t,!0),i.err)throw i.msg;return i.result}function yc(t){var e;t instanceof ArrayBuffer&&(t=new Uint8Array(t));try{e=vc(t)}catch(i){e=t}return e}function bc(){this.getUrl=function(t){var e,i=Zi(t),r=i.name.substr(0,4);return!["pdb","cif"].includes(i.ext)||i.compressed!==!1&&"gz"!==i.compressed?"mmtf"===i.ext?e=i.base.endsWith(".bb")?z_+r:B_+r:i.ext?(qp.warn("unsupported ext",i.ext),e=B_+r):e=B_+r:e=k_+i.path,Wi()+e},this.getExt=function(t){var e=Zi(t);if("mmtf"===e.ext||!e.ext)return"mmtf"}}function xc(){this.getUrl=function(t){var e,i=Zi(t),r=i.name;return i.ext&&"sdf"!==i.ext?(qp.warn("unsupported ext",i.ext),e=U_+r+j_):e=U_+r+j_,Wi()+e},this.getExt=function(t){var e=Zi(t);if(!e.ext||"sdf"===e.ext)return"sdf"}}function _c(){this.getUrl=function(t){return t}}function wc(t){t=t||"",this.getUrl=function(e){var i=Zi(e);return qi(t+i.path)}}"undefined"!=typeof window&&!function(){window.console=window.console||{};for(var t,e,i=window.console,r={},n=function(){},o="memory".split(","),a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=o.pop();)i[t]||(i[t]=r);for(;e=a.pop();)i[e]||(i[e]=n)}(),"undefined"==typeof HTMLCanvasElement||HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(t,e,i){for(var r=window.atob(this.toDataURL(e,i).split(",")[1]),n=r.length,o=n>>2,a=new Uint8Array(n),s=new Uint32Array(a.buffer,0,o),c=0,u=0;c<o;c++)s[c]=r.charCodeAt(u++)|r.charCodeAt(u++)<<8|r.charCodeAt(u++)<<16|r.charCodeAt(u++)<<24;for(var l=3&n;l--;)a[u]=r.charCodeAt(u++);t(new Blob([a],{type:e||"image/png"}))}}),Math.cbrt=Math.cbrt||function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&t>-9007199254740992&&t<9007199254740992&&Math.floor(t)===t}),Number.isNaN||(Number.isNaN=function(t){return t!==t}),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var e=arguments;if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var i,r=Object(t),n=!1,o=1;o<arguments.length;o++){var a=e[o];if(void 0!==a&&null!==a){for(var s=Object.keys(Object(a)),c=0,u=s.length;c<u;c++){var l=s[c];try{var h=Object.getOwnPropertyDescriptor(a,l);void 0!==h&&h.enumerable&&(r[l]=a[l])}catch(t){n||(n=!0,i=t)}}if(n)throw i}}return r}}),String.prototype.startsWith||!function(){var t=function(){var t;try{var e={},i=Object.defineProperty;t=i(e,e,e)&&i}catch(t){}return t}(),e={}.toString,i=function(t){if(null===this)throw TypeError();var i=String(this);if(t&&"[object RegExp]"==e.call(t))throw TypeError();var r=i.length,n=String(t),o=n.length,a=arguments.length>1?arguments[1]:void 0,s=a?Number(a):0;s!=s&&(s=0);var c=Math.min(Math.max(s,0),r);if(o+c>r)return!1;for(var u=-1;++u<o;)if(i.charCodeAt(c+u)!=n.charCodeAt(u))return!1;return!0};t?t(String.prototype,"startsWith",{value:i,configurable:!0,writable:!0}):String.prototype.startsWith=i}(),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var i=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>i.length)&&(e=i.length),e-=t.length;var r=i.indexOf(t,e);return r!==-1&&r===e}),String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&this.indexOf(t,e)!==-1}),Array.prototype.includes||(Array.prototype.includes=function(t){if(null==this)throw new TypeError("Array.prototype.includes called on null or undefined");var e=Object(this),i=parseInt(e.length,10)||0;if(0===i)return!1;var r,n=parseInt(arguments[1],10)||0;n>=0?r=n:(r=i+n,r<0&&(r=0));for(var o;r<i;){if(o=e[r],t===o||t!==t&&o!==o)return!0;r++}return!1}),Array.from||(Array.from=function(){var t=Object.prototype.toString,e=function(e){return"function"==typeof e||"[object Function]"===t.call(e)},i=function(t){var e=Number(t);return isNaN(e)?0:0!==e&&isFinite(e)?(e>0?1:-1)*Math.floor(Math.abs(e)):e},r=Math.pow(2,53)-1,n=function(t){var e=i(t);return Math.min(Math.max(e,0),r)};return function(t){var i=this,r=Object(t);if(null==t)throw new TypeError("Array.from requires an array-like object - not null or undefined");var o,a=arguments.length>1?arguments[1]:void 0;if("undefined"!=typeof a){if(!e(a))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(o=arguments[2])}for(var s,c=n(r.length),u=e(i)?Object(new i(c)):new Array(c),l=0;l<c;)s=r[l],a?u[l]="undefined"==typeof o?a(s,l):a.call(o,s,l):u[l]=s,l+=1;return u.length=c,u}}()),"undefined"!=typeof window&&!function(){for(var t=0,e=["ms","moz","webkit","o"],i=0;i<e.length&&!window.requestAnimationFrame;++i)window.requestAnimationFrame=window[e[i]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[i]+"CancelAnimationFrame"]||window[e[i]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e){var i=(new Date).getTime(),r=Math.max(0,16-(i-t)),n=window.setTimeout(function(){e(i+r)},r);return t=i+r,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}(),void 0===Function.prototype.name&&void 0!==Object.defineProperty&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}}),"undefined"!=typeof window&&(void 0===window.performance&&(self.performance={}),void 0===window.performance.now&&!function(){var t=Date.now();window.performance.now=function(){return Date.now()-t}}());var Sc=setTimeout,Ac="function"==typeof setImmediate&&setImmediate||function(t){Sc(t,0)},Mc=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};r.prototype.catch=function(t){return this.then(null,t)},r.prototype.then=function(t,i){var r=new this.constructor(e);return n(this,new c(t,i,r)),r},r.all=function(t){var e=Array.prototype.slice.call(t);return new r(function(t,i){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(t){r(o,t)},i)}e[o]=a,0===--n&&t(e)}catch(t){i(t)}}if(0===e.length)return t([]);for(var n=e.length,o=0;o<e.length;o++)r(o,e[o])})},r.resolve=function(t){return t&&"object"==typeof t&&t.constructor===r?t:new r(function(e){e(t)})},r.reject=function(t){return new r(function(e,i){i(t)})},r.race=function(t){return new r(function(e,i){for(var r=0,n=t.length;r<n;r++)t[r].then(e,i)})},r._setImmediateFn=function(t){Ac=t},r._setUnhandledRejectionFn=function(t){Mc=t},void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),void 0===Function.prototype.name&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}}),void 0===Object.assign&&!function(){Object.assign=function(t){var e=arguments;if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),r=1;r<arguments.length;r++){var n=e[r];if(void 0!==n&&null!==n)for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(i[o]=n[o])}return i}}(),Object.assign(l.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),i[t].indexOf(e)===-1&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&i[t].indexOf(e)!==-1},removeEventListener:function(t,e){if(void 0!==this._listeners){var i=this._listeners,r=i[t];if(void 0!==r){var n=r.indexOf(e);n!==-1&&r.splice(n,1)}}},dispatchEvent:function(t){var e=this;if(void 0!==this._listeners){var i=this._listeners,r=i[t.type];if(void 0!==r){t.target=this;var n=[],o=0,a=r.length;for(o=0;o<a;o++)n[o]=r[o];for(o=0;o<a;o++)n[o].call(e,t)}}}});var Pc="80",Cc=0,Tc=1,Ec=2,Ic=0,Lc=1,Rc=2,Oc=0,Dc=1,Nc=2,kc=1,Fc=2,Bc=0,zc=1,Uc=2,jc=0,$c=1,Vc=2,Gc=3,Hc=4,Wc=5,Xc=100,qc=101,Yc=102,Zc=103,Kc=104,Qc=200,Jc=201,tu=202,eu=203,iu=204,ru=205,nu=206,ou=207,au=208,su=209,cu=210,uu=0,lu=1,hu=2,du=3,fu=4,pu=5,mu=6,gu=7,vu=0,yu=1,bu=2,xu=0,_u=1,wu=2,Su=3,Au=4,Mu=300,Pu=301,Cu=302,Tu=303,Eu=304,Iu=305,Lu=306,Ru=307,Ou=1e3,Du=1001,Nu=1002,ku=1003,Fu=1004,Bu=1005,zu=1006,Uu=1007,ju=1008,$u=1009,Vu=1010,Gu=1011,Hu=1012,Wu=1013,Xu=1014,qu=1015,Yu=1016,Zu=1017,Ku=1018,Qu=1019,Ju=1020,tl=1021,el=1022,il=1023,rl=1024,nl=1025,ol=1026,al=1027,sl=2001,cl=2002,ul=2003,ll=2004,hl=2100,dl=2101,fl=2102,pl=2103,ml=2151,gl=2200,vl=2201,yl=2202,bl=2300,xl=2301,_l=2302,wl=2400,Sl=2401,Al=2402,Ml=0,Pl=1,Cl=2,Tl=3e3,El=3001,Il=3007,Ll=3002,Rl=3004,Ol=3005,Dl=3006,Nl=3200,kl=3201,Fl={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(36),r=0;return function(){for(var n=0;n<36;n++)8===n||13===n||18===n||23===n?i[n]="-":14===n?i[n]="4":(r<=2&&(r=33554432+16777216*Math.random()|0),t=15&r,r>>=4,i[n]=e[19===n?3&t|8:t]);return i.join("");
	}}(),clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,r,n){return r+(t-e)*(n-r)/(i-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*(3-2*t))},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*t*(t*(6*t-15)+10))},random16:function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Fl.DEG2RAD},radToDeg:function(t){return t*Fl.RAD2DEG},isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t++,t}};h.prototype={constructor:h,isVector2:!0,get width(){return this.x},set width(t){this.x=t},get height(){return this.y},set height(t){this.y=t},set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t,e;return function(i,r){return void 0===t&&(t=new h,e=new h),t.set(i,i),e.set(r,r),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,i))/i)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return 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},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.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)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromAttribute:function(t,e,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this},rotateAround:function(t,e){var i=Math.cos(e),r=Math.sin(e),n=this.x-t.x,o=this.y-t.y;return this.x=n*i-o*r+t.x,this.y=n*r+o*i+t.y,this}},d.DEFAULT_IMAGE=void 0,d.DEFAULT_MAPPING=Mu,d.prototype={constructor:d,isTexture:!0,set needsUpdate(t){t===!0&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){function e(t){var e;return void 0!==t.toDataURL?e=t:(e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0,t.width,t.height)),e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var i={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=Fl.generateUUID()),void 0===t.images[r.uuid]&&(t.images[r.uuid]={uuid:r.uuid,url:e(r)}),i.image=r.uuid}return t.textures[this.uuid]=i,i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===Mu){if(t.multiply(this.repeat),t.add(this.offset),t.x<0||t.x>1)switch(this.wrapS){case Ou:t.x=t.x-Math.floor(t.x);break;case Du:t.x=t.x<0?0:1;break;case Nu:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case Ou:t.y=t.y-Math.floor(t.y);break;case Du:t.y=t.y<0?0:1;break;case Nu:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}},Object.assign(d.prototype,l.prototype);var Bl=0;p.prototype={constructor:p,isMatrix4:!0,set:function(t,e,i,r,n,o,a,s,c,u,l,h,d,f,p,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=r,g[1]=n,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=u,g[10]=l,g[14]=h,g[3]=d,g[7]=f,g[11]=p,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new p).fromArray(this.elements)},copy:function(t){return this.elements.set(t.elements),this},copyPosition:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:function(){var t;return function(e){void 0===t&&(t=new g);var i=this.elements,r=e.elements,n=1/t.setFromMatrixColumn(e,0).length(),o=1/t.setFromMatrixColumn(e,1).length(),a=1/t.setFromMatrixColumn(e,2).length();return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i[4]=r[4]*o,i[5]=r[5]*o,i[6]=r[6]*o,i[8]=r[8]*a,i[9]=r[9]*a,i[10]=r[10]*a,this}}(),makeRotationFromEuler:function(t){(t&&t.isEuler)===!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,i=t.x,r=t.y,n=t.z,o=Math.cos(i),a=Math.sin(i),s=Math.cos(r),c=Math.sin(r),u=Math.cos(n),l=Math.sin(n);if("XYZ"===t.order){var h=o*u,d=o*l,f=a*u,p=a*l;e[0]=s*u,e[4]=-s*l,e[8]=c,e[1]=d+f*c,e[5]=h-p*c,e[9]=-a*s,e[2]=p-h*c,e[6]=f+d*c,e[10]=o*s}else if("YXZ"===t.order){var m=s*u,g=s*l,v=c*u,y=c*l;e[0]=m+y*a,e[4]=v*a-g,e[8]=o*c,e[1]=o*l,e[5]=o*u,e[9]=-a,e[2]=g*a-v,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){var m=s*u,g=s*l,v=c*u,y=c*l;e[0]=m-y*a,e[4]=-o*l,e[8]=v+g*a,e[1]=g+v*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){var h=o*u,d=o*l,f=a*u,p=a*l;e[0]=s*u,e[4]=f*c-d,e[8]=h*c+p,e[1]=s*l,e[5]=p*c+h,e[9]=d*c-f,e[2]=-c,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var b=o*s,x=o*c,_=a*s,w=a*c;e[0]=s*u,e[4]=w-b*l,e[8]=_*l+x,e[1]=l,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=x*l+_,e[10]=b-w*l}else if("XZY"===t.order){var b=o*s,x=o*c,_=a*s,w=a*c;e[0]=s*u,e[4]=-l,e[8]=c*u,e[1]=b*l+w,e[5]=o*u,e[9]=x*l-_,e[2]=_*l-x,e[6]=a*u,e[10]=w*l+b}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,i=t.x,r=t.y,n=t.z,o=t.w,a=i+i,s=r+r,c=n+n,u=i*a,l=i*s,h=i*c,d=r*s,f=r*c,p=n*c,m=o*a,g=o*s,v=o*c;return e[0]=1-(d+p),e[4]=l-v,e[8]=h+g,e[1]=l+v,e[5]=1-(u+p),e[9]=f-m,e[2]=h-g,e[6]=f+m,e[10]=1-(u+d),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var t,e,i;return function(r,n,o){void 0===t&&(t=new g,e=new g,i=new g);var a=this.elements;return i.subVectors(r,n).normalize(),0===i.lengthSq()&&(i.z=1),t.crossVectors(o,i).normalize(),0===t.lengthSq()&&(i.z+=1e-4,t.crossVectors(o,i).normalize()),e.crossVectors(i,t),a[0]=t.x,a[4]=e.x,a[8]=i.x,a[1]=t.y,a[5]=e.y,a[9]=i.y,a[2]=t.z,a[6]=e.z,a[10]=i.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,r=e.elements,n=this.elements,o=i[0],a=i[4],s=i[8],c=i[12],u=i[1],l=i[5],h=i[9],d=i[13],f=i[2],p=i[6],m=i[10],g=i[14],v=i[3],y=i[7],b=i[11],x=i[15],_=r[0],w=r[4],S=r[8],A=r[12],M=r[1],P=r[5],C=r[9],T=r[13],E=r[2],I=r[6],L=r[10],R=r[14],O=r[3],D=r[7],N=r[11],k=r[15];return n[0]=o*_+a*M+s*E+c*O,n[4]=o*w+a*P+s*I+c*D,n[8]=o*S+a*C+s*L+c*N,n[12]=o*A+a*T+s*R+c*k,n[1]=u*_+l*M+h*E+d*O,n[5]=u*w+l*P+h*I+d*D,n[9]=u*S+l*C+h*L+d*N,n[13]=u*A+l*T+h*R+d*k,n[2]=f*_+p*M+m*E+g*O,n[6]=f*w+p*P+m*I+g*D,n[10]=f*S+p*C+m*L+g*N,n[14]=f*A+p*T+m*R+g*k,n[3]=v*_+y*M+b*E+x*O,n[7]=v*w+y*P+b*I+x*D,n[11]=v*S+y*C+b*L+x*N,n[15]=v*A+y*T+b*R+x*k,this},multiplyToArray:function(t,e,i){var r=this.elements;return this.multiplyMatrices(t,e),i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToVector3Array:function(){var t;return function(e,i,r){var n=this;void 0===t&&(t=new g),void 0===i&&(i=0),void 0===r&&(r=e.length);for(var o=0,a=i;o<r;o+=3,a+=3)t.fromArray(e,a),t.applyMatrix4(n),t.toArray(e,a);return e}}(),applyToBuffer:function(){var t;return function(e,i,r){var n=this;void 0===t&&(t=new g),void 0===i&&(i=0),void 0===r&&(r=e.length/e.itemSize);for(var o=0,a=i;o<r;o++,a++)t.x=e.getX(a),t.y=e.getY(a),t.z=e.getZ(a),t.applyMatrix4(n),e.setXYZ(t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],i=t[4],r=t[8],n=t[12],o=t[1],a=t[5],s=t[9],c=t[13],u=t[2],l=t[6],h=t[10],d=t[14],f=t[3],p=t[7],m=t[11],g=t[15];return f*(+n*s*l-r*c*l-n*a*h+i*c*h+r*a*d-i*s*d)+p*(+e*s*d-e*c*h+n*o*h-r*o*d+r*c*u-n*s*u)+m*(+e*c*l-e*a*d-n*o*l+i*o*d+n*a*u-i*c*u)+g*(-r*a*u-e*s*l+e*a*h+r*o*l-i*o*h+i*s*u)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new g),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var i=this.elements,r=t.elements,n=r[0],o=r[1],a=r[2],s=r[3],c=r[4],u=r[5],l=r[6],h=r[7],d=r[8],f=r[9],p=r[10],m=r[11],g=r[12],v=r[13],y=r[14],b=r[15],x=f*y*h-v*p*h+v*l*m-u*y*m-f*l*b+u*p*b,_=g*p*h-d*y*h-g*l*m+c*y*m+d*l*b-c*p*b,w=d*v*h-g*f*h+g*u*m-c*v*m-d*u*b+c*f*b,S=g*f*l-d*v*l-g*u*p+c*v*p+d*u*y-c*f*y,A=n*x+o*_+a*w+s*S;if(0===A){var M="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(e===!0)throw new Error(M);return console.warn(M),this.identity()}var P=1/A;return i[0]=x*P,i[1]=(v*p*s-f*y*s-v*a*m+o*y*m+f*a*b-o*p*b)*P,i[2]=(u*y*s-v*l*s+v*a*h-o*y*h-u*a*b+o*l*b)*P,i[3]=(f*l*s-u*p*s-f*a*h+o*p*h+u*a*m-o*l*m)*P,i[4]=_*P,i[5]=(d*y*s-g*p*s+g*a*m-n*y*m-d*a*b+n*p*b)*P,i[6]=(g*l*s-c*y*s-g*a*h+n*y*h+c*a*b-n*l*b)*P,i[7]=(c*p*s-d*l*s+d*a*h-n*p*h-c*a*m+n*l*m)*P,i[8]=w*P,i[9]=(g*f*s-d*v*s-g*o*m+n*v*m+d*o*b-n*f*b)*P,i[10]=(c*v*s-g*u*s+g*o*h-n*v*h-c*o*b+n*u*b)*P,i[11]=(d*u*s-c*f*s-d*o*h+n*f*h+c*o*m-n*u*m)*P,i[12]=S*P,i[13]=(d*v*a-g*f*a+g*o*p-n*v*p-d*o*y+n*f*y)*P,i[14]=(g*u*a-c*v*a-g*o*l+n*v*l+c*o*y-n*u*y)*P,i[15]=(c*f*a-d*u*a+d*o*l-n*f*l-c*o*p+n*u*p)*P,this},scale:function(t){var e=this.elements,i=t.x,r=t.y,n=t.z;return e[0]*=i,e[4]*=r,e[8]*=n,e[1]*=i,e[5]*=r,e[9]*=n,e[2]*=i,e[6]*=r,e[10]*=n,e[3]*=i,e[7]*=r,e[11]*=n,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))},makeTranslation:function(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var i=Math.cos(e),r=Math.sin(e),n=1-i,o=t.x,a=t.y,s=t.z,c=n*o,u=n*a;return this.set(c*o+i,c*a-r*s,c*s+r*a,0,c*a+r*s,u*a+i,u*s-r*o,0,c*s-r*a,u*s+r*o,n*s*s+i,0,0,0,0,1),this},makeScale:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},compose:function(t,e,i){return this.makeRotationFromQuaternion(e),this.scale(i),this.setPosition(t),this},decompose:function(){var t,e;return function(i,r,n){void 0===t&&(t=new g,e=new p);var o=this.elements,a=t.set(o[0],o[1],o[2]).length(),s=t.set(o[4],o[5],o[6]).length(),c=t.set(o[8],o[9],o[10]).length(),u=this.determinant();u<0&&(a=-a),i.x=o[12],i.y=o[13],i.z=o[14],e.elements.set(this.elements);var l=1/a,h=1/s,d=1/c;return e.elements[0]*=l,e.elements[1]*=l,e.elements[2]*=l,e.elements[4]*=h,e.elements[5]*=h,e.elements[6]*=h,e.elements[8]*=d,e.elements[9]*=d,e.elements[10]*=d,r.setFromRotationMatrix(e),n.x=a,n.y=s,n.z=c,this}}(),makeFrustum:function(t,e,i,r,n,o){var a=this.elements,s=2*n/(e-t),c=2*n/(r-i),u=(e+t)/(e-t),l=(r+i)/(r-i),h=-(o+n)/(o-n),d=-2*o*n/(o-n);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(t,e,i,r){var n=i*Math.tan(Fl.DEG2RAD*t*.5),o=-n,a=o*e,s=n*e;return this.makeFrustum(a,s,o,n,i,r)},makeOrthographic:function(t,e,i,r,n,o){var a=this.elements,s=1/(e-t),c=1/(i-r),u=1/(o-n),l=(e+t)*s,h=(i+r)*c,d=(o+n)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,i=t.elements,r=0;r<16;r++)if(e[r]!==i[r])return!1;return!0},fromArray:function(t){return this.elements.set(t),this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}},m.prototype={constructor:m,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get w(){return this._w},set w(t){this._w=t,this.onChangeCallback()},set:function(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if((t&&t.isEuler)===!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var i=Math.cos(t._x/2),r=Math.cos(t._y/2),n=Math.cos(t._z/2),o=Math.sin(t._x/2),a=Math.sin(t._y/2),s=Math.sin(t._z/2),c=t.order;return"XYZ"===c?(this._x=o*r*n+i*a*s,this._y=i*a*n-o*r*s,this._z=i*r*s+o*a*n,this._w=i*r*n-o*a*s):"YXZ"===c?(this._x=o*r*n+i*a*s,this._y=i*a*n-o*r*s,this._z=i*r*s-o*a*n,this._w=i*r*n+o*a*s):"ZXY"===c?(this._x=o*r*n-i*a*s,this._y=i*a*n+o*r*s,this._z=i*r*s+o*a*n,this._w=i*r*n-o*a*s):"ZYX"===c?(this._x=o*r*n-i*a*s,this._y=i*a*n+o*r*s,this._z=i*r*s-o*a*n,this._w=i*r*n+o*a*s):"YZX"===c?(this._x=o*r*n+i*a*s,this._y=i*a*n+o*r*s,this._z=i*r*s-o*a*n,this._w=i*r*n-o*a*s):"XZY"===c&&(this._x=o*r*n-i*a*s,this._y=i*a*n-o*r*s,this._z=i*r*s+o*a*n,this._w=i*r*n+o*a*s),e!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,i=t.elements,r=i[0],n=i[4],o=i[8],a=i[1],s=i[5],c=i[9],u=i[2],l=i[6],h=i[10],d=r+s+h;return d>0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(l-c)*e,this._y=(o-u)*e,this._z=(a-n)*e):r>s&&r>h?(e=2*Math.sqrt(1+r-s-h),this._w=(l-c)/e,this._x=.25*e,this._y=(n+a)/e,this._z=(o+u)/e):s>h?(e=2*Math.sqrt(1+s-r-h),this._w=(o-u)/e,this._x=(n+a)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+h-r-s),this._w=(a-n)/e,this._x=(o+u)/e,this._y=(c+l)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e,i=1e-6;return function(r,n){return void 0===t&&(t=new g),e=r.dot(n)+1,e<i?(e=0,Math.abs(r.x)>Math.abs(r.z)?t.set(-r.y,r.x,0):t.set(0,-r.z,r.y)):t.crossVectors(r,n),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,r=t._y,n=t._z,o=t._w,a=e._x,s=e._y,c=e._z,u=e._w;return this._x=i*u+o*a+r*c-n*s,this._y=r*u+o*s+n*a-i*c,this._z=n*u+o*c+i*s-r*a,this._w=o*u-i*a-r*s-n*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,r=this._y,n=this._z,o=this._w,a=o*t._w+i*t._x+r*t._y+n*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=i,this._y=r,this._z=n,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(i+this._x),this._y=.5*(r+this._y),this._z=.5*(n+this._z),this;var c=Math.atan2(s,a),u=Math.sin((1-e)*c)/s,l=Math.sin(e*c)/s;return this._w=o*u+this._w*l,this._x=i*u+this._x*l,this._y=r*u+this._y*l,this._z=n*u+this._z*l,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},Object.assign(m,{slerp:function(t,e,i,r){return i.copy(t).slerp(e,r)},slerpFlat:function(t,e,i,r,n,o,a){var s=i[r+0],c=i[r+1],u=i[r+2],l=i[r+3],h=n[o+0],d=n[o+1],f=n[o+2],p=n[o+3];if(l!==p||s!==h||c!==d||u!==f){var m=1-a,g=s*h+c*d+u*f+l*p,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var b=Math.sqrt(y),x=Math.atan2(b,g*v);m=Math.sin(m*x)/b,a=Math.sin(a*x)/b}var _=a*v;if(s=s*m+h*_,c=c*m+d*_,u=u*m+f*_,l=l*m+p*_,m===1-a){var w=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=w,c*=w,u*=w,l*=w}}t[e]=s,t[e+1]=c,t[e+2]=u,t[e+3]=l}}),g.prototype={constructor:g,isVector3:!0,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t;return function(e){return(e&&e.isEuler)===!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),void 0===t&&(t=new m),this.applyQuaternion(t.setFromEuler(e))}}(),applyAxisAngle:function(){var t;return function(e,i){return void 0===t&&(t=new m),this.applyQuaternion(t.setFromAxisAngle(e,i))}}(),applyMatrix3:function(t){var e=this.x,i=this.y,r=this.z,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6]*r,this.y=n[1]*e+n[4]*i+n[7]*r,this.z=n[2]*e+n[5]*i+n[8]*r,this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*r+n[12],this.y=n[1]*e+n[5]*i+n[9]*r+n[13],this.z=n[2]*e+n[6]*i+n[10]*r+n[14],this},applyProjection:function(t){var e=this.x,i=this.y,r=this.z,n=t.elements,o=1/(n[3]*e+n[7]*i+n[11]*r+n[15]);return this.x=(n[0]*e+n[4]*i+n[8]*r+n[12])*o,this.y=(n[1]*e+n[5]*i+n[9]*r+n[13])*o,this.z=(n[2]*e+n[6]*i+n[10]*r+n[14])*o,this},applyQuaternion:function(t){var e=this.x,i=this.y,r=this.z,n=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*r-a*i,u=s*i+a*e-n*r,l=s*r+n*i-o*e,h=-n*e-o*i-a*r;return this.x=c*s+h*-n+u*-a-l*-o,this.y=u*s+h*-o+l*-n-c*-a,this.z=l*s+h*-a+c*-o-u*-n,this},project:function(){var t;return function(e){return void 0===t&&(t=new p),t.multiplyMatrices(e.projectionMatrix,t.getInverse(e.matrixWorld)),this.applyProjection(t)}}(),unproject:function(){var t;return function(e){return void 0===t&&(t=new p),t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyProjection(t)}}(),transformDirection:function(t){var e=this.x,i=this.y,r=this.z,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*r,this.y=n[1]*e+n[5]*i+n[9]*r,this.z=n[2]*e+n[6]*i+n[10]*r,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t,e;return function(i,r){return void 0===t&&(t=new g,e=new g),t.set(i,i,i),e.set(r,r,r),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,i))/i)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return 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},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},cross:function(t,e){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var i=this.x,r=this.y,n=this.z;return this.x=r*t.z-n*t.y,this.y=n*t.x-i*t.z,this.z=i*t.y-r*t.x,this},crossVectors:function(t,e){var i=t.x,r=t.y,n=t.z,o=e.x,a=e.y,s=e.z;return this.x=r*s-n*a,this.y=n*o-i*s,this.z=i*a-r*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t;return function(e){return void 0===t&&(t=new g),t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t;return function(e){return void 0===t&&(t=new g),this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Fl.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromMatrixPosition:function(t){return this.setFromMatrixColumn(t,3)},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this},setFromMatrixColumn:function(t,e){if("number"==typeof t){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var i=t;t=e,e=i}return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromAttribute:function(t,e,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this}},y.prototype={constructor:y,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){var e=this;this.makeEmpty();for(var i=0,r=t.length;i<r;i++)e.expandByPoint(t[i]);return this},setFromCenterAndSize:function(){var t=new h;return function(e,i){var r=t.copy(i).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=+(1/0),this.max.x=this.max.y=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(t){var e=t||new h;return e.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){var e=t||new h;return e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){var i=e||new h;return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){var i=e||new h;return i.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new h;return function(e){var i=t.copy(e).clamp(this.min,this.max);return i.sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},x.prototype=Object.create(d.prototype),x.prototype.constructor=x,x.prototype.isCubeTexture=!0,Object.defineProperty(x.prototype,"images",{get:function(){return this.image},set:function(t){
	this.image=t}});var zl=new d,Ul=new x,jl=[],$l=[];K.prototype.setValue=function(t,e){for(var i=this.seq,r=0,n=i.length;r!==n;++r){var o=i[r];o.setValue(t,e[o.id])}};var Vl=/([\w\d_]+)(\])?(\[|\.)?/g;tt.prototype.setValue=function(t,e,i){var r=this.map[e];void 0!==r&&r.setValue(t,i,this.renderer)},tt.prototype.set=function(t,e,i){var r=this.map[i];void 0!==r&&r.setValue(t,e[i],this.renderer)},tt.prototype.setOptional=function(t,e,i){var r=e[i];void 0!==r&&this.setValue(t,i,r)},tt.upload=function(t,e,i,r){for(var n=0,o=e.length;n!==o;++n){var a=e[n],s=i[a.id];s.needsUpdate!==!1&&a.setValue(t,s.value,r)}},tt.seqWithValue=function(t,e){for(var i=[],r=0,n=t.length;r!==n;++r){var o=t[r];o.id in e&&i.push(o)}return i},tt.splitDynamic=function(t,e){for(var i=null,r=t.length,n=0,o=0;o!==r;++o){var a=t[o],s=e[a.id];s&&s.dynamic===!0?(null===i&&(i=[]),i.push(a)):(n<o&&(t[n]=a),++n)}return n<r&&(t.length=n),i},tt.evalDynamic=function(t,e,i,r){for(var n=0,o=t.length;n!==o;++n){var a=e[t[n].id],s=a.onUpdateCallback;void 0!==s&&s.call(a,i,r)}},it.prototype={constructor:it,isVector4:!0,set:function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}},getComponent:function(t){switch(t){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: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z,n=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*r+o[12]*n,this.y=o[1]*e+o[5]*i+o[9]*r+o[13]*n,this.z=o[2]*e+o[6]*i+o[10]*r+o[14]*n,this.w=o[3]*e+o[7]*i+o[11]*r+o[15]*n,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,r,n,o=.01,a=.1,s=t.elements,c=s[0],u=s[4],l=s[8],h=s[1],d=s[5],f=s[9],p=s[2],m=s[6],g=s[10];if(Math.abs(u-h)<o&&Math.abs(l-p)<o&&Math.abs(f-m)<o){if(Math.abs(u+h)<a&&Math.abs(l+p)<a&&Math.abs(f+m)<a&&Math.abs(c+d+g-3)<a)return this.set(1,0,0,0),this;e=Math.PI;var v=(c+1)/2,y=(d+1)/2,b=(g+1)/2,x=(u+h)/4,_=(l+p)/4,w=(f+m)/4;return v>y&&v>b?v<o?(i=0,r=.707106781,n=.707106781):(i=Math.sqrt(v),r=x/i,n=_/i):y>b?y<o?(i=.707106781,r=0,n=.707106781):(r=Math.sqrt(y),i=x/r,n=w/r):b<o?(i=.707106781,r=.707106781,n=0):(n=Math.sqrt(b),i=_/n,r=w/n),this.set(i,r,n,e),this}var S=Math.sqrt((m-f)*(m-f)+(l-p)*(l-p)+(h-u)*(h-u));return Math.abs(S)<.001&&(S=1),this.x=(m-f)/S,this.y=(l-p)/S,this.z=(h-u)/S,this.w=Math.acos((c+d+g-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(i,r){return void 0===t&&(t=new it,e=new it),t.set(i,i,i,i),e.set(r,r,r,r),this.clamp(t,e)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return 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),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromAttribute:function(t,e,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this.w=t.array[e+3],this}},Object.assign(nt.prototype,l.prototype,{isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ot.prototype={constructor:ot,isMaterial:!0,get needsUpdate(){return this._needsUpdate},set needsUpdate(t){t===!0&&this.update(),this._needsUpdate=t},setValues:function(t){var e=this;if(void 0!==t)for(var i in t){var r=t[i];if(void 0!==r){var n=e[i];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):"overdraw"===i?e[i]=Number(r):e[i]=r:console.warn("THREE."+e.type+": '"+i+"' is not a property of this material.")}else console.warn("THREE.Material: '"+i+"' parameter is undefined.")}},toJSON:function(t){function e(t){var e=[];for(var i in t){var r=t[i];delete r.metadata,e.push(r)}return e}var i=void 0===t;i&&(t={textures:{},images:{}});var r={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,r.reflectivity=this.reflectivity),void 0!==this.size&&(r.size=this.size),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==$c&&(r.blending=this.blending),this.shading!==Fc&&(r.shading=this.shading),this.side!==Oc&&(r.side=this.side),this.vertexColors!==Bc&&(r.vertexColors=this.vertexColors),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),r.skinning=this.skinning,r.morphTargets=this.morphTargets,i){var n=e(t.textures),o=e(t.images);n.length>0&&(r.textures=n),o.length>0&&(r.images=o)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.shading=t.shading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.clipShadows=t.clipShadows;var e=t.clippingPlanes,i=null;if(null!==e){var r=e.length;i=new Array(r);for(var n=0;n!==r;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},Object.assign(ot.prototype,l.prototype);var Gl=0,Hl={merge:function(t){for(var e=this,i={},r=0;r<t.length;r++){var n=e.clone(t[r]);for(var o in n)i[o]=n[o]}return i},clone:function(t){var e={};for(var i in t){e[i]={};for(var r in t[i]){var n=t[i][r];n&&n.isColor||n&&n.isVector2||n&&n.isVector3||n&&n.isVector4||n&&n.isMatrix3||n&&n.isMatrix4||n&&n.isTexture?e[i][r]=n.clone():Array.isArray(n)?e[i][r]=n.slice():e[i][r]=n}}return e}};st.prototype=Object.create(ot.prototype),st.prototype.constructor=st,st.prototype.isShaderMaterial=!0,st.prototype.copy=function(t){return ot.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Hl.clone(t.uniforms),this.defines=t.defines,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},st.prototype.toJSON=function(t){var e=ot.prototype.toJSON.call(this,t);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e};var Wl="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",Xl="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",ql="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",Yl="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",Zl="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",Kl="\nvec3 transformed = vec3( position );\n",Ql="\nvec3 objectNormal = vec3( normal );\n",Jl="bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",th="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\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\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",eh="#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n#endif\n",ih="#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",rh="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",nh="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",oh="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",ah="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",sh="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",ch="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",uh="#define PI 3.14159265359\n#define PI2 6.28318530718\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",lh="#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1  (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale =  bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ?  a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ?  a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ?  a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ?  0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ?  0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ?  0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",hh="#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",dh="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",fh="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",ph="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",mh="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",gh="  gl_FragColor = linearToOutputTexel( gl_FragColor );\n",vh="\nvec4 LinearToLinear( in vec4 value ) {\n  return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n  return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n  return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n  return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n  return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n  return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n  float maxComponent = max( max( value.r, value.g ), value.b );\n  float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n  return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n  return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n  float maxRGB = max( value.x, max( value.g, value.b ) );\n  float M      = clamp( maxRGB / maxRange, 0.0, 1.0 );\n  M            = ceil( M * 255.0 ) / 255.0;\n  return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n    return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n    float maxRGB = max( value.x, max( value.g, value.b ) );\n    float D      = max( maxRange / maxRGB, 1.0 );\n    D            = min( floor( D ) / 255.0, 1.0 );\n    return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value )  {\n  vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n  Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n  vec4 vResult;\n  vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n  float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n  vResult.w = fract(Le);\n  vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n  return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n  float Le = value.z * 255.0 + value.w;\n  vec3 Xp_Y_XYZp;\n  Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n  Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n  Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n  vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n  return vec4( max(vRGB, 0.0), 1.0 );\n}\n",yh="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\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\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#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",bh="#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\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\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",xh="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",_h="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",wh="#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",Sh="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",Ah="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",Mh="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",Ph="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",Ch="uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight  ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#include <normal_flip>\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#include <normal_flip>\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",Th="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",Eh="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",Ih="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",Lh="struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material )   GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",Rh="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\t\t\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",Oh="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",Dh="#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",Nh="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",kh="#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",Fh="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",Bh="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",zh="#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",Uh="#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",jh="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",$h="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",Vh="#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",Gh="#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",Hh="#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",Wh="#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",Xh="#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",qh="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\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\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\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\t}\n#endif\n",Yh="vec3 packNormalToRGB( const in vec3 normal ) {\n  return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n  return 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256.,  256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n  return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n  return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n  return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n  return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",Zh="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",Kh="#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",Qh="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",Jh="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",td="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\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\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",ed="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",id="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",rd="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",nd="#ifdef USE_SKINNING\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#endif",od="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\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\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\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\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",ad="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\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#endif\n",sd="#ifdef USE_SKINNING\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\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",cd="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",ud="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",ld="#if defined( TONE_MAPPING )\n  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",hd="#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n  return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n  color *= toneMappingExposure;\n  return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n  color *= toneMappingExposure;\n  return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n  color *= toneMappingExposure;\n  color = max( vec3( 0.0 ), color - 0.004 );\n  return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",dd="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",fd="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",pd="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",md="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",gd="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",vd="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",yd="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",bd="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",xd="varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",_d="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",wd="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",Sd="uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",Ad="varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition;\n}\n",Md="uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",Pd="varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",Cd="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Td="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",Ed="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Id="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n}\n",Ld="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Rd="#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",Od="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Dd="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",Nd="#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",kd="#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",Fd="uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <packing>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( vNormal ), opacity );\n\t#include <logdepthbuf_fragment>\n}\n",Bd="varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",zd="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Ud="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",jd="uniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0  - getShadowMask() ) );\n}\n",$d="#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",Vd={
	alphamap_fragment:Wl,alphamap_pars_fragment:Xl,alphatest_fragment:ql,aomap_fragment:Yl,aomap_pars_fragment:Zl,begin_vertex:Kl,beginnormal_vertex:Ql,bsdfs:Jl,bumpmap_pars_fragment:th,clipping_planes_fragment:eh,clipping_planes_pars_fragment:ih,clipping_planes_pars_vertex:rh,clipping_planes_vertex:nh,color_fragment:oh,color_pars_fragment:ah,color_pars_vertex:sh,color_vertex:ch,common:uh,cube_uv_reflection_fragment:lh,defaultnormal_vertex:hh,displacementmap_pars_vertex:dh,displacementmap_vertex:fh,emissivemap_fragment:ph,emissivemap_pars_fragment:mh,encodings_fragment:gh,encodings_pars_fragment:vh,envmap_fragment:yh,envmap_pars_fragment:bh,envmap_pars_vertex:xh,envmap_vertex:_h,fog_fragment:wh,fog_pars_fragment:Sh,lightmap_fragment:Ah,lightmap_pars_fragment:Mh,lights_lambert_vertex:Ph,lights_pars:Ch,lights_phong_fragment:Th,lights_phong_pars_fragment:Eh,lights_physical_fragment:Ih,lights_physical_pars_fragment:Lh,lights_template:Rh,logdepthbuf_fragment:Oh,logdepthbuf_pars_fragment:Dh,logdepthbuf_pars_vertex:Nh,logdepthbuf_vertex:kh,map_fragment:Fh,map_pars_fragment:Bh,map_particle_fragment:zh,map_particle_pars_fragment:Uh,metalnessmap_fragment:jh,metalnessmap_pars_fragment:$h,morphnormal_vertex:Vh,morphtarget_pars_vertex:Gh,morphtarget_vertex:Hh,normal_flip:Wh,normal_fragment:Xh,normalmap_pars_fragment:qh,packing:Yh,premultiplied_alpha_fragment:Zh,project_vertex:Kh,roughnessmap_fragment:Qh,roughnessmap_pars_fragment:Jh,shadowmap_pars_fragment:td,shadowmap_pars_vertex:ed,shadowmap_vertex:id,shadowmask_pars_fragment:rd,skinbase_vertex:nd,skinning_pars_vertex:od,skinning_vertex:ad,skinnormal_vertex:sd,specularmap_fragment:cd,specularmap_pars_fragment:ud,tonemapping_fragment:ld,tonemapping_pars_fragment:hd,uv_pars_fragment:dd,uv_pars_vertex:fd,uv_vertex:pd,uv2_pars_fragment:md,uv2_pars_vertex:gd,uv2_vertex:vd,worldpos_vertex:yd,cube_frag:bd,cube_vert:xd,depth_frag:_d,depth_vert:wd,distanceRGBA_frag:Sd,distanceRGBA_vert:Ad,equirect_frag:Md,equirect_vert:Pd,linedashed_frag:Cd,linedashed_vert:Td,meshbasic_frag:Ed,meshbasic_vert:Id,meshlambert_frag:Ld,meshlambert_vert:Rd,meshphong_frag:Od,meshphong_vert:Dd,meshphysical_frag:Nd,meshphysical_vert:kd,normal_frag:Fd,normal_vert:Bd,points_frag:zd,points_vert:Ud,shadow_frag:jd,shadow_vert:$d};ct.prototype={constructor:ct,isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){this.r=t,this.g=t,this.b=t},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(){function t(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}return function(e,i,r){if(e=Fl.euclideanModulo(e,1),i=Fl.clamp(i,0,1),r=Fl.clamp(r,0,1),0===i)this.r=this.g=this.b=r;else{var n=r<=.5?r*(1+i):r+i-r*i,o=2*r-n;this.r=t(o,n,e+1/3),this.g=t(o,n,e),this.b=t(o,n,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var r,n=i[1],o=i[2];switch(n){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return 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,e(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return 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,e(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return e(r[5]),this.setHSL(a,s,c)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u=i[1],l=u.length;if(3===l)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}if(t&&t.length>0){var u=Gd[t];void 0!==u?this.setHex(u):console.warn("THREE.Color: Unknown color "+t)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(){var t=this.r,e=this.g,i=this.b;return this.r=t*t,this.g=e*e,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){var e,i,r=t||{h:0,s:0,l:0},n=this.r,o=this.g,a=this.b,s=Math.max(n,o,a),c=Math.min(n,o,a),u=(c+s)/2;if(c===s)e=0,i=0;else{var l=s-c;switch(i=u<=.5?l/(s+c):l/(2-s-c),s){case n:e=(o-a)/l+(o<a?6:0);break;case o:e=(a-n)/l+2;break;case a:e=(n-o)/l+4}e/=6}return r.h=e,r.s=i,r.l=u,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,i){var r=this.getHSL();return r.h+=t,r.s+=e,r.l+=i,this.setHSL(r.h,r.s,r.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}};var Gd={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Hd={common:{diffuse:{value:new ct(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new it(0,0,1,1)},specularMap:{value:null},alphaMap:{value:null},envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new h(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ct(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}}},points:{diffuse:{value:new ct(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},offsetRepeat:{value:new it(0,0,1,1)}}},Wd={basic:{uniforms:Hl.merge([Hd.common,Hd.aomap,Hd.fog]),vertexShader:Vd.meshbasic_vert,fragmentShader:Vd.meshbasic_frag},lambert:{uniforms:Hl.merge([Hd.common,Hd.aomap,Hd.lightmap,Hd.emissivemap,Hd.fog,Hd.lights,{emissive:{value:new ct(0)}}]),vertexShader:Vd.meshlambert_vert,fragmentShader:Vd.meshlambert_frag},phong:{uniforms:Hl.merge([Hd.common,Hd.aomap,Hd.lightmap,Hd.emissivemap,Hd.bumpmap,Hd.normalmap,Hd.displacementmap,Hd.fog,Hd.lights,{emissive:{value:new ct(0)},specular:{value:new ct(1118481)},shininess:{value:30}}]),vertexShader:Vd.meshphong_vert,fragmentShader:Vd.meshphong_frag},standard:{uniforms:Hl.merge([Hd.common,Hd.aomap,Hd.lightmap,Hd.emissivemap,Hd.bumpmap,Hd.normalmap,Hd.displacementmap,Hd.roughnessmap,Hd.metalnessmap,Hd.fog,Hd.lights,{emissive:{value:new ct(0)},roughness:{value:.5},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Vd.meshphysical_vert,fragmentShader:Vd.meshphysical_frag},points:{uniforms:Hl.merge([Hd.points,Hd.fog]),vertexShader:Vd.points_vert,fragmentShader:Vd.points_frag},dashed:{uniforms:Hl.merge([Hd.common,Hd.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Vd.linedashed_vert,fragmentShader:Vd.linedashed_frag},depth:{uniforms:Hl.merge([Hd.common,Hd.displacementmap]),vertexShader:Vd.depth_vert,fragmentShader:Vd.depth_frag},normal:{uniforms:{opacity:{value:1}},vertexShader:Vd.normal_vert,fragmentShader:Vd.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Vd.cube_vert,fragmentShader:Vd.cube_frag},equirect:{uniforms:{tEquirect:{value:null},tFlip:{value:-1}},vertexShader:Vd.equirect_vert,fragmentShader:Vd.equirect_frag},distanceRGBA:{uniforms:{lightPos:{value:new g}},vertexShader:Vd.distanceRGBA_vert,fragmentShader:Vd.distanceRGBA_frag}};Wd.physical={uniforms:Hl.merge([Wd.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Vd.meshphysical_vert,fragmentShader:Vd.meshphysical_frag},ut.prototype=Object.create(ot.prototype),ut.prototype.constructor=ut,ut.prototype.isMeshDepthMaterial=!0,ut.prototype.copy=function(t){return ot.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},lt.prototype={constructor:lt,isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=+(1/0),i=+(1/0),r=+(1/0),n=-(1/0),o=-(1/0),a=-(1/0),s=0,c=t.length;s<c;s+=3){var u=t[s],l=t[s+1],h=t[s+2];u<e&&(e=u),l<i&&(i=l),h<r&&(r=h),u>n&&(n=u),l>o&&(o=l),h>a&&(a=h)}this.min.set(e,i,r),this.max.set(n,o,a)},setFromPoints:function(t){var e=this;this.makeEmpty();for(var i=0,r=t.length;i<r;i++)e.expandByPoint(t[i]);return this},setFromCenterAndSize:function(){var t=new g;return function(e,i){var r=t.copy(i).multiplyScalar(.5);return this.min.copy(e).sub(r),this.max.copy(e).add(r),this}}(),setFromObject:function(){var t=new g;return function(e){var i=this;return e.updateMatrixWorld(!0),this.makeEmpty(),e.traverse(function(e){var r=e.geometry;if(void 0!==r)if(r&&r.isGeometry)for(var n=r.vertices,o=0,a=n.length;o<a;o++)t.copy(n[o]),t.applyMatrix4(e.matrixWorld),i.expandByPoint(t);else if(r&&r.isBufferGeometry){var s=r.attributes.position;if(void 0!==s){var c,u,l;s&&s.isInterleavedBufferAttribute?(c=s.data.array,u=s.offset,l=s.data.stride):(c=s.array,u=0,l=3);for(var o=u,a=c.length;o<a;o+=l)t.fromArray(c,o),t.applyMatrix4(e.matrixWorld),i.expandByPoint(t)}}}),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=+(1/0),this.max.x=this.max.y=this.max.z=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(t){var e=t||new g;return e.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){var e=t||new g;return e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){var i=e||new g;return i.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))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(){var t;return function(e){return void 0===t&&(t=new g),this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=t.constant&&i>=t.constant},clampPoint:function(t,e){var i=e||new g;return i.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new g;return function(e){var i=t.copy(e).clamp(this.min,this.max);return i.sub(e).length()}}(),getBoundingSphere:function(){var t=new g;return function(e){var i=e||new ht;return i.center=this.center(),i.radius=.5*this.size(t).length(),i}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new g,new g,new g,new g,new g,new g,new g,new g];return function(e){return this.isEmpty()?this:(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.setFromPoints(t),this)}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},ht.prototype={constructor:ht,set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new lt;return function(e,i){var r=this.center;void 0!==i?r.copy(i):t.setFromPoints(e).center(r);for(var n=0,o=0,a=e.length;o<a;o++)n=Math.max(n,r.distanceToSquared(e[o]));return this.radius=Math.sqrt(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(this.center.dot(t.normal)-t.constant)<=this.radius},clampPoint:function(t,e){var i=this.center.distanceToSquared(t),r=e||new g;return r.copy(t),i>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(t){var e=t||new lt;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},dt.prototype={constructor:dt,isMatrix3:!0,set:function(t,e,i,r,n,o,a,s,c){var u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=e,u[4]=n,u[5]=s,u[6]=i,u[7]=o,u[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=t.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToVector3Array:function(){var t;return function(e,i,r){var n=this;void 0===t&&(t=new g),void 0===i&&(i=0),void 0===r&&(r=e.length);for(var o=0,a=i;o<r;o+=3,a+=3)t.fromArray(e,a),t.applyMatrix3(n),t.toArray(e,a);return e}}(),applyToBuffer:function(){var t;return function(e,i,r){var n=this;void 0===t&&(t=new g),void 0===i&&(i=0),void 0===r&&(r=e.length/e.itemSize);for(var o=0,a=i;o<r;o++,a++)t.x=e.getX(a),t.y=e.getY(a),t.z=e.getZ(a),t.applyMatrix3(n),e.setXYZ(t.x,t.y,t.z);return e}}(),multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],i=t[1],r=t[2],n=t[3],o=t[4],a=t[5],s=t[6],c=t[7],u=t[8];return e*o*u-e*a*c-i*n*u+i*a*s+r*n*c-r*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var i=t.elements,r=this.elements,n=i[0],o=i[1],a=i[2],s=i[3],c=i[4],u=i[5],l=i[6],h=i[7],d=i[8],f=d*c-u*h,p=u*l-d*s,m=h*s-c*l,g=n*f+o*p+a*m;if(0===g){var v="THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";if(e===!0)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return r[0]=f*y,r[1]=(a*h-d*o)*y,r[2]=(u*o-a*c)*y,r[3]=p*y,r[4]=(d*n-a*l)*y,r[5]=(a*s-u*n)*y,r[6]=m*y,r[7]=(o*l-h*n)*y,r[8]=(c*n-o*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."),this.toArray(t,e)},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},fromArray:function(t){return this.elements.set(t),this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}},ft.prototype={constructor:ft,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,r){return this.normal.set(t,e,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new g,e=new g;return function(i,r,n){var o=t.subVectors(n,r).cross(e.subVectors(i,r)).normalize();return this.setFromNormalAndCoplanarPoint(o,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var i=this.distanceToPoint(t),r=e||new g;return r.copy(this.normal).multiplyScalar(i)},intersectLine:function(){var t=new g;return function(e,i){var r=i||new g,n=e.delta(t),o=this.normal.dot(n);if(0!==o){var a=-(e.start.dot(this.normal)+this.constant)/o;if(!(a<0||a>1))return r.copy(n).multiplyScalar(a).add(e.start)}else if(0===this.distanceToPoint(e.start))return r.copy(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){var e=t||new g;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new g,e=new dt;return function(i,r){var n=this.coplanarPoint(t).applyMatrix4(i),o=r||e.getNormalMatrix(i),a=this.normal.applyMatrix3(o).normalize();return this.constant=-n.dot(a),this}}(),translate:function(t){return this.constant=this.constant-t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},pt.prototype={constructor:pt,set:function(t,e,i,r,n,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(r),a[4].copy(n),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes,i=t.elements,r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],c=i[5],u=i[6],l=i[7],h=i[8],d=i[9],f=i[10],p=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(a-r,l-s,p-h,y-m).normalize(),e[1].setComponents(a+r,l+s,p+h,y+m).normalize(),e[2].setComponents(a+n,l+c,p+d,y+g).normalize(),e[3].setComponents(a-n,l-c,p-d,y-g).normalize(),e[4].setComponents(a-o,l-u,p-f,y-v).normalize(),e[5].setComponents(a+o,l+u,p+f,y+v).normalize(),this},intersectsObject:function(){var t=new ht;return function(e){var i=e.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),t.copy(i.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSprite:function(){var t=new ht;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,i=t.center,r=-t.radius,n=0;n<6;n++){var o=e[n].distanceToPoint(i);if(o<r)return!1}return!0},intersectsBox:function(){var t=new g,e=new g;return function(i){for(var r=this.planes,n=0;n<6;n++){var o=r[n];t.x=o.normal.x>0?i.min.x:i.max.x,e.x=o.normal.x>0?i.max.x:i.min.x,t.y=o.normal.y>0?i.min.y:i.max.y,e.y=o.normal.y>0?i.max.y:i.min.y,t.z=o.normal.z>0?i.min.z:i.max.z,e.z=o.normal.z>0?i.max.z:i.min.z;var a=o.distanceToPoint(t),s=o.distanceToPoint(e);if(a<0&&s<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}};var Xd=0;Rt.prototype={constructor:Rt,isBufferAttribute:!0,get count(){return this.array.length/this.itemSize},set needsUpdate(t){t===!0&&this.version++},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,i){var r=this;t*=this.itemSize,i*=e.itemSize;for(var n=0,o=this.itemSize;n<o;n++)r.array[t+n]=e.array[i+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,i=0,r=0,n=t.length;r<n;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new ct),e[i++]=o.r,e[i++]=o.g,e[i++]=o.b}return this},copyIndicesArray:function(t){for(var e=this.array,i=0,r=0,n=t.length;r<n;r++){var o=t[r];e[i++]=o.a,e[i++]=o.b,e[i++]=o.c}return this},copyVector2sArray:function(t){for(var e=this.array,i=0,r=0,n=t.length;r<n;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new h),e[i++]=o.x,e[i++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,i=0,r=0,n=t.length;r<n;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new g),e[i++]=o.x,e[i++]=o.y,e[i++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,i=0,r=0,n=t.length;r<n;r++){var o=t[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new it),e[i++]=o.x,e[i++]=o.y,e[i++]=o.z,e[i++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this},setXYZ:function(t,e,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this},setXYZW:function(t,e,i,r,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=n,this},clone:function(){return(new this.constructor).copy(this)}},Dt.prototype={constructor:Dt,clone:function(){return(new this.constructor).copy(this)},copy:function(t){var e=this;this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var i=0,r=t.vertexNormals.length;i<r;i++)e.vertexNormals[i]=t.vertexNormals[i].clone();for(var i=0,r=t.vertexColors.length;i<r;i++)e.vertexColors[i]=t.vertexColors[i].clone();return this}},Nt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Nt.DefaultOrder="XYZ",Nt.prototype={constructor:Nt,isEuler:!0,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get order(){return this._order},set order(t){this._order=t,this.onChangeCallback()},set:function(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){var r=Fl.clamp,n=t.elements,o=n[0],a=n[4],s=n[8],c=n[1],u=n[5],l=n[9],h=n[2],d=n[6],f=n[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,u),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(s,f),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===e?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(d,f),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,u))):"YZX"===e?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,f))):"XZY"===e?(this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,f),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,i!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var t;return function(e,i,r){return void 0===t&&(t=new p),t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,i,r)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new m;return function(e){return t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new g(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},kt.prototype={constructor:kt,set:function(t){this.mask=1<<t},enable:function(t){this.mask|=1<<t},toggle:function(t){this.mask^=1<<t},disable:function(t){this.mask&=~(1<<t)},test:function(t){
	return 0!==(this.mask&t.mask)}},Ft.DefaultUp=new g(0,1,0),Ft.DefaultMatrixAutoUpdate=!0,Object.assign(Ft.prototype,l.prototype,{isObject3D:!0,applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new m;return function(e,i){return t.setFromAxisAngle(e,i),this.quaternion.multiply(t),this}}(),rotateX:function(){var t=new g(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new g(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new g(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new g;return function(e,i){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(i)),this}}(),translateX:function(){var t=new g(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new g(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new g(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new p;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new p;return function(e){t.lookAt(e,this.position,this.up),this.quaternion.setFromRotationMatrix(t)}}(),add:function(t){var e=arguments,i=this;if(arguments.length>1){for(var r=0;r<arguments.length;r++)i.add(e[r]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){var e=arguments,i=this;if(arguments.length>1)for(var r=0;r<arguments.length;r++)i.remove(e[r]);var n=this.children.indexOf(t);n!==-1&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(n,1))},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){var i=this;if(this[t]===e)return this;for(var r=0,n=this.children.length;r<n;r++){var o=i.children[r],a=o.getObjectByProperty(t,e);if(void 0!==a)return a}},getWorldPosition:function(t){var e=t||new g;return this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new g,e=new g;return function(i){var r=i||new m;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,r,e),r}}(),getWorldRotation:function(){var t=new m;return function(e){var i=e||new Nt;return this.getWorldQuaternion(t),i.setFromQuaternion(t,this.rotation.order,!1)}}(),getWorldScale:function(){var t=new g,e=new m;return function(i){var r=i||new g;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,r),r}}(),getWorldDirection:function(){var t=new m;return function(e){var i=e||new g;return this.getWorldQuaternion(t),i.set(0,0,1).applyQuaternion(t)}}(),raycast:function(){},traverse:function(t){t(this);for(var e=this.children,i=0,r=e.length;i<r;i++)e[i].traverse(t)},traverseVisible:function(t){if(this.visible!==!1){t(this);for(var e=this.children,i=0,r=e.length;i<r;i++)e[i].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate===!0&&this.updateMatrix(),this.matrixWorldNeedsUpdate!==!0&&t!==!0||(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,i=0,r=e.length;i<r;i++)e[i].updateMatrixWorld(t)},toJSON:function(t){function e(t){var e=[];for(var i in t){var r=t[i];delete r.metadata,e.push(r)}return e}var i=this,r=void 0===t||""===t,n={};r&&(t={geometries:{},materials:{},textures:{},images:{}},n.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var o={};if(o.uuid=this.uuid,o.type=this.type,""!==this.name&&(o.name=this.name),"{}"!==JSON.stringify(this.userData)&&(o.userData=this.userData),this.castShadow===!0&&(o.castShadow=!0),this.receiveShadow===!0&&(o.receiveShadow=!0),this.visible===!1&&(o.visible=!1),o.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===t.geometries[this.geometry.uuid]&&(t.geometries[this.geometry.uuid]=this.geometry.toJSON(t)),o.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===t.materials[this.material.uuid]&&(t.materials[this.material.uuid]=this.material.toJSON(t)),o.material=this.material.uuid),this.children.length>0){o.children=[];for(var a=0;a<this.children.length;a++)o.children.push(i.children[a].toJSON(t).object)}if(r){var s=e(t.geometries),c=e(t.materials),u=e(t.textures),l=e(t.images);s.length>0&&(n.geometries=s),c.length>0&&(n.materials=c),u.length>0&&(n.textures=u),l.length>0&&(n.images=l)}return n.object=o,n},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){var i=this;if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(var r=0;r<t.children.length;r++){var n=t.children[r];i.add(n.clone())}return this}});var qd=0;Object.assign(zt.prototype,l.prototype,{isGeometry:!0,applyMatrix:function(t){for(var e=this,i=(new dt).getNormalMatrix(t),r=0,n=this.vertices.length;r<n;r++){var o=e.vertices[r];o.applyMatrix4(t)}for(var r=0,n=this.faces.length;r<n;r++){var a=e.faces[r];a.normal.applyMatrix3(i).normalize();for(var s=0,c=a.vertexNormals.length;s<c;s++)a.vertexNormals[s].applyMatrix3(i).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t;return function(e){return void 0===t&&(t=new p),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new p),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new p),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,i,r){return void 0===t&&(t=new p),t.makeTranslation(e,i,r),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,i,r){return void 0===t&&(t=new p),t.makeScale(e,i,r),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new Ft),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){function e(t,e,r,n){var o=void 0!==a?[l[t].clone(),l[e].clone(),l[r].clone()]:[],h=void 0!==s?[i.colors[t].clone(),i.colors[e].clone(),i.colors[r].clone()]:[],p=new Dt(t,e,r,o,h,n);i.faces.push(p),void 0!==c&&i.faceVertexUvs[0].push([d[t].clone(),d[e].clone(),d[r].clone()]),void 0!==u&&i.faceVertexUvs[1].push([f[t].clone(),f[e].clone(),f[r].clone()])}var i=this,r=null!==t.index?t.index.array:void 0,n=t.attributes,o=n.position.array,a=void 0!==n.normal?n.normal.array:void 0,s=void 0!==n.color?n.color.array:void 0,c=void 0!==n.uv?n.uv.array:void 0,u=void 0!==n.uv2?n.uv2.array:void 0;void 0!==u&&(this.faceVertexUvs[1]=[]);for(var l=[],d=[],f=[],p=0,m=0;p<o.length;p+=3,m+=2)i.vertices.push(new g(o[p],o[p+1],o[p+2])),void 0!==a&&l.push(new g(a[p],a[p+1],a[p+2])),void 0!==s&&i.colors.push(new ct(s[p],s[p+1],s[p+2])),void 0!==c&&d.push(new h(c[m],c[m+1])),void 0!==u&&f.push(new h(u[m],u[m+1]));if(void 0!==r){var v=t.groups;if(v.length>0)for(var p=0;p<v.length;p++)for(var y=v[p],b=y.start,x=y.count,m=b,_=b+x;m<_;m+=3)e(r[m],r[m+1],r[m+2],y.materialIndex);else for(var p=0;p<r.length;p+=3)e(r[p],r[p+1],r[p+2])}else for(var p=0;p<o.length/3;p+=3)e(p,p+1,p+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.translate(t.x,t.y,t.z),t},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,i=0===e?1:1/e,r=new p;return r.set(i,0,0,-i*t.x,0,i,0,-i*t.y,0,0,i,-i*t.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var t=this,e=new g,i=new g,r=0,n=this.faces.length;r<n;r++){var o=t.faces[r],a=t.vertices[o.a],s=t.vertices[o.b],c=t.vertices[o.c];e.subVectors(c,s),i.subVectors(a,s),e.cross(i),e.normalize(),o.normal.copy(e)}},computeVertexNormals:function(t){var e=this;void 0===t&&(t=!0);var i,r,n,o,a,s;for(s=new Array(this.vertices.length),i=0,r=this.vertices.length;i<r;i++)s[i]=new g;if(t){var c,u,l,h=new g,d=new g;for(n=0,o=this.faces.length;n<o;n++)a=e.faces[n],c=e.vertices[a.a],u=e.vertices[a.b],l=e.vertices[a.c],h.subVectors(l,u),d.subVectors(c,u),h.cross(d),s[a.a].add(h),s[a.b].add(h),s[a.c].add(h)}else for(n=0,o=this.faces.length;n<o;n++)a=e.faces[n],s[a.a].add(a.normal),s[a.b].add(a.normal),s[a.c].add(a.normal);for(i=0,r=this.vertices.length;i<r;i++)s[i].normalize();for(n=0,o=this.faces.length;n<o;n++){a=e.faces[n];var f=a.vertexNormals;3===f.length?(f[0].copy(s[a.a]),f[1].copy(s[a.b]),f[2].copy(s[a.c])):(f[0]=s[a.a].clone(),f[1]=s[a.b].clone(),f[2]=s[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,i,r,n,o=this;for(i=0,r=this.faces.length;i<r;i++)for(n=o.faces[i],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),t=0,e=n.vertexNormals.length;t<e;t++)n.__originalVertexNormals[t]?n.__originalVertexNormals[t].copy(n.vertexNormals[t]):n.__originalVertexNormals[t]=n.vertexNormals[t].clone();var a=new zt;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!o.morphNormals[t]){o.morphNormals[t]={},o.morphNormals[t].faceNormals=[],o.morphNormals[t].vertexNormals=[];var s,c,u=o.morphNormals[t].faceNormals,l=o.morphNormals[t].vertexNormals;for(i=0,r=this.faces.length;i<r;i++)s=new g,c={a:new g,b:new g,c:new g},u.push(s),l.push(c)}var h=o.morphNormals[t];a.vertices=o.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals();var s,c;for(i=0,r=this.faces.length;i<r;i++)n=o.faces[i],s=h.faceNormals[i],c=h.vertexNormals[i],s.copy(n.normal),c.a.copy(n.vertexNormals[0]),c.b.copy(n.vertexNormals[1]),c.c.copy(n.vertexNormals[2])}for(i=0,r=this.faces.length;i<r;i++)n=o.faces[i],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){for(var t=this,e=0,i=this.vertices,r=0,n=i.length;r<n;r++)r>0&&(e+=i[r].distanceTo(i[r-1])),t.lineDistances[r]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new lt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new ht),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if((t&&t.isGeometry)===!1)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);var r,n=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,c=t.faces,u=this.faceVertexUvs[0],l=t.faceVertexUvs[0];void 0===i&&(i=0),void 0!==e&&(r=(new dt).getNormalMatrix(e));for(var h=0,d=a.length;h<d;h++){var f=a[h],p=f.clone();void 0!==e&&p.applyMatrix4(e),o.push(p)}for(h=0,d=c.length;h<d;h++){var m,g,v,y=c[h],b=y.vertexNormals,x=y.vertexColors;m=new Dt(y.a+n,y.b+n,y.c+n),m.normal.copy(y.normal),void 0!==r&&m.normal.applyMatrix3(r).normalize();for(var _=0,w=b.length;_<w;_++)g=b[_].clone(),void 0!==r&&g.applyMatrix3(r).normalize(),m.vertexNormals.push(g);m.color.copy(y.color);for(var _=0,w=x.length;_<w;_++)v=x[_],m.vertexColors.push(v.clone());m.materialIndex=y.materialIndex+i,s.push(m)}for(h=0,d=l.length;h<d;h++){var S=l[h],A=[];if(void 0!==S){for(var _=0,w=S.length;_<w;_++)A.push(S[_].clone());u.push(A)}}},mergeMesh:function(t){return(t&&t.isMesh)===!1?void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t):(t.matrixAutoUpdate&&t.updateMatrix(),void this.merge(t.geometry,t.matrix))},mergeVertices:function(){var t,e,i,r,n,o,a,s,c=this,u={},l=[],h=[],d=4,f=Math.pow(10,d);for(i=0,r=this.vertices.length;i<r;i++)t=c.vertices[i],e=Math.round(t.x*f)+"_"+Math.round(t.y*f)+"_"+Math.round(t.z*f),void 0===u[e]?(u[e]=i,l.push(c.vertices[i]),h[i]=l.length-1):h[i]=h[u[e]];var p=[];for(i=0,r=this.faces.length;i<r;i++){n=c.faces[i],n.a=h[n.a],n.b=h[n.b],n.c=h[n.c],o=[n.a,n.b,n.c];for(var m=-1,g=0;g<3;g++)if(o[g]===o[(g+1)%3]){m=g,p.push(i);break}}for(i=p.length-1;i>=0;i--){var v=p[i];for(c.faces.splice(v,1),a=0,s=this.faceVertexUvs.length;a<s;a++)c.faceVertexUvs[a].splice(v,1)}var y=this.vertices.length-l.length;return this.vertices=l,y},sortFacesByMaterialIndex:function(){function t(t,e){return t.materialIndex-e.materialIndex}for(var e=this.faces,i=e.length,r=0;r<i;r++)e[r]._id=r;e.sort(t);var n,o,a=this.faceVertexUvs[0],s=this.faceVertexUvs[1];a&&a.length===i&&(n=[]),s&&s.length===i&&(o=[]);for(var r=0;r<i;r++){var c=e[r]._id;n&&n.push(a[c]),o&&o.push(s[c])}n&&(this.faceVertexUvs[0]=n),o&&(this.faceVertexUvs[1]=o)},toJSON:function(){function t(t,e,i){return i?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==f[e]?f[e]:(f[e]=d.length/3,d.push(t.x,t.y,t.z),f[e])}function i(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==m[e]?m[e]:(m[e]=p.length,p.push(t.getHex()),m[e])}function r(t){var e=t.x.toString()+t.y.toString();return void 0!==v[e]?v[e]:(v[e]=g.length/2,g.push(t.x,t.y),v[e])}var n=this,o={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(o.uuid=this.uuid,o.type=this.type,""!==this.name&&(o.name=this.name),void 0!==this.parameters){var a=this.parameters;for(var s in a)void 0!==a[s]&&(o[s]=a[s]);return o}for(var c=[],u=0;u<this.vertices.length;u++){var l=n.vertices[u];c.push(l.x,l.y,l.z)}for(var h=[],d=[],f={},p=[],m={},g=[],v={},u=0;u<this.faces.length;u++){var y=n.faces[u],b=!0,x=!1,_=void 0!==n.faceVertexUvs[0][u],w=y.normal.length()>0,S=y.vertexNormals.length>0,A=1!==y.color.r||1!==y.color.g||1!==y.color.b,M=y.vertexColors.length>0,P=0;if(P=t(P,0,0),P=t(P,1,b),P=t(P,2,x),P=t(P,3,_),P=t(P,4,w),P=t(P,5,S),P=t(P,6,A),P=t(P,7,M),h.push(P),h.push(y.a,y.b,y.c),h.push(y.materialIndex),_){var C=n.faceVertexUvs[0][u];h.push(r(C[0]),r(C[1]),r(C[2]))}if(w&&h.push(e(y.normal)),S){var T=y.vertexNormals;h.push(e(T[0]),e(T[1]),e(T[2]))}if(A&&h.push(i(y.color)),M){var E=y.vertexColors;h.push(i(E[0]),i(E[1]),i(E[2]))}}return o.data={},o.data.vertices=c,o.data.normals=d,p.length>0&&(o.data.colors=p),g.length>0&&(o.data.uvs=[g]),o.data.faces=h,o},clone:function(){return(new zt).copy(this)},copy:function(t){var e=this;this.vertices=[],this.faces=[],this.faceVertexUvs=[[]];for(var i=t.vertices,r=0,n=i.length;r<n;r++)e.vertices.push(i[r].clone());for(var o=t.faces,r=0,n=o.length;r<n;r++)e.faces.push(o[r].clone());for(var r=0,n=t.faceVertexUvs.length;r<n;r++){var a=t.faceVertexUvs[r];void 0===e.faceVertexUvs[r]&&(e.faceVertexUvs[r]=[]);for(var s=0,c=a.length;s<c;s++){for(var u=a[s],l=[],h=0,d=u.length;h<d;h++){var f=u[h];l.push(f.clone())}e.faceVertexUvs[r].push(l)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Yd=0;Object.assign(jt.prototype,l.prototype,{computeBoundingBox:zt.prototype.computeBoundingBox,computeBoundingSphere:zt.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},computeGroups:function(t){for(var e,i,r=[],n=t.faces,o=0;o<n.length;o++){var a=n[o];a.materialIndex!==i&&(i=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,r.push(e)),e={start:3*o,materialIndex:i})}void 0!==e&&(e.count=3*o-e.start,r.push(e)),this.groups=r},fromGeometry:function(t){var e,i=this,r=t.faces,n=t.vertices,o=t.faceVertexUvs,a=o[0]&&o[0].length>0,s=o[1]&&o[1].length>0,c=t.morphTargets,u=c.length;if(u>0){e=[];for(var l=0;l<u;l++)e[l]=[];this.morphTargets.position=e}var d,f=t.morphNormals,p=f.length;if(p>0){d=[];for(var l=0;l<p;l++)d[l]=[];this.morphTargets.normal=d}for(var m=t.skinIndices,g=t.skinWeights,v=m.length===n.length,y=g.length===n.length,l=0;l<r.length;l++){var b=r[l];i.vertices.push(n[b.a],n[b.b],n[b.c]);var x=b.vertexNormals;if(3===x.length)i.normals.push(x[0],x[1],x[2]);else{var _=b.normal;i.normals.push(_,_,_)}var w=b.vertexColors;if(3===w.length)i.colors.push(w[0],w[1],w[2]);else{var S=b.color;i.colors.push(S,S,S)}if(a===!0){var A=o[0][l];void 0!==A?i.uvs.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),i.uvs.push(new h,new h,new h))}if(s===!0){var A=o[1][l];void 0!==A?i.uvs2.push(A[0],A[1],A[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),i.uvs2.push(new h,new h,new h))}for(var M=0;M<u;M++){var P=c[M].vertices;e[M].push(P[b.a],P[b.b],P[b.c])}for(var M=0;M<p;M++){var C=f[M].vertexNormals[l];d[M].push(C.a,C.b,C.c)}v&&i.skinIndices.push(m[b.a],m[b.b],m[b.c]),y&&i.skinWeights.push(g[b.a],g[b.b],g[b.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.assign($t.prototype,l.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){this.index=t},addAttribute:function(t,e){return(e&&e.isBufferAttribute)===!1&&(e&&e.isInterleavedBufferAttribute)===!1?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(t,new Rt(arguments[1],arguments[2]))):"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(e)):(this.attributes[t]=e,this)},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,i){this.groups.push({start:t,count:e,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToVector3Array(e.array),e.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var r=(new dt).getNormalMatrix(t);r.applyToVector3Array(i.array),i.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t;return function(e){return void 0===t&&(t=new p),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new p),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new p),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,i,r){return void 0===t&&(t=new p),t.makeTranslation(e,i,r),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,i,r){return void 0===t&&(t=new p),t.makeScale(e,i,r),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new Ft),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t&&t.isPoints||t&&t.isLine){var i=new Ot(3*e.vertices.length,3),r=new Ot(3*e.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(e.vertices)),this.addAttribute("color",r.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var n=new Ot(e.lineDistances.length,1);this.addAttribute("lineDistance",n.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t&&t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},updateFromObject:function(t){var e=t.geometry;if(t&&t.isMesh){var i=e.__directGeometry;if(e.elementsNeedUpdate===!0&&(i=void 0,e.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(e);i.verticesNeedUpdate=e.verticesNeedUpdate,i.normalsNeedUpdate=e.normalsNeedUpdate,i.colorsNeedUpdate=e.colorsNeedUpdate,i.uvsNeedUpdate=e.uvsNeedUpdate,i.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=i}var r;return e.verticesNeedUpdate===!0&&(r=this.attributes.position,void 0!==r&&(r.copyVector3sArray(e.vertices),r.needsUpdate=!0),e.verticesNeedUpdate=!1),e.normalsNeedUpdate===!0&&(r=this.attributes.normal,void 0!==r&&(r.copyVector3sArray(e.normals),r.needsUpdate=!0),e.normalsNeedUpdate=!1),e.colorsNeedUpdate===!0&&(r=this.attributes.color,void 0!==r&&(r.copyColorsArray(e.colors),r.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(r=this.attributes.uv,void 0!==r&&(r.copyVector2sArray(e.uvs),r.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(r=this.attributes.lineDistance,void 0!==r&&(r.copyArray(e.lineDistances),r.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new jt).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=this,i=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new Rt(i,3).copyVector3sArray(t.vertices)),t.normals.length>0){var r=new Float32Array(3*t.normals.length);this.addAttribute("normal",new Rt(r,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.addAttribute("color",new Rt(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var o=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new Rt(o,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var a=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new Rt(a,2).copyVector2sArray(t.uvs2))}if(t.indices.length>0){var s=t.vertices.length>65535?Uint32Array:Uint16Array,c=new s(3*t.indices.length);this.setIndex(new Rt(c,1).copyIndicesArray(t.indices))}this.groups=t.groups;for(var u in t.morphTargets){for(var l=[],h=t.morphTargets[u],d=0,f=h.length;d<f;d++){var p=h[d],m=new Ot(3*p.length,3);l.push(m.copyVector3sArray(p))}e.morphAttributes[u]=l}if(t.skinIndices.length>0){var g=new Ot(4*t.skinIndices.length,4);this.addAttribute("skinIndex",g.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var v=new Ot(4*t.skinWeights.length,4);this.addAttribute("skinWeight",v.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new lt);var t=this.attributes.position.array;void 0!==t?this.boundingBox.setFromArray(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var t=new lt,e=new g;return function(){null===this.boundingSphere&&(this.boundingSphere=new ht);var i=this.attributes.position;if(i){var r=i.array,n=this.boundingSphere.center;t.setFromArray(r),t.center(n);for(var o=0,a=0,s=r.length;a<s;a+=3)e.fromArray(r,a),o=Math.max(o,n.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes,i=this.groups;if(e.position){var r=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new Rt(new Float32Array(r.length),3));else for(var n=e.normal.array,o=0,a=n.length;o<a;o++)n[o]=0;var s,c,u,l=e.normal.array,h=new g,d=new g,f=new g,p=new g,m=new g;if(t){var v=t.array;0===i.length&&this.addGroup(0,v.length);for(var y=0,b=i.length;y<b;++y)for(var x=i[y],_=x.start,w=x.count,o=_,a=_+w;o<a;o+=3)s=3*v[o+0],c=3*v[o+1],u=3*v[o+2],h.fromArray(r,s),d.fromArray(r,c),f.fromArray(r,u),p.subVectors(f,d),m.subVectors(h,d),p.cross(m),l[s]+=p.x,l[s+1]+=p.y,l[s+2]+=p.z,l[c]+=p.x,l[c+1]+=p.y,l[c+2]+=p.z,l[u]+=p.x,l[u+1]+=p.y,l[u+2]+=p.z}else for(var o=0,a=r.length;o<a;o+=9)h.fromArray(r,o),d.fromArray(r,o+3),f.fromArray(r,o+6),p.subVectors(f,d),m.subVectors(h,d),p.cross(m),l[o]=p.x,l[o+1]=p.y,l[o+2]=p.z,l[o+3]=p.x,l[o+4]=p.y,l[o+5]=p.z,l[o+6]=p.x,l[o+7]=p.y,l[o+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if((t&&t.isBufferGeometry)===!1)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0);var i=this.attributes;for(var r in i)if(void 0!==t.attributes[r])for(var n=i[r],o=n.array,a=t.attributes[r],s=a.array,c=a.itemSize,u=0,l=c*e;u<s.length;u++,l++)o[l]=s[u];return this},normalizeNormals:function(){for(var t,e,i,r,n=this.attributes.normal.array,o=0,a=n.length;o<a;o+=3)t=n[o],e=n[o+1],i=n[o+2],r=1/Math.sqrt(t*t+e*e+i*i),n[o]*=r,n[o+1]*=r,n[o+2]*=r},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new $t,e=this.index.array,i=this.attributes;for(var r in i){for(var n=i[r],o=n.array,a=n.itemSize,s=new o.constructor(e.length*a),c=0,u=0,l=0,h=e.length;l<h;l++){c=e[l]*a;for(var d=0;d<a;d++)s[u++]=o[c++]}t.addAttribute(r,new Rt(s,a))}return t},toJSON:function(){var t={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};var r=this.index;if(null!==r){var n=Array.prototype.slice.call(r.array);t.data.index={type:r.array.constructor.name,array:n}}var o=this.attributes;for(var i in o){var a=o[i],n=Array.prototype.slice.call(a.array);t.data.attributes[i]={itemSize:a.itemSize,type:a.array.constructor.name,array:n,normalized:a.normalized}}var s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(t.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),t},clone:function(){return(new $t).copy(this)},copy:function(t){var e=this,i=t.index;null!==i&&this.setIndex(i.clone());var r=t.attributes;for(var n in r){var o=r[n];e.addAttribute(n,o.clone())}for(var a=t.groups,s=0,c=a.length;s<c;s++){var u=a[s];e.addGroup(u.start,u.count,u.materialIndex)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),$t.MaxIndex=65535,Kt.prototype=Object.create($t.prototype),Kt.prototype.constructor=Kt,Qt.prototype={constructor:Qt,set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){var i=e||new g;return i.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new g;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){var i=e||new g;i.subVectors(t,this.origin);var r=i.dot(this.direction);return r<0?i.copy(this.origin):i.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new g;return function(e){var i=t.subVectors(e,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(i).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new g,e=new g,i=new g;return function(r,n,o,a){t.copy(r).add(n).multiplyScalar(.5),e.copy(n).sub(r).normalize(),i.copy(this.origin).sub(t);var s,c,u,l,h=.5*r.distanceTo(n),d=-this.direction.dot(e),f=i.dot(this.direction),p=-i.dot(e),m=i.lengthSq(),g=Math.abs(1-d*d);if(g>0)if(s=d*p-f,c=d*f-p,l=h*g,s>=0)if(c>=-l)if(c<=l){var v=1/g;s*=v,c*=v,u=s*(s+d*c+2*f)+c*(d*s+c+2*p)+m}else c=h,s=Math.max(0,-(d*c+f)),u=-s*s+c*(c+2*p)+m;else c=-h,s=Math.max(0,-(d*c+f)),u=-s*s+c*(c+2*p)+m;else c<=-l?(s=Math.max(0,-(-d*h+f)),c=s>0?-h:Math.min(Math.max(-h,-p),h),u=-s*s+c*(c+2*p)+m):c<=l?(s=0,c=Math.min(Math.max(-h,-p),h),u=c*(c+2*p)+m):(s=Math.max(0,-(d*h+f)),c=s>0?h:Math.min(Math.max(-h,-p),h),u=-s*s+c*(c+2*p)+m);else c=d>0?-h:h,s=Math.max(0,-(d*c+f)),u=-s*s+c*(c+2*p)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(e).multiplyScalar(c).add(t),u}}(),intersectSphere:function(){var t=new g;return function(e,i){t.subVectors(e.center,this.origin);var r=t.dot(this.direction),n=t.dot(t)-r*r,o=e.radius*e.radius;if(n>o)return null;var a=Math.sqrt(o-n),s=r-a,c=r+a;return s<0&&c<0?null:s<0?this.at(c,i):this.at(s,i)}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null},intersectPlane:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);if(0===e)return!0;var i=t.normal.dot(this.direction);return i*e<0},intersectBox:function(t,e){var i,r,n,o,a,s,c=1/this.direction.x,u=1/this.direction.y,l=1/this.direction.z,h=this.origin;return c>=0?(i=(t.min.x-h.x)*c,r=(t.max.x-h.x)*c):(i=(t.max.x-h.x)*c,r=(t.min.x-h.x)*c),u>=0?(n=(t.min.y-h.y)*u,o=(t.max.y-h.y)*u):(n=(t.max.y-h.y)*u,o=(t.min.y-h.y)*u),i>o||n>r?null:((n>i||i!==i)&&(i=n),(o<r||r!==r)&&(r=o),l>=0?(a=(t.min.z-h.z)*l,s=(t.max.z-h.z)*l):(a=(t.max.z-h.z)*l,s=(t.min.z-h.z)*l),i>s||a>r?null:((a>i||i!==i)&&(i=a),(s<r||r!==r)&&(r=s),r<0?null:this.at(i>=0?i:r,e)))},intersectsBox:function(){var t=new g;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new g,e=new g,i=new g,r=new g;return function(n,o,a,s,c){e.subVectors(o,n),i.subVectors(a,n),r.crossVectors(e,i);var u,l=this.direction.dot(r);if(l>0){if(s)return null;u=1}else{if(!(l<0))return null;u=-1,l=-l}t.subVectors(this.origin,n);var h=u*this.direction.dot(i.crossVectors(t,i));
	if(h<0)return null;var d=u*this.direction.dot(e.cross(t));if(d<0)return null;if(h+d>l)return null;var f=-u*t.dot(r);return f<0?null:this.at(f/l,c)}}(),applyMatrix4:function(t){return this.direction.add(this.origin).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},Jt.prototype={constructor:Jt,set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},center:function(t){var e=t||new g;return e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){var e=t||new g;return e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var i=e||new g;return this.delta(i).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new g,e=new g;return function(i,r){t.subVectors(i,this.start),e.subVectors(this.end,this.start);var n=e.dot(e),o=e.dot(t),a=o/n;return r&&(a=Fl.clamp(a,0,1)),a}}(),closestPointToPoint:function(t,e,i){var r=this.closestPointToPointParameter(t,e),n=i||new g;return this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}},te.normal=function(){var t=new g;return function(e,i,r,n){var o=n||new g;o.subVectors(r,i),t.subVectors(e,i),o.cross(t);var a=o.lengthSq();return a>0?o.multiplyScalar(1/Math.sqrt(a)):o.set(0,0,0)}}(),te.barycoordFromPoint=function(){var t=new g,e=new g,i=new g;return function(r,n,o,a,s){t.subVectors(a,n),e.subVectors(o,n),i.subVectors(r,n);var c=t.dot(t),u=t.dot(e),l=t.dot(i),h=e.dot(e),d=e.dot(i),f=c*h-u*u,p=s||new g;if(0===f)return p.set(-2,-1,-1);var m=1/f,v=(h*l-u*d)*m,y=(c*d-u*l)*m;return p.set(1-v-y,y,v)}}(),te.containsPoint=function(){var t=new g;return function(e,i,r,n){var o=te.barycoordFromPoint(e,i,r,n,t);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}(),te.prototype={constructor:te,set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new g,e=new g;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){var e=t||new g;return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return te.normal(this.a,this.b,this.c,t)},plane:function(t){var e=t||new ft;return e.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return te.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return te.containsPoint(t,this.a,this.b,this.c)},closestPointToPoint:function(){var t,e,i,r;return function(n,o){void 0===t&&(t=new ft,e=[new Jt,new Jt,new Jt],i=new g,r=new g);var a=o||new g,s=1/0;if(t.setFromCoplanarPoints(this.a,this.b,this.c),t.projectPoint(n,i),this.containsPoint(i)===!0)a.copy(i);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var c=0;c<e.length;c++){e[c].closestPointToPoint(i,!0,r);var u=i.distanceToSquared(r);u<s&&(s=u,a.copy(r))}}return a}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},ee.prototype=Object.create(ot.prototype),ee.prototype.constructor=ee,ee.prototype.isMeshBasicMaterial=!0,ee.prototype.copy=function(t){return ot.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},ie.prototype=Object.assign(Object.create(Ft.prototype),{constructor:ie,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return Ft.prototype.copy.call(this,t),this.drawMode=t.drawMode,this},updateMorphTargets:function(){var t=this;if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,i=this.geometry.morphTargets.length;e<i;e++)t.morphTargetInfluences.push(0),t.morphTargetDictionary[t.geometry.morphTargets[e].name]=e}},getMorphTargetIndexByName:function(t){return void 0!==this.morphTargetDictionary[t]?this.morphTargetDictionary[t]:(console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+t+" does not exist. Returning 0."),0)},raycast:function(){function t(t,e,i,r,n,o,a){return te.barycoordFromPoint(t,e,i,r,y),n.multiplyScalar(y.x),o.multiplyScalar(y.y),a.multiplyScalar(y.z),n.add(o).add(a),n.clone()}function e(t,e,i,r,n,o,a){var s,c=t.material;if(s=c.side===Dc?i.intersectTriangle(o,n,r,!0,a):i.intersectTriangle(r,n,o,c.side!==Nc,a),null===s)return null;x.copy(a),x.applyMatrix4(t.matrixWorld);var u=e.ray.origin.distanceTo(x);return u<e.near||u>e.far?null:{distance:u,point:x.clone(),object:t}}function i(i,r,n,o,u,l,h,d){a.fromArray(o,3*l),s.fromArray(o,3*h),c.fromArray(o,3*d);var p=e(i,r,n,a,s,c,b);return p&&(u&&(f.fromArray(u,2*l),m.fromArray(u,2*h),v.fromArray(u,2*d),p.uv=t(b,a,s,c,f,m,v)),p.face=new Dt(l,h,d,te.normal(a,s,c)),p.faceIndex=l),p}var r=new p,n=new Qt,o=new ht,a=new g,s=new g,c=new g,u=new g,l=new g,d=new g,f=new h,m=new h,v=new h,y=new g,b=new g,x=new g;return function(h,p){var g=this,y=this.geometry,x=this.material,_=this.matrixWorld;if(void 0!==x&&(null===y.boundingSphere&&y.computeBoundingSphere(),o.copy(y.boundingSphere),o.applyMatrix4(_),h.ray.intersectsSphere(o)!==!1&&(r.getInverse(_),n.copy(h.ray).applyMatrix4(r),null===y.boundingBox||n.intersectsBox(y.boundingBox)!==!1))){var w,S;if(y&&y.isBufferGeometry){var A,M,P,C=y.index,T=y.attributes,E=T.position.array;if(void 0!==T.uv&&(w=T.uv.array),null!==C)for(var I=C.array,L=0,R=I.length;L<R;L+=3)A=I[L],M=I[L+1],P=I[L+2],S=i(g,h,n,E,w,A,M,P),S&&(S.faceIndex=Math.floor(L/3),p.push(S));else for(var L=0,R=E.length;L<R;L+=9)A=L/3,M=A+1,P=A+2,S=i(g,h,n,E,w,A,M,P),S&&(S.index=A,p.push(S))}else if(y&&y.isGeometry){var O,D,N,k=x&&x.isMultiMaterial,F=k===!0?x.materials:null,B=y.vertices,z=y.faces,U=y.faceVertexUvs[0];U.length>0&&(w=U);for(var j=0,$=z.length;j<$;j++){var V=z[j],G=k===!0?F[V.materialIndex]:x;if(void 0!==G){if(O=B[V.a],D=B[V.b],N=B[V.c],G.morphTargets===!0){var H=y.morphTargets,W=g.morphTargetInfluences;a.set(0,0,0),s.set(0,0,0),c.set(0,0,0);for(var X=0,q=H.length;X<q;X++){var Y=W[X];if(0!==Y){var Z=H[X].vertices;a.addScaledVector(u.subVectors(Z[V.a],O),Y),s.addScaledVector(l.subVectors(Z[V.b],D),Y),c.addScaledVector(d.subVectors(Z[V.c],N),Y)}}a.add(O),s.add(D),c.add(N),O=a,D=s,N=c}if(S=e(g,h,n,O,D,N,b)){if(w){var K=w[j];f.copy(K[0]),m.copy(K[1]),v.copy(K[2]),S.uv=t(b,O,D,N,f,m,v)}S.face=V,S.faceIndex=j,p.push(S)}}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),re.prototype=Object.create($t.prototype),re.prototype.constructor=re,ne.prototype=Object.create(Ft.prototype),ne.prototype.constructor=ne,ne.prototype.isCamera=!0,ne.prototype.getWorldDirection=function(){var t=new m;return function(e){var i=e||new g;return this.getWorldQuaternion(t),i.set(0,0,-1).applyQuaternion(t)}}(),ne.prototype.lookAt=function(){var t=new p;return function(e){t.lookAt(this.position,e,this.up),this.quaternion.setFromRotationMatrix(t)}}(),ne.prototype.clone=function(){return(new this.constructor).copy(this)},ne.prototype.copy=function(t){return Ft.prototype.copy.call(this,t),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},oe.prototype=Object.assign(Object.create(ne.prototype),{constructor:oe,isPerspectiveCamera:!0,copy:function(t){return ne.prototype.copy.call(this,t),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*Fl.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Fl.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Fl.RAD2DEG*Math.atan(Math.tan(.5*Fl.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,i,r,n,o){this.aspect=t/e,this.view={fullWidth:t,fullHeight:e,offsetX:i,offsetY:r,width:n,height:o},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Fl.DEG2RAD*this.fov)/this.zoom,i=2*e,r=this.aspect*i,n=-.5*r,o=this.view;if(null!==o){var a=o.fullWidth,s=o.fullHeight;n+=o.offsetX*r/a,e-=o.offsetY*i/s,r*=o.width/a,i*=o.height/s}var c=this.filmOffset;0!==c&&(n+=t*c/this.getFilmWidth()),this.projectionMatrix.makeFrustum(n,n+r,e-i,e,t,this.far)},toJSON:function(t){var e=Ft.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),ae.prototype=Object.assign(Object.create(ne.prototype),{constructor:ae,isOrthographicCamera:!0,copy:function(t){return ne.prototype.copy.call(this,t),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,i,r,n,o){this.view={fullWidth:t,fullHeight:e,offsetX:i,offsetY:r,width:n,height:o},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,n=i-t,o=i+t,a=r+e,s=r-e;if(null!==this.view){var c=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),l=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;n+=l*(this.view.offsetX/c),o=n+l*(this.view.width/c),a-=h*(this.view.offsetY/u),s=a-h*(this.view.height/u)}this.projectionMatrix.makeOrthographic(n,o,a,s,this.near,this.far)},toJSON:function(t){var e=Ft.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),ce.prototype.isFogExp2=!0,ce.prototype.clone=function(){return new ce(this.color.getHex(),this.density)},ce.prototype.toJSON=function(t){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},ue.prototype.isFog=!0,ue.prototype.clone=function(){return new ue(this.color.getHex(),this.near,this.far)},ue.prototype.toJSON=function(t){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},le.prototype=Object.create(Ft.prototype),le.prototype.constructor=le,le.prototype.copy=function(t,e){return Ft.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},le.prototype.toJSON=function(t){var e=Ft.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},he.prototype=Object.assign(Object.create(Ft.prototype),{constructor:he,isLensFlare:!0,copy:function(t){var e=this;Ft.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var i=0,r=t.lensFlares.length;i<r;i++)e.lensFlares.push(t.lensFlares[i]);return this},add:function(t,e,i,r,n,o){void 0===e&&(e=-1),void 0===i&&(i=0),void 0===o&&(o=1),void 0===n&&(n=new ct(16777215)),void 0===r&&(r=$c),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:t,size:e,distance:i,x:0,y:0,z:0,scale:1,rotation:0,opacity:o,color:n,blending:r})},updateLensFlares:function(){var t,e,i=this,r=this.lensFlares.length,n=2*-this.positionScreen.x,o=2*-this.positionScreen.y;for(t=0;t<r;t++)e=i.lensFlares[t],e.x=i.positionScreen.x+n*e.distance,e.y=i.positionScreen.y+o*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)}}),de.prototype=Object.create(ot.prototype),de.prototype.constructor=de,de.prototype.copy=function(t){return ot.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this},fe.prototype=Object.assign(Object.create(Ft.prototype),{constructor:fe,isSprite:!0,raycast:function(){var t=new g;return function(e,i){t.setFromMatrixPosition(this.matrixWorld);var r=e.ray.distanceSqToPoint(t),n=this.scale.x*this.scale.y/4;r>n||i.push({distance:Math.sqrt(r),point:this.position,face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),pe.prototype=Object.assign(Object.create(Ft.prototype),{constructor:pe,copy:function(t){var e=this;Ft.prototype.copy.call(this,t,!1);for(var i=t.levels,r=0,n=i.length;r<n;r++){var o=i[r];e.addLevel(o.object.clone(),o.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var i=this.levels,r=0;r<i.length&&!(e<i[r].distance);r++);i.splice(r,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,i=1,r=e.length;i<r&&!(t<e[i].distance);i++);return e[i-1].object},raycast:function(){var t=new g;return function(e,i){t.setFromMatrixPosition(this.matrixWorld);var r=e.ray.origin.distanceTo(t);this.getObjectForDistance(r).raycast(e,i)}}(),update:function(){var t=new g,e=new g;return function(i){var r=this.levels;if(r.length>1){t.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var n=t.distanceTo(e);r[0].object.visible=!0;for(var o=1,a=r.length;o<a&&n>=r[o].distance;o++)r[o-1].object.visible=!1,r[o].object.visible=!0;for(;o<a;o++)r[o].object.visible=!1}}}(),toJSON:function(t){var e=Ft.prototype.toJSON.call(this,t);e.object.levels=[];for(var i=this.levels,r=0,n=i.length;r<n;r++){var o=i[r];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),me.prototype=Object.create(d.prototype),me.prototype.constructor=me,me.prototype.isDataTexture=!0,Object.assign(ge.prototype,{calculateInverses:function(){var t=this;this.boneInverses=[];for(var e=0,i=this.bones.length;e<i;e++){var r=new p;t.bones[e]&&r.getInverse(t.bones[e].matrixWorld),t.boneInverses.push(r)}},pose:function(){for(var t,e=this,i=0,r=this.bones.length;i<r;i++)t=e.bones[i],t&&t.matrixWorld.getInverse(e.boneInverses[i]);for(var i=0,r=this.bones.length;i<r;i++)t=e.bones[i],t&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){var t=new p;return function(){for(var e=this,i=0,r=this.bones.length;i<r;i++){var n=e.bones[i]?e.bones[i].matrixWorld:e.identityMatrix;t.multiplyMatrices(n,e.boneInverses[i]),t.toArray(e.boneMatrices,16*i)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),clone:function(){return new ge(this.bones,this.boneInverses,this.useVertexTexture)}}),ve.prototype=Object.assign(Object.create(Ft.prototype),{constructor:ve,isBone:!0,copy:function(t){return Ft.prototype.copy.call(this,t),this.skin=t.skin,this}}),ye.prototype=Object.assign(Object.create(ie.prototype),{constructor:ye,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var t=this;if(this.geometry&&this.geometry.isGeometry)for(var e=0;e<this.geometry.skinWeights.length;e++){var i=t.geometry.skinWeights[e],r=1/i.lengthManhattan();r!==1/0?i.multiplyScalar(r):i.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry)for(var n=new it,o=this.geometry.attributes.skinWeight,e=0;e<o.count;e++){n.x=o.getX(e),n.y=o.getY(e),n.z=o.getZ(e),n.w=o.getW(e);var r=1/n.lengthManhattan();r!==1/0?n.multiplyScalar(r):n.set(1,0,0,0),o.setXYZW(e,n.x,n.y,n.z,n.w)}},updateMatrixWorld:function(t){ie.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material,this.skeleton.useVertexTexture).copy(this)}}),be.prototype=Object.create(ot.prototype),be.prototype.constructor=be,be.prototype.isLineBasicMaterial=!0,be.prototype.copy=function(t){return ot.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},xe.prototype=Object.assign(Object.create(Ft.prototype),{constructor:xe,isLine:!0,raycast:function(){var t=new p,e=new Qt,i=new ht;return function(r,n){var o=this,a=r.linePrecision,s=a*a,c=this.geometry,u=this.matrixWorld;if(null===c.boundingSphere&&c.computeBoundingSphere(),i.copy(c.boundingSphere),i.applyMatrix4(u),r.ray.intersectsSphere(i)!==!1){t.getInverse(u),e.copy(r.ray).applyMatrix4(t);var l=new g,h=new g,d=new g,f=new g,p=this&&this.isLineSegments?2:1;if(c&&c.isBufferGeometry){var m=c.index,v=c.attributes,y=v.position.array;if(null!==m)for(var b=m.array,x=0,_=b.length-1;x<_;x+=p){var w=b[x],S=b[x+1];l.fromArray(y,3*w),h.fromArray(y,3*S);var A=e.distanceSqToSegment(l,h,f,d);if(!(A>s)){f.applyMatrix4(o.matrixWorld);var M=r.ray.origin.distanceTo(f);M<r.near||M>r.far||n.push({distance:M,point:d.clone().applyMatrix4(o.matrixWorld),index:x,face:null,faceIndex:null,object:o})}}else for(var x=0,_=y.length/3-1;x<_;x+=p){l.fromArray(y,3*x),h.fromArray(y,3*x+3);var A=e.distanceSqToSegment(l,h,f,d);if(!(A>s)){f.applyMatrix4(o.matrixWorld);var M=r.ray.origin.distanceTo(f);M<r.near||M>r.far||n.push({distance:M,point:d.clone().applyMatrix4(o.matrixWorld),index:x,face:null,faceIndex:null,object:o})}}}else if(c&&c.isGeometry)for(var P=c.vertices,C=P.length,x=0;x<C-1;x+=p){var A=e.distanceSqToSegment(P[x],P[x+1],f,d);if(!(A>s)){f.applyMatrix4(o.matrixWorld);var M=r.ray.origin.distanceTo(f);M<r.near||M>r.far||n.push({distance:M,point:d.clone().applyMatrix4(o.matrixWorld),index:x,face:null,faceIndex:null,object:o})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),_e.prototype=Object.assign(Object.create(xe.prototype),{constructor:_e,isLineSegments:!0}),we.prototype=Object.create(ot.prototype),we.prototype.constructor=we,we.prototype.isPointsMaterial=!0,we.prototype.copy=function(t){return ot.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this},Se.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Se,isPoints:!0,raycast:function(){var t=new p,e=new Qt,i=new ht;return function(r,n){function o(t,i){var o=e.distanceSqToPoint(t);if(o<h){var s=e.closestPointToPoint(t);s.applyMatrix4(c);var u=r.ray.origin.distanceTo(s);if(u<r.near||u>r.far)return;n.push({distance:u,distanceToRay:Math.sqrt(o),point:s.clone(),index:i,face:null,object:a})}}var a=this,s=this.geometry,c=this.matrixWorld,u=r.params.Points.threshold;if(null===s.boundingSphere&&s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(c),r.ray.intersectsSphere(i)!==!1){t.getInverse(c),e.copy(r.ray).applyMatrix4(t);var l=u/((this.scale.x+this.scale.y+this.scale.z)/3),h=l*l,d=new g;if(s&&s.isBufferGeometry){var f=s.index,p=s.attributes,m=p.position.array;if(null!==f)for(var v=f.array,y=0,b=v.length;y<b;y++){var x=v[y];d.fromArray(m,3*x),o(d,x)}else for(var y=0,_=m.length/3;y<_;y++)d.fromArray(m,3*y),o(d,y)}else for(var w=s.vertices,y=0,_=w.length;y<_;y++)o(w[y],y)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ae.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Ae}),Me.prototype=Object.create(d.prototype),Me.prototype.constructor=Me,Me.prototype.isCompressedTexture=!0,Pe.prototype=Object.create(d.prototype),Pe.prototype.constructor=Pe;var Zd={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},Kd=new Ce;Object.assign(Te.prototype,{load:function(t,e,i,r){void 0!==this.path&&(t=this.path+t);var n=this,o=Zd.get(t);if(void 0!==o)return n.manager.itemStart(t),setTimeout(function(){e&&e(o),n.manager.itemEnd(t)},0),o;var a=new XMLHttpRequest;return a.open("GET",t,!0),a.addEventListener("load",function(i){var o=i.target.response;Zd.add(t,o),200===this.status?(e&&e(o),n.manager.itemEnd(t)):0===this.status?(console.warn("THREE.XHRLoader: HTTP Status 0 received."),e&&e(o),n.manager.itemEnd(t)):(r&&r(i),n.manager.itemError(t))},!1),void 0!==i&&a.addEventListener("progress",function(t){i(t)},!1),a.addEventListener("error",function(e){r&&r(e),n.manager.itemError(t)},!1),void 0!==this.responseType&&(a.responseType=this.responseType),void 0!==this.withCredentials&&(a.withCredentials=this.withCredentials),a.overrideMimeType&&a.overrideMimeType("text/plain"),a.send(null),n.manager.itemStart(t),a},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this}}),Object.assign(Ee.prototype,{load:function(t,e,i,r){function n(n){c.load(t[n],function(t){var i=o._parser(t,!0);a[n]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},u+=1,6===u&&(1===i.mipmapCount&&(s.minFilter=zu),s.format=i.format,s.needsUpdate=!0,e&&e(s))},i,r)}var o=this,a=[],s=new Me;s.image=a;var c=new Te(this.manager);if(c.setPath(this.path),c.setResponseType("arraybuffer"),Array.isArray(t))for(var u=0,l=0,h=t.length;l<h;++l)n(l);else c.load(t,function(t){var i=o._parser(t,!0);if(i.isCubemap)for(var r=i.mipmaps.length/i.mipmapCount,n=0;n<r;n++){a[n]={mipmaps:[]};for(var c=0;c<i.mipmapCount;c++)a[n].mipmaps.push(i.mipmaps[n*i.mipmapCount+c]),a[n].format=i.format,a[n].width=i.width,a[n].height=i.height}else s.image.width=i.width,s.image.height=i.height,s.mipmaps=i.mipmaps;1===i.mipmapCount&&(s.minFilter=zu),s.format=i.format,s.needsUpdate=!0,e&&e(s)},i,r);return s},setPath:function(t){return this.path=t,this}}),Object.assign(Ie.prototype,{load:function(t,e,i,r){var n=this,o=new me,a=new Te(this.manager);return a.setResponseType("arraybuffer"),a.load(t,function(t){var i=n._parser(t);i&&(void 0!==i.image?o.image=i.image:void 0!==i.data&&(o.image.width=i.width,o.image.height=i.height,o.image.data=i.data),o.wrapS=void 0!==i.wrapS?i.wrapS:Du,o.wrapT=void 0!==i.wrapT?i.wrapT:Du,o.magFilter=void 0!==i.magFilter?i.magFilter:zu,o.minFilter=void 0!==i.minFilter?i.minFilter:ju,o.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(o.format=i.format),void 0!==i.type&&(o.type=i.type),void 0!==i.mipmaps&&(o.mipmaps=i.mipmaps),1===i.mipmapCount&&(o.minFilter=zu),o.needsUpdate=!0,e&&e(o,i))},i,r),o}}),Object.assign(Le.prototype,{load:function(t,e,i,r){var n=this,o=document.createElementNS("http://www.w3.org/1999/xhtml","img");if(o.onload=function(){URL.revokeObjectURL(o.src),e&&e(o),n.manager.itemEnd(t)},0===t.indexOf("data:"))o.src=t;else{var a=new Te;a.setPath(this.path),a.setResponseType("blob"),a.setWithCredentials(this.withCredentials),a.load(t,function(t){o.src=URL.createObjectURL(t)},i,r)}return n.manager.itemStart(t),o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Re.prototype,{load:function(t,e,i,r){function n(i){a.load(t[i],function(t){o.images[i]=t,s++,6===s&&(o.needsUpdate=!0,e&&e(o))},void 0,r)}var o=new x,a=new Le(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);for(var s=0,c=0;c<t.length;++c)n(c);return o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Oe.prototype,{load:function(t,e,i,r){var n=new d,o=new Le(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setWithCredentials(this.withCredentials),o.setPath(this.path),o.load(t,function(i){var r=t.search(/\.(jpg|jpeg)$/)>0||0===t.search(/^data\:image\/jpeg/);n.format=r?el:il,n.image=i,n.needsUpdate=!0,void 0!==e&&e(n)},i,r),n},setCrossOrigin:function(t){return this.crossOrigin=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setPath:function(t){return this.path=t,this}}),De.prototype=Object.assign(Object.create(Ft.prototype),{constructor:De,isLight:!0,copy:function(t){return Ft.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Ft.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Ne.prototype=Object.assign(Object.create(De.prototype),{constructor:Ne,isHemisphereLight:!0,copy:function(t){return De.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(ke.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Fe.prototype=Object.assign(Object.create(ke.prototype),{constructor:Fe,isSpotLightShadow:!0,update:function(t){var e=2*Fl.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||500,n=this.camera;e===n.fov&&i===n.aspect&&r===n.far||(n.fov=e,n.aspect=i,n.far=r,n.updateProjectionMatrix())}}),Be.prototype=Object.assign(Object.create(De.prototype),{constructor:Be,isSpotLight:!0,copy:function(t){return De.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),ze.prototype=Object.assign(Object.create(De.prototype),{constructor:ze,isPointLight:!0,copy:function(t){return De.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Ue.prototype=Object.assign(Object.create(ke.prototype),{constructor:Ue}),je.prototype=Object.assign(Object.create(De.prototype),{constructor:je,isDirectionalLight:!0,copy:function(t){return De.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),$e.prototype=Object.assign(Object.create(De.prototype),{constructor:$e,isAmbientLight:!0});var Qd={arraySlice:function(t,e,i){return Qd.isTypedArray(t)?new t.constructor(t.subarray(e,i)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,i){return t[e]-t[i]}for(var i=t.length,r=new Array(i),n=0;n!==i;++n)r[n]=n;return r.sort(e),r},sortedArray:function(t,e,i){for(var r=t.length,n=new t.constructor(r),o=0,a=0;a!==r;++o)for(var s=i[o]*e,c=0;c!==e;++c)n[a++]=t[s+c];return n},flattenJSON:function(t,e,i,r){for(var n=1,o=t[0];void 0!==o&&void 0===o[r];)o=t[n++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a)){do a=o[r],void 0!==a&&(e.push(o.time),i.push.apply(i,a)),o=t[n++];while(void 0!==o)}else if(void 0!==a.toArray){do a=o[r],void 0!==a&&(e.push(o.time),a.toArray(i,i.length)),o=t[n++];while(void 0!==o)}else do a=o[r],void 0!==a&&(e.push(o.time),i.push(a)),o=t[n++];while(void 0!==o)}}};Ve.prototype={constructor:Ve,evaluate:function(t){var e=this,i=this.parameterPositions,r=this._cachedIndex,n=i[r],o=i[r-1];t:{e:{var a;i:{r:if(!(t<n)){for(var s=r+2;;){if(void 0===n){if(t<o)break r;return r=i.length,e._cachedIndex=r,e.afterEnd_(r-1,t,o)}if(r===s)break;if(o=n,n=i[++r],t<n)break e}a=i.length;break i}{if(t>=o)break t;var c=i[1];t<c&&(r=2,o=c);for(var s=r-2;;){if(void 0===o)return e._cachedIndex=0,e.beforeStart_(0,t,n);if(r===s)break;if(n=o,o=i[--r-1],t>=o)break e}a=r,r=0}}for(;r<a;){var u=r+a>>>1;t<i[u]?a=u:r=u+1}if(n=i[r],o=i[r-1],void 0===o)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return r=i.length,this._cachedIndex=r,this.afterEnd_(r-1,o,t)}this._cachedIndex=r,this.intervalChanged_(r,o,n)}return this.interpolate_(r,o,t,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=t*r,o=0;o!==r;++o)e[o]=i[n+o];return e},interpolate_:function(t,e,i,r){throw new Error("call to abstract method")},intervalChanged_:function(t,e,i){}},Object.assign(Ve.prototype,{beforeStart_:Ve.prototype.copySampleValue_,afterEnd_:Ve.prototype.copySampleValue_}),Ge.prototype=Object.assign(Object.create(Ve.prototype),{constructor:Ge,DefaultSettings_:{endingStart:wl,endingEnd:wl},intervalChanged_:function(t,e,i){var r=this.parameterPositions,n=t-2,o=t+1,a=r[n],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case Sl:n=t,a=2*e-i;break;case Al:n=r.length-2,a=e+r[n]-r[n+1];break;default:n=t,a=i}if(void 0===s)switch(this.getSettings_().endingEnd){case Sl:o=t,s=2*i-e;break;case Al:o=1,s=i+r[1]-r[0];break;default:o=t-1,s=e}var c=.5*(i-e),u=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(s-i),this._offsetPrev=n*u,this._offsetNext=o*u},interpolate_:function(t,e,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,u=this._offsetPrev,l=this._offsetNext,h=this._weightPrev,d=this._weightNext,f=(i-e)/(r-e),p=f*f,m=p*f,g=-h*m+2*h*p-h*f,v=(1+h)*m+(-1.5-2*h)*p+(-.5+h)*f+1,y=(-1-d)*m+(1.5+d)*p+.5*f,b=d*m-d*p,x=0;x!==a;++x)n[x]=g*o[u+x]+v*o[c+x]+y*o[s+x]+b*o[l+x];return n}}),He.prototype=Object.assign(Object.create(Ve.prototype),{constructor:He,interpolate_:function(t,e,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,u=(i-e)/(r-e),l=1-u,h=0;h!==a;++h)n[h]=o[c+h]*l+o[s+h]*u;return n}}),We.prototype=Object.assign(Object.create(Ve.prototype),{constructor:We,interpolate_:function(t,e,i,r){return this.copySampleValue_(t-1)}});var Jd;Jd={TimeBufferType:Float32Array,
	ValueBufferType:Float32Array,DefaultInterpolation:xl,InterpolantFactoryMethodDiscrete:function(t){return new We(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new He(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Ge(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case bl:e=this.InterpolantFactoryMethodDiscrete;break;case xl:e=this.InterpolantFactoryMethodLinear;break;case _l:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return void console.warn(i)}this.createInterpolant=e},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return bl;case this.InterpolantFactoryMethodLinear:return xl;case this.InterpolantFactoryMethodSmooth:return _l}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,i=0,r=e.length;i!==r;++i)e[i]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,i=0,r=e.length;i!==r;++i)e[i]*=t;return this},trim:function(t,e){for(var i=this.times,r=i.length,n=0,o=r-1;n!==r&&i[n]<t;)++n;for(;o!==-1&&i[o]>e;)--o;if(++o,0!==n||o!==r){n>=o&&(o=Math.max(o,1),n=o-1);var a=this.getValueSize();this.times=Qd.arraySlice(i,n,o),this.values=Qd.arraySlice(this.values,n*a,o*a)}return this},validate:function(){var t=this,e=!0,i=this.getValueSize();i-Math.floor(i)!==0&&(console.error("invalid value size in track",this),e=!1);var r=this.times,n=this.values,o=r.length;0===o&&(console.error("track is empty",this),e=!1);for(var a=null,s=0;s!==o;s++){var c=r[s];if("number"==typeof c&&isNaN(c)){console.error("time is not a valid number",t,s,c),e=!1;break}if(null!==a&&a>c){console.error("out of order keys",t,s,c,a),e=!1;break}a=c}if(void 0!==n&&Qd.isTypedArray(n))for(var s=0,u=n.length;s!==u;++s){var l=n[s];if(isNaN(l)){console.error("value is not a valid number",t,s,l),e=!1;break}}return e},optimize:function(){for(var t=this.times,e=this.values,i=this.getValueSize(),r=1,n=1,o=t.length-1;n<=o;++n){var a=!1,s=t[n],c=t[n+1];if(s!==c&&(1!==n||s!==s[0]))for(var u=n*i,l=u-i,h=u+i,d=0;d!==i;++d){var f=e[u+d];if(f!==e[l+d]||f!==e[h+d]){a=!0;break}}if(a){if(n!==r){t[r]=t[n];for(var p=n*i,m=r*i,d=0;d!==i;++d)e[m+d]=e[p+d]}++r}}return r!==t.length&&(this.times=Qd.arraySlice(t,0,r),this.values=Qd.arraySlice(e,0,r*i)),this}},qe.prototype=Object.assign(Object.create(Jd),{constructor:qe,ValueTypeName:"vector"}),Ye.prototype=Object.assign(Object.create(Ve.prototype),{constructor:Ye,interpolate_:function(t,e,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=(i-e)/(r-e),u=s+a;s!==u;s+=4)m.slerpFlat(n,0,o,s-a,o,s,c);return n}}),Ze.prototype=Object.assign(Object.create(Jd),{constructor:Ze,ValueTypeName:"quaternion",DefaultInterpolation:xl,InterpolantFactoryMethodLinear:function(t){return new Ye(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Ke.prototype=Object.assign(Object.create(Jd),{constructor:Ke,ValueTypeName:"number"}),Qe.prototype=Object.assign(Object.create(Jd),{constructor:Qe,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:bl,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Je.prototype=Object.assign(Object.create(Jd),{constructor:Je,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:bl,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ti.prototype=Object.assign(Object.create(Jd),{constructor:ti,ValueTypeName:"color"}),ei.prototype=Jd,Jd.constructor=ei,Object.assign(ei,{parse:function(t){if(void 0===t.type)throw new Error("track type undefined, can not parse");var e=ei._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){var i=[],r=[];Qd.flattenJSON(t.keys,i,r,"value"),t.times=i,t.values=r}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){var e,i=t.constructor;if(void 0!==i.toJSON)e=i.toJSON(t);else{e={name:t.name,times:Qd.convertArray(t.times,Array),values:Qd.convertArray(t.values,Array)};var r=t.getInterpolation();r!==t.DefaultInterpolation&&(e.interpolation=r)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ke;case"vector":case"vector2":case"vector3":case"vector4":return qe;case"color":return ti;case"quaternion":return Ze;case"bool":case"boolean":return Je;case"string":return Qe}throw new Error("Unsupported typeName: "+t)}}),ii.prototype={constructor:ii,resetDuration:function(){for(var t=this,e=this.tracks,i=0,r=0,n=e.length;r!==n;++r){var o=t.tracks[r];i=Math.max(i,o.times[o.times.length-1])}this.duration=i},trim:function(){for(var t=this,e=0;e<this.tracks.length;e++)t.tracks[e].trim(0,t.duration);return this},optimize:function(){for(var t=this,e=0;e<this.tracks.length;e++)t.tracks[e].optimize();return this}},Object.assign(ii,{parse:function(t){for(var e=[],i=t.tracks,r=1/(t.fps||1),n=0,o=i.length;n!==o;++n)e.push(ei.parse(i[n]).scale(r));return new ii(t.name,t.duration,e)},toJSON:function(t){for(var e=[],i=t.tracks,r={name:t.name,duration:t.duration,tracks:e},n=0,o=i.length;n!==o;++n)e.push(ei.toJSON(i[n]));return r},CreateFromMorphTargetSequence:function(t,e,i,r){for(var n=e.length,o=[],a=0;a<n;a++){var s=[],c=[];s.push((a+n-1)%n,a,(a+1)%n),c.push(0,1,0);var u=Qd.getKeyframeOrder(s);s=Qd.sortedArray(s,1,u),c=Qd.sortedArray(c,1,u),r||0!==s[0]||(s.push(n),c.push(c[0])),o.push(new Ke(".morphTargetInfluences["+e[a].name+"]",s,c).scale(1/i))}return new ii(t,-1,o)},findByName:function(t,e){var i=t;if(!Array.isArray(t)){var r=t;i=r.geometry&&r.geometry.animations||r.animations}for(var n=0;n<i.length;n++)if(i[n].name===e)return i[n];return null},CreateClipsFromMorphTargetSequences:function(t,e,i){for(var r={},n=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],c=s.name.match(n);if(c&&c.length>1){var u=c[1],l=r[u];l||(r[u]=l=[]),l.push(s)}}var h=[];for(var u in r)h.push(ii.CreateFromMorphTargetSequence(u,r[u],e,i));return h},parseAnimation:function(t,e,i){if(!t)return console.error("  no animation in JSONLoader data"),null;for(var r=function(t,e,i,r,n){if(0!==i.length){var o=[],a=[];Qd.flattenJSON(i,o,a,r),0!==o.length&&n.push(new t(e,o,a))}},n=[],o=t.name||"default",a=t.length||-1,s=t.fps||30,c=t.hierarchy||[],u=0;u<c.length;u++){var l=c[u].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var h={},d=0;d<l.length;d++)if(l[d].morphTargets)for(var f=0;f<l[d].morphTargets.length;f++)h[l[d].morphTargets[f]]=-1;for(var p in h){for(var m=[],g=[],f=0;f!==l[d].morphTargets.length;++f){var v=l[d];m.push(v.time),g.push(v.morphTarget===p?1:0)}n.push(new Ke(".morphTargetInfluence["+p+"]",m,g))}a=h.length*(s||1)}else{var y=".bones["+e[u].name+"]";r(qe,y+".position",l,"pos",n),r(Ze,y+".quaternion",l,"rot",n),r(qe,y+".scale",l,"scl",n)}}if(0===n.length)return null;var b=new ii(o,a,n);return b}}),Object.assign(ri.prototype,{load:function(t,e,i,r){var n=this,o=new Te(n.manager);o.load(t,function(t){e(n.parse(JSON.parse(t)))},i,r)},setTextures:function(t){this.textures=t},parse:function(t){function e(t){return void 0===r[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),r[t]}var i=this,r=this.textures,n=new THREE[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&n.specular.setHex(t.specular),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.uniforms&&(n.uniforms=t.uniforms),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(n.vertexColors=t.vertexColors),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.shading&&(n.shading=t.shading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.side&&(n.side=t.side),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.skinning&&(n.skinning=t.skinning),void 0!==t.morphTargets&&(n.morphTargets=t.morphTargets),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=e(t.map)),void 0!==t.alphaMap&&(n.alphaMap=e(t.alphaMap),n.transparent=!0),void 0!==t.bumpMap&&(n.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=e(t.normalMap)),void 0!==t.normalScale){var o=t.normalScale;Array.isArray(o)===!1&&(o=[o,o]),n.normalScale=(new h).fromArray(o)}if(void 0!==t.displacementMap&&(n.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=e(t.specularMap)),void 0!==t.envMap&&(n.envMap=e(t.envMap)),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.lightMap&&(n.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.materials)for(var a=0,s=t.materials.length;a<s;a++)n.materials.push(i.parse(t.materials[a]));return n}}),Object.assign(ni.prototype,{load:function(t,e,i,r){var n=this,o=new Te(n.manager);o.load(t,function(t){e(n.parse(JSON.parse(t)))},i,r)},parse:function(t){var e=new $t,i=t.data.index,r={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};if(void 0!==i){var n=new r[i.type](i.array);e.setIndex(new Rt(n,1))}var o=t.data.attributes;for(var a in o){var s=o[a],n=new r[s.type](s.array);e.addAttribute(a,new Rt(n,s.itemSize,s.normalized))}var c=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==c)for(var u=0,l=c.length;u!==l;++u){var h=c[u];e.addGroup(h.start,h.count,h.materialIndex)}var d=t.data.boundingSphere;if(void 0!==d){var f=new g;void 0!==d.center&&f.fromArray(d.center),e.boundingSphere=new ht(f,d.radius)}return e}}),oi.prototype={constructor:oi,crossOrigin:void 0,extractUrlBase:function(t){var e=t.split("/");return 1===e.length?"./":(e.pop(),e.join("/")+"/")},initMaterials:function(t,e,i){for(var r=this,n=[],o=0;o<t.length;++o)n[o]=r.createMaterial(t[o],e,i);return n},createMaterial:function(){var t,e,i;return function(r,n,o){function a(t,i,r,a,c){var u,l=n+t,h=oi.Handlers.get(l);null!==h?u=h.load(l):(e.setCrossOrigin(o),u=e.load(l)),void 0!==i&&(u.repeat.fromArray(i),1!==i[0]&&(u.wrapS=Ou),1!==i[1]&&(u.wrapT=Ou)),void 0!==r&&u.offset.fromArray(r),void 0!==a&&("repeat"===a[0]&&(u.wrapS=Ou),"mirror"===a[0]&&(u.wrapS=Nu),"repeat"===a[1]&&(u.wrapT=Ou),"mirror"===a[1]&&(u.wrapT=Nu)),void 0!==c&&(u.anisotropy=c);var d=Fl.generateUUID();return s[d]=u,d}void 0===t&&(t=new ct),void 0===e&&(e=new Oe),void 0===i&&(i=new ri);var s={},c={uuid:Fl.generateUUID(),type:"MeshLambertMaterial"};for(var u in r){var l=r[u];switch(u){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":c.name=l;break;case"blending":c.blending=THREE[l];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",u,"is no longer supported.");break;case"colorDiffuse":c.color=t.fromArray(l).getHex();break;case"colorSpecular":c.specular=t.fromArray(l).getHex();break;case"colorEmissive":c.emissive=t.fromArray(l).getHex();break;case"specularCoef":c.shininess=l;break;case"shading":"basic"===l.toLowerCase()&&(c.type="MeshBasicMaterial"),"phong"===l.toLowerCase()&&(c.type="MeshPhongMaterial"),"standard"===l.toLowerCase()&&(c.type="MeshStandardMaterial");break;case"mapDiffuse":c.map=a(l,r.mapDiffuseRepeat,r.mapDiffuseOffset,r.mapDiffuseWrap,r.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":c.emissiveMap=a(l,r.mapEmissiveRepeat,r.mapEmissiveOffset,r.mapEmissiveWrap,r.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":c.lightMap=a(l,r.mapLightRepeat,r.mapLightOffset,r.mapLightWrap,r.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":c.aoMap=a(l,r.mapAORepeat,r.mapAOOffset,r.mapAOWrap,r.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":c.bumpMap=a(l,r.mapBumpRepeat,r.mapBumpOffset,r.mapBumpWrap,r.mapBumpAnisotropy);break;case"mapBumpScale":c.bumpScale=l;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":c.normalMap=a(l,r.mapNormalRepeat,r.mapNormalOffset,r.mapNormalWrap,r.mapNormalAnisotropy);break;case"mapNormalFactor":c.normalScale=[l,l];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":c.specularMap=a(l,r.mapSpecularRepeat,r.mapSpecularOffset,r.mapSpecularWrap,r.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":c.metalnessMap=a(l,r.mapMetalnessRepeat,r.mapMetalnessOffset,r.mapMetalnessWrap,r.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":c.roughnessMap=a(l,r.mapRoughnessRepeat,r.mapRoughnessOffset,r.mapRoughnessWrap,r.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":c.alphaMap=a(l,r.mapAlphaRepeat,r.mapAlphaOffset,r.mapAlphaWrap,r.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":c.side=Dc;break;case"doubleSided":c.side=Nc;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),c.opacity=l;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":c[u]=l;break;case"vertexColors":l===!0&&(c.vertexColors=Uc),"face"===l&&(c.vertexColors=zc);break;default:console.error("THREE.Loader.createMaterial: Unsupported",u,l)}}return"MeshBasicMaterial"===c.type&&delete c.emissive,"MeshPhongMaterial"!==c.type&&delete c.specular,c.opacity<1&&(c.transparent=!0),i.setTextures(s),i.parse(c)}}()},oi.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,i=0,r=e.length;i<r;i+=2){var n=e[i],o=e[i+1];if(n.test(t))return o}return null}},Object.assign(ai.prototype,{load:function(t,e,i,r){var n=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:oi.prototype.extractUrlBase(t),a=new Te(this.manager);a.setWithCredentials(this.withCredentials),a.load(t,function(i){var r=JSON.parse(i),a=r.metadata;if(void 0!==a){var s=a.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.SceneLoader instead.")}}var c=n.parse(r,o);e(c.geometry,c.materials)},i,r)},setTexturePath:function(t){this.texturePath=t},parse:function(t,e){function i(e){function i(t,e){return t&1<<e}var r,n,o,s,c,u,l,d,f,p,m,v,y,b,x,_,w,S,A,M,P,C,T,E,I,L,R,O=t.faces,D=t.vertices,N=t.normals,k=t.colors,F=0;if(void 0!==t.uvs){for(r=0;r<t.uvs.length;r++)t.uvs[r].length&&F++;for(r=0;r<F;r++)a.faceVertexUvs[r]=[]}for(s=0,c=D.length;s<c;)S=new g,S.x=D[s++]*e,S.y=D[s++]*e,S.z=D[s++]*e,a.vertices.push(S);for(s=0,c=O.length;s<c;)if(p=O[s++],m=i(p,0),v=i(p,1),y=i(p,3),b=i(p,4),x=i(p,5),_=i(p,6),w=i(p,7),m){if(M=new Dt,M.a=O[s],M.b=O[s+1],M.c=O[s+3],P=new Dt,P.a=O[s+1],P.b=O[s+2],P.c=O[s+3],s+=4,v&&(f=O[s++],M.materialIndex=f,P.materialIndex=f),o=a.faces.length,y)for(r=0;r<F;r++)for(E=t.uvs[r],a.faceVertexUvs[r][o]=[],a.faceVertexUvs[r][o+1]=[],n=0;n<4;n++)d=O[s++],L=E[2*d],R=E[2*d+1],I=new h(L,R),2!==n&&a.faceVertexUvs[r][o].push(I),0!==n&&a.faceVertexUvs[r][o+1].push(I);if(b&&(l=3*O[s++],M.normal.set(N[l++],N[l++],N[l]),P.normal.copy(M.normal)),x)for(r=0;r<4;r++)l=3*O[s++],T=new g(N[l++],N[l++],N[l]),2!==r&&M.vertexNormals.push(T),0!==r&&P.vertexNormals.push(T);if(_&&(u=O[s++],C=k[u],M.color.setHex(C),P.color.setHex(C)),w)for(r=0;r<4;r++)u=O[s++],C=k[u],2!==r&&M.vertexColors.push(new ct(C)),0!==r&&P.vertexColors.push(new ct(C));a.faces.push(M),a.faces.push(P)}else{if(A=new Dt,A.a=O[s++],A.b=O[s++],A.c=O[s++],v&&(f=O[s++],A.materialIndex=f),o=a.faces.length,y)for(r=0;r<F;r++)for(E=t.uvs[r],a.faceVertexUvs[r][o]=[],n=0;n<3;n++)d=O[s++],L=E[2*d],R=E[2*d+1],I=new h(L,R),a.faceVertexUvs[r][o].push(I);if(b&&(l=3*O[s++],A.normal.set(N[l++],N[l++],N[l])),x)for(r=0;r<3;r++)l=3*O[s++],T=new g(N[l++],N[l++],N[l]),A.vertexNormals.push(T);if(_&&(u=O[s++],A.color.setHex(k[u])),w)for(r=0;r<3;r++)u=O[s++],A.vertexColors.push(new ct(k[u]));a.faces.push(A)}}function r(){var e=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var i=0,r=t.skinWeights.length;i<r;i+=e){var n=t.skinWeights[i],o=e>1?t.skinWeights[i+1]:0,s=e>2?t.skinWeights[i+2]:0,c=e>3?t.skinWeights[i+3]:0;a.skinWeights.push(new it(n,o,s,c))}if(t.skinIndices)for(var i=0,r=t.skinIndices.length;i<r;i+=e){var u=t.skinIndices[i],l=e>1?t.skinIndices[i+1]:0,h=e>2?t.skinIndices[i+2]:0,d=e>3?t.skinIndices[i+3]:0;a.skinIndices.push(new it(u,l,h,d))}a.bones=t.bones,a.bones&&a.bones.length>0&&(a.skinWeights.length!==a.skinIndices.length||a.skinIndices.length!==a.vertices.length)&&console.warn("When skinning, number of vertices ("+a.vertices.length+"), skinIndices ("+a.skinIndices.length+"), and skinWeights ("+a.skinWeights.length+") should match.")}function n(e){if(void 0!==t.morphTargets)for(var i=0,r=t.morphTargets.length;i<r;i++){a.morphTargets[i]={},a.morphTargets[i].name=t.morphTargets[i].name,a.morphTargets[i].vertices=[];for(var n=a.morphTargets[i].vertices,o=t.morphTargets[i].vertices,s=0,c=o.length;s<c;s+=3){var u=new g;u.x=o[s]*e,u.y=o[s+1]*e,u.z=o[s+2]*e,n.push(u)}}if(void 0!==t.morphColors&&t.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var l=a.faces,h=t.morphColors[0].colors,i=0,r=l.length;i<r;i++)l[i].color.fromArray(h,3*i)}}function o(){var e=[],i=[];void 0!==t.animation&&i.push(t.animation),void 0!==t.animations&&(t.animations.length?i=i.concat(t.animations):i.push(t.animations));for(var r=0;r<i.length;r++){var n=ii.parseAnimation(i[r],a.bones);n&&e.push(n)}if(a.morphTargets){var o=ii.CreateClipsFromMorphTargetSequences(a.morphTargets,10);e=e.concat(o)}e.length>0&&(a.animations=e)}var a=new zt,s=void 0!==t.scale?1/t.scale:1;if(i(s),r(),n(s),o(),a.computeFaceNormals(),a.computeBoundingSphere(),void 0===t.materials||0===t.materials.length)return{geometry:a};var c=oi.prototype.initMaterials(t.materials,e,this.crossOrigin);return{geometry:a,materials:c}}}),Object.assign(si.prototype,{load:function(t,e,i,r){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var n=this,o=new Te(n.manager);o.load(t,function(t){n.parse(JSON.parse(t),e)},i,r)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var i=this.parseGeometries(t.geometries),r=this.parseImages(t.images,function(){void 0!==e&&e(a)}),n=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,n),a=this.parseObject(t.object,i,o);return t.animations&&(a.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(a),a},parseGeometries:function(t){var e=this,i={};if(void 0!==t)for(var r=new ai,n=new ni,o=0,a=t.length;o<a;o++){var s,c=t[o];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new THREE[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new THREE[c.type](c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new THREE[c.type](c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new THREE[c.type](c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new THREE[c.type](c.radius,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new THREE[c.type](c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":case"IcosahedronGeometry":case"OctahedronGeometry":case"TetrahedronGeometry":s=new THREE[c.type](c.radius,c.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new THREE[c.type](c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new THREE[c.type](c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new THREE[c.type](c.radius,c.tube,c.tubularSegments,c.radialSegments,c.p,c.q);break;case"LatheGeometry":case"LatheBufferGeometry":s=new THREE[c.type](c.points,c.segments,c.phiStart,c.phiLength);break;case"BufferGeometry":s=n.parse(c);break;case"Geometry":s=r.parse(c.data,e.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),i[c.uuid]=s}return i},parseMaterials:function(t,e){var i={};if(void 0!==t){var r=new ri;r.setTextures(e);for(var n=0,o=t.length;n<o;n++){var a=r.parse(t[n]);i[a.uuid]=a}}return i},parseAnimations:function(t){for(var e=[],i=0;i<t.length;i++){var r=ii.parse(t[i]);e.push(r)}return e},parseImages:function(t,e){function i(t){return r.manager.itemStart(t),a.load(t,function(){r.manager.itemEnd(t)},void 0,function(){r.manager.itemError(t)})}var r=this,n={};if(void 0!==t&&t.length>0){var o=new Ce(e),a=new Le(o);a.setCrossOrigin(this.crossOrigin);for(var s=0,c=t.length;s<c;s++){var u=t[s],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u.url)?u.url:r.texturePath+u.url;n[u.uuid]=i(l)}}return n},parseTextures:function(t,e){function i(t){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),THREE[t])}var r={};if(void 0!==t)for(var n=0,o=t.length;n<o;n++){var a=t[n];void 0===a.image&&console.warn('THREE.ObjectLoader: No "image" specified for',a.uuid),void 0===e[a.image]&&console.warn("THREE.ObjectLoader: Undefined image",a.image);var s=new d(e[a.image]);s.needsUpdate=!0,s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),void 0!==a.mapping&&(s.mapping=i(a.mapping)),void 0!==a.offset&&s.offset.fromArray(a.offset),void 0!==a.repeat&&s.repeat.fromArray(a.repeat),void 0!==a.wrap&&(s.wrapS=i(a.wrap[0]),s.wrapT=i(a.wrap[1])),void 0!==a.minFilter&&(s.minFilter=i(a.minFilter)),void 0!==a.magFilter&&(s.magFilter=i(a.magFilter)),void 0!==a.anisotropy&&(s.anisotropy=a.anisotropy),void 0!==a.flipY&&(s.flipY=a.flipY),r[a.uuid]=s}return r},parseObject:function(){var t=new p;return function(e,i,r){function n(t){return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),i[t]}function o(t){if(void 0!==t)return void 0===r[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),r[t]}var a,s=this;switch(e.type){case"Scene":a=new le,void 0!==e.background&&Number.isInteger(e.background)&&(a.background=new THREE.Color(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?a.fog=new ue(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(a.fog=new ce(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":a=new oe(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(a.focus=e.focus),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.filmGauge&&(a.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(a.filmOffset=e.filmOffset),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new ae(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":a=new $e(e.color,e.intensity);break;case"DirectionalLight":a=new je(e.color,e.intensity);break;case"PointLight":a=new ze(e.color,e.intensity,e.distance,e.decay);break;case"SpotLight":a=new Be(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":a=new Ne(e.color,e.groundColor,e.intensity);break;case"Mesh":var c=n(e.geometry),u=o(e.material);a=c.bones&&c.bones.length>0?new ye(c,u):new ie(c,u);break;case"LOD":a=new pe;break;case"Line":a=new xe(n(e.geometry),o(e.material),e.mode);break;case"LineSegments":a=new _e(n(e.geometry),o(e.material));break;case"PointCloud":case"Points":a=new Se(n(e.geometry),o(e.material));break;case"Sprite":a=new fe(o(e.material));break;case"Group":a=new Ae;break;default:a=new Ft}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.children)for(var l in e.children)a.add(s.parseObject(e.children[l],i,r));if("LOD"===e.type)for(var h=e.levels,d=0;d<h.length;d++){var f=h[d],l=a.getObjectByProperty("uuid",f.object);void 0!==l&&a.addLevel(l,f.distance)}return a}}()});var tf={area:function(t){for(var e=t.length,i=0,r=e-1,n=0;n<e;r=n++)i+=t[r].x*t[n].y-t[n].x*t[r].y;return.5*i},triangulate:function(){function t(t,e,i,r,n,o){var a,s,c,u,l,h,d,f,p;if(s=t[o[e]].x,c=t[o[e]].y,u=t[o[i]].x,l=t[o[i]].y,h=t[o[r]].x,d=t[o[r]].y,Number.EPSILON>(u-s)*(d-c)-(l-c)*(h-s))return!1;var m,g,v,y,b,x,_,w,S,A,M,P,C,T,E;for(m=h-u,g=d-l,v=s-h,y=c-d,b=u-s,x=l-c,a=0;a<n;a++)if(f=t[o[a]].x,p=t[o[a]].y,!(f===s&&p===c||f===u&&p===l||f===h&&p===d)&&(_=f-s,w=p-c,S=f-u,A=p-l,M=f-h,P=p-d,E=m*A-g*S,C=b*w-x*_,T=v*P-y*M,E>=-Number.EPSILON&&T>=-Number.EPSILON&&C>=-Number.EPSILON))return!1;return!0}return function(e,i){var r=e.length;if(r<3)return null;var n,o,a,s=[],c=[],u=[];if(tf.area(e)>0)for(o=0;o<r;o++)c[o]=o;else for(o=0;o<r;o++)c[o]=r-1-o;var l=r,h=2*l;for(o=l-1;l>2;){if(h--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i?u:s;if(n=o,l<=n&&(n=0),o=n+1,l<=o&&(o=0),a=o+1,l<=a&&(a=0),t(e,n,o,a,l,c)){var d,f,p,m,g;for(d=c[n],f=c[o],p=c[a],s.push([e[d],e[f],e[p]]),u.push([c[n],c[o],c[a]]),m=o,g=o+1;g<l;m++,g++)c[m]=c[g];l--,h=2*l}}return i?u:s}}(),triangulateShape:function(t,e){function i(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function r(t,e,i){return t.x!==e.x?t.x<e.x?t.x<=i.x&&i.x<=e.x:e.x<=i.x&&i.x<=t.x:t.y<e.y?t.y<=i.y&&i.y<=e.y:e.y<=i.y&&i.y<=t.y}function n(t,e,i,n,o){var a=e.x-t.x,s=e.y-t.y,c=n.x-i.x,u=n.y-i.y,l=t.x-i.x,h=t.y-i.y,d=s*c-a*u,f=s*l-a*h;if(Math.abs(d)>Number.EPSILON){var p;if(d>0){if(f<0||f>d)return[];if(p=u*l-c*h,p<0||p>d)return[]}else{if(f>0||f<d)return[];if(p=u*l-c*h,p>0||p<d)return[]}if(0===p)return!o||0!==f&&f!==d?[t]:[];if(p===d)return!o||0!==f&&f!==d?[e]:[];if(0===f)return[i];if(f===d)return[n];var m=p/d;return[{x:t.x+m*a,y:t.y+m*s}]}if(0!==f||u*l!==c*h)return[];var g=0===a&&0===s,v=0===c&&0===u;if(g&&v)return t.x!==i.x||t.y!==i.y?[]:[t];if(g)return r(i,n,t)?[t]:[];if(v)return r(t,e,i)?[i]:[];var y,b,x,_,w,S,A,M;return 0!==a?(t.x<e.x?(y=t,x=t.x,b=e,_=e.x):(y=e,x=e.x,b=t,_=t.x),i.x<n.x?(w=i,A=i.x,S=n,M=n.x):(w=n,A=n.x,S=i,M=i.x)):(t.y<e.y?(y=t,x=t.y,b=e,_=e.y):(y=e,x=e.y,b=t,_=t.y),i.y<n.y?(w=i,A=i.y,S=n,M=n.y):(w=n,A=n.y,S=i,M=i.y)),x<=A?_<A?[]:_===A?o?[]:[w]:_<=M?[w,b]:[w,S]:x>M?[]:x===M?o?[]:[y]:_<=M?[y,b]:[y,S]}function o(t,e,i,r){var n=e.x-t.x,o=e.y-t.y,a=i.x-t.x,s=i.y-t.y,c=r.x-t.x,u=r.y-t.y,l=n*s-o*a,h=n*u-o*c;if(Math.abs(l)>Number.EPSILON){var d=c*s-u*a;return l>0?h>=0&&d>=0:h>=0||d>=0}return h>0}function a(t,e){function i(t,e){var i=y.length-1,r=t-1;r<0&&(r=i);var n=t+1;n>i&&(n=0);var a=o(y[t],y[r],y[n],s[e]);if(!a)return!1;var c=s.length-1,u=e-1;u<0&&(u=c);var l=e+1;return l>c&&(l=0),a=o(s[e],s[u],s[l],y[t]),!!a}function r(t,e){var i,r,o;for(i=0;i<y.length;i++)if(r=i+1,r%=y.length,o=n(t,e,y[i],y[r],!0),o.length>0)return!0;return!1}function a(t,i){var r,o,a,s,c;for(r=0;r<b.length;r++)for(o=e[b[r]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,c=n(t,i,o[a],o[s],!0),c.length>0)return!0;return!1}for(var s,c,u,l,h,d,f,p,m,g,v,y=t.concat(),b=[],x=[],_=0,w=e.length;_<w;_++)b.push(_);for(var S=0,A=2*b.length;b.length>0;){if(A--,A<0){console.log("Infinite Loop! Holes left:"+b.length+", Probably Hole outside Shape!");break}for(u=S;u<y.length;u++){l=y[u],c=-1;for(var _=0;_<b.length;_++)if(d=b[_],f=l.x+":"+l.y+":"+d,void 0===x[f]){s=e[d];for(var M=0;M<s.length;M++)if(h=s[M],i(u,M)&&!r(l,h)&&!a(l,h)){c=M,b.splice(_,1),p=y.slice(0,u+1),m=y.slice(u),g=s.slice(c),v=s.slice(0,c+1),y=p.concat(g).concat(v).concat(m),S=u;break}if(c>=0)break;x[f]=!0}if(c>=0)break}}return y}i(t),e.forEach(i);for(var s,c,u,l,h,d,f={},p=t.concat(),m=0,g=e.length;m<g;m++)Array.prototype.push.apply(p,e[m]);for(s=0,c=p.length;s<c;s++)h=p[s].x+":"+p[s].y,void 0!==f[h]&&console.warn("THREE.ShapeUtils: Duplicate point",h,s),f[h]=s;var v=a(t,e),y=tf.triangulate(v,!1);for(s=0,c=y.length;s<c;s++)for(l=y[s],u=0;u<3;u++)h=l[u].x+":"+l[u].y,d=f[h],void 0!==d&&(l[u]=d);return y.concat()},isClockWise:function(t){return tf.area(t)<0},b2:function(){function t(t,e){var i=1-t;return i*i*e}function e(t,e){return 2*(1-t)*t*e}function i(t,e){return t*t*e}return function(r,n,o,a){return t(r,n)+e(r,o)+i(r,a)}}(),b3:function(){function t(t,e){var i=1-t;return i*i*i*e}function e(t,e){var i=1-t;return 3*i*i*t*e}function i(t,e){var i=1-t;return 3*i*t*t*e}function r(t,e){return t*t*t*e}return function(n,o,a,s,c){return t(n,o)+e(n,a)+i(n,s)+r(n,c)}}()};ci.prototype={constructor:ci,getPoint:function(t){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(t){var e=this.getUtoTmapping(t);return this.getPoint(e)},getPoints:function(t){var e=this;t||(t=5);for(var i=[],r=0;r<=t;r++)i.push(e.getPoint(r/t));return i},getSpacedPoints:function(t){
	var e=this;t||(t=5);for(var i=[],r=0;r<=t;r++)i.push(e.getPointAt(r/t));return i},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){var e=this;if(t||(t=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var i,r,n=[],o=this.getPoint(0),a=0;for(n.push(0),r=1;r<=t;r++)i=e.getPoint(r/t),a+=i.distanceTo(o),n.push(a),o=i;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var i,r=this.getLengths(),n=0,o=r.length;i=e?e:t*r[o-1];for(var a,s=0,c=o-1;s<=c;)if(n=Math.floor(s+(c-s)/2),a=r[n]-i,a<0)s=n+1;else{if(!(a>0)){c=n;break}c=n-1}if(n=c,r[n]===i){var u=n/(o-1);return u}var l=r[n],h=r[n+1],d=h-l,f=(i-l)/d,u=(n+f)/(o-1);return u},getTangent:function(t){var e=1e-4,i=t-e,r=t+e;i<0&&(i=0),r>1&&(r=1);var n=this.getPoint(i),o=this.getPoint(r),a=o.clone().sub(n);return a.normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)}},ci.create=function(t,e){return t.prototype=Object.create(ci.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},ui.prototype=Object.create(ci.prototype),ui.prototype.constructor=ui,ui.prototype.isLineCurve=!0,ui.prototype.getPoint=function(t){if(1===t)return this.v2.clone();var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},ui.prototype.getPointAt=function(t){return this.getPoint(t)},ui.prototype.getTangent=function(t){var e=this.v2.clone().sub(this.v1);return e.normalize()},li.prototype=Object.assign(Object.create(ci.prototype),{constructor:li,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new ui(e,t))},getPoint:function(t){for(var e=this,i=t*this.getLength(),r=this.getCurveLengths(),n=0;n<r.length;){if(r[n]>=i){var o=r[n]-i,a=e.curves[n],s=a.getLength(),c=0===s?0:1-o/s;return a.getPointAt(c)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getLengths()},getCurveLengths:function(){var t=this;if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],i=0,r=0,n=this.curves.length;r<n;r++)i+=t.curves[r].getLength(),e.push(i);return this.cacheLengths=e,e},getSpacedPoints:function(t){var e=this;t||(t=40);for(var i=[],r=0;r<=t;r++)i.push(e.getPoint(r/t));return this.autoClose&&i.push(i[0]),i},getPoints:function(t){t=t||12;for(var e,i=[],r=0,n=this.curves;r<n.length;r++)for(var o=n[r],a=o&&o.isEllipseCurve?2*t:o&&o.isLineCurve?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),c=0;c<s.length;c++){var u=s[c];e&&e.equals(u)||(i.push(u),e=u)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},createPointsGeometry:function(t){var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){for(var e=new zt,i=0,r=t.length;i<r;i++){var n=t[i];e.vertices.push(new g(n.x,n.y,n.z||0))}return e}}),hi.prototype=Object.create(ci.prototype),hi.prototype.constructor=hi,hi.prototype.isEllipseCurve=!0,hi.prototype.getPoint=function(t){for(var e=2*Math.PI,i=this.aEndAngle-this.aStartAngle,r=Math.abs(i)<Number.EPSILON;i<0;)i+=e;for(;i>e;)i-=e;i<Number.EPSILON&&(i=r?0:e),this.aClockwise!==!0||r||(i===e?i=-e:i-=e);var n=this.aStartAngle+t*i,o=this.aX+this.xRadius*Math.cos(n),a=this.aY+this.yRadius*Math.sin(n);if(0!==this.aRotation){var s=Math.cos(this.aRotation),c=Math.sin(this.aRotation),u=o-this.aX,l=a-this.aY;o=u*s-l*c+this.aX,a=u*c+l*s+this.aY}return new h(o,a)};var ef={tangentQuadraticBezier:function(t,e,i,r){return 2*(1-t)*(i-e)+2*t*(r-i)},tangentCubicBezier:function(t,e,i,r,n){return-3*e*(1-t)*(1-t)+3*i*(1-t)*(1-t)-6*t*i*(1-t)+6*t*r*(1-t)-3*t*t*r+3*t*t*n},tangentSpline:function(t,e,i,r,n){var o=6*t*t-6*t,a=3*t*t-4*t+1,s=-6*t*t+6*t,c=3*t*t-2*t;return o+a+s+c},interpolate:function(t,e,i,r,n){var o=.5*(i-t),a=.5*(r-e),s=n*n,c=n*s;return(2*e-2*i+o+a)*c+(-3*e+3*i-2*o-a)*s+o*n+e}};di.prototype=Object.create(ci.prototype),di.prototype.constructor=di,di.prototype.isSplineCurve=!0,di.prototype.getPoint=function(t){var e=this.points,i=(e.length-1)*t,r=Math.floor(i),n=i-r,o=e[0===r?r:r-1],a=e[r],s=e[r>e.length-2?e.length-1:r+1],c=e[r>e.length-3?e.length-1:r+2],u=ef.interpolate;return new h(u(o.x,a.x,s.x,c.x,n),u(o.y,a.y,s.y,c.y,n))},fi.prototype=Object.create(ci.prototype),fi.prototype.constructor=fi,fi.prototype.getPoint=function(t){var e=tf.b3;return new h(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y))},fi.prototype.getTangent=function(t){var e=ef.tangentCubicBezier;return new h(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()},pi.prototype=Object.create(ci.prototype),pi.prototype.constructor=pi,pi.prototype.getPoint=function(t){var e=tf.b2;return new h(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y))},pi.prototype.getTangent=function(t){var e=ef.tangentQuadraticBezier;return new h(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y)).normalize()};var rf=Object.assign(Object.create(li.prototype),{fromPoints:function(t){var e=this;this.moveTo(t[0].x,t[0].y);for(var i=1,r=t.length;i<r;i++)e.lineTo(t[i].x,t[i].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var i=new ui(this.currentPoint.clone(),new h(t,e));this.curves.push(i),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,i,r){var n=new pi(this.currentPoint.clone(),new h(t,e),new h(i,r));this.curves.push(n),this.currentPoint.set(i,r)},bezierCurveTo:function(t,e,i,r,n,o){var a=new fi(this.currentPoint.clone(),new h(t,e),new h(i,r),new h(n,o));this.curves.push(a),this.currentPoint.set(n,o)},splineThru:function(t){var e=[this.currentPoint.clone()].concat(t),i=new di(e);this.curves.push(i),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,i,r,n,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+a,e+s,i,r,n,o)},absarc:function(t,e,i,r,n,o){this.absellipse(t,e,i,i,r,n,o)},ellipse:function(t,e,i,r,n,o,a,s){var c=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(t+c,e+u,i,r,n,o,a,s)},absellipse:function(t,e,i,r,n,o,a,s){var c=new hi(t,e,i,r,n,o,a,s);if(this.curves.length>0){var u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);var l=c.getPoint(1);this.currentPoint.copy(l)}});mi.prototype=Object.create(zt.prototype),mi.prototype.constructor=mi,mi.NoTaper=function(t){return 1},mi.SinusoidalTaper=function(t){return Math.sin(Math.PI*t)},mi.FrenetFrames=function(t,e,i){function r(){f[0]=new g,m[0]=new g,o=Number.MAX_VALUE,a=Math.abs(d[0].x),s=Math.abs(d[0].y),c=Math.abs(d[0].z),a<=o&&(o=a,h.set(1,0,0)),s<=o&&(o=s,h.set(0,1,0)),c<=o&&h.set(0,0,1),v.crossVectors(d[0],h).normalize(),f[0].crossVectors(d[0],v),m[0].crossVectors(d[0],f[0])}var n,o,a,s,c,u,l,h=new g,d=[],f=[],m=[],v=new g,y=new p,b=e+1;for(this.tangents=d,this.normals=f,this.binormals=m,u=0;u<b;u++)l=u/(b-1),d[u]=t.getTangentAt(l),d[u].normalize();for(r(),u=1;u<b;u++)f[u]=f[u-1].clone(),m[u]=m[u-1].clone(),v.crossVectors(d[u-1],d[u]),v.length()>Number.EPSILON&&(v.normalize(),n=Math.acos(Fl.clamp(d[u-1].dot(d[u]),-1,1)),f[u].applyMatrix4(y.makeRotationAxis(v,n))),m[u].crossVectors(d[u],f[u]);if(i)for(n=Math.acos(Fl.clamp(f[0].dot(f[b-1]),-1,1)),n/=b-1,d[0].dot(v.crossVectors(f[0],f[b-1]))>0&&(n=-n),u=1;u<b;u++)f[u].applyMatrix4(y.makeRotationAxis(d[u],n*u)),m[u].crossVectors(d[u],f[u])},gi.prototype=Object.create(zt.prototype),gi.prototype.constructor=gi,gi.prototype.addShapeList=function(t,e){for(var i=this,r=t.length,n=0;n<r;n++){var o=t[n];i.addShape(o,e)}},gi.prototype.addShape=function(t,e){function i(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}function r(t,e,i){var r,n,o=1,a=t.x-e.x,s=t.y-e.y,c=i.x-t.x,u=i.y-t.y,l=a*a+s*s,d=a*u-s*c;if(Math.abs(d)>Number.EPSILON){var f=Math.sqrt(l),p=Math.sqrt(c*c+u*u),m=e.x-s/f,g=e.y+a/f,v=i.x-u/p,y=i.y+c/p,b=((v-m)*u-(y-g)*c)/(a*u-s*c);r=m+a*b-t.x,n=g+s*b-t.y;var x=r*r+n*n;if(x<=2)return new h(r,n);o=Math.sqrt(x/2)}else{var _=!1;a>Number.EPSILON?c>Number.EPSILON&&(_=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(_=!0):Math.sign(s)===Math.sign(u)&&(_=!0),_?(r=-s,n=a,o=Math.sqrt(l)):(r=a,n=s,o=Math.sqrt(l/2))}return new h(r/o,n/o)}function n(){if(_){var t=0,e=G*t;for(X=0;X<H;X++)V=k[X],c(V[2]+e,V[1]+e,V[0]+e);for(t=S+2*x,e=G*t,X=0;X<H;X++)V=k[X],c(V[0]+e,V[1]+e,V[2]+e)}else{for(X=0;X<H;X++)V=k[X],c(V[2],V[1],V[0]);for(X=0;X<H;X++)V=k[X],c(V[0]+G*S,V[1]+G*S,V[2]+G*S)}}function o(){var t=0;for(a(F,t),t+=F.length,T=0,E=D.length;T<E;T++)C=D[T],a(C,t),t+=C.length}function a(t,e){var i,r;for(X=t.length;--X>=0;){i=X,r=X-1,r<0&&(r=t.length-1);var n=0,o=S+2*x;for(n=0;n<o;n++){var a=G*n,s=G*(n+1),c=e+i+a,l=e+r+a,h=e+r+s,d=e+i+s;u(c,l,h,d,t,n,o,i,r)}}}function s(t,e,i){I.vertices.push(new g(t,e,i))}function c(t,e,i){t+=L,e+=L,i+=L,I.faces.push(new Dt(t,e,i,null,null,0));var r=P.generateTopUV(I,t,e,i);I.faceVertexUvs[0].push(r)}function u(t,e,i,r,n,o,a,s,c){t+=L,e+=L,i+=L,r+=L,I.faces.push(new Dt(t,e,r,null,null,1)),I.faces.push(new Dt(e,i,r,null,null,1));var u=P.generateSideWallUV(I,t,e,i,r);I.faceVertexUvs[0].push([u[0],u[1],u[3]]),I.faceVertexUvs[0].push([u[1],u[2],u[3]])}var l,d,f,p,m,v=void 0!==e.amount?e.amount:100,y=void 0!==e.bevelThickness?e.bevelThickness:6,b=void 0!==e.bevelSize?e.bevelSize:y-2,x=void 0!==e.bevelSegments?e.bevelSegments:3,_=void 0===e.bevelEnabled||e.bevelEnabled,w=void 0!==e.curveSegments?e.curveSegments:12,S=void 0!==e.steps?e.steps:1,A=e.extrudePath,M=!1,P=void 0!==e.UVGenerator?e.UVGenerator:gi.WorldUVGenerator;A&&(l=A.getSpacedPoints(S),M=!0,_=!1,d=void 0!==e.frames?e.frames:new mi.FrenetFrames(A,S,!1),f=new g,p=new g,m=new g),_||(x=0,y=0,b=0);var C,T,E,I=this,L=this.vertices.length,R=t.extractPoints(w),O=R.shape,D=R.holes,N=!tf.isClockWise(O);if(N){for(O=O.reverse(),T=0,E=D.length;T<E;T++)C=D[T],tf.isClockWise(C)&&(D[T]=C.reverse());N=!1}var k=tf.triangulateShape(O,D),F=O;for(T=0,E=D.length;T<E;T++)C=D[T],O=O.concat(C);for(var B,z,U,j,$,V,G=O.length,H=k.length,W=[],X=0,q=F.length,Y=q-1,Z=X+1;X<q;X++,Y++,Z++)Y===q&&(Y=0),Z===q&&(Z=0),W[X]=r(F[X],F[Y],F[Z]);var K,Q=[],J=W.concat();for(T=0,E=D.length;T<E;T++){for(C=D[T],K=[],X=0,q=C.length,Y=q-1,Z=X+1;X<q;X++,Y++,Z++)Y===q&&(Y=0),Z===q&&(Z=0),K[X]=r(C[X],C[Y],C[Z]);Q.push(K),J=J.concat(K)}for(B=0;B<x;B++){for(U=B/x,j=y*Math.cos(U*Math.PI/2),z=b*Math.sin(U*Math.PI/2),X=0,q=F.length;X<q;X++)$=i(F[X],W[X],z),s($.x,$.y,-j);for(T=0,E=D.length;T<E;T++)for(C=D[T],K=Q[T],X=0,q=C.length;X<q;X++)$=i(C[X],K[X],z),s($.x,$.y,-j)}for(z=b,X=0;X<G;X++)$=_?i(O[X],J[X],z):O[X],M?(p.copy(d.normals[0]).multiplyScalar($.x),f.copy(d.binormals[0]).multiplyScalar($.y),m.copy(l[0]).add(p).add(f),s(m.x,m.y,m.z)):s($.x,$.y,0);var tt;for(tt=1;tt<=S;tt++)for(X=0;X<G;X++)$=_?i(O[X],J[X],z):O[X],M?(p.copy(d.normals[tt]).multiplyScalar($.x),f.copy(d.binormals[tt]).multiplyScalar($.y),m.copy(l[tt]).add(p).add(f),s(m.x,m.y,m.z)):s($.x,$.y,v/S*tt);for(B=x-1;B>=0;B--){for(U=B/x,j=y*Math.cos(U*Math.PI/2),z=b*Math.sin(U*Math.PI/2),X=0,q=F.length;X<q;X++)$=i(F[X],W[X],z),s($.x,$.y,v+j);for(T=0,E=D.length;T<E;T++)for(C=D[T],K=Q[T],X=0,q=C.length;X<q;X++)$=i(C[X],K[X],z),M?s($.x,$.y+l[S-1].y,l[S-1].x+j):s($.x,$.y,v+j)}n(),o()},gi.WorldUVGenerator={generateTopUV:function(t,e,i,r){var n=t.vertices,o=n[e],a=n[i],s=n[r];return[new h(o.x,o.y),new h(a.x,a.y),new h(s.x,s.y)]},generateSideWallUV:function(t,e,i,r,n){var o=t.vertices,a=o[e],s=o[i],c=o[r],u=o[n];return Math.abs(a.y-s.y)<.01?[new h(a.x,1-a.z),new h(s.x,1-s.z),new h(c.x,1-c.z),new h(u.x,1-u.z)]:[new h(a.y,1-a.z),new h(s.y,1-s.z),new h(c.y,1-c.z),new h(u.y,1-u.z)]}},vi.prototype=Object.create(zt.prototype),vi.prototype.constructor=vi,vi.prototype.addShapeList=function(t,e){for(var i=this,r=0,n=t.length;r<n;r++)i.addShape(t[r],e);return this},vi.prototype.addShape=function(t,e){var i=this;void 0===e&&(e={});var r,n,o,a=void 0!==e.curveSegments?e.curveSegments:12,s=e.material,c=void 0===e.UVGenerator?gi.WorldUVGenerator:e.UVGenerator,u=this.vertices.length,l=t.extractPoints(a),h=l.shape,d=l.holes,f=!tf.isClockWise(h);if(f){for(h=h.reverse(),r=0,n=d.length;r<n;r++)o=d[r],tf.isClockWise(o)&&(d[r]=o.reverse());f=!1}var p=tf.triangulateShape(h,d);for(r=0,n=d.length;r<n;r++)o=d[r],h=h.concat(o);var m,v,y=h.length,b=p.length;for(r=0;r<y;r++)m=h[r],i.vertices.push(new g(m.x,m.y,0));for(r=0;r<b;r++){v=p[r];var x=v[0]+u,_=v[1]+u,w=v[2]+u;i.faces.push(new Dt(x,_,w,null,null,s)),i.faceVertexUvs[0].push(c.generateTopUV(i,x,_,w))}},yi.prototype=Object.assign(Object.create(rf),{constructor:yi,extrude:function(t){return new gi(this,t)},makeGeometry:function(t){return new vi(this,t)},getPointsHoles:function(t){for(var e=this,i=[],r=0,n=this.holes.length;r<n;r++)i[r]=e.holes[r].getPoints(t);return i},extractAllPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},extractPoints:function(t){return this.extractAllPoints(t)}}),bi.prototype=rf,rf.constructor=bi,xi.prototype={moveTo:function(t,e){this.currentPath=new bi,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,i,r){this.currentPath.quadraticCurveTo(t,e,i,r)},bezierCurveTo:function(t,e,i,r,n,o){this.currentPath.bezierCurveTo(t,e,i,r,n,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function i(t){for(var e=[],i=0,r=t.length;i<r;i++){var n=t[i],o=new yi;o.curves=n.curves,e.push(o)}return e}function r(t,e){for(var i=e.length,r=!1,n=i-1,o=0;o<i;n=o++){var a=e[n],s=e[o],c=s.x-a.x,u=s.y-a.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(a=e[o],c=-c,s=e[n],u=-u),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var l=u*(t.x-a.x)-c*(t.y-a.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return r}var n=tf.isClockWise,o=this.subPaths;if(0===o.length)return[];if(e===!0)return i(o);var a,s,c,u=[];if(1===o.length)return s=o[0],c=new yi,c.curves=s.curves,u.push(c),u;var l=!n(o[0].getPoints());l=t?!l:l;var h,d=[],f=[],p=[],m=0;f[m]=void 0,p[m]=[];for(var g=0,v=o.length;g<v;g++)s=o[g],h=s.getPoints(),a=n(h),a=t?!a:a,a?(!l&&f[m]&&m++,f[m]={s:new yi,p:h},f[m].s.curves=s.curves,l&&m++,p[m]=[]):p[m].push({h:s,p:h[0]});if(!f[0])return i(o);if(f.length>1){for(var y=!1,b=[],x=0,_=f.length;x<_;x++)d[x]=[];for(var x=0,_=f.length;x<_;x++)for(var w=p[x],S=0;S<w.length;S++){for(var A=w[S],M=!0,P=0;P<f.length;P++)r(A.p,f[P].p)&&(x!==P&&b.push({froms:x,tos:P,hole:S}),M?(M=!1,d[P].push(A)):y=!0);M&&d[x].push(A)}b.length>0&&(y||(p=d))}for(var C,g=0,T=f.length;g<T;g++){c=f[g].s,u.push(c),C=p[g];for(var E=0,I=C.length;E<I;E++)c.holes.push(C[E].h)}return u}},Object.assign(_i.prototype,{isFont:!0,generateShapes:function(t,e,i){function r(t){for(var i=String(t).split(""),r=e/o.resolution,a=0,s=[],c=0;c<i.length;c++){var u=n(i[c],r,a);a+=u.offset,s.push(u.path)}return s}function n(t,e,r){var n=o.glyphs[t]||o.glyphs["?"];if(n){var a,s,c,u,l,h,d,f,p,m,g,v=new xi,y=[],b=tf.b2,x=tf.b3;if(n.o)for(var _=n._cachedOutline||(n._cachedOutline=n.o.split(" ")),w=0,S=_.length;w<S;){var A=_[w++];switch(A){case"m":a=_[w++]*e+r,s=_[w++]*e,v.moveTo(a,s);break;case"l":a=_[w++]*e+r,s=_[w++]*e,v.lineTo(a,s);break;case"q":if(c=_[w++]*e+r,u=_[w++]*e,d=_[w++]*e+r,f=_[w++]*e,v.quadraticCurveTo(d,f,c,u),g=y[y.length-1]){l=g.x,h=g.y;for(var M=1;M<=i;M++){var P=M/i;b(P,l,d,c),b(P,h,f,u)}}break;case"b":if(c=_[w++]*e+r,u=_[w++]*e,d=_[w++]*e+r,f=_[w++]*e,p=_[w++]*e+r,m=_[w++]*e,v.bezierCurveTo(d,f,p,m,c,u),g=y[y.length-1]){l=g.x,h=g.y;for(var M=1;M<=i;M++){var P=M/i;x(P,l,d,p,c),x(P,h,f,m,u)}}}}return{offset:n.ha*e,path:v}}}void 0===e&&(e=100),void 0===i&&(i=4);for(var o=this.data,a=r(t),s=[],c=0,u=a.length;c<u;c++)Array.prototype.push.apply(s,a[c].toShapes());return s}}),Object.assign(wi.prototype,{load:function(t,e,i,r){var n=this,o=new Te(this.manager);o.load(t,function(t){var i;try{i=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(t.substring(65,t.length-2))}var r=n.parse(i);e&&e(r)},i,r)},parse:function(t){return new _i(t)}});var nf;Object.assign(Ai.prototype,{load:function(t,e,i,r){var n=new Te(this.manager);n.setResponseType("arraybuffer"),n.load(t,function(t){var i=Si();i.decodeAudioData(t,function(t){e(t)})},i,r)}}),Object.assign(Mi.prototype,{update:function(){var t,e,i,r,n,o=new p,a=new p;return function(s){var c=t!==s.focus||e!==s.fov||i!==s.aspect*this.aspect||r!==s.near||n!==s.far;if(c){t=s.focus,e=s.fov,i=s.aspect*this.aspect,r=s.near,n=s.far;var u,l,h=s.projectionMatrix.clone(),d=this.eyeSep/2,f=d*r/t,p=r*Math.tan(Fl.DEG2RAD*e*.5);a.elements[12]=-d,o.elements[12]=d,u=-p*i+f,l=p*i+f,h.elements[0]=2*r/(l-u),h.elements[8]=(l+u)/(l-u),this.cameraL.projectionMatrix.copy(h),u=-p*i-f,l=p*i-f,h.elements[0]=2*r/(l-u),h.elements[8]=(l+u)/(l-u),this.cameraR.projectionMatrix.copy(h)}this.cameraL.matrixWorld.copy(s.matrixWorld).multiply(a),this.cameraR.matrixWorld.copy(s.matrixWorld).multiply(o)}}()}),Pi.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Pi,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(t){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){this.gain.gain.value=t},updateMatrixWorld:function(){var t=new g,e=new m,i=new g,r=new g;return function(n){Ft.prototype.updateMatrixWorld.call(this,n);var o=this.context.listener,a=this.up;this.matrixWorld.decompose(t,e,i),r.set(0,0,-1).applyQuaternion(e),o.setPosition(t.x,t.y,t.z),o.setOrientation(r.x,r.y,r.z,a.x,a.y,a.z)}}()}),Ci.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Ci,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setBuffer:function(t){return this.source.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");var t=this.context.createBufferSource();return t.buffer=this.source.buffer,t.loop=this.source.loop,t.onended=this.source.onended,t.start(0,this.startTime),t.playbackRate.value=this.playbackRate,this.isPlaying=!0,this.source=t,this.connect()},pause:function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=this.context.currentTime,this.isPlaying=!1,this)},stop:function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=0,this.isPlaying=!1,this)},connect:function(){var t=this;if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,i=this.filters.length;e<i;e++)t.filters[e-1].connect(t.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){var t=this;if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,i=this.filters.length;e<i;e++)t.filters[e-1].disconnect(t.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),this.isPlaying===!0?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,this.isPlaying===!0&&(this.source.playbackRate.value=this.playbackRate),this)},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.source.loop},setLoop:function(t){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):void(this.source.loop=t)},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.value=t,this}}),Ti.prototype=Object.assign(Object.create(Ci.prototype),{constructor:Ti,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){this.panner.refDistance=t},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){this.panner.rolloffFactor=t},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){this.panner.distanceModel=t},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){this.panner.maxDistance=t},updateMatrixWorld:function(){var t=new g;return function(e){Ft.prototype.updateMatrixWorld.call(this,e),t.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(t.x,t.y,t.z)}}()}),Object.assign(Ei.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),i=0;i<e.length;i++)t+=e[i];return t/e.length}}),Ii.prototype={constructor:Ii,accumulate:function(t,e){var i=this.buffer,r=this.valueSize,n=t*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)i[n+a]=i[a];o=e}else{o+=e;var s=e/o;this._mixBufferRegion(i,n,0,s,r)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,i=this.buffer,r=t*e+e,n=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,n<1){var a=3*e;this._mixBufferRegion(i,r,a,1-n,e)}for(var s=e,c=e+e;s!==c;++s)if(i[s]!==i[s+e]){o.setValue(i,r);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,i=this.valueSize,r=3*i;t.getValue(e,r);for(var n=i,o=r;n!==o;++n)e[n]=e[r+n%i];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,i,r,n){if(r>=.5)for(var o=0;o!==n;++o)t[e+o]=t[i+o]},_slerp:function(t,e,i,r,n){m.slerpFlat(t,e,t,e,t,i,r)},_lerp:function(t,e,i,r,n){for(var o=1-r,a=0;a!==n;++a){var s=e+a;t[s]=t[s]*o+t[i+a]*r}}},Li.prototype={constructor:Li,getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,i=e.objectName,r=e.propertyName,n=e.propertyIndex;if(t||(t=Li.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("  trying to update node for track: "+this.path+" but it wasn't found.");if(i){var o=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("  can not bind to material as node does not have a material",this);if(!t.material.materials)return void console.error("  can not bind to material.materials as node.material does not have a materials array",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("  can not bind to bones as node does not have a skeleton",this);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[i])return void console.error("  can not bind to objectName of node, undefined",this);t=t[i]}if(void 0!==o){if(void 0===t[o])return void console.error("  trying to bind to objectIndex of objectName, but is undefined:",this,t);t=t[o]}}var s=t[r];if(void 0===s){var c=e.nodeName;return void console.error("  trying to update property for track: "+c+"."+r+" but it wasn't found.",t)}var u=this.Versioning.None;void 0!==t.needsUpdate?(u=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(u=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t);var l=this.BindingType.Direct;if(void 0!==n){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry",this);if(!t.geometry.morphTargets)return void console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);for(var a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===n){n=a;break}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=n}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):void 0!==s.length?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][u]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Object.assign(Li.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:Li.prototype.getValue,_setValue_unbound:Li.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)t[e++]=i[r]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.node[this.propertyName]=t[e]},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=t[e++]},function(t,e){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]]}),Li.Composite=function(t,e,i){var r=i||Li.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)},Li.Composite.prototype={constructor:Li.Composite,getValue:function(t,e){this.bind();var i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(t,e)},setValue:function(t,e){for(var i=this._bindings,r=this._targetGroup.nCachedObjects_,n=i.length;r!==n;++r)i[r].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},Li.create=function(t,e,i){return t&&t.isAnimationObjectGroup?new Li.Composite(t,e,i):new Li(t,e,i)},Li.parseTrackName=function(t){var e=/^((?:\w+\/)*)(\w+)?(?:\.(\w+)(?:\[(.+)\])?)?\.(\w+)(?:\[(.+)\])?$/,i=e.exec(t);if(!i)throw new Error("cannot parse trackName at all: "+t);var r={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]};if(null===r.propertyName||0===r.propertyName.length)throw new Error("can not parse propertyName from trackName: "+t);return r},Li.findNode=function(t,e){if(!e||""===e||"root"===e||"."===e||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){var i=function(t){for(var i=0;i<t.bones.length;i++){var r=t.bones[i];if(r.name===e)return r}return null},r=i(t.skeleton);if(r)return r}if(t.children){var n=function(t){for(var i=0;i<t.length;i++){var r=t[i];if(r.name===e||r.uuid===e)return r;var o=n(r.children);if(o)return o}return null},o=n(t.children);if(o)return o}return null},Ri.prototype={constructor:Ri,play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){var r=this._clip.duration,n=t._clip.duration,o=n/r,a=r/n;t.warp(1,o,e),this.warp(a,1,e)}return this},crossFadeTo:function(t,e,i){return t.crossFadeFrom(this,e,i)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,i){var r=this._mixer,n=r.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=n,s[1]=n+i,c[0]=t/a,c[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,i,r){var n=this._startTime;if(null!==n){var o=(t-n)*i;if(o<0||0===i)return;this._startTime=null,e=i*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var c=this._interpolants,u=this._propertyBindings,l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].accumulate(r,s)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var i=this._weightInterpolant;if(null!==i){var r=i.evaluate(t)[0];e*=r,t>i.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var i=this._timeScaleInterpolant;
	if(null!==i){var r=i.evaluate(t)[0];e*=r,t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var i=this._clip.duration,r=this.loop,n=this._loopCount;if(r===gl){n===-1&&(this.loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=i)e=i;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{var o=r===yl;if(n===-1&&(t>=0?(n=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=i||e<0){var a=Math.floor(e/i);e-=i*a,n+=Math.abs(a);var s=this.repetitions-n;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(0===s){var c=t<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1===(1&n))return this.time=e,i-e}return this.time=e,e},_setEndings:function(t,e,i){var r=this._interpolantSettings;i?(r.endingStart=Sl,r.endingEnd=Sl):(t?r.endingStart=this.zeroSlopeAtStart?Sl:wl:r.endingStart=Al,e?r.endingEnd=this.zeroSlopeAtEnd?Sl:wl:r.endingEnd=Al)},_scheduleFading:function(t,e,i){var r=this._mixer,n=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=n,s[0]=e,a[1]=n+t,s[1]=i,this}},Object.assign(Oi.prototype,l.prototype,{clipAction:function(t,e){var i=e||this._root,r=i.uuid,n="string"==typeof t?ii.findByName(i,t):t,o=null!==n?n.uuid:t,a=this._actionsByClip[o],s=null;if(void 0!==a){var c=a.actionByRoot[r];if(void 0!==c)return c;s=a.knownActions[0],null===n&&(n=s._clip)}if(null===n)return null;var u=new Ri(this,n,e);return this._bindAction(u,s),this._addInactiveAction(u,o,r),u},existingAction:function(t,e){var i=e||this._root,r=i.uuid,n="string"==typeof t?ii.findByName(i,t):t,o=n?n.uuid:t,a=this._actionsByClip[o];return void 0!==a?a.actionByRoot[r]||null:null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,i=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var n=0;n!==e;++n)t[n].reset();for(var n=0;n!==r;++n)i[n].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,i=this._nActiveActions,r=this.time+=t,n=Math.sign(t),o=this._accuIndex^=1,a=0;a!==i;++a){var s=e[a];s.enabled&&s._update(r,t,n,o)}for(var c=this._bindings,u=this._nActiveBindings,a=0;a!==u;++a)c[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this,i=this._actions,r=t.uuid,n=this._actionsByClip,o=n[r];if(void 0!==o){for(var a=o.knownActions,s=0,c=a.length;s!==c;++s){var u=a[s];e._deactivateAction(u);var l=u._cacheIndex,h=i[i.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,h._cacheIndex=l,i[l]=h,i.pop(),e._removeInactiveBindingsForAction(u)}delete n[r]}},uncacheRoot:function(t){var e=this,i=t.uuid,r=this._actionsByClip;for(var n in r){var o=r[n].actionByRoot,a=o[i];void 0!==a&&(e._deactivateAction(a),e._removeInactiveAction(a))}var s=this._bindingsByRootAndName,c=s[i];if(void 0!==c)for(var u in c){var l=c[u];l.restoreOriginalState(),e._removeInactiveBinding(l)}},uncacheAction:function(t,e){var i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),Object.assign(Oi.prototype,{_bindAction:function(t,e){var i=this,r=t._localRoot||this._root,n=t._clip.tracks,o=n.length,a=t._propertyBindings,s=t._interpolants,c=r.uuid,u=this._bindingsByRootAndName,l=u[c];void 0===l&&(l={},u[c]=l);for(var h=0;h!==o;++h){var d=n[h],f=d.name,p=l[f];if(void 0!==p)a[h]=p;else{if(p=a[h],void 0!==p){null===p._cacheIndex&&(++p.referenceCount,i._addInactiveBinding(p,c,f));continue}var m=e&&e._propertyBindings[h].binding.parsedPath;p=new Ii(Li.create(r,f,m),d.ValueTypeName,d.getValueSize()),++p.referenceCount,i._addInactiveBinding(p,c,f),a[h]=p}s[h].resultBuffer=p.buffer}},_activateAction:function(t){var e=this;if(!this._isActiveAction(t)){if(null===t._cacheIndex){var i=(t._localRoot||this._root).uuid,r=t._clip.uuid,n=this._actionsByClip[r];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,r,i)}for(var o=t._propertyBindings,a=0,s=o.length;a!==s;++a){var c=o[a];0===c.useCount++&&(e._lendBinding(c),c.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){var e=this;if(this._isActiveAction(t)){for(var i=t._propertyBindings,r=0,n=i.length;r!==n;++r){var o=i[r];0===--o.useCount&&(o.restoreOriginalState(),e._takeBackBinding(o))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,i){var r=this._actions,n=this._actionsByClip,o=n[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,n[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=r.length,r.push(t),o.actionByRoot[i]=t},_removeInactiveAction:function(t){var e=this._actions,i=e[e.length-1],r=t._cacheIndex;i._cacheIndex=r,e[r]=i,e.pop(),t._cacheIndex=null;var n=t._clip.uuid,o=this._actionsByClip,a=o[n],s=a.knownActions,c=s[s.length-1],u=t._byClipCacheIndex;c._byClipCacheIndex=u,s[u]=c,s.pop(),t._byClipCacheIndex=null;var l=a.actionByRoot,h=(e._localRoot||this._root).uuid;delete l[h],0===s.length&&delete o[n],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=this,i=t._propertyBindings,r=0,n=i.length;r!==n;++r){var o=i[r];0===--o.referenceCount&&e._removeInactiveBinding(o)}},_lendAction:function(t){var e=this._actions,i=t._cacheIndex,r=this._nActiveActions++,n=e[r];t._cacheIndex=r,e[r]=t,n._cacheIndex=i,e[i]=n},_takeBackAction:function(t){var e=this._actions,i=t._cacheIndex,r=--this._nActiveActions,n=e[r];t._cacheIndex=r,e[r]=t,n._cacheIndex=i,e[i]=n},_addInactiveBinding:function(t,e,i){var r=this._bindingsByRootAndName,n=r[e],o=this._bindings;void 0===n&&(n={},r[e]=n),n[i]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,i=t.binding,r=i.rootNode.uuid,n=i.path,o=this._bindingsByRootAndName,a=o[r],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete a[n];t:{for(var u in a)break t;delete o[r]}},_lendBinding:function(t){var e=this._bindings,i=t._cacheIndex,r=this._nActiveBindings++,n=e[r];t._cacheIndex=r,e[r]=t,n._cacheIndex=i,e[i]=n},_takeBackBinding:function(t){var e=this._bindings,i=t._cacheIndex,r=--this._nActiveBindings,n=e[r];t._cacheIndex=r,e[r]=t,n._cacheIndex=i,e[i]=n},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,i=t[e];return void 0===i&&(i=new He(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=e,t[e]=i),i},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,i=t.__cacheIndex,r=--this._nActiveControlInterpolants,n=e[r];t.__cacheIndex=r,e[r]=t,n.__cacheIndex=i,e[i]=n},_controlInterpolantsResultBuffer:new Float32Array(1)}),Di.prototype={constructor:Di,onUpdate:function(t){return this.dynamic=!0,this.onUpdateCallback=t,this}},Ni.prototype=Object.create(_e.prototype),Ni.prototype.constructor=Ni,Ni.prototype.update=function(){var t=new g,e=new g,i=new dt;return function(){var r=this,n=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var o=this.object.matrixWorld,a=this.geometry.attributes.position,s=this.object.geometry;if(s&&s.isGeometry)for(var c=s.vertices,u=s.faces,l=0,h=0,d=u.length;h<d;h++)for(var f=u[h],p=0,m=f.vertexNormals.length;p<m;p++){var g=c[f[n[p]]],v=f.vertexNormals[p];t.copy(g).applyMatrix4(o),e.copy(v).applyMatrix3(i).normalize().multiplyScalar(r.size).add(t),a.setXYZ(l,t.x,t.y,t.z),l+=1,a.setXYZ(l,e.x,e.y,e.z),l+=1}else if(s&&s.isBufferGeometry)for(var y=s.attributes.position,b=s.attributes.normal,l=0,p=0,m=y.count;p<m;p++)t.set(y.getX(p),y.getY(p),y.getZ(p)).applyMatrix4(o),e.set(b.getX(p),b.getY(p),b.getZ(p)),e.applyMatrix3(i).normalize().multiplyScalar(r.size).add(t),a.setXYZ(l,t.x,t.y,t.z),l+=1,a.setXYZ(l,e.x,e.y,e.z),l+=1;return a.needsUpdate=!0,this}}(),ki.prototype=Object.create(_e.prototype),ki.prototype.constructor=ki,ki.prototype.update=function(){var t=new g,e=new g,i=new dt;return function(){var r=this;this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry,s=a.vertices,c=a.faces,u=0,l=0,h=c.length;l<h;l++){var d=c[l],f=d.normal;t.copy(s[d.a]).add(s[d.b]).add(s[d.c]).divideScalar(3).applyMatrix4(n),e.copy(f).applyMatrix3(i).normalize().multiplyScalar(r.size).add(t),o.setXYZ(u,t.x,t.y,t.z),u+=1,o.setXYZ(u,e.x,e.y,e.z),u+=1}return o.needsUpdate=!0,this}}(),Fi.prototype=Object.create(_e.prototype),Fi.prototype.constructor=Fi,Fi.prototype.update=function(){function t(t,o,a,s){r.set(o,a,s).unproject(n);var c=i[t];if(void 0!==c)for(var u=0,l=c.length;u<l;u++)e.vertices[c[u]].copy(r)}var e,i,r=new g,n=new ne;return function(){e=this.geometry,i=this.pointMap;var r=1,o=1;n.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-r,-o,-1),t("n2",r,-o,-1),t("n3",-r,o,-1),t("n4",r,o,-1),t("f1",-r,-o,1),t("f2",r,-o,1),t("f3",-r,o,1),t("f4",r,o,1),t("u1",.7*r,1.1*o,-1),t("u2",.7*-r,1.1*o,-1),t("u3",0,2*o,-1),t("cf1",-r,0,1),t("cf2",r,0,1),t("cf3",0,-o,1),t("cf4",0,o,1),t("cn1",-r,0,-1),t("cn2",r,0,-1),t("cn3",0,-o,-1),t("cn4",0,o,-1),e.verticesNeedUpdate=!0}}(),Bi.prototype=Object.create($t.prototype),Bi.prototype.constructor=Bi;var of=new $t;of.addAttribute("position",new Ot([0,0,0,0,1,0],3));var af=new Bi(0,.5,1,5,1);af.translate(0,-.5,0),zi.prototype=Object.create(zt.prototype),zi.prototype.constructor=zi,Ui.prototype=Object.create(zi.prototype),Ui.prototype.constructor=Ui,ji.prototype=Object.create(zt.prototype),ji.prototype.constructor=ji,$i.prototype=Object.create($t.prototype),$i.prototype.constructor=$i;var sf=(function(){function t(){}var e=new g,i=new t,r=new t,n=new t;return t.prototype.init=function(t,e,i,r){this.c0=t,this.c1=i,this.c2=-3*t+3*e-2*i-r,this.c3=2*t-2*e+i+r},t.prototype.initNonuniformCatmullRom=function(t,e,i,r,n,o,a){var s=(e-t)/n-(i-t)/(n+o)+(i-e)/o,c=(i-e)/o-(r-e)/(o+a)+(r-i)/a;s*=o,c*=o,this.init(e,i,s,c)},t.prototype.initCatmullRom=function(t,e,i,r,n){this.init(e,i,n*(i-t),n*(r-e))},t.prototype.calc=function(t){var e=t*t,i=e*t;return this.c0+this.c1*t+this.c2*e+this.c3*i},ci.create(function(t){this.points=t||[],this.closed=!1},function(t){var o,a,s,c,u=this.points;c=u.length,c<2&&console.log("duh, you need at least 2 points"),o=(c-(this.closed?0:1))*t,a=Math.floor(o),s=o-a,this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/u.length)+1)*u.length:0===s&&a===c-1&&(a=c-2,s=1);var l,h,d,f;if(this.closed||a>0?l=u[(a-1)%c]:(e.subVectors(u[0],u[1]).add(u[0]),l=e),h=u[a%c],d=u[(a+1)%c],this.closed||a+2<c?f=u[(a+2)%c]:(e.subVectors(u[c-1],u[c-2]).add(u[c-1]),f=e),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var p="chordal"===this.type?.5:.25,m=Math.pow(l.distanceToSquared(h),p),v=Math.pow(h.distanceToSquared(d),p),y=Math.pow(d.distanceToSquared(f),p);v<1e-4&&(v=1),m<1e-4&&(m=v),y<1e-4&&(y=v),i.initNonuniformCatmullRom(l.x,h.x,d.x,f.x,m,v,y),r.initNonuniformCatmullRom(l.y,h.y,d.y,f.y,m,v,y),n.initNonuniformCatmullRom(l.z,h.z,d.z,f.z,m,v,y)}else if("catmullrom"===this.type){var b=void 0!==this.tension?this.tension:.5;i.initCatmullRom(l.x,h.x,d.x,f.x,b),r.initCatmullRom(l.y,h.y,d.y,f.y,b),n.initCatmullRom(l.z,h.z,d.z,f.z,b)}var x=new g(i.calc(s),r.calc(s),n.calc(s));return x})}(),ci.create(function(t){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=void 0===t?[]:t},function(t){var e=this.points,i=(e.length-1)*t,r=Math.floor(i),n=i-r,o=e[0==r?r:r-1],a=e[r],s=e[r>e.length-2?e.length-1:r+1],c=e[r>e.length-3?e.length-1:r+2],u=ef.interpolate;return new g(u(o.x,a.x,s.x,c.x,n),u(o.y,a.y,s.y,c.y,n),u(o.z,a.z,s.z,c.z,n))}),ci.create(function(t,e,i,r){this.v0=t,this.v1=e,this.v2=i,this.v3=r},function(t){var e=tf.b3;return new g(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),ci.create(function(t,e,i){this.v0=t,this.v1=e,this.v2=i},function(t){var e=tf.b2;return new g(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y),e(t,this.v0.z,this.v1.z,this.v2.z))}),ci.create(function(t,e){this.v1=t,this.v2=e},function(t){if(1===t)return this.v2.clone();var e=new g;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e}),function(t){this.name=t,this._dict={}}),cf={names:{}};sf.prototype.add=function(t,e){this._dict[lr(t)]=e},sf.prototype.get=function(t){return this._dict[lr(t)]},cf.names.get=function(){return Object.keys(this._dict)},Object.defineProperties(sf.prototype,cf);var uf=function(){this.activeWorkerCount=0,this._funcDict={},this._depsDict={},this._blobDict={}};uf.prototype.add=function(t,e,i){this._funcDict[t]=e,this._depsDict[t]=i},uf.prototype.get=function(t){return this._blobDict[t]||(this._blobDict[t]=pr(this._funcDict[t],this._depsDict[t])),this._blobDict[t]};var lf,hf,df,ff,pf,mf,gf,vf,yf,bf,xf,_f,wf,Sf,Af,Mf,Pf,Cf,Tf,Ef,If,Lf,Rf,Of,Df,Nf,kf,Ff,Bf,zf,Uf,jf,$f,Vf,Gf,Hf,Wf,Xf,qf,Yf,Zf,Kf,Qf,Jf,tp,ep,ip,rp,np,op,ap,sp,cp,up,lp,hp,dp,fp,pp,mp,gp,vp,yp,bp,xp,_p,wp,Sp,Ap,Mp,Pp,Cp,Tp,Ep,Ip,Lp,Rp,Op,Dp="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Np=new Array(36),kp=[].slice;Ep=function(){var t,e,i,r,n;for(t={},n="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),r=0,e=n.length;r<e;r++)i=n[r],t["[object "+i+"]"]=i.toLowerCase();return function(e){var i;return i=Object.prototype.toString.call(e),t[i]||"object"}}(),tp=function(t,e,i){return null==e&&(e=0),null==i&&(i=1),t<e&&(t=e),t>i&&(t=i),t},Ip=function(t){return t.length>=3?[].slice.call(t):t[0]},Ef=function(t){var e;for(e in t)e<3?(t[e]<0&&(t[e]=0),t[e]>255&&(t[e]=255)):3===e&&(t[e]<0&&(t[e]=0),t[e]>1&&(t[e]=1));return t},ff=Math.PI,Ap=Math.round,Rf=Math.cos,Ff=Math.floor,up=Math.pow,ep=Math.log,Pp=Math.sin,Cp=Math.sqrt,wf=Math.atan2,np=Math.max,_f=Math.abs,gf=2*ff,pf=ff/3,hf=ff/180,mf=180/ff,Tf=function(){return arguments[0]instanceof lf?arguments[0]:function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,arguments,function(){})},xf=[],Tf.version="1.1.1",bf={},vf=[],yf=!1,lf=function(){function t(){var t,e,i,r,n,o,a,s,c,u=arguments;for(o=this,e=[],s=0,r=arguments.length;s<r;s++)t=u[s],null!=t&&e.push(t);if(a=e[e.length-1],null!=bf[a])o._rgb=Ef(bf[a](Ip(e.slice(0,-1))));else{for(yf||(vf=vf.sort(function(t,e){return e.p-t.p}),yf=!0),c=0,n=vf.length;c<n&&(i=vf[c],!(a=i.test.apply(i,e)));c++);a&&(o._rgb=Ef(bf[a].apply(bf,e)))}null==o._rgb&&console.warn("unknown format: "+e),null==o._rgb&&(o._rgb=[0,0,0]),3===o._rgb.length&&o._rgb.push(1)}return t.prototype.alpha=function(t){return arguments.length?(this._rgb[3]=t,this):this._rgb[3]},t.prototype.toString=function(){return this.name()},t}(),Tf._input=bf,Tf.brewer=Pf={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Lp={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6",rebeccapurple:"#663399"},Tf.colors=Lf=Lp,Yf=function(){var t,e,i,r,n,o,a,s,c;return e=Ip(arguments),n=e[0],t=e[1],i=e[2],s=(n+16)/116,a=isNaN(t)?s:s+t/500,c=isNaN(i)?s:s-i/200,s=df.Yn*Zf(s),a=df.Xn*Zf(a),c=df.Zn*Zf(c),o=Op(3.2404542*a-1.5371385*s-.4985314*c),r=Op(-.969266*a+1.8760108*s+.041556*c),i=Op(.0556434*a-.2040259*s+1.0572252*c),o=tp(o,0,255),r=tp(r,0,255),i=tp(i,0,255),[o,r,i,e.length>3?e[3]:1]},Op=function(t){return Ap(255*(t<=.00304?12.92*t:1.055*up(t,1/2.4)-.055))},Zf=function(t){return t>df.t1?t*t*t:df.t2*(t-df.t0)},df={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},gp=function(){var t,e,i,r,n,o,a,s;return r=Ip(arguments),i=r[0],e=r[1],t=r[2],n=_p(i,e,t),o=n[0],a=n[1],s=n[2],[116*a-16,500*(o-a),200*(a-s)]},wp=function(t){return(t/=255)<=.04045?t/12.92:up((t+.055)/1.055,2.4)},Rp=function(t){return t>df.t3?up(t,1/3):t/df.t2+df.t0},_p=function(){var t,e,i,r,n,o,a;return r=Ip(arguments),i=r[0],e=r[1],t=r[2],i=wp(i),e=wp(e),t=wp(t),n=Rp((.4124564*i+.3575761*e+.1804375*t)/df.Xn),o=Rp((.2126729*i+.7151522*e+.072175*t)/df.Yn),a=Rp((.0193339*i+.119192*e+.9503041*t)/df.Zn),[n,o,a]},Tf.lab=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["lab"]),function(){})},bf.lab=Yf,lf.prototype.lab=function(){return gp(this._rgb)},Sf=function(t){var e,i,r,n,o,a,s,c,u,l,h;return t=function(){var e,i,r;for(r=[],i=0,e=t.length;i<e;i++)n=t[i],r.push(Tf(n));return r}(),2===t.length?(u=function(){var e,i,r;for(r=[],i=0,e=t.length;i<e;i++)n=t[i],r.push(n.lab());return r}(),o=u[0],a=u[1],e=function(t){var e,i;return i=function(){var i,r;for(r=[],e=i=0;i<=2;e=++i)r.push(o[e]+t*(a[e]-o[e]));return r}(),Tf.lab.apply(Tf,i)}):3===t.length?(l=function(){var e,i,r;for(r=[],i=0,e=t.length;i<e;i++)n=t[i],r.push(n.lab());return r}(),o=l[0],a=l[1],s=l[2],e=function(t){var e,i;return i=function(){var i,r;for(r=[],e=i=0;i<=2;e=++i)r.push((1-t)*(1-t)*o[e]+2*(1-t)*t*a[e]+t*t*s[e]);return r}(),Tf.lab.apply(Tf,i)}):4===t.length?(h=function(){var e,i,r;for(r=[],i=0,e=t.length;i<e;i++)n=t[i],r.push(n.lab());return r}(),o=h[0],a=h[1],s=h[2],c=h[3],e=function(t){var e,i;return i=function(){var i,r;for(r=[],e=i=0;i<=2;e=++i)r.push((1-t)*(1-t)*(1-t)*o[e]+3*(1-t)*(1-t)*t*a[e]+3*(1-t)*t*t*s[e]+t*t*t*c[e]);return r}(),Tf.lab.apply(Tf,i)}):5===t.length&&(i=Sf(t.slice(0,3)),r=Sf(t.slice(2,5)),e=function(t){return t<.5?i(2*t):r(2*(t-.5))}),e},Tf.bezier=function(t){var e;return e=Sf(t),e.scale=function(){return Tf.scale(e)},e},Tf.cubehelix=function(t,e,i,r,n){var o,a,s;return null==t&&(t=300),null==e&&(e=-1.5),null==i&&(i=1),null==r&&(r=1),null==n&&(n=[0,1]),a=n[1]-n[0],o=0,s=function(s){var c,u,l,h,d,f,p,m,g;return c=gf*((t+120)/360+e*s),p=up(n[0]+a*s,r),f=0!==o?i[0]+s*o:i,u=f*p*(1-p)/2,h=Rf(c),g=Pp(c),m=p+u*(-.14861*h+1.78277*g),d=p+u*(-.29227*h-.90649*g),l=p+u*(1.97294*h),Tf(Ef([255*m,255*d,255*l]))},s.start=function(e){return null==e?t:(t=e,s)},s.rotations=function(t){return null==t?e:(e=t,s)},s.gamma=function(t){return null==t?r:(r=t,s)},s.hue=function(t){return null==t?i:(i=t,"array"===Ep(i)?(o=i[1]-i[0],0===o&&(i=i[1])):o=0,s)},s.lightness=function(t){return null==t?n:(n=t,"array"===Ep(n)?(a=n[1]-n[0],0===a&&(n=n[1])):a=0,s)},s.scale=function(){return Tf.scale(s)},s.hue(i),s},Tf.random=function(){var t,e,i,r;for(e="0123456789abcdef",t="#",i=r=0;r<6;i=++r)t+=e.charAt(Ff(16*Math.random()));return new lf(t)},bf.rgb=function(){var t,e,i,r;e=Ip(arguments),i=[];for(t in e)r=e[t],i.push(r);return i},Tf.rgb=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["rgb"]),function(){})},lf.prototype.rgb=function(){return this._rgb.slice(0,3)},lf.prototype.rgba=function(){return this._rgb},vf.push({p:15,test:function(t){var e;return e=Ip(arguments),"array"===Ep(e)&&3===e.length?"rgb":4===e.length&&"number"===Ep(e[3])&&e[3]>=0&&e[3]<=1?"rgb":void 0}}),Bf=function(t){var e,i,r,n,o,a;if(t.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==t.length&&7!==t.length||(t=t.substr(1)),3===t.length&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),a=parseInt(t,16),n=a>>16,r=a>>8&255,i=255&a,[n,r,i,1];if(t.match(/^#?([A-Fa-f0-9]{8})$/))return 9===t.length&&(t=t.substr(1)),a=parseInt(t,16),n=a>>24&255,r=a>>16&255,i=a>>8&255,e=Ap((255&a)/255*100)/100,[n,r,i,e];if(null!=bf.css&&(o=bf.css(t)))return o;throw"unknown color: "+t},dp=function(t,e){var i,r,n,o,a,s,c;return null==e&&(e="rgb"),a=t[0],n=t[1],r=t[2],i=t[3],c=a<<16|n<<8|r,s="000000"+c.toString(16),s=s.substr(s.length-6),o="0"+Ap(255*i).toString(16),o=o.substr(o.length-2),"#"+function(){switch(e.toLowerCase()){case"rgba":return s+o;case"argb":return o+s;default:return s}}()},bf.hex=function(t){return Bf(t)},Tf.hex=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["hex"]),function(){})},lf.prototype.hex=function(t){return null==t&&(t="rgb"),dp(this._rgb,t)},vf.push({p:10,test:function(t){if(1===arguments.length&&"string"===Ep(t))return"hex"}}),jf=function(){var t,e,i,r,n,o,a,s,c,u,l,h,d,f;if(t=Ip(arguments),n=t[0],l=t[1],a=t[2],0===l)c=r=e=255*a;else{for(f=[0,0,0],i=[0,0,0],d=a<.5?a*(1+l):a+l-a*l,h=2*a-d,n/=360,f[0]=n+1/3,f[1]=n,f[2]=n-1/3,o=s=0;s<=2;o=++s)f[o]<0&&(f[o]+=1),f[o]>1&&(f[o]-=1),6*f[o]<1?i[o]=h+6*(d-h)*f[o]:2*f[o]<1?i[o]=d:3*f[o]<2?i[o]=h+(d-h)*(2/3-f[o])*6:i[o]=h;u=[Ap(255*i[0]),Ap(255*i[1]),Ap(255*i[2])],c=u[0],r=u[1],e=u[2]}return t.length>3?[c,r,e,t[3]]:[c,r,e]},pp=function(t,e,i){var r,n,o,a,s;return void 0!==t&&t.length>=3&&(a=t,t=a[0],e=a[1],i=a[2]),t/=255,e/=255,i/=255,o=Math.min(t,e,i),np=Math.max(t,e,i),n=(np+o)/2,np===o?(s=0,r=Number.NaN):s=n<.5?(np-o)/(np+o):(np-o)/(2-np-o),t===np?r=(e-i)/(np-o):e===np?r=2+(i-t)/(np-o):i===np&&(r=4+(t-e)/(np-o)),r*=60,r<0&&(r+=360),[r,s,n]},Tf.hsl=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["hsl"]),function(){})},bf.hsl=jf,lf.prototype.hsl=function(){return pp(this._rgb)},$f=function(){var t,e,i,r,n,o,a,s,c,u,l,h,d,f,p,m,g,v;if(t=Ip(arguments),n=t[0],m=t[1],v=t[2],v*=255,0===m)c=r=e=v;else switch(360===n&&(n=0),n>360&&(n-=360),n<0&&(n+=360),n/=60,o=Ff(n),i=n-o,a=v*(1-m),s=v*(1-m*i),g=v*(1-m*(1-i)),o){case 0:u=[v,g,a],c=u[0],r=u[1],e=u[2];break;case 1:l=[s,v,a],c=l[0],r=l[1],e=l[2];break;case 2:h=[a,v,g],c=h[0],r=h[1],e=h[2];break;case 3:d=[a,s,v],c=d[0],r=d[1],e=d[2];break;case 4:f=[g,a,v],c=f[0],r=f[1],e=f[2];break;case 5:p=[v,a,s],c=p[0],r=p[1],e=p[2]}return c=Ap(c),r=Ap(r),e=Ap(e),[c,r,e,t.length>3?t[3]:1]},mp=function(){var t,e,i,r,n,o,a,s,c;return a=Ip(arguments),o=a[0],i=a[1],t=a[2],n=Math.min(o,i,t),np=Math.max(o,i,t),e=np-n,c=np/255,0===np?(r=Number.NaN,s=0):(s=e/np,o===np&&(r=(i-t)/e),i===np&&(r=2+(t-o)/e),t===np&&(r=4+(o-i)/e),r*=60,r<0&&(r+=360)),[r,s,c]},Tf.hsv=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["hsv"]),function(){})},bf.hsv=$f,lf.prototype.hsv=function(){return mp(this._rgb)},sp=function(t){var e,i,r;return"number"===Ep(t)&&t>=0&&t<=16777215?(r=t>>16,i=t>>8&255,e=255&t,[r,i,e,1]):(console.warn("unknown num color: "+t),[0,0,0,1])},bp=function(){var t,e,i,r;return r=Ip(arguments),i=r[0],e=r[1],t=r[2],(i<<16)+(e<<8)+t},Tf.num=function(t){return new lf(t,"num")},lf.prototype.num=function(t){return null==t&&(t="rgb"),bp(this._rgb,t)},bf.num=sp,vf.push({p:10,test:function(t){if(1===arguments.length&&"number"===Ep(t)&&t>=0&&t<=16777215)return"num"}}),Of=function(t){var e,i,r,n,o,a,s,c;if(t=t.toLowerCase(),null!=Tf.colors&&Tf.colors[t])return Bf(Tf.colors[t]);if(o=t.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(s=o.slice(1,4),n=a=0;a<=2;n=++a)s[n]=+s[n];s[3]=1}else if(o=t.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(s=o.slice(1,5),n=c=0;c<=3;n=++c)s[n]=+s[n];else if(o=t.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(s=o.slice(1,4),n=e=0;e<=2;n=++e)s[n]=Ap(2.55*s[n]);s[3]=1}else if(o=t.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(s=o.slice(1,5),n=i=0;i<=2;n=++i)s[n]=Ap(2.55*s[n]);s[3]=+s[3]}else(o=t.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(r=o.slice(1,4),r[1]*=.01,r[2]*=.01,s=jf(r),s[3]=1):(o=t.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(r=o.slice(1,4),r[1]*=.01,r[2]*=.01,s=jf(r),s[3]=+o[4]);return s},hp=function(t){var e;return e=t[3]<1?"rgba":"rgb","rgb"===e?e+"("+t.slice(0,3).map(Ap).join(",")+")":"rgba"===e?e+"("+t.slice(0,3).map(Ap).join(",")+","+t[3]+")":void 0},Sp=function(t){return Ap(100*t)/100},Uf=function(t,e){var i;return i=e<1?"hsla":"hsl",t[0]=Sp(t[0]||0),t[1]=Sp(100*t[1])+"%",t[2]=Sp(100*t[2])+"%","hsla"===i&&(t[3]=e),i+"("+t.join(",")+")"},bf.css=function(t){return Of(t)},Tf.css=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["css"]),function(){})},lf.prototype.css=function(t){return null==t&&(t="rgb"),"rgb"===t.slice(0,3)?hp(this._rgb):"hsl"===t.slice(0,3)?Uf(this.hsl(),this.alpha()):void 0},bf.named=function(t){return Bf(Lp[t])},vf.push({p:20,test:function(t){if(1===arguments.length&&null!=Lp[t])return"named"}}),lf.prototype.name=function(t){var e,i;arguments.length&&(Lp[t]&&(this._rgb=Bf(Lp[t])),
	this._rgb[3]=1),e=this.hex();for(i in Lp)if(e===Lp[i])return i;return e},Kf=function(){var t,e,i,r;return r=Ip(arguments),i=r[0],t=r[1],e=r[2],e*=hf,[i,Rf(e)*t,Pp(e)*t]},Qf=function(){var t,e,i,r,n,o,a,s,c,u,l;return i=Ip(arguments),s=i[0],n=i[1],a=i[2],u=Kf(s,n,a),t=u[0],e=u[1],r=u[2],l=Yf(t,e,r),c=l[0],o=l[1],r=l[2],[tp(c,0,255),tp(o,0,255),tp(r,0,255),i.length>3?i[3]:1]},qf=function(){var t,e,i,r,n,o;return o=Ip(arguments),n=o[0],t=o[1],e=o[2],i=Cp(t*t+e*e),r=(wf(e,t)*mf+360)%360,0===Ap(1e4*i)&&(r=Number.NaN),[n,i,r]},vp=function(){var t,e,i,r,n,o,a;return o=Ip(arguments),n=o[0],i=o[1],e=o[2],a=gp(n,i,e),r=a[0],t=a[1],e=a[2],qf(r,t,e)},Tf.lch=function(){var t;return t=Ip(arguments),new lf(t,"lch")},Tf.hcl=function(){var t;return t=Ip(arguments),new lf(t,"hcl")},bf.lch=Qf,bf.hcl=function(){var t,e,i,r;return r=Ip(arguments),e=r[0],t=r[1],i=r[2],Qf([i,t,e])},lf.prototype.lch=function(){return vp(this._rgb)},lf.prototype.hcl=function(){return vp(this._rgb).reverse()},lp=function(t){var e,i,r,n,o,a,s,c,u;return null==t&&(t="rgb"),c=Ip(arguments),s=c[0],n=c[1],e=c[2],s/=255,n/=255,e/=255,o=1-Math.max(s,Math.max(n,e)),r=o<1?1/(1-o):0,i=(1-s-o)*r,a=(1-n-o)*r,u=(1-e-o)*r,[i,a,u,o]},If=function(){var t,e,i,r,n,o,a,s,c;return e=Ip(arguments),r=e[0],a=e[1],c=e[2],o=e[3],t=e.length>4?e[4]:1,1===o?[0,0,0,t]:(s=r>=1?0:Ap(255*(1-r)*(1-o)),n=a>=1?0:Ap(255*(1-a)*(1-o)),i=c>=1?0:Ap(255*(1-c)*(1-o)),[s,n,i,t])},bf.cmyk=function(){return If(Ip(arguments))},Tf.cmyk=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["cmyk"]),function(){})},lf.prototype.cmyk=function(){return lp(this._rgb)},bf.gl=function(){var t,e,i,r,n;for(r=function(){var t,i;t=Ip(arguments),i=[];for(e in t)n=t[e],i.push(n);return i}.apply(this,arguments),t=i=0;i<=2;t=++i)r[t]*=255;return r},Tf.gl=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["gl"]),function(){})},lf.prototype.gl=function(){var t;return t=this._rgb,[t[0]/255,t[1]/255,t[2]/255,t[3]]},yp=function(t,e,i){var r;return r=Ip(arguments),t=r[0],e=r[1],i=r[2],t=ip(t),e=ip(e),i=ip(i),.2126*t+.7152*e+.0722*i},ip=function(t){return t/=255,t<=.03928?t/12.92:up((t+.055)/1.055,2.4)},xf=[],Vf=function(t,e,i,r){var n,o,a,s;for(null==i&&(i=.5),null==r&&(r="rgb"),"object"!==Ep(t)&&(t=Tf(t)),"object"!==Ep(e)&&(e=Tf(e)),a=0,o=xf.length;a<o;a++)if(n=xf[a],r===n[0]){s=n[1](t,e,i,r);break}if(null==s)throw"color mode "+r+" is not supported";return s.alpha(t.alpha()+i*(e.alpha()-t.alpha())),s},Tf.interpolate=Vf,lf.prototype.interpolate=function(t,e,i){return Vf(this,t,e,i)},Tf.mix=Vf,lf.prototype.mix=lf.prototype.interpolate,Xf=function(t,e,i,r){var n,o;return n=t._rgb,o=e._rgb,new lf(n[0]+i*(o[0]-n[0]),n[1]+i*(o[1]-n[1]),n[2]+i*(o[2]-n[2]),r)},xf.push(["rgb",Xf]),lf.prototype.luminance=function(t,e){var i,r,n,o;return null==e&&(e="rgb"),arguments.length?(0===t?this._rgb=[0,0,0,this._rgb[3]]:1===t?this._rgb=[255,255,255,this._rgb[3]]:(r=1e-7,n=20,o=function(i,a){var s,c;return c=i.interpolate(a,.5,e),s=c.luminance(),Math.abs(t-s)<r||!n--?c:s>t?o(i,c):o(c,a)},i=yp(this._rgb),this._rgb=(i>t?o(Tf("black"),this):o(this,Tf("white"))).rgba()),this):yp(this._rgb)},Tp=function(t){var e,i,r,n;return n=t/100,n<66?(r=255,i=-155.25485562709179-.44596950469579133*(i=n-2)+104.49216199393888*ep(i),e=n<20?0:-254.76935184120902+.8274096064007395*(e=n-10)+115.67994401066147*ep(e)):(r=351.97690566805693+.114206453784165*(r=n-55)-40.25366309332127*ep(r),i=325.4494125711974+.07943456536662342*(i=n-50)-28.0852963507957*ep(i),e=255),Ef([r,i,e])},xp=function(){var t,e,i,r,n,o,a,s,c;for(a=Ip(arguments),o=a[0],i=a[1],t=a[2],n=1e3,r=4e4,e=.4;r-n>e;)c=.5*(r+n),s=Tp(c),s[2]/s[0]>=t/o?r=c:n=c;return Ap(c)},Tf.temperature=Tf.kelvin=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["temperature"]),function(){})},bf.temperature=bf.kelvin=bf.K=Tp,lf.prototype.temperature=function(){return xp(this._rgb)},lf.prototype.kelvin=lf.prototype.temperature,Tf.contrast=function(t,e){var i,r,n,o;return"string"!==(n=Ep(t))&&"number"!==n||(t=new lf(t)),"string"!==(o=Ep(e))&&"number"!==o||(e=new lf(e)),i=t.luminance(),r=e.luminance(),i>r?(i+.05)/(r+.05):(r+.05)/(i+.05)},lf.prototype.get=function(t){var e,i,r,n,o,a;return r=this,o=t.split("."),n=o[0],e=o[1],a=r[n](),e?(i=n.indexOf(e),i>-1?a[i]:console.warn("unknown channel "+e+" in mode "+n)):a},lf.prototype.set=function(t,e){var i,r,n,o,a,s;if(n=this,a=t.split("."),o=a[0],i=a[1],i)if(s=n[o](),r=o.indexOf(i),r>-1)if("string"===Ep(e))switch(e.charAt(0)){case"+":s[r]+=+e;break;case"-":s[r]+=+e;break;case"*":s[r]*=+e.substr(1);break;case"/":s[r]/=+e.substr(1);break;default:s[r]=+e}else s[r]=e;else console.warn("unknown channel "+i+" in mode "+o);else s=e;return n._rgb=Tf(s,o).alpha(n.alpha())._rgb,n},lf.prototype.darken=function(t){var e,i;return null==t&&(t=1),i=this,e=i.lab(),e[0]-=df.Kn*t,Tf.lab(e).alpha(i.alpha())},lf.prototype.brighten=function(t){return null==t&&(t=1),this.darken(-t)},lf.prototype.darker=lf.prototype.darken,lf.prototype.brighter=lf.prototype.brighten,lf.prototype.saturate=function(t){var e,i;return null==t&&(t=1),i=this,e=i.lch(),e[1]+=t*df.Kn,e[1]<0&&(e[1]=0),Tf.lch(e).alpha(i.alpha())},lf.prototype.desaturate=function(t){return null==t&&(t=1),this.saturate(-t)},lf.prototype.premultiply=function(){var t,e;return e=this.rgb(),t=this.alpha(),Tf(e[0]*t,e[1]*t,e[2]*t,t)},Af=function(t,e,i){if(!Af[i])throw"unknown blend mode "+i;return Af[i](t,e)},Mf=function(t){return function(e,i){var r,n;return r=Tf(i).rgb(),n=Tf(e).rgb(),Tf(t(r,n),"rgb")}},kf=function(t){return function(e,i){var r,n,o;for(o=[],r=n=0;n<=3;r=++n)o[r]=t(e[r],i[r]);return o}},ap=function(t,e){return t},op=function(t,e){return t*e/255},Df=function(t,e){return t>e?e:t},Jf=function(t,e){return t>e?t:e},Mp=function(t,e){return 255*(1-(1-t/255)*(1-e/255))},cp=function(t,e){return e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255))},Cf=function(t,e){return 255*(1-(1-e/255)/(t/255))},Nf=function(t,e){return 255===t?255:(t=255*(e/255)/(1-t/255),t>255?255:t)},Af.normal=Mf(kf(ap)),Af.multiply=Mf(kf(op)),Af.screen=Mf(kf(Mp)),Af.overlay=Mf(kf(cp)),Af.darken=Mf(kf(Df)),Af.lighten=Mf(kf(Jf)),Af.dodge=Mf(kf(Nf)),Af.burn=Mf(kf(Cf)),Tf.blend=Af,Tf.analyze=function(t){var e,i,r,n;for(r={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0},i=0,e=t.length;i<e;i++)n=t[i],null==n||isNaN(n)||(r.values.push(n),r.sum+=n,n<r.min&&(r.min=n),n>r.max&&(r.max=n),r.count+=1);return r.domain=[r.min,r.max],r.limits=function(t,e){return Tf.limits(r,t,e)},r},Tf.scale=function(t,e){var i,r,n,o,a,s,c,u,l,h,d,f,p,m,g,v,y,b,x,_,w;return l="rgb",h=Tf("#ccc"),m=0,s=!1,a=[0,1],p=[],f=[0,0],i=!1,n=[],d=!1,u=0,c=1,o=!1,r={},_=function(t){var e,i,r,o,a,s,c;if(null==t&&(t=["#fff","#000"]),null!=t&&"string"===Ep(t)&&null!=(null!=(o=Tf.brewer)?o[t]:void 0)&&(t=Tf.brewer[t]),"array"===Ep(t)){for(t=t.slice(0),e=r=0,a=t.length-1;0<=a?r<=a:r>=a;e=0<=a?++r:--r)i=t[e],"string"===Ep(i)&&(t[e]=Tf(i));for(p.length=0,e=c=0,s=t.length-1;0<=s?c<=s:c>=s;e=0<=s?++c:--c)p.push(e/(t.length-1))}return x(),n=t},y=function(t){var e,r;if(null!=i){for(r=i.length-1,e=0;e<r&&t>=i[e];)e++;return e-1}return 0},w=function(t){return t},g=function(t){var e,r,n,o,a;return a=t,i.length>2&&(o=i.length-1,e=y(t),n=i[0]+(i[1]-i[0])*(0+.5*m),r=i[o-1]+(i[o]-i[o-1])*(1-.5*m),a=u+(i[e]+.5*(i[e+1]-i[e])-n)/(r-n)*(c-u)),a},b=function(t,e){var o,a,s,d,m,g,v,b;if(null==e&&(e=!1),isNaN(t))return h;if(e?b=t:i&&i.length>2?(o=y(t),b=o/(i.length-2),b=f[0]+b*(1-f[0]-f[1])):c!==u?(b=(t-u)/(c-u),b=f[0]+b*(1-f[0]-f[1]),b=Math.min(1,Math.max(0,b))):b=1,e||(b=w(b)),d=Math.floor(1e4*b),r[d])a=r[d];else{if("array"===Ep(n))for(s=m=0,v=p.length-1;0<=v?m<=v:m>=v;s=0<=v?++m:--m){if(g=p[s],b<=g){a=n[s];break}if(b>=g&&s===p.length-1){a=n[s];break}if(b>g&&b<p[s+1]){b=(b-g)/(p[s+1]-g),a=Tf.interpolate(n[s],n[s+1],b,l);break}}else"function"===Ep(n)&&(a=n(b));r[d]=a}return a},x=function(){return r={}},_(t),v=function(t){var e;return e=Tf(b(t)),d&&e[d]?e[d]():e},v.classes=function(t){var e;return null!=t?("array"===Ep(t)?(i=t,a=[t[0],t[t.length-1]]):(e=Tf.analyze(a),i=0===t?[e.min,e.max]:Tf.limits(e,"e",t)),v):i},v.domain=function(t){var e,i,r,o,s,l,h;if(!arguments.length)return a;if(u=t[0],c=t[t.length-1],p=[],r=n.length,t.length===r&&u!==c)for(s=0,o=t.length;s<o;s++)i=t[s],p.push((i-u)/(c-u));else for(e=h=0,l=r-1;0<=l?h<=l:h>=l;e=0<=l?++h:--h)p.push(e/(r-1));return a=[u,c],v},v.mode=function(t){return arguments.length?(l=t,x(),v):l},v.range=function(t,e){return _(t,e),v},v.out=function(t){return d=t,v},v.spread=function(t){return arguments.length?(m=t,v):m},v.correctLightness=function(t){return null==t&&(t=!0),o=t,x(),w=o?function(t){var e,i,r,n,o,a,s,c,u;for(e=b(0,!0).lab()[0],i=b(1,!0).lab()[0],s=e>i,r=b(t,!0).lab()[0],o=e+(i-e)*t,n=r-o,c=0,u=1,a=20;Math.abs(n)>.01&&a-- >0;)!function(){return s&&(n*=-1),n<0?(c=t,t+=.5*(u-t)):(u=t,t+=.5*(c-t)),r=b(t,!0).lab()[0],n=r-o}();return t}:function(t){return t},v},v.padding=function(t){return null!=t?("number"===Ep(t)&&(t=[t,t]),f=t,v):f},v.colors=function(){var e,r,n,o,s,c,u,l,h;if(o=0,s="hex",1===arguments.length&&("string"===Ep(arguments[0])?s=arguments[0]:o=arguments[0]),2===arguments.length&&(o=arguments[0],s=arguments[1]),o)return r=a[0],e=a[1]-r,function(){u=[];for(var t=0;0<=o?t<o:t>o;0<=o?t++:t--)u.push(t);return u}.apply(this).map(function(t){return v(r+t/(o-1)*e)[s]()});if(t=[],l=[],i&&i.length>2)for(n=h=1,c=i.length;1<=c?h<c:h>c;n=1<=c?++h:--h)l.push(.5*(i[n-1]+i[n]));else l=a;return l.map(function(t){return v(t)[s]()})},v},null==Tf.scales&&(Tf.scales={}),Tf.scales.cool=function(){return Tf.scale([Tf.hsl(180,1,.9),Tf.hsl(250,.7,.4)])},Tf.scales.hot=function(){return Tf.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},Tf.analyze=function(t,e,i){var r,n,o,a,s,c,u;if(s={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0},null==i&&(i=function(){return!0}),r=function(t){null==t||isNaN(t)||(s.values.push(t),s.sum+=t,t<s.min&&(s.min=t),t>s.max&&(s.max=t),s.count+=1)},u=function(t,n){if(i(t,n))return r(null!=e&&"function"===Ep(e)?e(t):null!=e&&"string"===Ep(e)||"number"===Ep(e)?t[e]:t)},"array"===Ep(t))for(a=0,o=t.length;a<o;a++)c=t[a],u(c);else for(n in t)c=t[n],u(c,n);return s.domain=[s.min,s.max],s.limits=function(t,e){return Tf.limits(s,t,e)},s},Tf.limits=function(t,e,i){var r,n,o,a,s,c,u,l,h,d,f,p,m,g,v,y,b,x,_,w,S,A,M,P,C,T,E,I,L,R,O,D,N,k,F,B,z,U,j,$,V,G,H,W,X,q,Y,Z,K,Q,J,tt,et,it,rt;if(null==e&&(e="equal"),null==i&&(i=7),"array"===Ep(t)&&(t=Tf.analyze(t)),C=t.min,np=t.max,J=t.sum,it=t.values.sort(function(t,e){return t-e}),M=[],"c"===e.substr(0,1)&&(M.push(C),M.push(np)),"e"===e.substr(0,1)){for(M.push(C),w=O=1,F=i-1;1<=F?O<=F:O>=F;w=1<=F?++O:--O)M.push(C+w/i*(np-C));M.push(np)}else if("l"===e.substr(0,1)){if(C<=0)throw"Logarithmic scales are only possible for values > 0";for(T=Math.LOG10E*ep(C),P=Math.LOG10E*ep(np),M.push(C),w=rt=1,B=i-1;1<=B?rt<=B:rt>=B;w=1<=B?++rt:--rt)M.push(up(10,T+w/i*(P-T)));M.push(np)}else if("q"===e.substr(0,1)){for(M.push(C),w=r=1,G=i-1;1<=G?r<=G:r>=G;w=1<=G?++r:--r)D=it.length*w/i,N=Ff(D),N===D?M.push(it[N]):(k=D-N,M.push(it[N]*k+it[N+1]*(1-k)));M.push(np)}else if("k"===e.substr(0,1)){for(I=it.length,g=new Array(I),x=new Array(i),Q=!0,L=0,y=null,y=[],y.push(C),w=n=1,H=i-1;1<=H?n<=H:n>=H;w=1<=H?++n:--n)y.push(C+w/i*(np-C));for(y.push(np);Q;){for(S=o=0,W=i-1;0<=W?o<=W:o>=W;S=0<=W?++o:--o)x[S]=0;for(w=a=0,X=I-1;0<=X?a<=X:a>=X;w=0<=X?++a:--a){for(et=it[w],E=Number.MAX_VALUE,S=s=0,q=i-1;0<=q?s<=q:s>=q;S=0<=q?++s:--s)_=_f(y[S]-et),_<E&&(E=_,v=S);x[v]++,g[w]=v}for(R=new Array(i),S=c=0,Y=i-1;0<=Y?c<=Y:c>=Y;S=0<=Y?++c:--c)R[S]=null;for(w=u=0,Z=I-1;0<=Z?u<=Z:u>=Z;w=0<=Z?++u:--u)b=g[w],null===R[b]?R[b]=it[w]:R[b]+=it[w];for(S=l=0,K=i-1;0<=K?l<=K:l>=K;S=0<=K?++l:--l)R[S]*=1/x[S];for(Q=!1,S=h=0,z=i-1;0<=z?h<=z:h>=z;S=0<=z?++h:--h)if(R[S]!==y[w]){Q=!0;break}y=R,L++,L>200&&(Q=!1)}for(A={},S=d=0,U=i-1;0<=U?d<=U:d>=U;S=0<=U?++d:--d)A[S]=[];for(w=f=0,j=I-1;0<=j?f<=j:f>=j;w=0<=j?++f:--f)b=g[w],A[b].push(it[w]);for(tt=[],S=p=0,$=i-1;0<=$?p<=$:p>=$;S=0<=$?++p:--p)tt.push(A[S][0]),tt.push(A[S][A[S].length-1]);for(tt=tt.sort(function(t,e){return t-e}),M.push(tt[0]),w=m=1,V=tt.length-1;m<=V;w=m+=2)isNaN(tt[w])||M.push(tt[w])}return M},zf=function(t,e,i){var r,n,o,a;return r=Ip(arguments),t=r[0],e=r[1],i=r[2],t/=360,t<1/3?(n=(1-e)/3,a=(1+e*Rf(gf*t)/Rf(pf-gf*t))/3,o=1-(n+a)):t<2/3?(t-=1/3,a=(1-e)/3,o=(1+e*Rf(gf*t)/Rf(pf-gf*t))/3,n=1-(a+o)):(t-=2/3,o=(1-e)/3,n=(1+e*Rf(gf*t)/Rf(pf-gf*t))/3,a=1-(o+n)),a=tp(i*a*3),o=tp(i*o*3),n=tp(i*n*3),[255*a,255*o,255*n,r.length>3?r[3]:1]},fp=function(){var t,e,i,r,n,o,a,s;return a=Ip(arguments),o=a[0],e=a[1],t=a[2],gf=2*Math.PI,o/=255,e/=255,t/=255,n=Math.min(o,e,t),r=(o+e+t)/3,s=1-n/r,0===s?i=0:(i=(o-e+(o-t))/2,i/=Math.sqrt((o-e)*(o-e)+(o-t)*(e-t)),i=Math.acos(i),t>e&&(i=gf-i),i/=gf),[360*i,s,r]},Tf.hsi=function(){return function(t,e,i){i.prototype=t.prototype;var r=new i,n=t.apply(r,e);return Object(n)===n?n:r}(lf,kp.call(arguments).concat(["hsi"]),function(){})},bf.hsi=zf,lf.prototype.hsi=function(){return fp(this._rgb)},Gf=function(t,e,i,r){var n,o,a,s,c,u,l,h,d,f,p,m,g;return"hsl"===r?(m=t.hsl(),g=e.hsl()):"hsv"===r?(m=t.hsv(),g=e.hsv()):"hsi"===r?(m=t.hsi(),g=e.hsi()):"lch"!==r&&"hcl"!==r||(r="hcl",m=t.hcl(),g=e.hcl()),"h"===r.substr(0,1)&&(a=m[0],f=m[1],u=m[2],s=g[0],p=g[1],l=g[2]),isNaN(a)||isNaN(s)?isNaN(a)?isNaN(s)?o=Number.NaN:(o=s,1!==u&&0!==u||"hsv"===r||(d=p)):(o=a,1!==l&&0!==l||"hsv"===r||(d=f)):(n=s>a&&s-a>180?s-(a+360):s<a&&a-s>180?s+360-a:s-a,o=a+i*n),null==d&&(d=f+i*(p-f)),c=u+i*(l-u),h=Tf[r](o,d,c)},xf=xf.concat(function(){var t,e,i,r;for(i=["hsv","hsl","hsi","hcl","lch"],r=[],e=0,t=i.length;e<t;e++)rp=i[e],r.push([rp,Gf]);return r}()),Wf=function(t,e,i,r){var n,o;return n=t.num(),o=e.num(),Tf.num(n+(o-n)*i,"num")},xf.push(["num",Wf]),Hf=function(t,e,i,r){var n,o,a;return o=t.lab(),a=e.lab(),n=new lf(o[0]+i*(a[0]-o[0]),o[1]+i*(a[1]-o[1]),o[2]+i*(a[2]-o[2]),r)},xf.push(["lab",Hf]);var Fp=Tf,Bp=function(t){var e=t||{};this.scale=Hi(e.scale,"uniform"),this.mode=Hi(e.mode,"hcl"),this.domain=Hi(e.domain,[0,1]),this.value=new ct(Hi(e.value,16777215)).getHex(),this.structure=e.structure,this.volume=e.volume,this.surface=e.surface,this.gidPool=e.gidPool,this.structure&&(this.atomProxy=this.structure.getAtomProxy())};Bp.prototype.getScale=function(t){var e=t||{},i=Hi(e.scale,this.scale);return"rainbow"===i||"roygb"===i?i=["red","orange","yellow","green","blue"]:"rwb"===i&&(i=["red","white","blue"]),Fp.scale(i).mode(Hi(e.mode,this.mode)).domain(Hi(e.domain,this.domain)).out("num")},Bp.prototype.colorToArray=function(t,e,i){return void 0===e&&(e=[]),void 0===i&&(i=0),e[i+0]=(t>>16&255)/255,e[i+1]=(t>>8&255)/255,e[i+2]=(255&t)/255,e},Bp.prototype.atomColor=function(){return 16777215},Bp.prototype.atomColorToArray=function(t,e,i){return this.colorToArray(this.atomColor(t),e,i)},Bp.prototype.bondColor=function(t,e){return this.atomProxy.index=e?t.atomIndex1:t.atomIndex2,this.atomColor(this.atomProxy)},Bp.prototype.bondColorToArray=function(t,e,i,r){return this.colorToArray(this.bondColor(t,e),i,r)},Bp.prototype.volumeColor=function(){return 16777215},Bp.prototype.volumeColorToArray=function(t,e,i){return this.colorToArray(this.volumeColor(t),e,i)},Bp.prototype.positionColor=function(){return 16777215},Bp.prototype.positionColorToArray=function(t,e,i){return this.colorToArray(this.positionColor(t),e,i)},Mr.prototype={active:!0,params:null,execute:function(t){var e,i;return this.active&&this._listener&&(i=this.params?this.params.concat(t):t,e=this._listener.apply(this.context,i),this._isOnce&&this.detach()),e},detach:function(){return this.isBound()?this._signal.remove(this._listener,this.context):null},isBound:function(){return!!this._signal&&!!this._listener},isOnce:function(){return this._isOnce},getListener:function(){return this._listener},getSignal:function(){return this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},Cr.prototype={VERSION:"1.0.0",memorize:!1,_shouldPropagate:!0,active:!0,_registerListener:function(t,e,i,r){var n,o=this._indexOfListener(t,i);if(o!==-1){if(n=this._bindings[o],n.isOnce()!==e)throw new Error("You cannot add"+(e?"":"Once")+"() then add"+(e?"Once":"")+"() the same listener without removing the relationship first.")}else n=new Mr(this,t,e,i,r),this._addBinding(n);return this.memorize&&this._prevParams&&n.execute(this._prevParams),n},_addBinding:function(t){var e=this._bindings.length;do--e;while(this._bindings[e]&&t._priority<=this._bindings[e]._priority);this._bindings.splice(e+1,0,t)},_indexOfListener:function(t,e){for(var i,r=this,n=this._bindings.length;n--;)if(i=r._bindings[n],i._listener===t&&i.context===e)return n;return-1},has:function(t,e){return this._indexOfListener(t,e)!==-1},add:function(t,e,i){return Pr(t,"add"),this._registerListener(t,!1,e,i)},addOnce:function(t,e,i){return Pr(t,"addOnce"),this._registerListener(t,!0,e,i)},remove:function(t,e){Pr(t,"remove");var i=this._indexOfListener(t,e);return i!==-1&&(this._bindings[i]._destroy(),this._bindings.splice(i,1)),t},removeAll:function(){for(var t=this,e=this._bindings.length;e--;)t._bindings[e]._destroy();this._bindings.length=0},getNumListeners:function(){return this._bindings.length},halt:function(){this._shouldPropagate=!1},dispatch:function(t){if(this.active){var e,i=Array.prototype.slice.call(arguments),r=this._bindings.length;if(this.memorize&&(this._prevParams=i),r){e=this._bindings.slice(),this._shouldPropagate=!0;do r--;while(e[r]&&this._shouldPropagate&&e[r].execute(i)!==!1)}}},forget:function(){this._prevParams=null},dispose:function(){this.removeAll(),delete this._bindings,delete this._prevParams},toString:function(){return"[Signal active:"+this.active+" numListeners:"+this.getNumListeners()+"]"}};var zp={PROTEIN:1,NUCLEIC:2,RNA:3,DNA:4,POLYMER:5,WATER:6,HELIX:7,SHEET:8,BACKBONE:9,SIDECHAIN:10,ALL:11,HETERO:12,ION:13,SACCHARIDE:14};Tr.prototype={constructor:Tr,type:"selection",setString:function(t,e){if(void 0===t&&(t=this.string||""),t!==this.string){try{this.parse(t)}catch(t){this.selection={error:t.message}}this.string=t,this.test=this.makeAtomTest(),this.residueTest=this.makeResidueTest(),this.chainTest=this.makeChainTest(),this.modelTest=this.makeModelTest(),this.atomOnlyTest=this.makeAtomTest(!0),this.residueOnlyTest=this.makeResidueTest(!0),this.chainOnlyTest=this.makeChainTest(!0),this.modelOnlyTest=this.makeModelTest(!0),e||this.signals.stringChanged.dispatch(this.string)}},parse:function(t){if(this.selection={operator:void 0,rules:[]},t){var e,i,r=this,n=this.selection,o=[];t=t.replace(/\(/g," ( ").replace(/\)/g," ) ").trim(),"("===t.charAt(0)&&")"===t.substr(-1)&&(t=t.slice(1,-1).trim());var a,s,c,u,l,h,d,f,p,m,g=t.split(/\s+/),v=["*","","ALL"],y=function(t){e={operator:t,rules:[]},void 0===n?(n=e,r.selection=e):(n.rules.push(e),o.push(n),n=e)},b=function(t){i=n,n=o.pop(),void 0===n&&(y(t),x(i))},x=function(t){n.rules.push(t)};for(c=0;c<g.length;++c)if(a=g[c],"("!==a)if(")"!==a){if(u>0)if("NOT"===a.toUpperCase())u=1;else if(1===u)u=2;else{if(2!==u)throw new Error("something went wrong with 'not'");u=!1,b()}if("AND"!==a.toUpperCase())if("OR"!==a.toUpperCase())if("NOT"!==a.toUpperCase())if(s={},"HETERO"!==a.toUpperCase())if("WATER"!==a.toUpperCase())if("PROTEIN"!==a.toUpperCase())if("NUCLEIC"!==a.toUpperCase())if("RNA"!==a.toUpperCase())if("DNA"!==a.toUpperCase())if("POLYMER"!==a.toUpperCase())if("ION"!==a.toUpperCase())if("SACCHARIDE"!==a.toUpperCase()&&"SUGAR"!==a.toUpperCase())if("HYDROGEN"!==a.toUpperCase())if("SMALL"!==a.toUpperCase())if("NUCLEOPHILIC"!==a.toUpperCase())if("HYDROPHOBIC"!==a.toUpperCase())if("AROMATIC"!==a.toUpperCase())if("AMIDE"!==a.toUpperCase())if("ACIDIC"!==a.toUpperCase())if("BASIC"!==a.toUpperCase())if("CHARGED"!==a.toUpperCase())if("POLAR"!==a.toUpperCase())if("NONPOLAR"!==a.toUpperCase())if("HELIX"!==a.toUpperCase())if("SHEET"!==a.toUpperCase())if("TURN"!==a.toUpperCase())if("BACKBONE"!==a.toUpperCase())if("SIDECHAIN"!==a.toUpperCase())if("SIDECHAINATTACHED"!==a.toUpperCase())if(v.indexOf(a.toUpperCase())===-1)if("@"!==a.charAt(0))if("#"!==a.charAt(0))if("["!==a[0]||"]"!==a[a.length-1])if(a.length>=1&&a.length<=4&&"^"!==a[0]&&":"!==a[0]&&"."!==a[0]&&"%"!==a[0]&&"/"!==a[0]&&isNaN(parseInt(a)))s.resname=a.toUpperCase(),x(s);else{if(s={operator:"AND",rules:[]},d=a.split("/"),d.length>1&&d[1]){if(isNaN(parseInt(d[1])))throw new Error("model must be an integer");s.rules.push({model:parseInt(d[1])})}if(p=d[0].split("%"),p.length>1&&s.rules.push({altloc:p[1]}),l=p[0].split("."),l.length>1&&l[1]){if(l[1].length>4)throw new Error("atomname must be one to four characters");s.rules.push({atomname:l[1].substring(0,4).toUpperCase()})}if(h=l[0].split(":"),h.length>1&&h[1]&&s.rules.push({chainname:h[1]}),m=h[0].split("^"),m.length>1&&s.rules.push({inscode:m[1]}),m[0]){var _,w;if("-"===m[0][0]&&(m[0]=m[0].substr(1),_=!0),m[0].includes("--")&&(m[0]=m[0].replace("--","-"),w=!0),f=m[0].split("-"),1===f.length){if(f=parseInt(f[0]),isNaN(f))throw new Error("resi must be an integer");_&&(f*=-1),s.rules.push({resno:f})}else{if(2!==f.length)throw new Error("resi range must contain one '-'");_&&(f[0]*=-1),w&&(f[1]*=-1),s.rules.push({resno:[parseInt(f[0]),parseInt(f[1])]})}}if(1===s.rules.length)x(s.rules[0]);else{if(!(s.rules.length>1))throw new Error("empty selection chunk");x(s)}}else s.resname=a.substr(1,a.length-2).toUpperCase(),x(s);else s.element=a.substr(1).toUpperCase(),x(s);else{for(var S=a.substr(1).split(","),A=0,M=S.length;A<M;++A)S[A]=parseInt(S[A]);S.sort(function(t,e){return t-e}),s.atomindex=S,x(s)}else s.keyword=zp.ALL,x(s);else s={operator:"OR",rules:[{keyword:zp.SIDECHAIN},{operator:"AND",negate:!1,rules:[{keyword:zp.PROTEIN},{operator:"OR",negate:!1,rules:[{atomname:"CA"},{atomname:"BB"}]}]},{operator:"AND",negate:!1,rules:[{resname:"PRO"},{atomname:"N"}]},{operator:"AND",negate:!1,rules:[{keyword:zp.NUCLEIC},{operator:"OR",negate:!0,rules:[{atomname:"P"},{atomname:"OP1"},{atomname:"OP2"},{atomname:"O3'"},{atomname:"O3*"},{atomname:"O5'"},{atomname:"O5*"},{atomname:"C5'"},{atomname:"C5*"}]}]}]},x(s);else s.keyword=zp.SIDECHAIN,x(s);else s.keyword=zp.BACKBONE,x(s);else s={operator:"AND",rules:[{operator:"OR",negate:!0,rules:[{keyword:zp.HELIX},{keyword:zp.SHEET}]},{operator:"OR",rules:[{keyword:zp.PROTEIN},{sstruc:"s"},{sstruc:"t"},{sstruc:"l"}]}]},x(s);else s.keyword=zp.SHEET,x(s);else s.keyword=zp.HELIX,x(s);else s={operator:"OR",rules:[{resname:"ALA"},{resname:"CYS"},{resname:"GLY"},{resname:"ILE"},{resname:"LEU"},{resname:"MET"},{resname:"PHE"},{resname:"PRO"},{resname:"VAL"},{resname:"TRP"}]},x(s);else s={operator:"OR",rules:[{resname:"ASP"},{resname:"GLU"},{resname:"HIS"},{resname:"LYS"},{resname:"ARG"},{resname:"ASN"},{resname:"GLN"},{resname:"SER"},{resname:"THR"},{resname:"TYR"}]},x(s);else s={operator:"OR",rules:[{resname:"ASP"},{resname:"GLU"},{resname:"HIS"},{resname:"LYS"},{resname:"ARG"}]},x(s);else s={operator:"OR",rules:[{resname:"HIS"},{resname:"LYS"},{resname:"ARG"}]},x(s);else s={operator:"OR",rules:[{resname:"ASP"},{resname:"GLU"}]},x(s);else s={operator:"OR",rules:[{resname:"ASN"},{resname:"GLN"}]},x(s);else s={operator:"OR",rules:[{resname:"PHE"},{resname:"TYR"},{resname:"TRP"}]},x(s);else s={operator:"OR",rules:[{resname:"VAL"},{resname:"LEU"},{resname:"ILE"},{resname:"MET"},{resname:"PRO"}]},x(s);else s={operator:"OR",rules:[{resname:"SER"},{resname:"THR"},{resname:"CYS"}]},x(s);else s={operator:"OR",rules:[{resname:"GLY"},{resname:"ALA"}]},x(s);else s.element="H",x(s);else s.keyword=zp.SACCHARIDE,x(s);else s.keyword=zp.ION,x(s);else s.keyword=zp.POLYMER,x(s);else s.keyword=zp.DNA,x(s);else s.keyword=zp.RNA,x(s);else s.keyword=zp.NUCLEIC,x(s);else s.keyword=zp.PROTEIN,x(s);else s.keyword=zp.WATER,x(s);else s.keyword=zp.HETERO,x(s);else u=1,y(),n.negate=!0;else"AND"===n.operator?b("OR"):n.operator="OR";else if("OR"===n.operator){var P=n.rules.pop();y("AND"),x(P)}else n.operator="AND"}else b(),n.negate&&b();else u=!1,y();void 0===this.selection.operator&&1===this.selection.rules.length&&this.selection.rules[0].hasOwnProperty("operator")&&(this.selection=this.selection.rules[0])}},_makeTest:function(t,e){var i=this;if(void 0===e&&(e=this.selection),null===e)return!1;if(e.error)return!1;var r=e.rules.length;if(0===r)return!1;for(var n,o,a,s,c=!e.negate,u=!!e.negate,l=[],h=0;h<r;++h)n=e.rules[h],n.hasOwnProperty("operator")&&(l[h]=i._makeTest(t,n));return function(i){o="AND"===e.operator,s=!1;for(var h=0;h<r;++h)if(n=e.rules[h],n.hasOwnProperty("operator")){if(a=l[h]?l[h](i):-1,a===-1){s=!0;continue}if(a===!0){if(o)continue;return c}if(o)return u}else{if(n.keyword===zp.ALL){if(o)continue;return c}if(a=t(i,n),a!==-1){if(a===!0){if(o)continue;return c}if(o)return u}else s=!0}return s?-1:o?c:u}},_filter:function(t,e){var i=this;if(void 0===e&&(e=this.selection),e.error)return e;var r=e.rules.length;if(0===r)return e;var n={operator:e.operator,rules:[]};e.hasOwnProperty("negate")&&(n.negate=e.negate);for(var o=0;o<r;++o){var a=e.rules[o];if(a.hasOwnProperty("operator")){var s=i._filter(t,a);null!==s&&n.rules.push(s)}else t(a)||n.rules.push(a)}return n.rules.length>0?e:null},makeAtomTest:function(t){var e,i=["h","g","i"],r=["e","b"];e=t?this._filter(function(t){return void 0!==t.keyword&&t.keyword!==zp.BACKBONE&&t.keyword!==zp.SIDECHAIN||(void 0!==t.model||(void 0!==t.chainname||(void 0!==t.resname||(void 0!==t.resno||void 0!==t.sstruc))))}):this.selection;var n=function(t,e){if(void 0===e.atomname&&void 0===e.element&&void 0===e.altloc&&void 0===e.atomindex&&void 0===e.keyword&&void 0===e.inscode&&void 0===e.resname&&void 0===e.sstruc&&void 0===e.resno&&void 0===e.chainname&&void 0===e.model)return-1;if(void 0!==e.keyword){if(e.keyword===zp.BACKBONE&&!t.isBackbone())return!1;if(e.keyword===zp.SIDECHAIN&&!t.isSidechain())return!1;if(e.keyword===zp.HETERO&&!t.isHetero())return!1;if(e.keyword===zp.PROTEIN&&!t.isProtein())return!1;if(e.keyword===zp.NUCLEIC&&!t.isNucleic())return!1;if(e.keyword===zp.RNA&&!t.isRna())return!1;if(e.keyword===zp.DNA&&!t.isDna())return!1;if(e.keyword===zp.POLYMER&&!t.isPolymer())return!1;if(e.keyword===zp.WATER&&!t.isWater())return!1;if(e.keyword===zp.HELIX&&i.indexOf(t.sstruc)===-1)return!1;if(e.keyword===zp.SHEET&&r.indexOf(t.sstruc)===-1)return!1;if(e.keyword===zp.ION&&!t.isIon())return!1;if(e.keyword===zp.SACCHARIDE&&!t.isSaccharide())return!1}if(void 0!==e.atomname&&e.atomname!==t.atomname)return!1;if(void 0!==e.element&&e.element!==t.element)return!1;if(void 0!==e.altloc&&e.altloc!==t.altloc)return!1;if(void 0!==e.atomindex&&Ji(e.atomindex,t.index)<0)return!1;if(void 0!==e.resname&&e.resname!==t.resname)return!1;if(void 0!==e.sstruc&&e.sstruc!==t.sstruc)return!1;if(void 0!==e.resno)if(Array.isArray(e.resno)&&2===e.resno.length){if(e.resno[0]>t.resno||e.resno[1]<t.resno)return!1}else if(e.resno!==t.resno)return!1;return(void 0===e.inscode||e.inscode===t.inscode)&&((void 0===e.chainname||e.chainname===t.chainname)&&(void 0===e.model||e.model===t.modelIndex))};return this._makeTest(n,e)},makeResidueTest:function(t){var e,i=["h","g","i"],r=["e","b"];e=t?this._filter(function(t){return t.keyword===zp.BACKBONE||t.keyword===zp.SIDECHAIN||(void 0!==t.model||(void 0!==t.chainname||(void 0!==t.atomname||(void 0!==t.element||void 0!==t.altloc))))}):this.selection;var n=function(t,e){if(void 0===e.resname&&void 0===e.resno&&void 0===e.inscode&&void 0===e.sstruc&&void 0===e.model&&void 0===e.chainname&&void 0===e.atomindex&&(void 0===e.keyword||e.keyword===zp.BACKBONE||e.keyword===zp.SIDECHAIN))return-1;if(void 0!==e.keyword){if(e.keyword===zp.HETERO&&!t.isHetero())return!1;if(e.keyword===zp.PROTEIN&&!t.isProtein())return!1;if(e.keyword===zp.NUCLEIC&&!t.isNucleic())return!1;if(e.keyword===zp.RNA&&!t.isRna())return!1;if(e.keyword===zp.DNA&&!t.isDna())return!1;if(e.keyword===zp.POLYMER&&!t.isPolymer())return!1;if(e.keyword===zp.WATER&&!t.isWater())return!1;if(e.keyword===zp.HELIX&&i.indexOf(t.sstruc)===-1)return!1;if(e.keyword===zp.SHEET&&r.indexOf(t.sstruc)===-1)return!1;if(e.keyword===zp.ION&&!t.isIon())return!1;if(e.keyword===zp.SACCHARIDE&&!t.isSaccharide())return!1}if(void 0!==e.atomindex&&0===ir(e.atomindex,t.atomOffset,t.atomEnd))return!1;if(void 0!==e.resname&&e.resname!==t.resname)return!1;if(void 0!==e.sstruc&&e.sstruc!==t.sstruc)return!1;if(void 0!==e.resno)if(Array.isArray(e.resno)&&2===e.resno.length){if(e.resno[0]>t.resno||e.resno[1]<t.resno)return!1}else if(e.resno!==t.resno)return!1;return(void 0===e.inscode||e.inscode===t.inscode)&&((void 0===e.chainname||e.chainname===t.chainname)&&(void 0===e.model||e.model===t.modelIndex))};return this._makeTest(n,e)},makeChainTest:function(t){var e,i=[zp.HETERO,zp.PROTEIN,zp.NUCLEIC,zp.RNA,zp.DNA,zp.POLYMER,zp.WATER,zp.ION,zp.SACCHARIDE];e=t?this._filter(function(t){return void 0!==t.keyword&&!i.includes(t.keyword)||(void 0!==t.resname||(void 0!==t.resno||(void 0!==t.atomname||(void 0!==t.element||(void 0!==t.altloc||(void 0!==t.sstruc||void 0!==t.inscode))))))}):this.selection;var r=function(t,e){if(void 0===e.chainname&&void 0===e.model&&void 0===e.atomindex&&(void 0===e.keyword||!i.includes(e.keyword)))return-1;if(void 0!==e.keyword){if(e.keyword===zp.HETERO&&!t.isHetero())return!1;if(e.keyword===zp.PROTEIN&&!t.isProtein())return!1;if(e.keyword===zp.NUCLEIC&&!t.isNucleic())return!1;if(e.keyword===zp.RNA&&!t.isRna())return!1;if(e.keyword===zp.DNA&&!t.isDna())return!1;if(e.keyword===zp.POLYMER&&!t.isPolymer())return!1;if(e.keyword===zp.WATER&&!t.isWater())return!1;if(e.keyword===zp.ION&&!t.isIon())return!1;if(e.keyword===zp.SACCHARIDE&&!t.isSaccharide())return!1}return(void 0===e.atomindex||0!==ir(e.atomindex,t.atomOffset,t.atomEnd))&&((void 0===e.chainname||e.chainname===t.chainname)&&(void 0===e.model||e.model===t.modelIndex))};return this._makeTest(r,e)},makeModelTest:function(t){var e;e=t?this._filter(function(t){return void 0!==t.keyword||(void 0!==t.chainname||(void 0!==t.resname||(void 0!==t.resno||(void 0!==t.atomname||(void 0!==t.element||(void 0!==t.altloc||(void 0!==t.sstruc||void 0!==t.inscode)))))))}):this.selection;var i=function(t,e){return void 0===e.model&&void 0===e.atomindex?-1:(void 0===e.atomindex||0!==ir(e.atomindex,t.atomOffset,t.atomEnd))&&(void 0===e.model||e.model===t.index)};return this._makeTest(i,e)}};var Up=function(t){function e(e){var i=this;t.call(this,e);var r=e.dataList||[];this.colormakerList=[],this.selectionList=[],r.forEach(function(t){var e=t[0],r=t[1],n=t[2];void 0===n&&(n={}),Kp.hasScheme(e)?Object.assign(n,{scheme:e,structure:i.structure}):Object.assign(n,{scheme:"uniform",value:new ct(e).getHex()}),i.colormakerList.push(Kp.getScheme(n)),i.selectionList.push(new Tr(r))})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){for(var e=this,i=0,r=this.selectionList.length;i<r;++i)if(e.selectionList[i].test(t))return e.colormakerList[i].atomColor(t);return 16777215},e}(Bp),jp={"":"",OrRd:"[S] Orange-Red",PuBu:"[S] Purple-Blue",BuPu:"[S] Blue-Purple",Oranges:"[S] Oranges",BuGn:"[S] Blue-Green",YlOrBr:"[S] Yellow-Orange-Brown",YlGn:"[S] Yellow-Green",Reds:"[S] Reds",RdPu:"[S] Red-Purple",Greens:"[S] Greens",YlGnBu:"[S] Yellow-Green-Blue",Purples:"[S] Purples",GnBu:"[S] Green-Blue",Greys:"[S] Greys",YlOrRd:"[S] Yellow-Orange-Red",PuRd:"[S] Purple-Red",Blues:"[S] Blues",PuBuGn:"[S] Purple-Blue-Green",Spectral:"[D] Spectral",RdYlGn:"[D] Red-Yellow-Green",RdBu:"[D] Red-Blue",PiYG:"[D] Pink-Yellowgreen",PRGn:"[D] Purplered-Green",RdYlBu:"[D] Red-Yellow-Blue",BrBG:"[D] Brown-Bluegreen",RdGy:"[D] Red-Grey",PuOr:"[D] Purple-Orange",Set1:"[Q] Set1",Set2:"[Q] Set2",Set3:"[Q] Set3",Dark2:"[Q] Dark2",Paired:"[Q] Paired",
	Pastel1:"[Q] Pastel1",Pastel2:"[Q] Pastel2",Accent:"[Q] Accent",roygb:"[?] Rainbow",rwb:"[?] Red-White-Blue"},$p={"":"",rgb:"Red Green Blue",hsv:"Hue Saturation Value",hsl:"Hue Saturation Lightness",hsi:"Hue Saturation Intensity",lab:"CIE L*a*b*",hcl:"Hue Chroma Lightness"},Vp=function(){this.schemes={},this.userSchemes={}};Vp.prototype.getScheme=function(t){var e,i=t||{},r=i.scheme||"";return new(e=r in this.schemes?this.schemes[r]:r in this.userSchemes?this.userSchemes[r]:Bp)(t)},Vp.prototype.getPickingScheme=function(t){var e=Object.assign(t||{});return e.scheme="picking",this.getScheme(e)},Vp.prototype.getSchemes=function(){var t={};return Object.keys(this.schemes).forEach(function(e){t[e]=e}),Object.keys(this.userSchemes).forEach(function(e){t[e]=e.split("|")[1]}),t},Vp.prototype.getScales=function(){return jp},Vp.prototype.getModes=function(){return $p},Vp.prototype.add=function(t,e){this.schemes[t]=e},Vp.prototype.addScheme=function(t,e){return t instanceof Bp||(t=this.createScheme(t,e)),this.addUserScheme(t,e)},Vp.prototype.addUserScheme=function(t,e){e=e||"";var i=""+vr()+"|"+e;return this.userSchemes[i]=t,i},Vp.prototype.removeScheme=function(t){delete this.userSchemes[t]},Vp.prototype.createScheme=function(t,e){var i=function(i){Bp.call(this,i),this.label=e||"",t.call(this,i)};return i.prototype=Bp.prototype,i.prototype.constructor=Bp,i},Vp.prototype.addSelectionScheme=function(t,e){var i=function(e){function i(i){e.call(this,Object.assign({dataList:t},i))}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i}(Up);return this.addUserScheme(i,e)},Vp.prototype.hasScheme=function(t){return t in this.schemes||t in this.userSchemes};var Gp=Xi(),Hp="undefined"!=typeof window&&"undefined"!=typeof window.orientation,Wp=!1,Xp=!1,qp={log:Function.prototype.bind.call(console.log,console),info:Function.prototype.bind.call(console.info,console),warn:Function.prototype.bind.call(console.warn,console),error:Function.prototype.bind.call(console.error,console),time:Function.prototype.bind.call(console.time,console),timeEnd:Function.prototype.bind.call(console.timeEnd,console)};t.Debug=Gi(Vi("debug"));var Yp='<div style="display:flex;align-items:center;justify-content:center;height:100%;"><p style="padding:15px;text-align:center;">Your browser/graphics card does not seem to support <a target="_blank" href="https://en.wikipedia.org/wiki/WebGL">WebGL</a>.<br/><br/>Find out how to get it <a target="_blank" href="http://get.webgl.org/">here</a>.</p></div>',Zp=new uf,Kp=new Vp,Qp=new sf("datasource"),Jp=new sf("representatation"),tm=new sf("parser"),em=new sf("shader"),im=new sf("decompressor"),rm=new sf("component");Rr.prototype={constructor:Rr,type:"",__srcName:void 0,isBinary:function(){return this.binary||this.compressed},onload:function(){},onprogress:function(){},onerror:function(){},read:function(){var t=this;return new Promise(function(e,i){try{t._read(function(i){var r=im.get(t.compressed);t.compressed&&r?t.data=r(i):((t.binary||t.compressed)&&i instanceof ArrayBuffer&&(i=new Uint8Array(i)),t.data=i),e(t.data)})}catch(t){i(t)}})},_read:function(t){t(this.src)},_chunk:function(t,e){return e=Math.min(this.data.length,e),0===t&&this.data.length===e?this.data:this.isBinary()?this.data.subarray(t,e):this.data.substring(t,e)},chunk:function(t){var e=t+this.chunkSize;return this._chunk(t,e)},peekLines:function(t){var e,i=this.data,r=i.length,n=this.isBinary()?this.newline.charCodeAt(0):this.newline,o=0;for(e=0;e<r&&(i[e]===n&&++o,o!==t);++e);var a=this._chunk(0,e+1),s=this.chunkToLines(a,"",e>r);return s.lines},lineCount:function(){console.warn("lineCount - deprecated");for(var t=this.data,e=t.length,i=this.isBinary()?this.newline.charCodeAt(0):this.newline,r=0,n=0;n<e;++n)t[n]===i&&++r;return t[e-1]!==i&&++r,r},chunkCount:function(){return Math.floor(this.data.length/this.chunkSize)+1},asText:function(){return this.isBinary()?nr(this.data):this.data},chunkToLines:function(t,e,i){var r=this.newline;if(!this.isBinary()&&t.length===this.data.length)return{lines:t.split(r),partialLine:""};var n=this.isBinary()?nr(t):t,o=[],a=n.lastIndexOf(r);if(a===-1)e+=n;else{var s=e+n.substr(0,a);o=o.concat(s.split(r)),e=a===n.length-r.length?"":n.substr(a+r.length)}return i&&""!==e&&o.push(e),{lines:o,partialLine:e}},nextChunk:function(){var t=this.__pointer;if(!(t>this.data.length))return this.__pointer+=this.chunkSize,this.chunk(t)},nextChunkOfLines:function(){var t=this.nextChunk();if(void 0!==t){var e=this.__pointer>this.data.length,i=this.chunkToLines(t,this.__partialLine,e);return this.__partialLine=i.partialLine,i.lines}},eachChunk:function(t){for(var e=this,i=this.chunkSize,r=this.data.length,n=this.chunkCount(),o=0;o<r;o+=i){var a=e.chunk(o),s=Math.round(o/i);t(a,s,n)}},eachChunkOfLines:function(t){this.eachChunk(function(e,i,r){var n=i===r+1,o=this.chunkToLines(e,this.__partialLine,n);this.__partialLine=o.partialLine,t(o.lines,i,r)}.bind(this))},dispose:function(){delete this.src,this.__srcName&&delete this[this.__srcName]}},Or.prototype=Object.assign(Object.create(Rr.prototype),{constructor:Or,type:"file",__srcName:"file",_read:function(t){var e;if("function"==typeof importScripts){e=new FileReaderSync;var i;i=this.binary||this.compressed?e.readAsArrayBuffer(this.file):e.readAsText(this.file),t(i)}else e=new FileReader,e.onload=function(e){t(e.target.result)}.bind(this),"function"==typeof this.onprogress&&(e.onprogress=function(t){this.onprogress(t)}.bind(this)),"function"==typeof this.onerror&&(e.onerror=function(t){this.onerror(t)}.bind(this)),this.binary||this.compressed?e.readAsArrayBuffer(this.file):e.readAsText(this.file)}}),Dr.prototype=Object.assign(Object.create(Rr.prototype),{constructor:Dr,type:"network",__srcName:"url",_read:function(t){var e=this.src;"function"==typeof importScripts&&"../"===e.substr(0,3)&&(e="../"+e);var i=new XMLHttpRequest;i.open("GET",e,!0),i.addEventListener("load",function(){if(200!==i.status&&304!==i.status&&0!==i.status)throw"function"==typeof this.onerror&&this.onerror(i.status),"NetworkStreamer._read: status code "+i.status;try{t(i.response)}catch(t){this.onerror(t)}}.bind(this),!1),"function"==typeof this.onerror&&i.addEventListener("error",function(t){this.onerror(t)}.bind(this),!1),this.isBinary()?i.responseType="arraybuffer":this.json?i.responseType="json":this.xml?i.responseType="document":i.responseType="text",i.send(null)}});var nm=["mmtf","dcd","mrc","ccp4","map","dsn6","brix","dxbin"],om=["json"],am=["xml","validation"],sm=function(t,e){var i=Object.assign({},e),r=nm.includes(i.ext);this.compressed=Hi(i.compressed,!1),this.binary=Hi(i.binary,r),this.name=Hi(i.name,""),this.ext=Hi(i.ext,""),this.dir=Hi(i.dir,""),this.path=Hi(i.path,""),this.protocol=Hi(i.protocol,""),this.params=e;var n={compressed:this.compressed,binary:this.binary,json:om.includes(this.ext),xml:am.includes(this.ext)};"undefined"!=typeof File&&t instanceof File||"undefined"!=typeof Blob&&t instanceof Blob?this.streamer=new Or(t,n):this.streamer=new Dr(t,n),"function"==typeof i.onProgress&&(this.streamer.onprogress=i.onprogress)};sm.prototype.load=function(){return new Promise.reject("not implemented")};var cm=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=tm.get(this.ext),e=new t(this.streamer,this.params);return e.parse()},e}(sm),um=function(t,e,i){this.signals={elementAdded:new Cr,elementRemoved:new Cr,nameChanged:new Cr},this.name=e,this.path=i,this.dir=i.substring(0,i.lastIndexOf("/")+1);try{this.fn=new Function("stage","panel","__name__","__path__","__dir__",t)}catch(t){qp.error("Script compilation failed",t),this.fn=function(){}}},lm={type:{}};lm.type.get=function(){return"Script"},um.prototype.call=function(t){var e=this,i={add:function(){this.signals.elementAdded.dispatch(arguments)}.bind(this),remove:function(){this.signals.elementRemoved.dispatch(arguments)}.bind(this),setName:function(t){this.signals.nameChanged.dispatch(t)}.bind(this)};return new Promise(function(r,n){var o=[t,i,e.name,e.path,e.dir];try{e.fn.apply(null,o),r()}catch(t){qp.error("Script.fn",t),n(t)}})},Object.defineProperties(um.prototype,lm);var hm=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this;return this.streamer.read().then(function(){return new um(t.streamer.asText(),t.name,t.path)})},e}(sm),dm=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t,e=this;return t=this.protocol?this.protocol+"://"+this.dir:this.dir,this.streamer.read().then(function(){var i=JSON.parse(e.streamer.asText()),r=[];return i.files.map(function(e){r.push(kr(t+e,{ext:"text",useWorker:!1}))}),Promise.all(r).then(function(t){var r=t.reduce(function(t,e){return t+"\n\n"+e.data},"");return r+=i.source||"",new um(r,e.name,e.path)})})},e}(sm),fm={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/bcdiefguxX/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};Fr.format=function(t,e){var i,r,n,o,a,s,c,u=1,l=t.length,h="",d=[],f=!0,p="";for(r=0;r<l;r++)if(h=Br(t[r]),"string"===h)d[d.length]=t[r];else if("array"===h){if(o=t[r],o[2])for(i=e[u],n=0;n<o[2].length;n++){if(!i.hasOwnProperty(o[2][n]))throw new Error(Fr('[sprintf] property "%s" does not exist',o[2][n]));i=i[o[2][n]]}else i=o[1]?e[o[1]]:e[u++];if(fm.not_type.test(o[8])&&fm.not_primitive.test(o[8])&&"function"==Br(i)&&(i=i()),fm.numeric_arg.test(o[8])&&"number"!=Br(i)&&isNaN(i))throw new TypeError(Fr("[sprintf] expecting number but found %s",Br(i)));switch(fm.number.test(o[8])&&(f=i>=0),o[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,o[6]?parseInt(o[6]):0);break;case"e":i=o[7]?parseFloat(i).toExponential(o[7]):parseFloat(i).toExponential();break;case"f":i=o[7]?parseFloat(i).toFixed(o[7]):parseFloat(i);break;case"g":i=o[7]?parseFloat(i).toPrecision(o[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=String(i),i=o[7]?i.substring(0,o[7]):i;break;case"t":i=String(!!i),i=o[7]?i.substring(0,o[7]):i;break;case"T":i=Br(i),i=o[7]?i.substring(0,o[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=o[7]?i.substring(0,o[7]):i;break;case"x":i=parseInt(i,10).toString(16);break;case"X":i=parseInt(i,10).toString(16).toUpperCase()}fm.json.test(o[8])?d[d.length]=i:(!fm.number.test(o[8])||f&&!o[3]?p="":(p=f?"+":"-",i=i.toString().replace(fm.sign,"")),s=o[4]?"0"===o[4]?"0":o[4].charAt(1):" ",c=o[6]-(p+i).length,a=o[6]&&c>0?zr(s,c):"",d[d.length]=o[5]?p+i+a:"0"===s?p+a+i:a+p+i)}return d.join("")},Fr.cache={},Fr.parse=function(t){for(var e=t,i=[],r=[],n=0;e;){if(null!==(i=fm.text.exec(e)))r[r.length]=i[0];else if(null!==(i=fm.modulo.exec(e)))r[r.length]="%";else{if(null===(i=fm.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(i[2]){n|=1;var o=[],a=i[2],s=[];if(null===(s=fm.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o[o.length]=s[1];""!==(a=a.substring(s[0].length));)if(null!==(s=fm.key_access.exec(a)))o[o.length]=s[1];else{if(null===(s=fm.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=s[1]}i[2]=o}else n|=2;if(3===n)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r[r.length]=i}e=e.substring(i[0].length)}return r};var pm={0:["","0","00","000","0000","00000","000000","0000000"]," ":[""," ","  ","   ","    ","     ","      ","       "],_:["","_","__","___","____","_____","______","_______"]},mm=function(){this.count=0,this.signals={countChanged:new Cr}};mm.prototype.clear=function(){this.change(-this.count)},mm.prototype.change=function(t){this.count+=t,this.signals.countChanged.dispatch(t,this.count),this.count<0&&qp.warn("Counter.count below zero",this.count)},mm.prototype.increment=function(){this.change(1)},mm.prototype.decrement=function(){this.change(-1)},mm.prototype.listen=function(t){this.change(t.count),t.signals.countChanged.add(this.change,this)},mm.prototype.unlisten=function(t){var e=t.signals.countChanged;e.has(this.change,this)&&e.remove(this.change,this)},mm.prototype.onZeroOnce=function(t,e){if(0===this.count)t.call(e,0,0);else{var i=function(){0===this.count&&(this.signals.countChanged.remove(i,this),t.apply(e,arguments))};this.signals.countChanged.add(i,this)}},mm.prototype.dispose=function(){this.clear(),this.signals.countChanged.dispose()};var gm=function(t){this.name=t||"",this.nextGid=1,this.objectList=[],this.rangeList=[]};gm.prototype.getBaseObject=function(t){return"StructureView"===t.type&&(t=t.getStructure()),t},gm.prototype.addObject=function(t){t=this.getBaseObject(t);var e=this.allocateGidRange(t);return e&&(this.objectList.push(t),this.rangeList.push(e)),this},gm.prototype.removeObject=function(t){t=this.getBaseObject(t);var e=this.objectList.indexOf(t);return e!==-1&&(this.objectList.splice(e,1),this.rangeList.splice(e,1),0===this.objectList.length&&(this.nextGid=1)),this},gm.prototype.updateObject=function(t,e){t=this.getBaseObject(t);var i=this.objectList.indexOf(t);if(i!==-1){var r=this.rangeList[i];if(r[1]===this.nextGid){var n=this.getGidCount(t);this.nextGid+=n-(r[1]-r[0]),r[1]=this.nextGid}else this.rangeList[i]=this.allocateGidRange(t)}else e||qp.warn("GidPool.updateObject: object not found.");return this},gm.prototype.getGidCount=function(t){t=this.getBaseObject(t);var e=0;return"Structure"===t.type?e=t.atomStore.count+t.bondStore.count+t.backboneBondStore.count+t.rungBondStore.count:"Volume"===t.type?e=t.__data.length:qp.warn("GidPool.getGidCount: unknown object type"),e},gm.prototype.allocateGidRange=function(t){t=this.getBaseObject(t);var e=this.getGidCount(t);if(e>Math.pow(10,7))return qp.warn("GidPool.allocateGidRange: gidCount too large"),null;var i=this.nextGid;return this.nextGid+=e,this.nextGid>Math.pow(2,24)&&qp.error("GidPool.allocateGidRange: GidPool overflown"),[i,this.nextGid]},gm.prototype.getNextGid=function(){return this.nextGid++},gm.prototype.getGid=function(t,e){t=this.getBaseObject(t),e=e||0;var i=0,r=this.objectList.indexOf(t);if(r!==-1){var n=this.rangeList[r],o=n[0];i=o+e}else qp.warn("GidPool.getGid: object not found.");return i},gm.prototype.getByGid=function(t){var e;return this.objectList.forEach(function(i,r){var n=this.rangeList[r];if(!(t<n[0]||t>=n[1])){var o=t-n[0];"Structure"===i.type?o<i.atomStore.count?e=i.getAtomProxy(o):o<i.atomStore.count+i.bondStore.count?(o-=i.atomStore.count,e=i.getBondProxy(o)):o<i.atomStore.count+i.bondStore.count+i.backboneBondStore.count?(o-=i.atomStore.count+i.bondStore.count,e=i.getBondProxy(o),e.bondStore=i.backboneBondStore):o<i.atomStore.count+i.bondStore.count+i.backboneBondStore.count+i.rungBondStore.count?(o-=i.atomStore.count+i.bondStore.count+i.backboneBondStore.count,e=i.getBondProxy(o),e.bondStore=i.rungBondStore):qp.warn("GidPool.getByGid: invalid Structure gid",t):"Volume"===i.type?e={volume:i,index:o,value:i.data[o],x:i.dataPosition[3*o],y:i.dataPosition[3*o+1],z:i.dataPosition[3*o+2]}:qp.warn("GidPool.getByGid: unknown object type for gid",t)}},this),e},em.add("shader/BasicLine.vert","void main(){\n#include begin_vertex\n#include project_vertex\n}"),em.add("shader/BasicLine.frag","uniform vec3 uColor;\n#include common\n#include fog_pars_fragment\nvoid main(){\ngl_FragColor = vec4( uColor, 1.0 );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n}"),em.add("shader/Quad.vert","varying vec2 vUv;\nvoid main() {\nvUv = uv;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"),em.add("shader/Quad.frag","varying vec2 vUv;\nuniform sampler2D tForeground;\nuniform float scale;\nvoid main() {\nvec4 foreground = texture2D( tForeground, vUv );\ngl_FragColor = foreground * scale;\n}"),jr.prototype={update:function(){this.startTime=this.end(),this.currentTime=this.startTime,this.signals.updated.dispatch()},begin:function(){this.startTime=performance.now(),this.lastFrames=this.frames},end:function(){var t=performance.now();return this.count+=1,this.frames+=1,this.lastDuration=t-this.startTime,this.minDuration=Math.min(this.minDuration,this.lastDuration),this.maxDuration=Math.max(this.maxDuration,this.lastDuration),this.avgDuration-=this.avgDuration/30,this.avgDuration+=this.lastDuration/30,t>this.prevFpsTime+1e3&&(this.lastFps=this.frames,this.prevFpsTime=t,this.frames=0),t}},em.add("shader/chunk/dull_interior_fragment.glsl","#ifdef DULL_INTERIOR\nif( gl_FrontFacing == false ){\nnormal = vec3( 0.0, 0.0, 0.4 );\n}\n#endif"),em.add("shader/chunk/fog_fragment.glsl","#ifdef USE_FOG\nfloat depth = length( vViewPosition );\n#ifdef FOG_EXP2\nfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n#else\nfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n#endif\ngl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif"),em.add("shader/chunk/nearclip_vertex.glsl","#ifdef NEAR_CLIP\nif( vViewPosition.z < nearClip - 5.0 )\ngl_Position.z = 2.0 * gl_Position.w;\n#endif"),em.add("shader/chunk/nearclip_fragment.glsl","#ifdef NEAR_CLIP\nif( vViewPosition.z < nearClip )\ndiscard;\n#endif"),em.add("shader/chunk/radiusclip_vertex.glsl","#ifdef RADIUS_CLIP\nif( distance( vViewPosition, vClipCenter ) > clipRadius + 5.0 )\ngl_Position.z = 2.0 * gl_Position.w;\n#endif"),em.add("shader/chunk/radiusclip_fragment.glsl","#ifdef RADIUS_CLIP\nif( distance( vViewPosition, vClipCenter ) > clipRadius )\ndiscard;\n#endif"),em.add("shader/chunk/opaque_back_fragment.glsl","#ifdef OPAQUE_BACK\n#ifdef FLIP_SIDED\nif( gl_FrontFacing == true ){\ngl_FragColor.a = 1.0;\n}\n#else\nif( gl_FrontFacing == false ){\ngl_FragColor.a = 1.0;\n}\n#endif\n#endif");var vm=/^(?!\/\/)\s*#include\s+(\S+)/gim,ym={};if("undefined"!=typeof WebGLRenderingContext&&WebGLRenderingContext){var bm=WebGLRenderingContext.prototype,xm=bm.getShaderParameter;bm.getShaderParameter=function(){return!t.Debug||xm.apply(this,arguments)};var _m=bm.getShaderInfoLog;bm.getShaderInfoLog=function(){return t.Debug?_m.apply(this,arguments):""};var wm=bm.getProgramParameter;bm.getProgramParameter=function(e,i){return!t.Debug&&i===bm.LINK_STATUS||wm.apply(this,arguments)};var Sm=bm.getProgramInfoLog;bm.getProgramInfoLog=function(){return t.Debug?Sm.apply(this,arguments):""}}var Am=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];Am.forEach(function(t){t.forEach(function(t){t[0]*=.0625,t[1]*=.0625})}),Gr.prototype.constructor=Gr;var Mm=2*Math.PI,Pm=(new Float32Array(4),new Float32Array(4),new g),Cm=new p,Tm=new p,Em=new p,Im=new p,Lm=new Float32Array(4),Rm=new Uint8Array(4);on.prototype.constructor=on;var Om=function(t,e){this.signals={moved:new Cr,scrolled:new Cr,dragged:new Cr,dropped:new Cr,clicked:new Cr,hovered:new Cr};var i=Object.assign({},e);this.hoverTimeout=Hi(i.hoverTimeout,50),this.domElement=t,this.position=new h,this.prevPosition=new h,this.down=new h,this.canvasPosition=new h,this.moving=!1,this.hovering=!0,this.scrolled=!1,this.lastMoved=1/0,this.which=void 0,this.pressed=void 0,this.altKey=void 0,this.ctrlKey=void 0,this.metaKey=void 0,this.shiftKey=void 0,this.listen=this.listen.bind(this),this.onMousewheel=this.onMousewheel.bind(this),this.onMousemove=this.onMousemove.bind(this),this.onMousedown=this.onMousedown.bind(this),this.onMouseup=this.onMouseup.bind(this),this.listen(),t.addEventListener("mousewheel",this.onMousewheel),t.addEventListener("wheel",this.onMousewheel),t.addEventListener("MozMousePixelScroll",this.onMousewheel),t.addEventListener("mousemove",this.onMousemove),t.addEventListener("mousedown",this.onMousedown),t.addEventListener("mouseup",this.onMouseup),t.addEventListener("contextmenu",this.onContextmenu)};Om.prototype.setParameters=function(t){var e=Object.assign({},t);this.hoverTimeout=Hi(e.hoverTimeout,this.hoverTimeout)},Om.prototype.listen=function(){performance.now()-this.lastMoved>this.hoverTimeout&&(this.moving=!1),(this.scrolled||!this.moving&&!this.hovering)&&(this.scrolled=!1,this.hoverTimeout!==-1&&(this.hovering=!0,this.signals.hovered.dispatch())),requestAnimationFrame(this.listen)},Om.prototype.onMousewheel=function(t){var e=this;t.preventDefault();var i=0;i=t.wheelDelta?t.wheelDelta/40:t.detail?-t.detail/3:-t.deltaY/(t.deltaMode?.33:30),this.signals.scrolled.dispatch(i),setTimeout(function(){e.scrolled=!0},this.hoverTimeout)},Om.prototype.onMousemove=function(t){t.preventDefault(),this.setKeys(t),this.moving=!0,this.hovering=!1,this.lastMoved=performance.now(),this.prevPosition.copy(this.position),this.position.set(t.layerX,t.layerY),this.setCanvasPosition(t);var e=this.prevPosition.x-this.position.x,i=this.prevPosition.y-this.position.y;this.signals.moved.dispatch(e,i),this.pressed&&this.signals.dragged.dispatch(e,i)},Om.prototype.onMousedown=function(t){t.preventDefault(),this.setKeys(t),this.moving=!1,this.hovering=!1,this.down.set(t.layerX,t.layerY),this.which=t.which,this.pressed=!0,this.setCanvasPosition(t)},Om.prototype.onMouseup=function(t){t.preventDefault(),this.setKeys(t),this.signals.clicked.dispatch(),this.which=void 0,this.pressed=void 0},Om.prototype.onContextmenu=function(t){t.preventDefault()},Om.prototype.distance=function(){return this.position.distanceTo(this.down)},Om.prototype.setCanvasPosition=function(t){var e=this.domElement.getBoundingClientRect(),i=t.clientX-e.left,r=t.clientY-e.top;this.canvasPosition.set(i,e.height-r)},Om.prototype.setKeys=function(t){this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.metaKey=t.metaKey,this.shiftKey=t.shiftKey},Om.prototype.dispose=function(){var t=this.domElement;t.removeEventListener("mousewheel",this.onMousewheel),t.removeEventListener("wheel",this.onMousewheel),t.removeEventListener("MozMousePixelScroll",this.onMousewheel),t.removeEventListener("mousemove",this.onMousemove),t.removeEventListener("mousedown",this.onMousedown),t.removeEventListener("mouseup",this.onMouseup),t.removeEventListener("contextmenu",this.onContextmenu)};var Dm=new p,Nm=new p,km=new p,Fm=new g,Bm=function(t,e){var i=e||{};this.rotateSpeed=Hi(i.rotateSpeed,2),this.zoomSpeed=Hi(i.zoomSpeed,1.2),this.panSpeed=Hi(i.panSpeed,1),this.viewer=t.viewer,this.viewerControls=t.viewerControls};Bm.prototype.zoom=function(t){this.viewerControls.zoom(this.zoomSpeed*t*.02)},Bm.prototype.pan=function(t,e){var i,r=this.viewer.camera;if("OrthographicCamera"===r.type)i=1/r.zoom;else{var n=mr(r.fov),o=-2*r.position.z*Math.tan(n/2);i=o/this.viewer.height}Fm.set(t,e,0),Fm.multiplyScalar(this.panSpeed*i),km.getInverse(this.viewer.rotationGroup.matrix),Fm.applyMatrix4(km),this.viewerControls.translate(Fm)},Bm.prototype.rotate=function(t,e){Dm.makeRotationX(this.rotateSpeed*e*.01),Nm.makeRotationY(this.rotateSpeed*-t*.01),Dm.multiply(Nm),this.viewerControls.applyMatrix(Dm)};var zm=new g,Um=new h,jm=function(t){this.stage=t,this.viewer=t.viewer,this.gidPool=t.gidPool,this.mouseObserver=t.mouseObserver};jm.prototype.pick=function(t,e){var i,r,n,o=this.mouseObserver,a=this.viewer.pick(t,e),s=a.instance,c=this.gidPool.getByGid(a.gid);c&&"AtomProxy"===c.type?i=c:c&&"BondProxy"===c.type?r=c:c&&"Volume"===c.volume.type&&(n=c);var u,l;return(i||r||n)&&(i?(zm.copy(i),u=i.structure):r?(zm.copy(r.atom1).add(r.atom2).multiplyScalar(.5),u=r.structure):n&&(zm.copy(n),u=n.volume),s&&zm.applyProjection(s.matrix),u&&(l=this.stage.getComponentsByObject(u).list[0])),Um.copy(o.canvasPosition),{atom:i,bond:r,volume:n,instance:s,position:zm,component:l,canvasPosition:Um,altKey:o.altKey,ctrlKey:o.ctrlKey,metaKey:o.metaKey,shiftKey:o.shiftKey}};var $m=new m,Vm=new g,Gm=new g,Hm=new g,Wm=new p,Xm=new g,qm=new p,Ym=function(t){this.stage=t,this.viewer=t.viewer,this.signals={changed:new Cr}},Zm={position:{},rotation:{}};Zm.position.get=function(){return this.viewer.translationGroup.position},Zm.rotation.get=function(){return this.viewer.rotationGroup.quaternion},Ym.prototype.changed=function(){this.viewer.requestRender(),this.signals.changed.dispatch()},Ym.prototype.getOrientation=function(t){var e=t||new p;e.copy(this.viewer.rotationGroup.matrix);var i=-this.viewer.camera.position.z;return e.scale(Hm.set(i,i,i)),e.setPosition(this.viewer.translationGroup.position),e},Ym.prototype.orient=function(t){cr(t).decompose(Vm,$m,Gm),this.viewer.rotationGroup.setRotationFromQuaternion($m),this.viewer.translationGroup.position.copy(Vm),this.viewer.camera.position.z=-Gm.z,this.viewer.updateZoom(),this.changed()},Ym.prototype.translate=function(t){this.viewer.translationGroup.position.add(sr(t)),this.changed()},Ym.prototype.center=function(t){this.viewer.translationGroup.position.copy(sr(t)).negate(),this.changed()},Ym.prototype.zoom=function(t){this.distance(this.viewer.camera.position.z*(1-t))},Ym.prototype.distance=function(t){this.viewer.camera.position.z=t,this.viewer.updateZoom(),this.changed()},Ym.prototype.spin=function(t,e){Wm.getInverse(this.viewer.rotationGroup.matrix),Xm.copy(sr(t)).applyMatrix4(Wm),this.viewer.rotationGroup.rotateOnAxis(Xm,e),this.changed()},Ym.prototype.rotate=function(t){this.viewer.rotationGroup.setRotationFromQuaternion(ur(t)),this.changed()},Ym.prototype.align=function(t){qm.getInverse(cr(t)),this.viewer.rotationGroup.setRotationFromMatrix(qm),this.changed()},Ym.prototype.applyMatrix=function(t){this.viewer.rotationGroup.applyMatrix(cr(t)),this.changed()},Object.defineProperties(Ym.prototype,Zm);var Km=function(t,e){for(var i=[],r=arguments.length-2;r-- >0;)i[r]=arguments[r+2];this.duration=Hi(t,1e3),this.controls=e,this.startTime=performance.now(),this.elapsedTime=0,(n=this)._init.apply(n,i);var n};Km.prototype._init=function(){},Km.prototype._tick=function(){},Km.prototype.tick=function(t){return this.elapsedTime=t.currentTime-this.startTime,this.alpha=Ar(0,1,this.elapsedTime/this.duration),this._tick(t),1===this.alpha};var Qm=function(t){function e(e){for(var i=[],r=arguments.length-1;r-- >0;)i[r]=arguments[r+1];t.apply(this,[Hi(e,1/0)].concat(i))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e){Array.isArray(t)?this.axis=(new g).fromArray(t):this.axis=Hi(t,new g(0,1,0)),this.angle=Hi(e,.01)},e.prototype._tick=function(t){this.axis&&this.angle&&this.controls.spin(this.axis,this.angle*t.lastDuration/16)},e}(Km),Jm=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e){this.moveFrom=sr(Hi(t,new g)),this.moveTo=sr(Hi(e,new g))},e.prototype._tick=function(){this.controls.position.lerpVectors(this.moveFrom,this.moveTo,this.alpha).negate(),this.controls.changed()},e}(Km),tg=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e){this.zoomFrom=t,this.zoomTo=e},e.prototype._tick=function(){this.controls.distance(wr(this.zoomFrom,this.zoomTo,this.alpha))},e}(Km),eg=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._init=function(t,e){this.rotateFrom=ur(t),this.rotateTo=ur(e),this._currentRotation=new m},e.prototype._tick=function(){this._currentRotation.copy(this.rotateFrom).slerp(this.rotateTo,this.alpha),this.controls.rotate(this._currentRotation)},e}(Km),ig=function(t){this.stage=t,this.viewer=t.viewer,this.controls=t.viewerControls,this.animationList=[],this.finishedList=[]};ig.prototype.add=function(t){return this.animationList.push(t),t},ig.prototype.remove=function(t){var e=this.animationList,i=e.indexOf(t);i>-1&&e.splice(i,1)},ig.prototype.run=function(t){for(var e=this,i=this.finishedList,r=this.animationList,n=r.length,o=0;o<n;++o){var a=r[o];a.tick(t)&&i.push(a)}var s=i.length;if(s){for(var c=0;c<s;++c)e.remove(i[c]);i.length=0}},ig.prototype.spin=function(t,e,i){return this.add(new Qm(i,this.controls,t,e))},ig.prototype.rotate=function(t,e){var i=this.viewer.rotationGroup.quaternion.clone();return this.add(new eg(e,this.controls,i,t))},ig.prototype.move=function(t,e){var i=this.controls.position.clone().negate();return this.add(new Jm(e,this.controls,i,t))},ig.prototype.zoom=function(t,e){var i=this.viewer.camera.position.z;return this.add(new tg(e,this.controls,i,t))},ig.prototype.zoomMove=function(t,e,i){return[this.move(t,i),this.zoom(e,i)]},ig.prototype.clear=function(){this.animationList.length=0},ig.prototype.dispose=function(){this.clear()};var rg=2,ng=3,og=function(t){this.stage=t,this.mouse=t.mouseObserver,this.mouse.signals.clicked.add(this.onClick,this),this.mouse.signals.hovered.add(this.onHover,this)};og.prototype.pick=function(){return this.stage.pickingControls.pick(this.mouse.canvasPosition.x,this.mouse.canvasPosition.y)},og.prototype.onClick=function(){var e=this.pick();e.position&&this.mouse.which===rg&&this.stage.animationControls.move(e.position.clone()),this.stage.signals.clicked.dispatch(e),t.Debug&&qp.log("clicked",e)},og.prototype.onHover=function(){this.stage.signals.hovered.dispatch(this.pick())},og.prototype.dispose=function(){this.mouse.signals.clicked.remove(this.onClick,this),this.mouse.signals.hovered.remove(this.onHover,this)};var ag=function(t){this.mouse=t.mouseObserver,this.controls=t.trackballControls,this.mouse.signals.scrolled.add(this.onScroll,this),this.mouse.signals.dragged.add(this.onDrag,this)};ag.prototype.onScroll=function(t){this.controls.zoom(t)},ag.prototype.onDrag=function(t,e){this.mouse.which===ng?this.controls.pan(t,e):this.controls.rotate(t,e)},ag.prototype.dispose=function(){this.mouse.signals.scrolled.remove(this.onScroll,this),this.mouse.signals.dragged.remove(this.onDrag,this)};var sg=function(t){this.viewer=t.viewer,this.animationControls=t.animationControls,this.viewer.signals.ticked.add(this.onTick,this)};sg.prototype.onTick=function(t){this.animationControls.run(t)},sg.prototype.dispose=function(){this.viewer.signals.ticked.remove(this.onTick,this)},an.prototype.add=function(t){this.count<<5<=t&&this.resize(t),this.words[t>>>5]|=1<<t},an.prototype.add_unsafe=function(t){this.words[t>>>5]|=1<<t},an.prototype.flip=function(t){this.count<<5<=t&&this.resize(t),this.words[t>>>5]^=1<<t},an.prototype.flip_unsafe=function(t){this.words[t>>>5]^=1<<t},an.prototype.flip_all=function(){for(var t=this,e=this.count,i=0,r=32-this.length%32;i+7<e;i+=8)t.words[i]=~t.words[i],t.words[i+1]=~t.words[i+1],t.words[i+2]=~t.words[i+2],t.words[i+3]=~t.words[i+3],t.words[i+4]=~t.words[i+4],t.words[i+5]=~t.words[i+5],t.words[i+6]=~t.words[i+6],t.words[i+7]=~t.words[i+7];for(;i<e-1;++i)t.words[i]=~t.words[i];return this.words[e-1]=~(this.words[e-1]<<r)>>>r,this},an.prototype.set_all=function(t){return this.length<=0?this:(this.set_range(0,this.length-1,t),this)},an.prototype.set_range=function(t,e,i){var r=this;i=i?4294967295:0;for(var n=(t>>>5)+1,o=(e>>>5)-1,a=0|n;a+7<o;a+=8)r.words[a]=i,r.words[a+1]=i,r.words[a+2]=i,r.words[a+3]=i,r.words[a+4]=i,r.words[a+5]=i,r.words[a+6]=i,r.words[a+7]=i;for(;a<o;++a)r.words[a]=i;
	var s,c;if(i){for(s=t,c=(n<<5)+1;s<c;++s)r.words[s>>>5]|=1<<s;for(s=o<<5,c=e+1;s<c;++s)r.words[s>>>5]|=1<<s}else{for(s=t,c=(n<<5)+1;s<c;++s)r.words[s>>>5]&=~(1<<s);for(s=o<<5,c=e+1;s<c;++s)r.words[s>>>5]&=~(1<<s)}return this},an.prototype.clear=function(){return this.count=0,this.length=0,this.words=new Uint32Array(this.count),this},an.prototype.remove=function(t){this.count<<5<=t&&this.resize(t),this.words[t>>>5]&=~(1<<t)},an.prototype.remove_unsafe=function(t){this.words[t>>>5]&=~(1<<t)},an.prototype.isEmpty=function(){for(var t=this,e=this.count,i=0;i<e;i++)if(0!==t.words[i])return!1;return!0},an.prototype.has=function(t){return 0!==(this.words[t>>>5]&1<<t)},an.prototype.trim=function(){for(var t=this;this.count>0;)0===t.words[t.count-1]&&t.count--;this.words=this.words.slice(0,this.count)},an.prototype.resize=function(t){if(this.length=t,!(this.count<<5>t)&&(this.count=t+32>>>5,this.words.length<<5<=t)){var e=new Uint32Array(this.count<<1);e.set(this.words),this.words=e}},an.prototype.hammingWeight=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},an.prototype.size=function(){for(var t=this,e=0,i=this.count,r=0;r<i;r++)e+=t.hammingWeight(0|t.words[r]);return Math.min(e,this.length)},an.prototype.sizeRange=function(t,e){var i=0,r=t+e;return this.forEach(function(e){e>=t&&e<r&&++i}),i},an.prototype.array=function(){for(var t=this,e=new Array(this.size()),i=0,r=0|this.count,n=0;n<r;++n)for(var o=t.words[n];0!==o;){var a=o&-o;e[i++]=(n<<5)+t.hammingWeight(a-1|0),o^=a}return e},an.prototype.forEach=function(t){for(var e=this,i=0|this.count,r=0,n=0;n<i;++n)for(var o=e.words[n];0!==o;){var a=o&-o,s=(n<<5)+e.hammingWeight(a-1|0);s<e.length&&t(s,r),o^=a,r+=1}},an.forEach=function(t,e,i){for(var r=0|Math.min(e.count,i.count),n=0;n<r;++n)for(var o=e.words[n],a=i.words[n];0!==o&&0!==a;){var s=o&-o,c=a&-a,u=n<<5;t(u+e.hammingWeight(s-1|0),u+i.hammingWeight(c-1|0)),o^=s,a^=c}},an.prototype.clone=function(){var t=Object.create(an.prototype);return t.count=this.count,t.length=this.length,t.words=new Uint32Array(this.words),t},an.prototype.intersects=function(t){for(var e=this,i=Math.min(this.count,t.count),r=0;r<i;++r)if(0!==(e.words[r]&t.words[r]))return!0;return!1},an.prototype.intersection=function(t){for(var e=this,i=Math.min(this.count,t.count),r=0;r+7<i;r+=8)e.words[r]&=t.words[r],e.words[r+1]&=t.words[r+1],e.words[r+2]&=t.words[r+2],e.words[r+3]&=t.words[r+3],e.words[r+4]&=t.words[r+4],e.words[r+5]&=t.words[r+5],e.words[r+6]&=t.words[r+6],e.words[r+7]&=t.words[r+7];for(;r<i;++r)e.words[r]&=t.words[r];var n=this.count;for(r=i;r<n;++r)e.words[r]=0;return this.count=i,this},an.prototype.intersection_size=function(t){for(var e=this,i=Math.min(this.count,t.count),r=0,n=0;n<i;++n)r+=e.hammingWeight(e.words[n]&t.words[n]);return r},an.prototype.new_intersection=function(t){var e=this,i=Object.create(an.prototype);i.count=Math.min(this.count,t.count),i.words=new Uint32Array(i.count),i.length=Math.min(this.length,t.length);for(var r=i.count,n=0;n<r;++n)i.words[n]=e.words[n]&t.words[n];return i},an.prototype.equals=function(t){var e,i,r=this,n=Math.min(this.count,t.count);for(e=0;e<n;++e)if(r.words[e]!=t.words[e])return!1;if(this.count<t.count){for(i=t.count,e=this.count;e<i;++e)if(0!==t.words[e])return!1}else if(t.count<this.count)for(i=this.count,e=t.count;e<i;++e)if(0!==r.words[e])return!1;return!0},an.prototype.difference=function(t){for(var e=this,i=Math.min(this.count,t.count),r=0;r+7<i;r+=8)e.words[r]&=~t.words[r],e.words[r+1]&=~t.words[r+1],e.words[r+2]&=~t.words[r+2],e.words[r+3]&=~t.words[r+3],e.words[r+4]&=~t.words[r+4],e.words[r+5]&=~t.words[r+5],e.words[r+6]&=~t.words[r+6],e.words[r+7]&=~t.words[r+7];for(;r<i;++r)e.words[r]&=~t.words[r];return this},an.prototype.difference_size=function(t){for(var e=this,i=Math.min(this.count,t.count),r=0,n=0;n<i;++n)r+=e.hammingWeight(e.words[n]&~t.words[n]);for(var o=this.count;n<o;++n)r+=e.hammingWeight(e.words[n]);return r},an.prototype.toString=function(){return"{"+this.array().join(",")+"}"},an.prototype.union=function(t){for(var e=this,i=Math.min(this.count,t.count),r=0;r+7<i;r+=8)e.words[r]|=t.words[r],e.words[r+1]|=t.words[r+1],e.words[r+2]|=t.words[r+2],e.words[r+3]|=t.words[r+3],e.words[r+4]|=t.words[r+4],e.words[r+5]|=t.words[r+5],e.words[r+6]|=t.words[r+6],e.words[r+7]|=t.words[r+7];for(;r<i;++r)e.words[r]|=t.words[r];if(this.count<t.count){this.resize((t.count<<5)-1);var n=t.count;for(r=i;r<n;++r)e.words[r]=t.words[r];this.count=t.count}return this},an.prototype.new_union=function(t){var e=this,i=Object.create(an.prototype);i.count=Math.max(this.count,t.count),i.words=new Uint32Array(i.count);var r,n=Math.min(this.count,t.count);for(r=0;r<n;++r)i.words[r]=e.words[r]|t.words[r];var o=this.count;for(r=n;r<o;++r)i.words[r]=e.words[r];var a=t.count;for(r=n;r<a;++r)i.words[r]=t.words[r];return i},an.prototype.new_difference=function(t){return this.clone().difference(t)},an.prototype.union_size=function(t){var e,i,r=this,n=Math.min(this.count,t.count),o=0;for(e=0;e<n;++e)o+=r.hammingWeight(r.words[e]|t.words[e]);if(this.count<t.count)for(i=t.count,e=this.count;e<i;++e)o+=r.hammingWeight(0|t.words[e]);else for(i=this.count,e=t.count;e<i;++e)o+=r.hammingWeight(0|r.words[e]);return o},an.prototype.getTransferable=function(){return[this.words]},an.prototype.toJSON=function(){return{count:this.count,length:this.length,words:this.words}},an.prototype.fromJSON=function(t){return this.count=t.count,this.length=t.length,this.words=t.words,this},an.prototype.toSeleString=function(){var t=this.array().join(",");return t?"@"+t:"NONE"},an.prototype.type="Bitset";var cg=an,ug=0,lg=1,hg=2,dg=3,fg=4,pg=0,mg=1,gg=2,vg=3,yg=4,bg=5,xg=6,_g=0,wg=1,Sg=2,Ag=3,Mg=4,Pg=5,Cg=6,Tg=["D-BETA-PEPTIDE, C-GAMMA LINKING","D-GAMMA-PEPTIDE, C-DELTA LINKING","D-PEPTIDE COOH CARBOXY TERMINUS","D-PEPTIDE NH3 AMINO TERMINUS","D-PEPTIDE LINKING","L-BETA-PEPTIDE, C-GAMMA LINKING","L-GAMMA-PEPTIDE, C-DELTA LINKING","L-PEPTIDE COOH CARBOXY TERMINUS","L-PEPTIDE NH3 AMINO TERMINUS","L-PEPTIDE LINKING","PEPTIDE LINKING","PEPTIDE-LIKE"],Eg=["RNA OH 3 PRIME TERMINUS","RNA OH 5 PRIME TERMINUS","RNA LINKING"],Ig=["DNA OH 3 PRIME TERMINUS","DNA OH 5 PRIME TERMINUS","DNA LINKING","L-DNA LINKING","L-RNA LINKING"],Lg=["D-SACCHARIDE","D-SACCHARIDE 1,4 AND 1,4 LINKING","D-SACCHARIDE 1,4 AND 1,6 LINKING","L-SACCHARIDE","L-SACCHARIDE 1,4 AND 1,4 LINKING","L-SACCHARIDE 1,4 AND 1,6 LINKING","SACCHARIDE"],Rg=["OTHER"],Og=["NON-POLYMER"],Dg=Og.concat(Rg,Lg),Ng={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.3,TI:2.15,V:2.05,CR:2.05,MN:2.05,FE:2.05,CO:2,NI:2,CU:2,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.4,ZR:2.3,NB:2.15,MO:2.1,TC:2.05,RU:2.05,RH:2,PD:2.05,AG:2.1,CD:2.2,IN:2.2,SN:1.93,SB:2.17,TE:2.06,I:1.98,XE:2.16,CS:3.43,BA:2.68,LA:2.5,CE:2.48,PR:2.47,ND:2.45,PM:2.43,SM:2.42,EU:2.4,GD:2.38,TB:2.37,DY:2.35,HO:2.33,ER:2.32,TM:2.3,YB:2.28,LU:2.27,HF:2.25,TA:2.2,W:2.1,RE:2.05,OS:2,IR:2,PT:2.05,AU:2.1,HG:2.05,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,TH:2.4,PA:2,U:2.3,NP:2,PU:2,AM:2,CM:2,BK:2,CF:2,ES:2,FM:2,MD:2,NO:2,LR:2,RF:2,DB:2,SG:2,BH:2,HS:2,MT:2,DS:2,RG:2,CN:2,UUT:2,FL:2,UUP:2,LV:2,UUH:2},kg=2,Fg={H:.31,HE:.28,LI:1.28,BE:.96,B:.84,C:.76,N:.71,O:.66,F:.57,NE:.58,NA:1.66,MG:1.41,AL:1.21,SI:1.11,P:1.07,S:1.05,CL:1.02,AR:1.06,K:2.03,CA:1.76,SC:1.7,TI:1.6,V:1.53,CR:1.39,MN:1.39,FE:1.32,CO:1.26,NI:1.24,CU:1.32,ZN:1.22,GA:1.22,GE:1.2,AS:1.19,SE:1.2,BR:1.2,KR:1.16,RB:2.2,SR:1.95,Y:1.9,ZR:1.75,NB:1.64,MO:1.54,TC:1.47,RU:1.46,RH:1.42,PD:1.39,AG:1.45,CD:1.44,IN:1.42,SN:1.39,SB:1.39,TE:1.38,I:1.39,XE:1.4,CS:2.44,BA:2.15,LA:2.07,CE:2.04,PR:2.03,ND:2.01,PM:1.99,SM:1.98,EU:1.98,GD:1.96,TB:1.94,DY:1.92,HO:1.92,ER:1.89,TM:1.9,YB:1.87,LU:1.87,HF:1.75,TA:1.7,W:1.62,RE:1.51,OS:1.44,IR:1.41,PT:1.36,AU:1.36,HG:1.32,TL:1.45,PB:1.46,BI:1.48,PO:1.4,AT:1.5,RN:1.5,FR:2.6,RA:2.21,AC:2.15,TH:2.06,PA:2,U:1.96,NP:1.9,PU:1.87,AM:1.8,CM:1.69,BK:1.6,CF:1.6,ES:1.6,FM:1.6,MD:1.6,NO:1.6,LR:1.6,RF:1.6,DB:1.6,SG:1.6,BH:1.6,HS:1.6,MT:1.6,DS:1.6,RG:1.6,CN:1.6,UUT:1.6,FL:1.6,UUP:1.6,LV:1.6,UUH:1.6},Bg=1.6,zg={ALA:[.17,.5,.33],ARG:[.81,1.81,1],ASN:[.42,.85,.43],ASP:[1.23,3.64,2.41],ASH:[-.07,.43,.5],CYS:[-.24,-.02,.22],GLN:[.58,.77,.19],GLU:[2.02,3.63,1.61],GLH:[-.01,.11,.12],GLY:[.01,1.15,1.14],HIS:[.17,.11,-.06],ILE:[-.31,-1.12,-.81],LEU:[-.56,-1.25,-.69],LYS:[.99,2.8,1.81],MET:[-.23,-.67,-.44],PHE:[-1.13,-1.71,-.58],PRO:[.45,.14,-.31],SER:[.13,.46,.33],THR:[.14,.25,.11],TRP:[-1.85,-2.09,-.24],TYR:[-.94,-.71,.23],VAL:[.07,-.46,-.53]},Ug=[0,0,0],jg={HIS:"H",ARG:"R",LYS:"K",ILE:"I",PHE:"F",LEU:"L",TRP:"W",ALA:"A",MET:"M",PRO:"P",CYS:"C",ASN:"N",VAL:"V",GLY:"G",SER:"S",GLN:"Q",TYR:"Y",ASP:"D",GLU:"E",THR:"T",ASH:"D",GLH:"E",UNK:""},$g=Object.keys(jg),Vg=["A","C","T","G","U"],Gg=["DA","DC","DT","DG","DU","TCY","MCY","5CM"],Hg=["A","G","DA","DG"],Wg=["SOL","WAT","HOH","H2O","W","DOD","D3O","TIP3","TIP4"],Xg=["118","119","1AL","1CU","2FK","2HP","2OF","3CO","3MT","3NI","3OF","3P8","4MO","4PU","543","6MO","ACT","AG","AL","ALF","AM","ATH","AU","AU3","AUC","AZI","BA","BCT","BEF","BF4","BO4","BR","BS3","BSY","CA","CAC","CD","CD1","CD3","CD5","CE","CHT","CL","CO","CO3","CO5","CON","CR","CS","CSB","CU","CU1","CU3","CUA","CUZ","CYN","DME","DMI","DSC","DTI","DY","E4N","EDR","EMC","ER3","EU","EU3","F","FE","FE2","FPO","GA","GD3","GEP","HAI","HG","HGC","IN","IOD","IR","IR3","IRI","IUM","K","KO4","LA","LCO","LCP","LI","LU","MAC","MG","MH2","MH3","MLI","MLT","MMC","MN","MN3","MN5","MN6","MO1","MO2","MO3","MO4","MO5","MO6","MOO","MOS","MOW","MW1","MW2","MW3","NA","NA2","NA5","NA6","NAO","NAW","NCO","NET","NH4","NI","NI1","NI2","NI3","NO2","NO3","NRU","O4M","OAA","OC1","OC2","OC3","OC4","OC5","OC6","OC7","OC8","OCL","OCM","OCN","OCO","OF1","OF2","OF3","OH","OS","OS4","OXL","PB","PBM","PD","PDV","PER","PI","PO3","PO4","PR","PT","PT4","PTN","RB","RH3","RHD","RU","SB","SCN","SE4","SEK","SM","SMO","SO3","SO4","SR","T1A","TB","TBA","TCN","TEA","TH","THE","TL","TMA","TRA","UNX","V","VN3","VO4","W","WO5","Y1","YB","YB2","YH","YT3","ZCM","ZN","ZN2","ZN3","ZNO","ZO3","OHX"],qg=["045","0AT","0BD","0MK","0NZ","0TS","0V4","0XY","0YT","10M","147","149","14T","15L","16G","18T","18Y","1AR","1BW","1GL","1GN","1JB","1LL","1NA","1S3","26M","26Q","26R","26V","26W","26Y","27C","289","291","293","2DG","2F8","2FG","2FL","2FP","2GL","2M4","2M5","32O","34V","3CM","3DO","3DY","3FM","3LR","3MF","3MG","3SA","3ZW","46D","46M","46Z","48Z","4CQ","4GC","4NN","50A","5DI","5GF","5MM","5RP","5SA","5SP","64K","6PG","6SA","7JZ","7SA","A1Q","A2G","AAB","AAL","AAO","ABC","ABD","ABE","ABF","ABL","ACG","ACI","ACR","ACX","ADA","ADG","ADR","AF1","AFD","AFL","AFO","AFP","AFR","AGC","AGH","AGL","AHR","AIG","ALL","ALX","AMU","AOG","AOS","ARA","ARB","ARE","ARI","ASG","ASO","AXP","AXR","B0D","B16","B2G","B4G","B6D","B8D","B9D","BBK","BCD","BDG","BDP","BDR","BEM","BFP","BGC","BGL","BGP","BGS","BHG","BMA","BMX","BNG","BNX","BOG","BRI","BXF","BXP","BXX","BXY","C3X","C4X","C5X","CAP","CBI","CBK","CBS","CDR","CEG","CGF","CHO","CR1","CR6","CRA","CT3","CTO","CTR","CTT","D6G","DAF","DAG","DDA","DDB","DDL","DEL","DFR","DFX","DG0","DGC","DGD","DGM","DGS","DIG","DLF","DLG","DMU","DNO","DOM","DP5","DQQ","DQR","DR2","DR3","DR4","DRI","DSR","DT6","DVC","E4P","E5G","EAG","EBG","EBQ","EGA","EJT","EPG","ERE","ERI","F1P","F1X","F6P","FBP","FCA","FCB","FCT","FDP","FDQ","FFC","FIX","FMO","FRU","FSI","FU4","FUB","FUC","FUD","FUL","FXP","G16","G1P","G2F","G3I","G4D","G4S","G6D","G6P","G6S","GAC","GAD","GAL","GC1","GC4","GCD","GCN","GCO","GCS","GCT","GCU","GCV","GCW","GCX","GE1","GFG","GFP","GIV","GL0","GL2","GL5","GL6","GL7","GL9","GLA","GLB","GLC","GLD","GLF","GLG","GLO","GLP","GLS","GLT","GLW","GMH","GN1","GNX","GP1","GP4","GPH","GPM","GQ1","GQ2","GQ4","GS1","GS4","GSA","GSD","GTE","GTH","GTK","GTR","GTZ","GU0","GU1","GU2","GU3","GU4","GU5","GU6","GU8","GU9","GUF","GUP","GUZ","GYP","GYV","H2P","HDL","HMS","HS2","HSD","HSG","HSH","HSJ","HSQ","HSR","HSU","HSX","HSY","HSZ","IAB","IDG","IDR","IDS","IDT","IDU","IDX","IDY","IMK","IN1","IPT","ISL","KBG","KD2","KDA","KDM","KDO","KFN","KO1","KO2","KTU","L6S","LAG","LAI","LAK","LAO","LAT","LB2","LBT","LCN","LDY","LGC","LGU","LM2","LMT","LMU","LOG","LOX","LPK","LSM","LTM","LVZ","LXB","LXZ","M1F","M3M","M6P","M8C","MA1","MA2","MA3","MAB","MAG","MAL","MAN","MAT","MAV","MAW","MBG","MCU","MDA","MDM","MDP","MFA","MFB","MFU","MG5","MGA","MGL","MLB","MMA","MMN","MN0","MRP","MTT","MUG","MVP","MXY","N1L","N9S","NAA","NAG","NBG","NDG","NED","NG1","NG6","NGA","NGB","NGC","NGE","NGF","NGL","NGS","NGY","NHF","NM6","NM9","NTF","NTO","NTP","NXD","NYT","OPG","OPM","ORP","OX2","P3M","P53","P6P","PA5","PNA","PNG","PNW","PRP","PSJ","PSV","PTQ","QDK","QPS","QV4","R1P","R1X","R2B","R5P","RAA","RAE","RAF","RAM","RAO","RAT","RB5","RBL","RCD","RDP","REL","RER","RF5","RG1","RGG","RHA","RIB","RIP","RNS","RNT","ROB","ROR","RPA","RST","RUB","RUU","RZM","S6P","S7P","SA0","SCR","SDD","SF6","SF9","SG4","SG5","SG6","SG7","SGA","SGC","SGD","SGN","SGS","SHB","SHG","SI3","SIO","SOE","SOL","SSG","SUC","SUP","SUS","T6P","T6T","TAG","TCB","TDG","TGK","TGY","TH1","TIA","TM5","TM6","TM9","TMR","TMX","TOA","TOC","TRE","TYV","UCD","UDC","VG1","X0X","X1X","X2F","X4S","X5S","X6X","XBP","XDN","XDP","XIF","XIM","XLF","XLS","XMM","XUL","XXR","XYP","XYS","YO5","Z3Q","Z6J","Z9M","ZDC","ZDM"],Yg=["CA","C","N","O","O1","O2","OC1","OC2","OX1","OXT","H","H1","H2","H3","HA","BB"],Zg=["P","O3'","O5'","C5'","C4'","C3'","OP1","OP2","O3*","O5*","C5*","C4*","C3*"],Kg={};Kg[wg]={trace:"CA",direction1:"C",direction2:["O","OC1","O1","OX1","OXT"],backboneStart:"N",backboneEnd:"C"},Kg[Sg]={trace:["C4'","C4*"],direction1:["C1'","C1*"],direction2:["C3'","C3*"],backboneStart:"P",backboneEnd:["O3'","O3*"]},Kg[Ag]={trace:["C3'","C3*"],direction1:["C2'","C2*"],direction2:["O4'","O4*"],backboneStart:"P",backboneEnd:["O3'","O3*"]},Kg[Mg]={trace:["CA","BB"],backboneStart:["CA","BB"],backboneEnd:["CA","BB"]},Kg[Pg]={trace:["C4'","C4*","P"],backboneStart:["C4'","C4*","P"],backboneEnd:["C4'","C4*","P"]},Kg[Cg]={trace:["C3'","C3*","C2'","P"],backboneStart:["C3'","C3*","C2'","P"],backboneEnd:["C3'","C3*","C2'","P"]},Kg[_g]={},sn.prototype={constructor:sn,atomRadius:function(t){var e,i=this.type,r=this.scale;switch(i){case"vdw":e=Ng[t.element]||kg;break;case"covalent":e=Fg[t.element]||Bg;break;case"bfactor":e=t.bfactor||1;break;case"sstruc":var n=t.sstruc;e="h"===n?.25:"g"===n?.25:"i"===n?.25:"e"===n?.25:"b"===n?.25:Zg.includes(t.atomname)?.4:.1;break;default:e=i||1}return Math.min(e*r,this.max)}},sn.types={"":"",vdw:"by vdW radius",covalent:"by covalent radius",sstruc:"by secondary structure",bfactor:"by bfactor",size:"size"},bn.__deps=[xn],_n.__deps=[xn,yn],Cn.prototype={copyTo:function(t){t.data.set(this.data)}};var Qg=1.192092896e-7,Jg=1e-37;Vn.__deps=[jn],Gn.__deps=[jn],Hn.__deps=[jn],Xn.__deps=[pn,mn];var tv=new g(-1,-1,-1),ev=new p,iv=function(t){var e=t.rows,i=e/3,r=new Cn(e,3),n=new Cn(3,3),o=new Cn(1,3),a=new Cn(3,3),s=new Cn(3,3),c=On(t);Dn(t,c),Tn(r,t),En(n,r,r),zn(n,o,a,s);var u=new g(c[0],c[1],c[2]),l=new g(a.data[0],a.data[3],a.data[6]),h=new g(a.data[1],a.data[4],a.data[7]),d=new g(a.data[2],a.data[5],a.data[8]),f=l.clone().multiplyScalar(Math.sqrt(o.data[0]/i)),p=h.clone().multiplyScalar(Math.sqrt(o.data[1]/i)),m=d.clone().multiplyScalar(Math.sqrt(o.data[2]/i));this.begA=u.clone().sub(f),this.endA=u.clone().add(f),this.begB=u.clone().sub(p),this.endB=u.clone().add(p),this.begC=u.clone().sub(m),this.endC=u.clone().add(m),this.center=u,this.vecA=f,this.vecB=p,this.vecC=m,this.normVecA=l,this.normVecB=h,this.normVecC=d};iv.prototype.getBasisMatrix=function(t){var e=t||new p;return e.makeBasis(this.normVecB,this.normVecA,this.normVecC),e.determinant()<0&&e.scale(tv),e},iv.prototype.getRotationQuaternion=function(t){var e=t||new m;return e.setFromRotationMatrix(this.getBasisMatrix(ev)),e.inverse()},iv.prototype.getProjectedScaleForAtoms=function(t){var e=-(1/0),i=-(1/0),r=-(1/0),n=-(1/0),o=-(1/0),a=-(1/0),s=new g,c=new g,u=this.center,l=this.normVecA,h=this.normVecB,d=this.normVecC;return t.eachAtom(function(t){un(s.copy(t),l,u);var f=c.subVectors(s,u).normalize().dot(l),p=s.distanceTo(u);f>0?p>e&&(e=p):p>i&&(i=p),un(s.copy(t),h,u);var m=c.subVectors(s,u).normalize().dot(h),g=s.distanceTo(u);m>0?g>r&&(r=g):g>n&&(n=g),un(s.copy(t),d,u);var v=c.subVectors(s,u).normalize().dot(d),y=s.distanceTo(u);v>0?y>o&&(o=y):y>a&&(a=y)}),{d1a:e,d2a:r,d3a:o,d1b:-i,d2b:-n,d3b:-a}},Zn.prototype={constructor:Zn,type:"Store",init:function(t){var e=this;this.length=t,this.count=0;for(var i=0,r=this.__fields.length;i<r;++i){var n=e.__fields[i][0],o=e.__fields[i][1],a=e.__fields[i][2],s=e.length*o;e[n]=ar(a,s)}},resize:function(t){var e=this;this.length=Math.round(t||0),this.count=Math.min(this.count,this.length);for(var i=0,r=this.__fields.length;i<r;++i){var n=e.__fields[i][0],o=e.__fields[i][1],a=e.length*o,s=new e[n].constructor(a);e[n].length>a?s.set(e[n].subarray(0,a)):s.set(e[n]),e[n]=s}},growIfFull:function(){if(this.count>=this.length){var t=Math.round(1.5*this.length);this.resize(Math.max(256,t))}},copyFrom:function(t,e,i,r){for(var n=this,o=0,a=this.__fields.length;o<a;++o)for(var s=n.__fields[o][0],c=n.__fields[o][1],u=n[s],l=t[s],h=0;h<r;++h)for(var d=c*(e+h),f=c*(i+h),p=0;p<c;++p)u[d+p]=l[f+p]},copyWithin:function(t,e,i){for(var r=this,n=0,o=this.__fields.length;n<o;++n)for(var a=r.__fields[n][0],s=r.__fields[n][1],c=r[a],u=0;u<i;++u)for(var l=s*(t+u),h=s*(e+u),d=0;d<s;++d)c[l+d]=c[h+d]},sort:function(t){function e(t,e){t!==e&&(n.copyFrom(r,0,t,1),r.copyWithin(t,e,1),r.copyFrom(n,e,0,1))}function i(r,n){if(r<n){var o=Math.floor((r+n)/2),a=r,s=n;do{for(;t(a,o)<0;)a+=1;for(;t(s,o)>0;)s-=1;a<=s&&(a===o?o=s:s===o&&(o=a),e(a,s),a+=1,s-=1)}while(a<=s);i(r,s),i(a,n)}}qp.time("Store.sort");var r=this,n=new this.constructor(1);i(0,this.count-1),qp.timeEnd("Store.sort")},clear:function(){this.count=0},dispose:function(){var t=this;delete this.length,delete this.count;for(var e=0,i=this.__fields.length;e<i;++e){var r=t.__fields[e][0];delete t[r]}}},Kn.prototype=Object.assign(Object.create(Zn.prototype),{constructor:Kn,type:"BondStore",__fields:[["atomIndex1",1,"int32"],["atomIndex2",1,"int32"],["bondOrder",1,"int8"]],addBond:function(t,e,i){this.growIfFull();var r=this.count,n=t.index,o=e.index;n<o?(this.atomIndex1[r]=n,this.atomIndex2[r]=o):(this.atomIndex2[r]=n,this.atomIndex1[r]=o),i&&(this.bondOrder[r]=i),this.count+=1},addBondIfConnected:function(t,e,i){return!!t.connectedTo(e)&&(this.addBond(t,e,i),!0)}}),Qn.prototype=Object.assign(Object.create(Zn.prototype),{constructor:Qn,type:"AtomStore",__fields:[["residueIndex",1,"uint32"],["atomTypeId",1,"uint16"],["x",1,"float32"],["y",1,"float32"],["z",1,"float32"],["serial",1,"int32"],["bfactor",1,"float32"],["altloc",1,"uint8"],["occupancy",1,"float32"]],setAltloc:function(t,e){this.altloc[t]=e.charCodeAt(0)},getAltloc:function(t){var e=this.altloc[t];return e?String.fromCharCode(e):""}}),Jn.prototype=Object.assign(Object.create(Zn.prototype),{constructor:Jn,type:"ResidueStore",__fields:[["chainIndex",1,"uint32"],["atomOffset",1,"uint32"],["atomCount",1,"uint16"],["residueTypeId",1,"uint16"],["resno",1,"int32"],["sstruc",1,"uint8"],["inscode",1,"uint8"]],setSstruc:function(t,e){this.sstruc[t]=e.charCodeAt(0)},getSstruc:function(t){var e=this.sstruc[t];return e?String.fromCharCode(e):""},setInscode:function(t,e){this.inscode[t]=e.charCodeAt(0)},getInscode:function(t){var e=this.inscode[t];return e?String.fromCharCode(e):""}}),to.prototype=Object.assign(Object.create(Zn.prototype),{constructor:to,type:"ChainStore",__fields:[["entityIndex",1,"uint16"],["modelIndex",1,"uint16"],["residueOffset",1,"uint32"],["residueCount",1,"uint32"],["chainname",4,"uint8"],["chainid",4,"uint8"]],setChainname:function(t,e){var i=4*t;this.chainname[i]=e.charCodeAt(0),this.chainname[i+1]=e.charCodeAt(1),this.chainname[i+2]=e.charCodeAt(2),this.chainname[i+3]=e.charCodeAt(3)},getChainname:function(t){for(var e=this,i="",r=0;r<4;++r){var n=e.chainname[4*t+r];if(!n)break;i+=String.fromCharCode(n)}return i},setChainid:function(t,e){var i=4*t;this.chainid[i]=e.charCodeAt(0),this.chainid[i+1]=e.charCodeAt(1),this.chainid[i+2]=e.charCodeAt(2),this.chainid[i+3]=e.charCodeAt(3)},getChainid:function(t){for(var e=this,i="",r=0;r<4;++r){var n=e.chainid[4*t+r];if(!n)break;i+=String.fromCharCode(n)}return i}}),eo.prototype=Object.assign(Object.create(Zn.prototype),{constructor:eo,type:"ModelStore",__fields:[["chainOffset",1,"uint32"],["chainCount",1,"uint32"]]}),io.prototype={constructor:io,getCenterIterator:function(t){function e(){var t=this.get(s);return s+=1,t}function i(e){e=Math.min(o-1,Math.max(0,e));var i=c[a%4],r=3*e;if(i.fromArray(n,r),t){var s,u,l,h=Math.min(t,e,o-e-1);for(u=1;u<=h;++u)s=3*u,l=(h+1-u)/(h+1),i.x+=l*n[r-s+0]+l*n[r+s+0],i.y+=l*n[r-s+1]+l*n[r+s+1],i.z+=l*n[r-s+2]+l*n[r+s+2];i.x/=h+1,i.y/=h+1,i.z/=h+1}return a+=1,i}function r(){a=0,s=-1}var n=this.getPosition().center,o=n.length/3,a=0,s=-1,c=[new g,new g,new g,new g];return{size:o,next:e,get:i,reset:r}},getColor:function(t){var e=this.polymer,i=e.structure,r=e.residueCount,n=e.residueIndexStart,o=new Float32Array(3*r),a=new Float32Array(3*r),s=t||{};s.structure=i;for(var c=Kp.getScheme(s),u=Kp.getPickingScheme(s),l=i.getResidueProxy(),h=i.getAtomProxy(),d=0;d<r;++d){l.index=n+d,h.index=l.traceAtomIndex;var f=3*d;c.atomColorToArray(h,o,f),u.atomColorToArray(h,a,f)}return{color:o,pickingColor:a}},getSize:function(t,e){for(var i=this.polymer,r=i.structure,n=i.residueCount,o=i.residueIndexStart,a=new Float32Array(n),s=new sn(t,e),c=r.getResidueProxy(),u=r.getAtomProxy(),l=0;l<n;++l)c.index=o+l,u.index=c.traceAtomIndex,a[l]=s.atomRadius(u);return{size:a}},getPosition:function(){var t,e,i,r,n,o=this.polymer,a=o.structure,s=o.residueCount,c=s-3,u=new Float32Array(3*s),l=new Float32Array(3*s),h=new Float32Array(s),d=new Float32Array(s),f=new Float32Array(s),p=new Float32Array(s),m=new Float32Array(3*s),v=new g,y=new g,b=new g,x=new g,_=new g,w=new g,S=new g,A=new g,M=new g,P=new g,C=new g,T=new g(0,0,0),E="trace",I=a.getAtomProxy(),L=a.getAtomProxy(o.getAtomIndexByType(0,E)),R=a.getAtomProxy(o.getAtomIndexByType(1,E)),O=a.getAtomProxy(o.getAtomIndexByType(2,E));for(i=0;i<c;++i)I.index=L.index,L.index=R.index,R.index=O.index,O.index=o.getAtomIndexByType(i+3,E),e=3*i,v.subVectors(L,I),y.subVectors(R,L),b.subVectors(O,R),x.subVectors(v,y),_.subVectors(y,b),M.crossVectors(x,_).normalize(),M.toArray(l,e),i>0&&(h[i]=M.angleTo(P)),t=Math.cos(x.angleTo(_)),p[i]=180/Math.PI*Math.acos(t),r=x.length(),n=_.length(),d[i]=Math.sqrt(n*r)/Math.max(2,2*(1-t)),f[i]=Math.abs(y.dot(M)),w.copy(x).multiplyScalar(d[i]/r),S.copy(_).multiplyScalar(d[i]/n),w.subVectors(L,w),S.subVectors(R,S),w.toArray(u,e+3),S.toArray(u,e+6),C.subVectors(I,T),C.toArray(m,e),P.copy(M),T.copy(w);for(w.fromArray(u,3),S.fromArray(u,6),M.subVectors(w,S).normalize(),I.index=o.getAtomIndexByType(0,E),T.copy(I),A.copy(I),un(A,M,w),A.toArray(u,0),C.subVectors(T,w),C.toArray(m,0),w.fromArray(u,3*s-6),S.fromArray(u,3*s-9),M.subVectors(w,S).normalize(),I.index=o.getAtomIndexByType(s-1,E),T.copy(I),A.copy(I),un(A,M,w),A.toArray(u,3*s-3),i=s-3;i<s;++i)w.fromArray(u,3*i),I.index=o.getAtomIndexByType(i,E),T.copy(I),C.subVectors(T,w),C.toArray(m,3*i);var D=new Float32Array(s),N=new Float32Array(s),k=new Float32Array(s),F=new Float32Array(s);for(D[1]=d[0],N[1]=p[0],k[1]=d[0],i=2;i<s-2;++i)D[i]=.5*(d[i-2]+d[i-1]),N[i]=.5*(p[i-2]+p[i-1]),k[i]=.5*(f[i-2]+f[i-1]),w.fromArray(l,3*(i-2)),S.fromArray(l,3*(i-1)),F[i]=180/Math.PI*Math.acos(Math.cos(w.angleTo(S)));D[s-2]=d[s-4],N[s-2]=p[s-4],k[s-2]=f[s-4];var B=new Float32Array(3*s);for(Kr(l,B,0,0,3),Kr(l,B,0,3,3),i=2;i<s-2;++i)w.fromArray(l,3*(i-2)),S.fromArray(l,3*(i-1)),M.addVectors(S,w).multiplyScalar(.5).normalize(),M.toArray(B,3*i);return Kr(l,B,3*s-12,3*s-6,3),Kr(l,B,3*s-12,3*s-3,3),{center:u,axis:B,bending:F,radius:D,rise:k,twist:N,resdir:m}}},ro.prototype={constructor:ro,getAxis:function(t,e,i,r,n,o){t=t||30,e=e||2.5,i=void 0!==i&&i;var a=this.polymer,s=a.structure,c=a.residueCount,u=a.residueIndexStart,l=this.position,h=r||{};h.structure=s;for(var d,f,p=Kp.getScheme(h),m=Kp.getPickingScheme(h),v=new sn(n,o),y=0,b=0,x=[],_=[],w=[],S=[],A=[],M=[],P=[],C=[],T=[],E=[],I=[],L=new g,R=new g,O=s.getResidueProxy(),D=s.getResidueProxy(),N=s.getAtomProxy(),k=new g,F=new g,B=!1,z=0;z<c;++z)if(O.index=u+z,k.fromArray(l.center,3*z),z===c-1?B=!0:(D.index=u+z+1,F.fromArray(l.center,3*z+3),i&&O.sstruc!==D.sstruc?B=!0:k.distanceTo(F)>e?B=!0:l.bending[z]>t&&(B=!0)),B){if(z-y<4){y=z,B=!1;continue}N.index=O.traceAtomIndex,E=l.axis.subarray(3*y+3,3*z),I=l.center.subarray(3*y,3*z+3),d=cn(E).normalize(),f=cn(I),L.fromArray(I),un(L,d,f),R.fromArray(I,I.length-3),un(R,d,f),d.subVectors(R,L),d.toArray(x,b),f.toArray(_,b),L.toArray(w,b),R.toArray(S,b),p.atomColorToArray(N,A,b),m.atomColorToArray(N,M,b),P.push(v.atomRadius(N)),C.push(u+y),T.push(u+z+1-y),b+=3,y=z,B=!1}return{axis:new Float32Array(x),center:new Float32Array(_),begin:new Float32Array(w),end:new Float32Array(S),color:new Float32Array(A),pickingColor:new Float32Array(M),size:new Float32Array(P),residueOffset:C,residueCount:T}}},no.prototype={push:function(t){this.content.push(t),this.bubbleUp(this.content.length-1)},pop:function(){var t=this.content[0],e=this.content.pop();return this.content.length>0&&(this.content[0]=e,this.sinkDown(0)),t},peek:function(){return this.content[0]},remove:function(t){for(var e=this,i=this.content.length,r=0;r<i;r++)if(e.content[r]==t){var n=e.content.pop();return void(r!=i-1&&(e.content[r]=n,e.scoreFunction(n)<e.scoreFunction(t)?e.bubbleUp(r):e.sinkDown(r)))}throw new Error("Node not found.")},size:function(){return this.content.length},bubbleUp:function(t){for(var e=this,i=this.content[t];t>0;){var r=Math.floor((t+1)/2)-1,n=e.content[r];if(!(e.scoreFunction(i)<e.scoreFunction(n)))break;e.content[r]=i,e.content[t]=n,t=r}},sinkDown:function(t){for(var e,i,r=this,n=this.content.length,o=this.content[t],a=this.scoreFunction(o);;){var s=2*(t+1),c=s-1,u=null;if(c<n){var l=r.content[c];e=r.scoreFunction(l),e<a&&(u=c)}if(s<n){var h=r.content[s];i=r.scoreFunction(h),i<(null===u?a:e)&&(u=s)}if(null===u)break;r.content[t]=r.content[u],r.content[u]=o,t=u}}},ao.prototype={nearest:function(){var t=new Float32Array(3);return function(e,i,r){e instanceof g?e.toArray(t):"AtomProxy"===e.type&&e.positionToArray(t);for(var n=this.kdtree.nearest(t,i,r),o=this.kdtree.indices,a=this.kdtree.nodes,s=this.atomIndices,c=[],u=0,l=n.length;u<l;++u){var h=n[u],d=h[0],f=h[1];c.push({index:s[o[a[d]]],distance:f})}return c}}()};var rv={" ":"X","!":"Y","#":"Z",$:"-X","%":"-Y","&":"-Z","'":"Y+1/2","(":"1/2+X",")":"1/2+Y","*":"1/2-X","+":"1/2+Z",",":"1/2-Y","-":"1/2-Z",".":"X+1/2","/":"Z+1/2",0:"-X+1/2",1:"-Y+1/2",2:"-Z+1/2",3:"1/4+X",4:"1/4-Y",5:"1/4+Z",6:"1/4-X",7:"1/4+Y",8:"3/4-Y",9:"3/4+Z",":":"3/4+Y",";":"3/4+X","<":"3/4-X","=":"1/4-Z",">":"3/4-Z","?":"X-Y","@":"Y-X",A:"Z+1/3",B:"Z+2/3",C:"X+2/3",D:"Y+1/3",E:"-Y+2/3",F:"X-Y+1/3",G:"Y-X+2/3",H:"-X+1/3",I:"X+1/3",J:"Y+2/3",K:"-Y+1/3",L:"X-Y+2/3",M:"Y-X+1/3",N:"-X+2/3",O:"2/3+X",P:"1/3+Y",Q:"1/3+Z",R:"2/3-Y",S:"1/3+X-Y",T:"2/3+Y-X",U:"1/3-X",V:"2/3-X",W:"1/3-Y",X:"1/3-Z",Y:"2/3+Y",Z:"1/3+Y-X","[":"2/3+X-Y","]":"1/3+X","^":"2/3+Z",_:"2/3-Z","`":"5/6+Z",a:"1/6+Z",b:"5/6-Z",c:"1/6-Z",d:"Z+5/6",e:"Z+1/6",f:"Z+1/4",g:"+Y"},nv={"P 1":" !#","P -1":" !#$%&","P 1 2 1":" !#$!&","P 1 21 1":" !#$'&","C 1 2 1":" !#$!&()#*)&","P 1 m 1":" !# %#","P 1 c 1":" !# %+","C 1 m 1":" !# %#()#(,#","C 1 c 1":" !# %+()#(,+","P 1 2/m 1":" !# %#$!&$%&","P 1 21/m 1":" !#$)&$%& ,#","C 1 2/m 1":" !# %#$!&$%&()#(,#*)&*,&","P 1 2/c 1":" !#$!-$%& %+","P 1 21/c 1":" !#$%&$)- ,+","C 1 2/c 1":" !#$!-$%& %+()#*)-*,&(,+","P 2 2 2":" !#$%#$!& %&","P 2 2 21":" !#$%+$!- %&","P 21 21 2":" !#$%#*)&(,&","P 21 21 21":" !#*%+$)-(,&","C 2 2 21":" !#$%+$!- %&()#*,+*)-(,&","C 2 2 2":" !#$%#$!& %&()#*,#*)&(,&","F 2 2 2":" !#$%#$!& %& )+$,+$)- ,-(!+*%+*!-(%-()#*,#*)&(,&","I 2 2 2":" !#$%# %&$!&.'/01/.120'2","I 21 21 21":" !#*%+$)-(,&()+$,#*!& %-","P m m 2":" !#$%# %#$!#","P m c 21":" !#$%+ %+$!#","P c c 2":" !#$%# %+$!+","P m a 2":" !#$%#(%#*!#","P c a 21":" !#$%+(%#*!+","P n c 2":" !#$%# ,+$)+","P m n 21":" !#*%+(%+$!#","P b a 2":" !#$%#(,#*)#","P n a 21":" !#$%+(,#*)+","P n n 2":" !#$%#(,+*)+","C m m 2":" !#$%# %#$!#()#*,#(,#*)#","C m c 21":" !#$%+ %+$!#()#*,+(,+*)#","C c c 2":" !#$%# %+$!+()#*,#(,+*)+","A m m 2":" !#$%# %#$!# )+$,+ ,+$)+","A b m 2":" !#$%# ,#$)# )+$,+ %+$!+","A m a 2":" !#$%#(%#*!# )+$,+(,+*)+","A b a 2":" !#$%#(,#*)# )+$,+(%+*!+","F m m 2":" !#$%# %#$!# )+$,+ ,+$)+(!+*%+(%+*!+()#*,#(,#*)#","F d d 2":" !#$%#345675 )+$,+3896:9(!+*%+;49<79()#*,#;85<:5","I m m 2":" !#$%# %#$!#()+*,+(,+*)+","I b a 2":" !#$%#(,#*)#()+*,+ %+$!+","I m a 2":" !#$%#(%#*!#()+*,+ ,+$)+","P 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!#","P 2/n 2/n 2/n":" !#$%#$!& %&*,-()-(,+*)+","P 2/c 2/c 2/m":" !#$%#$!- %-$%& !& %+$!+","P 2/b 2/a 2/n":" !#$%#$!& %&*,&()&(,#*)#","P 21/m 2/m 2/a":" !#*%#$!&(%&$%&(!& %#*!#","P 2/n 21/n 2/a":" !#*%#*)- ,-$%&(!&(,+$)+","P 2/m 2/n 21/a":" !#*%+*!- %&$%&(!-(%+$!#","P 21/c 2/c 2/a":" !#*%#$!-(%-$%&(!& %+*!+","P 21/b 21/a 2/m":" !#$%#*)&(,&$%& !&(,#*)#","P 21/c 21/c 2/n":" !#*,#$)-(%-$%&()& ,+*!+","P 2/b 21/c 21/m":" !#$%+$)- ,&$%& !- ,+$)#","P 21/n 21/n 2/m":" !#$%#*)-(,-$%& !&(,+*)+","P 21/m 21/m 2/n":" !#$%#*'&.,&*,&.'& %#$!#","P 21/b 2/c 21/n":" !#*,+$!-(,&$%&()- %+*)#","P 21/b 21/c 21/a":" !#*%+$)-(,&$%&(!- ,+*)#","P 21/n 21/m 21/a":" !#0%/$'&.12$%&.!2 1#0'/","C 2/m 2/c 21/m":" !#$%+$!- %&$%& !- %+$!#()#*,+*)-(,&*,&()-(,+*)#","C 2/m 2/c 21/a":" !#$,+$)- %&$%& )- ,+$!#()#*%+*!-(,&*,&(!-(%+*)#","C 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!#()#*,#*)&(,&*,&()&(,#*)#","C 2/c 2/c 2/m":" !#$%#$!- %-$%& !& %+$!+()#*,#*)-(,-*,&()&(,+*)+","C 2/m 2/m 2/a":" !#$,#$)& %&$%& )& ,#$!#()#*%#*!&(,&*,&(!&(%#*)#","C 2/c 2/c 2/a":" !#*,#$!&(,&$,-(!- ,+*!+()#$%#*)& %&*%- )-(%+$)+","F 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!# )+$,+$)- ,-$,- )- ,+$)+(!+*%+*!-(%-*%-(!-(%+*!+()#*,#*)&(,&*,&()&(,#*)#","F 2/d 2/d 2/d":" !#$%#$!& %&64=37=345675 )+$,+$)- ,-68>3:>3896:9(!+*%+*!-(%-<4>;7>;49<79()#*,#*)&(,&<8=;:=;85<:5","I 2/m 2/m 2/m":" !#$%#$!& %&$%& !& %#$!#()+*,+*)-(,-*,-()-(,+*)+","I 2/b 2/a 2/m":" !#$%#*)&(,&$%& !&(,#*)#()+*,+$!- %-*,-()- %+$!+","I 21/b 21/c 21/a":" !#*%+$)-(,&$%&(!- ,+*)#()+$,#*!& %-*,- )&(%#$!+","I 21/m 21/m 21/a":" !#$,#$)& %&$%& )& ,#$!#()+*%+*!-(,-*,-(!-(%+*)+","P 4":" !#$%#% #!$#","P 41":" !#$%+% 5!$9","P 42":" !#$%#% +!$+","P 43":" !#$%+% 9!$5","I 4":" !#$%#% #!$#()+*,+,(+)*+","I 41":" !#*,+%(5)$9()+$%#, 9!*5","P -4":" !#$%#!$&% &","I -4":" !#$%#!$&% &()+*,+)*-,(-","P 4/m":" !#$%#% #!$#$%& !&!$&% &","P 42/m":" !#$%#% +!$+$%& !&!$-% -","P 4/n":" !#$%#,(#)*#*,&()&!$&% &","P 42/n":" !#$%#,(+)*+*,-()-!$&% &","I 4/m":" !#$%#% #!$#$%& !&!$&% &()+*,+,(+)*+*,-()-)*-,(-","I 41/a":" !#*,+%(5)$9$,=(!>!$&,(-()+$%#, 9!*5*%> )=)*-% &","P 4 2 2":" !#$%#% #!$#$!& %&! &%$&","P 4 21 2":" !#$%#,(#)*#*)&(,&! &%$&","P 41 2 2":" !#$%+% 5!$9$!& %-! >%$=","P 41 21 2":" !#$%+,(5)*9*)=(,>! &%$-","P 42 2 2":" !#$%#% +!$+$!& %&! -%$-","P 42 21 2":" !#$%#,(+)*+*)-(,-! &%$&","P 43 2 2":" !#$%+% 9!$5$!& %-! =%$>","P 43 21 2":" !#$%+,(9)*5*)>(,=! &%$-","I 4 2 2":" !#$%#% #!$#$!& %&! &%$&()+*,+,(+)*+*)-(,-)(-,*-","I 41 2 2":" !#*,+%(5)$9*!> ,=)(-%$&()+$%#, 9!*5$)=(%>! &,*-","P 4 m m":" !#$%#% #!$# %#$!#%$#! #","P 4 b m":" !#$%#% #!$#(,#*)#,*#)(#","P 42 c m":" !#$%#% +!$+ %+$!+%$#! #","P 42 n m":" !#$%#,(+)*+(,+*)+%$#! #","P 4 c c":" !#$%#% #!$# %+$!+%$+! +","P 4 n c":" !#$%#% #!$#(,+*)+,*+)(+","P 42 m c":" !#$%#% +!$+ %#$!#%$+! +","P 42 b c":" !#$%#% +!$+(,#*)#,*+)(+","I 4 m m":" !#$%#% #!$# %#$!#%$#! #()+*,+,(+)*+(,+*)+,*+)(+","I 4 c m":" !#$%#% #!$# %+$!+%$+! +()+*,+,(+)*+(,#*)#,*#)(#","I 41 m d":" !#*,+%(5)$9 %#*)+%*5) 9()+$%#, 9!*5(,+$!#,$9!(5","I 41 c d":" !#*,+%(5)$9 %+*)#%*9) 5()+$%#, 9!*5(,#$!+,$5!(9","P -4 2 m":" !#$%#% &!$&$!& %&%$#! #","P -4 2 c":" !#$%#% &!$&$!- %-%$+! +",
	"P -4 21 m":" !#$%#% &!$&*)&(,&,*#)(#","P -4 21 c":" !#$%#% &!$&*)-(,-,*+)(+","P -4 m 2":" !#$%#!$&% & %#$!#! &%$&","P -4 c 2":" !#$%#% &!$& %+$!+! -%$-","P -4 b 2":" !#$%#% &!$&(,#*)#)(&,*&","P -4 n 2":" !#$%#% &!$&(,+*)+)(-,*-","I -4 m 2":" !#$%#% &!$& %#$!#! &%$&()+*,+,(-)*-(,+*)+)(-,*-","I -4 c 2":" !#$%#% &!$& %+$!+! -%$-()+*,+,(-)*-(,#*)#)(&,*&","I -4 2 m":" !#$%#% &!$&$!& %&%$#! #()+*,+,(-)*-*)-(,-,*+)(+","I -4 2 d":" !#$%#% &!$&*!>(%>,$9) 9()+*,+,(-)*-$)= ,=%*5!(5","P 4/m 2/m 2/m":" !#$%#% #!$#$!& %&! &%$&$%& !&!$&% & %#$!#%$#! #","P 4/m 2/c 2/c":" !#$%#% #!$#$!- %-! -%$-$%& !&!$&% & %+$!+%$+! +","P 4/n 2/b 2/m":" !#$%#% #!$#$!& %&! &%$&*,&()&)*&,(&(,#*)#,*#)(#","P 4/n 2/n 2/c":" !#$%#% #!$#$!& %&! &%$&*,-()-)*-,(-(,+*)+,*+)(+","P 4/m 21/b 2/m":" !#$%#% #!$#*)&(,&)(&,*&$%& !&!$&% &(,#*)#,*#)(#","P 4/m 21/n 2/c":" !#$%#% #!$#*)-(,-)(-,*-$%& !&!$&% &(,+*)+,*+)(+","P 4/n 21/m 2/m":" !#$%#,(#)*#*)&(,&! &%$&*,&()&!$&% & %#$!#,*#)(#","P 4/n 2/c 2/c":" !#$%#,(#)*#*)-(,-! -%$-*,&()&!$&% & %+$!+,*+)(+","P 42/m 2/m 2/c":" !#$%#% +!$+$!& %&! -%$-$%& !&!$-% - %#$!#%$+! +","P 42/m 2/c 2/m":" !#$%#% +!$+$!- %-! &%$&$%& !&!$-% - %+$!+%$#! #","P 42/n 2/b 2/c":" !#$%#,(+)*+$!- %-)(&,*&*,-()-!$&% &(,#*)#%$+! +","P 42/n 2/n 2/m":" !#$%#,(+)*+$!& %&)(-,*-*,-()-!$&% &(,+*)+%$#! #","P 42/m 21/b 2/c":" !#$%#% +!$+*)&(,&)(-,*-$%& !&!$-% -(,#*)#,*+)(+","P 42/m 21/n 2/m":" !#$%#,./'*/*'-.,-! &%$&$%& !&'*-,.-.,/*'/%$#! #","P 42/n 21/m 2/c":" !#$%#,(+)*+*)-(,-! &%$&*,-()-!$&% & %#$!#,*+)(+","P 42/n 21/c 2/m":" !#$%#,(+)*+*)&(,&! -%$-*,-()-!$&% & %+$!+,*#)(#","I 4/m 2/m 2/m":" !#$%#% #!$#$!& %&! &%$&$%& !&!$&% & %#$!#%$#! #()+*,+,(+)*+*)-(,-)(-,*-*,-()-)*-,(-(,+*)+,*+)(+","I 4/m 2/c 2/m":" !#$%#% #!$#$!- %-! -%$-$%& !&!$&% & %+$!+%$+! +()+*,+,(+)*+*)&(,&)(&,*&*,-()-)*-,(-(,#*)#,*#)(#","I 41/a 2/m 2/d":" !#*,+%(5)$9*!> ,=)(-%$&$,=(!>!$&,(-(,+$!#,$9!(5()+$%#, 9!*5$)=(%>! &,*-*%> )=)*-% & %#*)+%*5) 9","I 41/a 2/c 2/d":" !#*,+%(5)$9*!= ,>)(&%$-$,=(!>!$&,(-(,#$!+,$5!(9()+$%#, 9!*5$)>(%=! -,*&*%> )=)*-% & %+*)#%*9) 5","P 3":" !#%?#@$#","P 31":" !#%?A@$B","P 32":" !#%?B@$A","H 3":" !#%?#@$#CDAEFAGHAIJBKLBMNB","R 3":" !## !!# ","P -3":" !#%?#@$#$%&!@&? &","H -3":" !#%?#@$#$%&!@&? &OPQRSQTUQVWXYZX[]X]Y^W[^ZV^UR_PT_SO_","R -3":" !## !!# $%&&$%%&$","P 3 1 2":" !#%?#@$#%$&@!& ?&","P 3 2 1":" !#%?#@$#! &?%&$@&","P 31 1 2":" !#%?Q@$^%$_@!X ?&","P 31 2 1":" !#%?A@$B! &?%_$@X","P 32 1 2":" !#%?^@$Q%$X@!_ ?&","P 32 2 1":" !#%?B@$A! &?%X$@_","H 3 2":" !#%?#@$#! &?%&$@&OPQRSQTUQY]X[WXVZX]Y^W[^ZV^PO_SR_UT_","R 3 2":" !## !!# %$&$&%&%$","P 3 m 1":" !#%?#@$#%$#@!# ?#","P 3 1 m":" !#%?#@$#! #?%#$@#","P 3 c 1":" !#%?#@$#%$+@!+ ?+","P 3 1 c":" !#%?#@$#! +?%+$@+","H 3 m":" !#%?#@$#%$#@!# ?#OPQRSQTUQRUQTPQOSQ]Y^W[^ZV^WV^ZY^][^","R 3 m":" !## !!# ! # #!#! ","H 3 c":" !#%?#@$#%$+@!+ ?+OPQRSQTUQRU`TP`OS`]Y^W[^ZV^WVaZYa][a","R 3 c":" !## !!# '././'/'.","P -3 1 2/m":" !#%?#@$#%$&@!& ?&$%&!@&? &! #?%#$@#","P -3 1 2/c":" !#%?#@$#%$-@!- ?-$%&!@&? &! +?%+$@+","P -3 2/m 1":" !#%?#@$#! &?%&$@&$%&!@&? &%$#@!# ?#","P -3 2/c 1":" !#%?#@$#! -?%-$@-$%&!@&? &%$+@!+ ?+","H -3 2/m":" !#%?#@$#! &?%&$@&$%&!@&? &%$#@!# ?#OPQRSQTUQY]X[WXVZXVWXYZX[]XRUQTPQOSQ]Y^W[^ZV^PO_SR_UT_UR_PT_SO_WV^ZY^][^","R -3 2/m":" !## !!# %$&$&%&%$$%&&$%%&$! # #!#! ","H -3 2/c":" !#%?#@$#! -?%-$@-$%&!@&? &%$+@!+ ?+OPQRSQTUQY]b[WbVZbVWXYZX[]XRU`TP`OS`]Y^W[^ZV^POcSRcUTcUR_PT_SO_WVaZYa][a","R -3 2/c":" !## !!# 102021210$%&&$%%&$'././'/'.","P 6":" !#%?#@$#$%#!@#? #","P 61":" !#%?A@$B$%/!@d? e","P 65":" !#%?B@$A$%/!@e? d","P 62":" !#%?^@$Q$%#!@^? Q","P 64":" !#%?Q@$^$%#!@Q? ^","P 63":" !#%?#@$#$%+!@+? +","P -6":" !#%?#@$# !&%?&@$&","P 6/m":" !#%?#@$#$%#!@#? #$%&!@&? & !&%?&@$&","P 63/m":" !#%?#@$#$%+!@+? +$%&!@&? & !-%?-@$-","P 6 2 2":" !#%?#@$#$%#!@#? #! &?%&$@&%$&@!& ?&","P 61 2 2":" !#%?Q@$^$%+!@`? a! X?%&$@_%$b@!- ?c","P 65 2 2":" !#%?^@$Q$%+!@a? `! _?%&$@X%$c@!- ?b","P 62 2 2":" !#%?^@$Q$%#!@^? Q! _?%&$@X%$_@!& ?X","P 64 2 2":" !#%?Q@$^$%#!@Q? ^! X?%&$@_%$X@!& ?_","P 63 2 2":" !#%?#@$#$%+!@+? +! &?%&$@&%$-@!- ?-","P 6 m m":" !#%?#@$#$%#!@#? #%$#@!# ?#! #?%#$@#","P 6 c c":" !#%?#@$#$%#!@#? #%$+@!+ ?+! +?%+$@+","P 63 c m":" !#%?#@$#$%+!@+? +%$+@!+ ?+! #?%#$@#","P 63 m c":" !#%?#@$#$%+!@+? +%$#@!# ?#! +?%+$@+","P -6 m 2":" !#%?#@$# !&%?&@$&%$#@!# ?#%$&@!& ?&","P -6 c 2":" !#%?#@$# !-%?-@$-%$+@!+ ?+%$&@!& ?&","P -6 2 m":" !#%?#@$# !&%?&@$&! &?%&$@&! #?%#$@#","P -6 2 c":" !#%?#@$# !-%?-@$-! &?%&$@&! +?%+$@+","P 6/m 2/m 2/m":" !#%?#@$#$%#!@#? #! &?%&$@&%$&@!& ?&$%&!@&? & !&@$&%?&%$#@!# ?#! #?%#$@#","P 6/m 2/c 2/c":" !#%?#@$#$%#!@#? #! -?%-$@-%$-@!- ?-$%&!@&? & !&@$&%?&%$+@!+ ?+! +?%+$@+","P 63/m 2/c 2/m":" !#%?#@$#$%+!@+? +! -?%-$@-%$&@!& ?&$%&!@&? & !-@$-%?-%$+@!+ ?+! #?%#$@#","P 63/m 2/m 2/c":" !#%?#@$#$%+!@+? +! &?%&$@&%$-@!- ?-$%&!@&? & !-@$-%?-%$#@!# ?#! +?%+$@+","P 2 3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ","F 2 3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%&  )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-((!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- ","I 2 3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-(","P 21 3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(","I 21 3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- ","P 2/m -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& $%& !& %#$!#&$%& !# %#$!%&$!& %# !#$","P 2/n -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& *,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*","F 2/m -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& $%& !& %#$!#&$%& !# %#$!%&$!& %# !#$ )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-($,- )- ,+$)+&*,&()#(,#*)%-*!-(%+(!+*(!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(*%-(!-(%+*!+-$,- )+ ,+$),&*)&(,#()#*()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- *,&()&(,#*)#-*%-(!+(%+*!,-$)- ,+ )+$","F 2/d -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& 64=37=345675=64=375345674=67=3453756 )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(68>3:>3896:9=<8=;:5;85<:4><7>;49;79<(!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(<4>;7>;49<79>68>3:93896:8=<:=;85;:5<()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- <8=;:=;8f<:f><4>;79;49<78>6:>3893:96","I 2/m -3":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& $%& !& %#$!#&$%& !# %#$!%&$!& %# !#$()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-(*,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*","P 21/a -3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&($%&(!- ,+*)#&$%-(!+ ,#*)%&$!-(,+ )#*","I 21/a -3":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&($%&(!- ,+*)#&$%-(!+ ,#*)%&$!-(,+ )#*()+$,#*g& %-+()#$,&*!- %)+(,#$!&*%- *,- )&(%#$!+-*,& )#(%+$!,-*)& %#(!+$","P 4 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$","P 42 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*","F 4 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$ )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(!(-%*-!*+%(+ +,$+)$-, -)#)*#,(&)(&,*(!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&() -,$-)$+, +(#,*#)*&,(&)+!*+%(-!(-%*()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- )(&,*&)*#,(#(+%*+!*-%(-!+)$+, -) -,$","F 41 3 2":" !#$,+*)&(%-# !+$,&*)-(%!# ,+$)&*%-(:3>46=7<98;5;58<976=43>:97<58;>:3=46 )+$%#*!-(,&#()+*%&$!- ,!+(,#*)-$%& :;=4<>765839;94<5:6>83=79:6543>7;=8<(!+*,#$)- %&+ )#$%-*!&(,)#(%+*!&$,- 73=86>:<54;935469:<=8;>7576983=:;>4<()#*%+$!& ,-+(!#*,-$)& %)+ %#$!-*,&(7;>8<=:69435398657<>4;=:5:<94;=73>86","I 4 3 2":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-()(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*","P 43 3 2":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(7;>46=:<5839398<5:6=4;>75:<983>7;=46","P 41 3 2":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(:3=8<>7694;5;54697<>83=:97654;=:3>8<","I 41 3 2":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(:3=8<>7694;5;54697<>83=:97654;=:3>8<()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- 7;>46=:<5839398<5:6=4;>75:<983>7;=46","P -4 3 m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! #%$#!$&% & #!$#%$&! &%#! #%$&!$&% ","F -4 3 m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! #%$#!$&% & #!$#%$&! &%#! #%$&!$&%  )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(!(+%*+!*-%(- +)$+,$-) -,#)(#,*&)*&,((!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&() +,$+)$-, -(#)*#,*&)(&,+!(+%*-!*-%(()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- )(#,*#)*&,(&(+!*+%*-!(-%+) +,$-)$-, ","I -4 3 m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! #%$#!$&% & #!$#%$&! &%#! #%$&!$&% ()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-()(+,*+)*-,(-(+)*+,*-)(-,+)(+,*-)*-,(","P -4 3 n":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(+,*+)*-,(-(+)*+,*-)(-,+)(+,*-)*-,(","F -4 3 c":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(+,*+)*-,(-(+)*+,*-)(-,+)(+,*-)*-,( )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-() #,$#)$&, &(#!*#%*&!(&%+! +%$-!$-% (!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(!(#%*#!*&%(& +!$+%$-! -%#) #,$&)$&, ()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- ! +%$+!$-% - #)$#,$&) &,#!(#%*&!*&%(","I -4 3 d":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(7354<9:6>8;=357<946>:;=857394<>:6=8;()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- :;98657<=43>;9:658<=73>49:;586=7<>43","P 4/m -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$%$#! #% &!$&$&! &% #!$#%&% &!$#%$#! ","P 4/n -3 2/n":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$*,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)(","P 42/m -3 2/n":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)(","P 42/n -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,**,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*%$#! #% &!$&$&! &% #!$#%&% &!$#%$#! ","F 4/m -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$%$#! #% &!$&$&! &% #!$#%&% &!$#%$#!  )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-(!(-%*-!*+%(+ +,$+)$-, -)#)*#,(&)(&,*$,- )- ,+$)+&*,&()#(,#*)%-*!-(%+(!+*%*+!(+%(-!*-$-) -, +)$+,&,(&)*#,*#)((!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&() -,$-)$+, +(#,*#)*&,(&)+!*+%(-!(-%**%-(!-(%+*!+-$,- )+ ,+$),&*)&(,#()#*,$+) +, -)$-*&)(&,(#)*#,-%(-!*+%*+!(()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- )(&,*&)*#,(#(+%*+!*-%(-!+)$+, -) -,$*,&()&(,#*)#-*%-(!+(%+*!,-$)- ,+ )+$,*#)(#,(&)*&*-!(-%(+!*+%-, -)$+,$+) ","F 4/m -3 2/c":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& )(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,*$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)( )+$,+$)- ,-#()#*,&*)&(,!+(%+*!-*%-() &,$&)$#, #(#%*#!*&%(&!+!$+% -! -%$$,- )- ,+$)+&*,&()#(,#*)%-*!-(%+(!+*,$#) #, &)$&*&!(&%(#!*#%-% -!$+%$+! (!+*%+*!-(%-+ )+$,-$)- ,)#(,#*)&*,&(!(&%*&!*#%(# +%$+!$-% -!#)$#, &) &,$*%-(!-(%+*!+-$,- )+ ,+$),&*)&(,#()#*%*#!(#%(&!*&$-! -% +!$+%&, &)$#,$#) ()#*,#*)&(,&+(!+*%-*!-(%)+ ,+$)-$,- ! -%$-!$+% + #,$#)$&, &)#!*#%(&!(&%**,&()&(,#*)#-*%-(!+(%+*!,-$)- ,+ )+$%$+! +% -!$-$&) &, #)$#,&%(&!*#%*#!(","F 41/d -3 2/m":" !#$,+*)&(%-# !+$,&*)-(%!# ,+$)&*%-(:3>46=7<98;5;58<976=43>:97<58;>:3=4664=3:>;85<79=64>3:5;89<74=6:>385;79<,$+! #%(-)*&*&)(-% #!$+,-%(&)*+,$#!  )+$%#*!-(,&#()+*%&$!- ,!+(,#*)-$%& :;=4<>765839;94<5:6>83=79:6543>7;=8<68>37=;49<:5=<8>;753496:4><:=;893756,*#!(+% &)$-*-!(&, +)$#%-, &!$+%*#)((!+*,#$)- %&+ )#$%-*!&(,)#(%+*!&$,- 73=86>:<54;935469:<=8;>7576983=:;>4<<4>;:=389675>68=379;45<:8=<7>;453:96%$#) +,(&!*-$&! -,(#)*+%&% -)$#,*+!(()#*%+$!& ,-+(!#*,-$)& %)+ %#$!-*,&(7;>8<=:69435398657<>4;=:5:<94;=73>86<8=;7>3456:9><4=;:9385678>67=349;:5<%*+)(#, -!$&$-) &%(+!*#,&,(-!*#%$+) ","F 41/d -3 2/c":" !#$,+*)&(%-# !+$,&*)-(%!# ,+$)&*%-(:3>46=7<98;5;58<976=43>:97<58;>:3=46<8>;7=3496:5><8=;793456:8><7=;493:56%*#)(+, &!$-$-! &,(+)*#%&, -!$#%*+)( )+$%#*!-(,&#()+*%&$!- ,!+(,#*)-$%& :;=4<>765839;94<5:6>83=79:6543>7;=8<<4=;:>385679>64=3:9;85<78=67>345;:9<%$+) #,(-!*&$&) -%(#!*+,&%(-)*#,$+! (!+*,#$)- %&+ )#$%-*!&(,)#(%+*!&$,- 73=86>:<54;935469:<=8;>7576983=:;>4<68=37>;45<:9=<4>;:5389674>6:=389;75<,*+!(#% -)$&*-)(&% +!$#,-,(&!*+%$#) ()#*%+$!& ,-+(!#*,-$)& %)+ %#$!-*,&(7;>8<=:69435398657<>4;=:5:<94;=73>8664>3:=;89<75=68>375;49<:4=<:>;853796,$#! +%(&)*-*&!(-, #)$+%-% &)$+,*#!(","I 4/m -3 2/m":" !#$%#$!& %&# !#$%&$!& %!# %#$!&$%& ! &%$&!$#% # #%$#!$&% &!#!$#% &! &%$$%& !& %#$!#&$%& !# %#$!%&$!& %# !#$%$#! #% &!$&$&! &% #!$#%&% &!$#%$#! ()+*,+*)-(,-+()+*,-*)-(,)+(,+*)-*,-()(-,*-)*+,(+(+,*+)*-,(-)+)*+,(-)(-,**,-()-(,+*)+-*,-()+(,+*),-*)-(,+()+*,*+)(+,(-)*-*-)(-,(+)*+,-,(-)*+,*+)(","I 41/a -3 2/d":" !#*%+$)-(,&# !+*%-$)&(,!# %+*)-$,&(:3=8<>7694;5;54697<>83=:97654;=:3>8<$%&(!- ,+*)#&$%-(!+ ,#*)%&$!-(,+ )#*4<97358;=:6>6>:;=8357<94=8;>:694<573()+$,#*!& %-+()#$,&*!- %)+(,#$!&*%- 7;>46=:<5839398<5:6=4;>75:<983>7;=46*,- )&(%#$!+-*,& )#(%+$!,-*)& %#(!+$865:;943>7<=<=73>4;9:658>43=7<5869:;","P 1 1 2":" !#$%#","P 1 1 21":" !#$%+","B 1 1 2":" !#$%#(g+*%+","A 1 2 1":" !#$!& )+$)-","C 1 21 1":" !#$)&()#*!&","I 1 2 1":" !#$!&.'/0'2","I 1 21 1":" !#$)&.'/0!-","P 1 1 m":" !# !&","P 1 1 b":" !# )&","B 1 1 m":" !# !&(!+(!-","B 1 1 b":" !# )&(!+()-","P 1 1 2/m":" !# !&$%#$%&","P 1 1 21/m":" !#$%+$%& !-","B 1 1 2/m":" !# !&$%#$%&(!+(!-*%+*%-","P 1 1 2/b":" !#$,#$%& )&","P 1 1 21/b":" !#$%&$,+ )-","B 1 1 2/b":" !#$,#$%& )&(!+*,+*%-()-","P 21 2 2":" !#$!&(%&*%#","P 2 21 2":" !# ,&$)&$%#","P 21 21 2 (a)":" !#*,#.%&$'&","P 21 2 21":" !#$!&(%-*%+","P 2 21 21":" !# %&$)-$,+","C 2 2 21a)":" !#*%+(,&$)-()#$,+ %&*!-","C 2 2 2a":" !#*,#.%&$'&()#$%# ,&*!&","F 2 2 2a":" !#*,#.%&$'& '/*%/.12$!2.!/$,/ %20'2.'#$%# 1&0!&","I 2 2 2a":" !#*,#.%&$'&()+$%+*!- ,-","P 21/m 21/m 2/n a":" !#*,#$)&(%&$%&.'& ,#*!#","P 42 21 2a":" !#*,#%.+'$+$'&.%&! -,*-","I 2 3a":" !#*,#.%&$'&!# ,- '&$%/$# !-*!/$%&.%()+$%+ ,-*!-)+(%&(!-*,#*+()&$)#*,- ,"},ov=function(t){this.name=t||"",this.partList=[]},av={type:{}};av.type.get=function(){return"Assembly"},ov.prototype.addPart=function(t,e){var i=new sv(t,e);return this.partList.push(i),i},ov.prototype.getCount=function(t,e){var i=0;return this.partList.forEach(function(r){i+=r[e](t)}),i},ov.prototype.getAtomCount=function(t){return this.getCount(t,"getAtomCount")},ov.prototype.getResidueCount=function(t){return this.getCount(t,"getResidueCount")},ov.prototype.getInstanceCount=function(){var t=0;return this.partList.forEach(function(e){t+=e.matrixList.length}),t},ov.prototype.isIdentity=function(t){if(1!==this.partList.length)return!1;var e=this.partList[0];if(1!==e.matrixList.length)return!1;var i=new p;if(!i.equals(e.matrixList[0]))return!1;var r=[];return t.eachChain(function(t){r.push(t.chainname)}),r=rr(r),e.chainList.length===r.length},ov.prototype.getBoundingBox=function(t){var e=new lt;return this.partList.forEach(function(i){var r=i.getBoundingBox(t);e.expandByPoint(r.min),e.expandByPoint(r.max)}),e},ov.prototype.getSelection=function(){var t=[];return this.partList.forEach(function(e){t=t.concat(e.chainList)}),co(t)},Object.defineProperties(ov.prototype,av);var sv=function(t,e){this.matrixList=t||[],this.chainList=e||[]},cv={type:{}};cv.type.get=function(){return"AssemblyPart"},sv.prototype.getCount=function(t,e){var i=0,r=this.chainList;return t.eachChain(function(t){(0===r.length||r.includes(t.chainname))&&(i+=t[e])}),this.matrixList.length*i},sv.prototype.getAtomCount=function(t){return this.getCount(t,"atomCount")},sv.prototype.getResidueCount=function(t){return this.getCount(t,"residueCount")},sv.prototype.getBoundingBox=function(t){var e=new lt,i=new lt,r=this.getSelection(),n=t.getBoundingBox(r);return this.matrixList.forEach(function(t){i.copy(n).applyMatrix4(t),e.expandByPoint(i.min),e.expandByPoint(i.max)}),e},sv.prototype.getSelection=function(){return co(this.chainList)},sv.prototype.getView=function(t){var e=this.getSelection();return e?t.getView(e):t},sv.prototype.getInstanceList=function(){for(var t=this,e=[],i=0,r=this.matrixList.length;i<r;++i)e.push({id:i+1,name:i,matrix:t.matrixList[i]});return e},Object.defineProperties(sv.prototype,cv);var uv=function(){var e=function(t,e,i,r){for(var n=t.structure,o=t.residueIndexStart,a=n.getResidueProxy(),s=n.getResidueProxy(),c=n.getAtomProxy(),u=n.getAtomProxy(),l=Math.max(0,e-2);l<=e;++l)for(var h=2;h<5;++h)if(!(l+h>=t.residueCount)){a.index=o+l,s.index=o+l+h,c.index=a.traceAtomIndex,u.index=s.traceAtomIndex;var d=c.distanceTo(u);if(Math.abs(d-i[h-2])>r)return!1}return!0},i=function(t,i){var r=[5.45,5.18,6.37],n=2.1;return e(t,i,r,n)},r=function(t,i){var r=[6.1,10.4,13],n=1.42;return e(t,i,r,n)},n=function(t){for(var e=t.residueStore,n=t.residueIndexStart,o=0,a=t.residueCount;o<a;++o){var s="c";i(t,o)?s="h":r(t,o)&&(s="s"),e.sstruc[n+o]=s.charCodeAt(0)}},o=function(t){for(var e=20,i=2,r=t.residueStore,n=t.residueIndexStart,o=new ro(t),a=o.position,s=new g,c=new g,u=0,l=t.residueCount;u<l;++u){s.fromArray(a.center,3*u),c.fromArray(a.center,3*u+3);var h=s.distanceTo(c);h<i&&h>1&&a.bending[u]<e&&(r.sstruc[n+u]="h".charCodeAt(0),r.sstruc[n+u+1]="h".charCodeAt(0))}};return function(e){t.Debug&&qp.time("calculateSecondaryStructure"),e.eachPolymer(function(t){if(!(t.residueCount<4)){if(t.isCg())o(t);else{if(!t.isProtein())return;n(t)}var e,i=0;t.eachResidue(function(t){t.sstruc===e?i+=1:(1===i&&(t.index-=1,t.sstruc="c"),i=1,e=t.sstruc)})}}),t.Debug&&qp.timeEnd("calculateSecondaryStructure")}}(),lv=["H","C","O","N","S","P"],hv=["NA","CL"];xo.prototype={constructor:xo,type:"AtomType",atomname:void 0,element:void 0,vdw:void 0,covalent:void 0},wo.prototype={constructor:wo,type:"ResidueType",resname:void 0,atomTypeIdList:void 0,atomCount:void 0,getBackboneIndexList:function(){var t,e=[];switch(this.moleculeType){case vg:t=Yg;break;case yg:case bg:t=Zg;break;default:return e}for(var i=this.structure.atomMap,r=this.atomTypeIdList,n=0,o=this.atomCount;n<o;++n){var a=i.get(r[n]);t.includes(a.atomname)&&e.push(n)}return e},getMoleculeType:function(){return this.isProtein()?vg:this.isRna()?yg:this.isDna()?bg:this.isWater()?mg:this.isIon()?gg:this.isSaccharide()?xg:pg},getBackboneType:function(t){return this.hasProteinBackbone(t)?wg:this.hasRnaBackbone(t)?Sg:this.hasDnaBackbone(t)?Ag:this.hasCgProteinBackbone(t)?Mg:this.hasCgRnaBackbone(t)?Pg:this.hasCgDnaBackbone(t)?Cg:_g},isProtein:function(){return this.chemCompType?Tg.includes(this.chemCompType):this.hasAtomWithName("CA","C","N")||$g.includes(this.resname)},isCg:function(){var t=this.backboneType;return t===Mg||t===Pg||t===Cg},isNucleic:function(){return this.isRna()||this.isDna()},isRna:function(){return this.chemCompType?Eg.includes(this.chemCompType):this.hasAtomWithName(["P","O3'","O3*"],["C4'","C4*"],["O2'","O2*","F2'","F2*"])||Vg.includes(this.resname)&&this.hasAtomWithName(["O2'","O2*","F2'","F2*"])},isDna:function(){return this.chemCompType?Ig.includes(this.chemCompType):this.hasAtomWithName(["P","O3'","O3*"],["C3'","C3*"])&&!this.hasAtomWithName(["O2'","O2*","F2'","F2*"])||Gg.includes(this.resname)},isHetero:function(){return 1===this.hetero},isIon:function(){return Xg.includes(this.resname)},isWater:function(){return Wg.includes(this.resname)},isSaccharide:function(){return this.chemCompType?Lg.includes(this.chemCompType):qg.includes(this.resname)},hasBackboneAtoms:function(t,e){var i=Kg[e];return t===-1?this.hasAtomWithName(i.trace,i.backboneEnd,i.direction1,i.direction2):0===t?this.hasAtomWithName(i.trace,i.direction1,i.direction2):1===t?this.hasAtomWithName(i.trace,i.backboneStart,i.direction1,i.direction2):this.hasAtomWithName(i.trace,i.backboneStart,i.backboneEnd,i.direction1,i.direction2)},hasProteinBackbone:function(t){return this.isProtein()&&this.hasBackboneAtoms(t,wg)},hasRnaBackbone:function(t){return this.isRna()&&this.hasBackboneAtoms(t,Sg)},hasDnaBackbone:function(t){return this.isDna()&&this.hasBackboneAtoms(t,Ag)},hasCgProteinBackbone:function(t){return this.isProtein()&&this.hasBackboneAtoms(t,Mg)},hasCgRnaBackbone:function(t){return this.isRna()&&this.hasBackboneAtoms(t,Pg)},hasCgDnaBackbone:function(t){return this.isDna()&&this.hasBackboneAtoms(t,Cg)},hasBackbone:function(t){return this.hasProteinBackbone(t)||this.hasRnaBackbone(t)||this.hasDnaBackbone(t)||this.hasCgProteinBackbone(t)||this.hasCgRnaBackbone(t)||this.hasCgDnaBackbone(t)},getAtomIndexByName:function(t){var e,i,r=this.atomCount,n=this.structure.atomMap,o=this.atomTypeIdList;if(Array.isArray(t)){for(e=0;e<r;++e)if(i=o[e],t.includes(n.get(i).atomname))return e}else for(e=0;e<r;++e)if(i=o[e],t===n.get(i).atomname)return e},hasAtomWithName:function(){for(var t=arguments,e=this,i=arguments.length,r=0;r<i;++r)if(void 0!==t[r]&&void 0===e.getAtomIndexByName(t[r]))return!1;return!0},getBonds:function(t){return void 0===this.bonds&&(this.bonds=fo(t)),this.bonds},getRings:function(){return void 0===this.rings&&this.calculateRings(),this.rings},getBondGraph:function(){return void 0===this.bondGraph&&this.calculateBondGraph(),this.bondGraph},calculateBondGraph:function(){for(var t,e,i=this.bondGraph={},r=this.getBonds(),n=r.atomIndices1.length,o=r.atomIndices1,a=r.atomIndices2,s=0;s<n;++s){t=o[s],e=a[s];var c=i[t]=i[t]||[];c.push(e);var u=i[e]=i[e]||[];u.push(t)}},calculateRings:function(){function t(a,s,c){if(i[a])throw Error("DFS revisited atom");i[a]=1,o.push(a);for(var u=s.length,l=0;l<u;++l){var h=s[l];if(0===i[h])e[h]&&e[h].length>=2?t(h,e[h],a):i[h]=2;else if(1===i[h]&&c&&c!=h){var d=[h];r[h]=1,n.push(d);for(var f=o.length-1;f>=0;--f){var p=o[f];if(p===h)break;d.push(p),r[p]=1}}}i[a]=2,o.pop()}for(var e=this.getBondGraph(),i=new Int8Array(this.atomCount),r=new Int8Array(this.atomCount),n=[],o=[],a=0;a<this.atomCount;++a)if(!i[a]){var s=e[a];!s||s.length<2?i[a]=2:(o.length=0,t(a,s))}this.rings={flags:r,rings:n}},assignBondReferenceAtomIndices:function(){var t,e,i,r,n,o=this.getBondGraph(),a=this.getRings(),s=a.flags,c=a.rings,u=this.bonds.atomIndices1,l=this.bonds.atomIndices2,h=this.bonds.bondOrders,d=this.bondReferenceAtomIndices,f=this.bonds.atomIndices1.length;for(d.length=0,t=0;t<f;++t)if(!(h[t]<=1)){if(i=u[t],r=l[t],s[i]&&s[r]){for(var p=0;p<c.length&&void 0===d[t];++p)for(var m=c[p],g=null,v=!1,y=0;y<m.length;++y)if(n=m[y],n===i||n===r?v=!0:g=n,v&&null!==g){d[t]=g;break}if(void 0!==d[t])continue}if(o[i].length>1){for(e=0;e<o[i].length;++e)if(n=o[i][e],n!==r){d[t]=n;break}}else if(o[r].length>1){for(e=0;e<o[r].length;++e)if(n=o[r][e],n!==i){d[t]=n;break}}else;}},getBondIndex:function(t,e){for(var i=this.bonds,r=i.atomIndices1,n=i.atomIndices2,o=r.indexOf(t),a=n.indexOf(e),s=a;o!==-1;){for(;a!==-1;){if(o===a)return o;a=n.indexOf(e,a+1)}o=r.indexOf(t,o+1),a=s}},getBondReferenceAtomIndex:function(t,e){var i=this.getBondIndex(t,e);if(void 0!==i)return 0===this.bondReferenceAtomIndices.length&&this.assignBondReferenceAtomIndices(),this.bondReferenceAtomIndices[i]}},Ao.prototype={constructor:Ao,type:"BondProxy",structure:void 0,bondStore:void 0,index:void 0,get atom1(){return this.structure.getAtomProxy(this.atomIndex1)},get atom2(){return this.structure.getAtomProxy(this.atomIndex2)},get atomIndex1(){return this.bondStore.atomIndex1[this.index]},set atomIndex1(t){this.bondStore.atomIndex1[this.index]=t},get atomIndex2(){return this.bondStore.atomIndex2[this.index]},set atomIndex2(t){this.bondStore.atomIndex2[this.index]=t},get bondOrder(){return this.bondStore.bondOrder[this.index]},set bondOrder(t){this.bondStore.bondOrder[this.index]=t},getReferenceAtomIndex:function(){var t=this._ap1,e=this._ap2;if(t.index=this.atomIndex1,e.index=this.atomIndex2,t.residueIndex===e.residueIndex){var i=t.index-t.residueAtomOffset,r=e.index-e.residueAtomOffset,n=t.residueType,o=n.getBondReferenceAtomIndex(i,r);return void 0!==o?o+t.residueAtomOffset:void console.warn("No reference atom found",t.index,e.index)}},calculateShiftDir:function(t){t||(t=new g);var e=this._ap1,i=this._ap2,r=this._ap3,n=this._v12,o=this._v13;e.index=this.atomIndex1,i.index=this.atomIndex2;var a=this.getReferenceAtomIndex();n.subVectors(e,i).normalize(),void 0!==a?(r.index=a,o.subVectors(e,r)):o.copy(e),o.normalize();var s=n.dot(o);return 1-Math.abs(s)<1e-5&&(o.set(1,0,0),s=n.dot(o),1-Math.abs(s)<1e-5&&(o.set(0,1,0),s=n.dot(o))),t.copy(o.sub(n.multiplyScalar(s))).normalize()},qualifiedName:function(){return this.atomIndex1+"="+this.atomIndex2},clone:function(){return new this.constructor(this.structure,this.index)},toObject:function(){return{atomIndex1:this.atomIndex1,atomIndex2:this.atomIndex2,bondOrder:this.bondOrder}}},Mo.prototype={constructor:Mo,type:"AtomProxy",structure:void 0,chainStore:void 0,residueStore:void 0,atomStore:void 0,index:void 0,get entity(){return this.structure.entityList[this.entityIndex]},get entityIndex(){return this.chainStore.entityIndex[this.chainIndex]},get modelIndex(){return this.chainStore.modelIndex[this.chainIndex]},get chainIndex(){return this.residueStore.chainIndex[this.residueIndex]},get residue(){return console.warn("residue - might be expensive"),this.structure.getResidueProxy(this.residueIndex)},get residueIndex(){return this.atomStore.residueIndex[this.index]},set residueIndex(t){this.atomStore.residueIndex[this.index]=t},get sstruc(){return this.residueStore.getSstruc(this.residueIndex)},get inscode(){return this.residueStore.getInscode(this.residueIndex)},get resno(){return this.residueStore.resno[this.residueIndex]},get chainname(){return this.chainStore.getChainname(this.chainIndex)},get chainid(){return this.chainStore.getChainid(this.chainIndex)},get residueType(){return this.residueMap.get(this.residueStore.residueTypeId[this.residueIndex])},get atomType(){return this.atomMap.get(this.atomStore.atomTypeId[this.index])},get residueAtomOffset(){return this.residueStore.atomOffset[this.residueIndex]},get resname(){return this.residueType.resname},get hetero(){return this.residueType.hetero},get atomname(){return this.atomType.atomname},get element(){return this.atomType.element},get vdw(){return this.atomType.vdw},get covalent(){return this.atomType.covalent},get x(){return this.atomStore.x[this.index]},set x(t){this.atomStore.x[this.index]=t},get y(){return this.atomStore.y[this.index]},set y(t){this.atomStore.y[this.index]=t},get z(){return this.atomStore.z[this.index]},set z(t){this.atomStore.z[this.index]=t},get serial(){return this.atomStore.serial[this.index]},set serial(t){this.atomStore.serial[this.index]=t},get bfactor(){return this.atomStore.bfactor[this.index]},set bfactor(t){this.atomStore.bfactor[this.index]=t},get occupancy(){return this.atomStore.occupancy[this.index]},set occupancy(t){this.atomStore.occupancy[this.index]=t},get altloc(){return this.atomStore.getAltloc(this.index)},set altloc(t){this.atomStore.setAltloc(this.index,t)},eachBond:function(t,e){e=e||this.structure._bp;for(var i=this.index,r=this.bondHash,n=r.indexArray,o=r.countArray[i],a=r.offsetArray[i],s=0;s<o;++s)e.index=n[a+s],t(e)},eachBondedAtom:function(t,e){e=e||this.structure._ap;var i=this.index;this.eachBond(function(r){i!==r.atomIndex1?e.index=r.atomIndex1:e.index=r.atomIndex2,t(e)})},isBackbone:function(){var t=this.residueType.backboneIndexList;if(t.length>0){var e=this.residueStore.atomOffset[this.residueIndex];return t.includes(this.index-e)}return!1},isPolymer:function(){if(this.structure.entityList.length>0)return this.entity.isPolymer();var t=this.residueType.moleculeType;return t===vg||t===yg||t===bg},isSidechain:function(){return this.isPolymer()&&!this.isBackbone()},isCg:function(){var t=this.residueType.backboneType;return t===Mg||t===Pg||t===Cg},isHetero:function(){return 1===this.residueType.hetero},isProtein:function(){return this.residueType.moleculeType===vg},isNucleic:function(){var t=this.residueType.moleculeType;return t===yg||t===bg},isRna:function(){return this.residueType.moleculeType===yg},isDna:function(){return this.residueType.moleculeType===bg},isWater:function(){return this.residueType.moleculeType===mg},isIon:function(){return this.residueType.moleculeType===gg},isSaccharide:function(){return this.residueType.moleculeType===xg},isRing:function(){var t=this.residueType.getRings().flags;return 1===t[this.index-this.residueAtomOffset]},distanceTo:function(t){var e=this.atomStore,i=t.atomStore,r=this.index,n=t.index,o=e.x[r]-i.x[n],a=e.y[r]-i.y[n],s=e.z[r]-i.z[n],c=o*o+a*a+s*s;return Math.sqrt(c)},connectedTo:function(t){var e=this.atomStore,i=t.atomStore,r=this.index,n=t.index;if(e.altloc&&i.altloc){var o=e.altloc[r],a=i.altloc[n];if(0!==o&&0!==a&&32!==o&&32!==a&&o!==a)return!1}var s=e.x[r]-i.x[n],c=e.y[r]-i.y[n],u=e.z[r]-i.z[n],l=s*s+c*c+u*u;if(l<64&&this.isCg())return!0;if(isNaN(l))return!1;var h=this.covalent+t.covalent,d=h+.3,f=h-.5;return l<d*d&&l>f*f},positionFromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e+0],this.y=t[e+1],this.z=t[e+2],this},positionToArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.index,r=this.atomStore;return t[e+0]=r.x[i],t[e+1]=r.y[i],t[e+2]=r.z[i],t},positionToVector3:function(t){return void 0===t&&(t=new g),t.x=this.x,t.y=this.y,t.z=this.z,t},positionFromVector3:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},getResidueBonds:function(t){var e,i,r,n,o=this.residueAtomOffset,a=this.index-this.residueAtomOffset,s=this.residueType.getBonds(),c=s.atomIndices1,u=s.atomIndices2;for(t||(n=[]),e=c.indexOf(a);e!==-1;){if(r=u[e]+o,t)return r;n.push(r),e=c.indexOf(a,e+1)}for(i=u.indexOf(a);i!==-1;){if(r=c[i]+o,t)return r;n.push(r),i=u.indexOf(a,i+1)}return n},qualifiedName:function(t){var e="";return this.resname&&!t&&(e+="["+this.resname+"]"),void 0!==this.resno&&(e+=this.resno),this.inscode&&(e+="^"+this.inscode),this.chainname&&(e+=":"+this.chainname),this.atomname&&(e+="."+this.atomname),this.altloc&&(e+="%"+this.altloc),this.structure.modelStore.count>1&&(e+="/"+this.modelIndex),e},clone:function(){return new this.constructor(this.structure,this.index)},toObject:function(){return{index:this.index,residueIndex:this.residueIndex,atomno:this.atomno,resname:this.resname,x:this.x,y:this.y,z:this.z,element:this.element,chainname:this.chainname,resno:this.resno,serial:this.serial,vdw:this.vdw,covalent:this.covalent,hetero:this.hetero,bfactor:this.bfactor,altloc:this.altloc,atomname:this.atomname,modelindex:this.modelindex}}},Po.prototype={constructor:Po,type:"ResidueProxy",structure:void 0,chainStore:void 0,residueStore:void 0,atomStore:void 0,index:void 0,get entity(){return this.structure.entityList[this.entityIndex]},get entityIndex(){return this.chainStore.entityIndex[this.chainIndex]},get chain(){return this.structure.getChainProxy(this.chainIndex)},get chainIndex(){return this.residueStore.chainIndex[this.index]},set chainIndex(t){this.residueStore.chainIndex[this.index]=t},get atomOffset(){return this.residueStore.atomOffset[this.index]},set atomOffset(t){this.residueStore.atomOffset[this.index]=t},get atomCount(){return this.residueStore.atomCount[this.index]},set atomCount(t){this.residueStore.atomCount[this.index]=t},get atomEnd(){return this.atomOffset+this.atomCount-1},get modelIndex(){return this.chainStore.modelIndex[this.chainIndex]},get chainname(){return this.chainStore.getChainname(this.chainIndex)},get chainid(){return this.chainStore.getChainid(this.chainIndex)},get resno(){return this.residueStore.resno[this.index]},set resno(t){this.residueStore.resno[this.index]=t},get sstruc(){return this.residueStore.getSstruc(this.index)},set sstruc(t){this.residueStore.setSstruc(this.index,t)},get inscode(){return this.residueStore.getInscode(this.index)},set inscode(t){this.residueStore.getInscode(this.index,t)},get residueType(){return this.residueMap.get(this.residueStore.residueTypeId[this.index])},get resname(){return this.residueType.resname},get hetero(){return this.residueType.hetero},get moleculeType(){return this.residueType.moleculeType},get backboneType(){return this.residueType.backboneType},get backboneStartType(){return this.residueType.backboneStartType},get backboneEndType(){return this.residueType.backboneEndType},get traceAtomIndex(){return this.residueType.traceAtomIndex+this.atomOffset},get direction1AtomIndex(){return this.residueType.direction1AtomIndex+this.atomOffset},get direction2AtomIndex(){return this.residueType.direction2AtomIndex+this.atomOffset},get backboneStartAtomIndex(){return this.residueType.backboneStartAtomIndex+this.atomOffset},get backboneEndAtomIndex(){return this.residueType.backboneEndAtomIndex+this.atomOffset},get rungEndAtomIndex(){return this.residueType.rungEndAtomIndex+this.atomOffset},eachAtom:function(t,e){var i,r=this.atomCount,n=this.atomOffset,o=this.structure._ap,a=n+r;if(e&&e.atomOnlyTest){var s=e.atomOnlyTest;for(i=n;i<a;++i)o.index=i,
	s(o)&&t(o)}else for(i=n;i<a;++i)o.index=i,t(o)},isProtein:function(){return this.residueType.moleculeType===vg},isNucleic:function(){var t=this.residueType.moleculeType;return t===yg||t===bg},isRna:function(){return this.residueType.moleculeType===yg},isDna:function(){return this.residueType.moleculeType===bg},isCg:function(){var t=this.residueType.backboneType;return t===Mg||t===Pg||t===Cg},isPolymer:function(){if(this.structure.entityList.length>0)return this.entity.isPolymer();var t=this.residueType.moleculeType;return t===vg||t===yg||t===bg},isHetero:function(){return 1===this.residueType.hetero},isWater:function(){return this.residueType.moleculeType===mg},isIon:function(){return this.residueType.moleculeType===gg},isSaccharide:function(){return this.residueType.moleculeType===xg},getAtomType:function(t){return this.atomMap.get(this.atomStore.atomTypeId[t])},getResname1:function(){return jg[this.resname.toUpperCase()]||"X"},getBackboneType:function(t){switch(t){case-1:return this.residueType.backboneStartType;case 1:return this.residueType.backboneEndType;default:return this.residueType.backboneType}},getAtomIndexByName:function(t){var e=this.residueType.getAtomIndexByName(t);return void 0!==e&&(e+=this.atomOffset),e},getAtomByName:function(t){return this.residueType.getAtomByName(t)},hasAtomWithName:function(t){return this.residueType.hasAtomWithName(t)},getAtomnameList:function(){var t=this;console.warn("getAtomnameList - might be expensive");for(var e=this.atomCount,i=this.atomOffset,r=new Array(e),n=0;n<e;++n)r[n]=t.getAtomType(i+n).atomname;return r},connectedTo:function(t){var e=this.structure.getAtomProxy(this.backboneEndAtomIndex),i=this.structure.getAtomProxy(t.backboneStartAtomIndex);return!(!e||!i)&&e.connectedTo(i)},getNextConnectedResidue:function(){var t=this.chainStore.residueOffset[this.chainIndex],e=this.chainStore.residueCount[this.chainIndex],i=this.index+1;if(i<t+e){var r=this.structure.getResidueProxy(i);if(this.connectedTo(r))return r}else if(i===t+e){var n=this.structure.getResidueProxy(t);if(this.connectedTo(n))return n}},getPreviousConnectedResidue:function(t){var e=this.chainStore.residueOffset[this.chainIndex],i=this.index-1;if(i>=e){if(void 0===t&&(t=this.structure.getResidueProxy()),t.index=i,t.connectedTo(this))return t}else if(i===e-1){void 0===t&&(t=this.structure.getResidueProxy());var r=this.chainStore.residueCount[this.chainIndex];if(t.index=e+r-1,t.connectedTo(this))return t}},getBonds:function(){return this.residueType.getBonds(this)},getRings:function(){return this.residueType.getRings()},qualifiedName:function(t){var e="";return this.resname&&!t&&(e+="["+this.resname+"]"),void 0!==this.resno&&(e+=this.resno),this.inscode&&(e+="^"+this.inscode),this.chain&&(e+=":"+this.chainname),e+="/"+this.modelIndex},clone:function(){return new this.constructor(this.structure,this.index)},toObject:function(){return{index:this.index,chainIndex:this.chainIndex,atomOffset:this.atomOffset,atomCount:this.atomCount,resno:this.resno,resname:this.resname,sstruc:this.sstruc}}},Co.prototype={constructor:Co,type:"Polymer",structure:void 0,residueStore:void 0,atomStore:void 0,residueIndexStart:void 0,residueIndexEnd:void 0,residueCount:void 0,get chainIndex(){return this.residueStore.chainIndex[this.residueIndexStart]},get modelIndex(){return this.chainStore.modelIndex[this.chainIndex]},get chainname(){return this.chainStore.getChainname(this.chainIndex)},isProtein:function(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.isProtein()},isCg:function(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.isCg()},isNucleic:function(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.isNucleic()},getMoleculeType:function(){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.moleculeType},getBackboneType:function(t){return this.__residueProxy.index=this.residueIndexStart,this.__residueProxy.getBackboneType(t)},getAtomIndexByType:function(t,e){this.isCyclic?t===-1?t=this.residueCount-1:t===this.residueCount&&(t=0):(t!==-1||this.isPrevConnected||(t+=1),t!==this.residueCount||this.isNextNextConnected||(t-=1));var i=this.__residueProxy;i.index=this.residueIndexStart+t;var r;switch(e){case"trace":r=i.traceAtomIndex;break;case"direction1":r=i.direction1AtomIndex;break;case"direction2":r=i.direction2AtomIndex;break;default:var n=i.getAtomByName(e);r=n?n.index:void 0}return r},eachAtom:function(t,e){this.eachResidue(function(i){i.eachAtom(t,e)},e)},eachAtomN:function(t,e,i){var r,n=this,o=this.residueCount,a=new Array(t);for(r=0;r<t;++r)a[r]=n.structure.getAtomProxy(n.getAtomIndexByType(r,i));e.apply(this,a);for(var s=t;s<o;++s){for(r=1;r<t;++r)a[r-1].index=a[r].index;a[t-1].index=n.getAtomIndexByType(s,i),e.apply(n,a)}},eachAtomN2:function(t,e,i){var r=this,n=this.atomOffset,o=this.atomCount,a=n+o;if(!(o<t)){for(var s=new Array(t),c=0;c<t;++c)s[c]=r.structure.getAtomProxy();var u=this.structure.atomSetCache["__"+i];void 0===u&&(qp.warn("no precomputed atomSet for: "+i),u=this.structure.getAtomSet(!1),this.eachResidue(function(t){var e=t.getAtomByName(i);u.add_unsafe(e.index)}));var l=0;u.forEach(function(i){if(i>=n&&i<a){for(var r=1;r<t;++r)s[r-1].index=s[r].index;s[t-1].index=i,l+=1,l>=t&&e.apply(this,s)}})}},eachDirectionAtomsN:function(t,e){var i=this,r=2*t,n=this.atomOffset,o=this.atomCount,a=n+o;if(!(o<t)){for(var s=new Array(r),c=0;c<r;++c)s[c]=i.structure.getAtomProxy();var u=this.structure.atomSetCache.__direction1,l=this.structure.atomSetCache.__direction2;if(void 0===u||void 0===l)return void qp.error("no precomputed atomSet for direction1 or direction2");var h=0;cg.forEach(function(i,r){if(i>=n&&i<a&&r>=n&&r<a){for(var o=1;o<t;++o)s[o-1].index=s[o].index,s[o-1+t].index=s[o+t].index;s[t-1].index=i,s[t-1+t].index=r,h+=1,h>=t&&e.apply(this,s)}},u,l)}},eachResidue:function(t){for(var e=this.structure.getResidueProxy(),i=this.residueCount,r=this.residueIndexStart,n=0;n<i;++n)e.index=r+n,t(e)},qualifiedName:function(){var t=this.structure.getResidueProxy(this.residueIndexStart),e=this.structure.getResidueProxy(this.residueIndexEnd);return t.qualifiedName()+" - "+e.qualifiedName()}},To.prototype={constructor:To,type:"ChainProxy",structure:void 0,chainStore:void 0,index:void 0,get entity(){return this.structure.entityList[this.entityIndex]},get model(){return this.structure.getModelProxy(this.modelIndex)},get entityIndex(){return this.chainStore.entityIndex[this.index]},set entityIndex(t){this.chainStore.entityIndex[this.index]=t},get modelIndex(){return this.chainStore.modelIndex[this.index]},set modelIndex(t){this.chainStore.modelIndex[this.index]=t},get residueOffset(){return this.chainStore.residueOffset[this.index]},set residueOffset(t){this.chainStore.residueOffset[this.index]=t},get residueCount(){return this.chainStore.residueCount[this.index]},set residueCount(t){this.chainStore.residueCount[this.index]=t},get residueEnd(){return this.residueOffset+this.residueCount-1},get atomOffset(){return this.residueStore.atomOffset[this.residueOffset]},get atomEnd(){return this.residueStore.atomOffset[this.residueEnd]+this.residueStore.atomCount[this.residueEnd]-1},get atomCount(){return 0===this.residueCount?0:this.atomEnd-this.atomOffset+1},get chainname(){return this.chainStore.getChainname(this.index)},set chainname(t){this.chainStore.setChainname(this.index,t)},get chainid(){return this.chainStore.getChainid(this.index)},set chainid(t){this.chainStore.setChainid(this.index,t)},get __firstResidueProxy(){return this.__residueProxy.index=this.residueOffset,this.__residueProxy},isProtein:function(){return this.__firstResidueProxy.isProtein()},isNucleic:function(){return this.__firstResidueProxy.isNucleic()},isRna:function(){return this.__firstResidueProxy.isRna()},isDna:function(){return this.__firstResidueProxy.isDna()},isPolymer:function(){return this.__firstResidueProxy.isPolymer()},isHetero:function(){return this.__firstResidueProxy.isHetero()},isWater:function(){return this.__firstResidueProxy.isWater()},isIon:function(){return this.__firstResidueProxy.isIon()},isSaccharide:function(){return this.__firstResidueProxy.isSaccharide()},eachAtom:function(t,e){this.eachResidue(function(i){i.eachAtom(t,e)},e)},eachResidue:function(t,e){var i,r=this.residueCount,n=this.residueOffset,o=this.structure._rp,a=n+r;if(e&&e.test){var s=e.residueOnlyTest;if(s)for(i=n;i<a;++i)o.index=i,s(o)&&t(o,e);else for(i=n;i<a;++i)o.index=i,t(o,e)}else for(i=n;i<a;++i)o.index=i,t(o)},eachResidueN:function(t,e){var i,r=this,n=this.residueCount,o=this.residueOffset,a=o+n;if(!(n<t)){var s=new Array(t);for(i=0;i<t;++i)s[i]=r.structure.getResidueProxy(o+i);e.apply(this,s);for(var c=o+t;c<a;++c){for(i=0;i<t;++i)s[i].index+=1;e.apply(r,s)}}},eachPolymer:function(t,e){for(var i,r,n=e?e.residueOnlyTest:void 0,o=this.model.structure,a=this.residueCount,s=this.residueOffset,c=s+a,u=this.structure.getResidueProxy(),l=this.structure.getResidueProxy(s),h=this.structure.getAtomProxy(),d=this.structure.getAtomProxy(),f=!0,p=s+1;p<c;++p){u.index=l.index,l.index=p,f&&(i=u.index,f=!1),r=l.index;var m=f?u.backboneEndType:u.backboneType,g=l.backboneType;m!==_g&&m===g?(h.index=u.backboneEndAtomIndex,d.index=l.backboneStartAtomIndex,h&&d&&h.connectedTo(d)&&(!n||n(u)&&n(l))||(u.index-i>1&&t(new Co(o,i,u.index)),i=r)):(m!==_g&&u.index-i>1&&t(new Co(o,i,u.index)),i=r)}r-i>1&&this.structure.getResidueProxy(i).backboneStartType&&t(new Co(o,i,r))},qualifiedName:function(){var t=":"+this.chainname+"/"+this.modelIndex;return t},clone:function(){return new this.constructor(this.structure,this.index)},toObject:function(){return{index:this.index,residueOffset:this.residueOffset,residueCount:this.residueCount,chainname:this.chainname}}},Eo.prototype={constructor:Eo,type:"ModelProxy",structure:void 0,modelStore:void 0,index:void 0,get chainOffset(){return this.modelStore.chainOffset[this.index]},set chainOffset(t){this.modelStore.chainOffset[this.index]=t},get chainCount(){return this.modelStore.chainCount[this.index]},set chainCount(t){this.modelStore.chainCount[this.index]=t},get residueOffset(){return this.chainStore.residueOffset[this.chainOffset]},get atomOffset(){return this.residueStore.atomOffset[this.residueOffset]},get chainEnd(){return this.chainOffset+this.chainCount-1},get residueEnd(){return this.chainStore.residueOffset[this.chainEnd]+this.chainStore.residueCount[this.chainEnd]-1},get atomEnd(){return this.residueStore.atomOffset[this.residueEnd]+this.residueStore.atomCount[this.residueEnd]-1},get residueCount(){return 0===this.chainCount?0:this.residueEnd-this.residueOffset+1},get atomCount(){return 0===this.residueCount?0:this.atomEnd-this.atomOffset+1},eachAtom:function(t,e){this.eachChain(function(i){i.eachAtom(t,e)},e)},eachResidue:function(t,e){this.eachChain(function(i){i.eachResidue(t,e)},e)},eachPolymer:function(t,e){if(e&&e.chainOnlyTest){var i=e.chainOnlyTest;this.eachChain(function(r){i(r)&&r.eachPolymer(t,e)})}else this.eachChain(function(i){i.eachPolymer(t,e)})},eachChain:function(t,e){var i,r=this.chainCount,n=this.chainOffset,o=this.structure._cp,a=n+r;if(e&&e.test){var s=e.chainOnlyTest;if(s)for(i=n;i<a;++i)o.index=i,s(o)&&t(o,e);else for(i=n;i<a;++i)o.index=i,t(o,e)}else for(i=n;i<a;++i)o.index=i,t(o)},qualifiedName:function(){var t="/"+this.index;return t},clone:function(){return new this.constructor(this.structure,this.index)},toObject:function(){return{index:this.index,chainOffset:this.chainOffset,chainCount:this.chainCount}}},Io.prototype={constructor:Io,type:"Structure",finalizeAtoms:function(){this.atomSet=this.getAtomSet(),this.atomCount=this.atomStore.count,this.boundingBox=this.getBoundingBox(),this.center=this.boundingBox.center(),this.spatialHash=new qn(this.atomStore,this.boundingBox)},finalizeBonds:function(){var t=this;this.bondSet=this.getBondSet(),this.bondCount=this.bondStore.count,this.bondHash=new Yn(this.bondStore,this.atomStore.count),this.atomSetCache={},this.atomSetDict.rung||(this.atomSetDict.rung=this.getAtomSet(!1));for(var e in t.atomSetDict){var i=t.atomSetDict[e],r=t.getAtomSet(!1);t.atomSetCache["__"+e]=r.intersection(i)}},getBondProxy:function(t){return new Ao(this,t)},getAtomProxy:function(t){return new Mo(this,t)},getResidueProxy:function(t){return new Po(this,t)},getChainProxy:function(t){return new To(this,t)},getModelProxy:function(t){return new Eo(this,t)},getBondSet:function(){t.Debug&&qp.time("Structure.getBondSet");var e=this.bondStore.count,i=new cg(e),r=this.atomSet;if(r)for(var n=this.getBondProxy(),o=0;o<e;++o)n.index=o,r.has(n.atomIndex1)&&r.has(n.atomIndex2)&&i.add_unsafe(n.index);else i.set_all(!0);return t.Debug&&qp.timeEnd("Structure.getBondSet"),i},getBackboneBondSet:function(){t.Debug&&qp.time("Structure.getBackboneBondSet");var e=this.backboneBondStore.count,i=new cg(e),r=this.atomSetCache.__backbone;if(r){var n=this.getBondProxy();n.bondStore=this.backboneBondStore;for(var o=0;o<e;++o)n.index=o,r.has(n.atomIndex1)&&r.has(n.atomIndex2)&&i.add_unsafe(n.index)}else i.set_all(!0);return t.Debug&&qp.timeEnd("Structure.getBackboneBondSet"),i},getRungBondSet:function(){t.Debug&&qp.time("Structure.getRungBondSet");var e=this.rungBondStore.count,i=new cg(e),r=this.atomSetCache.__rung;if(r){var n=this.getBondProxy();n.bondStore=this.rungBondStore;for(var o=0;o<e;++o)n.index=o,r.has(n.atomIndex1)&&r.has(n.atomIndex2)&&i.add_unsafe(n.index)}else i.set_all(!0);return t.Debug&&qp.timeEnd("Structure.getRungBondSet"),i},getAtomSet:function(e){t.Debug&&qp.time("Structure.getAtomSet");var i,r=this.atomStore.count;if(e&&"Bitset"===e.type)i=e;else if(e===!1)i=new cg(r);else if(e===!0)i=new cg(r),i.set_all(!0);else if(e&&e.test){var n=e.string;n in this.atomSetCache?i=this.atomSetCache[n]:(i=new cg(r),this.eachAtom(function(t){i.add_unsafe(t.index)},e),this.atomSetCache[n]=i)}else i=new cg(r),i.set_all(!0);return t.Debug&&qp.timeEnd("Structure.getAtomSet"),i},getAtomSetWithinSelection:function(t,e){var i=this.spatialHash,r=this.getAtomSet(!1),n=this.getAtomProxy();return this.getAtomSet(t).forEach(function(t){n.index=t,i.within(n.x,n.y,n.z,e).forEach(function(t){r.add_unsafe(t)})}),r},getAtomSetWithinPoint:function(t,e){var i=t,r=this.getAtomSet(!1);return this.spatialHash.within(i.x,i.y,i.z,e).forEach(function(t){r.add_unsafe(t)}),r},getAtomSetWithinVolume:function(t,e,i,r,n){var o=this;t.filterData(i,r,n);for(var a=t.dataPosition,s=a.length,c=t.matrix.getMaxScaleOnAxis(),u=this.getAtomSet(!1),l=0;l<s;l+=3)o.spatialHash.within(a[l],a[l+1],a[l+2],c).forEach(function(t){u.add_unsafe(t)});return u},getAtomSetWithinGroup:function(t){var e=this.atomStore.residueIndex,i=this.getAtomSet(!1),r=this.getResidueProxy();return this.getAtomSet(t).forEach(function(t){r.index=e[t];for(var n=r.atomOffset;n<=r.atomEnd;++n)i.add_unsafe(n)}),i},getSelection:function(){return!1},getStructure:function(){return this},eachEntity:function(t,e){this.entityList.forEach(function(i){void 0!==e&&i.getEntityType()!==e||t(i)})},eachBond:function(t,e){var i=this.getBondProxy(),r=this.bondSet;if(e&&e.test&&(r=r?r.new_intersection(this.getBondSet(e)):this.getBondSet(e)),r)r.forEach(function(e){i.index=e,t(i)});else for(var n=this.bondStore.count,o=0;o<n;++o)i.index=o,t(i)},eachAtom:function(t,e){if(e&&e.test)this.eachModel(function(i){i.eachAtom(t,e)},e);else for(var i=this.atomStore.count,r=this.getAtomProxy(),n=0;n<i;++n)r.index=n,t(r)},eachResidue:function(t,e){var i;if(e&&e.test){var r=this.modelStore.count,n=this.getModelProxy(),o=e.modelOnlyTest;if(o)for(i=0;i<r;++i)n.index=i,o(n)&&n.eachResidue(t,e);else for(i=0;i<r;++i)n.index=i,n.eachResidue(t,e)}else{var a=this.residueStore.count,s=this.getResidueProxy();for(i=0;i<a;++i)s.index=i,t(s)}},eachResidueN:function(t,e){var i,r,n=this,o=this.residueStore.count;if(!(o<t)){var a=new Array(t);for(i=0;i<t;++i)a[i]=n.getResidueProxy(i);for(e.apply(this,a),r=t;r<o;++r){for(i=0;i<t;++i)a[i].index+=1;e.apply(n,a)}}},eachPolymer:function(t,e){if(e&&e.modelOnlyTest){var i=e.modelOnlyTest;this.eachModel(function(r){i(r)&&r.eachPolymer(t,e)})}else this.eachModel(function(i){i.eachPolymer(t,e)})},eachChain:function(t,e){if(e&&e.test)this.eachModel(function(i){i.eachChain(t,e)});else for(var i=this.chainStore.count,r=this.getChainProxy(),n=0;n<i;++n)r.index=n,t(r)},eachModel:function(t,e){var i,r=this.modelStore.count,n=this.getModelProxy();if(e&&e.test){var o=e.modelOnlyTest;if(o)for(i=0;i<r;++i)n.index=i,o(n)&&t(n,e);else for(i=0;i<r;++i)n.index=i,t(n,e)}else for(i=0;i<r;++i)n.index=i,t(n)},getAtomData:function(t){var e=Object.assign({},t);e.colorParams&&(e.colorParams.structure=this.getStructure());var i,r,n,o,a,s,c,u,l=e.what,h=Hi(e.atomSet,this.atomSet),d={},f=this.getAtomProxy(),p=h.size();if(l&&!l.position||(o=new Float32Array(3*p),d.position=o),l&&!l.color||(a=new Float32Array(3*p),d.color=a,r=Kp.getScheme(e.colorParams)),!l||l.pickingColor){s=new Float32Array(3*p),d.pickingColor=s;var m=Object.assign(e.colorParams,{scheme:"picking"});n=Kp.getScheme(m)}return l&&!l.radius||(c=new Float32Array(p),d.radius=c,i=new sn(e.radiusParams.radius,e.radiusParams.scale)),l&&!l.index||(u=new Float32Array(p),d.index=u),h.forEach(function(t,e){var l=3*e;f.index=t,o&&f.positionToArray(o,l),a&&r.atomColorToArray(f,a,l),s&&n.atomColorToArray(f,s,l),c&&(c[e]=i.atomRadius(f)),u&&(u[e]=t)}),d},getBondData:function(t){var e=Object.assign({},t);e.colorParams&&(e.colorParams.structure=this.getStructure());var i,r,n,o,a,s,c,u,l,h,d,f=e.what,p=Hi(e.bondSet,this.bondSet),m=Hi(e.multipleBond,"off"),v="off"!==m,y="offset"===m,b=Hi(e.bondScale,.4),x=Hi(e.bondSpacing,1),_={},w=this.getBondProxy();e.bondStore&&(w.bondStore=e.bondStore);var S,A=this.getAtomProxy(),M=this.getAtomProxy();if(v){var P=w.bondStore.bondOrder;S=0,p.forEach(function(t){S+=P[t]})}else S=p.size();if(f&&!f.position||(o=new Float32Array(3*S),a=new Float32Array(3*S),_.position1=o,_.position2=a),f&&!f.color||(s=new Float32Array(3*S),c=new Float32Array(3*S),_.color=s,_.color2=c,r=Kp.getScheme(e.colorParams)),!f||f.pickingColor){u=new Float32Array(3*S),l=new Float32Array(3*S),_.pickingColor=u,_.pickingColor2=l;var C=Object.assign(e.colorParams,{scheme:"picking"});n=Kp.getScheme(C)}(!f||f.radius||v&&f.position)&&(i=new sn(e.radiusParams.radius,e.radiusParams.scale)),f&&!f.radius||(h=new Float32Array(S),_.radius=h,e.radius2&&(d=new Float32Array(S),_.radius2=d));var T,E,I,L,R,O,D,N=0,k=new g,F=new g,B=new g;return p.forEach(function(t){if(E=3*N,w.index=t,A.index=w.atomIndex1,M.index=w.atomIndex2,L=w.bondOrder,o&&(v&&L>1?(R=i.atomRadius(A),O=R*b/(.5*L),w.calculateShiftDir(B),y?(D=2*x*R,B.multiplyScalar(D),B.negate(),F.subVectors(M,A).multiplyScalar(Math.max(.1,D/1.88)),A.positionToArray(o,E),M.positionToArray(a,E),L>=2&&(k.addVectors(A,B).add(F).toArray(o,E+3),k.addVectors(M,B).sub(F).toArray(a,E+3),L>=3&&(k.subVectors(A,B).add(F).toArray(o,E+6),k.subVectors(M,B).sub(F).toArray(a,E+6)))):(D=(x-b)*R,B.multiplyScalar(D),2===L?(k.addVectors(A,B).toArray(o,E),k.subVectors(A,B).toArray(o,E+3),k.addVectors(M,B).toArray(a,E),k.subVectors(M,B).toArray(a,E+3)):3===L?(A.positionToArray(o,E),k.addVectors(A,B).toArray(o,E+3),k.subVectors(A,B).toArray(o,E+6),M.positionToArray(a,E),k.addVectors(M,B).toArray(a,E+3),k.subVectors(M,B).toArray(a,E+6)):(A.positionToArray(o,E),M.positionToArray(a,E)))):(A.positionToArray(o,E),M.positionToArray(a,E))),s&&(r.bondColorToArray(w,1,s,E),r.bondColorToArray(w,0,c,E),v&&L>1))for(T=1;T<L;++T)I=3*T+E,Qr(s,E,I,3),Qr(c,E,I,3);if(u&&(n.bondColorToArray(w,1,u,E),n.bondColorToArray(w,0,l,E),v&&L>1))for(T=1;T<L;++T)I=3*T+E,Qr(u,E,I,3),Qr(l,E,I,3);if(h&&(h[N]=i.atomRadius(A),v&&L>1))for(O=h[N]*b/(y?1:.5*L),T=y?1:0;T<L;++T)h[N+T]=O;if(d&&(d[N]=i.atomRadius(M),v&&L>1))for(O=d[N]*b/(y?1:.5*L),T=y?1:0;T<L;++T)d[N+T]=O;N+=v?L:1}),_},getBackboneAtomData:function(t){return t=Object.assign({atomSet:this.atomSetCache.__backbone},t),this.getAtomData(t)},getBackboneBondData:function(t){return t=Object.assign({bondSet:this.getBackboneBondSet(),bondStore:this.backboneBondStore},t),this.getBondData(t)},getRungAtomData:function(t){return t=Object.assign({atomSet:this.atomSetCache.__rung},t),this.getAtomData(t)},getRungBondData:function(t){return t=Object.assign({bondSet:this.getRungBondSet(),bondStore:this.rungBondStore},t),this.getBondData(t)},getBoundingBox:function(e,i){t.Debug&&qp.time("getBoundingBox"),i=i||new lt;var r=+(1/0),n=+(1/0),o=+(1/0),a=-(1/0),s=-(1/0),c=-(1/0);return this.eachAtom(function(t){var e=t.x,i=t.y,u=t.z;e<r&&(r=e),i<n&&(n=i),u<o&&(o=u),e>a&&(a=e),i>s&&(s=i),u>c&&(c=u)},e),i.min.set(r,n,o),i.max.set(a,s,c),t.Debug&&qp.timeEnd("getBoundingBox"),i},getPrincipalAxes:function(e){t.Debug&&qp.time("getPrincipalAxes");var i=0,r=new Cn(3,this.atomCount),n=r.data;return this.eachAtom(function(t){n[i+0]=t.x,n[i+1]=t.y,n[i+2]=t.z,i+=3},e),t.Debug&&qp.timeEnd("getPrincipalAxes"),new iv(r)},atomCenter:function(t){return t?this.getBoundingBox(t).center():this.center.clone()},getSequence:function(t){var e=[],i=this.getResidueProxy();return this.eachAtom(function(t){i.index=t.residueIndex,t.index===i.traceAtomIndex&&e.push(i.getResname1())},t),e},getAtomIndices:function(t){var e;if(t&&t.string)e=[],this.eachAtom(function(t){e.push(t.index)},t);else{var i={what:{index:!0}};e=this.getAtomData(i).index}return e},getChainnameCount:function(t){var e=new Set;return this.eachChain(function(t){t.residueCount&&e.add(t.chainname)},t),e.size},updatePosition:function(t){var e=0;this.eachAtom(function(i){i.positionFromArray(t,e),e+=3})},refreshPosition:function(){this.getBoundingBox(void 0,this.boundingBox),this.boundingBox.center(this.center),this.spatialHash=new qn(this.atomStore,this.boundingBox)},dispose:function(){this.frames&&(this.frames.length=0),this.boxes&&(this.boxes.length=0),this.bondStore.dispose(),this.backboneBondStore.dispose(),this.rungBondStore.dispose(),this.atomStore.dispose(),this.residueStore.dispose(),this.chainStore.dispose(),this.modelStore.dispose(),delete this.bondStore,delete this.atomStore,delete this.residueStore,delete this.chainStore,delete this.modelStore,delete this.frames,delete this.boxes,delete this.cif,delete this.bondSet,delete this.atomSet}},Lo.prototype={constructor:Lo,type:"Surface",set:function(t,e,i,r,n,o){this.position=t,this.index=e,this.normal=i,this.color=r,this.atomindex=n,this.size=t.length/3,this.contour=o},fromGeometry:function(e){t.Debug&&qp.time("GeometrySurface.fromGeometry");var i;e instanceof zt?(e.computeVertexNormals(!0),i=(new $t).fromGeometry(e)):i=e instanceof $t?e:e[0],i.boundingBox||i.computeBoundingBox(),this.center.copy(i.boundingBox.center()),this.boundingBox.copy(i.boundingBox);var r,n,o,a;if(i instanceof $t){var s=i.attributes,c=!!s.normal&&s.normal.array;(!c||0===c[0]&&0===c[1]&&0===c[2])&&i.computeVertexNormals(),r=s.position.array,o=s.index?s.index.array:null,a=s.normal.array}this.set(r,o,a,n,void 0),t.Debug&&qp.timeEnd("GeometrySurface.setGeometry")},getPosition:function(){return this.position},getColor:function(t){var e,i,r,n=t||{},o=this.size;if("volume"===n.scheme){var a=new g,s=this.position;for(r=Kp.getScheme(n),i=new Float32Array(3*o),e=0;e<o;++e){var c=3*e;a.set(s[c],s[c+1],s[c+2]),r.positionColorToArray(a,i,c)}}else if("random"===n.scheme)for(r=Kp.getScheme(n),i=new Float32Array(3*o),e=0;e<o;++e)r.volumeColorToArray(e,i,3*e);else if(this.atomindex){n.surface=this,i=new Float32Array(3*o),r=Kp.getScheme(n);var u=n.structure.getAtomProxy(),l=this.atomindex;for(e=0;e<o;++e)u.index=l[e],r.atomColorToArray(u,i,3*e)}else{var h=new ct(n.value);i=qr(o,h.r,h.g,h.b)}return i},getPickingColor:function(t){var e=Object.assign(t||{});return e.scheme="picking",this.getColor(e)},getNormal:function(){return this.normal},getSize:function(t,e){return Xr(this.size,t*e)},getIndex:function(){return this.index},getFilteredIndex:function(t,e){if(t&&this.atomindex){for(var i,r=new Tr(t),n=e.getAtomSet(r),o=[],a=this.atomindex,s=this.index,c=s.length,u=0,l=this.contour?2:3,h=0;h<c;h+=l){var d=!0;for(i=0;i<l;i++){var f=s[h+i],p=a[f];if(!n.has(p)){d=!1;break}}if(d)for(i=0;i<l;i++,u++)o[u]=s[h+i]}var m=this.position.length/3>65535?Uint32Array:Uint16Array;return new m(o)}return this.index},getAtomindex:function(){return this.atomindex},dispose:function(){}},Ro.prototype.constructor=Ro,Oo.prototype.constructor=Oo,Fo.__deps=[Do,No,ko],Bo.__deps=[zo],zo.__deps=[gn,mn,vn,fn],jo.__deps=[mr,wn,Sn,bn,xn,An,Mn,gn,Pn,Un,$n,Gn,Vn,Hn],$o.__deps=[Bo,zo,Fo,hn,dn,Wn,Xn],Zp.add("surf",function(t,e){var i=t.data.args,r=t.data.params;if(i&&(self.volsurf=new $o(i[0],i[1],i[2],i[3],i[4])),r){var n=self.volsurf.getSurface(r.isolevel,r.smooth,r.box,r.matrix,r.contour),o=[n.position.buffer,n.index.buffer];n.normal&&o.push(n.normal.buffer),n.atomindex&&o.push(n.atomindex.buffer),e({sd:n,p:r},o)}},[$o]),Vo.prototype={constructor:Vo,type:"Volume",setData:function(t,e,i,r,n){this.nx=e||1,this.ny=i||1,this.nz=r||1,this.data=t||new Float32Array(1),this.__data=this.data,this.setDataAtomindex(n),delete this.mc,delete this.__isolevel,delete this.__smooth,delete this.__minValue,delete this.__maxValue,delete this.__dataPositionBuffer,delete this.__dataPosition,delete this.__dataBuffer,delete this.__dataMin,delete this.__dataMax,delete this.__dataMean,delete this.__dataRms,this.worker&&this.worker.terminate()},setMatrix:function(t){this.matrix.copy(t);var e=this.boundingBox,i=this.center,r=this.nx-1,n=this.ny-1,o=this.nz-1;e.makeEmpty(),e.expandByPoint(i.set(r,n,o)),e.expandByPoint(i.set(r,n,0)),e.expandByPoint(i.set(r,0,o)),e.expandByPoint(i.set(r,0,0)),e.expandByPoint(i.set(0,n,o)),e.expandByPoint(i.set(0,0,o)),e.expandByPoint(i.set(0,n,0)),e.expandByPoint(i.set(0,0,0)),e.applyMatrix4(this.matrix),e.center(this.center);var a=this.matrix.elements,s=new g(a[0],a[1],a[2]),c=new g(a[4],a[5],a[6]),u=new g(a[8],a[9],a[10]),l=new g,h=this.normalMatrix.elements;l.crossVectors(c,u),h[0]=l.x,h[1]=l.y,h[2]=l.z,l.crossVectors(u,s),h[3]=l.x,h[4]=l.y,h[5]=l.z,l.crossVectors(s,c),h[6]=l.x,h[7]=l.y,h[8]=l.z,this.inverseMatrix.getInverse(this.matrix)},setDataAtomindex:function(t){this.dataAtomindex=t,this.__dataAtomindex=this.dataAtomindex,delete this.__dataAtomindexBuffer},getBox:function(t,e,i){return i||(i=new lt),i.set(t,t),i.expandByScalar(e),i.applyMatrix4(this.inverseMatrix),i.min.round(),i.max.round(),i},__getBox:function(t,e){if(t&&e){this.__box||(this.__box=new lt);var i=this.getBox(t,e,this.__box);return[i.min.toArray(),i.max.toArray()]}},makeSurface:function(t,e,i){var r=new Lo("","",t);return r.info.isolevel=e,r.info.smooth=i,r},getSurface:function(t,e,i,r){t=isNaN(t)?this.getValueForSigma(2):t,e=e||0,void 0===this.volsurf&&(this.volsurf=new $o(this.__data,this.nx,this.ny,this.nz,this.__dataAtomindex));var n=this.__getBox(i,r),o=this.volsurf.getSurface(t,e,n,this.matrix.elements);return this.makeSurface(o,t,e)},getSurfaceWorker:function(t,e,i,r,n){if(t=isNaN(t)?this.getValueForSigma(2):t,e=e||0,window.Worker){void 0===this.workerPool&&(this.workerPool=new Oo("surf",2));var o={},a=this.workerPool.getNextWorker();0===a.postCount&&(o.args=[this.__data,this.nx,this.ny,this.nz,this.__dataAtomindex]),o.params={isolevel:t,smooth:e,box:this.__getBox(i,r),matrix:this.matrix.elements},a.post(o,void 0,function(t){var e=t.data.sd,i=t.data.p;n(this.makeSurface(e,i.isolevel,i.smooth))}.bind(this),function(o){console.warn("Volume.getSurfaceWorker error - trying without worker",o);var a=this.getSurface(t,e,i,r);n(a)}.bind(this))}else{var s=this.getSurface(t,e,i,r);n(s)}},getValueForSigma:function(t){return t=void 0!==t?t:2,this.getDataMean()+t*this.getDataRms()},getSigmaForValue:function(t){return t=void 0!==t?t:0,(t-this.getDataMean())/this.getDataRms()},filterData:function(t,e,i){isNaN(t)&&this.header&&(t=this.header.DMEAN+2*this.header.ARMS),t=void 0===t||isNaN(t)?-(1/0):t,e=void 0!==e?e:1/0,i=i||!1,this.dataPosition||this.makeDataPosition();var r=this.__dataPosition,n=this.__data;if(t!==this.__minValue||e!=this.__maxValue||i!==this.__outside){if(t===-(1/0)&&e===1/0)this.dataPosition=r,this.data=n;else{var o=n.length;this.__dataBuffer||(this.__dataPositionBuffer=new ArrayBuffer(3*o*4),this.__dataBuffer=new ArrayBuffer(4*o));for(var a=new Float32Array(this.__dataPositionBuffer),s=new Float32Array(this.__dataBuffer),c=0,u=0;u<o;++u){var l=3*u,h=n[u];if(!i&&h>=t&&h<=e||i&&(h<t||h>e)){var d=3*c;a[d+0]=r[l+0],a[d+1]=r[l+1],a[d+2]=r[l+2],s[c]=h,c+=1}}this.dataPosition=new Float32Array(this.__dataPositionBuffer,0,3*c),this.data=new Float32Array(this.__dataBuffer,0,c)}this.__minValue=t,this.__maxValue=e,this.__outside=i}},makeDataPosition:function(){for(var t=this.nz,e=this.ny,i=this.nx,r=new Float32Array(i*e*t*3),n=0,o=0;o<t;++o)for(var a=0;a<e;++a)for(var s=0;s<i;++s)r[n+0]=s,r[n+1]=a,r[n+2]=o,n+=3;this.matrix.applyToVector3Array(r),this.dataPosition=r,this.__dataPosition=r},getDataAtomindex:function(){return this.dataAtomindex},getDataPosition:function(){return this.dataPosition},getDataColor:function(t){var e=t||{};e.volume=this,e.scale=e.scale||"Spectral",e.domain=e.domain||[this.getDataMin(),this.getDataMax()];for(var i=Kp.getScheme(e),r=this.dataPosition.length/3,n=new Float32Array(3*r),o=0;o<r;++o)i.volumeColorToArray(o,n,3*o);return n},getPickingDataColor:function(t){var e=Object.assign(t||{});return e.scheme="picking",this.getDataColor(e)},getDataSize:function(t,e){var i,r,n=this.dataPosition.length/3;switch(t){case"value":r=new Float32Array(this.data);break;case"abs-value":for(r=new Float32Array(this.data),i=0;i<n;++i)r[i]=Math.abs(r[i]);break;case"value-min":r=new Float32Array(this.data);var o=this.getDataMin();for(i=0;i<n;++i)r[i]-=o;break;case"deviation":r=new Float32Array(this.data);break;default:r=Xr(n,t)}if(1!==e)for(i=0;i<n;++i)r[i]*=e;return r},getDataMin:function(){if(void 0===this.__dataMin){for(var t=this.__data,e=t.length,i=1/0,r=0;r<e;++r)i=Math.min(i,t[r]);this.__dataMin=i}return this.__dataMin},getDataMax:function(){if(void 0===this.__dataMax){for(var t=this.__data,e=t.length,i=-(1/0),r=0;r<e;++r)i=Math.max(i,t[r]);this.__dataMax=i}return this.__dataMax},getDataMean:function(){if(void 0===this.__dataMean){for(var t=this.__data,e=t.length,i=0,r=0;r<e;++r)i+=t[r];this.__dataMean=i/e}return this.__dataMean},getDataRms:function(){if(void 0===this.__dataRms){var t,e,i=this.__data,r=i.length,n=0;for(e=0;e<r;++e)t=i[e],n+=t*t;this.__dataRms=Math.sqrt(n/r)}return this.__dataRms},clone:function(){var t=new Vo(this.name,this.path,this.__data,this.nx,this.ny,this.nz,this.__dataAtomindex);return t.matrix.copy(this.matrix),this.header&&(t.header=Object.assign({},this.header)),t},dispose:function(){this.workerPool&&this.workerPool.terminate()}};var dv=function(t,e){var i;"function"==typeof t.eachAtom?i=t.atomCount:t instanceof Float32Array&&(i=t.length/3);var r=new Cn(3,i),n=new Cn(3,i);this.coords1t=new Cn(i,3),this.coords2t=new Cn(i,3),this.A=new Cn(3,3),this.W=new Cn(1,3),this.U=new Cn(3,3),this.V=new Cn(3,3),this.VH=new Cn(3,3),this.R=new Cn(3,3),this.tmp=new Cn(3,3),this.c=new Cn(3,3),this.c.data.set([1,0,0,0,1,0,0,0,-1]),this.prepCoords(t,r),this.prepCoords(e,n),this._superpose(r,n)};dv.prototype._superpose=function(e,i){this.mean1=On(e),this.mean2=On(i),Dn(e,this.mean1),Dn(i,this.mean2),Tn(this.coords1t,e),Tn(this.coords2t,i),En(this.A,this.coords2t,this.coords1t),zn(this.A,this.W,this.U,this.V),In(this.V,this.VH),Rn(this.R,this.U,this.VH),Ln(this.R)<0&&(t.Debug&&qp.log("R not a right handed system"),Rn(this.tmp,this.c,this.VH),Rn(this.R,this.U,this.tmp))},dv.prototype.prepCoords=function(t,e){var i=0,r=e.data;"function"==typeof t.eachAtom?t.eachAtom(function(t){r[i+0]=t.x,r[i+1]=t.y,r[i+2]=t.z,i+=3}):t instanceof Float32Array?r.set(t):qp.warn("prepCoords: input type unknown")},dv.prototype.transform=function(t){var e;"function"==typeof t.eachAtom?e=t.atomCount:t instanceof Float32Array&&(e=t.length/3);var i=new Cn(3,e),r=new Cn(e,3);this.prepCoords(t,i),Dn(i,this.mean1),En(r,this.R,i),Tn(i,r),Nn(i,this.mean2);var n=0,o=i.data;"function"==typeof t.eachAtom?t.eachAtom(function(t){t.x=o[n+0],t.y=o[n+1],t.z=o[n+2],
	n+=3}):t instanceof Float32Array?t.set(o.subarray(0,3*e)):qp.warn("transform: input type unknown")};var fv=function(t,e,i){this.signals={gotNumframes:new Cr,frameChanged:new Cr,selectionChanged:new Cr,playerChanged:new Cr};var r=i||{};r.centerPbc=Hi(r.centerPbc,!0),r.removePbc=Hi(r.removePbc,!0),r.superpose=Hi(r.superpose,!0),this.setParameters(r),this.name=t.replace(/^.*[\\\/]/,""),this.selection=new Tr(Hi(r.sele,"backbone and not hydrogen")),this.selection.signals.stringChanged.add(function(){this.makeIndices(),this.resetCache()},this),this.setStructure(e),this.trajPath=t,this.numframes=void 0,this.getNumframes()};fv.prototype.setStructure=function(t){this.structure=t,this.atomCount=t.atomCount,this.makeAtomIndices(),this.saveInitialStructure(),this.backboneIndices=this.getIndices(new Tr("backbone and not hydrogen")),this.makeIndices(),this.frameCache=[],this.boxCache=[],this.pathCache=[],this.frameCacheSize=0,this.currentFrame=-1},fv.prototype.saveInitialStructure=function(){var t=0,e=new Float32Array(3*this.atomCount);this.structure.eachAtom(function(i){e[t+0]=i.x,e[t+1]=i.y,e[t+2]=i.z,t+=3}),this.initialStructure=e},fv.prototype.setSelection=function(t){return this.selection.setString(t),this},fv.prototype.getIndices=function(t){var e;if(t&&t.test){var i=0,r=t.test;e=[],this.structure.eachAtom(function(t){r(t)&&e.push(i),i+=1})}else e=this.structure.getAtomIndices(this.selection);return e},fv.prototype.makeIndices=function(){var t=this;this.indices=this.getIndices(this.selection);var e,i,r=3*this.indices.length;this.coords1=new Float32Array(r),this.coords2=new Float32Array(r);var n=this.initialStructure,o=this.coords2;for(e=0;e<r;e+=3)i=3*t.indices[e/3],o[e+0]=n[i+0],o[e+1]=n[i+1],o[e+2]=n[i+2]},fv.prototype.makeAtomIndices=function(){qp.error("Trajectory.makeAtomIndices not implemented")},fv.prototype.getNumframes=function(){qp.error("Trajectory.loadFrame not implemented")},fv.prototype.resetCache=function(){return this.frameCache=[],this.boxCache=[],this.pathCache=[],this.frameCacheSize=0,this.setFrame(this.currentFrame),this},fv.prototype.setParameters=function(t){var e=t,i=!1;void 0!==e.centerPbc&&e.centerPbc!==this.centerPbc&&(this.centerPbc=e.centerPbc,i=!0),void 0!==e.removePbc&&e.removePbc!==this.removePbc&&(this.removePbc=e.removePbc,i=!0),void 0!==e.superpose&&e.superpose!==this.superpose&&(this.superpose=e.superpose,i=!0),i&&this.resetCache()},fv.prototype.setFrame=function(t,e){return void 0===t?this:(this.inProgress=!0,t=parseInt(t),t===-1||this.frameCache[t]?this.updateStructure(t,e):this.loadFrame(t,function(){this.updateStructure(t,e)}.bind(this)),this)},fv.prototype.interpolate=function(t,e,i,r,n,o,a){var s,c=this.frameCache,u=c[t],l=c[e],h=c[i],d=c[r],f=u.length,p=new Float32Array(f);if("spline"===o)for(s=0;s<f;s+=3)p[s+0]=Sr(d[s+0],h[s+0],l[s+0],u[s+0],n,1),p[s+1]=Sr(d[s+1],h[s+1],l[s+1],u[s+1],n,1),p[s+2]=Sr(d[s+2],h[s+2],l[s+2],u[s+2],n,1);else for(s=0;s<f;s+=3)p[s+0]=wr(l[s+0],u[s+0],n),p[s+1]=wr(l[s+1],u[s+1],n),p[s+2]=wr(l[s+2],u[s+2],n);this.structure.updatePosition(p),this.currentFrame=t,this.signals.frameChanged.dispatch(t),"function"==typeof a&&a()},fv.prototype.setFrameInterpolated=function(t,e,i,r,n,o,a){if(void 0===t)return this;var s=this.frameCache,c=[];return s[r]||c.push(r),s[i]||c.push(i),s[e]||c.push(e),s[t]||c.push(t),c.length?this.loadFrame(c,function(){this.interpolate(t,e,i,r,n,o,a)}.bind(this)):this.interpolate(t,e,i,r,n,o,a),this},fv.prototype.loadFrame=function(t,e){if(Array.isArray(t)){var i,r=function(t,r){this._loadFrame(t,r),0===i.length()&&"function"==typeof e&&e()}.bind(this);i=new Go(r,t)}else this._loadFrame(t,e)},fv.prototype._loadFrame=function(t,e){qp.error("Trajectory._loadFrame not implemented",t,e)},fv.prototype.updateStructure=function(t,e){this._disposed||(t===-1?this.structure.updatePosition(this.initialStructure):this.structure.updatePosition(this.frameCache[t]),this.structure.trajectory={name:this.trajPath,frame:t},"function"==typeof e&&e(),this.currentFrame=t,this.inProgress=!1,this.signals.frameChanged.dispatch(t))},fv.prototype.getCircularMean=function(t,e,i){return[Hr(e,i[0],3,0,t),Hr(e,i[1],3,1,t),Hr(e,i[2],3,2,t)]},fv.prototype.doSuperpose=function(t){var e,i,r=this,n=3*this.indices.length,o=this.coords1,a=this.coords2;for(e=0;e<n;e+=3)i=3*r.indices[e/3],o[e+0]=t[i+0],o[e+1]=t[i+1],o[e+2]=t[i+2];var s=new dv(o,a);s.transform(t)},fv.prototype.process=function(t,e,i,r){if(this.setNumframes(r),e){if(this.backboneIndices.length>0&&this.centerPbc){var n=[e[0],e[4],e[8]],o=this.getCircularMean(this.backboneIndices,i,n);Ho(i,o,n)}this.removePbc&&Wo(i,e)}this.indices.length>0&&this.superpose&&this.doSuperpose(i),this.frameCache[t]=i,this.boxCache[t]=e,this.frameCacheSize+=1},fv.prototype.setNumframes=function(t){t!==this.numframes&&(this.numframes=t,this.signals.gotNumframes.dispatch(t))},fv.prototype.dispose=function(){this.frameCache=[],this._disposed=!0,this.player&&this.player.stop()},fv.prototype.setPlayer=function(t){this.player=t,this.signals.playerChanged.dispatch(t)},fv.prototype.getPath=function(t,e){qp.error("Trajectory.getPath not implemented",t,e)},em.add("shader/Mesh.vert","#define STANDARD\nuniform float nearClip;\nuniform vec3 clipCenter;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || ( !defined( PICKING ) && !defined( NOLIGHT ) )\nvarying vec3 vViewPosition;\n#endif\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#if defined( PICKING )\nattribute vec3 pickingColor;\nvarying vec3 vPickingColor;\n#elif defined( NOLIGHT )\nvarying vec3 vColor;\n#else\n#include color_pars_vertex\n#ifndef FLAT_SHADED\nvarying vec3 vNormal;\n#endif\n#endif\n#include common\nvoid main(){\n#if defined( PICKING )\nvPickingColor = pickingColor;\n#elif defined( NOLIGHT )\nvColor = color;\n#else\n#include color_vertex\n#include beginnormal_vertex\n#include defaultnormal_vertex\n#ifndef FLAT_SHADED\nvNormal = normalize( transformedNormal );\n#endif\n#endif\n#include begin_vertex\n#include project_vertex\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || ( !defined( PICKING ) && !defined( NOLIGHT ) )\nvViewPosition = -mvPosition.xyz;\n#endif\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n}"),em.add("shader/Mesh.frag","#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float nearClip;\nuniform float clipRadius;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || ( !defined( PICKING ) && !defined( NOLIGHT ) )\nvarying vec3 vViewPosition;\n#endif\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#if defined( PICKING )\nuniform float objectId;\nvarying vec3 vPickingColor;\n#elif defined( NOLIGHT )\nvarying vec3 vColor;\n#else\n#ifndef FLAT_SHADED\nvarying vec3 vNormal;\n#endif\n#include common\n#include color_pars_fragment\n#include fog_pars_fragment\n#include bsdfs\n#include lights_pars\n#include lights_physical_pars_fragment\n#endif\nvoid main(){\n#include nearclip_fragment\n#include radiusclip_fragment\n#if defined( PICKING )\ngl_FragColor = vec4( vPickingColor, objectId );\n#elif defined( NOLIGHT )\ngl_FragColor = vec4( vColor, opacity );\n#else\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\n#include normal_flip\n#include normal_fragment\n#include dull_interior_fragment\n#include lights_physical_fragment\n#include lights_template\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#include opaque_back_fragment\n#endif\n}");var pv={f:1,v2:2,v3:3,c:3},mv=function(t,e){var i=t||{},r=e||{};this.opaqueBack=Hi(r.opaqueBack,!1),this.dullInterior=Hi(r.dullInterior,!1),this.side=Hi(r.side,"double"),this.opacity=Hi(r.opacity,1),this.clipNear=Hi(r.clipNear,0),this.clipRadius=Hi(r.clipRadius,0),this.clipCenter=Hi(r.clipCenter,new g),this.flatShaded=Hi(r.flatShaded,!1),this.background=Hi(r.background,!1),this.linewidth=Hi(r.linewidth,1),this.wireframe=Hi(r.wireframe,!1),this.wireframeLinewidth=Hi(r.wireframeLinewidth,1),this.roughness=Hi(r.roughness,.4),this.metalness=Hi(r.metalness,0),this.diffuse=Hi(r.diffuse,16777215),this.forceTransparent=Hi(r.forceTransparent,!1),this.geometry=new $t,this.indexVersion=0,this.wireframeIndexVersion=-1,this.uniforms=Hl.merge([Hd.common,{fogColor:{value:null},fogNear:{value:0},fogFar:{value:0},opacity:{value:this.opacity},nearClip:{value:0},clipRadius:{value:this.clipRadius},clipCenter:{value:this.clipCenter}},{emissive:{value:new ct(0)},roughness:{value:this.roughness},metalness:{value:this.metalness}},Hd.ambient,Hd.lights]),this.uniforms.diffuse.value.set(this.diffuse);var n=new Di(0).onUpdate(function(t){this.value=Wp?t.id:t.id/255});this.pickingUniforms={nearClip:{value:0},objectId:n},this.group=new Ae,this.wireframeGroup=new Ae,this.pickingGroup=new Ae;var o=i.position||i.position1,a=o?o.length/3:0;this._positionDataSize=a,this.addAttributes({position:{type:"v3",value:i.position},color:{type:"c",value:i.color},vertexId:{type:"f",value:Yr(a)}}),i.index&&this.initIndex(i.index),i.pickingColor&&this.addAttributes({pickingColor:{type:"c",value:i.pickingColor}}),this.makeWireframeGeometry()},gv={parameters:{},transparent:{},size:{},attributeSize:{},pickable:{},dynamic:{},vertexShader:{},fragmentShader:{}};gv.parameters.get=function(){return{opaqueBack:{updateShader:!0},dullInterior:{updateShader:!0},side:{updateShader:!0,property:!0},opacity:{uniform:!0},clipNear:{updateShader:!0,property:!0},clipRadius:{updateShader:!0,property:!0,uniform:!0},clipCenter:{uniform:!0},flatShaded:{updateShader:!0},background:{updateShader:!0},linewidth:{property:!0},wireframe:{updateVisibility:!0},roughness:{uniform:!0},metalness:{uniform:!0},diffuse:{uniform:!0}}},gv.transparent.get=function(){return this.opacity<1||this.forceTransparent},gv.size.get=function(){return this._positionDataSize},gv.attributeSize.get=function(){return this.size},gv.pickable.get=function(){return!!this.geometry.attributes.pickingColor},gv.dynamic.get=function(){return!0},gv.vertexShader.get=function(){},gv.fragmentShader.get=function(){},mv.prototype.initIndex=function(t){this.geometry.setIndex(new Rt(t,1)),this.geometry.getIndex().setDynamic(this.dynamic)},mv.prototype.makeMaterial=function(){var t=Xo(this.side);this.material=new st({uniforms:this.uniforms,vertexShader:"",fragmentShader:"",depthTest:!0,transparent:this.transparent,depthWrite:!0,lights:!0,fog:!0,side:t,linewidth:this.linewidth}),this.material.vertexColors=Uc,this.material.extensions.derivatives=this.flatShaded,this.material.extensions.fragDepth=this.impostor,this.material.clipNear=this.clipNear,this.wireframeMaterial=new st({uniforms:this.uniforms,vertexShader:"",fragmentShader:"",depthTest:!0,transparent:this.transparent,depthWrite:!0,lights:!1,fog:!0,side:t,linewidth:this.linewidth}),this.wireframeMaterial.vertexColors=Uc,this.wireframeMaterial.clipNear=this.clipNear,this.pickingMaterial=new st({uniforms:this.pickingUniforms,vertexShader:"",fragmentShader:"",depthTest:!0,transparent:!1,depthWrite:!0,lights:!1,fog:!1,side:t,linewidth:this.linewidth}),this.pickingMaterial.vertexColors=Uc,this.pickingMaterial.extensions.fragDepth=this.impostor,this.pickingMaterial.clipNear=this.clipNear,this.updateShader()},mv.prototype.makeWireframeGeometry=function(){this.makeWireframeIndex();var t=this.geometry,e=this.wireframeIndex,i=new $t;i.attributes=t.attributes,e&&(i.setIndex(new Rt(e,1).setDynamic(this.dynamic)),i.setDrawRange(0,this.wireframeIndexCount)),this.wireframeGeometry=i},mv.prototype.makeWireframeIndex=function(){function t(t,i){if(t>i){var r=t;t=i,i=r}var n=e[t];return void 0===n?(e[t]=[i],!0):!n.includes(i)&&(n.push(i),!0)}var e=[],i=this.geometry.index;if(this.wireframe){if(i){var r=i.array,n=r.length;this.geometry.drawRange.count!==1/0&&(n=this.geometry.drawRange.count);var o;if(this.wireframeIndex&&this.wireframeIndex.length>2*n)o=this.wireframeIndex;else{var a=this.geometry.attributes.position.count,s=a>65535?Uint32Array:Uint16Array;o=new s(2*n)}var c=0;e.length=0;for(var u=0;u<n;u+=3){var l=r[u+0],h=r[u+1],d=r[u+2];t(l,h)&&(o[c+0]=l,o[c+1]=h,c+=2),t(h,d)&&(o[c+0]=h,o[c+1]=d,c+=2),t(d,l)&&(o[c+0]=d,o[c+1]=l,c+=2)}this.wireframeIndex=o,this.wireframeIndexCount=c,this.wireframeIndexVersion=this.indexVersion}}else this.wireframeIndex=new Uint16Array(0),this.wireframeIndexCount=0},mv.prototype.updateWireframeIndex=function(){if(this.wireframeGeometry.setDrawRange(0,1/0),this.wireframeIndexVersion<this.indexVersion&&this.makeWireframeIndex(),this.wireframeIndex.length>this.wireframeGeometry.index.array.length)this.wireframeGeometry.setIndex(new Rt(this.wireframeIndex,1).setDynamic(this.dynamic));else{var t=this.wireframeGeometry.getIndex();t.set(this.wireframeIndex),t.needsUpdate=this.wireframeIndexCount>0,t.updateRange.count=this.wireframeIndexCount}this.wireframeGeometry.setDrawRange(0,this.wireframeIndexCount)},mv.prototype.getRenderOrder=function(){var t=0;return"text"===this.type?t=1:this.transparent&&(t="surface"===this.type?3:2),t},mv.prototype.getMesh=function(){var t;return this.material||this.makeMaterial(),this.line?t=new _e(this.geometry,this.material):this.point?(t=new Se(this.geometry,this.material),this.sortParticles&&(t.sortParticles=!0)):t=new ie(this.geometry,this.material),t.frustumCulled=!1,t.renderOrder=this.getRenderOrder(),t},mv.prototype.getWireframeMesh=function(){var t;return this.material||this.makeMaterial(),this.wireframeGeometry||this.makeWireframeGeometry(),t=new _e(this.wireframeGeometry,this.wireframeMaterial),t.frustumCulled=!1,t.renderOrder=this.getRenderOrder(),t},mv.prototype.getPickingMesh=function(){var t;return this.material||this.makeMaterial(),t=new ie(this.geometry,this.pickingMaterial),t.frustumCulled=!1,t.renderOrder=this.getRenderOrder(),t},mv.prototype.getShader=function(t,e){return Vr(t,this.getDefines(e))},mv.prototype.getVertexShader=function(t){return this.getShader(this.vertexShader,t)},mv.prototype.getFragmentShader=function(t){return this.getShader(this.fragmentShader,t)},mv.prototype.getDefines=function(t){var e={};return this.clipNear&&(e.NEAR_CLIP=1),this.clipRadius&&(e.RADIUS_CLIP=1),"picking"===t?e.PICKING=1:(("background"===t||this.background)&&(e.NOLIGHT=1),this.flatShaded&&(e.FLAT_SHADED=1),this.opaqueBack&&(e.OPAQUE_BACK=1),this.dullInterior&&(e.DULL_INTERIOR=1)),e},mv.prototype.getParameters=function(){var t=this,e={};for(var i in t.parameters)e[i]=t[i];return e},mv.prototype.addUniforms=function(t){this.uniforms=Hl.merge([this.uniforms,t]),this.pickingUniforms=Hl.merge([this.pickingUniforms,t])},mv.prototype.addAttributes=function(t){var e=this;for(var i in t){var r,n=t[i],o=e.attributeSize*pv[n.type];n.value?(o!==n.value.length&&qp.error("attribute value has wrong length",i),r=n.value):r=ar("float32",o),e.geometry.addAttribute(i,new Rt(r,pv[n.type]).setDynamic(e.dynamic))}},mv.prototype.updateRenderOrder=function(){function t(t){t.renderOrder=e}var e=this.getRenderOrder();this.group.children.forEach(t),this.pickingGroup&&this.pickingGroup.children.forEach(t)},mv.prototype.updateShader=function(){var t=this.material,e=this.wireframeMaterial,i=this.pickingMaterial;t.vertexShader=this.getVertexShader(),t.fragmentShader=this.getFragmentShader(),t.needsUpdate=!0,e.vertexShader=this.getShader("Line.vert"),e.fragmentShader=this.getShader("Line.frag"),e.needsUpdate=!0,i.vertexShader=this.getVertexShader("picking"),i.fragmentShader=this.getFragmentShader("picking"),i.needsUpdate=!0},mv.prototype.setParameters=function(t){var e=this;if(t){var i=t,r=this.parameters,n={},o={},a=!1,s=!1;for(var c in i)void 0!==i[c]&&void 0!==r[c]&&(e[c]=i[c],r[c].property&&(r[c].property!==!0?n[r[c].property]=i[c]:n[c]=i[c]),r[c].uniform&&(r[c].uniform!==!0?o[r[c].uniform]=i[c]:o[c]=i[c]),r[c].updateShader&&(a=!0),r[c].updateVisibility&&(s=!0),e.dynamic&&"wireframe"===c&&i[c]===!0&&e.updateWireframeIndex(),"flatShaded"===c&&(e.material.extensions.derivatives=e.flatShaded),"forceTransparent"===c&&(n.transparent=e.transparent));this.setProperties(n),this.setUniforms(o),a&&this.updateShader(),s&&this.setVisibility(this.visible)}},mv.prototype.setAttributes=function(t){var e=this,i=this.geometry,r=i.attributes;for(var n in t){var o=t[n],a=o.length;if("index"===n){var s=i.getIndex();i.setDrawRange(0,1/0),a>s.array.length?i.setIndex(new Rt(o,1).setDynamic(e.dynamic)):(s.set(o),s.needsUpdate=a>0,s.updateRange.count=a,i.setDrawRange(0,a)),e.indexVersion++,e.wireframe&&e.updateWireframeIndex()}else{var c=r[n];a>c.array.length?i.addAttribute(n,new Rt(o,c.itemSize).setDynamic(e.dynamic)):(r[n].set(o),r[n].needsUpdate=a>0,r[n].updateRange.count=a)}}},mv.prototype.setUniforms=function(t){var e=this;if(t){var i=this.material.uniforms,r=this.wireframeMaterial.uniforms,n=this.pickingMaterial.uniforms;for(var o in t)"opacity"===o&&e.setProperties({transparent:e.transparent}),void 0!==i[o]&&(i[o].value.isVector3?i[o].value.copy(t[o]):i[o].value.set?i[o].value.set(t[o]):i[o].value=t[o]),void 0!==r[o]&&(r[o].value.isVector3?r[o].value.copy(t[o]):r[o].value.set?r[o].value.set(t[o]):r[o].value=t[o]),void 0!==n[o]&&(n[o].value.isVector3?n[o].value.copy(t[o]):n[o].value.set?n[o].value.set(t[o]):n[o].value=t[o])}},mv.prototype.setProperties=function(t){var e=this;if(t){var i=this.material,r=this.wireframeMaterial,n=this.pickingMaterial;for(var o in t){var a=t[o];"transparent"===o?e.updateRenderOrder():"side"===o&&(a=Xo(a)),void 0!==i[o]&&(i[o]=a),void 0!==r[o]&&(r[o]=a),void 0!==n[o]&&(n[o]=a)}i.needsUpdate=!0,r.needsUpdate=!0,n.needsUpdate=!0}},mv.prototype.setVisibility=function(t){this.visible=t,this.wireframe?(this.group.visible=!1,this.wireframeGroup.visible=t,this.pickable&&(this.pickingGroup.visible=!1)):(this.group.visible=t,this.wireframeGroup.visible=!1,this.pickable&&(this.pickingGroup.visible=t))},mv.prototype.dispose=function(){this.material&&this.material.dispose(),this.wireframeMaterial&&this.wireframeMaterial.dispose(),this.pickingMaterial&&this.pickingMaterial.dispose(),this.geometry.dispose(),this.wireframeGeometry&&this.wireframeGeometry.dispose()},Object.defineProperties(mv.prototype,gv);var vv=function(t){function e(e,i){t.call(this,e,i);var r=e||{};this.addAttributes({normal:{type:"v3",value:r.normal}}),void 0===r.normal&&this.geometry.computeVertexNormals()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexShader:{},fragmentShader:{}};return i.vertexShader.get=function(){return"Mesh.vert"},i.fragmentShader.get=function(){return"Mesh.frag"},Object.defineProperties(e.prototype,i),e}(mv),yv=new p,bv=new dt,xv=function(t){function e(e,i,r){var n,o,a,s,c,u=i||{},l=e.position.length/3;r.vertices&&r.faces?(a=qo(r),s=Zo(r),c=Yo(r),n=r.vertices.length,o=r.faces.length):(a=r.attributes.position.array,s=r.attributes.normal.array,c=r.index.array,n=a.length/3,o=c.length/3);var h=l*n,d=new Float32Array(3*h),f=new Float32Array(3*h),p=new Float32Array(3*h),m=new Float32Array(3*h),g=h>65535?Uint32Array:Uint16Array,v=new g(l*o*3);t.call(this,{position:d,color:p,index:v,normal:f,pickingColor:m},u),this.geoPosition=a,this.geoNormal=s,this.geoIndex=c,this.positionCount=l,this.geoPositionCount=n,this.geoFacesCount=o,this.transformedGeoPosition=new Float32Array(3*n),this.transformedGeoNormal=new Float32Array(3*n),this.meshPosition=d,this.meshColor=p,this.meshIndex=v,this.meshNormal=f,this.meshPickingColor=m,this.meshIndex=v,this.makeIndex()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={updateNormals:{}};return e.prototype.applyPositionTransform=function(){},e.prototype.setAttributes=function(t,e){var i,r,n,o,a,s,c,u,l,h,d,f=this,p=this.geometry.attributes,m=this.updateNormals;t.position&&(i=t.position,o=this.geoPosition,u=this.meshPosition,s=this.transformedGeoPosition,p.position.needsUpdate=!0,(m||e)&&(a=this.geoNormal,d=this.meshNormal,c=this.transformedGeoNormal,p.normal.needsUpdate=!0)),t.color&&(r=t.color,l=this.meshColor,p.color.needsUpdate=!0),t.pickingColor&&(n=t.pickingColor,h=this.meshPickingColor,p.pickingColor.needsUpdate=!0);for(var g=this.positionCount,v=this.geoPositionCount,y=0;y<g;++y){var b,x,_=y*v*3,w=3*y;if(i&&(s.set(o),yv.makeTranslation(i[w],i[w+1],i[w+2]),f.applyPositionTransform(yv,y,w),yv.applyToVector3Array(s),u.set(s,_),m?(c.set(a),bv.getNormalMatrix(yv),bv.applyToVector3Array(c),d.set(c,_)):e&&d.set(a,_)),r)for(b=0;b<v;++b)x=_+3*b,l[x]=r[w],l[x+1]=r[w+1],l[x+2]=r[w+2];if(n)for(b=0;b<v;++b)x=_+3*b,h[x]=n[w],h[x+1]=n[w+1],h[x+2]=n[w+2]}},e.prototype.makeIndex=function(){var t,e,i,r,n=this.geoIndex,o=this.meshIndex,a=this.positionCount,s=this.geoPositionCount,c=this.geoFacesCount,u=3*c;for(e=0;e<a;++e)for(i=e*u,r=i+u,o.set(n,i),t=i;t<r;++t)o[t]+=e*s},i.updateNormals.get=function(){return!1},Object.defineProperties(e.prototype,i),e}(vv),_v=new g,wv=function(t){function e(e,i){var r=i||{},n=Hi(r.sphereDetail,1),o=new Ui(1,n);t.call(this,e,r,o),this.setAttributes(e,!0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.applyPositionTransform=function(t,e){var i=this._radius[e];_v.set(i,i,i),t.scale(_v)},e.prototype.setAttributes=function(e,i){e.radius&&(this._radius=e.radius),t.prototype.setAttributes.call(this,e,i)},e}(xv);em.add("shader/SphereImpostor.vert","uniform mat4 projectionMatrixInverse;\nuniform float nearClip;\nvarying float vRadius;\nvarying float vRadiusSq;\nvarying vec3 vPoint;\nvarying vec3 vPointViewPosition;\nattribute vec2 mapping;\nattribute float radius;\n#ifdef PICKING\nattribute vec3 pickingColor;\nvarying vec3 vPickingColor;\n#else\n#include color_pars_vertex\n#endif\nconst mat4 D = mat4(\n1.0, 0.0, 0.0, 0.0,\n0.0, 1.0, 0.0, 0.0,\n0.0, 0.0, 1.0, 0.0,\n0.0, 0.0, 0.0, -1.0\n);\nmat4 transpose( in mat4 inMatrix ) {\nvec4 i0 = inMatrix[0];\nvec4 i1 = inMatrix[1];\nvec4 i2 = inMatrix[2];\nvec4 i3 = inMatrix[3];\nmat4 outMatrix = mat4(\nvec4(i0.x, i1.x, i2.x, i3.x),\nvec4(i0.y, i1.y, i2.y, i3.y),\nvec4(i0.z, i1.z, i2.z, i3.z),\nvec4(i0.w, i1.w, i2.w, i3.w)\n);\nreturn outMatrix;\n}\nvoid ComputePointSizeAndPositionInClipCoordSphere(){\nvec2 xbc;\nvec2 ybc;\nmat4 T = mat4(\nradius, 0.0, 0.0, 0.0,\n0.0, radius, 0.0, 0.0,\n0.0, 0.0, radius, 0.0,\nposition.x, position.y, position.z, 1.0\n);\nmat4 R = transpose( projectionMatrix * modelViewMatrix * T );\nfloat A = dot( R[ 3 ], D * R[ 3 ] );\nfloat B = -2.0 * dot( R[ 0 ], D * R[ 3 ] );\nfloat C = dot( R[ 0 ], D * R[ 0 ] );\nxbc[ 0 ] = ( -B - sqrt( B * B - 4.0 * A * C ) ) / ( 2.0 * A );\nxbc[ 1 ] = ( -B + sqrt( B * B - 4.0 * A * C ) ) / ( 2.0 * A );\nfloat sx = abs( xbc[ 0 ] - xbc[ 1 ] ) * 0.5;\nA = dot( R[ 3 ], D * R[ 3 ] );\nB = -2.0 * dot( R[ 1 ], D * R[ 3 ] );\nC = dot( R[ 1 ], D * R[ 1 ] );\nybc[ 0 ] = ( -B - sqrt( B * B - 4.0 * A * C ) ) / ( 2.0 * A );\nybc[ 1 ] = ( -B + sqrt( B * B - 4.0 * A * C ) ) / ( 2.0 * A );\nfloat sy = abs( ybc[ 0 ] - ybc[ 1 ] ) * 0.5;\ngl_Position.xy = vec2( 0.5 * ( xbc.x + xbc.y ), 0.5 * ( ybc.x + ybc.y ) );\ngl_Position.xy -= mapping * vec2( sx, sy );\ngl_Position.xy *= gl_Position.w;\n}\nvoid main(void){\n#ifdef PICKING\nvPickingColor = pickingColor;\n#else\n#include color_vertex\n#endif\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nmvPosition.z -= radius;\ngl_Position = projectionMatrix * vec4( mvPosition.xyz, 1.0 );\nComputePointSizeAndPositionInClipCoordSphere();\nvRadius = radius;\nvRadiusSq = radius * radius;\nvec4 vPoint4 = projectionMatrixInverse * gl_Position;\nvPoint = vPoint4.xyz / vPoint4.w;\nvPointViewPosition = -mvPosition.xyz / mvPosition.w;\n}"),em.add("shader/SphereImpostor.frag","#define STANDARD\n#define IMPOSTOR\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float nearClip;\nuniform mat4 projectionMatrix;\nuniform float ortho;\nvarying float vRadius;\nvarying float vRadiusSq;\nvarying vec3 vPoint;\nvarying vec3 vPointViewPosition;\n#ifdef PICKING\nuniform float objectId;\nvarying vec3 vPickingColor;\n#else\n#include common\n#include color_pars_fragment\n#include fog_pars_fragment\n#include bsdfs\n#include lights_pars\n#include lights_physical_pars_fragment\n#endif\nbool flag2 = false;\nbool interior = false;\nvec3 cameraPos;\nvec3 cameraNormal;\nfloat calcDepth( in vec3 cameraPos ){\nvec2 clipZW = cameraPos.z * projectionMatrix[2].zw + projectionMatrix[3].zw;\nreturn 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\nfloat calcClip( vec3 cameraPos ){\nreturn dot( vec4( cameraPos, 1.0 ), vec4( 0.0, 0.0, 1.0, nearClip - 0.5 ) );\n}\nbool Impostor( out vec3 cameraPos, out vec3 cameraNormal ){\nvec3 cameraSpherePos = -vPointViewPosition;\ncameraSpherePos.z += vRadius;\nvec3 rayOrigin = mix( vec3( 0.0, 0.0, 0.0 ), vPoint, ortho );\nvec3 rayDirection = mix( normalize( vPoint ), vec3( 0.0, 0.0, 1.0 ), ortho );\nvec3 cameraSphereDir = mix( cameraSpherePos, rayOrigin - cameraSpherePos, ortho );\nfloat B = dot( rayDirection, cameraSphereDir );\nfloat det = B * B + vRadiusSq - dot( cameraSphereDir, cameraSphereDir );\nif( det < 0.0 ){\ndiscard;\nreturn false;\n}else{\nfloat sqrtDet = sqrt( det );\nfloat posT = mix( B + sqrtDet, B + sqrtDet, ortho );\nfloat negT = mix( B - sqrtDet, sqrtDet - B, ortho );\ncameraPos = rayDirection * negT + rayOrigin;\n#ifdef NEAR_CLIP\nif( calcDepth( cameraPos ) <= 0.0 ){\ncameraPos = rayDirection * posT + rayOrigin;\ninterior = true;\nreturn false;\n}else if( calcClip( cameraPos ) > 0.0 ){\ncameraPos = rayDirection * posT + rayOrigin;\ninterior = true;\nflag2 = true;\nreturn false;\n}else{\ncameraNormal = normalize( cameraPos - cameraSpherePos );\n}\n#else\nif( calcDepth( cameraPos ) <= 0.0 ){\ncameraPos = rayDirection * posT + rayOrigin;\ninterior = true;\nreturn false;\n}else{\ncameraNormal = normalize( cameraPos - cameraSpherePos );\n}\n#endif\nreturn true;\n}\nreturn false;\n}\nvoid main(void){\nbool flag = Impostor( cameraPos, cameraNormal );\n#ifdef NEAR_CLIP\nif( calcClip( cameraPos ) > 0.0 )\ndiscard;\n#endif\ngl_FragDepthEXT = calcDepth( cameraPos );\nif( !flag ){\n#ifdef NEAR_CLIP\nif( flag2 ){\ngl_FragDepthEXT = max( 0.0, calcDepth( vec3( - ( nearClip - 0.5 ) ) ) + ( 0.0000001 / vRadius ) );\n}else if( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n#else\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n#endif\n}\nif (gl_FragDepthEXT < 0.0)\ndiscard;\nif (gl_FragDepthEXT > 1.0)\ndiscard;\n#ifdef PICKING\ngl_FragColor = vec4( vPickingColor, objectId );\n#else\nvec3 vNormal = cameraNormal;\nvec3 vViewPosition = -cameraPos;\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\n#include normal_flip\n#include normal_fragment\nif( interior ){\nnormal = vec3( 0.0, 0.0, 0.4 );\n}\n#include lights_physical_fragment\n#include lights_template\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");var Sv=function(t){function e(e,i){t.call(this,e,i);var r=this.attributeSize>65535?Uint32Array:Uint16Array;this.index=new r(this.indexSize),this.makeIndex(),this.initIndex(this.index,1),this.addAttributes({mapping:{type:this.mappingType,value:null}})}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={attributeSize:{},indexSize:{},mapping:{},mappingIndices:{},mappingIndicesSize:{},mappingType:{},mappingSize:{},mappingItemSize:{}};return i.attributeSize.get=function(){return this.size*this.mappingSize},i.indexSize.get=function(){return this.size*this.mappingIndicesSize},i.mapping.get=function(){},i.mappingIndices.get=function(){},i.mappingIndicesSize.get=function(){},i.mappingType.get=function(){},i.mappingSize.get=function(){},i.mappingItemSize.get=function(){},e.prototype.addAttributes=function(e){var i={};for(var r in e){var n=e[r];i[r]={type:n.type,value:null}}t.prototype.addAttributes.call(this,i)},e.prototype.setAttributes=function(t){t&&!t.position&&t.position1&&t.position2&&(t.position=Wr(t.position1,t.position2));var e,i,r,n,o,a,s,c=this.size,u=this.mappingSize,l=this.geometry.attributes;for(var h in t)if("index"!==h){i=t[h],e=l[h],r=e.itemSize,n=e.array;for(var d=0;d<c;++d){o=d*r,a=o*u;for(var f=0;f<u;++f){s=a+r*f;for(var p=0;p<r;++p)n[s+p]=i[o+p]}}e.needsUpdate=!0}},e.prototype.makeMapping=function(){for(var t=this.size,e=this.mapping,i=this.mappingSize,r=this.mappingItemSize,n=this.geometry.attributes.mapping.array,o=0;o<t;o++)n.set(e,o*r*i)},e.prototype.makeIndex=function(){for(var t,e,i=this.size,r=this.mappingSize,n=this.mappingIndices,o=this.mappingIndicesSize,a=this.index,s=0;s<i;s++){t=s*o,e=s*r,a.set(n,t);for(var c=0;c<o;++c)a[t+c]+=e}},Object.defineProperties(e.prototype,i),e}(mv),Av=new Float32Array([-1,1,-1,-1,1,1,1,-1]),Mv=new Uint16Array([0,1,2,1,3,2]),Pv=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={mapping:{},mappingIndices:{},mappingIndicesSize:{},mappingType:{},mappingSize:{},mappingItemSize:{}};return i.mapping.get=function(){return Av},i.mappingIndices.get=function(){return Mv},i.mappingIndicesSize.get=function(){return 6},i.mappingType.get=function(){return"v2"},i.mappingSize.get=function(){return 4},i.mappingItemSize.get=function(){return 2},Object.defineProperties(e.prototype,i),e}(Sv),Cv=function(t){function e(e,i){t.call(this,e,i),this.addUniforms({projectionMatrixInverse:{value:new p},ortho:{value:0}}),this.addAttributes({radius:{type:"f",value:null}}),this.setAttributes(e),this.makeMapping()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={impostor:{},vertexShader:{},fragmentShader:{}};return i.impostor.get=function(){return!0},i.vertexShader.get=function(){return"SphereImpostor.vert"},i.fragmentShader.get=function(){return"SphereImpostor.frag"},Object.defineProperties(e.prototype,i),e}(Pv),Tv=new g,Ev=new g,Iv=new g,Lv=new g(0,0,0),Rv=function(t){function e(e,i){var r=i||{},n=Hi(r.sphereDetail,2),o=new Ui(1,n);t.call(this,e,r,o),this.setAttributes(e,!0)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={updateNormals:{}};return e.prototype.applyPositionTransform=function(t,e,i){Ev.fromArray(this._majorAxis,i),Iv.fromArray(this._minorAxis,i),t.lookAt(Lv,Ev,Iv),Tv.set(this._radius[e],Iv.length(),Ev.length()),t.scale(Tv)},e.prototype.setAttributes=function(e,i){e.radius&&(this._radius=e.radius),e.majorAxis&&(this._majorAxis=e.majorAxis),e.minorAxis&&(this._minorAxis=e.minorAxis),t.prototype.setAttributes.call(this,e,i)},i.updateNormals.get=function(){return!0},Object.defineProperties(e.prototype,i),e}(xv),Ov=new g,Dv=new g,Nv=new g,kv=new g(0,1,0),Fv=function(t){function e(e,i){var r=i||{},n=Hi(r.radialSegments,10),o=Hi(r.openEnded,!0),a=(new p).makeRotationX(Math.PI/2),s=new Bi(1,1,1,n,1,o);s.applyMatrix(a);var c=e.position1.length,u=e.radius.length,l=new Float32Array(2*c),h=new Float32Array(2*c),d=new Float32Array(2*c);t.call(this,{position:l,color:h,pickingColor:d},r,s),this.__center=new Float32Array(c),
	this._position=l,this._color=h,this._pickingColor=d,this._from=new Float32Array(2*c),this._to=new Float32Array(2*c),this._radius=new Float32Array(2*u),this.setAttributes(e,!0)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={updateNormals:{}};return e.prototype.applyPositionTransform=function(t,e,i){Dv.fromArray(this._from,i),Nv.fromArray(this._to,i),t.lookAt(Dv,Nv,kv);var r=this._radius[e];Ov.set(r,r,Dv.distanceTo(Nv)),t.scale(Ov)},e.prototype.setAttributes=function(e,i){var r=this._position.length/2,n=this._radius.length/2,o={};e.position1&&e.position2&&(Wr(e.position1,e.position2,this.__center),Wr(e.position1,this.__center,this._position),Wr(this.__center,e.position2,this._position,r),this._from.set(e.position1),this._from.set(this.__center,r),this._to.set(this.__center),this._to.set(e.position2,r),o.position=this._position),e.color&&e.color2&&(this._color.set(e.color),this._color.set(e.color2,r),o.color=this._color),e.pickingColor&&e.pickingColor2&&(this._pickingColor.set(e.pickingColor),this._pickingColor.set(e.pickingColor2,r),o.pickingColor=this._pickingColor),e.radius&&(this._radius.set(e.radius),this._radius.set(e.radius,n)),t.prototype.setAttributes.call(this,o,i)},i.updateNormals.get=function(){return!0},Object.defineProperties(e.prototype,i),e}(xv);em.add("shader/CylinderImpostor.vert","\nattribute vec3 mapping;\nattribute vec3 position1;\nattribute vec3 position2;\nattribute float radius;\nvarying vec3 axis;\nvarying vec4 base_radius;\nvarying vec4 end_b;\nvarying vec3 U;\nvarying vec3 V;\nvarying vec4 w;\n#ifdef PICKING\nattribute vec3 pickingColor;\nattribute vec3 pickingColor2;\nvarying vec3 vPickingColor;\nvarying vec3 vPickingColor2;\n#else\nattribute vec3 color2;\nvarying vec3 vColor1;\nvarying vec3 vColor2;\n#endif\nuniform mat4 modelViewMatrixInverse;\nuniform float ortho;\nvoid main(){\n#ifdef PICKING\nvPickingColor = pickingColor;\nvPickingColor2 = pickingColor2;\n#else\nvColor1 = color;\nvColor2 = color2;\n#endif\nbase_radius.w = radius;\nvec3 center = position;\nvec3 dir = normalize( position2 - position1 );\nfloat ext = length( position2 - position1 ) / 2.0;\nvec3 cam_dir;\nif( ortho == 0.0 ){\ncam_dir = ( modelViewMatrixInverse * vec4( 0, 0, 0, 1 ) ).xyz - center;\n}else{\ncam_dir = ( modelViewMatrixInverse * vec4( 0, 0, 1, 0 ) ).xyz;\n}\ncam_dir = normalize( cam_dir );\nvec3 ldir;\nfloat b = dot( cam_dir, dir );\nend_b.w = b;\nif( b < 0.0 )\nldir = -ext * dir;\nelse\nldir = ext * dir;\nvec3 left = normalize( cross( cam_dir, ldir ) );\nleft = radius * left;\nvec3 up = radius * normalize( cross( left, ldir ) );\naxis = normalize( normalMatrix * ldir );\nU = normalize( normalMatrix * up );\nV = normalize( normalMatrix * left );\nvec4 base4 = modelViewMatrix * vec4( center - ldir, 1.0 );\nbase_radius.xyz = base4.xyz / base4.w;\nvec4 top_position = modelViewMatrix * vec4( center + ldir, 1.0 );\nvec4 end4 = top_position;\nend_b.xyz = end4.xyz / end4.w;\nw = modelViewMatrix * vec4(\ncenter + mapping.x*ldir + mapping.y*left + mapping.z*up, 1.0\n);\ngl_Position = projectionMatrix * w;\ngl_Position.z = 0.99;\n}"),em.add("shader/CylinderImpostor.frag","#define STANDARD\n#define IMPOSTOR\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float nearClip;\nuniform mat4 projectionMatrix;\nuniform float ortho;\nvarying vec3 axis;\nvarying vec4 base_radius;\nvarying vec4 end_b;\nvarying vec3 U;\nvarying vec3 V;\nvarying vec4 w;\n#ifdef PICKING\nuniform float objectId;\nvarying vec3 vPickingColor;\nvarying vec3 vPickingColor2;\n#else\nvarying vec3 vColor1;\nvarying vec3 vColor2;\n#include common\n#include fog_pars_fragment\n#include bsdfs\n#include lights_pars\n#include lights_physical_pars_fragment\n#endif\nbool interior = false;\nfloat distSq3( vec3 v3a, vec3 v3b ){\nreturn (\n( v3a.x - v3b.x ) * ( v3a.x - v3b.x ) +\n( v3a.y - v3b.y ) * ( v3a.y - v3b.y ) +\n( v3a.z - v3b.z ) * ( v3a.z - v3b.z )\n);\n}\nfloat calcDepth( in vec3 cameraPos ){\nvec2 clipZW = cameraPos.z * projectionMatrix[2].zw + projectionMatrix[3].zw;\nreturn 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\nfloat calcClip( vec3 cameraPos ){\nreturn dot( vec4( cameraPos, 1.0 ), vec4( 0.0, 0.0, 1.0, nearClip - 0.5 ) );\n}\nvoid main(){\nvec3 point = w.xyz / w.w;\nvec3 base = base_radius.xyz;\nfloat vRadius = base_radius.w;\nvec3 end = end_b.xyz;\nfloat b = end_b.w;\nvec3 end_cyl = end;\nvec3 surface_point = point;\nvec3 ray_target = surface_point;\nvec3 ray_origin = vec3(0.0);\nvec3 ray_direction = mix(normalize(ray_origin - ray_target), vec3(0.0, 0.0, 1.0), ortho);\nmat3 basis = mat3( U, V, axis );\nvec3 diff = ray_target - 0.5 * (base + end_cyl);\nvec3 P = diff * basis;\nfloat dz = dot( axis, ray_direction );\nfloat radius2 = vRadius*vRadius;\nvec3 D = vec3(dot(U, ray_direction),\ndot(V, ray_direction),\ndz);\nfloat a0 = P.x*P.x + P.y*P.y - radius2;\nfloat a1 = P.x*D.x + P.y*D.y;\nfloat a2 = D.x*D.x + D.y*D.y;\nfloat d = a1*a1 - a0*a2;\nif (d < 0.0)\ndiscard;\nfloat dist = (-a1 + sqrt(d)) / a2;\nvec3 new_point = ray_target + dist * ray_direction;\nvec3 tmp_point = new_point - base;\nvec3 _normal = normalize( tmp_point - axis * dot(tmp_point, axis) );\nray_origin = mix( ray_origin, surface_point, ortho );\nfloat front_cap_test = dot( tmp_point, axis );\nfloat end_cap_test = dot((new_point - end_cyl), axis);\n#ifndef CAP\nvec3 new_point2 = ray_target + ( (-a1 - sqrt(d)) / a2 ) * ray_direction;\nvec3 tmp_point2 = new_point2 - base;\n#endif\nif (front_cap_test < 0.0)\n{\nfloat dNV = dot(-axis, ray_direction);\nif (dNV < 0.0)\ndiscard;\nfloat near = dot(-axis, (base)) / dNV;\nvec3 front_point = ray_direction * near + ray_origin;\nif (dot(front_point - base, front_point-base) > radius2)\ndiscard;\n#ifdef CAP\nnew_point = front_point;\n_normal = axis;\n#else\nnew_point = ray_target + ( (-a1 - sqrt(d)) / a2 ) * ray_direction;\ndNV = dot(-axis, ray_direction);\nnear = dot(axis, end_cyl) / dNV;\nnew_point2 = ray_direction * near + ray_origin;\nif (dot(new_point2 - end_cyl, new_point2-base) < radius2)\ndiscard;\ninterior = true;\n#endif\n}\nif( end_cap_test > 0.0 )\n{\nfloat dNV = dot(axis, ray_direction);\nif (dNV < 0.0)\ndiscard;\nfloat near = dot(axis, end_cyl) / dNV;\nvec3 end_point = ray_direction * near + ray_origin;\nif( dot(end_point - end_cyl, end_point-base) > radius2 )\ndiscard;\n#ifdef CAP\nnew_point = end_point;\n_normal = axis;\n#else\nnew_point = ray_target + ( (-a1 - sqrt(d)) / a2 ) * ray_direction;\ndNV = dot(-axis, ray_direction);\nnear = dot(-axis, (base)) / dNV;\nnew_point2 = ray_direction * near + ray_origin;\nif (dot(new_point2 - base, new_point2-base) < radius2)\ndiscard;\ninterior = true;\n#endif\n}\ngl_FragDepthEXT = calcDepth( new_point );\n#ifdef NEAR_CLIP\nif( calcClip( new_point ) > 0.0 ){\ndist = (-a1 - sqrt(d)) / a2;\nnew_point = ray_target + dist * ray_direction;\nif( calcClip( new_point ) > 0.0 )\ndiscard;\ninterior = true;\ngl_FragDepthEXT = calcDepth( new_point );\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = max( 0.0, calcDepth( vec3( - ( nearClip - 0.5 ) ) ) + ( 0.0000001 / vRadius ) );\n}\n}else if( gl_FragDepthEXT <= 0.0 ){\ndist = (-a1 - sqrt(d)) / a2;\nnew_point = ray_target + dist * ray_direction;\ninterior = true;\ngl_FragDepthEXT = calcDepth( new_point );\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n}\n#else\nif( gl_FragDepthEXT <= 0.0 ){\ndist = (-a1 - sqrt(d)) / a2;\nnew_point = ray_target + dist * ray_direction;\ninterior = true;\ngl_FragDepthEXT = calcDepth( new_point );\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / vRadius );\n}\n}\n#endif\nif (gl_FragDepthEXT < 0.0)\ndiscard;\nif (gl_FragDepthEXT > 1.0)\ndiscard;\n#ifdef PICKING\nif( distSq3( new_point, end_cyl ) < distSq3( new_point, base ) ){\nif( b < 0.0 ){\ngl_FragColor = vec4( vPickingColor, objectId );\n}else{\ngl_FragColor = vec4( vPickingColor2, objectId );\n}\n}else{\nif( b > 0.0 ){\ngl_FragColor = vec4( vPickingColor, objectId );\n}else{\ngl_FragColor = vec4( vPickingColor2, objectId );\n}\n}\n#else\nvec3 vViewPosition = -new_point;\nvec3 vNormal = _normal;\nvec3 vColor;\nif( distSq3( new_point, end_cyl ) < distSq3( new_point, base ) ){\nif( b < 0.0 ){\nvColor = vColor1;\n}else{\nvColor = vColor2;\n}\n}else{\nif( b > 0.0 ){\nvColor = vColor1;\n}else{\nvColor = vColor2;\n}\n}\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\nvec3 normal = normalize( vNormal );\nif( interior ){\nnormal = vec3( 0.0, 0.0, 0.4 );\n}\n#include lights_physical_fragment\n#include lights_template\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");var Bv=new Float32Array([-1,1,-1,-1,-1,-1,1,1,-1,1,1,1,1,-1,-1,1,-1,1]),zv=new Uint16Array([0,1,2,1,4,2,2,4,3,4,5,3]),Uv=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={mapping:{},mappingIndices:{},mappingIndicesSize:{},mappingType:{},mappingSize:{},mappingItemSize:{}};return i.mapping.get=function(){return Bv},i.mappingIndices.get=function(){return zv},i.mappingIndicesSize.get=function(){return 12},i.mappingType.get=function(){return"v3"},i.mappingSize.get=function(){return 6},i.mappingItemSize.get=function(){return 3},Object.defineProperties(e.prototype,i),e}(Sv),jv=function(t){function e(e,i){t.call(this,e,i);var r=i||{};this.openEnded=Hi(r.openEnded,!1);var n=new Di(new p).onUpdate(function(t){this.value.getInverse(t.modelViewMatrix)});this.addUniforms({modelViewMatrixInverse:n,ortho:{value:0}}),this.addAttributes({position1:{type:"v3",value:null},position2:{type:"v3",value:null},color2:{type:"c",value:null},radius:{type:"f",value:null}}),e.pickingColor2&&this.addAttributes({pickingColor2:{type:"c",value:null}}),this.setAttributes(e),this.makeMapping()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={parameters:{},impostor:{},vertexShader:{},fragmentShader:{}};return i.parameters.get=function(){return Object.assign.call(this,{openEnded:{updateShader:!0}},t.prototype.parameters)},e.prototype.getDefines=function(e){var i=t.prototype.getDefines.call(this,e);return this.openEnded||(i.CAP=1),i},i.impostor.get=function(){return!0},i.vertexShader.get=function(){return"CylinderImpostor.vert"},i.fragmentShader.get=function(){return"CylinderImpostor.frag"},Object.defineProperties(e.prototype,i),e}(Uv),$v=new g,Vv=new g,Gv=new g,Hv=new g(0,1,0),Wv=function(t){function e(e,i){var r=i||{},n=Hi(r.radialSegments,60),o=Hi(r.openEnded,!1),a=(new p).makeRotationX(-Math.PI/2),s=new $i(1,1,n,1,o);s.applyMatrix(a);var c=e.position1.length,u=e.radius.length,l=new Float32Array(c);t.call(this,{position:l,color:e.color,pickingColor:e.pickingColor},r,s),this._position=l,this._from=new Float32Array(c),this._to=new Float32Array(c),this._radius=new Float32Array(u),this.setAttributes(e,!0)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={updateNormals:{}};return e.prototype.applyPositionTransform=function(t,e,i){Vv.fromArray(this._from,i),Gv.fromArray(this._to,i),t.lookAt(Vv,Gv,Hv);var r=this._radius[e];$v.set(r,r,Vv.distanceTo(Gv)),t.scale($v)},e.prototype.setAttributes=function(e,i){var r={};e.position1&&e.position2&&(Wr(e.position1,e.position2,this._position),this._from.set(e.position1),this._to.set(e.position2),r.position=this._position),e.color&&(r.color=e.color),e.pickingColor&&(r.pickingColor=e.pickingColor),e.radius&&this._radius.set(e.radius),t.prototype.setAttributes.call(this,r,i)},i.updateNormals.get=function(){return!0},Object.defineProperties(e.prototype,i),e}(xv),Xv=function(t,e){var i=t||{},r=e||{};this.aspectRatio=Hi(r.aspectRatio,1.5),this.wireframe=Hi(r.wireframe,!1);var n=Hi(r.radialSegments,50),o=Hi(r.openEnded,!1),a=Hi(r.disableImpostor,!1);this.splitPosition=new Float32Array(i.position1.length),this.cylinderRadius=new Float32Array(i.radius.length);var s=this.makeAttributes(i);this.cylinderBuffer=new Jo(s.cylinder,{radialSegments:n,openEnded:o,disableImpostor:a}),this.coneBuffer=new ta(s.cone,{radialSegments:n,openEnded:o,disableImpostor:a}),this.geometry=[this.cylinderBuffer.geometry,this.coneBuffer.geometry],this.group=new Ae,this.wireframeGroup=new Ae,this.pickingGroup=new Ae};Xv.prototype.makeAttributes=function(t){var e,i,r=this.splitPosition,n=this.cylinderRadius,o=this.aspectRatio,a={},s={};if(t.radius){for(e=0,i=n.length;e<i;++e)n[e]=t.radius[e]/o;a.radius=n,s.radius=t.radius}if(t.position1&&t.position2){var c=new g,u=new g,l=new g,h=new g;for(e=0,i=r.length;e<i;e+=3){c.fromArray(t.position1,e),u.fromArray(t.position2,e),l.subVectors(c,u);var d=l.length(),f=n[e/3]*o*2,p=Math.min(d,f);l.setLength(p),h.copy(u).add(l),h.toArray(r,e)}a.position1=t.position1,a.position2=r,s.position1=r,s.position2=t.position2}return t.color&&(a.color=t.color,a.color2=t.color,s.color=t.color),t.pickingColor&&(a.pickingColor=t.pickingColor,a.pickingColor2=t.pickingColor,s.pickingColor=t.pickingColor),{cylinder:a,cone:s}},Xv.prototype.getMesh=function(t){return(new Ae).add(this.cylinderBuffer.getMesh(t),this.coneBuffer.getMesh(t))},Xv.prototype.getWireframeMesh=function(){return(new Ae).add(this.cylinderBuffer.getWireframeMesh(),this.coneBuffer.getWireframeMesh())},Xv.prototype.getPickingMesh=function(){return(new Ae).add(this.cylinderBuffer.getPickingMesh(),this.coneBuffer.getPickingMesh())},Xv.prototype.setAttributes=function(t){var e=this.makeAttributes(t);this.cylinderBuffer.setAttributes({position1:e.cylinderFrom,position2:e.cylinderTo,color:e.cylinderColor,color2:e.cylinderColor2,radius:e.radius,pickingColor:e.cylinderPickingColor,pickingColor2:e.cylinderPickingColor2}),this.coneBuffer.setAttributes({position1:e.coneFrom,position2:e.coneTo,color:e.coneColor,radius:e.coneRadius.radius,pickingColor:e.conePickingColor})},Xv.prototype.setParameters=function(t){this.cylinderBuffer.setParameters(t),this.coneBuffer.setParameters(t),t&&void 0!==t.wireframe&&(this.wireframe=t.wireframe,this.setVisibility(this.visible))},Xv.prototype.setVisibility=function(){mv.prototype.setVisibility.apply(this,arguments)},Xv.prototype.dispose=function(){this.cylinderBuffer.dispose(),this.coneBuffer.dispose()},ea.prototype.constructor=ea,ea.prototype.type="Shape",ia.prototype={constructor:ia,type:"",parameters:{lazy:{type:"boolean"},clipNear:{type:"range",step:1,max:100,min:0,buffer:!0},clipRadius:{type:"number",precision:1,max:1e3,min:0,buffer:!0},clipCenter:{type:"vector3",precision:1,buffer:!0},flatShaded:{type:"boolean",buffer:!0},opacity:{type:"range",step:.01,max:1,min:0,buffer:!0},side:{type:"select",buffer:!0,options:{front:"front",back:"back",double:"double"}},wireframe:{type:"boolean",buffer:!0},linewidth:{type:"integer",max:50,min:1,buffer:!0},colorScheme:{type:"select",update:"color",options:{}},colorScale:{type:"select",update:"color",options:Kp.getScales()},colorValue:{type:"color",update:"color"},colorDomain:{type:"hidden",update:"color"},colorMode:{type:"select",update:"color",options:Kp.getModes()},roughness:{type:"range",step:.01,max:1,min:0,buffer:!0},metalness:{type:"range",step:.01,max:1,min:0,buffer:!0},diffuse:{type:"color",buffer:!0}},init:function(t){var e=t||{};this.clipNear=Hi(e.clipNear,0),this.clipRadius=Hi(e.clipRadius,0),this.clipCenter=Hi(e.clipCenter,new g),this.flatShaded=Hi(e.flatShaded,!1),this.side=Hi(e.side,"double"),this.opacity=Hi(e.opacity,1),this.wireframe=Hi(e.wireframe,!1),this.linewidth=Hi(e.linewidth,2),this.setColor(e.color,e),this.colorScheme=Hi(e.colorScheme,"uniform"),this.colorScale=Hi(e.colorScale,""),this.colorValue=Hi(e.colorValue,9474192),this.colorDomain=Hi(e.colorDomain,""),this.colorMode=Hi(e.colorMode,"hcl"),this.visible=Hi(e.visible,!0),this.quality=Hi(e.quality,void 0),this.roughness=Hi(e.roughness,.4),this.metalness=Hi(e.metalness,0),this.diffuse=Hi(e.diffuse,16777215),this.lazy=Hi(e.lazy,!1),this.lazyProps={build:!1,bufferParams:{},what:{}};var i=this.parameters;i.sphereDetail===!0&&(i.sphereDetail={type:"integer",max:3,min:0,rebuild:"impostor"}),i.radialSegments===!0&&(i.radialSegments={type:"integer",max:25,min:5,rebuild:"impostor"}),i.openEnded===!0&&(i.openEnded={type:"boolean",rebuild:"impostor",buffer:!0}),i.disableImpostor===!0&&(i.disableImpostor={type:"boolean",rebuild:!0}),"low"===e.quality?(i.sphereDetail&&(this.sphereDetail=0),i.radialSegments&&(this.radialSegments=5)):"medium"===e.quality?(i.sphereDetail&&(this.sphereDetail=1),i.radialSegments&&(this.radialSegments=10)):"high"===e.quality?(i.sphereDetail&&(this.sphereDetail=2),i.radialSegments&&(this.radialSegments=20)):(i.sphereDetail&&(this.sphereDetail=Hi(e.sphereDetail,1)),i.radialSegments&&(this.radialSegments=Hi(e.radialSegments,10))),i.openEnded&&(this.openEnded=Hi(e.openEnded,!0)),i.disableImpostor&&(this.disableImpostor=Hi(e.disableImpostor,!1))},getColorParams:function(t){return Object.assign({gidPool:this.gidPool,scheme:this.colorScheme,scale:this.colorScale,value:this.colorValue,domain:this.colorDomain,mode:this.colorMode},t)},getBufferParams:function(t){return Object.assign({clipNear:this.clipNear,clipRadius:this.clipRadius,clipCenter:this.clipCenter,flatShaded:this.flatShaded,opacity:this.opacity,side:this.side,wireframe:this.wireframe,linewidth:this.linewidth,roughness:this.roughness,metalness:this.metalness,diffuse:this.diffuse},t)},setColor:function(t,e){var i=Object.keys(Kp.getSchemes());return i.includes(t)?e?e.colorScheme=t:this.setParameters({colorScheme:t}):void 0!==t&&(t=new ct(t).getHex(),e?(e.colorScheme="uniform",e.colorValue=t):this.setParameters({colorScheme:"uniform",colorValue:t})),this},prepare:!1,create:function(){},update:function(){this.build()},build:function(t){return this.lazy&&!this.visible?void(this.lazyProps.build=!0):this.prepare?(this.queue.length()>0?(this.tasks.change(1-this.queue.length()),this.queue.kill()):this.tasks.increment(),void this.queue.push(t||!1)):(this.tasks.increment(),void this.make())},make:function(e,i){t.Debug&&qp.time("Representation.make "+this.type);var r=function(){e?(this.update(e),this.viewer.requestRender(),this.tasks.decrement(),i&&i()):(this.clear(),this.create(),this.manualAttach||this.disposed||(t.Debug&&qp.time("Representation.attach "+this.type),this.attach(function(){t.Debug&&qp.timeEnd("Representation.attach "+this.type),this.tasks.decrement(),i&&i()}.bind(this)))),t.Debug&&qp.timeEnd("Representation.make "+this.type)}.bind(this);this.prepare?this.prepare(r):r()},attach:function(t){this.setVisibility(this.visible),t()},setVisibility:function(t,e){if(this.visible=t,this.visible){var i=this.lazyProps,r=i.bufferParams,n=i.what;if(i.build)return i.build=!1,void this.build();(Object.keys(r).length||Object.keys(n).length)&&(i.bufferParams={},i.what={},this.updateParameters(r,n))}return this.bufferList.forEach(function(e){e.setVisibility(t)}),e||this.viewer.requestRender(),this},setParameters:function(t,e,i){var r=this,n=t||{},o=this.parameters;e=e||{},i=i||!1;var a={};for(var s in n)void 0!==n[s]&&void 0!==o[s]&&(o[s].int&&(n[s]=parseInt(n[s])),o[s].float&&(n[s]=parseFloat(n[s])),n[s]!==r[s]&&(r[s]=n[s],o[s].buffer&&(o[s].buffer===!0?a[s]=n[s]:a[o[s].buffer]=n[s]),o[s].update&&(e[o[s].update]=!0),!o[s].rebuild||"impostor"===o[s].rebuild&&Xp&&!r.disableImpostor||(i=!0)));return i?this.build():this.updateParameters(a,e),this},updateParameters:function(t,e){return this.lazy&&!this.visible?(Object.assign(this.lazyProps.bufferParams,t),void Object.assign(this.lazyProps.what,e)):(this.bufferList.forEach(function(e){e.setParameters(t)}),Object.keys(e).length&&this.update(e),void this.viewer.requestRender())},getParameters:function(){var t={lazy:this.lazy,visible:this.visible,quality:this.quality};return Object.keys(this.parameters).forEach(function(e){null!==this.parameters[e]&&(t[e]=this[e])},this),t},clear:function(){this.bufferList.forEach(function(t){this.viewer.remove(t),t.dispose()},this),this.bufferList.length=0,this.viewer.requestRender()},dispose:function(){this.disposed=!0,this.queue.kill(),this.tasks.dispose(),this.clear()}},ra.prototype=Object.assign(Object.create(ia.prototype),{constructor:ra,type:"buffer",parameters:Object.assign({},ia.prototype.parameters,{colorScheme:null,colorScale:null,colorValue:null,colorDomain:null,colorMode:null}),create:function(){this.bufferList.push.apply(this.bufferList,this.buffer)},attach:function(t){this.bufferList.forEach(function(t){this.viewer.add(t),t.setParameters(this.getBufferParams())},this),this.setVisibility(this.visible),t()}});var qv=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"surface"},Object.defineProperties(e.prototype,i),e}(vv),Yv=function(t){this.size=t.size,this.side=t.side,this.wireframe=t.wireframe,this.visible=t.visible,this.geometry=t.geometry,this.pickable=t.pickable,this.background=t.background,this.group=new Ae,this.wireframeGroup=new Ae,this.pickingGroup=new Ae,this.frontMeshes=[],this.backMeshes=[];var e=t,i=new t.constructor;e.makeMaterial(),i.makeMaterial(),i.geometry=t.geometry,i.wireframeGeometry=t.wireframeGeometry,i.setParameters(t.getParameters()),i.updateShader(),e.setParameters({side:"front"}),i.setParameters({side:"back",opacity:i.opacity}),this.buffer=t,this.frontBuffer=e,this.backBuffer=i};Yv.prototype.getMesh=function(t){var e,i;return t?(i=this.backBuffer.getPickingMesh(),e=this.frontBuffer.getPickingMesh()):(i=this.backBuffer.getMesh(),e=this.frontBuffer.getMesh()),this.frontMeshes.push(e),this.backMeshes.push(i),this.setParameters({side:this.side}),(new Ae).add(i,e)},Yv.prototype.getWireframeMesh=function(){return this.buffer.getWireframeMesh()},Yv.prototype.getPickingMesh=function(){return this.getMesh(!0)},Yv.prototype.setAttributes=function(t){this.buffer.setAttributes(t)},Yv.prototype.setParameters=function(t){t=Object.assign({},t),"front"===t.side?(this.frontMeshes.forEach(na),this.backMeshes.forEach(oa)):"back"===t.side?(this.frontMeshes.forEach(oa),this.backMeshes.forEach(na)):"double"===t.side&&(this.frontMeshes.forEach(na),this.backMeshes.forEach(na)),void 0!==t.side&&(this.side=t.side),delete t.side,this.frontBuffer.setParameters(t),void 0!==t.wireframe&&(this.wireframe=t.wireframe,this.setVisibility(this.visible)),delete t.wireframe,this.backBuffer.setParameters(t)},Yv.prototype.dispose=function(){this.frontBuffer.dispose(),this.backBuffer.dispose()},Yv.prototype.setVisibility=mv.prototype.setVisibility,aa.prototype=Object.assign(Object.create(ia.prototype),{constructor:aa,type:"surface",parameters:Object.assign({isolevelType:{type:"select",options:{value:"value",sigma:"sigma"}},isolevel:{type:"number",precision:2,max:1e3,min:-1e3},smooth:{type:"integer",precision:1,max:10,min:0},background:{type:"boolean",rebuild:!0},opaqueBack:{type:"boolean",buffer:!0},boxSize:{type:"integer",precision:1,max:100,min:0},colorVolume:{type:"hidden"},useWorker:{type:"boolean",rebuild:!0}},ia.prototype.parameters),init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"uniform"),e.colorValue=Hi(e.colorValue,14540253),this.isolevelType=Hi(e.isolevelType,"sigma"),this.isolevel=Hi(e.isolevel,2),this.smooth=Hi(e.smooth,0),this.background=Hi(e.background,!1),this.opaqueBack=Hi(e.opaqueBack,!0),this.boxSize=Hi(e.boxSize,0),this.colorVolume=Hi(e.colorVolume,void 0),this.useWorker=Hi(e.useWorker,!0),ia.prototype.init.call(this,e)},attach:function(t){this.bufferList.forEach(function(t){this.viewer.add(t)},this),this.setVisibility(this.visible),t()},prepare:function(t){if(this.volume){var e;if(e="sigma"===this.isolevelType?this.volume.getValueForSigma(this.isolevel):this.isolevel,!this.surface||this.__isolevel!==e||this.__smooth!==this.smooth||this.__boxSize!==this.boxSize||this.boxSize>0&&!this.__boxCenter.equals(this.boxCenter)){this.__isolevel=e,this.__smooth=this.smooth,this.__boxSize=this.boxSize,this.__boxCenter.copy(this.boxCenter),this.__box.copy(this.box);var i=function(e){this.surface=e,t()}.bind(this);this.useWorker?this.volume.getSurfaceWorker(e,this.smooth,this.boxCenter,this.boxSize,i):i(this.volume.getSurface(e,this.smooth,this.boxCenter,this.boxSize))}else t()}else t()},getSurfaceData:function(){return{position:this.surface.getPosition(),color:this.surface.getColor(this.getColorParams()),index:this.surface.getIndex(),normal:this.surface.getNormal()}},create:function(){var t=new qv(this.getSurfaceData(),this.getBufferParams({background:this.background,opaqueBack:this.opaqueBack,dullInterior:!1})),e=new Yv(t);this.bufferList.push(e)},update:function(t){if(0!==this.bufferList.length){t=t||{};var e={};t.position&&(e.position=this.surface.getPosition()),t.color&&(e.color=this.surface.getColor(this.getColorParams())),t.index&&(e.index=this.surface.getIndex()),t.normal&&(e.normal=this.surface.getNormal()),this.bufferList.forEach(function(t){t.setAttributes(e)})}},setParameters:function(t,e,i){return t&&void 0!==t.isolevelType&&this.volume&&("value"===this.isolevelType&&"sigma"===t.isolevelType?this.isolevel=this.volume.getSigmaForValue(this.isolevel):"sigma"===this.isolevelType&&"value"===t.isolevelType&&(this.isolevel=this.volume.getValueForSigma(this.isolevel)),this.isolevelType=t.isolevelType),t&&t.boxCenter&&(this.boxCenter.copy(t.boxCenter),delete t.boxCenter),ia.prototype.setParameters.call(this,t,e,i),this.volume&&this.volume.getBox(this.boxCenter,this.boxSize,this.box),t&&void 0!==t.colorVolume&&(e.color=!0),this.surface&&(void 0!==t.isolevel||void 0!==t.smooth||void 0!==t.boxSize||this.boxSize>0&&!this.__box.equals(this.box))&&this.build({position:!0,color:!0,index:!0,normal:!0}),this},getColorParams:function(){var t=ia.prototype.getColorParams.call(this);return t.volume=this.colorVolume,t},dispose:function(){this.viewer.signals.ticked.remove(this.setBox,this),ia.prototype.dispose.call(this)}}),em.add("shader/Point.vert","uniform float nearClip;\nuniform float clipRadius;\nuniform vec3 clipCenter;\nuniform float size;\nuniform float canvasHeight;\nuniform float pixelRatio;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#include color_pars_vertex\n#include common\nvoid main(){\n#include color_vertex\n#include begin_vertex\n#include project_vertex\n#ifdef USE_SIZEATTENUATION\ngl_PointSize = size * pixelRatio * ( ( canvasHeight / 2.0 ) / -mvPosition.z );\n#else\ngl_PointSize = size * pixelRatio;\n#endif\nvViewPosition = -mvPosition.xyz;\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n#include radiusclip_vertex\n}"),em.add("shader/Point.frag","uniform vec3 diffuse;\nuniform float opacity;\nuniform float nearClip;\nuniform float clipRadius;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#ifdef USE_MAP\nuniform sampler2D map;\n#endif\n#include common\n#include color_pars_fragment\n#include fog_pars_fragment\nvoid main(){\n#include nearclip_fragment\n#include radiusclip_fragment\nvec3 outgoingLight = vec3( 0.0 );\nvec4 diffuseColor = vec4( diffuse, 1.0 );\n#ifdef USE_MAP\ndiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) );\n#endif\n#include color_fragment\n#include alphatest_fragment\noutgoingLight = diffuseColor.rgb;\ngl_FragColor = vec4( outgoingLight, diffuseColor.a * opacity );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n}");var Zv=function(t){function e(e,i){var r=i||{};t.call(this,e,r),this.pointSize=Hi(r.pointSize,1),this.sizeAttenuation=Hi(r.sizeAttenuation,!0),this.sortParticles=Hi(r.sortParticles,!1),this.alphaTest=Hi(r.alphaTest,.5),this.useTexture=Hi(r.useTexture,!1),this.forceTransparent=Hi(r.forceTransparent,!1),this.edgeBleach=Hi(r.edgeBleach,0),this.addUniforms({size:{value:this.pointSize},canvasHeight:{value:1},pixelRatio:{value:1},map:{value:null}})}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={parameters:{},point:{},vertexShader:{},fragmentShader:{}};return i.parameters.get=function(){return Object.assign.call(this,{pointSize:{uniform:"size"},sizeAttenuation:{updateShader:!0},sortParticles:{},alphaTest:{updateShader:!0},useTexture:{updateShader:!0},forceTransparent:{},edgeBleach:{uniform:!0}},t.prototype.parameters)},e.prototype.makeMaterial=function(){t.prototype.makeMaterial.call(this),this.makeTexture(),this.material.uniforms.map.value=this.tex,this.material.blending=$c,this.material.needsUpdate=!0,this.wireframeMaterial.uniforms.map.value=this.tex,this.wireframeMaterial.blending=$c,this.wireframeMaterial.needsUpdate=!0,this.pickingMaterial.uniforms.map.value=this.tex,this.pickingMaterial.blending=$c,this.pickingMaterial.needsUpdate=!0},e.prototype.makeTexture=function(){this.tex&&this.tex.dispose(),this.tex=sa({delta:this.edgeBleach})},e.prototype.getDefines=function(e){var i=t.prototype.getDefines.call(this,e);return this.sizeAttenuation&&(i.USE_SIZEATTENUATION=1),this.useTexture&&(i.USE_MAP=1),this.alphaTest>0&&this.alphaTest<=1&&(i.ALPHATEST=this.alphaTest.toPrecision(2)),i},e.prototype.setUniforms=function(e){e&&void 0!==e.edgeBleach&&(this.makeTexture(),e.map=this.tex),t.prototype.setUniforms.call(this,e)},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.tex&&this.tex.dispose()},i.point.get=function(){return!0},i.vertexShader.get=function(){return"Point.vert"},i.fragmentShader.get=function(){return"Point.frag"},Object.defineProperties(e.prototype,i),e}(mv);ca.prototype=Object.assign(Object.create(ia.prototype),{constructor:ca,type:"dot",parameters:Object.assign({thresholdType:{type:"select",rebuild:!0,options:{value:"value",sigma:"sigma"}},thresholdMin:{type:"number",precision:3,max:1/0,min:-(1/0),rebuild:!0},thresholdMax:{type:"number",precision:3,max:1/0,min:-(1/0),rebuild:!0},thresholdOut:{type:"boolean",rebuild:!0},dotType:{type:"select",rebuild:!0,options:{"":"",sphere:"sphere",point:"point"}},radiusType:{type:"select",options:{"":"",value:"value","abs-value":"abs-value","value-min":"value-min",deviation:"deviation",size:"size"}},radius:{type:"number",precision:3,max:10,min:.001,property:"size"},scale:{type:"number",precision:3,max:10,min:.001},sphereDetail:!0,disableImpostor:!0,pointSize:{type:"number",precision:1,max:100,min:0,buffer:!0},sizeAttenuation:{type:"boolean",buffer:!0},sortParticles:{type:"boolean",rebuild:!0},useTexture:{type:"boolean",buffer:!0},alphaTest:{type:"range",step:.001,max:1,min:0,buffer:!0},forceTransparent:{type:"boolean",buffer:!0},edgeBleach:{type:"range",step:.001,max:1,min:0,buffer:!0}},ia.prototype.parameters,{colorScheme:{type:"select",update:"color",options:{"":"",value:"value",uniform:"uniform",random:"random"}}}),defaultSize:.1,init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"uniform"),e.colorValue=Hi(e.colorValue,14540253),this.thresholdType=Hi(e.thresholdType,"sigma"),this.thresholdMin=Hi(e.thresholdMin,2),this.thresholdMax=Hi(e.thresholdMax,1/0),this.thresholdOut=Hi(e.thresholdOut,!1),this.dotType=Hi(e.dotType,"point"),this.radius=Hi(e.radius,.1),this.scale=Hi(e.scale,1),this.pointSize=Hi(e.pointSize,1),this.sizeAttenuation=Hi(e.sizeAttenuation,!0),this.sortParticles=Hi(e.sortParticles,!1),this.useTexture=Hi(e.useTexture,!1),this.alphaTest=Hi(e.alphaTest,.5),this.forceTransparent=Hi(e.forceTransparent,!1),this.edgeBleach=Hi(e.edgeBleach,0),ia.prototype.init.call(this,e)},attach:function(t){this.bufferList.forEach(function(t){
	this.viewer.add(t)},this),this.setVisibility(this.visible),t()},create:function(){var t={};if(this.volume){var e,i,r=this.volume;"sigma"===this.thresholdType?(e=r.getValueForSigma(this.thresholdMin),i=r.getValueForSigma(this.thresholdMax)):(e=this.thresholdMin,i=this.thresholdMax),r.filterData(e,i,this.thresholdOut),t.position=r.getDataPosition(),t.color=r.getDataColor(this.getColorParams()),"sphere"===this.dotType&&(t.radius=r.getDataSize(this.radius,this.scale),t.pickingColor=r.getPickingDataColor(this.getColorParams()))}else{var n=this.surface;t.position=n.getPosition(),t.color=n.getColor(this.getColorParams()),"sphere"===this.dotType&&(t.radius=n.getSize(this.radius,this.scale),t.pickingColor=n.getPickingColor(this.getColorParams()))}"sphere"===this.dotType?this.dotBuffer=new Ko(t,this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!1})):this.dotBuffer=new Zv(t,this.getBufferParams({pointSize:this.pointSize,sizeAttenuation:this.sizeAttenuation,sortParticles:this.sortParticles,useTexture:this.useTexture,alphaTest:this.alphaTest,forceTransparent:this.forceTransparent,edgeBleach:this.edgeBleach})),this.bufferList.push(this.dotBuffer)},update:function(t){if(0!==this.bufferList.length){t=t||{};var e={};t.color&&(this.volume?e.color=this.volume.getDataColor(this.getColorParams()):e.color=this.surface.getColor(this.getColorParams())),"sphere"===this.dotType&&(t.radius||t.scale)&&(this.volume?e.radius=this.volume.getDataSize(this.radius,this.scale):e.radius=this.surface.getSize(this.radius,this.scale)),this.dotBuffer.setAttributes(e)}},setParameters:function(t,e,i){return e=e||{},t&&void 0!==t.thresholdType&&this.volume instanceof Vo&&("value"===this.thresholdType&&"sigma"===t.thresholdType?(this.thresholdMin=this.volume.getSigmaForValue(this.thresholdMin),this.thresholdMax=this.volume.getSigmaForValue(this.thresholdMax)):"sigma"===this.thresholdType&&"value"===t.thresholdType&&(this.thresholdMin=this.volume.getValueForSigma(this.thresholdMin),this.thresholdMax=this.volume.getValueForSigma(this.thresholdMax)),this.thresholdType=t.thresholdType),t&&void 0!==t.radiusType&&("radius"===t.radiusType?this.radius=this.defaultSize:this.radius=t.radiusType,e.radius=!0,"sphere"!==this.dotType||Xp&&!this.disableImpostor||(i=!0)),t&&void 0!==t.radius&&(e.radius=!0,"sphere"!==this.dotType||Xp&&!this.disableImpostor||(i=!0)),t&&void 0!==t.scale&&(e.scale=!0,"sphere"!==this.dotType||Xp&&!this.disableImpostor||(i=!0)),ia.prototype.setParameters.call(this,t,e,i),this}}),em.add("shader/Image.vert","uniform float clipRadius;\nuniform vec3 clipCenter;\nvarying vec2 vUv;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\nvoid main() {\n#include begin_vertex\n#include project_vertex\nvUv = uv;\nvViewPosition = -mvPosition.xyz;\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n}"),em.add("shader/Image.frag","uniform sampler2D map;\nuniform float opacity;\nuniform vec2 mapSize;\nuniform float nearClip;\nuniform float clipRadius;\nvarying vec2 vUv;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#include fog_pars_fragment\n#if defined( CUBIC_INTERPOLATION )\n#if defined( CATMULROM_FILTER ) || defined( MITCHELL_FILTER )\n#if defined( CATMULROM_FILTER )\nconst float B = 0.0;\nconst float C = 0.5;\n#elif defined( MITCHELL_FILTER )\nconst float B = 0.333;\nconst float C = 0.333;\n#endif\nfloat filter( float x ){\nfloat f = x;\nif( f < 0.0 )\n{\nf = -f;\n}\nif( f < 1.0 )\n{\nreturn ( ( 12.0 - 9.0 * B - 6.0 * C ) * ( f * f * f ) +\n( -18.0 + 12.0 * B + 6.0 *C ) * ( f * f ) +\n( 6.0 - 2.0 * B ) ) / 6.0;\n}\nelse if( f >= 1.0 && f < 2.0 )\n{\nreturn ( ( -B - 6.0 * C ) * ( f * f * f )\n+ ( 6.0 * B + 30.0 * C ) * ( f *f ) +\n( - ( 12.0 * B ) - 48.0 * C ) * f +\n8.0 * B + 24.0 * C)/ 6.0;\n}\nelse\n{\nreturn 0.0;\n}\n}\n#elif defined( BSPLINE_FILTER )\nfloat filter( float x ){\nfloat f = x;\nif( f < 0.0 ){\nf = -f;\n}\nif( f >= 0.0 && f <= 1.0 ){\nreturn ( 2.0 / 3.0 ) + ( 0.5 ) * ( f*f*f ) - ( f*f );\n}else if( f > 1.0 && f <= 2.0 ){\nreturn 1.0 / 6.0 * pow( ( 2.0 - f ), 3.0 );\n}\nreturn 1.0;\n}\n#else\nfloat filter( float x ){\nreturn 1.0;\n}\n#endif\nvec4 biCubic( sampler2D tex, vec2 texCoord ){\nvec2 texelSize = 1.0 / mapSize;\ntexCoord -= texelSize / 2.0;\nvec4 nSum = vec4( 0.0 );\nfloat nDenom = 0.0;\nvec2 cell = fract( texCoord * mapSize );\nfor( float m = -1.0; m <= 2.0; ++m ){\nfor( float n = -1.0; n <= 2.0; ++n ){\nvec4 vecData = texture2D(\ntex, texCoord + texelSize * vec2( m, n )\n);\nfloat c = filter( m - cell.x ) * filter( -n + cell.y );\nnSum += vecData * c;\nnDenom += c;\n}\n}\nreturn nSum / nDenom;\n}\n#endif\nvoid main(){\n#include nearclip_fragment\n#include radiusclip_fragment\n#if defined( CUBIC_INTERPOLATION )\ngl_FragColor = biCubic( map, vUv );\n#else\ngl_FragColor = texture2D( map, vUv );\n#endif\ngl_FragColor.a *= opacity;\nif( gl_FragColor.a < 0.01 )\ndiscard;\n#include fog_fragment\n}");var Kv=new Uint16Array([0,1,2,1,3,2]),Qv=new Float32Array([0,1,0,0,1,1,1,0]),Jv=function(t){function e(e,i,r,n,o){var a=o||{};t.call(this,{position:e,index:Kv},a),this.forceTransparent=!0,this.filter=Hi(a.filter,"nearest"),this.tex=new me(i,r,n),this.tex.flipY=!0,this.addUniforms({map:{value:null},mapSize:{value:new h(r,n)}}),this.geometry.addAttribute("uv",new Rt(Qv,2))}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={parameters:{},vertexShader:{},fragmentShader:{}};return i.parameters.get=function(){return Object.assign.call(this,{filter:{updateShader:!0,uniform:!0}},t.prototype.parameters)},e.prototype.getDefines=function(e){var i=t.prototype.getDefines.call(this,e);return this.filter.startsWith("cubic")&&(i.CUBIC_INTERPOLATION=1,this.filter.endsWith("bspline")?i.BSPLINE_FILTER=1:this.filter.endsWith("catmulrom")?i.CATMULROM_FILTER=1:this.filter.endsWith("mitchell")&&(i.MITCHELL_FILTER=1)),i},e.prototype.updateTexture=function(){var t=this.tex;this.filter.startsWith("cubic")?(t.minFilter=ku,t.magFilter=ku):"linear"===this.filter?(t.minFilter=zu,t.magFilter=zu):(t.minFilter=ku,t.magFilter=ku),t.needsUpdate=!0},e.prototype.makeMaterial=function(){t.prototype.makeMaterial.call(this),this.updateTexture();var e=this.material;e.uniforms.map.value=this.tex,e.blending=$c,e.needsUpdate=!0;var i=this.wireframeMaterial;i.uniforms.map.value=this.tex,i.blending=$c,i.needsUpdate=!0;var r=this.pickingMaterial;r.uniforms.map.value=this.tex,r.blending=$c,r.needsUpdate=!0},e.prototype.setUniforms=function(e){e&&void 0!==e.filter&&(this.updateTexture(),e.map=this.tex),t.prototype.setUniforms.call(this,e)},i.vertexShader.get=function(){return"Image.vert"},i.fragmentShader.get=function(){return"Image.frag"},Object.defineProperties(e.prototype,i),e}(mv);ua.prototype=Object.assign(Object.create(ia.prototype),{constructor:ua,type:"slice",parameters:Object.assign({filter:{type:"select",buffer:!0,options:{nearest:"nearest",linear:"linear","cubic-bspline":"cubic-bspline","cubic-catmulrom":"cubic-catmulrom","cubic-mitchell":"cubic-mitchell"}},position:{type:"range",step:.1,max:100,min:1,rebuild:!0},dimension:{type:"select",rebuild:!0,options:{x:"x",y:"y",z:"z"}},thresholdType:{type:"select",rebuild:!0,options:{value:"value",sigma:"sigma"}},thresholdMin:{type:"number",precision:3,max:1/0,min:-(1/0),rebuild:!0},thresholdMax:{type:"number",precision:3,max:1/0,min:-(1/0),rebuild:!0}},ia.prototype.parameters,{flatShaded:null,side:null,wireframe:null,linewidth:null,colorScheme:null,roughness:null,metalness:null,diffuse:null}),init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"value"),e.colorScale=Hi(e.colorScale,"Spectral"),ia.prototype.init.call(this,e),this.colorScheme="value",this.dimension=Hi(e.dimension,"x"),this.filter=Hi(e.filter,"cubic-bspline"),this.position=Hi(e.position,30),this.thresholdType=Hi(e.thresholdType,"sigma"),this.thresholdMin=Hi(e.thresholdMin,-(1/0)),this.thresholdMax=Hi(e.thresholdMax,1/0)},attach:function(t){this.bufferList.forEach(function(t){this.viewer.add(t)},this),this.setVisibility(this.visible),t()},create:function(){function t(t){return Math.round(t/100*(i-1))}function e(t,e,i,n){return 3*(i*r.ny*r.nx+e*r.nx+t)+n}var i=this.position,r=this.volume;r.filterData(-(1/0),1/0,!1);var n,o,a,s,c,u=r.data,l=r.matrix,h=new Float32Array(12),d=0,f=0,p=0,m=r.nx,v=r.ny,y=r.nz,b=new g;"x"===this.dimension?(a=t(r.nx),s=r.ny-1,c=r.nz-1,n=r.nz,o=r.ny,d=a,m=d+1,b.set(a,0,0).applyMatrix4(l).toArray(h,0),b.set(a,s,0).applyMatrix4(l).toArray(h,3),b.set(a,0,c).applyMatrix4(l).toArray(h,6),b.set(a,s,c).applyMatrix4(l).toArray(h,9)):"y"===this.dimension?(a=r.nx-1,s=t(r.ny),c=r.nz-1,n=r.nz,o=r.nx,f=s,v=f+1,b.set(0,s,0).applyMatrix4(l).toArray(h,0),b.set(a,s,0).applyMatrix4(l).toArray(h,3),b.set(0,s,c).applyMatrix4(l).toArray(h,6),b.set(a,s,c).applyMatrix4(l).toArray(h,9)):"z"===this.dimension&&(a=r.nx-1,s=r.ny-1,c=t(r.nz),n=r.nx,o=r.ny,p=c,y=p+1,b.set(0,0,c).applyMatrix4(l).toArray(h,0),b.set(0,s,c).applyMatrix4(l).toArray(h,3),b.set(a,0,c).applyMatrix4(l).toArray(h,6),b.set(a,s,c).applyMatrix4(l).toArray(h,9));var x,_,w=0,S=new Uint8Array(n*o*4);"sigma"===this.thresholdType?(x=r.getValueForSigma(this.thresholdMin),_=r.getValueForSigma(this.thresholdMax)):(x=this.thresholdMin,_=this.thresholdMax);var A=this.getColorParams({volume:r});A.domain=[r.getDataMin(),r.getDataMax()];for(var M=Kp.getScheme(A),P=new Float32Array(3),C=f;C<v;++C)for(var T=d;T<m;++T)for(var E=p;E<y;++E){var I=e(T,C,E,0)/3,L=u[I];M.volumeColorToArray(I,P),S[w]=Math.round(255*P[0]),S[w+1]=Math.round(255*P[1]),S[w+2]=Math.round(255*P[2]),S[w+3]=L>x&&L<_?255:0,w+=4}var R=new Jv(h,S,n,o,this.getBufferParams({filter:this.filter}));this.bufferList.push(R)}}),la.prototype=Object.assign(Object.create(ia.prototype),{constructor:la,type:"structure",parameters:Object.assign({radiusType:{type:"select",options:sn.types},radius:{type:"number",precision:3,max:10,min:.001},scale:{type:"number",precision:3,max:10,min:.001},assembly:null,defaultAssembly:{type:"hidden"}},ia.prototype.parameters),defaultScale:{vdw:1,covalent:1,bfactor:.01,sstruc:1},defaultSize:1,init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"element"),this.radius=Hi(e.radius,"vdw"),this.scale=Hi(e.scale,1),this.assembly=Hi(e.assembly,"default"),this.defaultAssembly=Hi(e.defaultAssembly,""),"auto"===e.quality&&(e.quality=this.getQuality()),ia.prototype.init.call(this,e)},getAssembly:function(){var t="default"===this.assembly?this.defaultAssembly:this.assembly;return this.structure.biomolDict[t]},getQuality:function(){var t,e=this.structureView,i=this.getAssembly();t=i?i.getAtomCount(e):e.atomCount,Hp&&(t*=4);var r=e.atomStore.count/e.residueStore.count<2;return r&&(t*=10),t<15e3?"high":t<8e4?"medium":"low"},create:function(){if(0!==this.structureView.atomCount){var t=this.getAssembly();if(t)t.partList.forEach(function(t,e){var i=t.getView(this.structureView);if(0!==i.atomCount){var r=this.createData(i,e);r&&(r.sview=i,r.instanceList=t.getInstanceList(),this.dataList.push(r))}},this);else{var e=this.createData(this.structureView,0);e&&(e.sview=this.structureView,this.dataList.push(e))}}},createData:function(){console.error("createData not implemented")},update:function(t){return this.lazy&&!this.visible?void Object.assign(this.lazyProps.what,t):void this.dataList.forEach(function(e){e.bufferList.length>0&&this.updateData(t,e)},this)},updateData:function(){console.error("updateData not implemented")},getColorParams:function(){var t=ia.prototype.getColorParams.call(this);return t.structure=this.structure,t},getAtomParams:function(t,e){return Object.assign({what:t,colorParams:this.getColorParams(),radiusParams:{radius:this.radius,scale:this.scale}},e)},getBondParams:function(t,e){return Object.assign({what:t,colorParams:this.getColorParams(),radiusParams:{radius:this.radius,scale:this.scale}},e)},setSelection:function(t,e){return this.selection.setString(t,e),this},setParameters:function(t,e,i){return e=e||{},t&&void 0!==t.radiusType&&("size"===t.radiusType?this.radius=this.defaultSize:this.radius=t.radiusType,e.radius=!0,Xp&&!this.disableImpostor||(i=!0)),t&&void 0!==t.radius&&(e.radius=!0,Xp&&!this.disableImpostor||(i=!0)),t&&void 0!==t.scale&&(e.radius=!0,Xp&&!this.disableImpostor||(i=!0)),t&&void 0!==t.defaultAssembly&&(i=!0),ia.prototype.setParameters.call(this,t,e,i),this},getParameters:function(){var t=Object.assign(ia.prototype.getParameters.call(this),{sele:this.selection?this.selection.string:void 0,defaultAssembly:this.defaultAssembly});return t},attach:function(t){var e=this.viewer,i=this.bufferList;this.dataList.forEach(function(t){t.bufferList.forEach(function(r){i.push(r),e.add(r,t.instanceList)})}),this.setVisibility(this.visible),t()},clear:function(){this.dataList.length=0,ia.prototype.clear.call(this)},dispose:function(){this.structureView.dispose(),delete this.structure,delete this.structureView,ia.prototype.dispose.call(this)}}),em.add("shader/Line.vert","uniform float nearClip;\nuniform vec3 clipCenter;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#include color_pars_vertex\nvoid main(){\n#include color_vertex\n#include begin_vertex\n#include project_vertex\nvViewPosition = -mvPosition.xyz;\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n}"),em.add("shader/Line.frag","uniform float opacity;\nuniform float nearClip;\nuniform float clipRadius;\nvarying vec3 vViewPosition;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#include common\n#include color_pars_fragment\n#include fog_pars_fragment\nvoid main(){\n#include nearclip_fragment\n#include radiusclip_fragment\ngl_FragColor = vec4( vColor, opacity );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n}");var ty=function(t){function e(e,i){var r=e.position1.length/3,n=4*r;t.call(this,{position:new Float32Array(3*n),color:new Float32Array(3*n)},i),this.setAttributes(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={line:{},vertexShader:{},fragmentShader:{}};return e.prototype.setAttributes=function(t){var e,i,r,n,o,a,s=this.geometry.attributes;t.position1&&t.position2&&(e=t.position1,i=t.position2,o=s.position.array,s.position.needsUpdate=!0),t.color&&t.color2&&(r=t.color,n=t.color2,a=s.color.array,s.color.needsUpdate=!0);for(var c,u,l,h,d,f,p,m,g,v,y,b=this.size,x=0;x<b;x++)u=3*x,c=4*x*3,e&&i&&(f=e[u],p=e[u+1],m=e[u+2],g=i[u],v=i[u+1],y=i[u+2],l=(f+g)/2,h=(p+v)/2,d=(m+y)/2,o[c]=f,o[c+1]=p,o[c+2]=m,o[c+3]=l,o[c+4]=h,o[c+5]=d,o[c+6]=l,o[c+7]=h,o[c+8]=d,o[c+9]=g,o[c+10]=v,o[c+11]=y),r&&n&&(a[c]=a[c+3]=r[u],a[c+1]=a[c+4]=r[u+1],a[c+2]=a[c+5]=r[u+2],a[c+6]=a[c+9]=n[u],a[c+7]=a[c+10]=n[u+1],a[c+8]=a[c+11]=n[u+2])},i.line.get=function(){return!0},i.vertexShader.get=function(){return"Line.vert"},i.fragmentShader.get=function(){return"Line.frag"},Object.defineProperties(e.prototype,i),e}(mv);ha.prototype=Object.assign(Object.create(la.prototype),{constructor:ha,type:"",parameters:Object.assign({drawLine:{type:"boolean",rebuild:!0},drawCylinder:{type:"boolean",rebuild:!0},drawPoint:{type:"boolean",rebuild:!0},drawSphere:{type:"boolean",rebuild:!0},linewidth:{type:"integer",max:20,min:1,rebuild:!0},pointSize:{type:"integer",max:20,min:1,rebuild:!0},sizeAttenuation:{type:"boolean",rebuild:!0},sort:{type:"boolean",rebuild:!0}},ia.prototype.parameters),init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"uniform"),e.colorValue=Hi(e.colorValue,14540253),this.drawLine=Hi(e.drawLine,!0),this.drawCylinder=Hi(e.drawCylinder,!1),this.drawPoint=Hi(e.drawPoint,!1),this.drawSphere=Hi(e.drawSphere,!1),this.pointSize=Hi(e.pointSize,1),this.sizeAttenuation=Hi(e.sizeAttenuation,!1),this.sort=Hi(e.sort,!0),la.prototype.init.call(this,e)},attach:function(t){this.bufferList.forEach(function(t){this.viewer.add(t)},this),this.setVisibility(this.visible),t()},prepare:function(t){t()},create:function(){if(0!==this.atomSet.atomCount){var t=this,e=this.atomSet.atoms[0].index;this.trajectory.getPath(e,function(e){var i=e.length/3,r=new ct(t.colorValue);if(t.drawSphere){var n=new Ko({position:e,color:qr(i,r.r,r.g,r.b),radius:Xr(i,.2)},t.getBufferParams({sphereDetail:t.sphereDetail,dullInterior:!0,disableImpostor:t.disableImpostor}));t.bufferList.push(n)}if(t.drawCylinder){var o=new Jo({position1:e.subarray(0,-3),position2:e.subarray(3),color:qr(i-1,r.r,r.g,r.b),color2:qr(i-1,r.r,r.g,r.b),radius:Xr(i,.05)},t.getBufferParams({openEnded:!1,radialSegments:t.radialSegments,disableImpostor:t.disableImpostor,dullInterior:!0}));t.bufferList.push(o)}if(t.drawPoint){var a=new Zv({position:e,color:qr(i,r.r,r.g,r.b)},t.getBufferParams({pointSize:t.pointSize,sizeAttenuation:t.sizeAttenuation,sort:t.sort}));t.bufferList.push(a)}if(t.drawLine){var s=new ty({position1:e.subarray(0,-3),position2:e.subarray(3),color:qr(i-1,r.r,r.g,r.b),color2:qr(i-1,r.r,r.g,r.b)},t.getBufferParams());t.bufferList.push(s)}t.attach()})}}});var ey=0,iy=["representationAdded","representationRemoved","visibilityChanged","statusChanged","nameChanged","disposed"],ry=function(t,e){var i=this;Object.defineProperty(this,"id",{value:ey++});var r=e||{};this.name=r.name,this.uuid=vr(),this.visible=void 0===r.visible||r.visible,this.signals={},this._signalNames.forEach(function(t){i.signals[t]=new Cr}),this.stage=t,this.viewer=t.viewer,this.reprList=[]},ny={type:{},_signalNames:{}};ny.type.get=function(){return"component"},ny._signalNames.get=function(){return iy},ry.prototype.addRepresentation=function(t,e,i){var r=i||{},n=this.stage.getParameters();r.quality=r.quality||n.quality,r.disableImpostor=Hi(r.disableImpostor,!n.impostor),r.useWorker=Hi(r.useWorker,n.workerDefault),r.visible=Hi(r.visible,!0),r.gidPool=this.stage.gidPool;var o=Object.assign({},r,{visible:this.visible&&r.visible}),a=fa(t,e,this.viewer,o),s=this.__getRepresentationComponent(a,r);return this.reprList.push(s),this.signals.representationAdded.dispatch(s),s},ry.prototype.addBufferRepresentation=function(t,e){return ry.prototype.addRepresentation.call(this,"buffer",t,e)},ry.prototype.hasRepresentation=function(t){return this.reprList.indexOf(t)!==-1},ry.prototype.removeRepresentation=function(t){var e=this.reprList.indexOf(t);e!==-1&&(this.reprList.splice(e,1),t.dispose(),this.signals.representationRemoved.dispatch(t))},ry.prototype.updateRepresentations=function(t){this.reprList.forEach(function(e){e.update(t)}),this.stage.viewer.requestRender()},ry.prototype.removeAllRepresentations=function(){this.reprList.slice().forEach(function(t){this.removeRepresentation(t)},this)},ry.prototype.clearRepresentations=function(){console.warn(".clearRepresentations is deprecated, use .removeAllRepresentations() instead"),this.removeAllRepresentations()},ry.prototype.dispose=function(){this.removeAllRepresentations(),delete this.reprList,this.signals.disposed.dispatch()},ry.prototype.setVisibility=function(t){return this.visible=t,this.eachRepresentation(function(t){t.updateVisibility()}),this.signals.visibilityChanged.dispatch(t),this},ry.prototype.setStatus=function(t){return this.status=t,this.signals.statusChanged.dispatch(t),this},ry.prototype.setName=function(t){return this.name=t,this.signals.nameChanged.dispatch(t),this},ry.prototype.getBox=function(){},ry.prototype.getCenter=function(){return this.getBox().center()},ry.prototype.getZoom=function(){return this.stage.getZoomForBox((t=this).getBox.apply(t,arguments));var t},ry.prototype.autoView=function(t){this.stage.animationControls.zoomMove(this.getCenter(),this.getZoom(),Hi(t,0))},ry.prototype.eachRepresentation=function(t){this.reprList.forEach(t)},Object.defineProperties(ry.prototype,ny),ry.prototype.__getRepresentationComponent=function(t,e){return new ay(this.stage,t,e,this)};var oy=["parametersChanged"],ay=function(t){function e(e,i,r,n){var o=r||{};o.name=Hi(o.name,i.type),t.call(this,e,o),this.parent=n,this.setRepresentation(i)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},_signalNames:{}};return i.type.get=function(){return"representation"},i._signalNames.get=function(){return t.prototype._signalNames.concat(oy)},e.prototype.getType=function(){return this.repr.type},e.prototype.setRepresentation=function(t){this.disposeRepresentation(),this.repr=t,this.stage.tasks.listen(this.repr.tasks),this.updateVisibility()},e.prototype.addRepresentation=function(){},e.prototype.removeRepresentation=function(){},e.prototype.hasRepresentation=function(){},e.prototype.disposeRepresentation=function(){this.repr&&(this.stage.tasks.unlisten(this.repr.tasks),this.repr.dispose())},e.prototype.dispose=function(){this.parent&&this.parent.hasRepresentation(this)?this.parent.removeRepresentation(this):(this.disposeRepresentation(),this.signals.disposed.dispatch())},e.prototype.setVisibility=function(t){return this.visible=t,this.updateVisibility(),this.signals.visibilityChanged.dispatch(this.visible),this},e.prototype.getVisibility=function(){return this.parent?this.parent.visible&&this.visible:this.visible},e.prototype.updateVisibility=function(){this.repr.setVisibility(this.getVisibility())},e.prototype.update=function(t){return this.repr.update(t),this},e.prototype.build=function(t){return this.repr.build(t),this},e.prototype.setSelection=function(t){return this.repr.setSelection(t),this},e.prototype.setParameters=function(t){return this.repr.setParameters(t),this.signals.parametersChanged.dispatch(this.repr.getParameters()),this},e.prototype.getParameters=function(){return this.repr.getParameters()},e.prototype.setColor=function(t){return this.repr.setColor(t),this},e.prototype.getCenter=function(){},e.prototype.getZoom=function(){},e.prototype.getBox=function(){},Object.defineProperties(e.prototype,i),e}(ry),sy=function(t){var e=this;this.list=t||[];for(var i=this.list.length,r=0;r<i;++r){var n=e.list[r];n.signals.disposed.add(e._remove,e)}};sy.prototype._remove=function(t){var e=this.list.indexOf(t);e!==-1&&this.list.splice(e,1)},sy.prototype._invoke=function(t,e){for(var i=this,r=this.list.length,n=0;n<r;++n){var o=i.list[n],a=o[t];"function"==typeof a&&a.apply(o,e)}return this},sy.prototype.setVisibility=function(t){return this._invoke("setVisibility",[t])},sy.prototype.setSelection=function(t){return this._invoke("setSelection",[t])},sy.prototype.dispose=function(){return this._invoke("dispose")};var cy=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addRepresentation=function(t,e){return this._invoke("addRepresentation",[t,e])},e.prototype.autoView=function(t){return this._invoke("autoView",[t])},e}(sy),uy=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setParameters=function(t){return this._invoke("setParameters",[t])},e.prototype.setColor=function(t){return this._invoke("setColor",[t])},e}(sy),ly=new g,hy=function(t,e){if(this.signals={parametersChanged:new Cr,fullscreenChanged:new Cr,componentAdded:new Cr,componentRemoved:new Cr,clicked:new Cr,hovered:new Cr},this.tasks=new mm,this.gidPool=new gm,this.compList=[],this.defaultFileParams={},this.viewer=new on(t),this.viewer.renderer){this.mouseObserver=new Om(this.viewer.renderer.domElement),this.viewerControls=new Ym(this),this.trackballControls=new Bm(this),this.pickingControls=new jm(this),this.animationControls=new ig(this),this.pickingBehavior=new og(this),this.mouseBehavior=new ag(this),this.animationBehavior=new sg(this),this.spinAnimation=this.animationControls.spin(null);var i=Object.assign({impostor:!0,quality:"medium",workerDefault:!0,sampleLevel:0,backgroundColor:"black",rotateSpeed:2,zoomSpeed:1.2,panSpeed:1,clipNear:0,clipFar:100,clipDist:10,fogNear:50,fogFar:100,cameraFov:40,cameraType:"perspective",lightColor:14540253,lightIntensity:1,ambientColor:14540253,ambientIntensity:.2,hoverTimeout:500},e);this.parameters={backgroundColor:{type:"color"},quality:{type:"select",options:{auto:"auto",low:"low",medium:"medium",high:"high"}},sampleLevel:{type:"range",step:1,max:5,min:-1},impostor:{type:"boolean"},workerDefault:{type:"boolean"},rotateSpeed:{type:"number",precision:1,max:10,min:0},zoomSpeed:{type:"number",precision:1,max:10,min:0},panSpeed:{type:"number",precision:1,max:10,min:0},clipNear:{type:"range",step:1,max:100,min:0},clipFar:{type:"range",step:1,max:100,min:0},clipDist:{type:"integer",max:200,min:0},fogNear:{type:"range",step:1,max:100,min:0},fogFar:{type:"range",step:1,max:100,min:0},cameraType:{type:"select",options:{perspective:"perspective",orthographic:"orthographic"}},cameraFov:{type:"range",step:1,max:120,min:15},lightColor:{type:"color"},lightIntensity:{type:"number",precision:2,max:10,min:0},ambientColor:{type:"color"},ambientIntensity:{type:"number",precision:2,max:10,min:0},hoverTimeout:{type:"integer",max:1e4,min:-1}},this.setParameters(i),this.viewer.animate()}};hy.prototype.setParameters=function(t){var e=Object.assign({},t),i=this.parameters,r=this.viewer,n=this.trackballControls;for(var o in e)void 0!==e[o]&&i[o]&&(i[o].int&&(e[o]=parseInt(e[o])),i[o].float&&(e[o]=parseFloat(e[o])),i[o].value=e[o]);return void 0!==e.quality&&this.setQuality(e.quality),void 0!==e.impostor&&this.setImpostor(e.impostor),void 0!==e.rotateSpeed&&(n.rotateSpeed=e.rotateSpeed),void 0!==e.zoomSpeed&&(n.zoomSpeed=e.zoomSpeed),void 0!==e.panSpeed&&(n.panSpeed=e.panSpeed),this.mouseObserver.setParameters({hoverTimeout:e.hoverTimeout}),r.setClip(e.clipNear,e.clipFar,e.clipDist),r.setFog(void 0,e.fogNear,e.fogFar),r.setCamera(e.cameraType,e.cameraFov),r.setSampling(e.sampleLevel),r.setBackground(e.backgroundColor),r.setLight(e.lightColor,e.lightIntensity,e.ambientColor,e.ambientIntensity),this.signals.parametersChanged.dispatch(this.getParameters()),this},hy.prototype.getParameters=function(){var t=this,e={};for(var i in t.parameters)e[i]=t.parameters[i].value;return e},hy.prototype.defaultFileRepresentation=function(e){if("structure"===e.type){e.setSelection("/0");var i,r,n,o=e.structure;if(o.biomolDict.BU1){var a=o.biomolDict.BU1;i=a.getAtomCount(o),r=a.getResidueCount(o),n=a.getInstanceCount(),e.setDefaultAssembly("BU1")}else i=o.getModelProxy(0).atomCount,r=o.getModelProxy(0).residueCount,n=1;Hp&&(i*=4);var s=o.atomStore.count/o.residueStore.count<2;s&&(i*=10);var c="chainname";if(1===o.getChainnameCount("polymer and /0")&&(c="residueindex"),t.Debug&&console.log(i,n,s),r/n<4)e.addRepresentation("ball+stick",{colorScheme:"element",scale:2,aspectRatio:1.5,bondScale:.3,bondSpacing:.75,quality:"auto"});else if(n>5&&i>15e3||i>7e5){var u=Math.min(1.5,Math.max(.1,2e3/(i/n)));s&&(u=Math.min(u,.15)),e.addRepresentation("surface",{sele:"polymer",surfaceType:"sas",probeRadius:1.4,scaleFactor:u,colorScheme:c,colorScale:"RdYlBu",useWorker:!1})}else i>25e4?e.addRepresentation("backbone",{lineOnly:!0,colorScheme:c,colorScale:"RdYlBu"}):i>1e5?e.addRepresentation("backbone",{quality:"low",disableImpostor:!0,colorScheme:c,colorScale:"RdYlBu",scale:2}):i>8e4?e.addRepresentation("backbone",{colorScheme:c,colorScale:"RdYlBu",scale:2}):(e.addRepresentation("cartoon",{color:c,colorScale:"RdYlBu",scale:.7,aspectRatio:5,quality:"auto"}),i<5e4&&e.addRepresentation("base",{color:c,colorScale:"RdYlBu",quality:"auto"}),e.addRepresentation("ball+stick",{sele:"hetero and not ( water or ion )",colorScheme:"element",scale:2,aspectRatio:1.5,bondScale:.3,bondSpacing:.75,quality:"auto"}));e.structure.frames.length&&e.addTrajectory()}else"surface"!==e.type&&"volume"!==e.type||e.addRepresentation("surface");this.tasks.onZeroOnce(this.autoView,this)},hy.prototype.loadFile=function(t,e){var i=Object.assign({},this.defaultFileParams,e),r=new ry(this,i);r.name=Zi(t).name,this.addComponent(r);var n=this.tasks;n.increment();var o,a=function(t){return this.removeComponent(r),r=this.addComponentFromObject(t,i),"script"===r.type&&r.run(),i.defaultRepresentation&&this.defaultFileRepresentation(r),n.decrement(),r}.bind(this),s=function(t){throw r.setStatus(t),n.decrement(),t},c=Hi(i.ext,Zi(t).ext);return o="dcd"===c?Promise.reject("loadFile: ext 'dcd' must be loaded into a structure component"):kr(t,i),o.then(a,s)},hy.prototype.addComponent=function(t){return t?(this.compList.push(t),void this.signals.componentAdded.dispatch(t)):void qp.warn("Stage.addComponent: no component given")},hy.prototype.addComponentFromObject=function(t,e){var i=rm.get(t.type);if(i){var r=new i(this,t,e);return this.addComponent(r),r}qp.warn("no component for object type",t.type)},hy.prototype.removeComponent=function(t){var e=this.compList.indexOf(t);e!==-1&&(this.compList.splice(e,1),t.dispose(),this.signals.componentRemoved.dispatch(t))},hy.prototype.removeAllComponents=function(t){this.compList.slice().forEach(function(e){t&&e.type!==t||this.removeComponent(e)},this)},hy.prototype.handleResize=function(){this.viewer.handleResize()},hy.prototype.toggleFullscreen=function(t){function e(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement}function i(){if(!e()&&r.lastFullscreenElement){var t=r.lastFullscreenElement;t.style.width=t.dataset.normalWidth,t.style.height=t.dataset.normalHeight,document.removeEventListener("fullscreenchange",i),document.removeEventListener("mozfullscreenchange",i),document.removeEventListener("webkitfullscreenchange",i),document.removeEventListener("MSFullscreenChange",i),r.handleResize(),r.signals.fullscreenChanged.dispatch(!1)}}if(!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled))return void qp.log("fullscreen mode (currently) not possible");var r=this;t=t||this.viewer.container,this.lastFullscreenElement=t,e()?document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen():(t.dataset.normalWidth=t.style.width,t.dataset.normalHeight=t.style.height,t.style.width=screen.width+"px",t.style.height=screen.height+"px",t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen(),document.addEventListener("fullscreenchange",i),document.addEventListener("mozfullscreenchange",i),document.addEventListener("webkitfullscreenchange",i),document.addEventListener("MSFullscreenChange",i),this.handleResize(),this.signals.fullscreenChanged.dispatch(!0),setTimeout(function(){r.handleResize()},100))},hy.prototype.setSpin=function(t,e){Array.isArray(t)&&(t=(new g).fromArray(t)),this.spinAnimation.axis=t,this.spinAnimation.angle=e},hy.prototype.getZoomForBox=function(t){var e=t.size(ly),i=Math.max(e.x,e.y,e.z),r=Math.min(e.x,e.y,e.z),n=i+Math.sqrt(r),o=mr(this.viewer.perspectiveCamera.fov),a=this.viewer.width,s=this.viewer.height,c=a/s,u=s<a?1:c;return n=Math.abs(.5*n/u/Math.sin(o/2)),n+=this.parameters.clipDist.value,-n},hy.prototype.getBox=function(){return this.viewer.boundingBox},hy.prototype.getZoom=function(){return this.getZoomForBox(this.getBox())},hy.prototype.getCenter=function(){return this.getBox().center()},hy.prototype.autoView=function(t){this.animationControls.zoomMove(this.getCenter(),this.getZoom(),Hi(t,0))},hy.prototype.makeImage=function(t){var e=this.viewer,i=this.tasks;return new Promise(function(r,n){function o(){i.increment(),e.makeImage(t).then(function(t){i.decrement(),r(t)}).catch(function(t){i.decrement(),n(t)})}i.onZeroOnce(o)})},hy.prototype.setImpostor=function(t){this.parameters.impostor.value=t;var e=["spacefill","ball+stick","licorice","hyperball","backbone","rocket","helixorient","contact","distance","dot"];
	this.eachRepresentation(function(i){if("script"!==i.type&&e.includes(i.getType())){var r=i.getParameters();r.disableImpostor=!t,i.build(r)}})},hy.prototype.setQuality=function(t){this.parameters.quality.value=t;var e=["tube","cartoon","ribbon","trace","rope"],i=["spacefill","ball+stick","licorice","hyperball","backbone","rocket","helixorient","contact","distance","dot"];this.eachRepresentation(function(r){if("script"!==r.type){var n=r.getParameters();if(!e.includes(r.getType())){if(!i.includes(r.getType()))return;if(!n.disableImpostor)return void(r.repr.quality=t)}n.quality=t,r.build(n)}})},hy.prototype.eachComponent=function(t,e){this.compList.forEach(function(i,r){e&&i.type!==e||t(i,r)})},hy.prototype.eachRepresentation=function(t,e){this.eachComponent(function(e){e.reprList.forEach(function(i){t(i,e)})},e)},hy.prototype.getComponentsByName=function(t,e){var i=[];return this.eachComponent(function(e){(void 0===t||pa(t,e))&&i.push(e)},e),new cy(i)},hy.prototype.getComponentsByObject=function(t){var e=[];return this.eachComponent(function(i){i[i.type]===t&&e.push(i)}),new cy(e)},hy.prototype.getRepresentationsByName=function(t,e){var i,r;"object"!=typeof t?(i=void 0,r=t):(i=t.comp,r=t.repr);var n=[];return this.eachRepresentation(function(t,e){(void 0===i||pa(i,e))&&(void 0===r||pa(r,t))&&n.push(t)},e),new uy(n)},hy.prototype.getAnythingByName=function(t){var e=this.getComponentsByName(t).list,i=this.getRepresentationsByName(t).list;return new sy(e.concat(i))},hy.prototype.dispose=function(){this.tasks.dispose()};var dy=function(t,e){this.signals={startedRunning:new Cr,haltedRunning:new Cr};var i=Object.assign({},e);t.signals.playerChanged.add(function(t){t!==this&&this.pause()},this);var r=t.numframes;this.traj=t,this.start=Hi(i.start,0),this.end=Math.min(Hi(i.end,r-1),r-1),this.step=Hi(i.step,Math.ceil((r+1)/100)),this.timeout=Hi(i.timeout,50),this.interpolateType=Hi(i.interpolateType,""),this.interpolateStep=Hi(i.interpolateStep,5),this.mode=Hi(i.mode,"loop"),this.direction=Hi(i.direction,"forward"),this._stopFlag=!1,this._running=!1};dy.prototype._animate=function(){var t;if(this._running=!0,this.traj.inProgress||this._stopFlag||(t="forward"===this.direction?this.traj.currentFrame+this.step:this.traj.currentFrame-this.step,(t>=this.end||t<this.start)&&("once"===this.mode?(this.pause(),t="forward"===this.direction?this.end:this.start):t="forward"===this.direction?this.start:this.end),this.interpolateType||this.traj.setFrame(t)),this._stopFlag)this._running=!1;else if(!this.traj.inProgress&&this.interpolateType){var e,i,r;"forward"===this.direction?(e=Math.max(this.start,t-this.step),i=Math.max(this.start,t-2*this.step),r=Math.max(this.start,t-3*this.step)):(e=Math.min(this.end,t+this.step),i=Math.min(this.end,t+2*this.step),r=Math.min(this.end,t+3*this.step)),this._interpolate(t,e,i,r,1/this.interpolateStep,0)}else setTimeout(this._animate.bind(this),this.timeout)},dy.prototype._interpolate=function(t,e,i,r,n,o){if(o+=n,o<=1){var a=Math.round(this.timeout*n);this.traj.setFrameInterpolated(t,e,i,r,o,this.interpolateType,function(){setTimeout(function(){this._interpolate(t,e,i,r,n,o)}.bind(this),a)}.bind(this))}else setTimeout(this._animate.bind(this),0)},dy.prototype.toggle=function(){this._running?this.pause():this.play()},dy.prototype.play=function(){if(!this._running){this.traj.player!==this&&this.traj.setPlayer(this);var t=this.traj.currentFrame,e=Math.ceil(t/this.step)*this.step;"forward"===this.direction&&t>=this.end?e=this.start:"backward"===this.direction&&t<=this.start&&(e=this.end),this.traj.setFrame(e),this._stopFlag=!1,this._animate(),this.signals.startedRunning.dispatch()}},dy.prototype.pause=function(){this._running&&(this._stopFlag=!0,this.signals.haltedRunning.dispatch())},dy.prototype.stop=function(){this.traj.setFrame(this.start),this.pause()};var fy="ACDEFGHIKLMNPQRSTVWY",py="ARNDCQEGHILKMFPSTWYVBZ?",my=[[4,0,-2,-1,-2,0,-2,-1,-1,-1,-1,-2,-1,-1,-1,1,0,0,-3,-2],[0,9,-3,-4,-2,-3,-3,-1,-3,-1,-1,-3,-3,-3,-3,-1,-1,-1,-2,-2],[-2,-3,6,2,-3,-1,-1,-3,-1,-4,-3,1,-1,0,-2,0,-1,-3,-4,-3],[-1,-4,2,5,-3,-2,0,-3,1,-3,-2,0,-1,2,0,0,-1,-2,-3,-2],[-2,-2,-3,-3,6,-3,-1,0,-3,0,0,-3,-4,-3,-3,-2,-2,-1,1,3],[0,-3,-1,-2,-3,6,-2,-4,-2,-4,-3,0,-2,-2,-2,0,-2,-3,-2,-3],[-2,-3,-1,0,-1,-2,8,-3,-1,-3,-2,1,-2,0,0,-1,-2,-3,-2,2],[-1,-1,-3,-3,0,-4,-3,4,-3,2,1,-3,-3,-3,-3,-2,-1,3,-3,-1],[-1,-3,-1,1,-3,-2,-1,-3,5,-2,-1,0,-1,1,2,0,-1,-2,-3,-2],[-1,-1,-4,-3,0,-4,-3,2,-2,4,2,-3,-3,-2,-2,-2,-1,1,-2,-1],[-1,-1,-3,-2,0,-3,-2,1,-1,2,5,-2,-2,0,-1,-1,-1,1,-1,-1],[-2,-3,1,0,-3,0,1,-3,0,-3,-2,6,-2,0,0,1,0,-3,-4,-2],[-1,-3,-1,-1,-4,-2,-2,-3,-1,-3,-2,-2,7,-1,-2,-1,-1,-2,-4,-3],[-1,-3,0,2,-3,-2,0,-3,1,-2,0,0,-1,5,1,0,-1,-2,-2,-1],[-1,-3,-2,0,-3,-2,0,-3,2,-2,-1,0,-2,1,5,-1,-1,-3,-3,-2],[1,-1,0,0,-2,0,-1,-2,0,-2,-1,1,-1,0,-1,4,1,-2,-3,-2],[0,-1,-1,-1,-2,-2,-2,-1,-1,-1,-1,0,-1,-1,-1,1,5,0,-2,-2],[0,-1,-3,-2,-1,-3,-3,3,-2,1,1,-3,-2,-2,-3,-2,0,4,-3,-1],[-3,-2,-4,-3,1,-2,-2,-3,-3,-2,-1,-4,-4,-2,-3,-3,-2,-3,11,2],[-2,-2,-3,-2,3,-3,2,-1,-2,-1,-1,-2,-3,-1,-2,-2,-2,-1,2,7]],gy=[[4,-1,-2,-2,0,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-3,-2,0,-2,-1,0],[-1,5,0,-2,-3,1,0,-2,0,-3,-2,2,-1,-3,-2,-1,-1,-3,-2,-3,-1,0,-1],[-2,0,6,1,-3,0,0,0,1,-3,-3,0,-2,-3,-2,1,0,-4,-2,-3,3,0,-1],[-2,-2,1,6,-3,0,2,-1,-1,-3,-4,-1,-3,-3,-1,0,-1,-4,-3,-3,4,1,-1],[0,-3,-3,-3,9,-3,-4,-3,-3,-1,-1,-3,-1,-2,-3,-1,-1,-2,-2,-1,-3,-3,-2],[-1,1,0,0,-3,5,2,-2,0,-3,-2,1,0,-3,-1,0,-1,-2,-1,-2,0,3,-1],[-1,0,0,2,-4,2,5,-2,0,-3,-3,1,-2,-3,-1,0,-1,-3,-2,-2,1,4,-1],[0,-2,0,-1,-3,-2,-2,6,-2,-4,-4,-2,-3,-3,-2,0,-2,-2,-3,-3,-1,-2,-1],[-2,0,1,-1,-3,0,0,-2,8,-3,-3,-1,-2,-1,-2,-1,-2,-2,2,-3,0,0,-1],[-1,-3,-3,-3,-1,-3,-3,-4,-3,4,2,-3,1,0,-3,-2,-1,-3,-1,3,-3,-3,-1],[-1,-2,-3,-4,-1,-2,-3,-4,-3,2,4,-2,2,0,-3,-2,-1,-2,-1,1,-4,-3,-1],[-1,2,0,-1,-3,1,1,-2,-1,-3,-2,5,-1,-3,-1,0,-1,-3,-2,-2,0,1,-1],[-1,-1,-2,-3,-1,0,-2,-3,-2,1,2,-1,5,0,-2,-1,-1,-1,-1,1,-3,-1,-1],[-2,-3,-3,-3,-2,-3,-3,-3,-1,0,0,-3,0,6,-4,-2,-2,1,3,-1,-3,-3,-1],[-1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4,7,-1,-1,-4,-3,-2,-2,-1,-2],[1,-1,1,0,-1,0,0,0,-1,-2,-2,0,-1,-2,-1,4,1,-3,-2,-2,0,0,0],[0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,1,5,-2,-2,0,-1,-1,0],[-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1,1,-4,-3,-2,11,2,-3,-4,-3,-2],[-2,-2,-2,-3,-2,-1,-2,-3,2,-1,-1,-2,-1,3,-3,-2,-2,2,7,-1,-3,-2,-1],[0,-3,-3,-3,-1,-2,-2,-3,-3,3,1,-2,1,-1,-2,-2,0,-3,-1,4,-3,-2,-1],[-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,4,1,-1],[-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,1,4,-1],[0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,0,0,-2,-1,-1,-1,-1,-1]],vy=function(){return{blosum62:ma(py,gy),blosum62x:ma(fy,my)}}(),yy=function(t,e,i,r,n){this.seq1=t,this.seq2=e,this.gapPenalty=i||-10,this.gapExtensionPenalty=r||-1,this.substMatrix=n||"blosum62",this.substMatrix&&(this.substMatrix=vy[this.substMatrix])};yy.prototype.initMatrices=function(){var t=this;this.n=this.seq1.length,this.m=this.seq2.length,this.score=void 0,this.ali="",this.S=[],this.V=[],this.H=[];var e,i;for(e=0;e<=this.n;++e)for(t.S[e]=[],t.V[e]=[],t.H[e]=[],i=0;i<=this.m;++i)t.S[e][i]=0,t.V[e][i]=0,t.H[e][i]=0;for(e=0;e<=this.n;++e)t.S[e][0]=t.gap(0),t.H[e][0]=-(1/0);for(i=0;i<=this.m;++i)t.S[0][i]=t.gap(0),t.V[0][i]=-(1/0);this.S[0][0]=0},yy.prototype.gap=function(t){return this.gapPenalty+t*this.gapExtensionPenalty},yy.prototype.makeScoreFn=function(){var t,e,i=this.seq1,r=this.seq2,n=this.substMatrix;return n?function(o,a){t=i[o],e=r[a];try{return n[t][e]}catch(t){return-4}}:(qp.warn("Alignment: no subst matrix"),function(n,o){return t=i[n],e=r[o],t===e?5:-3})},yy.prototype.calc=function(){t.Debug&&qp.time("Alignment.calc"),this.initMatrices();var e,i,r,n,o,a,s,c=this.gap(0),u=this.makeScoreFn(),l=this.gapExtensionPenalty,h=this.V,d=this.H,f=this.S,p=this.n,m=this.m;for(a=1;a<=p;++a)for(i=f[a-1],e=h[a-1],r=h[a],n=d[a],o=f[a],s=1;s<=m;++s)r[s]=Math.max(i[s]+c,e[s]+l),n[s]=Math.max(o[s-1]+c,n[s-1]+l),o[s]=Math.max(i[s-1]+u(a-1,s-1),r[s],n[s]);t.Debug&&qp.timeEnd("Alignment.calc"),t.Debug&&qp.log(this.S,this.V,this.H)},yy.prototype.trace=function(){var e=this;t.Debug&&qp.time("Alignment.trace"),this.ali1="",this.ali2="";var i=this.makeScoreFn(),r=this.n,n=this.m,o="S";for(this.S[r][n]>=this.V[r][n]&&this.S[r][n]>=this.V[r][n]?(o="S",this.score=this.S[r][n]):this.V[r][n]>=this.H[r][n]?(o="V",this.score=this.V[r][n]):(o="H",this.score=this.H[r][n]),t.Debug&&qp.log("Alignment: SCORE",this.score),t.Debug&&qp.log("Alignment: S, V, H",this.S[r][n],this.V[r][n],this.H[r][n]);r>0&&n>0;)"S"===o?e.S[r][n]===e.S[r-1][n-1]+i(r-1,n-1)?(e.ali1=e.seq1[r-1]+e.ali1,e.ali2=e.seq2[n-1]+e.ali2,--r,--n,o="S"):e.S[r][n]===e.V[r][n]?o="V":e.S[r][n]===e.H[r][n]?o="H":(--r,--n):"V"===o?e.V[r][n]===e.V[r-1][n]+e.gapExtensionPenalty?(e.ali1=e.seq1[r-1]+e.ali1,e.ali2="-"+e.ali2,--r,o="V"):e.V[r][n]===e.S[r-1][n]+e.gap(0)?(e.ali1=e.seq1[r-1]+e.ali1,e.ali2="-"+e.ali2,--r,o="S"):--r:"H"===o?e.H[r][n]===e.H[r][n-1]+e.gapExtensionPenalty?(e.ali1="-"+e.ali1,e.ali2=e.seq2[n-1]+e.ali2,--n,o="H"):e.H[r][n]===e.S[r][n-1]+e.gap(0)?(e.ali1="-"+e.ali1,e.ali2=e.seq2[n-1]+e.ali2,--n,o="S"):--n:qp.error("Alignment: no matrix");for(;r>0;)e.ali1=e.seq1[r-1]+e.ali1,e.ali2="-"+e.ali2,--r;for(;n>0;)e.ali1="-"+e.ali1,e.ali2=e.seq2[n-1]+e.ali2,--n;t.Debug&&qp.timeEnd("Alignment.trace"),t.Debug&&qp.log([this.ali1,this.ali2])};var by=function(t){function e(e){if(t.call(this,e),e.scale||(this.scale="roygb"),e.domain){var i=this.getScale();this.atomColor=function(t){return i(t.index)}}else{var r={};this.structure.eachModel(function(t){this.domain=[t.atomOffset,t.atomEnd],r[t.index]=this.getScale()}.bind(this)),this.atomColor=function(t){return r[t.modelIndex](t.index)}}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("atomindex",by);var xy=function(t){function e(e){if(t.call(this,e),e.scale||(this.scale="OrRd"),!e.domain){var i,r=1/0,n=-(1/0);e.sele&&(i=new Selection(e.sele)),this.structure.eachAtom(function(t){var e=t.bfactor;r=Math.min(r,e),n=Math.max(n,e)},i),this.domain=[r,n]}var o=this.getScale();this.atomColor=function(t){return o(t.bfactor)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("bfactor",xy);var _y=function(t){function e(e){t.call(this,e),e.scale||(this.scale="Spectral");var i={},r={};this.structure.eachModel(function(t){var e=0,n={};t.eachChain(function(t){void 0===n[t.chainid]&&(n[t.chainid]=e,e+=1)}),this.domain=[0,e-1],i[t.index]=n,r[t.index]=this.getScale()}.bind(this)),this.atomColor=function(t){var e=i[t.modelIndex];return r[t.modelIndex](e[t.chainid])}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("chainid",_y);var wy=function(t){function e(e){if(t.call(this,e),e.scale||(this.scale="Spectral"),e.domain){var i=this.getScale();this.atomColor=function(t){return i(t.chainIndex)}}else{var r={};this.structure.eachModel(function(t){this.domain=[t.chainOffset,t.chainEnd],r[t.index]=this.getScale()}.bind(this)),this.atomColor=function(t){return r[t.modelIndex](t.chainIndex)}}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("chainindex",wy);var Sy=function(t){function e(e){t.call(this,e),e.scale||(this.scale="Spectral");var i={},r={};this.structure.eachModel(function(t){var e=0,n={};t.eachChain(function(t){void 0===n[t.chainname]&&(n[t.chainname]=e,e+=1)}),this.domain=[0,e-1],i[t.index]=n,r[t.index]=this.getScale()}.bind(this)),this.atomColor=function(t){var e=i[t.modelIndex];return r[t.modelIndex](e[t.chainname])}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("chainname",Sy);var Ay=function(t){function e(e){t.call(this,e),e.scale||(this.scale="RdYlBu"),this.rsrzScale=this.getScale({domain:[2,0]}),this.rsccScale=this.getScale({domain:[.678,1]});var i=e.structure.validation||{};this.rsrzDict=i.rsrzDict||{},this.rsccDict=i.rsccDict||{}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e=t.resno;t.inscode&&(e+="^"+t.inscode),t.chainname&&(e+=":"+t.chainname),e+="/"+t.modelIndex;var i=this.rsrzDict[e];if(void 0!==i)return this.rsrzScale(i);var r=this.rsccDict[e];return void 0!==r?this.rsccScale(r):9474192},e}(Bp);Kp.add("densityfit",Ay);var My={H:16777215,HE:14286847,LI:13402367,BE:12779264,B:16758197,C:9474192,N:3166456,O:16715021,F:9494608,NE:11789301,NA:11230450,MG:9109248,AL:12560038,SI:1578e4,P:16744448,S:16777008,CL:2093087,AR:8442339,K:9388244,CA:4062976,SC:15132390,TI:12567239,V:10921643,CR:9083335,MN:10255047,FE:14706227,CO:15765664,NI:5296208,CU:13140019,ZN:8224944,GA:12750735,GE:6721423,AS:12419299,SE:16752896,BR:10889513,KR:6076625,RB:7351984,SR:65280,Y:9764863,ZR:9756896,NB:7586505,MO:5551541,TC:3907230,RU:2396047,RH:687500,PD:27013,AG:12632256,CD:16767375,IN:10909043,SN:6717568,SB:10380213,TE:13924864,I:9699476,XE:9699476,CS:5707663,BA:51456,LA:7394559,CE:16777159,PR:14286791,ND:13107143,PM:10747847,SM:9437127,EU:6422471,GD:4587463,TB:3211207,DY:2097095,HO:65436,ER:58997,TM:54354,YB:48952,LU:43812,HF:5096191,TA:5089023,W:2200790,RE:2522539,OS:2516630,IR:1528967,PT:13684960,AU:16765219,HG:12105936,TL:10900557,PB:5724513,BI:10375093,PO:11230208,AT:7688005,RN:4358806,FR:4325478,RA:32e3,AC:7384058,TH:47871,PA:41471,U:36863,NP:33023,PU:27647,AM:5528818,CM:7888099,BK:9064419,CF:10565332,ES:11739092,FM:11739066,MD:11734438,NO:12389767,LR:13041766,RF:13369433,DB:13697103,SG:14221381,BH:14680120,HS:15073326,MT:15400998,DS:16777215,RG:16777215,CN:16777215,UUT:16777215,FL:16777215,UUP:16777215,LV:16777215,UUH:16777215,D:16777152,T:16777120},Py=16777215,Cy=function(t){function e(e){var i=e||{};i.value=Hi(i.value,My.C),t.call(this,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e=t.element;return"C"===e?this.value:My[e]||Py},e}(Bp);Kp.add("element",Cy);var Ty=function(t){function e(e){t.call(this,e),e.scale||(this.scale="Spectral"),e.domain||(this.domain=[0,this.structure.entityList.length-1]);var i=this.getScale();this.atomColor=function(t){return i(t.entityIndex)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("entityindex",Ty);var Ey=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e=t.entity,i=e?e.entityType:void 0;switch(i){case lg:return 8374655;case hg:return 16629894;case dg:return 12496596;case fg:return 3697840;default:return 16777113}},e}(Bp);Kp.add("entitytype",Ey);var Iy=function(t){function e(e){t.call(this,e);var i=e.structure.validation||{};this.geoAtomDict=i.geoAtomDict||{},this.geoDict=i.geoDict||{}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e=t.resno;t.inscode&&(e+="^"+t.inscode),t.chainname&&(e+=":"+t.chainname),e+="/"+t.modelIndex;var i,r=this.geoAtomDict[e];if(void 0!==r){var n=r[t.atomname]||0;i=yr(n)}else i=this.geoDict[e]||0;return 0===i?2188972:1===i?16703627:2===i?16018755:i>=3?10813478:9474192},e}(Bp);Kp.add("geoquality",Iy);var Ly=function(t){function e(e){t.call(this,e),e.scale||(this.scale="RdYlGn");var i,r=0,n={};for(i in zg)n[i]=zg[i][r];if(!e.domain){var o,a=1/0,s=-(1/0);for(i in n)o=n[i],a=Math.min(a,o),s=Math.max(s,o);this.domain=[a,0,s]}var c=this.getScale();this.atomColor=function(t){return c(n[t.resname]||Ug)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("hydrophobicity",Ly);var Ry=function(t){function e(e){t.call(this,e),e.scale||(this.scale="roygb"),e.domain||(this.domain=[0,this.structure.modelStore.count]);var i=this.getScale();this.atomColor=function(t){return i(t.modelIndex)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("modelindex",Ry);var Oy=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){switch(t.residueType.moleculeType){case mg:return 3697840;case gg:return 15729279;case vg:return 12496596;case yg:return 16629894;case bg:return 12540695;case xg:return 8374655;default:return 16777113}},e}(Bp);Kp.add("moleculetype",Oy);var Dy=function(t){function e(e){t.call(this,e),e.scale||(this.scale="PuBu"),e.domain||(this.domain=[0,1]);var i=this.getScale();this.atomColor=function(t){return i(t.occupancy)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("occupancy",Dy);var Ny=function(t){function e(e){t.call(this,e),this.structure&&(this.offset=this.structure.atomStore.count,e.backbone?this.offset+=this.structure.bondStore.count:e.rung&&(this.offset+=this.structure.bondStore.count,this.offset+=this.structure.backboneBondStore.count)),this.gidPool||(console.warn("no gidPool"),this.gidPool={getGid:function(){return 0}})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return this.gidPool.getGid(this.structure,t.index)},e.prototype.bondColor=function(t){return this.gidPool.getGid(this.structure,this.offset+t.index)},e.prototype.volumeColor=function(t){return this.gidPool.getGid(this.volume,t)},e}(Bp);Kp.add("picking",Ny);var ky=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(){return 16777215*Math.random()},e.prototype.volumeColor=function(){return 16777215*Math.random()},e.prototype.positionColor=function(){return 16777215*Math.random()},e}(Bp);Kp.add("random",ky);var Fy=function(t){function e(e){if(t.call(this,e),e.scale||(this.scale="roygb"),e.domain){var i=this.getScale();this.atomColor=function(t){return i(t.residueIndex)}}else{var r={};this.structure.eachChain(function(t){this.domain=[t.residueOffset,t.residueEnd],r[t.index]=this.getScale()}.bind(this)),this.atomColor=function(t){return r[t.chainIndex](t.residueIndex)}}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("residueindex",Fy);var By={ALA:9240460,ARG:124,ASN:16743536,ASP:10485826,CYS:16777072,GLN:16731212,GLU:6684672,GLY:16777215,HIS:7368959,ILE:19456,LEU:4546117,LYS:4671416,MET:12099650,PHE:5459026,PRO:5395026,SER:16740418,THR:12078080,TRP:5195264,TYR:9203788,VAL:16747775,ASX:16711935,GLX:16711935,ASH:16711935,GLH:16711935,A:10526975,G:16740464,I:8454143,C:16747595,T:10551200,U:16744576,DA:10526975,DG:16740464,DI:8454143,DC:16747595,DT:10551200,DU:16744576},zy=16711935,Uy=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){return By[t.resname]||zy},e}(Bp);Kp.add("resname",Uy);var jy={alphaHelix:16711808,threeTenHelix:10485888,piHelix:6291584,betaStrand:16762880,betaTurn:6324479,coil:16777215,dna:11403518,rna:16580962,carbohydrate:10921722},$y=8421504,Vy=function(t){function e(e){t.call(this,e),this.rp=this.structure.getResidueProxy()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(t){var e=t.sstruc,i=this.rp;return"h"===e?jy.alphaHelix:"g"===e?jy.threeTenHelix:"i"===e?jy.piHelix:"e"===e||"b"===e?jy.betaStrand:"t"===e?jy.betaTurn:(i.index=t.residueIndex,i.isDna()?jy.dna:i.isRna()?jy.rna:i.isSaccharide()?jy.carbohydrate:i.isProtein()||"s"===e||"l"===e?jy.coil:$y)},e}(Bp);Kp.add("sstruc",Vy);var Gy=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.atomColor=function(){return this.value},e.prototype.bondColor=function(){return this.value},e.prototype.valueColor=function(){return this.value},e.prototype.volumeColor=function(){return this.value},e}(Bp);Kp.add("uniform",Gy);var Hy=function(t){function e(e){t.call(this,e);var i=this.getScale();this.volumeColor=function(t){return i(this.volume.data[t])}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("value",Hy);var Wy=function(t){function e(e){t.call(this,e);var i=this.volume;if(i&&i.inverseMatrix){var r=this.getScale(),n=i.inverseMatrix,o=i.__data,a=i.nx,s=i.ny,c=new g;this.positionColor=function(t){c.copy(t),c.applyMatrix4(n),c.round();var e=(c.z*s+c.y)*a+c.x;return r(o[e])}}else{var u=this.value;this.positionColor=function(){return u}}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bp);Kp.add("volume",Wy);var Xy=function(t){function e(e,i,r){var n=this,o=r||{};o.name=Hi(o.name,i.name),t.call(this,e,o),this.script=i,this.status="loaded",this.script.signals.nameChanged.add(function(t){n.setName(t)})}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"script"},e.prototype.addRepresentation=function(){},e.prototype.removeRepresentation=function(){},e.prototype.run=function(){var t=this;this.setStatus("running"),this.script.call(this.stage).then(function(){t.setStatus("finished")}),this.setStatus("called")},e.prototype.dispose=function(){this.signals.disposed.dispatch()},e.prototype.setVisibility=function(){},e.prototype.getCenter=function(){},e.prototype.getZoom=function(){},e.prototype.getBox=function(){},Object.defineProperties(e.prototype,i),e}(ry);rm.add("script",Xy);var qy=function(t){function e(e,i,r){var n=r||{};n.name=Hi(n.name,i.name),t.call(this,e,n),this.shape=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"shape"},e.prototype.addRepresentation=function(e,i){return t.prototype.addRepresentation.call(this,e,this.shape,i)},e.prototype.getBox=function(){return this.shape.boundingBox},e.prototype.getCenter=function(){return this.shape.center},e.prototype.dispose=function(){this.shape.dispose(),t.prototype.dispose.call(this)},Object.defineProperties(e.prototype,i),e}(ry);rm.add("shape",qy);var Yy=["frameChanged","playerChanged","gotNumframes","parametersChanged"],Zy=function(t){function e(e,i,r,n){var o=this,a=r||{};a.name=Hi(a.name,i.name),t.call(this,e,a),this.trajectory=i,this.parent=n,this.status="loaded",this.defaultStep=Hi(a.defaultStep,void 0),this.defaultTimeout=Hi(a.defaultTimeout,50),this.defaultInterpolateType=Hi(a.defaultInterpolateType,""),this.defaultInterpolateStep=Hi(a.defaultInterpolateStep,5),this.defaultMode=Hi(a.defaultMode,"loop"),this.defaultDirection=Hi(a.defaultDirection,"forward"),i.signals.frameChanged.add(function(t){o.signals.frameChanged.dispatch(t)}),i.signals.playerChanged.add(function(t){o.signals.playerChanged.dispatch(t)}),i.signals.gotNumframes.add(function(t){o.signals.gotNumframes.dispatch(t)}),void 0!==a.initialFrame&&this.setFrame(a.initialFrame)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},_signalNames:{}};return i.type.get=function(){return"trajectory"},i._signalNames.get=function(){return t.prototype._signalNames.concat(Yy)},e.prototype.addRepresentation=function(e,i){return t.prototype.addRepresentation.call(this,e,this.trajectory,i)},e.prototype.setFrame=function(t){this.trajectory.setFrame(t)},e.prototype.setParameters=function(t){return this.trajectory.setParameters(t),this.signals.parametersChanged.dispatch(t),this},e.prototype.dispose=function(){this.trajectory.dispose(),t.prototype.dispose.call(this)},e.prototype.getCenter=function(){},Object.defineProperties(e.prototype,i),e}(ry),Ky=function(t){function e(e,i,r){t.call(this,"",i,r),this.name=e.name,this.path=e.path,this.frames=e.coordinates,this.boxes=e.boxes}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"frames"},e.prototype.makeAtomIndices=function(){"StructureView"===this.structure.type?this.atomIndices=this.structure.getAtomIndices():this.atomIndices=null},e.prototype._loadFrame=function(t,e){var i,r=this.frames[t];if(this.atomIndices){var n=this.atomIndices,o=n.length;i=new Float32Array(3*o);for(var a=0;a<o;++a){var s=3*a,c=3*n[a];i[s+0]=r[c+0],i[s+1]=r[c+1],i[s+2]=r[c+2]}}else i=new Float32Array(r);var u=this.boxes[t],l=this.frames.length;this.process(t,u,i,l),"function"==typeof e&&e()},e.prototype.getNumframes=function(){this.frames&&this.setNumframes(this.frames.length)},e.prototype.getPath=function(t,e){var i,r,n,o=this,a=this.numframes,s=3*t,c=new Float32Array(3*a);for(i=0;i<a;++i)r=3*i,n=o.frames[i],c[r+0]=n[s+0],c[r+1]=n[s+1],c[r+2]=n[s+2];e(c)},Object.defineProperties(e.prototype,i),e}(fv),Qy=function(t){function e(e,i,r){t.call(this,"",i,r)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"structure"},e.prototype.makeAtomIndices=function(){this.structure.atomSet.size()<this.structure.atomStore.count?this.atomIndices=this.structure.getAtomIndices():this.atomIndices=null},e.prototype._loadFrame=function(t,e){var i,r=this.structure,n=r.frames[t];if(this.atomIndices){var o=this.atomIndices,a=o.length;i=new Float32Array(3*a);for(var s=0;s<a;++s){var c=3*s,u=3*o[s];i[c+0]=n[u+0],i[c+1]=n[u+1],i[c+2]=n[u+2]}}else i=new Float32Array(n);var l=r.boxes[t],h=r.frames.length;this.process(t,l,i,h),"function"==typeof e&&e()},e.prototype.getNumframes=function(){this.setNumframes(this.structure.frames.length)},e.prototype.getPath=function(t,e){var i,r,n,o=this,a=this.numframes,s=3*t,c=new Float32Array(3*a);for(i=0;i<a;++i)r=3*i,n=o.structure.frames[i],c[r+0]=n[s+0],c[r+1]=n[s+1],c[r+2]=n[s+2];e(c)},Object.defineProperties(e.prototype,i),e}(fv),Jy=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"remote"},e.prototype.makeAtomIndices=function(){var t=[];if("StructureView"===this.structure.type){var e,i,r=this.structure.getAtomIndices(),n=r[0],o=r[0],a=r.length;for(e=1;e<a;++e)i=r[e],o+1<i&&(t.push([n,o+1]),n=i),o=i;t.push([n,o+1])}else t.push([0,this.atomCount]);this.atomIndices=t},e.prototype._loadFrame=function(t,e){var i=new XMLHttpRequest,r=Qp.trajectory,n=r.getFrameUrl(this.trajPath,t),o=r.getFrameParams(this.trajPath,this.atomIndices);i.open("POST",n,!0),i.responseType="arraybuffer",i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.addEventListener("load",function(){var r=i.response;if(!r)return void qp.error("empty arrayBuffer for '"+n+"'");var o=new Int32Array(r,0,1)[0],a=new Float32Array(r,8,9),s=new Float32Array(r,44);this.process(t,a,s,o),"function"==typeof e&&e()}.bind(this),!1),i.send(o)},e.prototype.getNumframes=function(){var t=new XMLHttpRequest,e=Qp.trajectory,i=e.getNumframesUrl(this.trajPath);t.open("GET",i,!0),t.addEventListener("load",function(){this.setNumframes(parseInt(t.response))}.bind(this),!1),t.send(null)},e.prototype.getPath=function(t,e){if(this.pathCache[t])return void e(this.pathCache[t]);qp.time("loadPath");var i=new XMLHttpRequest,r=Qp.trajectory,n=r.getPathUrl(this.trajPath,t),o="";i.open("POST",n,!0),i.responseType="arraybuffer",i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.addEventListener("load",function(){qp.timeEnd("loadPath");var r=i.response;if(!r)return void qp.error("empty arrayBuffer for '"+n+"'");var o=new Float32Array(r);this.pathCache[t]=o,e(o)}.bind(this),!1),i.send(o)},Object.defineProperties(e.prototype,i),e}(fv);Io.prototype.getView=function(t){return new ya(this,t)},ya.prototype=Object.assign(Object.create(Io.prototype),{constructor:ya,type:"StructureView",init:function(){Object.defineProperties(this,{name:{get:function(){return this.structure.name}},path:{get:function(){return this.structure.path}},title:{get:function(){return this.structure.title}},id:{get:function(){return this.structure.id}},atomSetDict:{get:function(){return this.structure.atomSetDict}},biomolDict:{get:function(){return this.structure.biomolDict}},entityList:{get:function(){return this.structure.entityList}},unitcell:{get:function(){return this.structure.unitcell}},frames:{get:function(){return this.structure.frames}},boxes:{get:function(){return this.structure.boxes}},validation:{get:function(){return this.structure.validation}},bondStore:{get:function(){return this.structure.bondStore}},backboneBondStore:{get:function(){return this.structure.backboneBondStore}},rungBondStore:{get:function(){return this.structure.rungBondStore}},atomStore:{get:function(){return this.structure.atomStore}},residueStore:{get:function(){return this.structure.residueStore}},chainStore:{get:function(){return this.structure.chainStore}},modelStore:{get:function(){return this.structure.modelStore}},atomMap:{get:function(){return this.structure.atomMap}},residueMap:{get:function(){return this.structure.residueMap}},bondHash:{get:function(){return this.structure.bondHash}},spatialHash:{get:function(){return this.structure.spatialHash}}}),this._bp=this.getBondProxy(),this._ap=this.getAtomProxy(),this._rp=this.getResidueProxy(),this._cp=this.getChainProxy(),this.selection&&this.selection.signals.stringChanged.add(this.refresh,this),this.structure.signals.refreshed.add(this.refresh,this)},refresh:function(){var e=this;t.Debug&&qp.time("StructureView.refresh"),this.atomSetCache={},this.atomSet=this.getAtomSet(this.selection,!0),this.structure.atomSet&&(t.Debug&&qp.time("StructureView.refresh#atomSet.intersection"),this.atomSet=this.atomSet.intersection(this.structure.atomSet),t.Debug&&qp.timeEnd("StructureView.refresh#atomSet.intersection")),this.bondSet=this.getBondSet(),t.Debug&&qp.time("StructureView.refresh#atomSetDict.new_intersection");for(var i in e.atomSetDict){var r=e.atomSetDict[i];e.atomSetCache["__"+i]=r.new_intersection(e.atomSet)}t.Debug&&qp.timeEnd("StructureView.refresh#atomSetDict.new_intersection"),t.Debug&&qp.time("StructureView.refresh#size"),this.atomCount=this.atomSet.size(),this.bondCount=this.bondSet.size(),t.Debug&&qp.timeEnd("StructureView.refresh#size"),this.boundingBox=this.getBoundingBox(),this.center=this.boundingBox.center(),t.Debug&&qp.timeEnd("StructureView.refresh"),this.signals.refreshed.dispatch()},setSelection:function(t){this.selection=t,this.refresh()},getSelection:function(t){var e=[];t&&t.string&&e.push(t.string);var i=this.structure.getSelection();i&&i.string&&e.push(i.string),this.selection&&this.selection.string&&e.push(this.selection.string);var r="";return e.length>0&&(r="( "+e.join(" ) AND ( ")+" )"),new Tr(r)},getStructure:function(){return this.structure.getStructure()},eachBond:function(t,e){this.structure.eachBond(t,this.getSelection(e))},eachAtom:function(t,e){var i=this.getAtomProxy(),r=this.getAtomSet(e),n=this.atomStore.count;if(r&&r.size()<n)r.forEach(function(e){i.index=e,t(i)});else for(var o=0;o<n;++o)i.index=o,t(i)},eachResidue:function(t,e){this.structure.eachResidue(t,this.getSelection(e))},eachResidueN:function(){console.error("StructureView.eachResidueN() not implemented")},eachChain:function(t,e){this.structure.eachChain(t,this.getSelection(e))},eachModel:function(t,e){this.structure.eachModel(t,this.getSelection(e))},getAtomSet:function(e,i){t.Debug&&qp.time("StructureView.getAtomSet");var r=this.structure.getAtomSet(e);return!i&&this.atomSet&&(r=r.new_intersection(this.atomSet)),t.Debug&&qp.timeEnd("StructureView.getAtomSet"),r},getAtomIndices:function(t){return this.structure.getAtomIndices(this.getSelection(t))},refreshPosition:function(){return this.structure.refreshPosition()},dispose:function(){this.selection&&this.selection.signals.stringChanged.remove(this.refresh,this),this.structure.signals.refreshed.remove(this.refresh,this),
	delete this.structure,delete this.atomSet,delete this.bondSet,delete this.atomCount,delete this.bondCount}});var tb=["trajectoryAdded","trajectoryRemoved","defaultAssemblyChanged"],eb=function(t){function e(e,i,r){var n=r||{};n.name=Hi(n.name,i.name),t.call(this,e,n),this.structure=i,this.trajList=[],this.initSelection(n.sele),this.setDefaultAssembly(n.assembly||""),this.stage.gidPool.addObject(this.structure)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},_signalNames:{}};return i.type.get=function(){return"structure"},i._signalNames.get=function(){return t.prototype._signalNames.concat(tb)},e.prototype.initSelection=function(t){var e=this;this.selection=new Tr(t),this.structureView=new ya(this.structure,this.selection),this.selection.signals.stringChanged.add(function(){e.structureView.setSelection(e.selection),e.rebuildRepresentations(),e.rebuildTrajectories()})},e.prototype.setSelection=function(t){return this.selection.setString(t),this},e.prototype.setDefaultAssembly=function(t){var e=this;this.defaultAssembly=t,this.reprList.forEach(function(t){t.setParameters({defaultAssembly:e.defaultAssembly})}),this.signals.defaultAssemblyChanged.dispatch(t)},e.prototype.rebuildRepresentations=function(){this.reprList.forEach(function(t){t.build()})},e.prototype.rebuildTrajectories=function(){var t=this;this.trajList.slice().forEach(function(e){e.trajectory.setStructure(t.structureView)})},e.prototype.addRepresentation=function(e,i){var r=i||{};return r.defaultAssembly=this.defaultAssembly,t.prototype.addRepresentation.call(this,e,this.structureView,r)},e.prototype.addTrajectory=function(t,e){var i=this,r=va(t,this.structureView,e);r.signals.frameChanged.add(function(){i.updateRepresentations({position:!0})});var n=new Zy(this.stage,r,e,this);return this.trajList.push(n),this.signals.trajectoryAdded.dispatch(n),n},e.prototype.removeTrajectory=function(t){var e=this.trajList.indexOf(t);e!==-1&&this.trajList.splice(e,1),t.dispose(),this.signals.trajectoryRemoved.dispatch(t)},e.prototype.dispose=function(){this.stage.gidPool.removeObject(this.structure),this.trajList.slice().forEach(function(t){t.dispose()}),this.trajList.length=0,this.structure.dispose(),t.prototype.dispose.call(this)},e.prototype.autoView=function(t,e){Number.isInteger(t)&&(e=t,t=void 0),this.stage.animationControls.zoomMove(this.getCenter(t),this.getZoom(t),Hi(e,0))},e.prototype.getBox=function(t){var e;return e=t?this.structureView.getBoundingBox(new Tr(t)):this.structureView.boundingBox},e.prototype.getCenter=function(t){return t?this.structure.atomCenter(new Tr(t)):this.structure.center},e.prototype.superpose=function(t,e,i,r){return ga(this.structureView,t.structureView,e,i,r),this.updateRepresentations({position:!0}),this},e.prototype.setVisibility=function(e){return t.prototype.setVisibility.call(this,e),this.trajList.forEach(function(t){t.setVisibility(e)}),this},Object.defineProperties(e.prototype,i),e}(ry);rm.add("structure",eb);var ib=function(t){function e(e,i,r){var n=r||{};n.name=Hi(n.name,i.name),t.call(this,e,n),this.surface=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"surface"},e.prototype.addRepresentation=function(e,i){return t.prototype.addRepresentation.call(this,e,this.surface,i)},e.prototype.getBox=function(){return this.surface.boundingBox},e.prototype.getCenter=function(){return this.surface.center},e.prototype.dispose=function(){this.surface.dispose(),t.prototype.dispose.call(this)},Object.defineProperties(e.prototype,i),e}(ry);rm.add("surface",ib);var rb=function(t){function e(e,i,r){var n=r||{};n.name=Hi(n.name,i.name),t.call(this,e,n),this.volume=i,this.stage.gidPool.addObject(this.volume)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"volume"},e.prototype.addRepresentation=function(e,i){return t.prototype.addRepresentation.call(this,e,this.volume,i)},e.prototype.getBox=function(){return this.volume.boundingBox},e.prototype.getCenter=function(){return this.volume.center},e.prototype.dispose=function(){this.stage.gidPool.removeObject(this.volume),this.volume.dispose(),t.prototype.dispose.call(this)},Object.defineProperties(e.prototype,i),e}(ry);rm.add("volume",rb),ba.prototype=Object.assign(Object.create(la.prototype),{constructor:ba,type:"axes",parameters:Object.assign({radius:{type:"number",precision:3,max:10,min:.001},sphereDetail:!0,radialSegments:!0,disableImpostor:!0,showAxes:{type:"boolean",rebuild:!0},showBox:{type:"boolean",rebuild:!0}},ia.prototype.parameters,{assembly:null}),init:function(t){var e=t||{};e.radius=Hi(e.radius,.5),e.colorValue=Hi(e.colorValue,"lightgreen"),la.prototype.init.call(this,e),this.showAxes=Hi(e.showAxes,!0),this.showBox=Hi(e.showBox,!1)},getPrincipalAxes:function(){var t,e=this.getAssembly();return e&&(t=e.partList[0].getSelection()),this.structureView.getPrincipalAxes(t)},getAxesData:function(t){var e=this.getPrincipalAxes(t),i=new ct(this.colorValue),r=0,n=0;this.showAxes&&(r+=6,n+=3),this.showBox&&(r+=8,n+=12);var o=new Float32Array(3*r),a=qr(r,i.r,i.g,i.b),s=Xr(r,this.radius),c=new Float32Array(3*n),u=new Float32Array(3*n),l=qr(n,i.r,i.g,i.b),h=Xr(n,this.radius),d=0;if(this.showAxes){var f=function(t,e){t.toArray(o,2*d),e.toArray(o,2*d+3),t.toArray(c,d),e.toArray(u,d),d+=3};f(e.begA,e.endA),f(e.begB,e.endB),f(e.begC,e.endC)}if(this.showBox){var p=new g,m=e.getProjectedScaleForAtoms(t),v=m.d1a,y=m.d2a,b=m.d3a,x=m.d1b,_=m.d2b,w=m.d3b;console.log(v,y,b,x,_,w);var S=2*d,A=function(t,i,r){p.copy(e.center).addScaledVector(e.normVecA,t).addScaledVector(e.normVecB,i).addScaledVector(e.normVecC,r),p.toArray(o,S),S+=3};A(v,y,b),A(v,y,w),A(v,_,w),A(v,_,b),A(x,_,w),A(x,_,b),A(x,y,b),A(x,y,w);var M=d,P=function(t,e){p.fromArray(o,2*d+3*t).toArray(c,M),p.fromArray(o,2*d+3*e).toArray(u,M),M+=3};P(0,1),P(0,3),P(0,6),P(1,2),P(1,7),P(2,3),P(2,4),P(3,5),P(4,5),P(4,7),P(5,6),P(6,7)}return{vertex:{position:o,color:a,radius:s},edge:{position1:c,position2:u,color:l,color2:l,radius:h}}},create:function(){var t=this.getAxesData(this.structureView);this.sphereBuffer=new Ko(t.vertex,this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0})),this.cylinderBuffer=new Jo(t.edge,this.getBufferParams({openEnded:!0,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0})),this.dataList.push({sview:this.structureView,bufferList:[this.sphereBuffer,this.cylinderBuffer]})},updateData:function(t,e){var i=this.getAxesData(e.sview),r={},n={};t&&!t.position||(r.position=i.vertex.position,n.position1=i.edge.position1,n.position2=i.edge.position2),t&&!t.color||(r.color=i.vertex.color,n.color=i.edge.color,n.color2=i.edge.color),t&&!t.radius||(r.radius=i.vertex.radius,n.radius=i.edge.radius),this.sphereBuffer.setAttributes(r),this.cylinderBuffer.setAttributes(n)}}),Jp.add("axes",ba),xa.prototype=Object.assign(Object.create(la.prototype),{constructor:xa,type:"ball+stick",defaultSize:.15,parameters:Object.assign({sphereDetail:!0,radialSegments:!0,openEnded:!0,disableImpostor:!0,aspectRatio:{type:"number",precision:1,max:10,min:1},lineOnly:{type:"boolean",rebuild:!0},cylinderOnly:{type:"boolean",rebuild:!0},multipleBond:{type:"select",rebuild:!0,options:{off:"off",symmetric:"symmetric",offset:"offset"}},bondScale:{type:"number",precision:2,max:1,min:.01},bondSpacing:{type:"number",precision:2,max:2,min:.5}},la.prototype.parameters),init:function(t){var e=t||{};e.radius=Hi(e.radius,this.defaultSize),this.aspectRatio=Hi(e.aspectRatio,2),this.lineOnly=Hi(e.lineOnly,!1),this.cylinderOnly=Hi(e.cylinderOnly,!1),this.multipleBond=Hi(e.multipleBond,"off"),this.bondSpacing=Hi(e.bondSpacing,1),this.bondScale=Hi(e.bondScale,.4),la.prototype.init.call(this,e)},getAtomParams:function(t,e){return e=Object.assign({radiusParams:{radius:this.radius,scale:this.scale*this.aspectRatio}},e),la.prototype.getAtomParams.call(this,t,e)},getAtomData:function(t,e,i){return t.getAtomData(this.getAtomParams(e,i))},getBondParams:function(t,e){return e=Object.assign({multipleBond:this.multipleBond,bondSpacing:this.bondSpacing,bondScale:this.bondScale},e),la.prototype.getBondParams.call(this,t,e)},getBondData:function(t,e,i){return t.getBondData(this.getBondParams(e,i))},createData:function(t){var e=this.getBondData(t),i=[];if(this.lineOnly)this.lineBuffer=new ty(e,this.getBufferParams()),i.push(this.lineBuffer);else{var r=new Jo(e,this.getBufferParams({openEnded:this.openEnded,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0}));if(i.push(r),!this.cylinderOnly){var n=new Ko(this.getAtomData(t),this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0}));i.push(n)}}return{bufferList:i}},updateData:function(t,e){"off"!==this.multipleBond&&t&&t.radius&&(t.position=!0);var i=this.getBondData(e.sview,t);if(this.lineOnly){var r={};t&&!t.position||(r.position1=i.position1,r.position2=i.position2),t&&!t.color||(r.color=i.color,r.color2=i.color2),e.bufferList[0].setAttributes(r)}else{var n={};if(t&&!t.position||(n.position1=i.position1,n.position2=i.position2),t&&!t.color||(n.color=i.color,n.color2=i.color2),t&&!t.radius||(n.radius=i.radius),e.bufferList[0].setAttributes(n),!this.cylinderOnly){var o=this.getAtomData(e.sview,t),a={};t&&!t.position||(a.position=o.position),t&&!t.color||(a.color=o.color),t&&!t.radius||(a.radius=o.radius),e.bufferList[1].setAttributes(a)}}},setParameters:function(t){var e=!1,i={};return t&&(t.aspectRatio||t.bondSpacing||t.bondScale)&&(i.radius=!0,Xp&&!this.disableImpostor||(e=!0)),la.prototype.setParameters.call(this,t,i,e),this}}),Jp.add("ball+stick",xa),_a.prototype=Object.assign(Object.create(xa.prototype),{constructor:_a,type:"backbone",defaultSize:.25,parameters:Object.assign({},xa.prototype.parameters,{multipleBond:null,bondSpacing:null}),init:function(t){var e=t||{};e.aspectRatio=Hi(e.aspectRatio,1),xa.prototype.init.call(this,e)},getAtomData:function(t,e,i){return t.getBackboneAtomData(this.getAtomParams(e,i))},getBondData:function(t,e,i){var r=this.getBondParams(e,i);return r.colorParams.backbone=!0,t.getBackboneBondData(r)}}),Jp.add("backbone",_a),wa.prototype=Object.assign(Object.create(xa.prototype),{constructor:wa,type:"base",defaultSize:.3,parameters:Object.assign({},xa.prototype.parameters,{multipleBond:null,bondSpacing:null}),init:function(t){var e=t||{};e.aspectRatio=Hi(e.aspectRatio,1),xa.prototype.init.call(this,e)},getAtomData:function(t,e,i){return t.getRungAtomData(this.getAtomParams(e,i))},getBondData:function(t,e,i){var r=this.getBondParams(e,i);return r.colorParams.rung=!0,t.getRungBondData(r)}}),Jp.add("base",wa),Aa.prototype={constructor:Aa,getAtomIterator:function(t,e){function i(){var t=this.get(u);return u+=1,t}function r(i){var r=l[c%4];if(r.index=o.getAtomIndexByType(i,t),e&&i>0&&i<s&&"e"===r.sstruc){var n=h[c%4];return d.index=o.getAtomIndexByType(i+1,t),f.index=o.getAtomIndexByType(i-1,t),n.addVectors(d,f).add(r).add(r).multiplyScalar(.25),c+=1,n}return c+=1,r}function n(){c=0,u=-1}var o=this.polymer,a=o.structure,s=o.residueCount,c=0,u=-1,l=[a.getAtomProxy(),a.getAtomProxy(),a.getAtomProxy(),a.getAtomProxy()],h=[new g,new g,new g,new g],d=a.getAtomProxy(),f=a.getAtomProxy();return{size:s,next:i,get:r,reset:n}},getSubdividedColor:function(t){function e(t,e,i){d.atomColorToArray(t,e,i)}function i(t,e,i){f.atomColorToArray(t,e,i)}var r=this.subdiv,n=this.polymer,o=n.residueCount,a=o-1,s=a*r*3+3;n.isCyclic&&(s+=3*r);var c=new Float32Array(s),u=new Float32Array(s),l=this.getAtomIterator("trace"),h=t||{};h.structure=n.structure;var d=Kp.getScheme(h),f=Kp.getPickingScheme(h);return this.interpolator.getColor(l,e,i,c,u,0,n.isCyclic),{color:c,pickingColor:u}},getSubdividedPosition:function(){var t=this.getPosition();return{position:t}},getSubdividedOrientation:function(){var t=this.getTangent(),e=this.getNormals(t);return{tangent:t,normal:e.normal,binormal:e.binormal}},getSubdividedSize:function(t,e){function i(t){return l.atomRadius(t)}var r=this.subdiv,n=this.polymer,o=n.residueCount,a=o-1,s=a*r+1;n.isCyclic&&(s+=r);var c=new Float32Array(s),u=this.getAtomIterator("trace"),l=new sn(t,e);return this.interpolator.getSize(u,i,c,0,n.isCyclic),{size:c}},getPosition:function(){var t=this.subdiv,e=this.polymer,i=e.residueCount,r=i-1,n=r*t*3+3;e.isCyclic&&(n+=3*t);var o=new Float32Array(n),a=this.positionIterator||this.getAtomIterator("trace",this.smoothSheet);return this.interpolator.getPosition(a,o,0,e.isCyclic),o},getTangent:function(){var t=this.subdiv,e=this.polymer,i=this.size,r=i-1,n=r*t*3+3;e.isCyclic&&(n+=3*t);var o=new Float32Array(n),a=this.positionIterator||this.getAtomIterator("trace",this.smoothSheet);return this.interpolator.getTangent(a,o,0,e.isCyclic),o},getNormals:function(t){var e=this.subdiv,i=this.polymer,r=i.isProtein(),n=this.size,o=n-1,a=o*e*3+3;i.isCyclic&&(a+=3*e);var s=new Float32Array(a),c=new Float32Array(a);if(this.directional&&!this.polymer.isCg()){var u=this.getAtomIterator("direction1"),l=this.getAtomIterator("direction2");this.interpolator.getNormalDir(u,l,t,s,c,0,i.isCyclic,r)}else this.interpolator.getNormal(n,t,s,c,0,i.isCyclic,r);return{normal:s,binormal:c}}};var nb=new g,ob=new g,ab=function(t){function e(e,i){var r=e||{},n=i||{},o=Hi(n.radialSegments,4),a=Hi(n.capped,!1),s=a?o:0,c=a?o-2:0,u=r.position.length/3,l=u-1,h=u*o*3+2*s*3,d=new Float32Array(h),f=new Float32Array(h),p=new Float32Array(h),m=r.pickingColor?new Float32Array(h):void 0,g=2*l*o*3+2*c*3,v=h/3>65535?Uint32Array:Uint16Array,y=new v(g);t.call(this,{position:d,color:f,index:y,normal:p,pickingColor:m},n),this.aspectRatio=Hi(n.aspectRatio,1),this.radialSegments=o,this.capped=a,this.capVertices=s,this.capTriangles=c,this.size2=u,this.setAttributes(r),this.meshIndex=y,this.makeIndex()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setAttributes=function(t){var e,i,r,n,o,a,s,c,u,l,h,d=this.aspectRatio,f=this.size2,p=f-1,m=this.radialSegments,g=this.geometry.attributes;t.position&&(e=t.position,i=t.normal,r=t.binormal,n=t.tangent,a=t.size,c=g.position.array,l=g.normal.array,g.position.needsUpdate=!0,g.normal.needsUpdate=!0),t.color&&(o=t.color,u=g.color.array,g.color.needsUpdate=!0),t.pickingColor&&(s=t.pickingColor,h=g.pickingColor.array,g.pickingColor.needsUpdate=!0);var v,y,b,x,_,w,S,A,M,P,C,T,E,I,L,R,O,D,N,k,F,B,z,U=[],j=[],$=[],V=[],G=[],H=[];if(e)for(y=0;y<m;++y)S=y/m*2*Math.PI,U[y]=d*Math.cos(S),j[y]=Math.sin(S),$[y]=d*Math.cos(S-.01),V[y]=Math.sin(S-.01),G[y]=d*Math.cos(S+.01),H[y]=Math.sin(S+.01);for(v=0;v<f;++v)for(b=3*v,x=b*m,e&&(nb.set(n[b],n[b+1],n[b+2]),L=i[b],R=i[b+1],O=i[b+2],D=r[b],N=r[b+1],k=r[b+2],F=e[b],B=e[b+1],z=e[b+2],I=a[v]),y=0;y<m;++y)_=x+3*y,e&&(A=-I*U[y],M=I*j[y],P=-I*$[y],C=I*V[y],T=-I*G[y],E=I*H[y],c[_]=F+A*L+M*D,c[_+1]=B+A*R+M*N,c[_+2]=z+A*O+M*k,ob.set(T*L+E*D-(P*L+C*D),T*R+E*N-(P*R+C*N),T*O+E*k-(P*O+C*k)).cross(nb),l[_]=ob.x,l[_+1]=ob.y,l[_+2]=ob.z),o&&(u[_]=o[b],u[_+1]=o[b+1],u[_+2]=o[b+2]),s&&(h[_]=s[b],h[_+1]=s[b+1],h[_+2]=s[b+2]);for(b=0,x=3*f*m,y=0;y<m;++y)_=b+3*y,w=x+3*y,e&&(c[w]=c[_],c[w+1]=c[_+1],c[w+2]=c[_+2],l[w]=n[b],l[w+1]=n[b+1],l[w+2]=n[b+2]),o&&(u[w]=u[_],u[w+1]=u[_+1],u[w+2]=u[_+2]),s&&(h[w]=h[_],h[w+1]=h[_+1],h[w+2]=h[_+2]);for(b=3*(f-1)*m,x=3*(f+1)*m,y=0;y<m;++y)_=b+3*y,w=x+3*y,e&&(c[w]=c[_],c[w+1]=c[_+1],c[w+2]=c[_+2],l[w]=n[3*p],l[w+1]=n[3*p+1],l[w+2]=n[3*p+2]),o&&(u[w]=u[_],u[w+1]=u[_+1],u[w+2]=u[_+2]),s&&(h[w]=h[_],h[w+1]=h[_+1],h[w+2]=h[_+2])},e.prototype.makeIndex=function(){var t,e,i,r,n,o,a=this.meshIndex,s=this.size2,c=s-1,u=this.capTriangles,l=this.radialSegments,h=this.radialSegments+1;for(t=0;t<c;++t)for(e=t*l*3*2,i=t*l,r=(t+1)*l,o=0;o<l;++o)n=e+3*o*2,a[n]=i+o,a[n+1]=i+(o+1)%l,a[n+2]=r+o,a[n+3]=r+o,a[n+4]=i+(o+1)%l,a[n+5]=r+(o+1)%l;var d=[0];for(o=1;o<h/2;++o)d.push(o),l-o!==o&&d.push(l-o);for(n=c*l*3*2,e=s*l,o=0;o<d.length-2;++o)o%2===0?(a[n+3*o+0]=e+d[o+0],a[n+3*o+1]=e+d[o+1],a[n+3*o+2]=e+d[o+2]):(a[n+3*o+0]=e+d[o+2],a[n+3*o+1]=e+d[o+1],a[n+3*o+2]=e+d[o+0]);for(n=c*l*3*2+3*u,e=s*l+l,o=0;o<d.length-2;++o)o%2===0?(a[n+3*o+0]=e+d[o+0],a[n+3*o+1]=e+d[o+1],a[n+3*o+2]=e+d[o+2]):(a[n+3*o+0]=e+d[o+2],a[n+3*o+1]=e+d[o+1],a[n+3*o+2]=e+d[o+0])},e}(vv);Ma.prototype=Object.assign(Object.create(la.prototype),{constructor:Ma,type:"cartoon",parameters:Object.assign({aspectRatio:{type:"number",precision:1,max:10,min:1},subdiv:{type:"integer",max:50,min:1,rebuild:!0},radialSegments:{type:"integer",max:50,min:1,rebuild:!0},tension:{type:"number",precision:1,max:1,min:.1},capped:{type:"boolean",rebuild:!0},smoothSheet:{type:"boolean",rebuild:!0}},la.prototype.parameters),init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"chainname"),e.colorScale=Hi(e.colorScale,"RdYlBu"),e.radius=Hi(e.radius,"sstruc"),e.scale=Hi(e.scale,.7),this.aspectRatio=Hi(e.aspectRatio,5),this.tension=Hi(e.tension,NaN),this.capped=Hi(e.capped,!0),this.smoothSheet=Hi(e.smoothSheet,!1),la.prototype.init.call(this,e),"low"===e.quality?(this.subdiv=3,this.radialSegments=6):"medium"===e.quality?this.subdiv=6:"high"===e.quality?this.subdiv=12:this.subdiv=Hi(e.subdiv,6)},getSplineParams:function(t){return Object.assign({subdiv:this.subdiv,tension:this.tension,directional:1!==this.aspectRatio,smoothSheet:this.smoothSheet},t)},getSpline:function(t){return new Aa(t,this.getSplineParams())},getScale:function(t){return t.isCg()?this.scale*this.aspectRatio:this.scale},getAspectRatio:function(t){return t.isCg()?1:this.aspectRatio},createData:function(t){var e=[],i=[];return this.structure.eachPolymer(function(t){if(!(t.residueCount<4)){i.push(t);var r=this.getSpline(t),n=r.getSubdividedPosition(),o=r.getSubdividedOrientation(),a=r.getSubdividedColor(this.getColorParams()),s=r.getSubdividedSize(this.radius,this.getScale(t));e.push(new ab(Object.assign({},n,o,a,s),this.getBufferParams({radialSegments:this.radialSegments,aspectRatio:this.getAspectRatio(t),capped:this.capped,dullInterior:!0})))}}.bind(this),t.getSelection()),{bufferList:e,polymerList:i}},updateData:function(e,i){var r=this;t.Debug&&qp.time(this.type+" repr update"),e=e||{};for(var n=0,o=i.polymerList.length;n<o;++n){var a={},s=i.polymerList[n],c=r.getSpline(s);if(i.bufferList[n].aspectRatio=r.getAspectRatio(s),e.position||e.radius){var u=c.getSubdividedPosition(),l=c.getSubdividedOrientation(),h=c.getSubdividedSize(r.radius,r.getScale(s));a.position=u.position,a.normal=l.normal,a.binormal=l.binormal,a.tangent=l.tangent,a.size=h.size}if(e.color){var d=c.getSubdividedColor(r.getColorParams());a.color=d.color,a.pickingColor=d.pickingColor}i.bufferList[n].setAttributes(a)}t.Debug&&qp.timeEnd(this.type+" repr update")},setParameters:function(t){var e=!1,i={};return t&&t.aspectRatio&&(i.radius=!0),t&&t.tension&&(i.position=!0),la.prototype.setParameters.call(this,t,i,e),this}}),Jp.add("cartoon",Ma),Pa.prototype={within:function(t,e){qp.time("Contact within");var i=this.kdtree2,r=this.sview1.getAtomProxy(),n=this.sview1.getAtomSet(!1),o=new Kn;this.sview1.eachAtom(function(a){for(var s=!1,c=i.nearest(a,1/0,t),u=0,l=c.length;u<l;++u){var h=c[u];r.index=h.index,a.residueIndex!==r.residueIndex&&(!e||h.distance>e)&&(s=!0,n.add_unsafe(r.index),o.addBond(a,r,1))}s&&n.add_unsafe(a.index)});var a=new cg(o.count);return a.set_all(!0),qp.timeEnd("Contact within"),{atomSet:n,bondSet:a,bondStore:o}}},Ea.prototype=Object.assign(Object.create(la.prototype),{constructor:Ea,type:"contact",defaultSize:.25,parameters:Object.assign({contactType:{type:"select",rebuild:!0,options:{polar:"polar",polarBackbone:"polar backbone"}},maxDistance:{type:"number",precision:1,max:10,min:.1,rebuild:!0},maxAngle:{type:"integer",max:180,min:0,rebuild:!0},radialSegments:!0,disableImpostor:!0},la.prototype.parameters),init:function(t){var e=t||{};e.radius=Hi(e.radius,this.defaultSize),this.contactType=Hi(e.contactType,"polarBackbone"),this.maxDistance=Hi(e.maxDistance,3.5),this.maxAngle=Hi(e.maxAngle,40),la.prototype.init.call(this,e)},getContactData:function(t){var e={polar:Ca,polarBackbone:Ta},i=e[this.contactType](t,this.maxDistance,this.maxAngle);return i},getBondData:function(t,e,i){return t.getBondData(this.getBondParams(e,i))},createData:function(t){var e=this.getContactData(t),i={bondSet:e.bondSet,bondStore:e.bondStore},r=this.getBondData(t,void 0,i),n=new Jo(r,this.getBufferParams({openEnded:!1,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0}));return{bufferList:[n],bondSet:e.bondSet,bondStore:e.bondStore}},updateData:function(t,e){if(!t||t.position){var i=this.getContactData(e.sview);e.bondSet=i.bondSet,e.bondStore=i.bondStore}var r={bondSet:e.bondSet,bondStore:e.bondStore},n=this.getBondData(e.sview,t,r),o={};t&&!t.position||(o.position=Wr(n.position1,n.position2),o.position1=n.position1,o.position2=n.position2),t&&!t.color||(o.color=n.color1,o.color2=n.color2),t&&!t.radius||(o.radius=n.radius),e.bufferList[0].setAttributes(o)}}),Jp.add("contact",Ea),em.add("shader/SDFFont.vert","uniform float nearClip;\nuniform float clipRadius;\nuniform vec3 clipCenter;\nuniform float xOffset;\nuniform float yOffset;\nuniform float zOffset;\nuniform bool ortho;\nvarying vec3 vViewPosition;\nvarying vec2 texCoord;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\nattribute vec2 mapping;\nattribute vec2 inputTexCoord;\nattribute float inputSize;\n#include color_pars_vertex\n#include common\nvoid main(void){\n#include color_vertex\ntexCoord = inputTexCoord;\nfloat _zOffset = zOffset;\nif( texCoord.x == 10.0 ){\n_zOffset -= 0.001;\n}\nvec3 pos = position;\nif( ortho ){\npos += normalize( cameraPosition ) * _zOffset;\n}\nvec4 cameraPos = modelViewMatrix * vec4( pos, 1.0 );\nvec4 cameraCornerPos = vec4( cameraPos.xyz, 1.0 );\ncameraCornerPos.xy += mapping * inputSize * 0.01;\ncameraCornerPos.x += xOffset;\ncameraCornerPos.y += yOffset;\nif( !ortho ){\ncameraCornerPos.xyz += normalize( -cameraCornerPos.xyz ) * _zOffset;\n}\ngl_Position = projectionMatrix * cameraCornerPos;\nvViewPosition = -cameraCornerPos.xyz;\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n#include radiusclip_vertex\n}"),em.add("shader/SDFFont.frag","uniform sampler2D fontTexture;\nuniform float opacity;\nuniform bool showBorder;\nuniform vec3 borderColor;\nuniform float borderWidth;\nuniform vec3 backgroundColor;\nuniform float backgroundOpacity;\nuniform float nearClip;\nuniform float clipRadius;\nvarying vec3 vViewPosition;\nvarying vec2 texCoord;\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\n#include common\n#include color_pars_fragment\n#include fog_pars_fragment\n#ifdef SDF\nconst float smoothness = 16.0;\n#else\nconst float smoothness = 256.0;\n#endif\nconst float gamma = 2.2;\nvoid main(){\n#include nearclip_fragment\n#include radiusclip_fragment\nif( texCoord.x > 1.0 ){\ngl_FragColor = vec4( backgroundColor, backgroundOpacity );\n}else{\nfloat sdf = texture2D( fontTexture, texCoord ).a;\nif( showBorder ) sdf += borderWidth;\nfloat w = clamp(\nsmoothness * ( abs( dFdx( texCoord.x ) ) + abs( dFdy( texCoord.y ) ) ),\n0.0,\n0.5\n);\nfloat a = smoothstep( 0.5 - w, 0.5 + w, sdf );\na = pow( a, 1.0 / gamma );\nif( a < 0.2 ) discard;\na *= opacity;\nvec3 outgoingLight = vColor;\nif( showBorder && sdf < ( 0.5 + borderWidth ) ){\noutgoingLight = borderColor;\n}\ngl_FragColor = vec4( outgoingLight, a );\n}\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n}");var sb={},cb=function(t){var e=Object.assign({},t);if(this.font=Hi(e.font,["sans-serif"]),this.size=Hi(e.size,36),this.style=Hi(e.style,"normal"),this.variant=Hi(e.variant,"normal"),this.weight=Hi(e.weight,"normal"),this.outline=Hi(e.outline,0),this.width=Hi(e.width,1024),this.height=Hi(e.height,1024),this.gamma=1,"undefined"!=typeof navigator){var i=navigator.userAgent;i.match(/Chrome/)&&i.match(/OS X/)&&(this.gamma=.5)}this.mapped={},this.scratchW=0,this.scratchH=0,this.currentX=0,this.currentY=0,this.build(),this.populate(),this.texture=new Pe(this.canvas2),this.texture.flipY=!1,this.texture.needsUpdate=!0};cb.prototype.build=function(){var t=this.size+2*this.outline+Math.round(this.size/4),e=this.width/4,i=document.createElement("canvas");i.width=e,i.height=t;var r=i.getContext("2d");r.font=this.style+" "+this.variant+" "+this.weight+" "+this.size+"px "+this.font,r.fillStyle="#FF0000",r.textAlign="left",r.textBaseline="bottom",r.lineJoin="round";for(var n=[],o=3*this.outline,a=0;a<o;++a){var s=Math.max(0,8*-a+128-8*!a),c=("00"+s.toString(16)).slice(-2);n.push("#"+c+c+c)}var u=new Uint8Array(e*t*2);this.canvas=i,this.context=r,this.lineHeight=t,this.maxWidth=e,this.colors=n,this.scratch=u,this.data=new Uint8Array(this.width*this.height*4),this.canvas2=document.createElement("canvas"),this.canvas2.width=this.width,this.canvas2.height=this.height,this.context2=this.canvas2.getContext("2d")},cb.prototype.map=function(t){return void 0===this.mapped[t]&&(this.draw(t),this.currentX+this.scratchW>this.width&&(this.currentX=0,this.currentY+=this.scratchH),this.currentY+this.scratchH>this.height&&console.warn("canvas to small"),this.mapped[t]={x:this.currentX,y:this.currentY,w:this.scratchW,h:this.scratchH},this.context2.drawImage(this.canvas,0,0,this.scratchW,this.scratchH,this.currentX,this.currentY,this.scratchW,this.scratchH),this.currentX+=this.scratchW),this.mapped[t]},cb.prototype.draw=function(t){var e=this.lineHeight,i=this.outline,r=this.context,n=this.scratch,o=this.maxWidth,a=this.colors,s=i,c=e-this.outline,u=r.measureText(t),l=Math.min(o,Math.ceil(u.width+2*s+1));r.clearRect(0,0,l,e);var h,d,f,p,m;if(0===this.outline)for(r.fillText(t,s,c),p=r.getImageData(0,0,l,e),m=p.data,f=3,h=0,d=m.length/4;h<d;++h)n[h]=m[f],f+=4;else{for(r.globalCompositeOperation="source-over",h=i+1;h>0;--h)f=h>1?2*h-2:h,r.strokeStyle=a[f-1],r.lineWidth=f,r.strokeText(t,s,c);r.globalCompositeOperation="multiply",r.fillStyle="#FF00FF",r.fillText(t,s,c),p=r.getImageData(0,0,l,e),m=p.data,f=0;var g=this.gamma;for(h=0,d=m.length/4;h<d;++h){var v=m[f],y=v?m[f+1]/v:1;.5===g&&(y=Math.sqrt(y)),y=Math.min(1,Math.max(0,y));var b=256-v,x=b+(v-b)*y;n[h]=Math.max(0,Math.min(255,x+2)),m[f+3]=n[h],f+=4}}r.putImageData(p,0,0),this.scratchW=l,this.scratchH=e},cb.prototype.populate=function(){for(var t=this,e=0;e<256;++e)t.map(String.fromCharCode(e))};var ub=function(t){function e(e,i){var r=e||{},n=i||{};n.forceTransparent=!0;for(var o=r.position.length/3,a=0,s=0;s<o;++s)a+=r.text[s].length;var c=a;n.showBackground&&(c+=o),t.call(this,{position:new Float32Array(3*c),color:new Float32Array(3*c)},n),this.fontFamily=Hi(n.fontFamily,"sans-serif"),this.fontStyle=Hi(n.fontStyle,"normal"),this.fontWeight=Hi(n.fontWeight,"bold"),this.fontSize=Hi(n.fontSize,48),this.sdf=Hi(n.sdf,"Chrome"===Gp),this.xOffset=Hi(n.xOffset,0),this.yOffset=Hi(n.yOffset,0),this.zOffset=Hi(n.zOffset,.5),this.attachment=Hi(n.attachment,"bottom-left"),this.showBorder=Hi(n.showBorder,!1),this.borderColor=Hi(n.borderColor,"lightgrey"),this.borderWidth=Hi(n.borderWidth,.15),this.showBackground=Hi(n.showBackground,!1),this.backgroundColor=Hi(n.backgroundColor,"lightgrey"),this.backgroundMargin=Hi(n.backgroundMargin,.5),this.backgroundOpacity=Hi(n.backgroundOpacity,1),this.text=r.text,this.positionCount=o,this.addUniforms({fontTexture:{value:null},xOffset:{value:this.xOffset},yOffset:{value:this.yOffset},zOffset:{value:this.zOffset},ortho:{value:!1},showBorder:{value:this.showBorder},borderColor:{value:new ct(this.borderColor)},borderWidth:{value:this.borderWidth},backgroundColor:{value:new ct(this.backgroundColor)},backgroundOpacity:{value:this.backgroundOpacity}}),this.addAttributes({inputTexCoord:{type:"v2",value:null},inputSize:{type:"f",value:null}}),this.setAttributes(e),this.makeTexture(),this.makeMapping()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={parameters:{},type:{},vertexShader:{},fragmentShader:{}};return i.parameters.get=function(){return Object.assign.call(this,{fontFamily:{uniform:!0},fontStyle:{uniform:!0},fontWeight:{uniform:!0},fontSize:{uniform:!0},sdf:{updateShader:!0,uniform:!0},xOffset:{uniform:!0},yOffset:{uniform:!0},zOffset:{uniform:!0},showBorder:{uniform:!0},borderColor:{uniform:!0},borderWidth:{uniform:!0},backgroundColor:{uniform:!0},backgroundOpacity:{uniform:!0}},t.prototype.parameters)},e.prototype.makeMaterial=function(){t.prototype.makeMaterial.call(this);var e=this.texture,i=this.material;i.extensions.derivatives=!0,i.lights=!1,i.uniforms.fontTexture.value=e,i.needsUpdate=!0;var r=this.wireframeMaterial;r.extensions.derivatives=!0,r.lights=!1,r.uniforms.fontTexture.value=e,r.needsUpdate=!0;var n=this.pickingMaterial;n.extensions.derivatives=!0,n.lights=!1,n.uniforms.fontTexture.value=e,n.needsUpdate=!0},e.prototype.setAttributes=function(t){var e,i,r,n,o,a,s=this,c=this.text,u=this.geometry.attributes;t.position&&(e=t.position,n=u.position.array,u.position.needsUpdate=!0),t.size&&(i=t.size,o=u.inputSize.array,u.inputSize.needsUpdate=!0),t.color&&(r=t.color,a=u.color.array,u.color.needsUpdate=!0);for(var l,h,d,f,p,m=this.positionCount,g=0,v=0;v<m;++v)for(h=3*v,d=c[v],p=d.length,s.showBackground&&(p+=1),f=0;f<p;++f,++g)for(var y=0;y<4;y++)l=4*g*3+3*y,e&&(n[l]=e[h],n[l+1]=e[h+1],n[l+2]=e[h+2]),i&&(o[4*g+y]=i[v]),r&&(a[l]=r[h],a[l+1]=r[h+1],a[l+2]=r[h+2])},e.prototype.makeTexture=function(){this.textAtlas=Ia({font:[this.fontFamily],style:this.fontStyle,weight:this.fontWeight,size:this.fontSize,outline:this.sdf?5:0}),this.texture=this.textAtlas.texture},e.prototype.makeMapping=function(){for(var t,e,i,r,n,o,a,s,c=this,u=this.textAtlas,l=this.text,h=this.attachment,d=u.lineHeight*this.backgroundMargin*.1-10,f=this.geometry.attributes.inputTexCoord.array,p=this.geometry.attributes.mapping.array,m=this.positionCount,g=0,v=0;v<m;++v){for(i=l[v],r=0,o=i.length,n=0;n<o;++n)t=u.mapped[i[n]],r+=t.w-2*u.outline;for(s=h.startsWith("top")?u.lineHeight/1.25:h.startsWith("middle")?u.lineHeight/2.5:0,a=h.endsWith("right")?r:h.endsWith("center")?r/2:0,a+=u.outline,s+=u.outline,c.showBackground&&(e=2*g*4,p[e+0]=-u.lineHeight/6-a-d,p[e+1]=u.lineHeight-s+d,p[e+2]=-u.lineHeight/6-a-d,p[e+3]=0-s-d,p[e+4]=r+u.lineHeight/6-a+2*u.outline+d,p[e+5]=u.lineHeight-s+d,p[e+6]=r+u.lineHeight/6-a+2*u.outline+d,p[e+7]=0-s-d,f[e+0]=10,f[e+2]=10,f[e+4]=10,f[e+6]=10,g+=1),r=0,n=0;n<o;++n,++g){t=u.mapped[i[n]],e=2*g*4,p[e+0]=r-a,p[e+1]=t.h-s,p[e+2]=r-a,p[e+3]=0-s,p[e+4]=r+t.w-a,p[e+5]=t.h-s,p[e+6]=r+t.w-a,p[e+7]=0-s;var y=u.width,b=u.height,x=[t.x/y,t.y/b,t.x/y,(t.y+t.h)/b,(t.x+t.w)/y,t.y/b,(t.x+t.w)/y,(t.y+t.h)/b];f.set(x,e),r+=t.w-2*u.outline}}this.geometry.attributes.inputTexCoord.needsUpdate=!0,this.geometry.attributes.mapping.needsUpdate=!0},e.prototype.getDefines=function(e){var i=t.prototype.getDefines.call(this,e);return this.sdf&&(i.SDF=1),i},e.prototype.setUniforms=function(e){!e||void 0===e.fontFamily&&void 0===e.fontStyle&&void 0===e.fontWeight&&void 0===e.fontSize&&void 0===e.sdf||(this.makeTexture(),this.makeMapping(),this.texture.needsUpdate=!0,e.fontTexture=this.texture),t.prototype.setUniforms.call(this,e)},i.type.get=function(){return"text"},i.vertexShader.get=function(){return"SDFFont.vert"},i.fragmentShader.get=function(){return"SDFFont.frag"},Object.defineProperties(e.prototype,i),e}(Pv);La.prototype=Object.assign(Object.create(la.prototype),{constructor:La,type:"distance",defaultSize:.15,parameters:Object.assign({labelSize:{type:"number",precision:3,max:10,min:.001},labelColor:{type:"color"},labelVisible:{type:"boolean"},labelZOffset:{type:"number",precision:1,max:20,min:-20,buffer:"zOffset"},atomPair:{type:"hidden",rebuild:!0},radialSegments:!0,disableImpostor:!0},la.prototype.parameters,{flatShaded:null,assembly:null}),init:function(t){var e=t||{};e.radius=Hi(e.radius,this.defaultSize),
	this.fontFamily=Hi(e.fontFamily,"sans-serif"),this.fontStyle=Hi(e.fontStyle,"normal"),this.fontWeight=Hi(e.fontWeight,"bold"),this.sdf=Hi(e.sdf,"Firefox"!==Gp),this.labelSize=Hi(e.labelSize,2),this.labelColor=Hi(e.labelColor,16777215),this.labelVisible=Hi(e.labelVisible,!0),this.labelZOffset=Hi(e.labelZOffset,.5),this.atomPair=Hi(e.atomPair,[]),la.prototype.init.call(this,e)},getDistanceData:function(t,e){var i=e.length,r=new Array(i),n=new Float32Array(3*i),o=new Tr,a=new Tr,s=new Kn,c=t.getAtomProxy(),u=t.getAtomProxy(),l=0;e.forEach(function(e,i){var h=e[0],d=e[1];if(Number.isInteger(h)&&Number.isInteger(d))c.index=h,u.index=d;else{o.setString(h),a.setString(d);var f=t.getAtomIndices(o),p=t.getAtomIndices(a);if(!f.length||!p.length)return void(l+=1);c.index=f[0],u.index=p[0]}s.addBond(c,u,1),i-=l,r[i]=c.distanceTo(u).toFixed(2);var m=3*i;n[m+0]=(c.x+u.x)/2,n[m+1]=(c.y+u.y)/2,n[m+2]=(c.z+u.z)/2},this),l>0&&(i-=l,n=n.subarray(0,3*i));var h=new cg(s.count);return h.set_all(!0),{text:r,position:n,bondSet:h,bondStore:s}},getBondData:function(t,e,i){return t.getBondData(this.getBondParams(e,i))},create:function(){if(0!==this.structureView.atomCount){var t=this.atomPair.length;if(0!==t){var e=this.getDistanceData(this.structureView,this.atomPair),i=new ct(this.labelColor);this.textBuffer=new ub({position:e.position,size:Xr(t,this.labelSize),color:qr(t,i.r,i.g,i.b),text:e.text},this.getBufferParams({fontFamily:this.fontFamily,fontStyle:this.fontStyle,fontWeight:this.fontWeight,sdf:this.sdf,zOffset:this.labelZOffset,opacity:1,visible:this.labelVisible}));var r={bondSet:e.bondSet,bondStore:e.bondStore},n=this.getBondData(this.structureView,void 0,r);this.cylinderBuffer=new Jo(n,this.getBufferParams({openEnded:!1,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0})),this.dataList.push({sview:this.structureView,bondSet:e.bondSet,bondStore:e.bondStore,position:e.position,bufferList:[this.textBuffer,this.cylinderBuffer]})}}},update:function(t){t.position?this.build():la.prototype.update.call(this,t)},updateData:function(t,e){var i={bondSet:e.bondSet,bondStore:e.bondStore},r=this.getBondData(e.sview,t,i),n={},o={},a=this.atomPair.length;if(t.labelSize&&(o.size=Xr(a,this.labelSize)),t.labelColor){var s=new ct(this.labelColor);o.color=qr(a,s.r,s.g,s.b)}t.color&&(n.color=r.color1,n.color2=r.color2),(t.radius||t.scale)&&(n.radius=r.radius),this.textBuffer.setAttributes(o),this.cylinderBuffer.setAttributes(n)},setVisibility:function(t,e){return la.prototype.setVisibility.call(this,t,!0),this.textBuffer&&this.textBuffer.setVisibility(this.labelVisible&&this.visible),e||this.viewer.requestRender(),this},setParameters:function(t){var e=!1,i={};return t&&t.labelSize&&(i.labelSize=!0),t&&t.labelColor&&(i.labelColor=!0),la.prototype.setParameters.call(this,t,i,e),t&&void 0!==t.labelVisible&&this.setVisibility(this.visible),this}}),Jp.add("distance",La);var lb=function(t){function e(e,i){var r=i||{},n=e.position.length/3,o=2*n,a=new ct(Hi(r.color,"grey")),s=new Float32Array(3*o),c=qr(o,a.r,a.g,a.b);t.call(this,{position:s,color:c},r),this.scale=Hi(r.scale,1),this.setAttributes(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={line:{},vertexShader:{},fragmentShader:{}};return e.prototype.setAttributes=function(t){var e,i,r,n=this.geometry.attributes;t.position&&t.vector&&(e=t.position,i=t.vector,r=n.position.array,n.position.needsUpdate=!0);var o,a,s=this.size/2,c=this.scale;if(t.position&&t.vector)for(var u=0;u<s;u++)o=2*u*3,a=3*u,r[o+0]=e[a+0],r[o+1]=e[a+1],r[o+2]=e[a+2],r[o+3]=e[a+0]+i[a+0]*c,r[o+4]=e[a+1]+i[a+1]*c,r[o+5]=e[a+2]+i[a+2]*c},i.line.get=function(){return!0},i.vertexShader.get=function(){return"Line.vert"},i.fragmentShader.get=function(){return"Line.frag"},Object.defineProperties(e.prototype,i),e}(mv);Ra.prototype=Object.assign(Object.create(la.prototype),{constructor:Ra,type:"helixorient",parameters:Object.assign({sphereDetail:!0,disableImpostor:!0},la.prototype.parameters),init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"sstruc"),e.radius=Hi(e.radius,.15),e.scale=Hi(e.scale,1),la.prototype.init.call(this,e)},createData:function(t){var e=[],i=[];return this.structure.eachPolymer(function(t){if(!(t.residueCount<4)){i.push(t);var r=new io(t),n=r.getPosition(),o=r.getColor(this.getColorParams()),a=r.getSize(this.radius,this.scale);e.push(new Ko({position:n.center,color:o.color,radius:a.size,pickingColor:o.pickingColor},this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0})),new lb({position:n.center,vector:n.axis},this.getBufferParams({color:"skyblue",scale:1})),new lb({position:n.center,vector:n.resdir},this.getBufferParams({color:"lightgreen",scale:1})))}}.bind(this),t.getSelection()),{bufferList:e,polymerList:i}},updateData:function(e,i){t.Debug&&qp.time(this.type+" repr update"),e=e||{};for(var r=0,n=i.polymerList.length;r<n;++r){var o=3*r,a={},s=i.polymerList[r],c=new io(s);if(e.position){var u=c.getPosition();a.position=u.center,i.bufferList[o+1].setAttributes({position:u.center,vector:u.axis}),i.bufferList[o+2].setAttributes({position:u.center,vector:u.resdir})}i.bufferList[o].setAttributes(a)}t.Debug&&qp.timeEnd(this.type+" repr update")}}),Jp.add("helixorient",Ra),Oa.prototype=Object.assign(Object.create(xa.prototype),{constructor:Oa,type:"licorice",parameters:Object.assign({},xa.prototype.parameters,{aspectRatio:null}),init:function(t){var e=t||{};e.aspectRatio=1,xa.prototype.init.call(this,e)}}),Jp.add("licorice",Oa),em.add("shader/HyperballStickImpostor.vert","\nattribute vec3 mapping;\nattribute float radius;\nattribute float radius2;\nattribute vec3 position1;\nattribute vec3 position2;\nvarying mat4 matrix_near;\nvarying vec4 prime1;\nvarying vec4 prime2;\nvarying float vRadius;\nvarying float vRadius2;\n#ifdef PICKING\nattribute vec3 pickingColor;\nattribute vec3 pickingColor2;\nvarying vec3 vPickingColor;\nvarying vec3 vPickingColor2;\n#else\nattribute vec3 color2;\nvarying vec3 vColor1;\nvarying vec3 vColor2;\n#endif\nuniform float shrink;\nuniform mat4 modelViewProjectionMatrix;\nuniform mat4 modelViewProjectionMatrixInverse;\nvoid main(){\nvRadius = radius;\nvRadius2 = radius2;\nvec4 spaceposition;\nvec3 position_atom1;\nvec3 position_atom2;\nvec4 vertex_position;\n#ifdef PICKING\nvPickingColor = pickingColor;\nvPickingColor2 = pickingColor2;\n#else\nvColor1 = color;\nvColor2 = color2;\n#endif\nfloat radius1 = radius;\nposition_atom1 = position1;\nposition_atom2 = position2;\nfloat distance = distance( position_atom1, position_atom2 );\nspaceposition.z = mapping.z * distance;\nif (radius1 > radius2) {\nspaceposition.y = mapping.y * 1.5 * radius1;\nspaceposition.x = mapping.x * 1.5 * radius1;\n} else {\nspaceposition.y = mapping.y * 1.5 * radius2;\nspaceposition.x = mapping.x * 1.5 * radius2;\n}\nspaceposition.w = 1.0;\nvec4 e3 = vec4( 1.0 );\nvec3 e1, e1_temp, e2, e2_temp;\ne3.xyz = normalize(position_atom1-position_atom2);\nif (e3.z == 0.0) { e3.z = 0.0000000000001;}\nif ( (position_atom1.x - position_atom2.x) == 0.0) { position_atom1.x += 0.001;}\nif ( (position_atom1.y - position_atom2.y) == 0.0) { position_atom1.y += 0.001;}\nif ( (position_atom1.z - position_atom2.z) == 0.0) { position_atom1.z += 0.001;}\nvec4 focus = vec4( 1.0 );\nfocus.x = ( position_atom1.x*position_atom1.x - position_atom2.x*position_atom2.x +\n( radius2*radius2 - radius1*radius1 )*e3.x*e3.x/shrink )/(2.0*(position_atom1.x - position_atom2.x));\nfocus.y = ( position_atom1.y*position_atom1.y - position_atom2.y*position_atom2.y +\n( radius2*radius2 - radius1*radius1 )*e3.y*e3.y/shrink )/(2.0*(position_atom1.y - position_atom2.y));\nfocus.z = ( position_atom1.z*position_atom1.z - position_atom2.z*position_atom2.z +\n( radius2*radius2 - radius1*radius1 )*e3.z*e3.z/shrink )/(2.0*(position_atom1.z - position_atom2.z));\ne1.x = 1.0;\ne1.y = 1.0;\ne1.z = ( (e3.x*focus.x + e3.y*focus.y + e3.z*focus.z) - e1.x*e3.x - e1.y*e3.y)/e3.z;\ne1_temp = e1 - focus.xyz;\ne1 = normalize(e1_temp);\ne2_temp = e1.yzx * e3.zxy - e1.zxy * e3.yzx;\ne2 = normalize(e2_temp);\nmat3 R= mat3( e1.xyz, e2.xyz, e3.xyz );\nvertex_position.xyz = R * spaceposition.xyz;\nvertex_position.w = 1.0;\nvertex_position.x += (position_atom1.x+position_atom2.x) / 2.0;\nvertex_position.y += (position_atom1.y+position_atom2.y) / 2.0;\nvertex_position.z += (position_atom1.z+position_atom2.z) / 2.0;\ngl_Position = modelViewProjectionMatrix * vertex_position;\nvec4 i_near, i_far;\nvec4 near = gl_Position;\nnear.z = 0.0 ;\nnear = modelViewProjectionMatrixInverse * near;\ni_near = near;\nvec4 far = gl_Position;\nfar.z = far.w ;\ni_far = modelViewProjectionMatrixInverse * far;\nprime1 = vec4( position_atom1 - (position_atom1 - focus.xyz)*shrink, 1.0 );\nprime2 = vec4( position_atom2 - (position_atom2 - focus.xyz)*shrink, 1.0 );\nfloat Rsquare = (radius1*radius1/shrink) - (\n(position_atom1.x - focus.x)*(position_atom1.x - focus.x) +\n(position_atom1.y - focus.y)*(position_atom1.y - focus.y) +\n(position_atom1.z - focus.z)*(position_atom1.z - focus.z)\n);\nfocus.w = Rsquare;\nmatrix_near = mat4( i_near, i_far, focus, e3 );\ngl_Position.z = 1.0;\n}"),em.add("shader/HyperballStickImpostor.frag","#define STANDARD\n#define IMPOSTOR\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float nearClip;\nuniform float shrink;\nuniform mat4 modelViewMatrix;\nuniform mat4 modelViewProjectionMatrix;\nuniform mat4 modelViewMatrixInverseTranspose;\nuniform mat4 projectionMatrix;\nvarying mat4 matrix_near;\nvarying vec4 prime1;\nvarying vec4 prime2;\nvarying float vRadius;\nvarying float vRadius2;\n#ifdef PICKING\nuniform float objectId;\nvarying vec3 vPickingColor;\nvarying vec3 vPickingColor2;\n#else\nvarying vec3 vColor1;\nvarying vec3 vColor2;\n#include common\n#include fog_pars_fragment\n#include bsdfs\n#include lights_pars\n#include lights_physical_pars_fragment\n#endif\nbool interior = false;\nfloat calcClip( vec4 cameraPos ){\nreturn dot( cameraPos, vec4( 0.0, 0.0, 1.0, nearClip - 0.5 ) );\n}\nfloat calcClip( vec3 cameraPos ){\nreturn calcClip( vec4( cameraPos, 1.0 ) );\n}\nfloat calcDepth( in vec3 cameraPos ){\nvec2 clipZW = cameraPos.z * projectionMatrix[2].zw + projectionMatrix[3].zw;\nreturn 0.5 + 0.5 * clipZW.x / clipZW.y;\n}\nstruct Ray {\nvec3 origin ;\nvec3 direction ;\n};\nbool cutoff_plane (vec3 M, vec3 cutoff, vec3 x3){\nfloat a = x3.x;\nfloat b = x3.y;\nfloat c = x3.z;\nfloat d = -x3.x*cutoff.x-x3.y*cutoff.y-x3.z*cutoff.z;\nfloat l = a*M.x+b*M.y+c*M.z+d;\nif (l<0.0) {return true;}\nelse{return false;}\n}\nvec3 isect_surf(Ray r, mat4 matrix_coef){\nvec4 direction = vec4(r.direction, 0.0);\nvec4 origin = vec4(r.origin, 1.0);\nfloat a = dot(direction,(matrix_coef*direction));\nfloat b = dot(origin,(matrix_coef*direction));\nfloat c = dot(origin,(matrix_coef*origin));\nfloat delta =b*b-a*c;\ngl_FragColor.a = 1.0;\nif (delta<0.0){\ndiscard;\n}\nfloat t1 =(-b-sqrt(delta))/a;\nreturn r.origin+t1*r.direction;\n}\nvec3 isect_surf2(Ray r, mat4 matrix_coef){\nvec4 direction = vec4(r.direction, 0.0);\nvec4 origin = vec4(r.origin, 1.0);\nfloat a = dot(direction,(matrix_coef*direction));\nfloat b = dot(origin,(matrix_coef*direction));\nfloat c = dot(origin,(matrix_coef*origin));\nfloat delta =b*b-a*c;\ngl_FragColor.a = 1.0;\nif (delta<0.0){\ndiscard;\n}\nfloat t2 =(-b+sqrt(delta))/a;\nreturn r.origin+t2*r.direction;\n}\nRay primary_ray(vec4 near1, vec4 far1){\nvec3 near=near1.xyz/near1.w;\nvec3 far=far1.xyz/far1.w;\nreturn Ray(near,far-near);\n}\nfloat update_z_buffer(vec3 M, mat4 ModelViewP){\nfloat depth1;\nvec4 Ms=(ModelViewP*vec4(M,1.0));\nreturn depth1=(1.0+Ms.z/Ms.w)/2.0;\n}\nvoid main(){\nfloat radius = max( vRadius, vRadius2 );\nvec4 i_near, i_far, focus;\nvec3 e3, e1, e1_temp, e2;\ni_near = vec4(matrix_near[0][0],matrix_near[0][1],matrix_near[0][2],matrix_near[0][3]);\ni_far = vec4(matrix_near[1][0],matrix_near[1][1],matrix_near[1][2],matrix_near[1][3]);\nfocus = vec4(matrix_near[2][0],matrix_near[2][1],matrix_near[2][2],matrix_near[2][3]);\ne3 = vec3(matrix_near[3][0],matrix_near[3][1],matrix_near[3][2]);\ne1.x = 1.0;\ne1.y = 1.0;\ne1.z = ( (e3.x*focus.x + e3.y*focus.y + e3.z*focus.z) - e1.x*e3.x - e1.y*e3.y)/e3.z;\ne1_temp = e1 - focus.xyz;\ne1 = normalize(e1_temp);\ne2 = normalize(cross(e1,e3));\nvec4 equation = focus;\nfloat shrinkfactor = shrink;\nfloat t1 = -1.0/(1.0-shrinkfactor);\nfloat t2 = 1.0/(shrinkfactor);\nvec4 colonne1, colonne2, colonne3, colonne4;\nmat4 mat;\nvec3 equation1 = vec3(t2,t2,t1);\nfloat A1 = - e1.x*equation.x - e1.y*equation.y - e1.z*equation.z;\nfloat A2 = - e2.x*equation.x - e2.y*equation.y - e2.z*equation.z;\nfloat A3 = - e3.x*equation.x - e3.y*equation.y - e3.z*equation.z;\nfloat A11 = equation1.x*e1.x*e1.x + equation1.y*e2.x*e2.x + equation1.z*e3.x*e3.x;\nfloat A21 = equation1.x*e1.x*e1.y + equation1.y*e2.x*e2.y + equation1.z*e3.x*e3.y;\nfloat A31 = equation1.x*e1.x*e1.z + equation1.y*e2.x*e2.z + equation1.z*e3.x*e3.z;\nfloat A41 = equation1.x*e1.x*A1 + equation1.y*e2.x*A2 + equation1.z*e3.x*A3;\nfloat A22 = equation1.x*e1.y*e1.y + equation1.y*e2.y*e2.y + equation1.z*e3.y*e3.y;\nfloat A32 = equation1.x*e1.y*e1.z + equation1.y*e2.y*e2.z + equation1.z*e3.y*e3.z;\nfloat A42 = equation1.x*e1.y*A1 + equation1.y*e2.y*A2 + equation1.z*e3.y*A3;\nfloat A33 = equation1.x*e1.z*e1.z + equation1.y*e2.z*e2.z + equation1.z*e3.z*e3.z;\nfloat A43 = equation1.x*e1.z*A1 + equation1.y*e2.z*A2 + equation1.z*e3.z*A3;\nfloat A44 = equation1.x*A1*A1 + equation1.y*A2*A2 + equation1.z*A3*A3 - equation.w;\ncolonne1 = vec4(A11,A21,A31,A41);\ncolonne2 = vec4(A21,A22,A32,A42);\ncolonne3 = vec4(A31,A32,A33,A43);\ncolonne4 = vec4(A41,A42,A43,A44);\nmat = mat4(colonne1,colonne2,colonne3,colonne4);\nRay ray = primary_ray(i_near,i_far) ;\nvec3 M;\nM = isect_surf(ray, mat);\nif (cutoff_plane(M, prime1.xyz, -e3) || cutoff_plane(M, prime2.xyz, e3)){ discard; }\nvec4 M1 = vec4(M,1.0);\nvec4 M2 = mat*M1;\nvec3 _normal = ( modelViewMatrixInverseTranspose * M2 ).xyz;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix) ;\n#ifdef NEAR_CLIP\nif( calcClip( modelViewMatrix * vec4( M, 1.0 ) ) > 0.0 ){\nM = isect_surf2(ray, mat);\nif( calcClip( modelViewMatrix * vec4( M, 1.0 ) ) > 0.0 )\ndiscard;\ninterior = true;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix) ;\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = max( 0.0, calcDepth( vec3( - ( nearClip - 0.5 ) ) ) + ( 0.0000001 / radius ) );\n}\n}else if( gl_FragDepthEXT <= 0.0 ){\nM = isect_surf2(ray, mat);\ninterior = true;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix);\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / radius );\n}\n}\n#else\nif( gl_FragDepthEXT <= 0.0 ){\nM = isect_surf2(ray, mat);\ninterior = true;\ngl_FragDepthEXT = update_z_buffer(M, modelViewProjectionMatrix) ;\nif( gl_FragDepthEXT >= 0.0 ){\ngl_FragDepthEXT = 0.0 + ( 0.0000001 / radius );\n}\n}\n#endif\nif (cutoff_plane(M, prime1.xyz, -e3) || cutoff_plane(M, prime2.xyz, e3)){ discard; }\nif (gl_FragDepthEXT < 0.0)\ndiscard;\nif (gl_FragDepthEXT > 1.0)\ndiscard;\nfloat distance_ratio = ((M.x-prime2.x)*e3.x + (M.y-prime2.y)*e3.y +(M.z-prime2.z)*e3.z) /\ndistance(prime2.xyz,prime1.xyz);\n#ifdef PICKING\nif( distance_ratio > 0.5 ){\ngl_FragColor = vec4( vPickingColor, objectId );\n}else{\ngl_FragColor = vec4( vPickingColor2, objectId );\n}\n#else\nvec3 vViewPosition = -( modelViewMatrix * vec4( M, 1.0 ) ).xyz;\nvec3 vNormal = _normal;\nvec3 vColor;\nif( distance_ratio>0.5 ){\nvColor = vColor1;\n}else{\nvColor = vColor2;\n}\nvec4 diffuseColor = vec4( diffuse, opacity );\nReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\nvec3 totalEmissiveLight = emissive;\n#include color_fragment\n#include roughnessmap_fragment\n#include metalnessmap_fragment\nvec3 normal = normalize( vNormal );\nif( interior ){\nnormal = vec3( 0.0, 0.0, 0.4 );\n}\n#include lights_physical_fragment\n#include lights_template\nvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveLight;\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\n#include premultiplied_alpha_fragment\n#include tonemapping_fragment\n#include encodings_fragment\n#include fog_fragment\n#endif\n}");var hb=new Float32Array([-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,1,1,1,-1,1,1]),db=new Uint16Array([0,1,2,0,2,3,1,5,6,1,6,2,4,6,5,4,7,6,0,7,4,0,3,7,0,5,1,0,4,5,3,2,6,3,6,7]),fb=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={mapping:{},mappingIndices:{},mappingIndicesSize:{},mappingType:{},mappingSize:{},mappingItemSize:{}};return i.mapping.get=function(){return hb},i.mappingIndices.get=function(){return db},i.mappingIndicesSize.get=function(){return 36},i.mappingType.get=function(){return"v3"},i.mappingSize.get=function(){return 8},i.mappingItemSize.get=function(){return 3},Object.defineProperties(e.prototype,i),e}(Sv),pb=new p,mb=function(t){function e(e,i){t.call(this,e,i);var r=e||{},n=i||{},o=Hi(n.shrink,.14),a=new Di(new p).onUpdate(Da),s=new Di(new p).onUpdate(Da),c=new Di(new p).onUpdate(Da);this.addUniforms({modelViewProjectionMatrix:a,modelViewProjectionMatrixInverse:s,modelViewMatrixInverseTranspose:c,shrink:{value:o}}),this.addAttributes({position1:{type:"v3",value:null},position2:{type:"v3",value:null},color2:{type:"c",value:null},radius:{type:"f",value:null},radius2:{type:"f",value:null}}),r.pickingColor2&&this.addAttributes({pickingColor2:{type:"c",value:null}}),this.setAttributes(r),this.makeMapping()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={parameters:{},impostor:{},vertexShader:{},fragmentShader:{}};return i.parameters.get=function(){return Object.assign.call(this,{shrink:{uniform:!0}},t.prototype.parameters)},i.impostor.get=function(){return!0},i.vertexShader.get=function(){return"HyperballStickImpostor.vert"},i.fragmentShader.get=function(){return"HyperballStickImpostor.frag"},Object.defineProperties(e.prototype,i),e}(fb);ka.prototype=Object.assign(Object.create(Oa.prototype),{constructor:ka,type:"hyperball",defaultSize:1,parameters:Object.assign({shrink:{type:"number",precision:3,max:1,min:.001,buffer:!0}},Oa.prototype.parameters,{multipleBond:null,bondSpacing:null}),init:function(t){var e=t||{};e.scale=Hi(e.scale,.2),e.radius=Hi(e.radius,"vdw"),this.shrink=Hi(e.shrink,.12),Oa.prototype.init.call(this,e)},getBondParams:function(t,e){return t&&!t.radius||(e=Object.assign({radius2:!0},e)),Oa.prototype.getBondParams.call(this,t,e)},createData:function(t){var e=new Ko(t.getAtomData(this.getAtomParams()),this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0}));this.__center=new Float32Array(3*t.bondCount);var i=new Na(t.getBondData(this.getBondParams()),this.getBufferParams({shrink:this.shrink,radialSegments:this.radialSegments,dullInterior:!0}),this.disableImpostor);return{bufferList:[e,i]}},updateData:function(t,e){var i=e.sview.getAtomData(this.getAtomParams()),r=e.sview.getBondData(this.getBondParams()),n={},o={};if(!t||t.position){n.position=i.position;var a=r.position1,s=r.position2;o.position=Wr(a,s,this.__center),o.position1=a,o.position2=s}t&&!t.color||(n.color=i.color,o.color=r.color1,o.color2=r.color2),t&&!t.radius||(n.radius=i.radius,o.radius=r.radius1,o.radius2=r.radius2),e.bufferList[0].setAttributes(n),e.bufferList[1].setAttributes(o)}}),Jp.add("hyperball",ka),Fa.prototype={constructor:Fa,atomLabel:function(t){var e,i=this.type;switch(i){case"atomname":e=t.atomname;break;case"atomindex":e=""+t.index;break;case"occupancy":e=t.occupancy.toFixed(2);break;case"bfactor":e=t.bfactor.toFixed(2);break;case"serial":e=""+t.serial;break;case"element":e=t.element;break;case"atom":e=t.atomname+"|"+t.index;break;case"resname":e=t.resname;break;case"resno":e=""+t.resno;break;case"res":var r=t.resname.toUpperCase();e=(jg[r]||r)+t.resno;break;case"text":e=this.text[t.index];break;default:e=t.qualifiedName()}return void 0===e?"":e}},Fa.types={"":"",atomname:"atom name",atomindex:"atom index",occupancy:"occupancy",bfactor:"b-factor",serial:"serial",element:"element",atom:"atom name + index",resname:"residue name",resno:"residue no",res:"residue name + no",text:"text",qualified:"qualified name"},Ba.prototype=Object.assign(Object.create(la.prototype),{constructor:Ba,type:"label",parameters:Object.assign({labelType:{type:"select",options:Fa.types,rebuild:!0},labelText:{type:"hidden",rebuild:!0},fontFamily:{type:"select",options:{"sans-serif":"sans-serif",monospace:"monospace",serif:"serif"},buffer:!0},fontStyle:{type:"select",options:{normal:"normal",italic:"italic"},buffer:!0},fontWeight:{type:"select",options:{normal:"normal",bold:"bold"},buffer:!0},sdf:{type:"boolean",buffer:!0},xOffset:{type:"number",precision:1,max:20,min:-20,buffer:!0},yOffset:{type:"number",precision:1,max:20,min:-20,buffer:!0},zOffset:{type:"number",precision:1,max:20,min:-20,buffer:!0},attachment:{type:"select",options:{"bottom-left":"bottom-left","bottom-center":"bottom-center","bottom-right":"bottom-right","middle-left":"middle-left","middle-center":"middle-center","middle-right":"middle-right","top-left":"top-left","top-center":"top-center","top-right":"top-right"},rebuild:!0},showBorder:{type:"boolean",buffer:!0},borderColor:{type:"color",buffer:!0},borderWidth:{type:"number",precision:2,max:.3,min:0,buffer:!0},showBackground:{type:"boolean",rebuild:!0},backgroundColor:{type:"color",buffer:!0},backgroundMargin:{type:"number",precision:2,max:2,min:0,rebuild:!0},backgroundOpacity:{type:"range",step:.01,max:1,min:0,buffer:!0}},la.prototype.parameters,{side:null,flatShaded:null,wireframe:null,linewidth:null,roughness:null,metalness:null,diffuse:null}),init:function(t){var e=t||{};this.labelType=Hi(e.labelType,"res"),this.labelText=Hi(e.labelText,{}),this.fontFamily=Hi(e.fontFamily,"sans-serif"),this.fontStyle=Hi(e.fontStyle,"normal"),this.fontWeight=Hi(e.fontWeight,"bold"),this.sdf=Hi(e.sdf,"Chrome"===Gp),this.xOffset=Hi(e.xOffset,0),this.yOffset=Hi(e.yOffset,0),this.zOffset=Hi(e.zOffset,.5),this.attachment=Hi(e.attachment,"bottom-left"),this.showBorder=Hi(e.showBorder,!1),this.borderColor=Hi(e.borderColor,"lightgrey"),this.borderWidth=Hi(e.borderWidth,.15),this.showBackground=Hi(e.showBackground,!1),this.backgroundColor=Hi(e.backgroundColor,"lightgrey"),this.backgroundMargin=Hi(e.backgroundMargin,.5),this.backgroundOpacity=Hi(e.backgroundOpacity,1),la.prototype.init.call(this,e)},createData:function(t){var e={position:!0,color:!0,radius:!0},i=t.getAtomData(this.getAtomParams(e)),r=[],n=new Fa(this.labelType,this.labelText);t.eachAtom(function(t){r.push(n.atomLabel(t))});var o=new ub({position:i.position,size:i.radius,color:i.color,text:r},this.getBufferParams({fontFamily:this.fontFamily,fontStyle:this.fontStyle,fontWeight:this.fontWeight,sdf:this.sdf,xOffset:this.xOffset,yOffset:this.yOffset,zOffset:this.zOffset,attachment:this.attachment,showBorder:this.showBorder,borderColor:this.borderColor,borderWidth:this.borderWidth,showBackground:this.showBackground,backgroundColor:this.backgroundColor,backgroundMargin:this.backgroundMargin,backgroundOpacity:this.backgroundOpacity}));return{bufferList:[o]}},updateData:function(t,e){var i=e.sview.getAtomData(this.getAtomParams(t)),r={};t&&!t.position||(r.position=i.position),t&&!t.radius||(r.size=i.radius),t&&!t.color||(r.color=i.color),e.bufferList[0].setAttributes(r)}}),Jp.add("label",Ba),za.prototype=Object.assign(Object.create(la.prototype),{constructor:za,type:"line",parameters:Object.assign({multipleBond:{type:"select",rebuild:!0,options:{off:"off",symmetric:"symmetric",offset:"offset"}},bondSpacing:{type:"number",precision:2,max:2,min:.5}},ia.prototype.parameters,{flatShaded:null,side:null,wireframe:null,roughness:null,metalness:null,diffuse:null}),init:function(t){var e=t||{};this.multipleBond=Hi(e.multipleBond,"off"),this.bondSpacing=Hi(e.bondSpacing,1),la.prototype.init.call(this,e)},getBondParams:function(t,e){return e=Object.assign({multipleBond:this.multipleBond,bondSpacing:this.bondSpacing,radiusParams:{radius:.1,scale:1}},e),la.prototype.getBondParams.call(this,t,e)},createData:function(t){var e={position:!0,color:!0},i=t.getBondData(this.getBondParams(e)),r=new ty(i,this.getBufferParams());return{bufferList:[r]}},updateData:function(t,e){var i=e.sview.getBondData(this.getBondParams(t)),r={};t&&!t.position||(r.position1=i.position1,r.position2=i.position2),t&&!t.color||(r.color=i.color,r.color2=i.color2),e.bufferList[0].setAttributes(r)},setParameters:function(t){var e=!1,i={};return t&&t.bondSpacing&&(i.position=!0),la.prototype.setParameters.call(this,t,i,e),this}}),Jp.add("line",za),ja.__deps=[jo,Uo,$o,ln,Ua],Va.__deps=[jo,$o,Xr,ln,xn,mn,_n,$a,Hi],Zp.add("molsurf",function(t,e){var i=t.data.args,r=t.data.params;if(i&&r){var n="av"===r.type?Va:ja,o=new n(i.coordList,i.radiusList,i.indexList),a=o.getSurface(r.type,r.probeRadius,r.scaleFactor,r.cutoff,!0,r.smooth,r.contour),s=[a.position.buffer,a.index.buffer];a.normal&&s.push(a.normal.buffer),a.atomindex&&s.push(a.atomindex.buffer),e({sd:a,p:r},s)}},[ja,Va]),Ga.prototype={getAtomData:function(){return this.structure.getAtomData({what:{position:!0,radius:!0,index:!0},radiusParams:{radius:"vdw",scale:1}})},makeSurface:function(t,e){var i=new Lo("","",t);return i.info.type=e.type,i.info.probeRadius=e.probeRadius,i.info.scaleFactor=e.scaleFactor,i.info.smooth=e.smooth,i.info.cutoff=e.cutoff,i},getSurface:function(t){var e=t||{},i=this.getAtomData(),r=i.position,n=i.radius,o=i.index,a="av"===e.type?Va:ja,s=new a(r,n,o),c=s.getSurface(e.type,e.probeRadius,e.scaleFactor,e.cutoff,!0,e.smooth,e.contour);return this.makeSurface(c,e)},getSurfaceWorker:function(t,e){var i=Object.assign({},t);if(window.Worker){void 0===this.worker&&(this.worker=new Ro("molsurf"));var r=this.getAtomData(),n=r.position,o=r.radius,a=r.index,s={args:{coordList:n,radiusList:o,indexList:a},params:i},c=[n.buffer,o.buffer,a.buffer];this.worker.post(s,c,function(t){var r=t.data.sd;e(this.makeSurface(r,i))}.bind(this),function(t){console.warn("MolecularSurface.getSurfaceWorker error - trying without worker",t),this.worker.terminate(),this.worker=void 0;var r=this.getSurface(i);e(r)}.bind(this))}else{var u=this.getSurface(i);e(u)}},dispose:function(){this.worker&&this.worker.terminate()}};var gb=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={line:{},vertexShader:{},fragmentShader:{}};return e.prototype.setAttributes=function(t){var e=this.geometry.attributes;t.color&&(e.color.array.set(t.color),e.color.needsUpdate=!0),t.index&&(e.index.array.set(t.index),e.index.needsUpdate=!0)},i.line.get=function(){return!0},i.vertexShader.get=function(){return"Line.vert"},i.fragmentShader.get=function(){return"Line.frag"},Object.defineProperties(e.prototype,i),e}(mv);Ha.prototype=Object.assign(Object.create(la.prototype),{constructor:Ha,type:"surface",parameters:Object.assign({surfaceType:{type:"select",rebuild:!0,options:{vws:"vws",sas:"sas",ms:"ms",ses:"ses",av:"av"}},probeRadius:{type:"number",precision:1,max:20,min:0,rebuild:!0},smooth:{type:"integer",precision:1,max:10,min:0,rebuild:!0},scaleFactor:{type:"number",precision:1,max:5,min:0,rebuild:!0},cutoff:{type:"number",precision:2,max:50,min:0,rebuild:!0},contour:{type:"boolean",rebuild:!0},background:{type:"boolean",rebuild:!0},opaqueBack:{type:"boolean",buffer:!0},filterSele:{type:"text",rebuild:!0},colorVolume:{type:"hidden"},useWorker:{type:"boolean",rebuild:!0}},la.prototype.parameters,{radiusType:null,radius:null,scale:null}),init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"uniform"),e.colorValue=Hi(e.colorValue,14540253),this.surfaceType=Hi(e.surfaceType,"ms"),this.probeRadius=Hi(e.probeRadius,1.4),this.smooth=Hi(e.smooth,2),this.scaleFactor=Hi(e.scaleFactor,2),this.cutoff=Hi(e.cutoff,0),this.contour=Hi(e.contour,!1),this.background=Hi(e.background,!1),this.opaqueBack=Hi(e.opaqueBack,!0),this.filterSele=Hi(e.filterSele,""),this.colorVolume=Hi(e.colorVolume,void 0),this.useWorker=Hi(e.useWorker,!0),la.prototype.init.call(this,t)},prepareData:function(t,e,i){var r=this.__infoList[e];if(r||(r={},this.__infoList[e]=r),r.molsurf&&r.sele===t.selection.string)i(e);else{if(this.filterSele){var n=t.structure.getView(new Tr(this.filterSele)),o=n.boundingBox.size(),a=Math.max(o.x,o.y,o.z),s=t.getAtomSetWithinPoint(n.center,a/2+6);t=t.getView(new Tr(t.getAtomSetWithinSelection(s,3).toSeleString()))}r.sele=t.selection.string,r.molsurf=new Ga(t);var c=this.getSurfaceParams(),u=function(t){r.surface=t,i(e)};this.useWorker?r.molsurf.getSurfaceWorker(c,u):u(r.molsurf.getSurface(c))}},prepare:function(t){if((this.__forceNewMolsurf||this.__sele!==this.selection.string||this.__surfaceParams!==JSON.stringify(this.getSurfaceParams()))&&(this.__infoList.forEach(function(t){t.molsurf.dispose()}.bind(this)),this.__infoList.length=0),0===this.structureView.atomCount)return void t();var e=function(){this.__sele=this.selection.string,this.__surfaceParams=JSON.stringify(this.getSurfaceParams()),this.__forceNewMolsurf=!1,t()}.bind(this),i="default"===this.assembly?this.defaultAssembly:this.assembly,r=this.structure.biomolDict[i];r?r.partList.forEach(function(t,i){var n=t.getView(this.structureView);this.prepareData(n,i,function(t){t===r.partList.length-1&&e()}.bind(this))},this):this.prepareData(this.structureView,0,e)},createData:function(t,e){var i=this.__infoList[e],r=i.surface,n={position:r.getPosition(),color:r.getColor(this.getColorParams()),index:r.getFilteredIndex(this.filterSele,t)};if(r.contour){var o=new gb(n,this.getBufferParams({wireframe:!1}));return{bufferList:[o],info:i}}n.normal=r.getNormal(),n.pickingColor=r.getPickingColor(this.getColorParams());var a=new qv(n,this.getBufferParams({background:this.background,opaqueBack:this.opaqueBack,dullInterior:!1})),s=new Yv(a);return{bufferList:[s],info:i}},updateData:function(t,e){var i={};return t.position?(this.__forceNewMolsurf=!0,void this.build()):(t.color&&(i.color=e.info.surface.getColor(this.getColorParams())),t.index&&(i.index=e.info.surface.getFilteredIndex(this.filterSele,e.sview)),void e.bufferList[0].setAttributes(i))},setParameters:function(t,e,i){return e=e||{},t&&t.filterSele&&(e.index=!0),t&&void 0!==t.colorVolume&&(e.color=!0),t&&t.wireframe&&(t.contour||void 0===t.contour&&this.contour)&&(t.wireframe=!1),la.prototype.setParameters.call(this,t,e,i),this},getSurfaceParams:function(t){var e=Object.assign({type:this.surfaceType,probeRadius:this.probeRadius,scaleFactor:this.scaleFactor,smooth:this.smooth&&!this.contour,cutoff:this.cutoff,contour:this.contour,useWorker:this.useWorker},t);return e},getColorParams:function(){var t=la.prototype.getColorParams.call(this);return t.volume=this.colorVolume,t},clear:function(){la.prototype.clear.call(this)},dispose:function(){this.__infoList.forEach(function(t){t.molsurf.dispose()}.bind(this)),this.__infoList.length=0,la.prototype.dispose.call(this)}}),Jp.add("surface",Ha),Wa.prototype=Object.assign(Object.create(la.prototype),{constructor:Wa,type:"point",parameters:Object.assign({pointSize:{type:"number",precision:1,max:100,min:0,buffer:!0},sizeAttenuation:{type:"boolean",buffer:!0},sortParticles:{type:"boolean",rebuild:!0},useTexture:{type:"boolean",buffer:!0},alphaTest:{type:"range",step:.001,max:1,min:0,buffer:!0},forceTransparent:{type:"boolean",buffer:!0},edgeBleach:{type:"range",step:.001,max:1,min:0,buffer:!0}},ia.prototype.parameters,{flatShaded:null,wireframe:null,linewidth:null,roughness:null,metalness:null}),init:function(t){var e=t||{};this.pointSize=Hi(e.pointSize,1),this.sizeAttenuation=Hi(e.sizeAttenuation,!0),this.sortParticles=Hi(e.sortParticles,!1),this.useTexture=Hi(e.useTexture,!1),
	this.alphaTest=Hi(e.alphaTest,.5),this.forceTransparent=Hi(e.forceTransparent,!1),this.edgeBleach=Hi(e.edgeBleach,0),la.prototype.init.call(this,e)},createData:function(t){var e={position:!0,color:!0},i=t.getAtomData(this.getAtomParams(e)),r=new Zv(i,this.getBufferParams({pointSize:this.pointSize,sizeAttenuation:this.sizeAttenuation,sortParticles:this.sortParticles,useTexture:this.useTexture,alphaTest:this.alphaTest,forceTransparent:this.forceTransparent,edgeBleach:this.edgeBleach}));return{bufferList:[r]}},updateData:function(t,e){var i=e.sview.getAtomData(this.getAtomParams(t)),r={};t&&!t.position||(r.position=i.position),t&&!t.color||(r.color=i.color),e.bufferList[0].setAttributes(r)}}),Jp.add("point",Wa),em.add("shader/Ribbon.vert","#define STANDARD\nuniform float nearClip;\nuniform vec3 clipCenter;\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvarying vec3 vViewPosition;\n#endif\n#if defined( RADIUS_CLIP )\nvarying vec3 vClipCenter;\n#endif\nattribute vec3 dir;\nattribute float size;\n#ifdef PICKING\nattribute vec3 pickingColor;\nvarying vec3 vPickingColor;\n#else\n#include color_pars_vertex\n#ifndef FLAT_SHADED\nvarying vec3 vNormal;\n#endif\n#endif\n#include common\nvoid main(void){\n#ifdef PICKING\nvPickingColor = pickingColor;\n#else\n#include color_vertex\n#include beginnormal_vertex\n#include defaultnormal_vertex\n#ifndef FLAT_SHADED\nvNormal = normalize( transformedNormal );\n#endif\n#endif\n#include begin_vertex\ntransformed += normalize( dir ) * size;\n#include project_vertex\n#if defined( NEAR_CLIP ) || defined( RADIUS_CLIP ) || !defined( PICKING )\nvViewPosition = -mvPosition.xyz;\n#endif\n#if defined( RADIUS_CLIP )\nvClipCenter = -( modelViewMatrix * vec4( clipCenter, 1.0 ) ).xyz;\n#endif\n#include nearclip_vertex\n}");var vb=new Uint16Array([0,1,2,1,3,2]),yb=function(t){function e(e,i){var r=e||{},n=r.position.length/3-1,o=4*n,a=3*o,s=new Float32Array(a),c=new Float32Array(a),u=new Float32Array(a),l=r.pickingColor?new Float32Array(a):void 0,h=a/3>65535?Uint32Array:Uint16Array,d=new h(a);t.call(this,{position:s,color:c,index:d,normal:u,pickingColor:l},i),this.addAttributes({dir:{type:"v3",value:new Float32Array(a)}}),this.addAttributes({size:{type:"f",value:new Float32Array(o)}}),this.setAttributes(r),this.meshIndex=d,this.makeIndex()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={vertexShader:{}};return e.prototype.setAttributes=function(t){var e,i,r,n,o,a,s,c,u,l,h,d,f=this.size,p=f/4,m=this.geometry.attributes;t.position&&(e=t.position,s=m.position.array,m.position.needsUpdate=!0),t.normal&&(i=t.normal,c=m.normal.array,m.normal.needsUpdate=!0),t.size&&(r=t.size,u=m.size.array,m.size.needsUpdate=!0),t.dir&&(n=t.dir,l=m.dir.array,m.dir.needsUpdate=!0),t.color&&(o=t.color,h=m.color.array,m.color.needsUpdate=!0),t.pickingColor&&(a=t.pickingColor,d=m.pickingColor.array,m.pickingColor.needsUpdate=!0);var g,v,y,b,x,_,w,S=r?r[0]:null;for(g=0;g<p;++g){for(_=3*g,y=3*g*4,x=4*g,e&&(s[y]=s[y+3]=e[_],s[y+1]=s[y+4]=e[_+1],s[y+2]=s[y+5]=e[_+2],s[y+6]=s[y+9]=e[_+3],s[y+7]=s[y+10]=e[_+4],s[y+8]=s[y+11]=e[_+5]),i&&(c[y]=c[y+3]=-i[_],c[y+1]=c[y+4]=-i[_+1],c[y+2]=c[y+5]=-i[_+2],c[y+6]=c[y+9]=-i[_+3],c[y+7]=c[y+10]=-i[_+4],c[y+8]=c[y+11]=-i[_+5]),v=0;v<4;++v)b=y+3*v,o&&(h[b]=o[_],h[b+1]=o[_+1],h[b+2]=o[_+2]),a&&(d[b]=a[_],d[b+1]=a[_+1],d[b+2]=a[_+2]);r&&(w=r[g],S!==r[g]?(u[x]=S,u[x+1]=S,u[x+2]=w,u[x+3]=w):(u[x]=w,u[x+1]=w,u[x+2]=w,u[x+3]=w),S=w),n&&(l[y]=n[_],l[y+1]=n[_+1],l[y+2]=n[_+2],l[y+3]=-n[_],l[y+4]=-n[_+1],l[y+5]=-n[_+2],l[y+6]=n[_+3],l[y+7]=n[_+4],l[y+8]=n[_+5],l[y+9]=-n[_+3],l[y+10]=-n[_+4],l[y+11]=-n[_+5])}},e.prototype.makeIndex=function(){var t,e,i,r,n=this.meshIndex,o=n.length/4/3;for(e=0;e<o;++e)for(i=6*e,r=4*e,n.set(vb,i),t=0;t<6;++t)n[i+t]+=r},i.vertexShader.get=function(){return"Ribbon.vert"},Object.defineProperties(e.prototype,i),e}(vv);Xa.prototype=Object.assign(Object.create(la.prototype),{constructor:Xa,type:"ribbon",parameters:Object.assign({subdiv:{type:"integer",max:50,min:1,rebuild:!0},tension:{type:"number",precision:1,max:1,min:.1},smoothSheet:{type:"boolean",rebuild:!0}},la.prototype.parameters,{side:null,wireframe:null,linewidth:null}),init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"chainname"),e.colorScale=Hi(e.colorScale,"RdYlBu"),e.radius=Hi(e.radius,"sstruc"),e.scale=Hi(e.scale,4),"low"===e.quality?this.subdiv=3:"medium"===e.quality?this.subdiv=6:"high"===e.quality?this.subdiv=12:this.subdiv=Hi(e.subdiv,6),this.tension=Hi(e.tension,NaN),this.smoothSheet=Hi(e.smoothSheet,!1),la.prototype.init.call(this,e)},getSplineParams:function(t){return Object.assign({subdiv:this.subdiv,tension:this.tension,directional:!0,smoothSheet:this.smoothSheet},t)},createData:function(t){var e=[],i=[];return this.structure.eachPolymer(function(t){if(!(t.residueCount<4)){i.push(t);var r=new Aa(t,this.getSplineParams()),n=r.getSubdividedPosition(),o=r.getSubdividedOrientation(),a=r.getSubdividedColor(this.getColorParams()),s=r.getSubdividedSize(this.radius,this.scale);e.push(new yb({position:n.position,normal:o.binormal,dir:o.normal,color:a.color,size:s.size,pickingColor:a.pickingColor},this.getBufferParams()))}}.bind(this),t.getSelection()),{bufferList:e,polymerList:i}},updateData:function(t,e){var i=this;t=t||{};var r=0,n=e.polymerList.length;for(r=0;r<n;++r){var o={},a=new Aa(e.polymerList[r],i.getSplineParams());if(t.position){var s=a.getSubdividedPosition(),c=a.getSubdividedOrientation();o.position=s.position,o.normal=c.binormal,o.dir=c.normal}if(t.radius||t.scale){var u=a.getSubdividedSize(i.radius,i.scale);o.size=u.size}if(t.color){var l=a.getSubdividedColor(i.getColorParams());o.color=l.color}e.bufferList[r].setAttributes(o)}},setParameters:function(t){var e=!1,i={};return t&&t.tension&&(i.position=!0),la.prototype.setParameters.call(this,t,i,e),this}}),Jp.add("ribbon",Xa),qa.prototype=Object.assign(Object.create(la.prototype),{constructor:qa,type:"rocket",parameters:Object.assign({localAngle:{type:"integer",max:180,min:0,rebuild:!0},centerDist:{type:"number",precision:1,max:10,min:0,rebuild:!0},ssBorder:{type:"boolean",rebuild:!0},radialSegments:!0,openEnded:!0,disableImpostor:!0},la.prototype.parameters),init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"sstruc"),e.radius=Hi(e.radius,1.5),e.scale=Hi(e.scale,1),e.openEnded=Hi(e.openEnded,!1),this.localAngle=Hi(e.localAngle,30),this.centerDist=Hi(e.centerDist,2.5),this.ssBorder=Hi(e.ssBorder,!1),la.prototype.init.call(this,e)},createData:function(t){var e=0,i=[],r=[];this.structure.eachPolymer(function(t){if(!(t.residueCount<4||t.isNucleic())){var n=new ro(t),o=n.getAxis(this.localAngle,this.centerDist,this.ssBorder,this.getColorParams(),this.radius,this.scale);e+=o.size.length,i.push(o),r.push(n)}}.bind(this),t.getSelection());var n={begin:new Float32Array(3*e),end:new Float32Array(3*e),size:new Float32Array(e),color:new Float32Array(3*e),pickingColor:new Float32Array(3*e)},o=0;i.forEach(function(t){n.begin.set(t.begin,3*o),n.end.set(t.end,3*o),n.size.set(t.size,o),n.color.set(t.color,3*o),n.pickingColor.set(t.pickingColor,3*o),o+=t.size.length});var a=new Jo({position1:n.begin,position2:n.end,color:n.color,color2:n.color,radius:n.size,pickingColor:n.pickingColor,pickingColor2:n.pickingColor},this.getBufferParams({openEnded:this.openEnded,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0}));return{bufferList:[a],axisList:i,helixbundleList:r,axisData:n}},updateData:function(t,e){if(t=t||{},t.position)return void this.build();var i={};if(t.color||t.radius){var r=0;e.helixbundleList.forEach(function(i){var n=i.getAxis(this.localAngle,this.centerDist,this.ssBorder,this.getColorParams(),this.radius,this.scale);t.color&&e.axisData.color.set(n.color,3*r),(t.radius||t.scale)&&e.axisData.size.set(n.size,r),r+=n.size.length}.bind(this)),t.color&&(i.color=e.axisData.color,i.color2=e.axisData.color),(t.radius||t.scale)&&(i.radius=e.axisData.size)}e.bufferList[0].setAttributes(i)}}),Jp.add("rocket",qa),Ya.prototype=Object.assign(Object.create(Ma.prototype),{constructor:Ya,type:"rope",parameters:Object.assign({smooth:{type:"integer",max:15,min:0,rebuild:!0}},Ma.prototype.parameters,{aspectRatio:null,smoothSheet:null}),init:function(t){var e=t||{};e.aspectRatio=1,e.tension=Hi(e.tension,.5),e.scale=Hi(e.scale,5),e.smoothSheet=!1,this.smooth=Hi(e.smooth,2),Ma.prototype.init.call(this,e)},getSpline:function(t){var e=new io(t);return new Aa(t,this.getSplineParams({directional:!1,positionIterator:e.getCenterIterator(this.smooth)}))}}),Jp.add("rope",Ya),Za.prototype=Object.assign(Object.create(la.prototype),{constructor:Za,type:"spacefill",parameters:Object.assign({sphereDetail:!0,disableImpostor:!0},la.prototype.parameters),init:function(t){var e=t||{};la.prototype.init.call(this,e)},createData:function(t){var e=new Ko(t.getAtomData(this.getAtomParams()),this.getBufferParams({sphereDetail:this.sphereDetail,dullInterior:!0,disableImpostor:this.disableImpostor}));return{bufferList:[e]}},updateData:function(t,e){var i=e.sview.getAtomData(this.getAtomParams(t)),r={};t&&!t.position||(r.position=i.position),t&&!t.color||(r.color=i.color),t&&!t.radius||(r.radius=i.radius),e.bufferList[0].setAttributes(r)}}),Jp.add("spacefill",Za);var bb=function(t){function e(e,i){var r=e||{},n=i||{},o=r.position.length/3,a=o-1,s=new Float32Array(3*a*2),c=new Float32Array(3*a*2);t.call(this,{position:s,color:c},n),this.setAttributes(e)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={line:{},vertexShader:{},fragmentShader:{}};return e.prototype.setAttributes=function(t){var e,i,r,n,o=this.geometry.attributes;if(t.position&&(e=t.position,r=o.position.array,o.position.needsUpdate=!0),t.color&&(i=t.color,n=o.color.array,o.color.needsUpdate=!0),!e&&!i)return void qp.warn("TraceBuffer.prototype.setAttributes no data");for(var a,s,c=this.size,u=c-1,l=0;l<u;++l)a=3*l,s=3*l*2,e&&(r[s]=e[a],r[s+1]=e[a+1],r[s+2]=e[a+2],r[s+3]=e[a+3],r[s+4]=e[a+4],r[s+5]=e[a+5]),i&&(n[s]=i[a],n[s+1]=i[a+1],n[s+2]=i[a+2],n[s+3]=i[a+3],n[s+4]=i[a+4],n[s+5]=i[a+5])},i.line.get=function(){return!0},i.vertexShader.get=function(){return"Line.vert"},i.fragmentShader.get=function(){return"Line.frag"},Object.defineProperties(e.prototype,i),e}(mv);Ka.prototype=Object.assign(Object.create(la.prototype),{constructor:Ka,type:"trace",parameters:Object.assign({subdiv:{type:"integer",max:50,min:1,rebuild:!0},tension:{type:"number",precision:1,max:1,min:.1},smoothSheet:{type:"boolean",rebuild:!0}},ia.prototype.parameters,{flatShaded:null,side:null,wireframe:null}),init:function(t){var e=t||{};e.colorScheme=Hi(e.colorScheme,"chainname"),e.colorScale=Hi(e.colorScale,"RdYlBu"),"low"===e.quality?this.subdiv=3:"medium"===e.quality?this.subdiv=6:"high"===e.quality?this.subdiv=12:this.subdiv=Hi(e.subdiv,6),this.tension=Hi(e.tension,NaN),this.smoothSheet=Hi(e.smoothSheet,!1),la.prototype.init.call(this,e)},getSplineParams:function(t){return Object.assign({subdiv:this.subdiv,tension:this.tension,directional:!1,smoothSheet:this.smoothSheet},t)},createData:function(t){var e=[],i=[];return this.structure.eachPolymer(function(t){if(!(t.residueCount<4)){i.push(t);var r=new Aa(t,this.getSplineParams()),n=r.getSubdividedPosition(),o=r.getSubdividedColor(this.getColorParams());e.push(new bb(Object.assign({},n,o),this.getBufferParams()))}}.bind(this),t.getSelection()),{bufferList:e,polymerList:i}},updateData:function(t,e){var i=this;t=t||{};var r=0,n=e.polymerList.length;for(r=0;r<n;++r){var o={},a=new Aa(e.polymerList[r],i.getSplineParams());if(t.position){var s=a.getSubdividedPosition();o.position=s.position}if(t.color){var c=a.getSubdividedColor(i.getColorParams());o.color=c.color}e.bufferList[r].setAttributes(o)}},setParameters:function(t){var e=!1,i={};return t&&t.tension&&(i.position=!0),la.prototype.setParameters.call(this,t,i,e),this}}),Jp.add("trace",Ka),Qa.prototype=Object.assign(Object.create(Ma.prototype),{constructor:Qa,type:"tube",parameters:Object.assign({},Ma.prototype.parameters,{aspectRatio:null}),init:function(t){var e=t||{};e.aspectRatio=1,e.scale=Hi(e.scale,2),Ma.prototype.init.call(this,e),"low"===e.quality&&(this.radialSegments=5)},getSplineParams:function(){return Ma.prototype.getSplineParams.call(this,{directional:!1})}}),Jp.add("tube",Qa),Ja.prototype=Object.assign(Object.create(la.prototype),{constructor:Ja,type:"unitcell",parameters:Object.assign({radius:{type:"number",precision:3,max:10,min:.001},sphereDetail:!0,radialSegments:!0,disableImpostor:!0},ia.prototype.parameters,{assembly:null}),init:function(t){var e=t||{},i=.5;this.structure.unitcell&&(i=Math.cbrt(this.structure.unitcell.volume)/200),e.radius=Hi(e.radius,i),e.colorValue=Hi(e.colorValue,"orange"),la.prototype.init.call(this,e)},getUnitcellData:function(t){function e(t,e,i){f.set(t,e,i).multiply(d).applyMatrix4(h.fracToCart).toArray(n,p),p+=3}function i(t,e){f.fromArray(n,3*t).toArray(s,m),f.fromArray(n,3*e).toArray(c,m),m+=3}var r=new ct(this.colorValue),n=new Float32Array(24),o=qr(8,r.r,r.g,r.b),a=Xr(8,this.radius),s=new Float32Array(36),c=new Float32Array(36),u=qr(12,r.r,r.g,r.b),l=Xr(12,this.radius),h=t.unitcell,d=t.center.clone().applyMatrix4(h.cartToFrac).floor().multiplyScalar(2).addScalar(1),f=new g,p=0;e(0,0,0),e(1,0,0),e(0,1,0),e(0,0,1),e(1,1,0),e(1,0,1),e(0,1,1),e(1,1,1);var m=0;return i(0,1),i(0,2),i(0,3),i(1,4),i(1,5),i(2,6),i(3,5),i(4,7),i(5,7),i(2,4),i(7,6),i(3,6),{vertex:{position:n,color:o,radius:a},edge:{position1:s,position2:c,color:u,color2:u,radius:l}}},create:function(){var t=this.structureView.getStructure();if(t.unitcell){var e=this.getUnitcellData(t);this.sphereBuffer=new Ko(e.vertex,this.getBufferParams({sphereDetail:this.sphereDetail,disableImpostor:this.disableImpostor,dullInterior:!0})),this.cylinderBuffer=new Jo(e.edge,this.getBufferParams({openEnded:!0,radialSegments:this.radialSegments,disableImpostor:this.disableImpostor,dullInterior:!0})),this.dataList.push({sview:this.structureView,bufferList:[this.sphereBuffer,this.cylinderBuffer]})}},updateData:function(t,e){var i=e.sview.getStructure(),r=this.getUnitcellData(i),n={},o={};t&&!t.position||(n.position=r.vertexPosition,o.position1=r.edgePosition1,o.position2=r.edgePosition2),t&&!t.color||(n.color=r.vertexColor,o.color=r.edgeColor,o.color2=r.edgeColor),t&&!t.radius||(n.radius=r.vertexRadius,o.radius=r.edgeRadius),this.sphereBuffer.setAttributes(n),this.cylinderBuffer.setAttributes(o)}}),Jp.add("unitcell",Ja);var xb=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},parameters:{}};return i.type.get=function(){return"validation"},i.parameters.get=function(){return Object.assign.call(this,t.prototype.parameters,{radiusType:null,radius:null,scale:null})},e.prototype.init=function(e){var i=e||{};i.colorValue=Hi(i.colorValue,"#f0027f"),t.prototype.init.call(this,i)},e.prototype.createData=function(t){if(t.validation){var e=t.validation.getClashData({structure:t,color:this.colorValue}),i=new Jo(e,this.getBufferParams({openEnded:!1}));return{bufferList:[i]}}},e.prototype.updateData=function(){this.build()},Object.defineProperties(e.prototype,i),e}(la);Jp.add("validation",xb);var _b=function(t,e){var i=e||{};this.streamer=t,this.name=Hi(i.name,""),this.path=Hi(i.path,"")},wb={type:{},__objName:{}};wb.type.get=function(){return""},wb.__objName.get=function(){return""},_b.prototype.parse=function(){var t=this;return this.streamer.read().then(function(){return t._beforeParse(),t._parse(),t._afterParse(),t[t.__objName]})},_b.prototype._parse=function(){},_b.prototype._beforeParse=function(){},_b.prototype._afterParse=function(){t.Debug&&qp.log(this[this.__objName])},Object.defineProperties(_b.prototype,wb);var Sb=function(t){function e(e,i){var r=i||{};t.call(this,e,r),this.firstModelOnly=Hi(r.firstModelOnly,!1),this.asTrajectory=Hi(r.asTrajectory,!1),this.cAlphaOnly=Hi(r.cAlphaOnly,!1),this.structure=new Io(this.name,this.path),this.structureBuilder=new ts(this.structure)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},__objName:{}};return i.type.get=function(){return"structure"},i.__objName.get=function(){return"structure"},Object.defineProperties(e.prototype,i),e}(_b),Ab=function(t){var e=t||{};this.a=e.a||1,this.b=e.b||1,this.c=e.c||1,this.alpha=e.alpha||90,this.beta=e.beta||90,this.gamma=e.gamma||90,this.spacegroup=e.spacegroup||"P 1",this.cartToFrac=e.cartToFrac||e.scale,this.fracToCart=new p;var i=mr(this.alpha),r=mr(this.beta),n=mr(this.gamma),o=Math.cos(i),a=Math.cos(r),s=Math.cos(n),c=Math.sin(r),u=Math.sin(n);if(this.volume=this.a*this.b*this.c*Math.sqrt(1-o*o-a*a-s*s+2*o*a*s),void 0===this.cartToFrac){var l=this.a*this.b*u/this.volume,h=(a*s-o)/(c*u);this.fracToCart.set(this.a,0,0,0,this.b*s,this.b*u,0,0,this.c*a,-this.c*c*h,1/l,0,0,0,0,1).transpose(),this.cartToFrac=(new p).getInverse(this.fracToCart)}else this.fracToCart.getInverse(this.cartToFrac)},Mb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"gro"},i.prototype._parse=function(){function e(t,e,n){for(var h=t;h<e;++h){++C;var g=C-1,T=n[h];if(T)if(g%w===0)s&&(i=new Float32Array(3*_),u.push(i),r=0);else if(g%w===1);else if(g%w===w-1){var E=T.trim().split(/\s+/),I=new Float32Array(9);if(I[0]=10*parseFloat(E[0]),I[4]=10*parseFloat(E[1]),I[8]=10*parseFloat(E[2]),l.push(I),a)return!0;P+=1}else{if(d=T.substr(10,5).trim(),c&&"CA"!==d)continue;var L=10*parseFloat(T.substr(y,v)),R=10*parseFloat(T.substr(b,v)),O=10*parseFloat(T.substr(x,v));if(s){var D=3*r;if(i[D+0]=L,i[D+1]=R,i[D+2]=O,r+=1,g>w)continue}f=T.substr(5,5).trim(),p=parseInt(T.substr(0,5)),m=parseInt(T.substr(15,5)),A.growIfFull(),A.atomTypeId[M]=S.add(d),A.x[M]=L,A.y[M]=R,A.z[M]=O,A.serial[M]=m,o.addAtom(P,"","",f,p,0,"l"),M+=1}}}t.Debug&&qp.time("GroParser._parse "+this.name);var i,r,n=this.structure,o=this.structureBuilder,a=this.firstModelOnly,s=this.asTrajectory,c=this.cAlphaOnly,u=n.frames,l=n.boxes,h=this.streamer.peekLines(3);n.title=h[0].trim();var d,f,p,m,g=h[2].length-h[2].lastIndexOf(".")-1,v=5+g,y=20,b=20+v,x=20+2*v,_=parseInt(h[1]),w=_+3,S=n.atomMap,A=n.atomStore;A.resize(_);var M=0,P=0,C=0;this.streamer.eachChunkOfLines(function(t){e(0,t.length,t)}),n.unitcell=new Ab(l[0][0],l[0][4],l[0][8],90,90,90,"P 1"),o.finalize(),n.finalizeAtoms(),lo(n),ho(n),n.finalizeBonds(),uv(n),vo(n),t.Debug&&qp.timeEnd("GroParser._parse "+this.name)},Object.defineProperties(i.prototype,r),i}(Sb);tm.add("gro",Mb);var Pb=function(t,e,i,r,n){this.structure=t,this.index=e,this.description=i||"",this.entityType=es(r||""),this.chainIndexList=n||[],n.forEach(function(i){t.chainStore.entityIndex[i]=e})},Cb={type:{}};Cb.type.get=function(){return"Entity"},Pb.prototype.getEntityType=function(){return this.entityType},Pb.prototype.isPolymer=function(){return this.entityType===lg},Pb.prototype.isNonPolymer=function(){return this.entityType===hg},Pb.prototype.isMacrolide=function(){return this.entityType===dg},Pb.prototype.isWater=function(){return this.entityType===fg},Pb.prototype.eachChain=function(t){var e=this.structure.getChainProxy();this.chainIndexList.forEach(function(i){e.index=i,t(e)})},Object.defineProperties(Pb.prototype,Cb);var Tb={1:"h",2:"h",3:"i",4:"h",5:"g",6:"h",7:"h",8:"h",9:"h",10:"h","":"h"},Eb=function(e){function i(t,i){var r=i||{};e.call(this,t,r),this.hex=Hi(r.hex,!1)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"pdb"},i.prototype._parse=function(){function e(t,e,it){for(var dt,ft,pt=t;pt<e;++pt)if(s=it[pt],c=s.substr(0,6),"ATOM  "===c||"HETATM"===c){if(ht&&(V?(X?(i=new Float32Array(3*at.count),H.push(i)):i=[],r=0):$||(Y={}),T=1,E=T.toString(),I=!0,ht=!1),$&&lt>0)continue;var mt,gt,vt,yt,bt;if(N){if(yt=s.split(k),bt=10===yt.length?1:0,g=yt[2],G&&"CA"!==g)continue;mt=parseFloat(yt[6-bt]),gt=parseFloat(yt[7-bt]),vt=parseFloat(yt[8-bt])}else{if(g=s.substr(12,4).trim(),G&&"CA"!==g)continue;mt=parseFloat(s.substr(30,8)),gt=parseFloat(s.substr(38,8)),vt=parseFloat(s.substr(46,8))}if(V&&(dt=3*r,i[dt+0]=mt,i[dt+1]=gt,i[dt+2]=vt,r+=1,X))continue;var xt;N?(u=parseInt(yt[1]),xt="",v="H"===s[0]?1:0,l=bt?"":yt[4],h=parseInt(yt[5-bt]),m="",d=yt[3],y=parseFloat(yt[9-bt]),b="",f=0):(u=parseInt(s.substr(6,5),U),z&&99999===u&&(U=16),xt=s.substr(76,2).trim(),v="H"===s[0]?1:0,l=s[21].trim()||s.substr(72,4).trim(),h=parseInt(s.substr(22,4),j),z&&9999===h&&(j=16),m=s[26].trim(),d=s.substr(17,4).trim(),y=parseFloat(s.substr(60,6)),b=s[16].trim(),f=parseFloat(s.substr(54,6))),at.growIfFull(),at.atomTypeId[ut]=ot.add(g,xt),at.x[ut]=mt,at.y[ut]=gt,at.z[ut]=vt,at.serial[ut]=u,at.bfactor[ut]=isNaN(y)?0:y,at.altloc[ut]=b.charCodeAt(0),at.occupancy[ut]=isNaN(f)?0:f,v?L===l&&O===d&&(Wg.includes(d)||R===h&&D===m)||(T+=1,E=T.toString(),R=h,O=d,D=m):I||L===l||(T+=1,E=T.toString()),B.addAtom(lt,l,E,d,h,v,void 0,m),Y[u]=ut,ut+=1,I=!1,L=l}else if("CONECT"===c){var _t=Y[parseInt(s.substr(6,5))],wt=[11,16,21,26],St={};if(void 0===_t)continue;for(dt=0;dt<4;++dt){var At=parseInt(s.substr(wt[dt],5));if(!Number.isNaN(At)&&(At=Y[At],void 0!==At))if(_t<At?(st.index=_t,ct.index=At):(st.index=At,ct.index=_t),void 0!==St[At])F.bondStore.bondOrder[St[At]]+=1;else{var Mt=st.index+"|"+ct.index;void 0===K[Mt]&&(K[Mt]=!0,St[At]=F.bondStore.count,F.bondStore.addBond(st,ct,1))}}}else if("HELIX "===c){x=s[19].trim(),_=parseInt(s.substr(21,4)),w=s[25].trim(),S=s[31].trim(),A=parseInt(s.substr(33,4)),M=s[37].trim();var Pt=parseInt(s.substr(39,1));Pt=(Tb[Pt]||Tb[""]).charCodeAt(0),rt.push([x,_,w,S,A,M,Pt])}else if("SHEET "===c)x=s[21].trim(),_=parseInt(s.substr(22,4)),w=s[26].trim(),S=s[32].trim(),A=parseInt(s.substr(33,4)),M=s[37].trim(),nt.push([x,_,w,S,A,M]);else if("HETNAM"===c)et[s.substr(11,3)]=s.substr(15).trim();else if("COMPND"===c){var Ct,Tt=s.substr(10,70).trim(),Et=Tt.indexOf(":"),It=Tt.substring(0,Et);J.includes(It)?(C=It,Ct=Tt.substring(Et+2)):Ct=Tt,Ct=Ct.replace(/;$/,""),"MOL_ID"===C?(P={chainList:[],name:""},Q.push(P)):"MOLECULE"===C?(P.name&&(P.name+=" "),P.name+=Ct):"CHAIN"===C&&Array.prototype.push.apply(P.chainList,Ct.split(/\s*,\s*/))}else if(s.startsWith("TER")){var Lt=F.getChainProxy(F.chainStore.count-1);tt[Lt.chainname]=Lt.index,T+=1,E=T.toString(),I=!0}else if("REMARK"===c&&"350"===s.substr(7,3)){if("BIOMOLECULE:"===s.substr(11,12)){var Rt=s.substr(23).trim();/^(0|[1-9][0-9]*)$/.test(Rt)&&(Rt="BU"+Rt),n=new ov(Rt),q[Rt]=n}else if("BIOMT"===s.substr(13,5)){var Ot=s.split(/\s+/),Dt=parseInt(s[18])-1;0===Dt&&(a=new p,o.matrixList.push(a));var Nt=a.elements;Nt[0+Dt]=parseFloat(Ot[4]),Nt[4+Dt]=parseFloat(Ot[5]),Nt[8+Dt]=parseFloat(Ot[6]),Nt[12+Dt]=parseFloat(Ot[7])}else if("APPLY THE FOLLOWING TO CHAINS:"===s.substr(11,30)||"                   AND CHAINS:"===s.substr(11,30)){"APPLY"===s.substr(11,5)&&(o=n.addPart());var kt=s.substr(41,30).split(",");for(ft=kt.length;dt<ft;++dt){var Ft=kt[dt].trim();Ft&&o.chainList.push(Ft)}}}else if("HEADER"===c)F.id=s.substr(62,4);else if("TITLE "===c)F.title+=(F.title?" ":"")+s.substr(10,70).trim();else if("MODEL "===c)ht=!0;else if("ENDMDL"===c||s.startsWith("END")){if(ht)continue;V&&!X&&(H.push(new Float32Array(i)),X=!0),lt+=1,ht=!0}else if("MTRIX"===s.substr(0,5)){if("1"===s[59])continue;var Bt=s.split(/\s+/),zt=Bt[1].trim();if("1"===s[5]&&"1"===zt){var Ut="NCS";n=new ov(Ut),q[Ut]=n,o=n.addPart()}var jt=parseInt(s[5])-1;0===jt&&(a=new p,o.matrixList.push(a));var $t=a.elements;$t[0+jt]=parseFloat(Bt[2]),$t[4+jt]=parseFloat(Bt[3]),$t[8+jt]=parseFloat(Bt[4]),$t[12+jt]=parseFloat(Bt[5])}else if("ORIGX"===s.substr(0,5)){Z.origx||(Z.origx=new p);var Vt=s.split(/\s+/),Gt=parseInt(s[5])-1,Ht=Z.origx.elements;Ht[0+Gt]=parseFloat(Vt[1]),Ht[4+Gt]=parseFloat(Vt[2]),Ht[8+Gt]=parseFloat(Vt[3]),Ht[12+Gt]=parseFloat(Vt[4])}else if("SCALE"===s.substr(0,5)){Z.scale||(Z.scale=new p);var Wt=s.split(/\s+/),Xt=parseInt(s[5])-1,qt=Z.scale.elements;qt[0+Xt]=parseFloat(Wt[1]),qt[4+Xt]=parseFloat(Wt[2]),qt[8+Xt]=parseFloat(Wt[3]),qt[12+Xt]=parseFloat(Wt[4])}else if("CRYST1"===c){var Yt=parseFloat(s.substr(6,9)),Zt=parseFloat(s.substr(15,9)),Kt=parseFloat(s.substr(24,9)),Qt=parseFloat(s.substr(33,7)),Jt=parseFloat(s.substr(40,7)),te=parseFloat(s.substr(47,7)),ee=s.substr(55,11).trim(),ie=new Float32Array(9);ie[0]=Yt,ie[4]=Zt,ie[8]=Kt,W.push(ie),0===lt&&(Z.a=Yt,Z.b=Zt,Z.c=Kt,Z.alpha=Qt,Z.beta=Jt,Z.gamma=te,Z.spacegroup=ee)}}t.Debug&&qp.time("PdbParser._parse "+this.name);var i,r,n,o,a,s,c,u,l,h,d,f,m,g,v,y,b,x,_,w,S,A,M,P,C,T,E,I,L,R,O,D,N="pqr"===this.type,k=/\s+/,F=this.structure,B=this.structureBuilder,z=this.hex,U=10,j=10,$=this.firstModelOnly,V=this.asTrajectory,G=this.cAlphaOnly,H=F.frames,W=F.boxes,X=!1,q=F.biomolDict,Y={},Z={},K={},Q=[],J=["MOL_ID","MOLECULE","CHAIN","FRAGMENT","SYNONYM","EC","ENGINEERED","MUTATION","OTHER_DETAILS"],tt={},et={},it={helices:[],sheets:[]},rt=it.helices,nt=it.sheets,ot=F.atomMap,at=F.atomStore;at.resize(Math.round(this.streamer.data.length/80));var st=F.getAtomProxy(),ct=F.getAtomProxy(),ut=0,lt=0,ht=!0;this.streamer.eachChunkOfLines(function(t){e(0,t.length,t)});var dt=Q.length;if(Q.length){F.eachChain(function(t){t.entityIndex=dt}),Q.forEach(function(t,e){var i=t.chainList.map(function(t){return tt[t]});F.entityList.push(new Pb(F,e,t.name,"polymer",i))});var ft=Q.length,pt=F.getResidueProxy(),mt={};F.eachChain(function(t){t.entityIndex===dt&&(pt.index=t.residueOffset,mt[pt.resname]||(mt[pt.resname]=[]),mt[pt.resname].push(t.index))}),Object.keys(mt).forEach(function(t){var e=mt[t],i="non-polymer",r=et[t]||t;Wg.includes(t)&&(r="water",i="water"),F.entityList.push(new Pb(F,ft,r,i,e)),ft+=1})}void 0!==Z.a?F.unitcell=new Ab(Z):F.unitcell=void 0,B.finalize(),F.finalizeAtoms(),lo(F),ho(F),F.finalizeBonds(),rt.length||nt.length?uo(F,it):uv(F),vo(F),t.Debug&&qp.timeEnd("PdbParser._parse "+this.name)},Object.defineProperties(i.prototype,r),i}(Sb);tm.add("pdb",Eb),tm.add("pdb1",Eb),tm.add("ent",Eb);var Ib=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"pqr"},Object.defineProperties(e.prototype,i),e}(Eb);tm.add("pqr",Ib);var Lb=/\s+/,Rb=/'((?:(?!'\s).)*)'|"((?:(?!"\s).)*)"|(\S+)/g,Ob=/"/g,Db=/^['"]+|['"]+$/g,Nb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"cif"},i.prototype._parse=function(){function e(e,q,Y){for(var Z=e;Z<q;++Z)if(n=Y[Z],o=n.trim(),(o||R||N)&&"#"!==o[0])if("data_"===o.substring(0,5));else if(";"===o[0])R?(N?(B===F.length&&(B=0),F[B].push(O),B+=1):U===!1?E[z]=O:E[z][U]=O,R=!1,O=null):(R=!0,O=o.substring(1));else if("loop_"===o)N=!0,k=!0,F.length=0,$.length=0,B=0;else if("_"===o[0]){var K,Q,J;if(N&&!k&&(N=!1),N)K=o.split("."),Q=K[0].substring(1),J=K[1],1===K.length?(J=!1,E[Q]||(E[Q]=[]),F.push(E[Q])):(E[Q]||(E[Q]={}),E[Q][J]?qp.warn(Q,J,"already exists"):(E[Q][J]=[],F.push(E[Q][J]),$.push(J))),z=Q,U=J,j=!0;else{var tt=o.match(Rb),et=tt[0],it=tt[1];K=et.split("."),Q=K[0].substring(1),J=K[1],1===K.length?(J=!1,E[Q]=it):(E[Q]||(E[Q]={}),E[Q][J]?qp.warn(Q,J,"already exists"):E[Q][J]=it),it||(D=!0),z=Q,U=J}}else if(R)O+=n;else if(N){var rt,nt;if(!o)continue;if("atom_site"===z){rt=$.length,nt=o.split(Lb),j&&(a=$.indexOf("auth_asym_id"),s=$.indexOf("auth_seq_id"),c=$.indexOf("label_atom_id"),u=$.indexOf("label_comp_id"),l=$.indexOf("label_asym_id"),h=$.indexOf("label_entity_id"),d=$.indexOf("label_alt_id"),y=$.indexOf("Cartn_x"),b=$.indexOf("Cartn_y"),x=$.indexOf("Cartn_z"),p=$.indexOf("id"),m=$.indexOf("type_symbol"),f=$.indexOf("group_PDB"),_=$.indexOf("B_iso_or_equiv"),g=$.indexOf("pdbx_PDB_model_num"),v=$.indexOf("pdbx_PDB_ins_code"),w=$.indexOf("occupancy"),j=!1,H=parseInt(nt[g]),P&&(i=[],r=0));var ot=parseInt(nt[g]);if(H!==ot&&(P&&(0===X&&T.push(new Float32Array(i)),i=new Float32Array(3*G.count),T.push(i),r=0),X+=1),H=ot,M&&X>0)continue;var at=nt[c].replace(Ob,"");if(C&&"CA"!==at)continue;var st=parseFloat(nt[y]),ct=parseFloat(nt[b]),ut=parseFloat(nt[x]);if(P){var lt=3*r;if(i[lt+0]=st,i[lt+1]=ct,i[lt+2]=ut,r+=1,X>0)continue}var ht=nt[u],dt=parseInt(nt[s]),ft=nt[v];ft="?"===ft?"":ft;var pt=nt[a],mt=nt[l],gt="H"===nt[f][0]?1:0,vt=nt[m],yt=parseFloat(nt[_]),bt=parseFloat(nt[w]),xt=nt[d];if(xt="."===xt?"":xt,G.growIfFull(),G.atomTypeId[W]=V.add(at,vt),G.x[W]=st,G.y[W]=ct,G.z[W]=ut,G.serial[W]=parseInt(nt[p]),G.bfactor[W]=isNaN(yt)?0:yt,G.occupancy[W]=isNaN(bt)?0:bt,G.altloc[W]=xt.charCodeAt(0),A.addAtom(X,pt,mt,ht,dt,gt,void 0,ft),t.Debug){var _t=I[mt];void 0!==_t&&_t!==pt&&qp.warn(_t,pt)}I[mt]=pt;var wt=nt[h];L[wt]||(L[wt]=new Set),L[wt].add(S.chainStore.count-1),W+=1}else{nt=o.match(Rb),rt=nt.length,B===F.length&&(B=0);for(var St=0;St<rt;++St)F[B+St].push(nt[St]);B+=rt}k=!1}else if("'"===o[0]&&"'"===o[o.length-1]){var At=o.substring(1,o.length-1);U===!1?E[z]=At:E[z][U]=At}else D?U===!1?E[z]=o:E[z][U]=o:t.Debug&&qp.log("CifParser._parse: unknown state",o);else R=!1,N=!1,D=!1,F.length=0,B=null,z=null,U=null,j=null,$.length=0}qp.time("CifParser._parse "+this.name);var i,r,n,o,a,s,c,u,l,h,d,f,p,m,g,v,y,b,x,_,w,S=this.structure,A=this.structureBuilder,M=this.firstModelOnly,P=this.asTrajectory,C=this.cAlphaOnly,T=S.frames,E={},I={},L={},R=!1,O=null,D=!1,N=!1,k=!1,F=[],B=null,z=null,U=null,j=null,$=[],V=S.atomMap,G=S.atomStore;G.resize(this.streamer.data.length/100);var H,W=0,X=0;if(this.streamer.eachChunkOfLines(function(t){e(0,t.length,t)}),E.chem_comp&&E.chem_comp_atom)as(E,S,A),A.finalize(),S.finalizeAtoms(),S.finalizeBonds(),bo(S);else{var q=ss(E,S,I);if(cs(E,S,I),us(E,S,I),ls(E,S,L),E.struct&&E.struct.title&&(S.title=E.struct.title.trim().replace(Db,"")),E.entry&&E.entry.id&&(S.id=E.entry.id.trim().replace(Db,"")),E.database_PDB_rev){if(E.database_PDB_rev.date){is(E.database_PDB_rev,"date");var Y=E.database_PDB_rev.date.filter(rs);Y.length&&(S.header.releaseDate=Y[Y.length-1])}if(E.database_PDB_rev.date_original){is(E.database_PDB_rev,"date_original");var Z=E.database_PDB_rev.date_original.filter(rs);Z.length&&(S.header.depositionDate=Z[Z.length-1])}}E.reflns&&E.reflns.d_resolution_high?rs(E.reflns.d_resolution_high)&&(S.header.resolution=parseFloat(E.reflns.d_resolution_high)):E.refine&&E.refine.ls_d_res_high&&rs(E.refine.ls_d_res_high)&&(S.header.resolution=parseFloat(E.refine.ls_d_res_high)),E.refine&&E.refine.ls_R_factor_R_free&&rs(E.refine.ls_R_factor_R_free)&&(S.header.rFree=parseFloat(E.refine.ls_R_factor_R_free)),E.refine&&E.refine.ls_R_factor_R_work&&rs(E.refine.ls_R_factor_R_work)&&(S.header.rWork=parseFloat(E.refine.ls_R_factor_R_work)),E.exptl&&E.exptl.method&&(is(E.exptl,"method"),S.header.experimentalMethods=E.exptl.method.map(function(t){return t.replace(Db,"")})),A.finalize(),S.finalizeAtoms(),ho(S),S.finalizeBonds(),q?uo(S,q):uv(S),vo(S)}t.Debug&&qp.timeEnd("CifParser._parse "+this.name)},Object.defineProperties(i.prototype,r),i}(Sb);tm.add("cif",Nb),tm.add("mcif",Nb),tm.add("mmcif",Nb);var kb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"sdf"},i.prototype._parse=function(){function e(t,e,a){for(var M=t;M<e;++M){var P=a[M];if("$$$$"===P.substr(0,4)&&(w=-1,++S,A=d.count),3===w&&(f=parseInt(P.substr(0,3)),p=parseInt(P.substr(3,3)),m=4,g=m+f,v=g,y=v+p,o&&(c=0,s=new Float32Array(3*f),u.push(s),S>0&&(l=!0))),w>=m&&w<g){if(n&&S>0)continue;var C=parseFloat(P.substr(0,10)),T=parseFloat(P.substr(10,10)),E=parseFloat(P.substr(20,10));if(o){var I=3*c;if(s[I+0]=C,s[I+1]=T,s[I+2]=E,c+=1,l)continue}var L=P.substr(31,3).trim(),R=L+(_+1);d.growIfFull(),d.atomTypeId[_]=h.add(R,L),d.x[_]=C,d.y[_]=T,d.z[_]=E,d.serial[_]=_,r.addAtom(S,"","","HET",1,1),
	_+=1}if(w>=v&&w<y){if(n&&S>0)continue;if(o&&S>0)continue;b.index=parseInt(P.substr(0,3))-1+A,x.index=parseInt(P.substr(3,3))-1+A;var O=parseInt(P.substr(6,3));i.bondStore.addBond(b,x,O)}++w}}t.Debug&&qp.time("SdfParser._parse "+this.name);var i=this.structure,r=this.structureBuilder,n=this.firstModelOnly,o=this.asTrajectory,a=this.streamer.peekLines(2);i.id=a[0].trim(),i.title=a[1].trim();var s,c,u=i.frames,l=!1,h=i.atomMap,d=i.atomStore;d.resize(Math.round(this.streamer.data.length/50));var f,p,m,g,v,y,b=i.getAtomProxy(),x=i.getAtomProxy(),_=0,w=0,S=0,A=0;this.streamer.eachChunkOfLines(function(t){e(0,t.length,t)}),r.finalize(),i.finalizeAtoms(),i.finalizeBonds(),bo(i),t.Debug&&qp.timeEnd("SdfParser._parse "+this.name)},i.prototype._postProcess=function(){bo(this.structure)},Object.defineProperties(i.prototype,r),i}(Sb);tm.add("sdf",kb);var Fb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"mol2"},i.prototype._parse=function(){function e(t,e,M){for(var P,C=t;C<e;++C){var T=M[C].trim();if(""!==T&&"#"!==T[0])if("@"===T[0])"@<TRIPOS>MOLECULE"===T?(y=b,p=0,++g):"@<TRIPOS>ATOM"===T?(y=x,m=d.count,c&&(r=0,i=new Float32Array(3*v),u.push(i),g>0&&(l=!0))):y="@<TRIPOS>BOND"===T?_:0;else if(y===b)0===p?(o.title=T,o.id=T):1===p&&(P=T.split(n),v=parseInt(P[0])),++p;else if(y===x){if(P=T.split(n),s&&g>0)continue;var E=parseFloat(P[2]),I=parseFloat(P[3]),L=parseFloat(P[4]);if(c){var R=3*r;if(i[R+0]=E,i[R+1]=I,i[R+2]=L,r+=1,l)continue}var O=P[0],D=P[1],N=P[5].split(".")[0],k=P[6]?parseInt(P[6]):1,F=P[7]?P[7]:"",B=P[8]?parseFloat(P[8]):0;d.growIfFull(),d.atomTypeId[f]=h.add(D,N),d.x[f]=E,d.y[f]=I,d.z[f]=L,d.serial[f]=O,d.bfactor[f]=B,a.addAtom(g,"","",F,k,1),f+=1}else if(y===_){if(s&&g>0)continue;if(c&&g>0)continue;P=T.split(n),w.index=parseInt(P[1])-1+m,S.index=parseInt(P[2])-1+m;var z=A[P[3]];o.bondStore.addBond(w,S,z)}}}t.Debug&&qp.time("Mol2Parser._parse "+this.name);var i,r,n=/\s+/,o=this.structure,a=this.structureBuilder,s=this.firstModelOnly,c=this.asTrajectory,u=o.frames,l=!1,h=o.atomMap,d=o.atomStore;d.resize(Math.round(this.streamer.data.length/60));var f=0,p=0,m=0,g=-1,v=0,y=0,b=1,x=2,_=3,w=o.getAtomProxy(),S=o.getAtomProxy(),A={1:1,2:2,3:3,am:1,ar:1,du:1,un:1,nc:0};this.streamer.eachChunkOfLines(function(t){e(0,t.length,t)}),a.finalize(),o.finalizeAtoms(),lo(o),mo(o,!0),go(o,!0),o.finalizeBonds(),bo(o),uv(o),t.Debug&&qp.timeEnd("Mol2Parser._parse "+this.name)},Object.defineProperties(i.prototype,r),i}(Sb);tm.add("mol2",Fb);var Bb=["mmtfVersion","mmtfProducer","unitCell","spaceGroup","structureId","title","depositionDate","releaseDate","experimentalMethods","resolution","rFree","rWork","bioAssemblyList","ncsOperatorList","entityList","groupList","numBonds","numAtoms","numGroups","numChains","numModels","groupsPerChain","chainsPerModel"],zb=["xCoordList","yCoordList","zCoordList","groupIdList","groupTypeList","chainIdList","bFactorList","atomIdList","altLocList","occupancyList","secStructList","insCodeList","sequenceIndexList","chainNameList","bondAtomList","bondOrderList"],Ub=Bb.concat(zb),jb={0:"i".charCodeAt(0),1:"s".charCodeAt(0),2:"h".charCodeAt(0),3:"e".charCodeAt(0),4:"g".charCodeAt(0),5:"b".charCodeAt(0),6:"t".charCodeAt(0),7:"l".charCodeAt(0),"-1":"".charCodeAt(0)},$b=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"mmtf"},i.prototype._parse=function(){t.Debug&&qp.time("MmtfParser._parse "+this.name);var e,i,r,n,o,a=this.structure,s=Rs(Is(this.streamer.data)),c=["depositionDate","releaseDate","resolution","rFree","rWork","experimentalMethods"];c.forEach(function(t){void 0!==s[t]&&(a.header[t]=s[t])});var u,l,h,d,f,m;if(a.id=s.structureId,a.title=s.title,this.firstModelOnly||this.asTrajectory){for(f=1,d=s.chainsPerModel[0],h=0,e=0,i=d;e<i;++e)h+=s.groupsPerChain[e];for(l=0,e=0,i=h;e<i;++e)o=s.groupList[s.groupTypeList[e]],l+=o.atomNameList.length;u=s.numBonds,m=[d]}else u=s.numBonds,l=s.numAtoms,h=s.numGroups,d=s.numChains,f=s.numModels,m=s.chainsPerModel;if(u+=h,this.asTrajectory)for(e=0,i=s.numModels;e<i;++e){var g=new Float32Array(3*l),v=l*e;for(r=0;r<l;++r){var y=3*r,b=r+v;g[y]=s.xCoordList[b],g[y+1]=s.yCoordList[b],g[y+2]=s.zCoordList[b]}a.frames.push(g)}var x=new Uint32Array(u),_=new Uint32Array(u),w=new Uint8Array(u),S=new Uint32Array(l),A=new Uint32Array(h),M=new Uint32Array(h),P=new Uint16Array(h),C=new Uint16Array(d),T=new Uint32Array(d),E=new Uint32Array(d),I=new Uint32Array(f),L=new Uint32Array(f),R=0;for(e=0,i=f;e<i;++e){var O=m[e];for(I[e]=R,L[e]=O,r=0;r<O;++r)C[r+R]=e;R+=O}var D=s.groupsPerChain,N=0;for(e=0,i=d;e<i;++e){var k=D[e];for(T[e]=N,E[e]=k,r=0;r<k;++r)A[r+N]=e;N+=k}var F=0,B=0;for(e=0,i=h;e<i;++e){o=s.groupList[s.groupTypeList[e]];var z=o.atomNameList.length,U=o.bondAtomList,j=o.bondOrderList;for(r=0,n=j.length;r<n;++r)x[B]=F+U[2*r],_[B]=F+U[2*r+1],w[B]=j[r],B+=1;for(M[e]=F,P[e]=z,r=0;r<z;++r)S[F]=e,F+=1}var $=s.bondAtomList;if($)for(s.bondOrderList&&w.set(s.bondOrderList,B),e=0,i=$.length;e<i;e+=2){var V=$[e],G=$[e+1];V<l&&G<l&&(x[B]=V,_[B]=G,B+=1)}a.bondStore.length=w.length,a.bondStore.count=B,a.bondStore.atomIndex1=x,a.bondStore.atomIndex2=_,a.bondStore.bondOrder=w,a.atomStore.length=l,a.atomStore.count=l,a.atomStore.residueIndex=S,a.atomStore.atomTypeId=new Uint16Array(l),a.atomStore.x=s.xCoordList.subarray(0,l),a.atomStore.y=s.yCoordList.subarray(0,l),a.atomStore.z=s.zCoordList.subarray(0,l),a.atomStore.serial=s.atomIdList.subarray(0,l),a.atomStore.bfactor=s.bFactorList.subarray(0,l),a.atomStore.altloc=s.altLocList.subarray(0,l),a.atomStore.occupancy=s.occupancyList.subarray(0,l),a.residueStore.length=h,a.residueStore.count=h,a.residueStore.chainIndex=A,a.residueStore.residueTypeId=s.groupTypeList,a.residueStore.atomOffset=M,a.residueStore.atomCount=P,a.residueStore.resno=s.groupIdList.subarray(0,h),a.residueStore.sstruc=s.secStructList.subarray(0,h),a.residueStore.inscode=s.insCodeList.subarray(0,h),a.chainStore.length=d,a.chainStore.count=d,a.chainStore.entityIndex=new Uint16Array(d),a.chainStore.modelIndex=C,a.chainStore.residueOffset=T,a.chainStore.residueCount=E,a.chainStore.chainname=s.chainNameList.subarray(0,4*d),a.chainStore.chainid=s.chainIdList.subarray(0,4*d),a.modelStore.length=f,a.modelStore.count=f,a.modelStore.chainOffset=I,a.modelStore.chainCount=L;var H={};for(e=0,i=s.groupList.length;e<i;++e){var W=s.groupList[e],X=[];for(r=0,n=W.atomNameList.length;r<n;++r){var q=W.elementList[r].toUpperCase(),Y=W.atomNameList[r];X.push(a.atomMap.add(Y,q))}var Z=W.chemCompType.toUpperCase(),K=Dg.includes(Z),Q=W.bondOrderList.length,J=new Array(Q),tt=new Array(Q);for(r=0;r<Q;++r)J[r]=W.bondAtomList[2*r],tt[r]=W.bondAtomList[2*r+1];var et={atomIndices1:J,atomIndices2:tt,bondOrders:W.bondOrderList};H[e]=a.residueMap.add(W.groupName,X,K,Z,et)}for(e=0,i=h;e<i;++e)a.residueStore.residueTypeId[e]=H[a.residueStore.residueTypeId[e]];for(e=0,i=a.atomStore.count;e<i;++e){var it=a.atomStore.residueIndex[e],rt=a.residueMap.list[a.residueStore.residueTypeId[it]],nt=a.residueStore.atomOffset[it];a.atomStore.atomTypeId[e]=rt.atomTypeIdList[e-nt]}if(s.secStructList){var ot=s.secStructList.length;for(e=0,i=a.residueStore.count;e<i;++e){var at=jb[a.residueStore.sstruc[e%ot]];void 0!==at&&(a.residueStore.sstruc[e]=at)}}if(s.entityList&&s.entityList.forEach(function(t,e){a.entityList[e]=new Pb(a,e,t.description,t.type,t.chainIndexList)}),s.bioAssemblyList&&s.bioAssemblyList.forEach(function(t,e){var i=e+1,r=new ov(i);a.biomolDict["BU"+i]=r;var n={};t.transformList.forEach(function(t){var e=(new p).fromArray(t.matrix).transpose(),i=t.chainIndexList.map(function(t){for(var e="",i=0;i<4;++i){var r=s.chainNameList[4*t+i];if(!r)break;e+=String.fromCharCode(r)}return e}),o=n[i];o?o.matrixList.push(e):n[i]=r.addPart([e],i)})}),s.ncsOperatorList){var st="NCS",ct=new ov(st),ut=ct.addPart();s.ncsOperatorList.forEach(function(t){var e=(new p).fromArray(t).transpose();ut.matrixList.push(e)}),ut.matrixList.length>0&&(a.biomolDict[st]=ct)}var lt=s.unitCell;lt&&Array.isArray(lt)&&lt[0]?a.unitcell=new Ab({a:lt[0],b:lt[1],c:lt[2],alpha:lt[3],beta:lt[4],gamma:lt[5],spacegroup:s.spaceGroup}):a.unitcell=void 0,go(a,!0),mo(a,!0),a.finalizeAtoms(),a.finalizeBonds(),vo(a),t.Debug&&qp.timeEnd("MmtfParser._parse "+this.name)},Object.defineProperties(i.prototype,r),i}(Sb);tm.add("mmtf",$b);var Vb=function(t,e){this.name=t,this.path=e,this.coordinates=[],this.boxes=[]},Gb={type:{}};Gb.type.get=function(){return"Frames"},Object.defineProperties(Vb.prototype,Gb);var Hb=function(t){function e(e,i){t.call(this,e,i),this.frames=new Vb(this.name,this.path)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},__objName:{}};return i.type.get=function(){return"trajectory"},i.__objName.get=function(){return"frames"},Object.defineProperties(e.prototype,i),e}(_b),Wb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"dcd"},i.prototype._parse=function(){t.Debug&&qp.time("DcdParser._parse "+this.name);var e=this.streamer.data;e instanceof Uint8Array&&(e=e.buffer);var i,r,n=new DataView(e),o=this.frames,a=o.coordinates,s=o.boxes,c={},u=0,l=new Int32Array(e,0,23),h=l[0]!==n.getInt32(0);if(84!==l[0])for(r=e.byteLength,i=0;i<r;i+=4)n.setFloat32(i,n.getFloat32(i),!0);84!==l[0]&&qp.error("dcd bad format, header block start");var d=String.fromCharCode(n.getUint8(4),n.getUint8(5),n.getUint8(6),n.getUint8(7));"CORD"!==d&&qp.error("dcd bad format, format string");var f=!1,p=!1,m=!1;0!==l[22]&&(f=!0,0!==l[12]&&(p=!0),1===l[13]&&(m=!0)),c.NSET=l[2],c.ISTART=l[3],c.NSAVC=l[4],c.NAMNF=l[10],f?c.DELTA=n.getFloat32(44,h):c.DELTA=n.getFloat64(44,h),84!==l[22]&&qp.error("dcd bad format, header block end"),u=u+84+8;var g=n.getInt32(u,h),v=u+1;if((g-4)%80!==0&&qp.error("dcd bad format, title block start"),c.TITLE=nr(new Uint8Array(e,v,g)),n.getInt32(v+g+4-1,h)!==g&&qp.error("dcd bad format, title block end"),u=u+g+8,4!==n.getInt32(u,h)&&qp.error("dcd bad format, natom block start"),c.NATOM=n.getInt32(u+4,h),4!==n.getInt32(u+8,h)&&qp.error("dcd bad format, natom block end"),u=u+4+8,c.NAMNF>0)return void qp.error("dcd format with fixed atoms unsupported, aborting");var y=c.NATOM,b=4*y;for(i=0,r=c.NSET;i<r;++i){if(p){u+=4;var x=new Float32Array(9);x[0]=n.getFloat64(u,h),x[4]=n.getFloat64(u+16,h),x[8]=n.getFloat64(u+40,h),s.push(x),u+=48,u+=4}for(var _=new Float32Array(3*y),w=0;w<3;++w){n.getInt32(u,h)!==b&&qp.error("dcd bad format, coord block start",i,w),u+=4;for(var S=new Float32Array(e,u,y),A=0;A<y;++A)_[3*A+w]=S[A];u+=b,n.getInt32(u,h)!==b&&qp.error("dcd bad format, coord block end",i,w),u+=4}if(a.push(_),m){var M=n.getInt32(u,h);u+=4+M+4}}t.Debug&&qp.timeEnd("DcdParser._parse "+this.name)},Object.defineProperties(i.prototype,r),i}(Hb);tm.add("dcd",Wb);var Xb=function(t){function e(e,i){var r=i||{};t.call(this,e,r),this.volume=new Vo(this.name,this.path),this.voxelSize=Hi(r.voxelSize,1)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},__objName:{}};return i.type.get=function(){return"volume"},i.__objName.get=function(){return"volume"},e.prototype._afterParse=function(){this.volume.setMatrix(this.getMatrix())},e.prototype.getMatrix=function(){return new p},Object.defineProperties(e.prototype,i),e}(_b),qb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"mrc"},i.prototype._parse=function(){t.Debug&&qp.time("MrcParser._parse "+this.name);var e=this.streamer.data;e instanceof Uint8Array&&(e=e.buffer);var i=this.volume,r={},n=new Int32Array(e,0,56),o=new Float32Array(e,0,56),a=new DataView(e);if(r.MAP=String.fromCharCode(a.getUint8(208),a.getUint8(209),a.getUint8(210),a.getUint8(211)),r.MACHST=[a.getUint8(212),a.getUint8(213)],17===r.MACHST[0]&&17===r.MACHST[1])for(var s=e.byteLength,c=0;c<s;c+=4)a.setFloat32(c,a.getFloat32(c),!0);r.NX=n[0],r.NY=n[1],r.NZ=n[2],r.MODE=n[3],r.NXSTART=n[4],r.NYSTART=n[5],r.NZSTART=n[6],r.MX=n[7],r.MY=n[8],r.MZ=n[9],r.xlen=o[10]*this.voxelSize,r.ylen=o[11]*this.voxelSize,r.zlen=o[12]*this.voxelSize,r.alpha=o[13],r.beta=o[14],r.gamma=o[15],r.MAPC=n[16],r.MAPR=n[17],r.MAPS=n[18],r.DMIN=o[19],r.DMAX=o[20],r.DMEAN=o[21],r.ISPG=n[22],r.NSYMBT=n[23],r.LSKFLG=n[24],r.originX=o[49],r.originY=o[50],r.originZ=o[51],r.ARMS=o[54],i.header=r;var u;if(2===r.MODE)u=new Float32Array(e,1024+r.NSYMBT,r.NX*r.NY*r.NZ);else if(0===r.MODE){u=new Float32Array(new Int8Array(e,1024+r.NSYMBT,r.NX*r.NY*r.NZ));var l=1,h=0;if(n[39]===-128&&127===n[40]){l=(r.DMAX-r.DMIN)/255,h=.5*(r.DMIN+r.DMAX+l);for(var d=0,f=u.length;d<f;++d)u[d]=l*u[d]+h}}else qp.error("MrcParser unknown mode",r.MODE);i.setData(u,r.NX,r.NY,r.NZ),t.Debug&&qp.timeEnd("MrcParser._parse "+this.name)},i.prototype.getMatrix=function(){var t=this.volume.header,e=[t.xlen,0,0],i=[t.ylen*Math.cos(Math.PI/180*t.gamma),t.ylen*Math.sin(Math.PI/180*t.gamma),0],r=[t.zlen*Math.cos(Math.PI/180*t.beta),t.zlen*(Math.cos(Math.PI/180*t.alpha)-Math.cos(Math.PI/180*t.gamma)*Math.cos(Math.PI/180*t.beta))/Math.sin(Math.PI/180*t.gamma),0];r[2]=Math.sqrt(t.zlen*t.zlen*Math.sin(Math.PI/180*t.beta)*Math.sin(Math.PI/180*t.beta)-r[1]*r[1]);var n=[0,e,i,r],o=[0,t.MX,t.MY,t.MZ],a=[0,t.MAPC,t.MAPR,t.MAPS],s=new p;return s.set(n[a[1]][0]/o[a[1]],n[a[2]][0]/o[a[2]],n[a[3]][0]/o[a[3]],0,n[a[1]][1]/o[a[1]],n[a[2]][1]/o[a[2]],n[a[3]][1]/o[a[3]],0,n[a[1]][2]/o[a[1]],n[a[2]][2]/o[a[2]],n[a[3]][2]/o[a[3]],0,0,0,0,1),s.setPosition(new g(t.originX,t.originY,t.originZ)),s.multiply((new p).makeTranslation(t.NXSTART,t.NYSTART,t.NZSTART)),s},Object.defineProperties(i.prototype,r),i}(Xb);tm.add("mrc",qb),tm.add("ccp4",qb),tm.add("map",qb);var Yb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"cube"},i.prototype._parse=function(){function e(t,e){var i=n[t].trim().split(a)[e];return parseFloat(i)}function i(t,e,i){for(var r=t;r<e;++r){var n=i[r].trim();if(""!==n&&h>=o.atomCount+6+d){n=n.split(a);for(var s=0,c=n.length;s<c;++s)1!==n.length&&(u[l]=parseFloat(n[s]),++l)}++h}}t.Debug&&qp.time("CubeParser._parse "+this.name);var r=this.volume,n=this.streamer.peekLines(6),o={},a=/\s+/,s=.529177210859,c=s*this.voxelSize;o.atomCount=Math.abs(e(2,0)),o.originX=e(2,1)*s,o.originY=e(2,2)*s,o.originZ=e(2,3)*s,o.NVX=e(3,0),o.NVY=e(4,0),o.NVZ=e(5,0),o.basisX=new g(e(3,1),e(3,2),e(3,3)).multiplyScalar(c),o.basisY=new g(e(4,1),e(4,2),e(4,3)).multiplyScalar(c),o.basisZ=new g(e(5,1),e(5,2),e(5,3)).multiplyScalar(c);var u=new Float32Array(o.NVX*o.NVY*o.NVZ),l=0,h=0,d=e(2,0)>0?0:1;this.streamer.eachChunkOfLines(function(t){i(0,t.length,t)}),r.header=o,r.setData(u,o.NVZ,o.NVY,o.NVX),t.Debug&&qp.timeEnd("CubeParser._parse "+this.name)},i.prototype.getMatrix=function(){var t=this.volume.header,e=new p;return e.multiply((new p).makeTranslation(t.originX,t.originY,t.originZ)),e.multiply((new p).makeBasis(t.basisZ,t.basisY,t.basisX)),e},Object.defineProperties(i.prototype,r),i}(Xb);tm.add("cub",Yb),tm.add("cube",Yb);var Zb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"dsn6"},i.prototype._parse=function(){t.Debug&&qp.time("Dsn6Parser._parse "+this.name);var e=this.streamer.data;e instanceof Uint8Array&&(e=e.buffer);var i,r,n=this.volume,o={},a=new Int16Array(e),s=new Uint8Array(e),c=String.fromCharCode.apply(null,s.subarray(0,512));if(c.startsWith(":-)"))o.xStart=parseInt(c.substr(10,5)),o.yStart=parseInt(c.substr(15,5)),o.zStart=parseInt(c.substr(20,5)),o.xExtent=parseInt(c.substr(32,5)),o.yExtent=parseInt(c.substr(38,5)),o.zExtent=parseInt(c.substr(42,5)),o.xRate=parseInt(c.substr(52,5)),o.yRate=parseInt(c.substr(58,5)),o.zRate=parseInt(c.substr(62,5)),o.xlen=parseFloat(c.substr(73,10))*this.voxelSize,o.ylen=parseFloat(c.substr(83,10))*this.voxelSize,o.zlen=parseFloat(c.substr(93,10))*this.voxelSize,o.alpha=parseFloat(c.substr(103,10)),o.beta=parseFloat(c.substr(113,10)),o.gamma=parseFloat(c.substr(123,10)),i=parseFloat(c.substr(138,12))/100,r=parseInt(c.substr(155,8));else{if(100!==a[18])for(var u=0,l=a.length;u<l;++u){var h=a[u];a[u]=(255&h)<<8|h>>8&255}o.xStart=a[0],o.yStart=a[1],o.zStart=a[2],o.xExtent=a[3],o.yExtent=a[4],o.zExtent=a[5],o.xRate=a[6],o.yRate=a[7],o.zRate=a[8];var d=1/a[17],f=d*this.voxelSize;o.xlen=a[9]*f,o.ylen=a[10]*f,o.zlen=a[11]*f,o.alpha=a[12]*d,o.beta=a[13]*d,o.gamma=a[14]*d,i=a[15]/100,r=a[16]}n.header=o,qp.log(o,i,r);for(var p=new Float32Array(o.xExtent*o.yExtent*o.zExtent),m=512,g=Math.ceil(o.xExtent/8),v=Math.ceil(o.yExtent/8),y=Math.ceil(o.zExtent/8),b=0;b<y;++b)for(var x=0;x<v;++x)for(var _=0;_<g;++_)for(var w=0;w<8;++w)for(var S=8*b+w,A=0;A<8;++A)for(var M=8*x+A,P=0;P<8;++P){var C=8*_+P;if(!(C<o.xExtent&&M<o.yExtent&&S<o.zExtent)){m+=8-P;break}var T=(C*o.yExtent+M)*o.zExtent+S;p[T]=(s[m]-r)/i,++m}n.setData(p,o.zExtent,o.yExtent,o.xExtent),t.Debug&&qp.timeEnd("Dsn6Parser._parse "+this.name)},i.prototype.getMatrix=function(){var t=this.volume.header,e=[t.xlen,0,0],i=[t.ylen*Math.cos(Math.PI/180*t.gamma),t.ylen*Math.sin(Math.PI/180*t.gamma),0],r=[t.zlen*Math.cos(Math.PI/180*t.beta),t.zlen*(Math.cos(Math.PI/180*t.alpha)-Math.cos(Math.PI/180*t.gamma)*Math.cos(Math.PI/180*t.beta))/Math.sin(Math.PI/180*t.gamma),0];r[2]=Math.sqrt(t.zlen*t.zlen*Math.sin(Math.PI/180*t.beta)*Math.sin(Math.PI/180*t.beta)-r[1]*r[1]);var n=[0,e,i,r],o=[0,t.xRate,t.yRate,t.zRate],a=[0,1,2,3],s=new p;return s.set(n[a[1]][0]/o[a[1]],n[a[2]][0]/o[a[2]],n[a[3]][0]/o[a[3]],0,n[a[1]][1]/o[a[1]],n[a[2]][1]/o[a[2]],n[a[3]][1]/o[a[3]],0,n[a[1]][2]/o[a[1]],n[a[2]][2]/o[a[2]],n[a[3]][2]/o[a[3]],0,0,0,0,1),s.multiply((new p).makeRotationY(mr(90))),s.multiply((new p).makeTranslation(-t.zStart,t.yStart,t.xStart)),s.multiply((new p).makeScale(-1,1,1)),s},Object.defineProperties(i.prototype,r),i}(Xb);tm.add("dsn6",Zb),tm.add("brix",Zb);var Kb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"dx"},i.prototype._parse=function(){function e(t,e,i){for(var r=t;r<e;++r){if(l<c&&h>a){var n=i[r].trim();if(""!==n)for(var o=n.split(s),d=0,f=o.length;d<f;++d)u[l]=parseFloat(o[d]),++l}++h}}t.Debug&&qp.time("DxParser._parse "+this.name);var i=this.volume,r=this.streamer.peekLines(30),n=this.parseHeaderLines(r),o=this.volume.header,a=n.dataLineStart,s=/\s+/,c=o.nx*o.ny*o.nz,u=new Float32Array(c),l=0,h=0;this.streamer.eachChunkOfLines(function(t){e(0,t.length,t)}),i.setData(u,o.nz,o.ny,o.nx),t.Debug&&qp.timeEnd("DxParser._parse "+this.name)},i.prototype.parseHeaderLines=function(t){for(var e=this,i={},r=/\s+/,n=t.length,o=0,a=0,s=0,c=0;c<n;++c){var u,l=t[c];if(l.startsWith("object 1"))u=l.split(r),i.nx=parseInt(u[5]),i.ny=parseInt(u[6]),i.nz=parseInt(u[7]);else if(l.startsWith("origin"))u=l.split(r),i.xmin=parseFloat(u[1]),i.ymin=parseFloat(u[2]),i.zmin=parseFloat(u[3]);else if(l.startsWith("delta"))u=l.split(r),0===s?i.hx=parseFloat(u[1])*e.voxelSize:1===s?i.hy=parseFloat(u[2])*e.voxelSize:2===s&&(i.hz=parseFloat(u[3])*e.voxelSize),s+=1;else if(l.startsWith("object 3")){o=c,a+=l.length+1;break}a+=l.length+1}return this.volume.header=i,{dataLineStart:o,headerByteCount:a}},i.prototype.getMatrix=function(){var t=this.volume.header,e=new p;return e.multiply((new p).makeRotationY(mr(90))),e.multiply((new p).makeTranslation(-t.zmin,t.ymin,t.xmin)),e.multiply((new p).makeScale(-t.hz,t.hy,t.hx)),e},Object.defineProperties(i.prototype,r),i}(Xb);tm.add("dx",Kb);var Qb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"dxbin"},i.prototype._parse=function(){t.Debug&&qp.time("DxbinParser._parse "+this.name);var e=this.streamer.data;e instanceof Uint8Array&&(e=e.buffer);for(var i=or(new Uint8Array(e,0,1e3)),r=this.parseHeaderLines(i),n=this.volume.header,o=r.headerByteCount,a=n.nx*n.ny*n.nz,s=new DataView(e),c=new Float32Array(a),u=0;u<a;++u)c[u]=s.getFloat64(8*u+o,!0);this.volume.setData(c,n.nz,n.ny,n.nx),t.Debug&&qp.timeEnd("DxbinParser._parse "+this.name)},Object.defineProperties(i.prototype,r),i}(Kb);tm.add("dxbin",Qb);var Jb=function(e){function i(){e.apply(this,arguments)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{}};return r.type.get=function(){return"xplor"},i.prototype._parse=function(){function e(t){return t.trim().split(s).map(parseFloat)}function i(t,e,i){for(var r=t;r<e;++r){var n=i[r];if(v>=c&&(v-c)%y!==0&&g<p)for(var o=0,a=6;o<a;++o)m[g]=parseFloat(n.substr(12*o,12)),++g;++v}}t.Debug&&qp.time("XplorParser._parse "+this.name);var r,n=this.volume,o=this.streamer.peekLines(8),a={},s=/\s+/;r=o[2].startsWith("REMARKS")?parseInt(o[1].substring(0,8))+2:5;var c=r+3,u=e(o[r]);a.NA=u[0],a.AMIN=u[1],a.AMAX=u[2],a.NB=u[3],a.BMIN=u[4],a.BMAX=u[5],a.NC=u[6],a.CMIN=u[7],a.CMAX=u[8];var l=e(o[r+1]);a.a=l[0]*this.voxelSize,a.b=l[1]*this.voxelSize,a.c=l[2]*this.voxelSize,a.alpha=l[3],a.beta=l[4],a.gamma=l[5];var h=a.AMAX-a.AMIN+1,d=a.BMAX-a.BMIN+1,f=a.CMAX-a.CMIN+1,p=h*d*f,m=new Float32Array(p),g=0,v=0,y=1+h*d/6;this.streamer.eachChunkOfLines(function(t){i(0,t.length,t)}),n.header=a,n.setData(m,h,d,f),t.Debug&&qp.timeEnd("XplorParser._parse "+this.name)},i.prototype.getMatrix=function(){var t=this.volume.header,e=[t.a,0,0],i=[t.b*Math.cos(Math.PI/180*t.gamma),t.b*Math.sin(Math.PI/180*t.gamma),0],r=[t.c*Math.cos(Math.PI/180*t.beta),t.c*(Math.cos(Math.PI/180*t.alpha)-Math.cos(Math.PI/180*t.gamma)*Math.cos(Math.PI/180*t.beta))/Math.sin(Math.PI/180*t.gamma),0];r[2]=Math.sqrt(t.c*t.c*Math.sin(Math.PI/180*t.beta)*Math.sin(Math.PI/180*t.beta)-r[1]*r[1]);var n=[0,e,i,r],o=[0,t.NA,t.NB,t.NC],a=[0,1,2,3],s=new p;return s.set(n[a[1]][0]/o[a[1]],n[a[2]][0]/o[a[2]],n[a[3]][0]/o[a[3]],0,n[a[1]][1]/o[a[1]],n[a[2]][1]/o[a[2]],n[a[3]][1]/o[a[3]],0,n[a[1]][2]/o[a[1]],n[a[2]][2]/o[a[2]],n[a[3]][2]/o[a[3]],0,0,0,0,1),s.multiply((new p).makeTranslation(t.AMIN,t.BMIN,t.CMIN)),s},Object.defineProperties(i.prototype,r),i}(Xb);tm.add("xplor",Jb),tm.add("cns",Jb);var tx=function(t){function e(e,i){t.call(this,e,i),this.loader=this.getLoader(),this.surface=new Lo(this.name,this.path)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},__objName:{}};return i.type.get=function(){return"surface"},i.__objName.get=function(){return"surface"},e.prototype._parse=function(){var t=this.loader.parse(this.streamer.asText());this.surface.fromGeometry(t)},Object.defineProperties(e.prototype,i),e}(_b);Os.prototype={constructor:Os,setPropertyNameMapping:function(t){this.propertyNameMapping=t},bin2str:function(t){for(var e=new Uint8Array(t),i="",r=0;r<t.byteLength;r++)i+=String.fromCharCode(e[r]);return i},isASCII:function(t){var e=this.parseHeader(this.bin2str(t));return"ascii"===e.format},parse:function(t){return t instanceof ArrayBuffer?this.isASCII(t)?this.parseASCII(this.bin2str(t)):this.parseBinary(t):this.parseASCII(t)},parseHeader:function(t){function e(t,e){var i={type:t[0]};return"list"===i.type?(i.name=t[3],i.countType=t[1],i.itemType=t[2]):i.name=t[1],i.name in e&&(i.name=e[i.name]),i}var i=this,r=/ply([\s\S]*)end_header\s/,n="",o=0,a=r.exec(t);null!==a&&(n=a[1],o=a[0].length);for(var s,c,u,l={comments:[],elements:[],headerLength:o},h=n.split("\n"),d=0;d<h.length;d++){var f=h[d];if(f=f.trim(),""!==f)switch(u=f.split(/\s+/),c=u.shift(),f=u.join(" "),c){case"format":l.format=u[0],l.version=u[1];break;case"comment":l.comments.push(f);break;case"element":void 0!==s&&l.elements.push(s),s={},s.name=u[0],s.count=parseInt(u[1]),s.properties=[];break;case"property":s.properties.push(e(u,i.propertyNameMapping));break;default:console.log("unhandled",c,u)}}return void 0!==s&&l.elements.push(s),l},parseASCIINumber:function(t,e){switch(e){case"char":case"uchar":case"short":case"ushort":case"int":case"uint":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":return parseInt(t);case"float":case"double":case"float32":case"float64":return parseFloat(t)}},parseASCIIElement:function(t,e){for(var i=this,r=e.split(/\s+/),n={},o=0;o<t.length;o++)if("list"===t[o].type){for(var a=[],s=i.parseASCIINumber(r.shift(),t[o].countType),c=0;c<s;c++)a.push(i.parseASCIINumber(r.shift(),t[o].itemType));n[t[o].name]=a}else n[t[o].name]=i.parseASCIINumber(r.shift(),t[o].type);return n},parseASCII:function(t){var e,i=this,r=new zt,n=this.parseHeader(t),o=/end_header\s([\s\S]*)$/,a="";null!==(e=o.exec(t))&&(a=e[1]);var s=a.split("\n"),c=0,u=0;r.useColor=!1;for(var l=0;l<s.length;l++){var h=s[l];if(h=h.trim(),""!==h){u>=n.elements[c].count&&(c++,u=0);var d=i.parseASCIIElement(n.elements[c].properties,h);i.handleElement(r,n.elements[c].name,d),u++}}return this.postProcess(r)},postProcess:function(t){if(t.useColor){for(var e=0;e<t.faces.length;e++)t.faces[e].vertexColors=[t.colors[t.faces[e].a],t.colors[t.faces[e].b],t.colors[t.faces[e].c]];t.elementsNeedUpdate=!0}return t.computeBoundingSphere(),t},handleElement:function(t,e,i){if("vertex"===e){if(t.vertices.push(new g(i.x,i.y,i.z)),"red"in i&&"green"in i&&"blue"in i){t.useColor=!0;var r=new ct;r.setRGB(i.red/255,i.green/255,i.blue/255),t.colors.push(r)}}else if("face"===e){var n=i.vertex_indices;3===n.length?t.faces.push(new Dt(n[0],n[1],n[2])):4===n.length&&t.faces.push(new Dt(n[0],n[1],n[3]),new Dt(n[1],n[2],n[3]))}},binaryRead:function(t,e,i,r){switch(i){case"int8":case"char":return[t.getInt8(e),1];case"uint8":case"uchar":return[t.getUint8(e),1];case"int16":case"short":return[t.getInt16(e,r),2];case"uint16":case"ushort":return[t.getUint16(e,r),2];case"int32":case"int":return[t.getInt32(e,r),4];case"uint32":case"uint":return[t.getUint32(e,r),4];case"float32":case"float":return[t.getFloat32(e,r),4];case"float64":case"double":return[t.getFloat64(e,r),8]}},binaryReadElement:function(t,e,i,r){for(var n,o=this,a={},s=0,c=0;c<i.length;c++)if("list"===i[c].type){var u=[];n=o.binaryRead(t,e+s,i[c].countType,r);var l=n[0];s+=n[1];for(var h=0;h<l;h++)n=o.binaryRead(t,e+s,i[c].itemType,r),u.push(n[0]),s+=n[1];a[i[c].name]=u}else n=o.binaryRead(t,e+s,i[c].type,r),a[i[c].name]=n[0],s+=n[1];return[a,s]},parseBinary:function(t){for(var e,i=this,r=new zt,n=this.parseHeader(this.bin2str(t)),o="binary_little_endian"===n.format,a=new DataView(t,n.headerLength),s=0,c=0;c<n.elements.length;c++)for(var u=0;u<n.elements[c].count;u++){e=i.binaryReadElement(a,s,n.elements[c].properties,o),s+=e[1];var l=e[0];i.handleElement(r,n.elements[c].name,l)}return this.postProcess(r)}};var ex=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"ply"},e.prototype.getLoader=function(){return new Os},Object.defineProperties(e.prototype,i),e}(tx);tm.add("ply",ex),Ds.prototype={constructor:Ds,setPath:function(t){this.path=t},_createParserState:function(){var t={objects:[],object:{},vertices:[],normals:[],startObject:function(t,e){return this.object&&this.object.fromDeclaration===!1?(this.object.name=t,void(this.object.fromDeclaration=e!==!1)):(this.object={name:t||"",geometry:{vertices:[],normals:[]},fromDeclaration:e!==!1},void this.objects.push(this.object))},parseVertexIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseNormalIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},addVertex:function(t,e,i){var r=this.vertices,n=this.object.geometry.vertices;n.push(r[t+0]),n.push(r[t+1]),n.push(r[t+2]),n.push(r[e+0]),n.push(r[e+1]),n.push(r[e+2]),n.push(r[i+0]),n.push(r[i+1]),n.push(r[i+2])},addVertexLine:function(t){var e=this.vertices,i=this.object.geometry.vertices;i.push(e[t+0]),i.push(e[t+1]),i.push(e[t+2])},addNormal:function(t,e,i){var r=this.normals,n=this.object.geometry.normals;n.push(r[t+0]),n.push(r[t+1]),n.push(r[t+2]),n.push(r[e+0]),n.push(r[e+1]),n.push(r[e+2]),n.push(r[i+0]),n.push(r[i+1]),n.push(r[i+2])},addFace:function(t,e,i,r,n,o,a,s){var c,u=this.vertices.length,l=this.parseVertexIndex(t,u),h=this.parseVertexIndex(e,u),d=this.parseVertexIndex(i,u);if(void 0===r?this.addVertex(l,h,d):(c=this.parseVertexIndex(r,u),this.addVertex(l,h,c),this.addVertex(h,d,c)),void 0!==n){var f=this.normals.length;l=this.parseNormalIndex(n,f),h=n===o?l:this.parseNormalIndex(o,f),d=n===a?l:this.parseNormalIndex(a,f),void 0===r?this.addNormal(l,h,d):(c=this.parseNormalIndex(s,f),this.addNormal(l,h,c),this.addNormal(h,d,c))}},addLineGeometry:function(t){var e=this;this.object.geometry.type="Line";for(var i=this.vertices.length,r=0,n=t.length;r<n;r++)e.addVertexLine(e.parseVertexIndex(t[r],i))}};return t.startObject("",!1),t},parse:function(t){var e=this,i=this._createParserState();t.indexOf("\r\n")!==-1&&(t=t.replace(/\r\n/g,"\n")),t.indexOf("\\\n")!==-1&&(t=t.replace(/\\\n/g,""));var r,n,o=t.split("\n"),a="",s="",c="",u=0,l=[],h="function"==typeof"".trimLeft;for(r=0,n=o.length;r<n;r++)if(a=o[r],a=h?a.trimLeft():a.trim(),u=a.length,0!==u&&(s=a.charAt(0),"#"!==s))if("v"===s){if(c=a.charAt(1)," "===c&&null!==(l=e.regexp.vertex_pattern.exec(a)))i.vertices.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));else if("n"===c&&null!==(l=e.regexp.normal_pattern.exec(a)))i.normals.push(parseFloat(l[1]),parseFloat(l[2]),parseFloat(l[3]));else if("t"!==c||null===(l=e.regexp.uv_pattern.exec(a)))throw new Error("Unexpected vertex/normal/uv line: '"+a+"'")}else if("f"===s)if(null!==(l=e.regexp.face_vertex_uv_normal.exec(a)))i.addFace(l[1],l[4],l[7],l[10],l[3],l[6],l[9],l[12]);else if(null!==(l=e.regexp.face_vertex_uv.exec(a)));else if(null!==(l=e.regexp.face_vertex_normal.exec(a)))i.addFace(l[1],l[3],l[5],l[7],l[2],l[4],l[6],l[8]);else{if(null===(l=e.regexp.face_vertex.exec(a)))throw new Error("Unexpected face line: '"+a+"'");i.addFace(l[1],l[2],l[3],l[4])}else if("l"===s){var d=a.substring(1).trim().split(" "),f=[],p=[];if(a.indexOf("/")===-1)f=d;else for(var m=0,g=d.length;m<g;m++){var v=d[m].split("/");""!==v[0]&&f.push(v[0]),""!==v[1]&&p.push(v[1])}i.addLineGeometry(f,p)}else if(null!==(l=e.regexp.object_pattern.exec(a))){var y=l[0].substr(1).trim();i.startObject(y)}else if(e.regexp.material_use_pattern.test(a));else if(e.regexp.material_library_pattern.test(a));else if(null===(l=e.regexp.smoothing_pattern.exec(a))){if("\0"===a)continue;throw new Error("Unexpected line: '"+a+"'")}var b=[];for(r=0,n=i.objects.length;r<n;r++){var x=i.objects[r],_=x.geometry;if(0!==_.vertices.length){var w=new $t;w.addAttribute("position",new Rt(new Float32Array(_.vertices),3)),_.normals.length>0?w.addAttribute("normal",new Rt(new Float32Array(_.normals),3)):w.computeVertexNormals(),b.push(w)}}return b}};var ix=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{}};return i.type.get=function(){return"obj"},e.prototype.getLoader=function(){return new Ds},Object.defineProperties(e.prototype,i),e}(tx);tm.add("obj",ix);var rx=function(t){function e(e,i){t.call(this,e,i),this.text={name:this.name,path:this.path,data:""}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},__objName:{}};return i.type.get=function(){return"text"},i.__objName.get=function(){return"text"},e.prototype._parse=function(){this.text.data=this.streamer.asText()},Object.defineProperties(e.prototype,i),e}(_b);tm.add("txt",rx),tm.add("text",rx);var nx=function(t){function e(e,i){
	t.call(this,e,i),this.table={name:this.name,path:this.path,colNames:[],data:[]}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},__objName:{}};return i.type.get=function(){return"csv"},i.__objName.get=function(){return"table"},e.prototype._parse=function(){var t=this.table.data,e=/\s*,\s*/;this.streamer.eachChunkOfLines(function(i,r){for(var n=this,o=i.length,a=0;a<o;++a){var s=i[a].trim(),c=s.split(e);0===r&&0===a?n.table.colNames=c:s&&t.push(c)}}.bind(this))},Object.defineProperties(e.prototype,i),e}(_b);tm.add("csv",nx);var ox=function(t){function e(e,i){var r=i||{};t.call(this,e,r),this.string=Hi(r.string,!1),this.json={name:this.name,path:this.path,data:{}}}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={type:{},__objName:{}};return i.type.get=function(){return"json"},i.__objName.get=function(){return"json"},e.prototype._parse=function(){this.streamer.isBinary()||this.string?this.json.data=JSON.parse(this.streamer.asText()):this.json.data=this.streamer.data},Object.defineProperties(e.prototype,i),e}(_b);tm.add("json",ox);var ax=/^['"]|['"]$/g,sx=/^<([\w-:.]+)\s*/,cx=/^([^<]*)/,ux=/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/,lx=function(e){function i(t,i){var r=i||{};e.call(this,t,r),this.useDomParser=Hi(r.useDomParser,!1),this.xml={name:this.name,path:this.path,data:{}}}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={type:{},__objName:{}};return r.type.get=function(){return"xml"},r.__objName.get=function(){return"xml"},i.prototype.__xmlParser=function(t){return ks(t)},i.prototype.__domParser=function(t){var e=new window.DOMParser;return e.parseFromString(t,"text/xml")},i.prototype._parse=function(){t.Debug&&qp.time("XmlParser._parse "+this.name),this.useDomParser?this.streamer.data instanceof Document?this.xml.data=this.streamer.data:this.xml.data=this.__domParser(this.streamer.asText()):this.xml.data=this.__xmlParser(this.streamer.asText()),t.Debug&&qp.timeEnd("XmlParser._parse "+this.name)},Object.defineProperties(i.prototype,r),i}(_b);tm.add("xml",lx);var hx=function(t,e){this.name=t,this.path=e,this.rsrzDict={},this.rsccDict={},this.clashDict={},this.geoDict={},this.geoAtomDict={},this.atomDict={},this.clashSele="NONE"};hx.prototype.fromXml=function(e){t.Debug&&qp.time("Validation.fromXml");var i=this.rsrzDict,r=this.rsccDict,n=this.clashDict,o=this.geoDict,a=this.geoAtomDict,s=this.atomDict,c=e.getElementsByTagName("ModelledSubgroup"),u={},l=[];t.Debug&&qp.time("Validation.fromXml#clashDict");for(var h=0,d=c.length;h<d;++h){var f=c[h],p=f.attributes,m=Fs(p);void 0!==p.rsrz&&(i[m]=parseFloat(p.rsrz.value)),void 0!==p.rscc&&(r[m]=parseFloat(p.rscc.value)),p.sele=m;for(var g=f.getElementsByTagName("clash"),v=0,y=g.length;v<y;++v){var b=g[v].attributes,x=b.atom.value;if("H"!==yo(x)){var _=b.cid.value,w=Fs(p,x,!0);if(s[w]=!0,void 0===u[_])u[_]={sele1:w,res1:m};else{var S=u[_];S.res1!==m&&(S.sele2=w,S.res2=m,l.push(S.res1,m),n[_]=S)}}}}t.Debug&&qp.timeEnd("Validation.fromXml#clashDict");for(var A=0,M=c.length;A<M;++A){var P=c[A],C=P.attributes,T=C.sele,E="."!==C.seq.value;if(E){var I=js(n,P,C);I>0&&(o[T]=I)}else{var L=P.getElementsByTagName("clash"),R=P.getElementsByTagName("mog-bond-outlier"),O=P.getElementsByTagName("mog-angle-outlier");if(R.length>0||O.length>0||L.length>0){var D={};a[T]=D;for(var N=0,k=L.length;N<k;++N){var F=L[N].attributes;n[F.cid.value]&&Bs(D,F.atom.value,1)}for(var B=0,z=R.length;B<z;++B){var U=R[B].attributes;U.atoms.value.split(",").forEach(function(t){Bs(D,t,2)})}for(var j=0,$=O.length;j<$;++j){var V=O[j].attributes;V.atoms.value.split(",").forEach(function(t){Bs(D,t,4)})}}}}this.clashSele=l.length?l.join(" OR "):"NONE",t.Debug&&qp.timeEnd("Validation.fromXml")},hx.prototype.getClashData=function(e){t.Debug&&qp.time("Validation.getClashData");var i=e||{},r=i.structure,n=r.atomSet,o=new ct(Hi(i.color,"#f0027f")),a=r.getAtomProxy(),s=r.getAtomProxy(),c=new g,u=new g,l=new g,h=this.clashDict,d=Object.keys(h).length,f=new Float32Array(3*d),p=new Float32Array(3*d),m=qr(d,o.r,o.g,o.b),v=new Float32Array(d);t.Debug&&qp.time("Validation.getClashData#atomDict");var y=this.atomDict;r.eachAtom(function(t){var e=Us(t);y[e]===!0&&(y[e]=t.index)}),t.Debug&&qp.timeEnd("Validation.getClashData#atomDict");var b=0;for(var x in h){var _=h[x];if(a.index=y[_.sele1],s.index=y[_.sele2],n.has(a.index)&&n.has(s.index)&&void 0!==a.index&&void 0!==s.index){c.subVectors(s,a).setLength(a.vdw),u.copy(a).add(c),c.subVectors(a,s).setLength(s.vdw),l.copy(s).add(c);var w=a.distanceTo(s)/2,S=Math.sqrt(a.vdw*a.vdw-w*w),A=Math.sqrt(s.vdw*s.vdw-w*w);u.toArray(f,3*b),l.toArray(p,3*b),v[b]=(S+A)/2,++b}}return t.Debug&&qp.timeEnd("Validation.getClashData"),{position1:f.subarray(0,3*b),position2:p.subarray(0,3*b),color:m.subarray(0,3*b),color2:m.subarray(0,3*b),radius:v.subarray(0,b)}};var dx=function(e){function i(t,i){var r=i||{};e.call(this,t,r),this.useDomParser=!0,this.validation=new hx(this.name,this.path)}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var r={__objName:{}};return r.__objName.get=function(){return"validation"},i.prototype._parse=function(){e.prototype._parse.call(this),t.Debug&&qp.time("ValidationParser._parse "+this.name),this.validation.fromXml(this.xml.data),t.Debug&&qp.timeEnd("ValidationParser._parse "+this.name)},Object.defineProperties(i.prototype,r),i}(lx);tm.add("validation",dx);var fx,px,mx=Xs(),gx=30,vx=12,yx=15,bx=852,xx=592,_x=0,wx=1,Sx=2,Ax=[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,0,0],Mx=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Px=[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,0,0],Cx=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],Tx=0,Ex=1,Ix=2,Lx=4,Rx=5,Ox=6,Dx=0,Nx=1,kx=2,Fx=-2,Bx=-3,zx=-4,Ux=-5,jx=8,$x=1,Vx=2,Gx=3,Hx=4,Wx=5,Xx=6,qx=7,Yx=8,Zx=9,Kx=10,Qx=11,Jx=12,t_=13,e_=14,i_=15,r_=16,n_=17,o_=18,a_=19,s_=20,c_=21,u_=22,l_=23,h_=24,d_=25,f_=26,p_=27,m_=28,g_=29,v_=30,y_=31,b_=32,x_=852,__=592,w_=!0,S_=!0,A_=!0;try{String.fromCharCode.apply(null,[0])}catch(t){S_=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){A_=!1}for(var M_=new Uint8Array(256),P_=0;P_<256;P_++)M_[P_]=P_>=252?6:P_>=248?5:P_>=240?4:P_>=224?3:P_>=192?2:1;M_[254]=M_[254]=1;var C_=0,T_=2,E_=4,I_=0,L_=1,R_=2,O_=-5,D_={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},N_=Object.prototype.toString;gc.prototype.push=function(t,e){var i,r,n,o,a,s,c=this,u=this.strm,l=this.options.chunkSize,h=this.options.dictionary,d=!1;if(this.ended)return!1;r=e===~~e?e:e===!0?E_:C_,"string"==typeof t?u.input=hc(t):"[object ArrayBuffer]"===N_.call(t)?u.input=new Uint8Array(t):u.input=t,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new Uint8Array(l),u.next_out=0,u.avail_out=l),i=oc(u,C_),i===R_&&h&&(s="string"==typeof h?uc(h):"[object ArrayBuffer]"===N_.call(h)?new Uint8Array(h):h,i=cc(c.strm,s)),i===O_&&d===!0&&(i=I_,d=!1),i!==L_&&i!==I_)return c.onEnd(i),c.ended=!0,!1;u.next_out&&(0!==u.avail_out&&i!==L_&&(0!==u.avail_in||r!==E_&&r!==T_)||("string"===c.options.to?(n=fc(u.output,u.next_out),o=u.next_out-n,a=dc(u.output,n),u.next_out=o,u.avail_out=l-o,o&&Gs(u.output,u.output,n,o,0),c.onData(a)):c.onData(Vs(u.output,u.next_out)))),0===u.avail_in&&0===u.avail_out&&(d=!0)}while((u.avail_in>0||0===u.avail_out)&&i!==L_);return i===L_&&(r=E_),r===E_?(i=ac(this.strm),this.onEnd(i),this.ended=!0,i===I_):r!==T_||(this.onEnd(I_),u.avail_out=0,!0)},gc.prototype.onData=function(t){this.chunks.push(t)},gc.prototype.onEnd=function(t){t===I_&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Hs(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},im.add("gz",yc);var k_="//files.rcsb.org/download/",F_="//mmtf.rcsb.org/v1.0/",B_=F_+"full/",z_=F_+"reduced/";Qp.add("rcsb",new bc);var U_="//pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/",j_="/SDF?record_type=3d";Qp.add("pubchem",new xc),Qp.add("ftp",new _c),Qp.add("http",new _c),Qp.add("https",new _c);var $_="0.10.0-dev.9";"undefined"==typeof window||window.Promise||(window.Promise=r),t.Version=$_,t.setDebug=Lr,t.DatasourceRegistry=Qp,t.StaticDatasource=wc,t.ParserRegistry=tm,t.autoLoad=kr,t.RepresentationRegistry=Jp,t.ColormakerRegistry=Kp,t.Colormaker=Bp,t.Selection=Tr,t.PdbWriter=Ur,t.Stage=hy,t.Collection=sy,t.ComponentCollection=cy,t.RepresentationCollection=uy,t.Assembly=ov,t.TrajectoryPlayer=dy,t.superpose=ga,t.guessElement=yo,t.Queue=Go,t.Counter=mm,t.throttle=Ki,t.download=Yi,t.getQuery=Vi,t.getDataInfo=Nr,t.getFileInfo=Zi,t.uniqueArray=rr,t.BufferRepresentation=ra,t.SphereBuffer=Ko,t.EllipsoidBuffer=Qo,t.CylinderBuffer=Jo,t.ConeBuffer=ta,t.ArrowBuffer=Xv,t.TextBuffer=ub,t.Shape=ea,t.Kdtree=ao,t.SpatialHash=qn,t.Signal=Cr,t.Matrix3=dt,t.Matrix4=p,t.Vector2=h,t.Vector3=g,t.Box3=lt,t.Quaternion=m,t.Plane=ft,t.Color=ct,Object.defineProperty(t,"__esModule",{value:!0})});
	
	/* WEBPACK VAR INJECTION */}.call(exports, __jupyter_require__('timers-browserify@2.0.2/main.js').setImmediate))
})
/** END DEFINE BLOCK for ngl@0.10.0-dev.9/dist/ngl.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/draggable.js **/
jupyter.define('jquery-ui@1.12.1/ui/widgets/draggable.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Draggable 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Draggable
	//>>group: Interactions
	//>>description: Enables dragging functionality for any element.
	//>>docs: http://api.jqueryui.com/draggable/
	//>>demos: http://jqueryui.com/draggable/
	//>>css.structure: ../../themes/base/draggable.css
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
				__jupyter_require__('jquery@2.2.4/dist/jquery.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widgets/mouse.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/data.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/plugin.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/safe-active-element.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/safe-blur.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/scroll-parent.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/version.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widget.js')
			], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	
	$.widget( "ui.draggable", $.ui.mouse, {
		version: "1.12.1",
		widgetEventPrefix: "drag",
		options: {
			addClasses: true,
			appendTo: "parent",
			axis: false,
			connectToSortable: false,
			containment: false,
			cursor: "auto",
			cursorAt: false,
			grid: false,
			handle: false,
			helper: "original",
			iframeFix: false,
			opacity: false,
			refreshPositions: false,
			revert: false,
			revertDuration: 500,
			scope: "default",
			scroll: true,
			scrollSensitivity: 20,
			scrollSpeed: 20,
			snap: false,
			snapMode: "both",
			snapTolerance: 20,
			stack: false,
			zIndex: false,
	
			// Callbacks
			drag: null,
			start: null,
			stop: null
		},
		_create: function() {
	
			if ( this.options.helper === "original" ) {
				this._setPositionRelative();
			}
			if ( this.options.addClasses ) {
				this._addClass( "ui-draggable" );
			}
			this._setHandleClassName();
	
			this._mouseInit();
		},
	
		_setOption: function( key, value ) {
			this._super( key, value );
			if ( key === "handle" ) {
				this._removeHandleClassName();
				this._setHandleClassName();
			}
		},
	
		_destroy: function() {
			if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
				this.destroyOnClear = true;
				return;
			}
			this._removeHandleClassName();
			this._mouseDestroy();
		},
	
		_mouseCapture: function( event ) {
			var o = this.options;
	
			// Among others, prevent a drag on a resizable-handle
			if ( this.helper || o.disabled ||
					$( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) {
				return false;
			}
	
			//Quit if we're not on a valid handle
			this.handle = this._getHandle( event );
			if ( !this.handle ) {
				return false;
			}
	
			this._blurActiveElement( event );
	
			this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
	
			return true;
	
		},
	
		_blockFrames: function( selector ) {
			this.iframeBlocks = this.document.find( selector ).map( function() {
				var iframe = $( this );
	
				return $( "<div>" )
					.css( "position", "absolute" )
					.appendTo( iframe.parent() )
					.outerWidth( iframe.outerWidth() )
					.outerHeight( iframe.outerHeight() )
					.offset( iframe.offset() )[ 0 ];
			} );
		},
	
		_unblockFrames: function() {
			if ( this.iframeBlocks ) {
				this.iframeBlocks.remove();
				delete this.iframeBlocks;
			}
		},
	
		_blurActiveElement: function( event ) {
			var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
				target = $( event.target );
	
			// Don't blur if the event occurred on an element that is within
			// the currently focused element
			// See #10527, #12472
			if ( target.closest( activeElement ).length ) {
				return;
			}
	
			// Blur any element that currently has focus, see #4261
			$.ui.safeBlur( activeElement );
		},
	
		_mouseStart: function( event ) {
	
			var o = this.options;
	
			//Create and append the visible helper
			this.helper = this._createHelper( event );
	
			this._addClass( this.helper, "ui-draggable-dragging" );
	
			//Cache the helper size
			this._cacheHelperProportions();
	
			//If ddmanager is used for droppables, set the global draggable
			if ( $.ui.ddmanager ) {
				$.ui.ddmanager.current = this;
			}
	
			/*
			 * - Position generation -
			 * This block generates everything position related - it's the core of draggables.
			 */
	
			//Cache the margins of the original element
			this._cacheMargins();
	
			//Store the helper's css position
			this.cssPosition = this.helper.css( "position" );
			this.scrollParent = this.helper.scrollParent( true );
			this.offsetParent = this.helper.offsetParent();
			this.hasFixedAncestor = this.helper.parents().filter( function() {
					return $( this ).css( "position" ) === "fixed";
				} ).length > 0;
	
			//The element's absolute position on the page minus margins
			this.positionAbs = this.element.offset();
			this._refreshOffsets( event );
	
			//Generate the original position
			this.originalPosition = this.position = this._generatePosition( event, false );
			this.originalPageX = event.pageX;
			this.originalPageY = event.pageY;
	
			//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
			( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) );
	
			//Set a containment if given in the options
			this._setContainment();
	
			//Trigger event + callbacks
			if ( this._trigger( "start", event ) === false ) {
				this._clear();
				return false;
			}
	
			//Recache the helper size
			this._cacheHelperProportions();
	
			//Prepare the droppable offsets
			if ( $.ui.ddmanager && !o.dropBehaviour ) {
				$.ui.ddmanager.prepareOffsets( this, event );
			}
	
			// Execute the drag once - this causes the helper not to be visible before getting its
			// correct position
			this._mouseDrag( event, true );
	
			// If the ddmanager is used for droppables, inform the manager that dragging has started
			// (see #5003)
			if ( $.ui.ddmanager ) {
				$.ui.ddmanager.dragStart( this, event );
			}
	
			return true;
		},
	
		_refreshOffsets: function( event ) {
			this.offset = {
				top: this.positionAbs.top - this.margins.top,
				left: this.positionAbs.left - this.margins.left,
				scroll: false,
				parent: this._getParentOffset(),
				relative: this._getRelativeOffset()
			};
	
			this.offset.click = {
				left: event.pageX - this.offset.left,
				top: event.pageY - this.offset.top
			};
		},
	
		_mouseDrag: function( event, noPropagation ) {
	
			// reset any necessary cached properties (see #5009)
			if ( this.hasFixedAncestor ) {
				this.offset.parent = this._getParentOffset();
			}
	
			//Compute the helpers position
			this.position = this._generatePosition( event, true );
			this.positionAbs = this._convertPositionTo( "absolute" );
	
			//Call plugins and callbacks and use the resulting position if something is returned
			if ( !noPropagation ) {
				var ui = this._uiHash();
				if ( this._trigger( "drag", event, ui ) === false ) {
					this._mouseUp( new $.Event( "mouseup", event ) );
					return false;
				}
				this.position = ui.position;
			}
	
			this.helper[ 0 ].style.left = this.position.left + "px";
			this.helper[ 0 ].style.top = this.position.top + "px";
	
			if ( $.ui.ddmanager ) {
				$.ui.ddmanager.drag( this, event );
			}
	
			return false;
		},
	
		_mouseStop: function( event ) {
	
			//If we are using droppables, inform the manager about the drop
			var that = this,
				dropped = false;
			if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
				dropped = $.ui.ddmanager.drop( this, event );
			}
	
			//if a drop comes from outside (a sortable)
			if ( this.dropped ) {
				dropped = this.dropped;
				this.dropped = false;
			}
	
			if ( ( this.options.revert === "invalid" && !dropped ) ||
					( this.options.revert === "valid" && dropped ) ||
					this.options.revert === true || ( $.isFunction( this.options.revert ) &&
					this.options.revert.call( this.element, dropped ) )
			) {
				$( this.helper ).animate(
					this.originalPosition,
					parseInt( this.options.revertDuration, 10 ),
					function() {
						if ( that._trigger( "stop", event ) !== false ) {
							that._clear();
						}
					}
				);
			} else {
				if ( this._trigger( "stop", event ) !== false ) {
					this._clear();
				}
			}
	
			return false;
		},
	
		_mouseUp: function( event ) {
			this._unblockFrames();
	
			// If the ddmanager is used for droppables, inform the manager that dragging has stopped
			// (see #5003)
			if ( $.ui.ddmanager ) {
				$.ui.ddmanager.dragStop( this, event );
			}
	
			// Only need to focus if the event occurred on the draggable itself, see #10527
			if ( this.handleElement.is( event.target ) ) {
	
				// The interaction is over; whether or not the click resulted in a drag,
				// focus the element
				this.element.trigger( "focus" );
			}
	
			return $.ui.mouse.prototype._mouseUp.call( this, event );
		},
	
		cancel: function() {
	
			if ( this.helper.is( ".ui-draggable-dragging" ) ) {
				this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
			} else {
				this._clear();
			}
	
			return this;
	
		},
	
		_getHandle: function( event ) {
			return this.options.handle ?
				!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
				true;
		},
	
		_setHandleClassName: function() {
			this.handleElement = this.options.handle ?
				this.element.find( this.options.handle ) : this.element;
			this._addClass( this.handleElement, "ui-draggable-handle" );
		},
	
		_removeHandleClassName: function() {
			this._removeClass( this.handleElement, "ui-draggable-handle" );
		},
	
		_createHelper: function( event ) {
	
			var o = this.options,
				helperIsFunction = $.isFunction( o.helper ),
				helper = helperIsFunction ?
					$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
					( o.helper === "clone" ?
						this.element.clone().removeAttr( "id" ) :
						this.element );
	
			if ( !helper.parents( "body" ).length ) {
				helper.appendTo( ( o.appendTo === "parent" ?
					this.element[ 0 ].parentNode :
					o.appendTo ) );
			}
	
			// Http://bugs.jqueryui.com/ticket/9446
			// a helper function can return the original element
			// which wouldn't have been set to relative in _create
			if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
				this._setPositionRelative();
			}
	
			if ( helper[ 0 ] !== this.element[ 0 ] &&
					!( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
				helper.css( "position", "absolute" );
			}
	
			return helper;
	
		},
	
		_setPositionRelative: function() {
			if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
				this.element[ 0 ].style.position = "relative";
			}
		},
	
		_adjustOffsetFromHelper: function( obj ) {
			if ( typeof obj === "string" ) {
				obj = obj.split( " " );
			}
			if ( $.isArray( obj ) ) {
				obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
			}
			if ( "left" in obj ) {
				this.offset.click.left = obj.left + this.margins.left;
			}
			if ( "right" in obj ) {
				this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
			}
			if ( "top" in obj ) {
				this.offset.click.top = obj.top + this.margins.top;
			}
			if ( "bottom" in obj ) {
				this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
			}
		},
	
		_isRootNode: function( element ) {
			return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
		},
	
		_getParentOffset: function() {
	
			//Get the offsetParent and cache its position
			var po = this.offsetParent.offset(),
				document = this.document[ 0 ];
	
			// This is a special case where we need to modify a offset calculated on start, since the
			// following happened:
			// 1. The position of the helper is absolute, so it's position is calculated based on the
			// next positioned parent
			// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
			// the document, which means that the scroll is included in the initial calculation of the
			// offset of the parent, and never recalculated upon drag
			if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document &&
					$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
				po.left += this.scrollParent.scrollLeft();
				po.top += this.scrollParent.scrollTop();
			}
	
			if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
				po = { top: 0, left: 0 };
			}
	
			return {
				top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
				left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
			};
	
		},
	
		_getRelativeOffset: function() {
			if ( this.cssPosition !== "relative" ) {
				return { top: 0, left: 0 };
			}
	
			var p = this.element.position(),
				scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
	
			return {
				top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
					( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
				left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
					( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
			};
	
		},
	
		_cacheMargins: function() {
			this.margins = {
				left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ),
				top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
				right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ),
				bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 )
			};
		},
	
		_cacheHelperProportions: function() {
			this.helperProportions = {
				width: this.helper.outerWidth(),
				height: this.helper.outerHeight()
			};
		},
	
		_setContainment: function() {
	
			var isUserScrollable, c, ce,
				o = this.options,
				document = this.document[ 0 ];
	
			this.relativeContainer = null;
	
			if ( !o.containment ) {
				this.containment = null;
				return;
			}
	
			if ( o.containment === "window" ) {
				this.containment = [
					$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
					$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
					$( window ).scrollLeft() + $( window ).width() -
						this.helperProportions.width - this.margins.left,
					$( window ).scrollTop() +
						( $( window ).height() || document.body.parentNode.scrollHeight ) -
						this.helperProportions.height - this.margins.top
				];
				return;
			}
	
			if ( o.containment === "document" ) {
				this.containment = [
					0,
					0,
					$( document ).width() - this.helperProportions.width - this.margins.left,
					( $( document ).height() || document.body.parentNode.scrollHeight ) -
						this.helperProportions.height - this.margins.top
				];
				return;
			}
	
			if ( o.containment.constructor === Array ) {
				this.containment = o.containment;
				return;
			}
	
			if ( o.containment === "parent" ) {
				o.containment = this.helper[ 0 ].parentNode;
			}
	
			c = $( o.containment );
			ce = c[ 0 ];
	
			if ( !ce ) {
				return;
			}
	
			isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
	
			this.containment = [
				( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
					( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
				( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
					( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
				( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
					( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
					( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
					this.helperProportions.width -
					this.margins.left -
					this.margins.right,
				( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
					( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
					( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
					this.helperProportions.height -
					this.margins.top -
					this.margins.bottom
			];
			this.relativeContainer = c;
		},
	
		_convertPositionTo: function( d, pos ) {
	
			if ( !pos ) {
				pos = this.position;
			}
	
			var mod = d === "absolute" ? 1 : -1,
				scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
	
			return {
				top: (
	
					// The absolute mouse position
					pos.top	+
	
					// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.relative.top * mod +
	
					// The offsetParent's offset without borders (offset + border)
					this.offset.parent.top * mod -
					( ( this.cssPosition === "fixed" ?
						-this.offset.scroll.top :
						( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
				),
				left: (
	
					// The absolute mouse position
					pos.left +
	
					// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.relative.left * mod +
	
					// The offsetParent's offset without borders (offset + border)
					this.offset.parent.left * mod	-
					( ( this.cssPosition === "fixed" ?
						-this.offset.scroll.left :
						( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
				)
			};
	
		},
	
		_generatePosition: function( event, constrainPosition ) {
	
			var containment, co, top, left,
				o = this.options,
				scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
				pageX = event.pageX,
				pageY = event.pageY;
	
			// Cache the scroll
			if ( !scrollIsRootNode || !this.offset.scroll ) {
				this.offset.scroll = {
					top: this.scrollParent.scrollTop(),
					left: this.scrollParent.scrollLeft()
				};
			}
	
			/*
			 * - Position constraining -
			 * Constrain the position to a mix of grid, containment.
			 */
	
			// If we are not dragging yet, we won't check for options
			if ( constrainPosition ) {
				if ( this.containment ) {
					if ( this.relativeContainer ) {
						co = this.relativeContainer.offset();
						containment = [
							this.containment[ 0 ] + co.left,
							this.containment[ 1 ] + co.top,
							this.containment[ 2 ] + co.left,
							this.containment[ 3 ] + co.top
						];
					} else {
						containment = this.containment;
					}
	
					if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
						pageX = containment[ 0 ] + this.offset.click.left;
					}
					if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
						pageY = containment[ 1 ] + this.offset.click.top;
					}
					if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
						pageX = containment[ 2 ] + this.offset.click.left;
					}
					if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
						pageY = containment[ 3 ] + this.offset.click.top;
					}
				}
	
				if ( o.grid ) {
	
					//Check for grid elements set to 0 to prevent divide by 0 error causing invalid
					// argument errors in IE (see ticket #6950)
					top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
						this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY;
					pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] ||
						top - this.offset.click.top > containment[ 3 ] ) ?
							top :
							( ( top - this.offset.click.top >= containment[ 1 ] ) ?
								top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;
	
					left = o.grid[ 0 ] ? this.originalPageX +
						Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] :
						this.originalPageX;
					pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] ||
						left - this.offset.click.left > containment[ 2 ] ) ?
							left :
							( ( left - this.offset.click.left >= containment[ 0 ] ) ?
								left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
				}
	
				if ( o.axis === "y" ) {
					pageX = this.originalPageX;
				}
	
				if ( o.axis === "x" ) {
					pageY = this.originalPageY;
				}
			}
	
			return {
				top: (
	
					// The absolute mouse position
					pageY -
	
					// Click offset (relative to the element)
					this.offset.click.top -
	
					// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.relative.top -
	
					// The offsetParent's offset without borders (offset + border)
					this.offset.parent.top +
					( this.cssPosition === "fixed" ?
						-this.offset.scroll.top :
						( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
				),
				left: (
	
					// The absolute mouse position
					pageX -
	
					// Click offset (relative to the element)
					this.offset.click.left -
	
					// Only for relative positioned nodes: Relative offset from element to offset parent
					this.offset.relative.left -
	
					// The offsetParent's offset without borders (offset + border)
					this.offset.parent.left +
					( this.cssPosition === "fixed" ?
						-this.offset.scroll.left :
						( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
				)
			};
	
		},
	
		_clear: function() {
			this._removeClass( this.helper, "ui-draggable-dragging" );
			if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) {
				this.helper.remove();
			}
			this.helper = null;
			this.cancelHelperRemoval = false;
			if ( this.destroyOnClear ) {
				this.destroy();
			}
		},
	
		// From now on bulk stuff - mainly helpers
	
		_trigger: function( type, event, ui ) {
			ui = ui || this._uiHash();
			$.ui.plugin.call( this, type, [ event, ui, this ], true );
	
			// Absolute position and offset (see #6884 ) have to be recalculated after plugins
			if ( /^(drag|start|stop)/.test( type ) ) {
				this.positionAbs = this._convertPositionTo( "absolute" );
				ui.offset = this.positionAbs;
			}
			return $.Widget.prototype._trigger.call( this, type, event, ui );
		},
	
		plugins: {},
	
		_uiHash: function() {
			return {
				helper: this.helper,
				position: this.position,
				originalPosition: this.originalPosition,
				offset: this.positionAbs
			};
		}
	
	} );
	
	$.ui.plugin.add( "draggable", "connectToSortable", {
		start: function( event, ui, draggable ) {
			var uiSortable = $.extend( {}, ui, {
				item: draggable.element
			} );
	
			draggable.sortables = [];
			$( draggable.options.connectToSortable ).each( function() {
				var sortable = $( this ).sortable( "instance" );
	
				if ( sortable && !sortable.options.disabled ) {
					draggable.sortables.push( sortable );
	
					// RefreshPositions is called at drag start to refresh the containerCache
					// which is used in drag. This ensures it's initialized and synchronized
					// with any changes that might have happened on the page since initialization.
					sortable.refreshPositions();
					sortable._trigger( "activate", event, uiSortable );
				}
			} );
		},
		stop: function( event, ui, draggable ) {
			var uiSortable = $.extend( {}, ui, {
				item: draggable.element
			} );
	
			draggable.cancelHelperRemoval = false;
	
			$.each( draggable.sortables, function() {
				var sortable = this;
	
				if ( sortable.isOver ) {
					sortable.isOver = 0;
	
					// Allow this sortable to handle removing the helper
					draggable.cancelHelperRemoval = true;
					sortable.cancelHelperRemoval = false;
	
					// Use _storedCSS To restore properties in the sortable,
					// as this also handles revert (#9675) since the draggable
					// may have modified them in unexpected ways (#8809)
					sortable._storedCSS = {
						position: sortable.placeholder.css( "position" ),
						top: sortable.placeholder.css( "top" ),
						left: sortable.placeholder.css( "left" )
					};
	
					sortable._mouseStop( event );
	
					// Once drag has ended, the sortable should return to using
					// its original helper, not the shared helper from draggable
					sortable.options.helper = sortable.options._helper;
				} else {
	
					// Prevent this Sortable from removing the helper.
					// However, don't set the draggable to remove the helper
					// either as another connected Sortable may yet handle the removal.
					sortable.cancelHelperRemoval = true;
	
					sortable._trigger( "deactivate", event, uiSortable );
				}
			} );
		},
		drag: function( event, ui, draggable ) {
			$.each( draggable.sortables, function() {
				var innermostIntersecting = false,
					sortable = this;
	
				// Copy over variables that sortable's _intersectsWith uses
				sortable.positionAbs = draggable.positionAbs;
				sortable.helperProportions = draggable.helperProportions;
				sortable.offset.click = draggable.offset.click;
	
				if ( sortable._intersectsWith( sortable.containerCache ) ) {
					innermostIntersecting = true;
	
					$.each( draggable.sortables, function() {
	
						// Copy over variables that sortable's _intersectsWith uses
						this.positionAbs = draggable.positionAbs;
						this.helperProportions = draggable.helperProportions;
						this.offset.click = draggable.offset.click;
	
						if ( this !== sortable &&
								this._intersectsWith( this.containerCache ) &&
								$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
							innermostIntersecting = false;
						}
	
						return innermostIntersecting;
					} );
				}
	
				if ( innermostIntersecting ) {
	
					// If it intersects, we use a little isOver variable and set it once,
					// so that the move-in stuff gets fired only once.
					if ( !sortable.isOver ) {
						sortable.isOver = 1;
	
						// Store draggable's parent in case we need to reappend to it later.
						draggable._parent = ui.helper.parent();
	
						sortable.currentItem = ui.helper
							.appendTo( sortable.element )
							.data( "ui-sortable-item", true );
	
						// Store helper option to later restore it
						sortable.options._helper = sortable.options.helper;
	
						sortable.options.helper = function() {
							return ui.helper[ 0 ];
						};
	
						// Fire the start events of the sortable with our passed browser event,
						// and our own helper (so it doesn't create a new one)
						event.target = sortable.currentItem[ 0 ];
						sortable._mouseCapture( event, true );
						sortable._mouseStart( event, true, true );
	
						// Because the browser event is way off the new appended portlet,
						// modify necessary variables to reflect the changes
						sortable.offset.click.top = draggable.offset.click.top;
						sortable.offset.click.left = draggable.offset.click.left;
						sortable.offset.parent.left -= draggable.offset.parent.left -
							sortable.offset.parent.left;
						sortable.offset.parent.top -= draggable.offset.parent.top -
							sortable.offset.parent.top;
	
						draggable._trigger( "toSortable", event );
	
						// Inform draggable that the helper is in a valid drop zone,
						// used solely in the revert option to handle "valid/invalid".
						draggable.dropped = sortable.element;
	
						// Need to refreshPositions of all sortables in the case that
						// adding to one sortable changes the location of the other sortables (#9675)
						$.each( draggable.sortables, function() {
							this.refreshPositions();
						} );
	
						// Hack so receive/update callbacks work (mostly)
						draggable.currentItem = draggable.element;
						sortable.fromOutside = draggable;
					}
	
					if ( sortable.currentItem ) {
						sortable._mouseDrag( event );
	
						// Copy the sortable's position because the draggable's can potentially reflect
						// a relative position, while sortable is always absolute, which the dragged
						// element has now become. (#8809)
						ui.position = sortable.position;
					}
				} else {
	
					// If it doesn't intersect with the sortable, and it intersected before,
					// we fake the drag stop of the sortable, but make sure it doesn't remove
					// the helper by using cancelHelperRemoval.
					if ( sortable.isOver ) {
	
						sortable.isOver = 0;
						sortable.cancelHelperRemoval = true;
	
						// Calling sortable's mouseStop would trigger a revert,
						// so revert must be temporarily false until after mouseStop is called.
						sortable.options._revert = sortable.options.revert;
						sortable.options.revert = false;
	
						sortable._trigger( "out", event, sortable._uiHash( sortable ) );
						sortable._mouseStop( event, true );
	
						// Restore sortable behaviors that were modfied
						// when the draggable entered the sortable area (#9481)
						sortable.options.revert = sortable.options._revert;
						sortable.options.helper = sortable.options._helper;
	
						if ( sortable.placeholder ) {
							sortable.placeholder.remove();
						}
	
						// Restore and recalculate the draggable's offset considering the sortable
						// may have modified them in unexpected ways. (#8809, #10669)
						ui.helper.appendTo( draggable._parent );
						draggable._refreshOffsets( event );
						ui.position = draggable._generatePosition( event, true );
	
						draggable._trigger( "fromSortable", event );
	
						// Inform draggable that the helper is no longer in a valid drop zone
						draggable.dropped = false;
	
						// Need to refreshPositions of all sortables just in case removing
						// from one sortable changes the location of other sortables (#9675)
						$.each( draggable.sortables, function() {
							this.refreshPositions();
						} );
					}
				}
			} );
		}
	} );
	
	$.ui.plugin.add( "draggable", "cursor", {
		start: function( event, ui, instance ) {
			var t = $( "body" ),
				o = instance.options;
	
			if ( t.css( "cursor" ) ) {
				o._cursor = t.css( "cursor" );
			}
			t.css( "cursor", o.cursor );
		},
		stop: function( event, ui, instance ) {
			var o = instance.options;
			if ( o._cursor ) {
				$( "body" ).css( "cursor", o._cursor );
			}
		}
	} );
	
	$.ui.plugin.add( "draggable", "opacity", {
		start: function( event, ui, instance ) {
			var t = $( ui.helper ),
				o = instance.options;
			if ( t.css( "opacity" ) ) {
				o._opacity = t.css( "opacity" );
			}
			t.css( "opacity", o.opacity );
		},
		stop: function( event, ui, instance ) {
			var o = instance.options;
			if ( o._opacity ) {
				$( ui.helper ).css( "opacity", o._opacity );
			}
		}
	} );
	
	$.ui.plugin.add( "draggable", "scroll", {
		start: function( event, ui, i ) {
			if ( !i.scrollParentNotHidden ) {
				i.scrollParentNotHidden = i.helper.scrollParent( false );
			}
	
			if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
					i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
				i.overflowOffset = i.scrollParentNotHidden.offset();
			}
		},
		drag: function( event, ui, i  ) {
	
			var o = i.options,
				scrolled = false,
				scrollParent = i.scrollParentNotHidden[ 0 ],
				document = i.document[ 0 ];
	
			if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
				if ( !o.axis || o.axis !== "x" ) {
					if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
							o.scrollSensitivity ) {
						scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
					} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
						scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
					}
				}
	
				if ( !o.axis || o.axis !== "y" ) {
					if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
							o.scrollSensitivity ) {
						scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
					} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
						scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
					}
				}
	
			} else {
	
				if ( !o.axis || o.axis !== "x" ) {
					if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) {
						scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed );
					} else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) <
							o.scrollSensitivity ) {
						scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed );
					}
				}
	
				if ( !o.axis || o.axis !== "y" ) {
					if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) {
						scrolled = $( document ).scrollLeft(
							$( document ).scrollLeft() - o.scrollSpeed
						);
					} else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) <
							o.scrollSensitivity ) {
						scrolled = $( document ).scrollLeft(
							$( document ).scrollLeft() + o.scrollSpeed
						);
					}
				}
	
			}
	
			if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
				$.ui.ddmanager.prepareOffsets( i, event );
			}
	
		}
	} );
	
	$.ui.plugin.add( "draggable", "snap", {
		start: function( event, ui, i ) {
	
			var o = i.options;
	
			i.snapElements = [];
	
			$( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap )
				.each( function() {
					var $t = $( this ),
						$o = $t.offset();
					if ( this !== i.element[ 0 ] ) {
						i.snapElements.push( {
							item: this,
							width: $t.outerWidth(), height: $t.outerHeight(),
							top: $o.top, left: $o.left
						} );
					}
				} );
	
		},
		drag: function( event, ui, inst ) {
	
			var ts, bs, ls, rs, l, r, t, b, i, first,
				o = inst.options,
				d = o.snapTolerance,
				x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
				y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
	
			for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {
	
				l = inst.snapElements[ i ].left - inst.margins.left;
				r = l + inst.snapElements[ i ].width;
				t = inst.snapElements[ i ].top - inst.margins.top;
				b = t + inst.snapElements[ i ].height;
	
				if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
						!$.contains( inst.snapElements[ i ].item.ownerDocument,
						inst.snapElements[ i ].item ) ) {
					if ( inst.snapElements[ i ].snapping ) {
						( inst.options.snap.release &&
							inst.options.snap.release.call(
								inst.element,
								event,
								$.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
							) );
					}
					inst.snapElements[ i ].snapping = false;
					continue;
				}
	
				if ( o.snapMode !== "inner" ) {
					ts = Math.abs( t - y2 ) <= d;
					bs = Math.abs( b - y1 ) <= d;
					ls = Math.abs( l - x2 ) <= d;
					rs = Math.abs( r - x1 ) <= d;
					if ( ts ) {
						ui.position.top = inst._convertPositionTo( "relative", {
							top: t - inst.helperProportions.height,
							left: 0
						} ).top;
					}
					if ( bs ) {
						ui.position.top = inst._convertPositionTo( "relative", {
							top: b,
							left: 0
						} ).top;
					}
					if ( ls ) {
						ui.position.left = inst._convertPositionTo( "relative", {
							top: 0,
							left: l - inst.helperProportions.width
						} ).left;
					}
					if ( rs ) {
						ui.position.left = inst._convertPositionTo( "relative", {
							top: 0,
							left: r
						} ).left;
					}
				}
	
				first = ( ts || bs || ls || rs );
	
				if ( o.snapMode !== "outer" ) {
					ts = Math.abs( t - y1 ) <= d;
					bs = Math.abs( b - y2 ) <= d;
					ls = Math.abs( l - x1 ) <= d;
					rs = Math.abs( r - x2 ) <= d;
					if ( ts ) {
						ui.position.top = inst._convertPositionTo( "relative", {
							top: t,
							left: 0
						} ).top;
					}
					if ( bs ) {
						ui.position.top = inst._convertPositionTo( "relative", {
							top: b - inst.helperProportions.height,
							left: 0
						} ).top;
					}
					if ( ls ) {
						ui.position.left = inst._convertPositionTo( "relative", {
							top: 0,
							left: l
						} ).left;
					}
					if ( rs ) {
						ui.position.left = inst._convertPositionTo( "relative", {
							top: 0,
							left: r - inst.helperProportions.width
						} ).left;
					}
				}
	
				if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
					( inst.options.snap.snap &&
						inst.options.snap.snap.call(
							inst.element,
							event,
							$.extend( inst._uiHash(), {
								snapItem: inst.snapElements[ i ].item
							} ) ) );
				}
				inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
	
			}
	
		}
	} );
	
	$.ui.plugin.add( "draggable", "stack", {
		start: function( event, ui, instance ) {
			var min,
				o = instance.options,
				group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
					return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
						( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
				} );
	
			if ( !group.length ) { return; }
	
			min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
			$( group ).each( function( i ) {
				$( this ).css( "zIndex", min + i );
			} );
			this.css( "zIndex", ( min + group.length ) );
		}
	} );
	
	$.ui.plugin.add( "draggable", "zIndex", {
		start: function( event, ui, instance ) {
			var t = $( ui.helper ),
				o = instance.options;
	
			if ( t.css( "zIndex" ) ) {
				o._zIndex = t.css( "zIndex" );
			}
			t.css( "zIndex", o.zIndex );
		},
		stop: function( event, ui, instance ) {
			var o = instance.options;
	
			if ( o._zIndex ) {
				$( ui.helper ).css( "zIndex", o._zIndex );
			}
		}
	} );
	
	return $.ui.draggable;
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/draggable.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/data.js **/
jupyter.define('jquery-ui@1.12.1/ui/data.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI :data 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: :data Selector
	//>>group: Core
	//>>description: Selects elements which have data stored under the specified key.
	//>>docs: http://api.jqueryui.com/data-selector/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	return $.extend( $.expr[ ":" ], {
		data: $.expr.createPseudo ?
			$.expr.createPseudo( function( dataName ) {
				return function( elem ) {
					return !!$.data( elem, dataName );
				};
			} ) :
	
			// Support: jQuery <1.8
			function( elem, i, match ) {
				return !!$.data( elem, match[ 3 ] );
			}
	} );
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/data.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/plugin.js **/
jupyter.define('jquery-ui@1.12.1/ui/plugin.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	// $.ui.plugin is deprecated. Use $.widget() extensions instead.
	return $.ui.plugin = {
		add: function( module, option, set ) {
			var i,
				proto = $.ui[ module ].prototype;
			for ( i in set ) {
				proto.plugins[ i ] = proto.plugins[ i ] || [];
				proto.plugins[ i ].push( [ option, set[ i ] ] );
			}
		},
		call: function( instance, name, args, allowDisconnected ) {
			var i,
				set = instance.plugins[ name ];
	
			if ( !set ) {
				return;
			}
	
			if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
					instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
				return;
			}
	
			for ( i = 0; i < set.length; i++ ) {
				if ( instance.options[ set[ i ][ 0 ] ] ) {
					set[ i ][ 1 ].apply( instance.element, args );
				}
			}
		}
	};
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/plugin.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/safe-blur.js **/
jupyter.define('jquery-ui@1.12.1/ui/safe-blur.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	return $.ui.safeBlur = function( element ) {
	
		// Support: IE9 - 10 only
		// If the <body> is blurred, IE will switch windows, see #9420
		if ( element && element.nodeName.toLowerCase() !== "body" ) {
			$( element ).trigger( "blur" );
		}
	};
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/safe-blur.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/scroll-parent.js **/
jupyter.define('jquery-ui@1.12.1/ui/scroll-parent.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Scroll Parent 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: scrollParent
	//>>group: Core
	//>>description: Get the closest ancestor element that is scrollable.
	//>>docs: http://api.jqueryui.com/scrollParent/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	return $.fn.scrollParent = function( includeHidden ) {
		var position = this.css( "position" ),
			excludeStaticParent = position === "absolute",
			overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
			scrollParent = this.parents().filter( function() {
				var parent = $( this );
				if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
					return false;
				}
				return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
					parent.css( "overflow-x" ) );
			} ).eq( 0 );
	
		return position === "fixed" || !scrollParent.length ?
			$( this[ 0 ].ownerDocument || document ) :
			scrollParent;
	};
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/scroll-parent.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/safe-active-element.js **/
jupyter.define('jquery-ui@1.12.1/ui/safe-active-element.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	return $.ui.safeActiveElement = function( document ) {
		var activeElement;
	
		// Support: IE 9 only
		// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
		try {
			activeElement = document.activeElement;
		} catch ( error ) {
			activeElement = document.body;
		}
	
		// Support: IE 9 - 11 only
		// IE may return null instead of an element
		// Interestingly, this only seems to occur when NOT in an iframe
		if ( !activeElement ) {
			activeElement = document.body;
		}
	
		// Support: IE 11 only
		// IE11 returns a seemingly empty object in some cases when accessing
		// document.activeElement from an <iframe>
		if ( !activeElement.nodeName ) {
			activeElement = document.body;
		}
	
		return activeElement;
	};
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/safe-active-element.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/dialog.js **/
jupyter.define('jquery-ui@1.12.1/ui/widgets/dialog.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Dialog 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Dialog
	//>>group: Widgets
	//>>description: Displays customizable dialog windows.
	//>>docs: http://api.jqueryui.com/dialog/
	//>>demos: http://jqueryui.com/dialog/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/dialog.css
	//>>css.theme: ../../themes/base/theme.css
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
				__jupyter_require__('jquery@2.2.4/dist/jquery.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widgets/button.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widgets/draggable.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widgets/mouse.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widgets/resizable.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/focusable.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/keycode.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/position.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/safe-active-element.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/safe-blur.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/tabbable.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/unique-id.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/version.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widget.js')
			], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	
	$.widget( "ui.dialog", {
		version: "1.12.1",
		options: {
			appendTo: "body",
			autoOpen: true,
			buttons: [],
			classes: {
				"ui-dialog": "ui-corner-all",
				"ui-dialog-titlebar": "ui-corner-all"
			},
			closeOnEscape: true,
			closeText: "Close",
			draggable: true,
			hide: null,
			height: "auto",
			maxHeight: null,
			maxWidth: null,
			minHeight: 150,
			minWidth: 150,
			modal: false,
			position: {
				my: "center",
				at: "center",
				of: window,
				collision: "fit",
	
				// Ensure the titlebar is always visible
				using: function( pos ) {
					var topOffset = $( this ).css( pos ).offset().top;
					if ( topOffset < 0 ) {
						$( this ).css( "top", pos.top - topOffset );
					}
				}
			},
			resizable: true,
			show: null,
			title: null,
			width: 300,
	
			// Callbacks
			beforeClose: null,
			close: null,
			drag: null,
			dragStart: null,
			dragStop: null,
			focus: null,
			open: null,
			resize: null,
			resizeStart: null,
			resizeStop: null
		},
	
		sizeRelatedOptions: {
			buttons: true,
			height: true,
			maxHeight: true,
			maxWidth: true,
			minHeight: true,
			minWidth: true,
			width: true
		},
	
		resizableRelatedOptions: {
			maxHeight: true,
			maxWidth: true,
			minHeight: true,
			minWidth: true
		},
	
		_create: function() {
			this.originalCss = {
				display: this.element[ 0 ].style.display,
				width: this.element[ 0 ].style.width,
				minHeight: this.element[ 0 ].style.minHeight,
				maxHeight: this.element[ 0 ].style.maxHeight,
				height: this.element[ 0 ].style.height
			};
			this.originalPosition = {
				parent: this.element.parent(),
				index: this.element.parent().children().index( this.element )
			};
			this.originalTitle = this.element.attr( "title" );
			if ( this.options.title == null && this.originalTitle != null ) {
				this.options.title = this.originalTitle;
			}
	
			// Dialogs can't be disabled
			if ( this.options.disabled ) {
				this.options.disabled = false;
			}
	
			this._createWrapper();
	
			this.element
				.show()
				.removeAttr( "title" )
				.appendTo( this.uiDialog );
	
			this._addClass( "ui-dialog-content", "ui-widget-content" );
	
			this._createTitlebar();
			this._createButtonPane();
	
			if ( this.options.draggable && $.fn.draggable ) {
				this._makeDraggable();
			}
			if ( this.options.resizable && $.fn.resizable ) {
				this._makeResizable();
			}
	
			this._isOpen = false;
	
			this._trackFocus();
		},
	
		_init: function() {
			if ( this.options.autoOpen ) {
				this.open();
			}
		},
	
		_appendTo: function() {
			var element = this.options.appendTo;
			if ( element && ( element.jquery || element.nodeType ) ) {
				return $( element );
			}
			return this.document.find( element || "body" ).eq( 0 );
		},
	
		_destroy: function() {
			var next,
				originalPosition = this.originalPosition;
	
			this._untrackInstance();
			this._destroyOverlay();
	
			this.element
				.removeUniqueId()
				.css( this.originalCss )
	
				// Without detaching first, the following becomes really slow
				.detach();
	
			this.uiDialog.remove();
	
			if ( this.originalTitle ) {
				this.element.attr( "title", this.originalTitle );
			}
	
			next = originalPosition.parent.children().eq( originalPosition.index );
	
			// Don't try to place the dialog next to itself (#8613)
			if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
				next.before( this.element );
			} else {
				originalPosition.parent.append( this.element );
			}
		},
	
		widget: function() {
			return this.uiDialog;
		},
	
		disable: $.noop,
		enable: $.noop,
	
		close: function( event ) {
			var that = this;
	
			if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
				return;
			}
	
			this._isOpen = false;
			this._focusedElement = null;
			this._destroyOverlay();
			this._untrackInstance();
	
			if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) {
	
				// Hiding a focused element doesn't trigger blur in WebKit
				// so in case we have nothing to focus on, explicitly blur the active element
				// https://bugs.webkit.org/show_bug.cgi?id=47182
				$.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) );
			}
	
			this._hide( this.uiDialog, this.options.hide, function() {
				that._trigger( "close", event );
			} );
		},
	
		isOpen: function() {
			return this._isOpen;
		},
	
		moveToTop: function() {
			this._moveToTop();
		},
	
		_moveToTop: function( event, silent ) {
			var moved = false,
				zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() {
					return +$( this ).css( "z-index" );
				} ).get(),
				zIndexMax = Math.max.apply( null, zIndices );
	
			if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
				this.uiDialog.css( "z-index", zIndexMax + 1 );
				moved = true;
			}
	
			if ( moved && !silent ) {
				this._trigger( "focus", event );
			}
			return moved;
		},
	
		open: function() {
			var that = this;
			if ( this._isOpen ) {
				if ( this._moveToTop() ) {
					this._focusTabbable();
				}
				return;
			}
	
			this._isOpen = true;
			this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
	
			this._size();
			this._position();
			this._createOverlay();
			this._moveToTop( null, true );
	
			// Ensure the overlay is moved to the top with the dialog, but only when
			// opening. The overlay shouldn't move after the dialog is open so that
			// modeless dialogs opened after the modal dialog stack properly.
			if ( this.overlay ) {
				this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
			}
	
			this._show( this.uiDialog, this.options.show, function() {
				that._focusTabbable();
				that._trigger( "focus" );
			} );
	
			// Track the dialog immediately upon openening in case a focus event
			// somehow occurs outside of the dialog before an element inside the
			// dialog is focused (#10152)
			this._makeFocusTarget();
	
			this._trigger( "open" );
		},
	
		_focusTabbable: function() {
	
			// Set focus to the first match:
			// 1. An element that was focused previously
			// 2. First element inside the dialog matching [autofocus]
			// 3. Tabbable element inside the content element
			// 4. Tabbable element inside the buttonpane
			// 5. The close button
			// 6. The dialog itself
			var hasFocus = this._focusedElement;
			if ( !hasFocus ) {
				hasFocus = this.element.find( "[autofocus]" );
			}
			if ( !hasFocus.length ) {
				hasFocus = this.element.find( ":tabbable" );
			}
			if ( !hasFocus.length ) {
				hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
			}
			if ( !hasFocus.length ) {
				hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
			}
			if ( !hasFocus.length ) {
				hasFocus = this.uiDialog;
			}
			hasFocus.eq( 0 ).trigger( "focus" );
		},
	
		_keepFocus: function( event ) {
			function checkFocus() {
				var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
					isActive = this.uiDialog[ 0 ] === activeElement ||
						$.contains( this.uiDialog[ 0 ], activeElement );
				if ( !isActive ) {
					this._focusTabbable();
				}
			}
			event.preventDefault();
			checkFocus.call( this );
	
			// support: IE
			// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
			// so we check again later
			this._delay( checkFocus );
		},
	
		_createWrapper: function() {
			this.uiDialog = $( "<div>" )
				.hide()
				.attr( {
	
					// Setting tabIndex makes the div focusable
					tabIndex: -1,
					role: "dialog"
				} )
				.appendTo( this._appendTo() );
	
			this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" );
			this._on( this.uiDialog, {
				keydown: function( event ) {
					if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
							event.keyCode === $.ui.keyCode.ESCAPE ) {
						event.preventDefault();
						this.close( event );
						return;
					}
	
					// Prevent tabbing out of dialogs
					if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
						return;
					}
					var tabbables = this.uiDialog.find( ":tabbable" ),
						first = tabbables.filter( ":first" ),
						last = tabbables.filter( ":last" );
	
					if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) &&
							!event.shiftKey ) {
						this._delay( function() {
							first.trigger( "focus" );
						} );
						event.preventDefault();
					} else if ( ( event.target === first[ 0 ] ||
							event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) {
						this._delay( function() {
							last.trigger( "focus" );
						} );
						event.preventDefault();
					}
				},
				mousedown: function( event ) {
					if ( this._moveToTop( event ) ) {
						this._focusTabbable();
					}
				}
			} );
	
			// We assume that any existing aria-describedby attribute means
			// that the dialog content is marked up properly
			// otherwise we brute force the content as the description
			if ( !this.element.find( "[aria-describedby]" ).length ) {
				this.uiDialog.attr( {
					"aria-describedby": this.element.uniqueId().attr( "id" )
				} );
			}
		},
	
		_createTitlebar: function() {
			var uiDialogTitle;
	
			this.uiDialogTitlebar = $( "<div>" );
			this._addClass( this.uiDialogTitlebar,
				"ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" );
			this._on( this.uiDialogTitlebar, {
				mousedown: function( event ) {
	
					// Don't prevent click on close button (#8838)
					// Focusing a dialog that is partially scrolled out of view
					// causes the browser to scroll it into view, preventing the click event
					if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
	
						// Dialog isn't getting focus when dragging (#8063)
						this.uiDialog.trigger( "focus" );
					}
				}
			} );
	
			// Support: IE
			// Use type="button" to prevent enter keypresses in textboxes from closing the
			// dialog in IE (#9312)
			this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
				.button( {
					label: $( "<a>" ).text( this.options.closeText ).html(),
					icon: "ui-icon-closethick",
					showLabel: false
				} )
				.appendTo( this.uiDialogTitlebar );
	
			this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" );
			this._on( this.uiDialogTitlebarClose, {
				click: function( event ) {
					event.preventDefault();
					this.close( event );
				}
			} );
	
			uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar );
			this._addClass( uiDialogTitle, "ui-dialog-title" );
			this._title( uiDialogTitle );
	
			this.uiDialogTitlebar.prependTo( this.uiDialog );
	
			this.uiDialog.attr( {
				"aria-labelledby": uiDialogTitle.attr( "id" )
			} );
		},
	
		_title: function( title ) {
			if ( this.options.title ) {
				title.text( this.options.title );
			} else {
				title.html( "&#160;" );
			}
		},
	
		_createButtonPane: function() {
			this.uiDialogButtonPane = $( "<div>" );
			this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane",
				"ui-widget-content ui-helper-clearfix" );
	
			this.uiButtonSet = $( "<div>" )
				.appendTo( this.uiDialogButtonPane );
			this._addClass( this.uiButtonSet, "ui-dialog-buttonset" );
	
			this._createButtons();
		},
	
		_createButtons: function() {
			var that = this,
				buttons = this.options.buttons;
	
			// If we already have a button pane, remove it
			this.uiDialogButtonPane.remove();
			this.uiButtonSet.empty();
	
			if ( $.isEmptyObject( buttons ) || ( $.isArray( buttons ) && !buttons.length ) ) {
				this._removeClass( this.uiDialog, "ui-dialog-buttons" );
				return;
			}
	
			$.each( buttons, function( name, props ) {
				var click, buttonOptions;
				props = $.isFunction( props ) ?
					{ click: props, text: name } :
					props;
	
				// Default to a non-submitting button
				props = $.extend( { type: "button" }, props );
	
				// Change the context for the click callback to be the main element
				click = props.click;
				buttonOptions = {
					icon: props.icon,
					iconPosition: props.iconPosition,
					showLabel: props.showLabel,
	
					// Deprecated options
					icons: props.icons,
					text: props.text
				};
	
				delete props.click;
				delete props.icon;
				delete props.iconPosition;
				delete props.showLabel;
	
				// Deprecated options
				delete props.icons;
				if ( typeof props.text === "boolean" ) {
					delete props.text;
				}
	
				$( "<button></button>", props )
					.button( buttonOptions )
					.appendTo( that.uiButtonSet )
					.on( "click", function() {
						click.apply( that.element[ 0 ], arguments );
					} );
			} );
			this._addClass( this.uiDialog, "ui-dialog-buttons" );
			this.uiDialogButtonPane.appendTo( this.uiDialog );
		},
	
		_makeDraggable: function() {
			var that = this,
				options = this.options;
	
			function filteredUi( ui ) {
				return {
					position: ui.position,
					offset: ui.offset
				};
			}
	
			this.uiDialog.draggable( {
				cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
				handle: ".ui-dialog-titlebar",
				containment: "document",
				start: function( event, ui ) {
					that._addClass( $( this ), "ui-dialog-dragging" );
					that._blockFrames();
					that._trigger( "dragStart", event, filteredUi( ui ) );
				},
				drag: function( event, ui ) {
					that._trigger( "drag", event, filteredUi( ui ) );
				},
				stop: function( event, ui ) {
					var left = ui.offset.left - that.document.scrollLeft(),
						top = ui.offset.top - that.document.scrollTop();
	
					options.position = {
						my: "left top",
						at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
							"top" + ( top >= 0 ? "+" : "" ) + top,
						of: that.window
					};
					that._removeClass( $( this ), "ui-dialog-dragging" );
					that._unblockFrames();
					that._trigger( "dragStop", event, filteredUi( ui ) );
				}
			} );
		},
	
		_makeResizable: function() {
			var that = this,
				options = this.options,
				handles = options.resizable,
	
				// .ui-resizable has position: relative defined in the stylesheet
				// but dialogs have to use absolute or fixed positioning
				position = this.uiDialog.css( "position" ),
				resizeHandles = typeof handles === "string" ?
					handles :
					"n,e,s,w,se,sw,ne,nw";
	
			function filteredUi( ui ) {
				return {
					originalPosition: ui.originalPosition,
					originalSize: ui.originalSize,
					position: ui.position,
					size: ui.size
				};
			}
	
			this.uiDialog.resizable( {
				cancel: ".ui-dialog-content",
				containment: "document",
				alsoResize: this.element,
				maxWidth: options.maxWidth,
				maxHeight: options.maxHeight,
				minWidth: options.minWidth,
				minHeight: this._minHeight(),
				handles: resizeHandles,
				start: function( event, ui ) {
					that._addClass( $( this ), "ui-dialog-resizing" );
					that._blockFrames();
					that._trigger( "resizeStart", event, filteredUi( ui ) );
				},
				resize: function( event, ui ) {
					that._trigger( "resize", event, filteredUi( ui ) );
				},
				stop: function( event, ui ) {
					var offset = that.uiDialog.offset(),
						left = offset.left - that.document.scrollLeft(),
						top = offset.top - that.document.scrollTop();
	
					options.height = that.uiDialog.height();
					options.width = that.uiDialog.width();
					options.position = {
						my: "left top",
						at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
							"top" + ( top >= 0 ? "+" : "" ) + top,
						of: that.window
					};
					that._removeClass( $( this ), "ui-dialog-resizing" );
					that._unblockFrames();
					that._trigger( "resizeStop", event, filteredUi( ui ) );
				}
			} )
				.css( "position", position );
		},
	
		_trackFocus: function() {
			this._on( this.widget(), {
				focusin: function( event ) {
					this._makeFocusTarget();
					this._focusedElement = $( event.target );
				}
			} );
		},
	
		_makeFocusTarget: function() {
			this._untrackInstance();
			this._trackingInstances().unshift( this );
		},
	
		_untrackInstance: function() {
			var instances = this._trackingInstances(),
				exists = $.inArray( this, instances );
			if ( exists !== -1 ) {
				instances.splice( exists, 1 );
			}
		},
	
		_trackingInstances: function() {
			var instances = this.document.data( "ui-dialog-instances" );
			if ( !instances ) {
				instances = [];
				this.document.data( "ui-dialog-instances", instances );
			}
			return instances;
		},
	
		_minHeight: function() {
			var options = this.options;
	
			return options.height === "auto" ?
				options.minHeight :
				Math.min( options.minHeight, options.height );
		},
	
		_position: function() {
	
			// Need to show the dialog to get the actual offset in the position plugin
			var isVisible = this.uiDialog.is( ":visible" );
			if ( !isVisible ) {
				this.uiDialog.show();
			}
			this.uiDialog.position( this.options.position );
			if ( !isVisible ) {
				this.uiDialog.hide();
			}
		},
	
		_setOptions: function( options ) {
			var that = this,
				resize = false,
				resizableOptions = {};
	
			$.each( options, function( key, value ) {
				that._setOption( key, value );
	
				if ( key in that.sizeRelatedOptions ) {
					resize = true;
				}
				if ( key in that.resizableRelatedOptions ) {
					resizableOptions[ key ] = value;
				}
			} );
	
			if ( resize ) {
				this._size();
				this._position();
			}
			if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
				this.uiDialog.resizable( "option", resizableOptions );
			}
		},
	
		_setOption: function( key, value ) {
			var isDraggable, isResizable,
				uiDialog = this.uiDialog;
	
			if ( key === "disabled" ) {
				return;
			}
	
			this._super( key, value );
	
			if ( key === "appendTo" ) {
				this.uiDialog.appendTo( this._appendTo() );
			}
	
			if ( key === "buttons" ) {
				this._createButtons();
			}
	
			if ( key === "closeText" ) {
				this.uiDialogTitlebarClose.button( {
	
					// Ensure that we always pass a string
					label: $( "<a>" ).text( "" + this.options.closeText ).html()
				} );
			}
	
			if ( key === "draggable" ) {
				isDraggable = uiDialog.is( ":data(ui-draggable)" );
				if ( isDraggable && !value ) {
					uiDialog.draggable( "destroy" );
				}
	
				if ( !isDraggable && value ) {
					this._makeDraggable();
				}
			}
	
			if ( key === "position" ) {
				this._position();
			}
	
			if ( key === "resizable" ) {
	
				// currently resizable, becoming non-resizable
				isResizable = uiDialog.is( ":data(ui-resizable)" );
				if ( isResizable && !value ) {
					uiDialog.resizable( "destroy" );
				}
	
				// Currently resizable, changing handles
				if ( isResizable && typeof value === "string" ) {
					uiDialog.resizable( "option", "handles", value );
				}
	
				// Currently non-resizable, becoming resizable
				if ( !isResizable && value !== false ) {
					this._makeResizable();
				}
			}
	
			if ( key === "title" ) {
				this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
			}
		},
	
		_size: function() {
	
			// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
			// divs will both have width and height set, so we need to reset them
			var nonContentHeight, minContentHeight, maxContentHeight,
				options = this.options;
	
			// Reset content sizing
			this.element.show().css( {
				width: "auto",
				minHeight: 0,
				maxHeight: "none",
				height: 0
			} );
	
			if ( options.minWidth > options.width ) {
				options.width = options.minWidth;
			}
	
			// Reset wrapper sizing
			// determine the height of all the non-content elements
			nonContentHeight = this.uiDialog.css( {
				height: "auto",
				width: options.width
			} )
				.outerHeight();
			minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
			maxContentHeight = typeof options.maxHeight === "number" ?
				Math.max( 0, options.maxHeight - nonContentHeight ) :
				"none";
	
			if ( options.height === "auto" ) {
				this.element.css( {
					minHeight: minContentHeight,
					maxHeight: maxContentHeight,
					height: "auto"
				} );
			} else {
				this.element.height( Math.max( 0, options.height - nonContentHeight ) );
			}
	
			if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
				this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
			}
		},
	
		_blockFrames: function() {
			this.iframeBlocks = this.document.find( "iframe" ).map( function() {
				var iframe = $( this );
	
				return $( "<div>" )
					.css( {
						position: "absolute",
						width: iframe.outerWidth(),
						height: iframe.outerHeight()
					} )
					.appendTo( iframe.parent() )
					.offset( iframe.offset() )[ 0 ];
			} );
		},
	
		_unblockFrames: function() {
			if ( this.iframeBlocks ) {
				this.iframeBlocks.remove();
				delete this.iframeBlocks;
			}
		},
	
		_allowInteraction: function( event ) {
			if ( $( event.target ).closest( ".ui-dialog" ).length ) {
				return true;
			}
	
			// TODO: Remove hack when datepicker implements
			// the .ui-front logic (#8989)
			return !!$( event.target ).closest( ".ui-datepicker" ).length;
		},
	
		_createOverlay: function() {
			if ( !this.options.modal ) {
				return;
			}
	
			// We use a delay in case the overlay is created from an
			// event that we're going to be cancelling (#2804)
			var isOpening = true;
			this._delay( function() {
				isOpening = false;
			} );
	
			if ( !this.document.data( "ui-dialog-overlays" ) ) {
	
				// Prevent use of anchors and inputs
				// Using _on() for an event handler shared across many instances is
				// safe because the dialogs stack and must be closed in reverse order
				this._on( this.document, {
					focusin: function( event ) {
						if ( isOpening ) {
							return;
						}
	
						if ( !this._allowInteraction( event ) ) {
							event.preventDefault();
							this._trackingInstances()[ 0 ]._focusTabbable();
						}
					}
				} );
			}
	
			this.overlay = $( "<div>" )
				.appendTo( this._appendTo() );
	
			this._addClass( this.overlay, null, "ui-widget-overlay ui-front" );
			this._on( this.overlay, {
				mousedown: "_keepFocus"
			} );
			this.document.data( "ui-dialog-overlays",
				( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 );
		},
	
		_destroyOverlay: function() {
			if ( !this.options.modal ) {
				return;
			}
	
			if ( this.overlay ) {
				var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
	
				if ( !overlays ) {
					this._off( this.document, "focusin" );
					this.document.removeData( "ui-dialog-overlays" );
				} else {
					this.document.data( "ui-dialog-overlays", overlays );
				}
	
				this.overlay.remove();
				this.overlay = null;
			}
		}
	} );
	
	// DEPRECATED
	// TODO: switch return back to widget declaration at top of file when this is removed
	if ( $.uiBackCompat !== false ) {
	
		// Backcompat for dialogClass option
		$.widget( "ui.dialog", $.ui.dialog, {
			options: {
				dialogClass: ""
			},
			_createWrapper: function() {
				this._super();
				this.uiDialog.addClass( this.options.dialogClass );
			},
			_setOption: function( key, value ) {
				if ( key === "dialogClass" ) {
					this.uiDialog
						.removeClass( this.options.dialogClass )
						.addClass( value );
				}
				this._superApply( arguments );
			}
		} );
	}
	
	return $.ui.dialog;
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/dialog.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/button.js **/
jupyter.define('jquery-ui@1.12.1/ui/widgets/button.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Button 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Button
	//>>group: Widgets
	//>>description: Enhances a form with themeable buttons.
	//>>docs: http://api.jqueryui.com/button/
	//>>demos: http://jqueryui.com/button/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/button.css
	//>>css.theme: ../../themes/base/theme.css
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
				__jupyter_require__('jquery@2.2.4/dist/jquery.js'),
	
				// These are only for backcompat
				// TODO: Remove after 1.12
				__jupyter_require__('jquery-ui@1.12.1/ui/widgets/controlgroup.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widgets/checkboxradio.js'),
	
				__jupyter_require__('jquery-ui@1.12.1/ui/keycode.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widget.js')
			], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	
	$.widget( "ui.button", {
		version: "1.12.1",
		defaultElement: "<button>",
		options: {
			classes: {
				"ui-button": "ui-corner-all"
			},
			disabled: null,
			icon: null,
			iconPosition: "beginning",
			label: null,
			showLabel: true
		},
	
		_getCreateOptions: function() {
			var disabled,
	
				// This is to support cases like in jQuery Mobile where the base widget does have
				// an implementation of _getCreateOptions
				options = this._super() || {};
	
			this.isInput = this.element.is( "input" );
	
			disabled = this.element[ 0 ].disabled;
			if ( disabled != null ) {
				options.disabled = disabled;
			}
	
			this.originalLabel = this.isInput ? this.element.val() : this.element.html();
			if ( this.originalLabel ) {
				options.label = this.originalLabel;
			}
	
			return options;
		},
	
		_create: function() {
			if ( !this.option.showLabel & !this.options.icon ) {
				this.options.showLabel = true;
			}
	
			// We have to check the option again here even though we did in _getCreateOptions,
			// because null may have been passed on init which would override what was set in
			// _getCreateOptions
			if ( this.options.disabled == null ) {
				this.options.disabled = this.element[ 0 ].disabled || false;
			}
	
			this.hasTitle = !!this.element.attr( "title" );
	
			// Check to see if the label needs to be set or if its already correct
			if ( this.options.label && this.options.label !== this.originalLabel ) {
				if ( this.isInput ) {
					this.element.val( this.options.label );
				} else {
					this.element.html( this.options.label );
				}
			}
			this._addClass( "ui-button", "ui-widget" );
			this._setOption( "disabled", this.options.disabled );
			this._enhance();
	
			if ( this.element.is( "a" ) ) {
				this._on( {
					"keyup": function( event ) {
						if ( event.keyCode === $.ui.keyCode.SPACE ) {
							event.preventDefault();
	
							// Support: PhantomJS <= 1.9, IE 8 Only
							// If a native click is available use it so we actually cause navigation
							// otherwise just trigger a click event
							if ( this.element[ 0 ].click ) {
								this.element[ 0 ].click();
							} else {
								this.element.trigger( "click" );
							}
						}
					}
				} );
			}
		},
	
		_enhance: function() {
			if ( !this.element.is( "button" ) ) {
				this.element.attr( "role", "button" );
			}
	
			if ( this.options.icon ) {
				this._updateIcon( "icon", this.options.icon );
				this._updateTooltip();
			}
		},
	
		_updateTooltip: function() {
			this.title = this.element.attr( "title" );
	
			if ( !this.options.showLabel && !this.title ) {
				this.element.attr( "title", this.options.label );
			}
		},
	
		_updateIcon: function( option, value ) {
			var icon = option !== "iconPosition",
				position = icon ? this.options.iconPosition : value,
				displayBlock = position === "top" || position === "bottom";
	
			// Create icon
			if ( !this.icon ) {
				this.icon = $( "<span>" );
	
				this._addClass( this.icon, "ui-button-icon", "ui-icon" );
	
				if ( !this.options.showLabel ) {
					this._addClass( "ui-button-icon-only" );
				}
			} else if ( icon ) {
	
				// If we are updating the icon remove the old icon class
				this._removeClass( this.icon, null, this.options.icon );
			}
	
			// If we are updating the icon add the new icon class
			if ( icon ) {
				this._addClass( this.icon, null, value );
			}
	
			this._attachIcon( position );
	
			// If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove
			// the iconSpace if there is one.
			if ( displayBlock ) {
				this._addClass( this.icon, null, "ui-widget-icon-block" );
				if ( this.iconSpace ) {
					this.iconSpace.remove();
				}
			} else {
	
				// Position is beginning or end so remove the ui-widget-icon-block class and add the
				// space if it does not exist
				if ( !this.iconSpace ) {
					this.iconSpace = $( "<span> </span>" );
					this._addClass( this.iconSpace, "ui-button-icon-space" );
				}
				this._removeClass( this.icon, null, "ui-wiget-icon-block" );
				this._attachIconSpace( position );
			}
		},
	
		_destroy: function() {
			this.element.removeAttr( "role" );
	
			if ( this.icon ) {
				this.icon.remove();
			}
			if ( this.iconSpace ) {
				this.iconSpace.remove();
			}
			if ( !this.hasTitle ) {
				this.element.removeAttr( "title" );
			}
		},
	
		_attachIconSpace: function( iconPosition ) {
			this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace );
		},
	
		_attachIcon: function( iconPosition ) {
			this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon );
		},
	
		_setOptions: function( options ) {
			var newShowLabel = options.showLabel === undefined ?
					this.options.showLabel :
					options.showLabel,
				newIcon = options.icon === undefined ? this.options.icon : options.icon;
	
			if ( !newShowLabel && !newIcon ) {
				options.showLabel = true;
			}
			this._super( options );
		},
	
		_setOption: function( key, value ) {
			if ( key === "icon" ) {
				if ( value ) {
					this._updateIcon( key, value );
				} else if ( this.icon ) {
					this.icon.remove();
					if ( this.iconSpace ) {
						this.iconSpace.remove();
					}
				}
			}
	
			if ( key === "iconPosition" ) {
				this._updateIcon( key, value );
			}
	
			// Make sure we can't end up with a button that has neither text nor icon
			if ( key === "showLabel" ) {
					this._toggleClass( "ui-button-icon-only", null, !value );
					this._updateTooltip();
			}
	
			if ( key === "label" ) {
				if ( this.isInput ) {
					this.element.val( value );
				} else {
	
					// If there is an icon, append it, else nothing then append the value
					// this avoids removal of the icon when setting label text
					this.element.html( value );
					if ( this.icon ) {
						this._attachIcon( this.options.iconPosition );
						this._attachIconSpace( this.options.iconPosition );
					}
				}
			}
	
			this._super( key, value );
	
			if ( key === "disabled" ) {
				this._toggleClass( null, "ui-state-disabled", value );
				this.element[ 0 ].disabled = value;
				if ( value ) {
					this.element.blur();
				}
			}
		},
	
		refresh: function() {
	
			// Make sure to only check disabled if its an element that supports this otherwise
			// check for the disabled class to determine state
			var isDisabled = this.element.is( "input, button" ) ?
				this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" );
	
			if ( isDisabled !== this.options.disabled ) {
				this._setOptions( { disabled: isDisabled } );
			}
	
			this._updateTooltip();
		}
	} );
	
	// DEPRECATED
	if ( $.uiBackCompat !== false ) {
	
		// Text and Icons options
		$.widget( "ui.button", $.ui.button, {
			options: {
				text: true,
				icons: {
					primary: null,
					secondary: null
				}
			},
	
			_create: function() {
				if ( this.options.showLabel && !this.options.text ) {
					this.options.showLabel = this.options.text;
				}
				if ( !this.options.showLabel && this.options.text ) {
					this.options.text = this.options.showLabel;
				}
				if ( !this.options.icon && ( this.options.icons.primary ||
						this.options.icons.secondary ) ) {
					if ( this.options.icons.primary ) {
						this.options.icon = this.options.icons.primary;
					} else {
						this.options.icon = this.options.icons.secondary;
						this.options.iconPosition = "end";
					}
				} else if ( this.options.icon ) {
					this.options.icons.primary = this.options.icon;
				}
				this._super();
			},
	
			_setOption: function( key, value ) {
				if ( key === "text" ) {
					this._super( "showLabel", value );
					return;
				}
				if ( key === "showLabel" ) {
					this.options.text = value;
				}
				if ( key === "icon" ) {
					this.options.icons.primary = value;
				}
				if ( key === "icons" ) {
					if ( value.primary ) {
						this._super( "icon", value.primary );
						this._super( "iconPosition", "beginning" );
					} else if ( value.secondary ) {
						this._super( "icon", value.secondary );
						this._super( "iconPosition", "end" );
					}
				}
				this._superApply( arguments );
			}
		} );
	
		$.fn.button = ( function( orig ) {
			return function() {
				if ( !this.length || ( this.length && this[ 0 ].tagName !== "INPUT" ) ||
						( this.length && this[ 0 ].tagName === "INPUT" && (
							this.attr( "type" ) !== "checkbox" && this.attr( "type" ) !== "radio"
						) ) ) {
					return orig.apply( this, arguments );
				}
				if ( !$.ui.checkboxradio ) {
					$.error( "Checkboxradio widget missing" );
				}
				if ( arguments.length === 0 ) {
					return this.checkboxradio( {
						"icon": false
					} );
				}
				return this.checkboxradio.apply( this, arguments );
			};
		} )( $.fn.button );
	
		$.fn.buttonset = function() {
			if ( !$.ui.controlgroup ) {
				$.error( "Controlgroup widget missing" );
			}
			if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) {
				return this.controlgroup.apply( this,
					[ arguments[ 0 ], "items.button", arguments[ 2 ] ] );
			}
			if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) {
				return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] );
			}
			if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) {
				arguments[ 0 ].items = {
					button: arguments[ 0 ].items
				};
			}
			return this.controlgroup.apply( this, arguments );
		};
	}
	
	return $.ui.button;
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/button.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/controlgroup.js **/
jupyter.define('jquery-ui@1.12.1/ui/widgets/controlgroup.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Controlgroup 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Controlgroup
	//>>group: Widgets
	//>>description: Visually groups form control widgets
	//>>docs: http://api.jqueryui.com/controlgroup/
	//>>demos: http://jqueryui.com/controlgroup/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/controlgroup.css
	//>>css.theme: ../../themes/base/theme.css
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
				__jupyter_require__('jquery@2.2.4/dist/jquery.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widget.js')
			], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
	
	return $.widget( "ui.controlgroup", {
		version: "1.12.1",
		defaultElement: "<div>",
		options: {
			direction: "horizontal",
			disabled: null,
			onlyVisible: true,
			items: {
				"button": "input[type=button], input[type=submit], input[type=reset], button, a",
				"controlgroupLabel": ".ui-controlgroup-label",
				"checkboxradio": "input[type='checkbox'], input[type='radio']",
				"selectmenu": "select",
				"spinner": ".ui-spinner-input"
			}
		},
	
		_create: function() {
			this._enhance();
		},
	
		// To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
		_enhance: function() {
			this.element.attr( "role", "toolbar" );
			this.refresh();
		},
	
		_destroy: function() {
			this._callChildMethod( "destroy" );
			this.childWidgets.removeData( "ui-controlgroup-data" );
			this.element.removeAttr( "role" );
			if ( this.options.items.controlgroupLabel ) {
				this.element
					.find( this.options.items.controlgroupLabel )
					.find( ".ui-controlgroup-label-contents" )
					.contents().unwrap();
			}
		},
	
		_initWidgets: function() {
			var that = this,
				childWidgets = [];
	
			// First we iterate over each of the items options
			$.each( this.options.items, function( widget, selector ) {
				var labels;
				var options = {};
	
				// Make sure the widget has a selector set
				if ( !selector ) {
					return;
				}
	
				if ( widget === "controlgroupLabel" ) {
					labels = that.element.find( selector );
					labels.each( function() {
						var element = $( this );
	
						if ( element.children( ".ui-controlgroup-label-contents" ).length ) {
							return;
						}
						element.contents()
							.wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
					} );
					that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
					childWidgets = childWidgets.concat( labels.get() );
					return;
				}
	
				// Make sure the widget actually exists
				if ( !$.fn[ widget ] ) {
					return;
				}
	
				// We assume everything is in the middle to start because we can't determine
				// first / last elements until all enhancments are done.
				if ( that[ "_" + widget + "Options" ] ) {
					options = that[ "_" + widget + "Options" ]( "middle" );
				} else {
					options = { classes: {} };
				}
	
				// Find instances of this widget inside controlgroup and init them
				that.element
					.find( selector )
					.each( function() {
						var element = $( this );
						var instance = element[ widget ]( "instance" );
	
						// We need to clone the default options for this type of widget to avoid
						// polluting the variable options which has a wider scope than a single widget.
						var instanceOptions = $.widget.extend( {}, options );
	
						// If the button is the child of a spinner ignore it
						// TODO: Find a more generic solution
						if ( widget === "button" && element.parent( ".ui-spinner" ).length ) {
							return;
						}
	
						// Create the widget if it doesn't exist
						if ( !instance ) {
							instance = element[ widget ]()[ widget ]( "instance" );
						}
						if ( instance ) {
							instanceOptions.classes =
								that._resolveClassesValues( instanceOptions.classes, instance );
						}
						element[ widget ]( instanceOptions );
	
						// Store an instance of the controlgroup to be able to reference
						// from the outermost element for changing options and refresh
						var widgetElement = element[ widget ]( "widget" );
						$.data( widgetElement[ 0 ], "ui-controlgroup-data",
							instance ? instance : element[ widget ]( "instance" ) );
	
						childWidgets.push( widgetElement[ 0 ] );
					} );
			} );
	
			this.childWidgets = $( $.unique( childWidgets ) );
			this._addClass( this.childWidgets, "ui-controlgroup-item" );
		},
	
		_callChildMethod: function( method ) {
			this.childWidgets.each( function() {
				var element = $( this ),
					data = element.data( "ui-controlgroup-data" );
				if ( data && data[ method ] ) {
					data[ method ]();
				}
			} );
		},
	
		_updateCornerClass: function( element, position ) {
			var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
			var add = this._buildSimpleOptions( position, "label" ).classes.label;
	
			this._removeClass( element, null, remove );
			this._addClass( element, null, add );
		},
	
		_buildSimpleOptions: function( position, key ) {
			var direction = this.options.direction === "vertical";
			var result = {
				classes: {}
			};
			result.classes[ key ] = {
				"middle": "",
				"first": "ui-corner-" + ( direction ? "top" : "left" ),
				"last": "ui-corner-" + ( direction ? "bottom" : "right" ),
				"only": "ui-corner-all"
			}[ position ];
	
			return result;
		},
	
		_spinnerOptions: function( position ) {
			var options = this._buildSimpleOptions( position, "ui-spinner" );
	
			options.classes[ "ui-spinner-up" ] = "";
			options.classes[ "ui-spinner-down" ] = "";
	
			return options;
		},
	
		_buttonOptions: function( position ) {
			return this._buildSimpleOptions( position, "ui-button" );
		},
	
		_checkboxradioOptions: function( position ) {
			return this._buildSimpleOptions( position, "ui-checkboxradio-label" );
		},
	
		_selectmenuOptions: function( position ) {
			var direction = this.options.direction === "vertical";
			return {
				width: direction ? "auto" : false,
				classes: {
					middle: {
						"ui-selectmenu-button-open": "",
						"ui-selectmenu-button-closed": ""
					},
					first: {
						"ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ),
						"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" )
					},
					last: {
						"ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
						"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
					},
					only: {
						"ui-selectmenu-button-open": "ui-corner-top",
						"ui-selectmenu-button-closed": "ui-corner-all"
					}
	
				}[ position ]
			};
		},
	
		_resolveClassesValues: function( classes, instance ) {
			var result = {};
			$.each( classes, function( key ) {
				var current = instance.options.classes[ key ] || "";
				current = $.trim( current.replace( controlgroupCornerRegex, "" ) );
				result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
			} );
			return result;
		},
	
		_setOption: function( key, value ) {
			if ( key === "direction" ) {
				this._removeClass( "ui-controlgroup-" + this.options.direction );
			}
	
			this._super( key, value );
			if ( key === "disabled" ) {
				this._callChildMethod( value ? "disable" : "enable" );
				return;
			}
	
			this.refresh();
		},
	
		refresh: function() {
			var children,
				that = this;
	
			this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction );
	
			if ( this.options.direction === "horizontal" ) {
				this._addClass( null, "ui-helper-clearfix" );
			}
			this._initWidgets();
	
			children = this.childWidgets;
	
			// We filter here because we need to track all childWidgets not just the visible ones
			if ( this.options.onlyVisible ) {
				children = children.filter( ":visible" );
			}
	
			if ( children.length ) {
	
				// We do this last because we need to make sure all enhancment is done
				// before determining first and last
				$.each( [ "first", "last" ], function( index, value ) {
					var instance = children[ value ]().data( "ui-controlgroup-data" );
	
					if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
						var options = that[ "_" + instance.widgetName + "Options" ](
							children.length === 1 ? "only" : value
						);
						options.classes = that._resolveClassesValues( options.classes, instance );
						instance.element[ instance.widgetName ]( options );
					} else {
						that._updateCornerClass( children[ value ](), value );
					}
				} );
	
				// Finally call the refresh method on each of the child widgets.
				this._callChildMethod( "refresh" );
			}
		}
	} );
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/controlgroup.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/checkboxradio.js **/
jupyter.define('jquery-ui@1.12.1/ui/widgets/checkboxradio.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Checkboxradio 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Checkboxradio
	//>>group: Widgets
	//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
	//>>docs: http://api.jqueryui.com/checkboxradio/
	//>>demos: http://jqueryui.com/checkboxradio/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/button.css
	//>>css.structure: ../../themes/base/checkboxradio.css
	//>>css.theme: ../../themes/base/theme.css
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
				__jupyter_require__('jquery@2.2.4/dist/jquery.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/escape-selector.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/form-reset-mixin.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/labels.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widget.js')
			], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	
	$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
		version: "1.12.1",
		options: {
			disabled: null,
			label: null,
			icon: true,
			classes: {
				"ui-checkboxradio-label": "ui-corner-all",
				"ui-checkboxradio-icon": "ui-corner-all"
			}
		},
	
		_getCreateOptions: function() {
			var disabled, labels;
			var that = this;
			var options = this._super() || {};
	
			// We read the type here, because it makes more sense to throw a element type error first,
			// rather then the error for lack of a label. Often if its the wrong type, it
			// won't have a label (e.g. calling on a div, btn, etc)
			this._readType();
	
			labels = this.element.labels();
	
			// If there are multiple labels, use the last one
			this.label = $( labels[ labels.length - 1 ] );
			if ( !this.label.length ) {
				$.error( "No label found for checkboxradio widget" );
			}
	
			this.originalLabel = "";
	
			// We need to get the label text but this may also need to make sure it does not contain the
			// input itself.
			this.label.contents().not( this.element[ 0 ] ).each( function() {
	
				// The label contents could be text, html, or a mix. We concat each element to get a
				// string representation of the label, without the input as part of it.
				that.originalLabel += this.nodeType === 3 ? $( this ).text() : this.outerHTML;
			} );
	
			// Set the label option if we found label text
			if ( this.originalLabel ) {
				options.label = this.originalLabel;
			}
	
			disabled = this.element[ 0 ].disabled;
			if ( disabled != null ) {
				options.disabled = disabled;
			}
			return options;
		},
	
		_create: function() {
			var checked = this.element[ 0 ].checked;
	
			this._bindFormResetHandler();
	
			if ( this.options.disabled == null ) {
				this.options.disabled = this.element[ 0 ].disabled;
			}
	
			this._setOption( "disabled", this.options.disabled );
			this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" );
			this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" );
	
			if ( this.type === "radio" ) {
				this._addClass( this.label, "ui-checkboxradio-radio-label" );
			}
	
			if ( this.options.label && this.options.label !== this.originalLabel ) {
				this._updateLabel();
			} else if ( this.originalLabel ) {
				this.options.label = this.originalLabel;
			}
	
			this._enhance();
	
			if ( checked ) {
				this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
				if ( this.icon ) {
					this._addClass( this.icon, null, "ui-state-hover" );
				}
			}
	
			this._on( {
				change: "_toggleClasses",
				focus: function() {
					this._addClass( this.label, null, "ui-state-focus ui-visual-focus" );
				},
				blur: function() {
					this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" );
				}
			} );
		},
	
		_readType: function() {
			var nodeName = this.element[ 0 ].nodeName.toLowerCase();
			this.type = this.element[ 0 ].type;
			if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) {
				$.error( "Can't create checkboxradio on element.nodeName=" + nodeName +
					" and element.type=" + this.type );
			}
		},
	
		// Support jQuery Mobile enhanced option
		_enhance: function() {
			this._updateIcon( this.element[ 0 ].checked );
		},
	
		widget: function() {
			return this.label;
		},
	
		_getRadioGroup: function() {
			var group;
			var name = this.element[ 0 ].name;
			var nameSelector = "input[name='" + $.ui.escapeSelector( name ) + "']";
	
			if ( !name ) {
				return $( [] );
			}
	
			if ( this.form.length ) {
				group = $( this.form[ 0 ].elements ).filter( nameSelector );
			} else {
	
				// Not inside a form, check all inputs that also are not inside a form
				group = $( nameSelector ).filter( function() {
					return $( this ).form().length === 0;
				} );
			}
	
			return group.not( this.element );
		},
	
		_toggleClasses: function() {
			var checked = this.element[ 0 ].checked;
			this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
	
			if ( this.options.icon && this.type === "checkbox" ) {
				this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked )
					._toggleClass( this.icon, null, "ui-icon-blank", !checked );
			}
	
			if ( this.type === "radio" ) {
				this._getRadioGroup()
					.each( function() {
						var instance = $( this ).checkboxradio( "instance" );
	
						if ( instance ) {
							instance._removeClass( instance.label,
								"ui-checkboxradio-checked", "ui-state-active" );
						}
					} );
			}
		},
	
		_destroy: function() {
			this._unbindFormResetHandler();
	
			if ( this.icon ) {
				this.icon.remove();
				this.iconSpace.remove();
			}
		},
	
		_setOption: function( key, value ) {
	
			// We don't allow the value to be set to nothing
			if ( key === "label" && !value ) {
				return;
			}
	
			this._super( key, value );
	
			if ( key === "disabled" ) {
				this._toggleClass( this.label, null, "ui-state-disabled", value );
				this.element[ 0 ].disabled = value;
	
				// Don't refresh when setting disabled
				return;
			}
			this.refresh();
		},
	
		_updateIcon: function( checked ) {
			var toAdd = "ui-icon ui-icon-background ";
	
			if ( this.options.icon ) {
				if ( !this.icon ) {
					this.icon = $( "<span>" );
					this.iconSpace = $( "<span> </span>" );
					this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" );
				}
	
				if ( this.type === "checkbox" ) {
					toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank";
					this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" );
				} else {
					toAdd += "ui-icon-blank";
				}
				this._addClass( this.icon, "ui-checkboxradio-icon", toAdd );
				if ( !checked ) {
					this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" );
				}
				this.icon.prependTo( this.label ).after( this.iconSpace );
			} else if ( this.icon !== undefined ) {
				this.icon.remove();
				this.iconSpace.remove();
				delete this.icon;
			}
		},
	
		_updateLabel: function() {
	
			// Remove the contents of the label ( minus the icon, icon space, and input )
			var contents = this.label.contents().not( this.element[ 0 ] );
			if ( this.icon ) {
				contents = contents.not( this.icon[ 0 ] );
			}
			if ( this.iconSpace ) {
				contents = contents.not( this.iconSpace[ 0 ] );
			}
			contents.remove();
	
			this.label.append( this.options.label );
		},
	
		refresh: function() {
			var checked = this.element[ 0 ].checked,
				isDisabled = this.element[ 0 ].disabled;
	
			this._updateIcon( checked );
			this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
			if ( this.options.label !== null ) {
				this._updateLabel();
			}
	
			if ( isDisabled !== this.options.disabled ) {
				this._setOptions( { "disabled": isDisabled } );
			}
		}
	
	} ] );
	
	return $.ui.checkboxradio;
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/checkboxradio.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/escape-selector.js **/
jupyter.define('jquery-ui@1.12.1/ui/escape-selector.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	// Internal use only
	return $.ui.escapeSelector = ( function() {
		var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;
		return function( selector ) {
			return selector.replace( selectorEscape, "\\$1" );
		};
	} )();
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/escape-selector.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/form-reset-mixin.js **/
jupyter.define('jquery-ui@1.12.1/ui/form-reset-mixin.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Form Reset Mixin 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Form Reset Mixin
	//>>group: Core
	//>>description: Refresh input widgets when their form is reset
	//>>docs: http://api.jqueryui.com/form-reset-mixin/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
				__jupyter_require__('jquery@2.2.4/dist/jquery.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/form.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/version.js')
			], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	
	return $.ui.formResetMixin = {
		_formResetHandler: function() {
			var form = $( this );
	
			// Wait for the form reset to actually happen before refreshing
			setTimeout( function() {
				var instances = form.data( "ui-form-reset-instances" );
				$.each( instances, function() {
					this.refresh();
				} );
			} );
		},
	
		_bindFormResetHandler: function() {
			this.form = this.element.form();
			if ( !this.form.length ) {
				return;
			}
	
			var instances = this.form.data( "ui-form-reset-instances" ) || [];
			if ( !instances.length ) {
	
				// We don't use _on() here because we use a single event handler per form
				this.form.on( "reset.ui-form-reset", this._formResetHandler );
			}
			instances.push( this );
			this.form.data( "ui-form-reset-instances", instances );
		},
	
		_unbindFormResetHandler: function() {
			if ( !this.form.length ) {
				return;
			}
	
			var instances = this.form.data( "ui-form-reset-instances" );
			instances.splice( $.inArray( this, instances ), 1 );
			if ( instances.length ) {
				this.form.data( "ui-form-reset-instances", instances );
			} else {
				this.form
					.removeData( "ui-form-reset-instances" )
					.off( "reset.ui-form-reset" );
			}
		}
	};
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/form-reset-mixin.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/form.js **/
jupyter.define('jquery-ui@1.12.1/ui/form.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	// Support: IE8 Only
	// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
	// with a string, so we need to find the proper form.
	return $.fn.form = function() {
		return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
	};
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/form.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/labels.js **/
jupyter.define('jquery-ui@1.12.1/ui/labels.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Labels 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: labels
	//>>group: Core
	//>>description: Find all the labels associated with a given input
	//>>docs: http://api.jqueryui.com/labels/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js'), __jupyter_require__('jquery-ui@1.12.1/ui/escape-selector.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	return $.fn.labels = function() {
		var ancestor, selector, id, labels, ancestors;
	
		// Check control.labels first
		if ( this[ 0 ].labels && this[ 0 ].labels.length ) {
			return this.pushStack( this[ 0 ].labels );
		}
	
		// Support: IE <= 11, FF <= 37, Android <= 2.3 only
		// Above browsers do not support control.labels. Everything below is to support them
		// as well as document fragments. control.labels does not work on document fragments
		labels = this.eq( 0 ).parents( "label" );
	
		// Look for the label based on the id
		id = this.attr( "id" );
		if ( id ) {
	
			// We don't search against the document in case the element
			// is disconnected from the DOM
			ancestor = this.eq( 0 ).parents().last();
	
			// Get a full set of top level ancestors
			ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );
	
			// Create a selector for the label based on the id
			selector = "label[for='" + $.ui.escapeSelector( id ) + "']";
	
			labels = labels.add( ancestors.find( selector ).addBack( selector ) );
	
		}
	
		// Return whatever we have found for labels
		return this.pushStack( labels );
	};
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/labels.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/resizable.js **/
jupyter.define('jquery-ui@1.12.1/ui/widgets/resizable.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Resizable 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: Resizable
	//>>group: Interactions
	//>>description: Enables resize functionality for any element.
	//>>docs: http://api.jqueryui.com/resizable/
	//>>demos: http://jqueryui.com/resizable/
	//>>css.structure: ../../themes/base/core.css
	//>>css.structure: ../../themes/base/resizable.css
	//>>css.theme: ../../themes/base/theme.css
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
				__jupyter_require__('jquery@2.2.4/dist/jquery.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widgets/mouse.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/disable-selection.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/plugin.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/version.js'),
				__jupyter_require__('jquery-ui@1.12.1/ui/widget.js')
			], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	
	$.widget( "ui.resizable", $.ui.mouse, {
		version: "1.12.1",
		widgetEventPrefix: "resize",
		options: {
			alsoResize: false,
			animate: false,
			animateDuration: "slow",
			animateEasing: "swing",
			aspectRatio: false,
			autoHide: false,
			classes: {
				"ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
			},
			containment: false,
			ghost: false,
			grid: false,
			handles: "e,s,se",
			helper: false,
			maxHeight: null,
			maxWidth: null,
			minHeight: 10,
			minWidth: 10,
	
			// See #7960
			zIndex: 90,
	
			// Callbacks
			resize: null,
			start: null,
			stop: null
		},
	
		_num: function( value ) {
			return parseFloat( value ) || 0;
		},
	
		_isNumber: function( value ) {
			return !isNaN( parseFloat( value ) );
		},
	
		_hasScroll: function( el, a ) {
	
			if ( $( el ).css( "overflow" ) === "hidden" ) {
				return false;
			}
	
			var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
				has = false;
	
			if ( el[ scroll ] > 0 ) {
				return true;
			}
	
			// TODO: determine which cases actually cause this to happen
			// if the element doesn't have the scroll set, see if it's possible to
			// set the scroll
			el[ scroll ] = 1;
			has = ( el[ scroll ] > 0 );
			el[ scroll ] = 0;
			return has;
		},
	
		_create: function() {
	
			var margins,
				o = this.options,
				that = this;
			this._addClass( "ui-resizable" );
	
			$.extend( this, {
				_aspectRatio: !!( o.aspectRatio ),
				aspectRatio: o.aspectRatio,
				originalElement: this.element,
				_proportionallyResizeElements: [],
				_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
			} );
	
			// Wrap the element if it cannot hold child nodes
			if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
	
				this.element.wrap(
					$( "<div class='ui-wrapper' style='overflow: hidden;'></div>" ).css( {
						position: this.element.css( "position" ),
						width: this.element.outerWidth(),
						height: this.element.outerHeight(),
						top: this.element.css( "top" ),
						left: this.element.css( "left" )
					} )
				);
	
				this.element = this.element.parent().data(
					"ui-resizable", this.element.resizable( "instance" )
				);
	
				this.elementIsWrapper = true;
	
				margins = {
					marginTop: this.originalElement.css( "marginTop" ),
					marginRight: this.originalElement.css( "marginRight" ),
					marginBottom: this.originalElement.css( "marginBottom" ),
					marginLeft: this.originalElement.css( "marginLeft" )
				};
	
				this.element.css( margins );
				this.originalElement.css( "margin", 0 );
	
				// support: Safari
				// Prevent Safari textarea resize
				this.originalResizeStyle = this.originalElement.css( "resize" );
				this.originalElement.css( "resize", "none" );
	
				this._proportionallyResizeElements.push( this.originalElement.css( {
					position: "static",
					zoom: 1,
					display: "block"
				} ) );
	
				// Support: IE9
				// avoid IE jump (hard set the margin)
				this.originalElement.css( margins );
	
				this._proportionallyResize();
			}
	
			this._setupHandles();
	
			if ( o.autoHide ) {
				$( this.element )
					.on( "mouseenter", function() {
						if ( o.disabled ) {
							return;
						}
						that._removeClass( "ui-resizable-autohide" );
						that._handles.show();
					} )
					.on( "mouseleave", function() {
						if ( o.disabled ) {
							return;
						}
						if ( !that.resizing ) {
							that._addClass( "ui-resizable-autohide" );
							that._handles.hide();
						}
					} );
			}
	
			this._mouseInit();
		},
	
		_destroy: function() {
	
			this._mouseDestroy();
	
			var wrapper,
				_destroy = function( exp ) {
					$( exp )
						.removeData( "resizable" )
						.removeData( "ui-resizable" )
						.off( ".resizable" )
						.find( ".ui-resizable-handle" )
							.remove();
				};
	
			// TODO: Unwrap at same DOM position
			if ( this.elementIsWrapper ) {
				_destroy( this.element );
				wrapper = this.element;
				this.originalElement.css( {
					position: wrapper.css( "position" ),
					width: wrapper.outerWidth(),
					height: wrapper.outerHeight(),
					top: wrapper.css( "top" ),
					left: wrapper.css( "left" )
				} ).insertAfter( wrapper );
				wrapper.remove();
			}
	
			this.originalElement.css( "resize", this.originalResizeStyle );
			_destroy( this.originalElement );
	
			return this;
		},
	
		_setOption: function( key, value ) {
			this._super( key, value );
	
			switch ( key ) {
			case "handles":
				this._removeHandles();
				this._setupHandles();
				break;
			default:
				break;
			}
		},
	
		_setupHandles: function() {
			var o = this.options, handle, i, n, hname, axis, that = this;
			this.handles = o.handles ||
				( !$( ".ui-resizable-handle", this.element ).length ?
					"e,s,se" : {
						n: ".ui-resizable-n",
						e: ".ui-resizable-e",
						s: ".ui-resizable-s",
						w: ".ui-resizable-w",
						se: ".ui-resizable-se",
						sw: ".ui-resizable-sw",
						ne: ".ui-resizable-ne",
						nw: ".ui-resizable-nw"
					} );
	
			this._handles = $();
			if ( this.handles.constructor === String ) {
	
				if ( this.handles === "all" ) {
					this.handles = "n,e,s,w,se,sw,ne,nw";
				}
	
				n = this.handles.split( "," );
				this.handles = {};
	
				for ( i = 0; i < n.length; i++ ) {
	
					handle = $.trim( n[ i ] );
					hname = "ui-resizable-" + handle;
					axis = $( "<div>" );
					this._addClass( axis, "ui-resizable-handle " + hname );
	
					axis.css( { zIndex: o.zIndex } );
	
					this.handles[ handle ] = ".ui-resizable-" + handle;
					this.element.append( axis );
				}
	
			}
	
			this._renderAxis = function( target ) {
	
				var i, axis, padPos, padWrapper;
	
				target = target || this.element;
	
				for ( i in this.handles ) {
	
					if ( this.handles[ i ].constructor === String ) {
						this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show();
					} else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
						this.handles[ i ] = $( this.handles[ i ] );
						this._on( this.handles[ i ], { "mousedown": that._mouseDown } );
					}
	
					if ( this.elementIsWrapper &&
							this.originalElement[ 0 ]
								.nodeName
								.match( /^(textarea|input|select|button)$/i ) ) {
						axis = $( this.handles[ i ], this.element );
	
						padWrapper = /sw|ne|nw|se|n|s/.test( i ) ?
							axis.outerHeight() :
							axis.outerWidth();
	
						padPos = [ "padding",
							/ne|nw|n/.test( i ) ? "Top" :
							/se|sw|s/.test( i ) ? "Bottom" :
							/^e$/.test( i ) ? "Right" : "Left" ].join( "" );
	
						target.css( padPos, padWrapper );
	
						this._proportionallyResize();
					}
	
					this._handles = this._handles.add( this.handles[ i ] );
				}
			};
	
			// TODO: make renderAxis a prototype function
			this._renderAxis( this.element );
	
			this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
			this._handles.disableSelection();
	
			this._handles.on( "mouseover", function() {
				if ( !that.resizing ) {
					if ( this.className ) {
						axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i );
					}
					that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se";
				}
			} );
	
			if ( o.autoHide ) {
				this._handles.hide();
				this._addClass( "ui-resizable-autohide" );
			}
		},
	
		_removeHandles: function() {
			this._handles.remove();
		},
	
		_mouseCapture: function( event ) {
			var i, handle,
				capture = false;
	
			for ( i in this.handles ) {
				handle = $( this.handles[ i ] )[ 0 ];
				if ( handle === event.target || $.contains( handle, event.target ) ) {
					capture = true;
				}
			}
	
			return !this.options.disabled && capture;
		},
	
		_mouseStart: function( event ) {
	
			var curleft, curtop, cursor,
				o = this.options,
				el = this.element;
	
			this.resizing = true;
	
			this._renderProxy();
	
			curleft = this._num( this.helper.css( "left" ) );
			curtop = this._num( this.helper.css( "top" ) );
	
			if ( o.containment ) {
				curleft += $( o.containment ).scrollLeft() || 0;
				curtop += $( o.containment ).scrollTop() || 0;
			}
	
			this.offset = this.helper.offset();
			this.position = { left: curleft, top: curtop };
	
			this.size = this._helper ? {
					width: this.helper.width(),
					height: this.helper.height()
				} : {
					width: el.width(),
					height: el.height()
				};
	
			this.originalSize = this._helper ? {
					width: el.outerWidth(),
					height: el.outerHeight()
				} : {
					width: el.width(),
					height: el.height()
				};
	
			this.sizeDiff = {
				width: el.outerWidth() - el.width(),
				height: el.outerHeight() - el.height()
			};
	
			this.originalPosition = { left: curleft, top: curtop };
			this.originalMousePosition = { left: event.pageX, top: event.pageY };
	
			this.aspectRatio = ( typeof o.aspectRatio === "number" ) ?
				o.aspectRatio :
				( ( this.originalSize.width / this.originalSize.height ) || 1 );
	
			cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" );
			$( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor );
	
			this._addClass( "ui-resizable-resizing" );
			this._propagate( "start", event );
			return true;
		},
	
		_mouseDrag: function( event ) {
	
			var data, props,
				smp = this.originalMousePosition,
				a = this.axis,
				dx = ( event.pageX - smp.left ) || 0,
				dy = ( event.pageY - smp.top ) || 0,
				trigger = this._change[ a ];
	
			this._updatePrevProperties();
	
			if ( !trigger ) {
				return false;
			}
	
			data = trigger.apply( this, [ event, dx, dy ] );
	
			this._updateVirtualBoundaries( event.shiftKey );
			if ( this._aspectRatio || event.shiftKey ) {
				data = this._updateRatio( data, event );
			}
	
			data = this._respectSize( data, event );
	
			this._updateCache( data );
	
			this._propagate( "resize", event );
	
			props = this._applyChanges();
	
			if ( !this._helper && this._proportionallyResizeElements.length ) {
				this._proportionallyResize();
			}
	
			if ( !$.isEmptyObject( props ) ) {
				this._updatePrevProperties();
				this._trigger( "resize", event, this.ui() );
				this._applyChanges();
			}
	
			return false;
		},
	
		_mouseStop: function( event ) {
	
			this.resizing = false;
			var pr, ista, soffseth, soffsetw, s, left, top,
				o = this.options, that = this;
	
			if ( this._helper ) {
	
				pr = this._proportionallyResizeElements;
				ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName );
				soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height;
				soffsetw = ista ? 0 : that.sizeDiff.width;
	
				s = {
					width: ( that.helper.width()  - soffsetw ),
					height: ( that.helper.height() - soffseth )
				};
				left = ( parseFloat( that.element.css( "left" ) ) +
					( that.position.left - that.originalPosition.left ) ) || null;
				top = ( parseFloat( that.element.css( "top" ) ) +
					( that.position.top - that.originalPosition.top ) ) || null;
	
				if ( !o.animate ) {
					this.element.css( $.extend( s, { top: top, left: left } ) );
				}
	
				that.helper.height( that.size.height );
				that.helper.width( that.size.width );
	
				if ( this._helper && !o.animate ) {
					this._proportionallyResize();
				}
			}
	
			$( "body" ).css( "cursor", "auto" );
	
			this._removeClass( "ui-resizable-resizing" );
	
			this._propagate( "stop", event );
	
			if ( this._helper ) {
				this.helper.remove();
			}
	
			return false;
	
		},
	
		_updatePrevProperties: function() {
			this.prevPosition = {
				top: this.position.top,
				left: this.position.left
			};
			this.prevSize = {
				width: this.size.width,
				height: this.size.height
			};
		},
	
		_applyChanges: function() {
			var props = {};
	
			if ( this.position.top !== this.prevPosition.top ) {
				props.top = this.position.top + "px";
			}
			if ( this.position.left !== this.prevPosition.left ) {
				props.left = this.position.left + "px";
			}
			if ( this.size.width !== this.prevSize.width ) {
				props.width = this.size.width + "px";
			}
			if ( this.size.height !== this.prevSize.height ) {
				props.height = this.size.height + "px";
			}
	
			this.helper.css( props );
	
			return props;
		},
	
		_updateVirtualBoundaries: function( forceAspectRatio ) {
			var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
				o = this.options;
	
			b = {
				minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0,
				maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity,
				minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0,
				maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity
			};
	
			if ( this._aspectRatio || forceAspectRatio ) {
				pMinWidth = b.minHeight * this.aspectRatio;
				pMinHeight = b.minWidth / this.aspectRatio;
				pMaxWidth = b.maxHeight * this.aspectRatio;
				pMaxHeight = b.maxWidth / this.aspectRatio;
	
				if ( pMinWidth > b.minWidth ) {
					b.minWidth = pMinWidth;
				}
				if ( pMinHeight > b.minHeight ) {
					b.minHeight = pMinHeight;
				}
				if ( pMaxWidth < b.maxWidth ) {
					b.maxWidth = pMaxWidth;
				}
				if ( pMaxHeight < b.maxHeight ) {
					b.maxHeight = pMaxHeight;
				}
			}
			this._vBoundaries = b;
		},
	
		_updateCache: function( data ) {
			this.offset = this.helper.offset();
			if ( this._isNumber( data.left ) ) {
				this.position.left = data.left;
			}
			if ( this._isNumber( data.top ) ) {
				this.position.top = data.top;
			}
			if ( this._isNumber( data.height ) ) {
				this.size.height = data.height;
			}
			if ( this._isNumber( data.width ) ) {
				this.size.width = data.width;
			}
		},
	
		_updateRatio: function( data ) {
	
			var cpos = this.position,
				csize = this.size,
				a = this.axis;
	
			if ( this._isNumber( data.height ) ) {
				data.width = ( data.height * this.aspectRatio );
			} else if ( this._isNumber( data.width ) ) {
				data.height = ( data.width / this.aspectRatio );
			}
	
			if ( a === "sw" ) {
				data.left = cpos.left + ( csize.width - data.width );
				data.top = null;
			}
			if ( a === "nw" ) {
				data.top = cpos.top + ( csize.height - data.height );
				data.left = cpos.left + ( csize.width - data.width );
			}
	
			return data;
		},
	
		_respectSize: function( data ) {
	
			var o = this._vBoundaries,
				a = this.axis,
				ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ),
				ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ),
				isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
				isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
				dw = this.originalPosition.left + this.originalSize.width,
				dh = this.originalPosition.top + this.originalSize.height,
				cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
			if ( isminw ) {
				data.width = o.minWidth;
			}
			if ( isminh ) {
				data.height = o.minHeight;
			}
			if ( ismaxw ) {
				data.width = o.maxWidth;
			}
			if ( ismaxh ) {
				data.height = o.maxHeight;
			}
	
			if ( isminw && cw ) {
				data.left = dw - o.minWidth;
			}
			if ( ismaxw && cw ) {
				data.left = dw - o.maxWidth;
			}
			if ( isminh && ch ) {
				data.top = dh - o.minHeight;
			}
			if ( ismaxh && ch ) {
				data.top = dh - o.maxHeight;
			}
	
			// Fixing jump error on top/left - bug #2330
			if ( !data.width && !data.height && !data.left && data.top ) {
				data.top = null;
			} else if ( !data.width && !data.height && !data.top && data.left ) {
				data.left = null;
			}
	
			return data;
		},
	
		_getPaddingPlusBorderDimensions: function( element ) {
			var i = 0,
				widths = [],
				borders = [
					element.css( "borderTopWidth" ),
					element.css( "borderRightWidth" ),
					element.css( "borderBottomWidth" ),
					element.css( "borderLeftWidth" )
				],
				paddings = [
					element.css( "paddingTop" ),
					element.css( "paddingRight" ),
					element.css( "paddingBottom" ),
					element.css( "paddingLeft" )
				];
	
			for ( ; i < 4; i++ ) {
				widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
				widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
			}
	
			return {
				height: widths[ 0 ] + widths[ 2 ],
				width: widths[ 1 ] + widths[ 3 ]
			};
		},
	
		_proportionallyResize: function() {
	
			if ( !this._proportionallyResizeElements.length ) {
				return;
			}
	
			var prel,
				i = 0,
				element = this.helper || this.element;
	
			for ( ; i < this._proportionallyResizeElements.length; i++ ) {
	
				prel = this._proportionallyResizeElements[ i ];
	
				// TODO: Seems like a bug to cache this.outerDimensions
				// considering that we are in a loop.
				if ( !this.outerDimensions ) {
					this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
				}
	
				prel.css( {
					height: ( element.height() - this.outerDimensions.height ) || 0,
					width: ( element.width() - this.outerDimensions.width ) || 0
				} );
	
			}
	
		},
	
		_renderProxy: function() {
	
			var el = this.element, o = this.options;
			this.elementOffset = el.offset();
	
			if ( this._helper ) {
	
				this.helper = this.helper || $( "<div style='overflow:hidden;'></div>" );
	
				this._addClass( this.helper, this._helper );
				this.helper.css( {
					width: this.element.outerWidth(),
					height: this.element.outerHeight(),
					position: "absolute",
					left: this.elementOffset.left + "px",
					top: this.elementOffset.top + "px",
					zIndex: ++o.zIndex //TODO: Don't modify option
				} );
	
				this.helper
					.appendTo( "body" )
					.disableSelection();
	
			} else {
				this.helper = this.element;
			}
	
		},
	
		_change: {
			e: function( event, dx ) {
				return { width: this.originalSize.width + dx };
			},
			w: function( event, dx ) {
				var cs = this.originalSize, sp = this.originalPosition;
				return { left: sp.left + dx, width: cs.width - dx };
			},
			n: function( event, dx, dy ) {
				var cs = this.originalSize, sp = this.originalPosition;
				return { top: sp.top + dy, height: cs.height - dy };
			},
			s: function( event, dx, dy ) {
				return { height: this.originalSize.height + dy };
			},
			se: function( event, dx, dy ) {
				return $.extend( this._change.s.apply( this, arguments ),
					this._change.e.apply( this, [ event, dx, dy ] ) );
			},
			sw: function( event, dx, dy ) {
				return $.extend( this._change.s.apply( this, arguments ),
					this._change.w.apply( this, [ event, dx, dy ] ) );
			},
			ne: function( event, dx, dy ) {
				return $.extend( this._change.n.apply( this, arguments ),
					this._change.e.apply( this, [ event, dx, dy ] ) );
			},
			nw: function( event, dx, dy ) {
				return $.extend( this._change.n.apply( this, arguments ),
					this._change.w.apply( this, [ event, dx, dy ] ) );
			}
		},
	
		_propagate: function( n, event ) {
			$.ui.plugin.call( this, n, [ event, this.ui() ] );
			( n !== "resize" && this._trigger( n, event, this.ui() ) );
		},
	
		plugins: {},
	
		ui: function() {
			return {
				originalElement: this.originalElement,
				element: this.element,
				helper: this.helper,
				position: this.position,
				size: this.size,
				originalSize: this.originalSize,
				originalPosition: this.originalPosition
			};
		}
	
	} );
	
	/*
	 * Resizable Extensions
	 */
	
	$.ui.plugin.add( "resizable", "animate", {
	
		stop: function( event ) {
			var that = $( this ).resizable( "instance" ),
				o = that.options,
				pr = that._proportionallyResizeElements,
				ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ),
				soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
				soffsetw = ista ? 0 : that.sizeDiff.width,
				style = {
					width: ( that.size.width - soffsetw ),
					height: ( that.size.height - soffseth )
				},
				left = ( parseFloat( that.element.css( "left" ) ) +
					( that.position.left - that.originalPosition.left ) ) || null,
				top = ( parseFloat( that.element.css( "top" ) ) +
					( that.position.top - that.originalPosition.top ) ) || null;
	
			that.element.animate(
				$.extend( style, top && left ? { top: top, left: left } : {} ), {
					duration: o.animateDuration,
					easing: o.animateEasing,
					step: function() {
	
						var data = {
							width: parseFloat( that.element.css( "width" ) ),
							height: parseFloat( that.element.css( "height" ) ),
							top: parseFloat( that.element.css( "top" ) ),
							left: parseFloat( that.element.css( "left" ) )
						};
	
						if ( pr && pr.length ) {
							$( pr[ 0 ] ).css( { width: data.width, height: data.height } );
						}
	
						// Propagating resize, and updating values for each animation step
						that._updateCache( data );
						that._propagate( "resize", event );
	
					}
				}
			);
		}
	
	} );
	
	$.ui.plugin.add( "resizable", "containment", {
	
		start: function() {
			var element, p, co, ch, cw, width, height,
				that = $( this ).resizable( "instance" ),
				o = that.options,
				el = that.element,
				oc = o.containment,
				ce = ( oc instanceof $ ) ?
					oc.get( 0 ) :
					( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
	
			if ( !ce ) {
				return;
			}
	
			that.containerElement = $( ce );
	
			if ( /document/.test( oc ) || oc === document ) {
				that.containerOffset = {
					left: 0,
					top: 0
				};
				that.containerPosition = {
					left: 0,
					top: 0
				};
	
				that.parentData = {
					element: $( document ),
					left: 0,
					top: 0,
					width: $( document ).width(),
					height: $( document ).height() || document.body.parentNode.scrollHeight
				};
			} else {
				element = $( ce );
				p = [];
				$( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) {
					p[ i ] = that._num( element.css( "padding" + name ) );
				} );
	
				that.containerOffset = element.offset();
				that.containerPosition = element.position();
				that.containerSize = {
					height: ( element.innerHeight() - p[ 3 ] ),
					width: ( element.innerWidth() - p[ 1 ] )
				};
	
				co = that.containerOffset;
				ch = that.containerSize.height;
				cw = that.containerSize.width;
				width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
				height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
	
				that.parentData = {
					element: ce,
					left: co.left,
					top: co.top,
					width: width,
					height: height
				};
			}
		},
	
		resize: function( event ) {
			var woset, hoset, isParent, isOffsetRelative,
				that = $( this ).resizable( "instance" ),
				o = that.options,
				co = that.containerOffset,
				cp = that.position,
				pRatio = that._aspectRatio || event.shiftKey,
				cop = {
					top: 0,
					left: 0
				},
				ce = that.containerElement,
				continueResize = true;
	
			if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
				cop = co;
			}
	
			if ( cp.left < ( that._helper ? co.left : 0 ) ) {
				that.size.width = that.size.width +
					( that._helper ?
						( that.position.left - co.left ) :
						( that.position.left - cop.left ) );
	
				if ( pRatio ) {
					that.size.height = that.size.width / that.aspectRatio;
					continueResize = false;
				}
				that.position.left = o.helper ? co.left : 0;
			}
	
			if ( cp.top < ( that._helper ? co.top : 0 ) ) {
				that.size.height = that.size.height +
					( that._helper ?
						( that.position.top - co.top ) :
						that.position.top );
	
				if ( pRatio ) {
					that.size.width = that.size.height * that.aspectRatio;
					continueResize = false;
				}
				that.position.top = that._helper ? co.top : 0;
			}
	
			isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
			isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
	
			if ( isParent && isOffsetRelative ) {
				that.offset.left = that.parentData.left + that.position.left;
				that.offset.top = that.parentData.top + that.position.top;
			} else {
				that.offset.left = that.element.offset().left;
				that.offset.top = that.element.offset().top;
			}
	
			woset = Math.abs( that.sizeDiff.width +
				( that._helper ?
					that.offset.left - cop.left :
					( that.offset.left - co.left ) ) );
	
			hoset = Math.abs( that.sizeDiff.height +
				( that._helper ?
					that.offset.top - cop.top :
					( that.offset.top - co.top ) ) );
	
			if ( woset + that.size.width >= that.parentData.width ) {
				that.size.width = that.parentData.width - woset;
				if ( pRatio ) {
					that.size.height = that.size.width / that.aspectRatio;
					continueResize = false;
				}
			}
	
			if ( hoset + that.size.height >= that.parentData.height ) {
				that.size.height = that.parentData.height - hoset;
				if ( pRatio ) {
					that.size.width = that.size.height * that.aspectRatio;
					continueResize = false;
				}
			}
	
			if ( !continueResize ) {
				that.position.left = that.prevPosition.left;
				that.position.top = that.prevPosition.top;
				that.size.width = that.prevSize.width;
				that.size.height = that.prevSize.height;
			}
		},
	
		stop: function() {
			var that = $( this ).resizable( "instance" ),
				o = that.options,
				co = that.containerOffset,
				cop = that.containerPosition,
				ce = that.containerElement,
				helper = $( that.helper ),
				ho = helper.offset(),
				w = helper.outerWidth() - that.sizeDiff.width,
				h = helper.outerHeight() - that.sizeDiff.height;
	
			if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
				$( this ).css( {
					left: ho.left - cop.left - co.left,
					width: w,
					height: h
				} );
			}
	
			if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
				$( this ).css( {
					left: ho.left - cop.left - co.left,
					width: w,
					height: h
				} );
			}
		}
	} );
	
	$.ui.plugin.add( "resizable", "alsoResize", {
	
		start: function() {
			var that = $( this ).resizable( "instance" ),
				o = that.options;
	
			$( o.alsoResize ).each( function() {
				var el = $( this );
				el.data( "ui-resizable-alsoresize", {
					width: parseFloat( el.width() ), height: parseFloat( el.height() ),
					left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
				} );
			} );
		},
	
		resize: function( event, ui ) {
			var that = $( this ).resizable( "instance" ),
				o = that.options,
				os = that.originalSize,
				op = that.originalPosition,
				delta = {
					height: ( that.size.height - os.height ) || 0,
					width: ( that.size.width - os.width ) || 0,
					top: ( that.position.top - op.top ) || 0,
					left: ( that.position.left - op.left ) || 0
				};
	
				$( o.alsoResize ).each( function() {
					var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {},
						css = el.parents( ui.originalElement[ 0 ] ).length ?
								[ "width", "height" ] :
								[ "width", "height", "top", "left" ];
	
					$.each( css, function( i, prop ) {
						var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 );
						if ( sum && sum >= 0 ) {
							style[ prop ] = sum || null;
						}
					} );
	
					el.css( style );
				} );
		},
	
		stop: function() {
			$( this ).removeData( "ui-resizable-alsoresize" );
		}
	} );
	
	$.ui.plugin.add( "resizable", "ghost", {
	
		start: function() {
	
			var that = $( this ).resizable( "instance" ), cs = that.size;
	
			that.ghost = that.originalElement.clone();
			that.ghost.css( {
				opacity: 0.25,
				display: "block",
				position: "relative",
				height: cs.height,
				width: cs.width,
				margin: 0,
				left: 0,
				top: 0
			} );
	
			that._addClass( that.ghost, "ui-resizable-ghost" );
	
			// DEPRECATED
			// TODO: remove after 1.12
			if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) {
	
				// Ghost option
				that.ghost.addClass( this.options.ghost );
			}
	
			that.ghost.appendTo( that.helper );
	
		},
	
		resize: function() {
			var that = $( this ).resizable( "instance" );
			if ( that.ghost ) {
				that.ghost.css( {
					position: "relative",
					height: that.size.height,
					width: that.size.width
				} );
			}
		},
	
		stop: function() {
			var that = $( this ).resizable( "instance" );
			if ( that.ghost && that.helper ) {
				that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) );
			}
		}
	
	} );
	
	$.ui.plugin.add( "resizable", "grid", {
	
		resize: function() {
			var outerDimensions,
				that = $( this ).resizable( "instance" ),
				o = that.options,
				cs = that.size,
				os = that.originalSize,
				op = that.originalPosition,
				a = that.axis,
				grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
				gridX = ( grid[ 0 ] || 1 ),
				gridY = ( grid[ 1 ] || 1 ),
				ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX,
				oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY,
				newWidth = os.width + ox,
				newHeight = os.height + oy,
				isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ),
				isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ),
				isMinWidth = o.minWidth && ( o.minWidth > newWidth ),
				isMinHeight = o.minHeight && ( o.minHeight > newHeight );
	
			o.grid = grid;
	
			if ( isMinWidth ) {
				newWidth += gridX;
			}
			if ( isMinHeight ) {
				newHeight += gridY;
			}
			if ( isMaxWidth ) {
				newWidth -= gridX;
			}
			if ( isMaxHeight ) {
				newHeight -= gridY;
			}
	
			if ( /^(se|s|e)$/.test( a ) ) {
				that.size.width = newWidth;
				that.size.height = newHeight;
			} else if ( /^(ne)$/.test( a ) ) {
				that.size.width = newWidth;
				that.size.height = newHeight;
				that.position.top = op.top - oy;
			} else if ( /^(sw)$/.test( a ) ) {
				that.size.width = newWidth;
				that.size.height = newHeight;
				that.position.left = op.left - ox;
			} else {
				if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
					outerDimensions = that._getPaddingPlusBorderDimensions( this );
				}
	
				if ( newHeight - gridY > 0 ) {
					that.size.height = newHeight;
					that.position.top = op.top - oy;
				} else {
					newHeight = gridY - outerDimensions.height;
					that.size.height = newHeight;
					that.position.top = op.top + os.height - newHeight;
				}
				if ( newWidth - gridX > 0 ) {
					that.size.width = newWidth;
					that.position.left = op.left - ox;
				} else {
					newWidth = gridX - outerDimensions.width;
					that.size.width = newWidth;
					that.position.left = op.left + os.width - newWidth;
				}
			}
		}
	
	} );
	
	return $.ui.resizable;
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/widgets/resizable.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/disable-selection.js **/
jupyter.define('jquery-ui@1.12.1/ui/disable-selection.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Disable Selection 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: disableSelection
	//>>group: Core
	//>>description: Disable selection of text content within the set of matched elements.
	//>>docs: http://api.jqueryui.com/disableSelection/
	
	// This file is deprecated
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	return $.fn.extend( {
		disableSelection: ( function() {
			var eventType = "onselectstart" in document.createElement( "div" ) ?
				"selectstart" :
				"mousedown";
	
			return function() {
				return this.on( eventType + ".ui-disableSelection", function( event ) {
					event.preventDefault();
				} );
			};
		} )(),
	
		enableSelection: function() {
			return this.off( ".ui-disableSelection" );
		}
	} );
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/disable-selection.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/focusable.js **/
jupyter.define('jquery-ui@1.12.1/ui/focusable.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Focusable 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: :focusable Selector
	//>>group: Core
	//>>description: Selects elements which can be focused.
	//>>docs: http://api.jqueryui.com/focusable-selector/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	// Selectors
	$.ui.focusable = function( element, hasTabindex ) {
		var map, mapName, img, focusableIfVisible, fieldset,
			nodeName = element.nodeName.toLowerCase();
	
		if ( "area" === nodeName ) {
			map = element.parentNode;
			mapName = map.name;
			if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
				return false;
			}
			img = $( "img[usemap='#" + mapName + "']" );
			return img.length > 0 && img.is( ":visible" );
		}
	
		if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) {
			focusableIfVisible = !element.disabled;
	
			if ( focusableIfVisible ) {
	
				// Form controls within a disabled fieldset are disabled.
				// However, controls within the fieldset's legend do not get disabled.
				// Since controls generally aren't placed inside legends, we skip
				// this portion of the check.
				fieldset = $( element ).closest( "fieldset" )[ 0 ];
				if ( fieldset ) {
					focusableIfVisible = !fieldset.disabled;
				}
			}
		} else if ( "a" === nodeName ) {
			focusableIfVisible = element.href || hasTabindex;
		} else {
			focusableIfVisible = hasTabindex;
		}
	
		return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) );
	};
	
	// Support: IE 8 only
	// IE 8 doesn't resolve inherit to visible/hidden for computed values
	function visible( element ) {
		var visibility = element.css( "visibility" );
		while ( visibility === "inherit" ) {
			element = element.parent();
			visibility = element.css( "visibility" );
		}
		return visibility !== "hidden";
	}
	
	$.extend( $.expr[ ":" ], {
		focusable: function( element ) {
			return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
		}
	} );
	
	return $.ui.focusable;
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/focusable.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/tabbable.js **/
jupyter.define('jquery-ui@1.12.1/ui/tabbable.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Tabbable 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: :tabbable Selector
	//>>group: Core
	//>>description: Selects elements which can be tabbed to.
	//>>docs: http://api.jqueryui.com/tabbable-selector/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js'), __jupyter_require__('jquery-ui@1.12.1/ui/focusable.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	return $.extend( $.expr[ ":" ], {
		tabbable: function( element ) {
			var tabIndex = $.attr( element, "tabindex" ),
				hasTabindex = tabIndex != null;
			return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
		}
	} );
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/tabbable.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/unique-id.js **/
jupyter.define('jquery-ui@1.12.1/ui/unique-id.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Unique ID 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 */
	
	//>>label: uniqueId
	//>>group: Core
	//>>description: Functions to generate and remove uniqueId's
	//>>docs: http://api.jqueryui.com/uniqueId/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	} ( function( $ ) {
	
	return $.fn.extend( {
		uniqueId: ( function() {
			var uuid = 0;
	
			return function() {
				return this.each( function() {
					if ( !this.id ) {
						this.id = "ui-id-" + ( ++uuid );
					}
				} );
			};
		} )(),
	
		removeUniqueId: function() {
			return this.each( function() {
				if ( /^ui-id-\d+$/.test( this.id ) ) {
					$( this ).removeAttr( "id" );
				}
			} );
		}
	} );
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/unique-id.js **/


/** START DEFINE BLOCK for jquery-ui@1.12.1/ui/position.js **/
jupyter.define('jquery-ui@1.12.1/ui/position.js', function (module, exports, __jupyter_require__) {
	var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	 * jQuery UI Position 1.12.1
	 * http://jqueryui.com
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license.
	 * http://jquery.org/license
	 *
	 * http://api.jqueryui.com/position/
	 */
	
	//>>label: Position
	//>>group: Core
	//>>description: Positions elements relative to other elements.
	//>>docs: http://api.jqueryui.com/position/
	//>>demos: http://jqueryui.com/position/
	
	( function( factory ) {
		if ( true ) {
	
			// AMD. Register as an anonymous module.
			!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __jupyter_require__('jquery@2.2.4/dist/jquery.js'), __jupyter_require__('jquery-ui@1.12.1/ui/version.js') ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		} else {
	
			// Browser globals
			factory( jQuery );
		}
	}( function( $ ) {
	( function() {
	var cachedScrollbarWidth,
		max = Math.max,
		abs = Math.abs,
		rhorizontal = /left|center|right/,
		rvertical = /top|center|bottom/,
		roffset = /[\+\-]\d+(\.[\d]+)?%?/,
		rposition = /^\w+/,
		rpercent = /%$/,
		_position = $.fn.position;
	
	function getOffsets( offsets, width, height ) {
		return [
			parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
			parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
		];
	}
	
	function parseCss( element, property ) {
		return parseInt( $.css( element, property ), 10 ) || 0;
	}
	
	function getDimensions( elem ) {
		var raw = elem[ 0 ];
		if ( raw.nodeType === 9 ) {
			return {
				width: elem.width(),
				height: elem.height(),
				offset: { top: 0, left: 0 }
			};
		}
		if ( $.isWindow( raw ) ) {
			return {
				width: elem.width(),
				height: elem.height(),
				offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
			};
		}
		if ( raw.preventDefault ) {
			return {
				width: 0,
				height: 0,
				offset: { top: raw.pageY, left: raw.pageX }
			};
		}
		return {
			width: elem.outerWidth(),
			height: elem.outerHeight(),
			offset: elem.offset()
		};
	}
	
	$.position = {
		scrollbarWidth: function() {
			if ( cachedScrollbarWidth !== undefined ) {
				return cachedScrollbarWidth;
			}
			var w1, w2,
				div = $( "<div " +
					"style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" +
					"<div style='height:100px;width:auto;'></div></div>" ),
				innerDiv = div.children()[ 0 ];
	
			$( "body" ).append( div );
			w1 = innerDiv.offsetWidth;
			div.css( "overflow", "scroll" );
	
			w2 = innerDiv.offsetWidth;
	
			if ( w1 === w2 ) {
				w2 = div[ 0 ].clientWidth;
			}
	
			div.remove();
	
			return ( cachedScrollbarWidth = w1 - w2 );
		},
		getScrollInfo: function( within ) {
			var overflowX = within.isWindow || within.isDocument ? "" :
					within.element.css( "overflow-x" ),
				overflowY = within.isWindow || within.isDocument ? "" :
					within.element.css( "overflow-y" ),
				hasOverflowX = overflowX === "scroll" ||
					( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ),
				hasOverflowY = overflowY === "scroll" ||
					( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight );
			return {
				width: hasOverflowY ? $.position.scrollbarWidth() : 0,
				height: hasOverflowX ? $.position.scrollbarWidth() : 0
			};
		},
		getWithinInfo: function( element ) {
			var withinElement = $( element || window ),
				isWindow = $.isWindow( withinElement[ 0 ] ),
				isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,
				hasOffset = !isWindow && !isDocument;
			return {
				element: withinElement,
				isWindow: isWindow,
				isDocument: isDocument,
				offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
				scrollLeft: withinElement.scrollLeft(),
				scrollTop: withinElement.scrollTop(),
				width: withinElement.outerWidth(),
				height: withinElement.outerHeight()
			};
		}
	};
	
	$.fn.position = function( options ) {
		if ( !options || !options.of ) {
			return _position.apply( this, arguments );
		}
	
		// Make a copy, we don't want to modify arguments
		options = $.extend( {}, options );
	
		var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
			target = $( options.of ),
			within = $.position.getWithinInfo( options.within ),
			scrollInfo = $.position.getScrollInfo( within ),
			collision = ( options.collision || "flip" ).split( " " ),
			offsets = {};
	
		dimensions = getDimensions( target );
		if ( target[ 0 ].preventDefault ) {
	
			// Force left top to allow flipping
			options.at = "left top";
		}
		targetWidth = dimensions.width;
		targetHeight = dimensions.height;
		targetOffset = dimensions.offset;
	
		// Clone to reuse original targetOffset later
		basePosition = $.extend( {}, targetOffset );
	
		// Force my and at to have valid horizontal and vertical positions
		// if a value is missing or invalid, it will be converted to center
		$.each( [ "my", "at" ], function() {
			var pos = ( options[ this ] || "" ).split( " " ),
				horizontalOffset,
				verticalOffset;
	
			if ( pos.length === 1 ) {
				pos = rhorizontal.test( pos[ 0 ] ) ?
					pos.concat( [ "center" ] ) :
					rvertical.test( pos[ 0 ] ) ?
						[ "center" ].concat( pos ) :
						[ "center", "center" ];
			}
			pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
			pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
	
			// Calculate offsets
			horizontalOffset = roffset.exec( pos[ 0 ] );
			verticalOffset = roffset.exec( pos[ 1 ] );
			offsets[ this ] = [
				horizontalOffset ? horizontalOffset[ 0 ] : 0,
				verticalOffset ? verticalOffset[ 0 ] : 0
			];
	
			// Reduce to just the positions without the offsets
			options[ this ] = [
				rposition.exec( pos[ 0 ] )[ 0 ],
				rposition.exec( pos[ 1 ] )[ 0 ]
			];
		} );
	
		// Normalize collision option
		if ( collision.length === 1 ) {
			collision[ 1 ] = collision[ 0 ];
		}
	
		if ( options.at[ 0 ] === "right" ) {
			basePosition.left += targetWidth;
		} else if ( options.at[ 0 ] === "center" ) {
			basePosition.left += targetWidth / 2;
		}
	
		if ( options.at[ 1 ] === "bottom" ) {
			basePosition.top += targetHeight;
		} else if ( options.at[ 1 ] === "center" ) {
			basePosition.top += targetHeight / 2;
		}
	
		atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
		basePosition.left += atOffset[ 0 ];
		basePosition.top += atOffset[ 1 ];
	
		return this.each( function() {
			var collisionPosition, using,
				elem = $( this ),
				elemWidth = elem.outerWidth(),
				elemHeight = elem.outerHeight(),
				marginLeft = parseCss( this, "marginLeft" ),
				marginTop = parseCss( this, "marginTop" ),
				collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) +
					scrollInfo.width,
				collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) +
					scrollInfo.height,
				position = $.extend( {}, basePosition ),
				myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
	
			if ( options.my[ 0 ] === "right" ) {
				position.left -= elemWidth;
			} else if ( options.my[ 0 ] === "center" ) {
				position.left -= elemWidth / 2;
			}
	
			if ( options.my[ 1 ] === "bottom" ) {
				position.top -= elemHeight;
			} else if ( options.my[ 1 ] === "center" ) {
				position.top -= elemHeight / 2;
			}
	
			position.left += myOffset[ 0 ];
			position.top += myOffset[ 1 ];
	
			collisionPosition = {
				marginLeft: marginLeft,
				marginTop: marginTop
			};
	
			$.each( [ "left", "top" ], function( i, dir ) {
				if ( $.ui.position[ collision[ i ] ] ) {
					$.ui.position[ collision[ i ] ][ dir ]( position, {
						targetWidth: targetWidth,
						targetHeight: targetHeight,
						elemWidth: elemWidth,
						elemHeight: elemHeight,
						collisionPosition: collisionPosition,
						collisionWidth: collisionWidth,
						collisionHeight: collisionHeight,
						offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
						my: options.my,
						at: options.at,
						within: within,
						elem: elem
					} );
				}
			} );
	
			if ( options.using ) {
	
				// Adds feedback as second argument to using callback, if present
				using = function( props ) {
					var left = targetOffset.left - position.left,
						right = left + targetWidth - elemWidth,
						top = targetOffset.top - position.top,
						bottom = top + targetHeight - elemHeight,
						feedback = {
							target: {
								element: target,
								left: targetOffset.left,
								top: targetOffset.top,
								width: targetWidth,
								height: targetHeight
							},
							element: {
								element: elem,
								left: position.left,
								top: position.top,
								width: elemWidth,
								height: elemHeight
							},
							horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
							vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
						};
					if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
						feedback.horizontal = "center";
					}
					if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
						feedback.vertical = "middle";
					}
					if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
						feedback.important = "horizontal";
					} else {
						feedback.important = "vertical";
					}
					options.using.call( this, props, feedback );
				};
			}
	
			elem.offset( $.extend( position, { using: using } ) );
		} );
	};
	
	$.ui.position = {
		fit: {
			left: function( position, data ) {
				var within = data.within,
					withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
					outerWidth = within.width,
					collisionPosLeft = position.left - data.collisionPosition.marginLeft,
					overLeft = withinOffset - collisionPosLeft,
					overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
					newOverRight;
	
				// Element is wider than within
				if ( data.collisionWidth > outerWidth ) {
	
					// Element is initially over the left side of within
					if ( overLeft > 0 && overRight <= 0 ) {
						newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
							withinOffset;
						position.left += overLeft - newOverRight;
	
					// Element is initially over right side of within
					} else if ( overRight > 0 && overLeft <= 0 ) {
						position.left = withinOffset;
	
					// Element is initially over both left and right sides of within
					} else {
						if ( overLeft > overRight ) {
							position.left = withinOffset + outerWidth - data.collisionWidth;
						} else {
							position.left = withinOffset;
						}
					}
	
				// Too far left -> align with left edge
				} else if ( overLeft > 0 ) {
					position.left += overLeft;
	
				// Too far right -> align with right edge
				} else if ( overRight > 0 ) {
					position.left -= overRight;
	
				// Adjust based on position and margin
				} else {
					position.left = max( position.left - collisionPosLeft, position.left );
				}
			},
			top: function( position, data ) {
				var within = data.within,
					withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
					outerHeight = data.within.height,
					collisionPosTop = position.top - data.collisionPosition.marginTop,
					overTop = withinOffset - collisionPosTop,
					overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
					newOverBottom;
	
				// Element is taller than within
				if ( data.collisionHeight > outerHeight ) {
	
					// Element is initially over the top of within
					if ( overTop > 0 && overBottom <= 0 ) {
						newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
							withinOffset;
						position.top += overTop - newOverBottom;
	
					// Element is initially over bottom of within
					} else if ( overBottom > 0 && overTop <= 0 ) {
						position.top = withinOffset;
	
					// Element is initially over both top and bottom of within
					} else {
						if ( overTop > overBottom ) {
							position.top = withinOffset + outerHeight - data.collisionHeight;
						} else {
							position.top = withinOffset;
						}
					}
	
				// Too far up -> align with top
				} else if ( overTop > 0 ) {
					position.top += overTop;
	
				// Too far down -> align with bottom edge
				} else if ( overBottom > 0 ) {
					position.top -= overBottom;
	
				// Adjust based on position and margin
				} else {
					position.top = max( position.top - collisionPosTop, position.top );
				}
			}
		},
		flip: {
			left: function( position, data ) {
				var within = data.within,
					withinOffset = within.offset.left + within.scrollLeft,
					outerWidth = within.width,
					offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
					collisionPosLeft = position.left - data.collisionPosition.marginLeft,
					overLeft = collisionPosLeft - offsetLeft,
					overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
					myOffset = data.my[ 0 ] === "left" ?
						-data.elemWidth :
						data.my[ 0 ] === "right" ?
							data.elemWidth :
							0,
					atOffset = data.at[ 0 ] === "left" ?
						data.targetWidth :
						data.at[ 0 ] === "right" ?
							-data.targetWidth :
							0,
					offset = -2 * data.offset[ 0 ],
					newOverRight,
					newOverLeft;
	
				if ( overLeft < 0 ) {
					newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
						outerWidth - withinOffset;
					if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
						position.left += myOffset + atOffset + offset;
					}
				} else if ( overRight > 0 ) {
					newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
						atOffset + offset - offsetLeft;
					if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
						position.left += myOffset + atOffset + offset;
					}
				}
			},
			top: function( position, data ) {
				var within = data.within,
					withinOffset = within.offset.top + within.scrollTop,
					outerHeight = within.height,
					offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
					collisionPosTop = position.top - data.collisionPosition.marginTop,
					overTop = collisionPosTop - offsetTop,
					overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
					top = data.my[ 1 ] === "top",
					myOffset = top ?
						-data.elemHeight :
						data.my[ 1 ] === "bottom" ?
							data.elemHeight :
							0,
					atOffset = data.at[ 1 ] === "top" ?
						data.targetHeight :
						data.at[ 1 ] === "bottom" ?
							-data.targetHeight :
							0,
					offset = -2 * data.offset[ 1 ],
					newOverTop,
					newOverBottom;
				if ( overTop < 0 ) {
					newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
						outerHeight - withinOffset;
					if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
						position.top += myOffset + atOffset + offset;
					}
				} else if ( overBottom > 0 ) {
					newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
						offset - offsetTop;
					if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
						position.top += myOffset + atOffset + offset;
					}
				}
			}
		},
		flipfit: {
			left: function() {
				$.ui.position.flip.left.apply( this, arguments );
				$.ui.position.fit.left.apply( this, arguments );
			},
			top: function() {
				$.ui.position.flip.top.apply( this, arguments );
				$.ui.position.fit.top.apply( this, arguments );
			}
		}
	};
	
	} )();
	
	return $.ui.position;
	
	} ) );
	
})
/** END DEFINE BLOCK for jquery-ui@1.12.1/ui/position.js **/


/** START DEFINE BLOCK for nglview-js-widgets@0.5.4-dev.1/package.json **/
jupyter.define('nglview-js-widgets@0.5.4-dev.1/package.json', function (module, exports, __jupyter_require__) {
	module.exports = {
		"name": "nglview-js-widgets",
		"version": "0.5.4-dev.1",
		"description": "nglview-js-widgets",
		"author": "Hai Nguyen <hainm.comp@gmail.com>, Alexander Rose <alexander.rose@weirdbyte.de>",
		"license": "MIT",
		"main": "src/index.js",
		"repository": {
			"type": "git",
			"url": "https://github.com/arose/nglview.git"
		},
		"bugs": {
			"url": "https://github.com/arose/nglview/issues"
		},
		"files": [
			"dist"
		],
		"keywords": [
			"molecular graphics",
			"molecular structure",
			"jupyter",
			"widgets",
			"ipython",
			"ipywidgets",
			"science"
		],
		"scripts": {
			"lint": "eslint src test",
			"prepublish": "webpack",
			"test": "mocha"
		},
		"devDependencies": {
			"@jupyterlab/extension-builder": "^0.10.0",
			"babel-eslint": "^7.0.0",
			"babel-register": "^6.11.6",
			"eslint": "^3.2.2",
			"eslint-config-google": "^0.7.1",
			"json-loader": "^0.5.4",
			"ngl": "0.10.0-dev.9",
			"webpack": "^1.12.14"
		},
		"dependencies": {
			"jquery": "^2.1.4",
			"jquery-ui": "^1.12.1",
			"underscore": "^1.8.3",
			"jupyter-js-widgets": "~2.1.4",
			"@jupyterlab/nbwidgets": "^0.6.15"
		}
	};
})
/** END DEFINE BLOCK for nglview-js-widgets@0.5.4-dev.1/package.json **/


/** START DEFINE BLOCK for @jupyterlab/nbwidgets@0.6.15/lib/index.js **/
jupyter.define('@jupyterlab/nbwidgets@0.6.15/lib/index.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var __extends = (this && this.__extends) || function (d, b) {
	    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
	    function __() { this.constructor = d; }
	    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
	};
	var jupyter_js_widgets_1 = __jupyter_require__('jupyter-js-widgets@~2.1.4/lib/index.js');
	var panel_1 = __jupyter_require__('phosphor@^0.7.0/lib/ui/panel.js');
	var token_1 = __jupyter_require__('phosphor@^0.7.0/lib/core/token.js');
	var widget_1 = __jupyter_require__('phosphor@^0.7.0/lib/ui/widget.js');
	var semvercache_1 = __jupyter_require__('@jupyterlab/nbwidgets@0.6.15/lib/semvercache.js');
	/**
	 * The token identifying the JupyterLab plugin.
	 */
	exports.INBWidgetExtension = new token_1.Token('jupyter.extensions.nbWidgetManager');
	/**
	 * The class name added to an BackboneViewWrapper widget.
	 */
	var BACKBONEVIEWWRAPPER_CLASS = 'jp-BackboneViewWrapper';
	var BackboneViewWrapper = (function (_super) {
	    __extends(BackboneViewWrapper, _super);
	    /**
	     * Construct a new `Backbone` wrapper widget.
	     *
	     * @param view - The `Backbone.View` instance being wrapped.
	     */
	    function BackboneViewWrapper(view) {
	        var _this = this;
	        _super.call(this);
	        this._view = null;
	        this._view = view;
	        view.on('remove', function () {
	            _this.dispose();
	            console.log('View removed', view);
	        });
	        this.addClass(BACKBONEVIEWWRAPPER_CLASS);
	        this.node.appendChild(view.el);
	    }
	    BackboneViewWrapper.prototype.onAfterAttach = function (msg) {
	        this._view.trigger('displayed');
	    };
	    BackboneViewWrapper.prototype.dispose = function () {
	        this._view = null;
	        _super.prototype.dispose.call(this);
	    };
	    return BackboneViewWrapper;
	}(widget_1.Widget));
	exports.BackboneViewWrapper = BackboneViewWrapper;
	/**
	 * A widget manager that returns phosphor widgets.
	 */
	var WidgetManager = (function (_super) {
	    __extends(WidgetManager, _super);
	    function WidgetManager(context, rendermime) {
	        var _this = this;
	        _super.call(this);
	        this._registry = new semvercache_1.SemVerCache();
	        this._context = context;
	        this._rendermime = rendermime;
	        context.kernelChanged.connect(function (sender, kernel) {
	            if (context.kernel) {
	                _this.validateVersion();
	            }
	            _this.newKernel(kernel);
	        });
	        if (context.kernel) {
	            this.validateVersion();
	            this.newKernel(context.kernel);
	        }
	    }
	    WidgetManager.prototype.newKernel = function (kernel) {
	        var _this = this;
	        if (this._commRegistration) {
	            this._commRegistration.dispose();
	        }
	        if (!kernel) {
	            return;
	        }
	        this._commRegistration = kernel.registerCommTarget(this.comm_target_name, function (comm, msg) {
	            var oldComm = new jupyter_js_widgets_1.shims.services.Comm(comm);
	            _this.handle_comm_open(oldComm, msg);
	        });
	    };
	    ;
	    /**
	     * Return a phosphor widget representing the view
	     */
	    WidgetManager.prototype.display_view = function (msg, view, options) {
	        var widget = view.pWidget ? view.pWidget : new BackboneViewWrapper(view);
	        return Promise.resolve(widget);
	    };
	    /**
	     * Create a comm.
	     */
	    WidgetManager.prototype._create_comm = function (target_name, model_id, data) {
	        var comm = this._context.kernel.connectToComm(target_name, model_id);
	        comm.open(data);
	        return Promise.resolve(new jupyter_js_widgets_1.shims.services.Comm(comm));
	    };
	    /**
	     * Get the currently-registered comms.
	     */
	    WidgetManager.prototype._get_comm_info = function () {
	        return this._context.kernel.requestCommInfo({ target: 'jupyter.widget' }).then(function (reply) {
	            return reply.content.comms;
	        });
	    };
	    Object.defineProperty(WidgetManager.prototype, "isDisposed", {
	        /**
	         * Get whether the manager is disposed.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._context === null;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Dispose the resources held by the manager.
	     */
	    WidgetManager.prototype.dispose = function () {
	        if (this.isDisposed) {
	            return;
	        }
	        if (this._commRegistration) {
	            this._commRegistration.dispose();
	        }
	        this._context = null;
	    };
	    /**
	     * Load a class and return a promise to the loaded object.
	     */
	    WidgetManager.prototype.loadClass = function (className, moduleName, moduleVersion, error) {
	        var mod = this._registry.get(moduleName, moduleVersion);
	        if (!mod) {
	            return Promise.reject("Module " + moduleName + ", semver range " + moduleVersion + " is not registered as a widget module");
	        }
	        var cls = mod[className];
	        if (!cls) {
	            return Promise.reject("Class " + className + " not found in module " + moduleName);
	        }
	        return Promise.resolve(cls);
	    };
	    Object.defineProperty(WidgetManager.prototype, "context", {
	        get: function () {
	            return this._context;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(WidgetManager.prototype, "rendermime", {
	        get: function () {
	            return this._rendermime;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    Object.defineProperty(WidgetManager.prototype, "displayWithOutput", {
	        get: function () {
	            return true;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    WidgetManager.prototype.register = function (data) {
	        this._registry.set(data.name, data.version, data.exports);
	    };
	    return WidgetManager;
	}(jupyter_js_widgets_1.ManagerBase));
	exports.WidgetManager = WidgetManager;
	/**
	 * A renderer for widgets.
	 */
	var WidgetRenderer = (function () {
	    function WidgetRenderer(widgetManager) {
	        this.mimetypes = ['application/vnd.jupyter.widget-view+json'];
	        this._manager = widgetManager;
	    }
	    /**
	     * Whether the input can safely sanitized for a given mimetype.
	     */
	    WidgetRenderer.prototype.isSanitizable = function (mimetype) {
	        return false;
	    };
	    /**
	     * Whether the input is safe without sanitization.
	     */
	    WidgetRenderer.prototype.isSafe = function (mimetype) {
	        return false;
	    };
	    /**
	     * Render a widget mimetype.
	     */
	    WidgetRenderer.prototype.render = function (options) {
	        var _this = this;
	        // data is a model id
	        var w = new panel_1.Panel();
	        var model = this._manager.get_model(options.source.model_id);
	        if (model) {
	            model.then(function (model) {
	                return _this._manager.display_model(void 0, model, void 0);
	            }).then(function (view) {
	                w.addWidget(view);
	            });
	        }
	        else {
	            // Model doesn't exist
	            var error = document.createElement('p');
	            error.textContent = 'Widget not found.';
	            w.addWidget(new widget_1.Widget({ node: error }));
	        }
	        return w;
	    };
	    Object.defineProperty(WidgetRenderer.prototype, "isDisposed", {
	        /**
	         * Get whether the manager is disposed.
	         *
	         * #### Notes
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._manager === null;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    /**
	     * Dispose the resources held by the manager.
	     */
	    WidgetRenderer.prototype.dispose = function () {
	        if (this.isDisposed) {
	            return;
	        }
	        this._manager = null;
	    };
	    return WidgetRenderer;
	}());
	exports.WidgetRenderer = WidgetRenderer;
	
})
/** END DEFINE BLOCK for @jupyterlab/nbwidgets@0.6.15/lib/index.js **/


/** START DEFINE BLOCK for phosphor@0.7.1/lib/core/token.js **/
jupyter.define('phosphor@0.7.1/lib/core/token.js', function (module, exports, __jupyter_require__) {
	/*-----------------------------------------------------------------------------
	| Copyright (c) 2014-2016, PhosphorJS Contributors
	|
	| Distributed under the terms of the BSD 3-Clause License.
	|
	| The full license is in the file LICENSE, distributed with this software.
	|----------------------------------------------------------------------------*/
	"use strict";
	/**
	 * A runtime object which captures compile-time type information.
	 *
	 * #### Notes
	 * A token captures the compile-time type of an interface or class in
	 * an object which is useful for various type-safe runtime operations.
	 *
	 * #### Example
	 * ``` typescript
	 * interface IThing {
	 *   value: number;
	 * }
	 *
	 * const IThing = new Token<IThing>('my-module/IThing');
	 *
	 * // some runtime type registry
	 * registry.registerFactory(IThing, () => { value: 42 });
	 *
	 * // later...
	 * let thing = registry.getInstance(IThing);
	 * thing.value; // 42
	 * ```
	 */
	var Token = (function () {
	    /**
	     * Construct a new token.
	     *
	     * @param name - A human readable name for the token.
	     */
	    function Token(name) {
	        this._name = name;
	    }
	    Object.defineProperty(Token.prototype, "name", {
	        /**
	         * The human readable name for the token.
	         *
	         * #### Notes
	         * This can be useful for debugging and logging.
	         *
	         * This is a read-only property.
	         */
	        get: function () {
	            return this._name;
	        },
	        enumerable: true,
	        configurable: true
	    });
	    return Token;
	}());
	exports.Token = Token;
	
})
/** END DEFINE BLOCK for phosphor@0.7.1/lib/core/token.js **/


/** START DEFINE BLOCK for @jupyterlab/nbwidgets@0.6.15/lib/semvercache.js **/
jupyter.define('@jupyterlab/nbwidgets@0.6.15/lib/semvercache.js', function (module, exports, __jupyter_require__) {
	// Copyright (c) Jupyter Development Team.
	// Distributed under the terms of the Modified BSD License.
	"use strict";
	var semver_1 = __jupyter_require__('semver@5.3.0/semver.js');
	/**
	 * A cache using semver ranges to retrieve values.
	 */
	var SemVerCache = (function () {
	    function SemVerCache() {
	        this._cache = Object.create(null);
	    }
	    SemVerCache.prototype.set = function (key, version, object) {
	        if (!(key in this._cache)) {
	            this._cache[key] = Object.create(null);
	        }
	        if (!(version in this._cache[key])) {
	            this._cache[key][version] = object;
	        }
	    };
	    SemVerCache.prototype.get = function (key, semver) {
	        if (key in this._cache) {
	            var versions = this._cache[key];
	            var best = semver_1.maxSatisfying(Object.keys(versions), semver);
	            return versions[best];
	        }
	    };
	    return SemVerCache;
	}());
	exports.SemVerCache = SemVerCache;
	
})
/** END DEFINE BLOCK for @jupyterlab/nbwidgets@0.6.15/lib/semvercache.js **/
