From 433c1f1462db986588efefc767a6adb6ada4bd2b Mon Sep 17 00:00:00 2001 From: argon24 Date: Mon, 18 Dec 2017 17:12:54 +0100 Subject: [PATCH 1/3] New feature: modify the value of numbercontroller (both box and slider) using mouse wheel --- build/dat.gui.js | 255 +++++++++++------- build/dat.gui.js.map | 2 +- build/dat.gui.min.js | 4 +- package.json | 1 + src/dat/controllers/NumberControllerBox.js | 13 + src/dat/controllers/NumberControllerSlider.js | 16 ++ 6 files changed, 196 insertions(+), 95 deletions(-) diff --git a/build/dat.gui.js b/build/dat.gui.js index 55d5d56c..a912149e 100644 --- a/build/dat.gui.js +++ b/build/dat.gui.js @@ -1028,8 +1028,6 @@ return /******/ (function(modules) { // webpackBootstrap * * @param {Object} object The object to be manipulated * @param {string} property The name of the property to be manipulated - * - * @member dat.controllers */ var Controller = function () { function Controller(object, property) { @@ -1192,12 +1190,11 @@ return /******/ (function(modules) { // webpackBootstrap /** * @class Provides a checkbox input to alter the boolean property of an object. + * * @extends dat.controllers.Controller * * @param {Object} object The object to be manipulated * @param {string} property The name of the property to be manipulated - * - * @member dat.controllers */ var BooleanController = function (_Controller) { _inherits(BooleanController, _Controller); @@ -1592,8 +1589,6 @@ return /******/ (function(modules) { // webpackBootstrap * @param {string} property The name of the property to be manipulated * @param {Object|string[]} options A map of labels to acceptable values, or * a list of acceptable string values. - * - * @member dat.controllers */ var OptionController = function (_Controller) { _inherits(OptionController, _Controller); @@ -1703,8 +1698,6 @@ return /******/ (function(modules) { // webpackBootstrap * * @param {Object} object The object to be manipulated * @param {string} property The name of the property to be manipulated - * - * @member dat.controllers */ var StringController = function (_Controller) { _inherits(StringController, _Controller); @@ -1814,8 +1807,6 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Number} [params.min] Minimum allowed value * @param {Number} [params.max] Maximum allowed value * @param {Number} [params.step] Increment by which to change value - * - * @member dat.controllers */ var NumberController = function (_Controller) { @@ -1872,8 +1863,8 @@ return /******/ (function(modules) { // webpackBootstrap */ - NumberController.prototype.min = function min(v) { - this.__min = v; + NumberController.prototype.min = function min(minValue) { + this.__min = minValue; return this; }; @@ -1886,8 +1877,8 @@ return /******/ (function(modules) { // webpackBootstrap */ - NumberController.prototype.max = function max(v) { - this.__max = v; + NumberController.prototype.max = function max(maxValue) { + this.__max = maxValue; return this; }; @@ -1903,10 +1894,10 @@ return /******/ (function(modules) { // webpackBootstrap */ - NumberController.prototype.step = function step(v) { - this.__step = v; - this.__impliedStep = v; - this.__precision = numDecimals(v); + NumberController.prototype.step = function step(stepValue) { + this.__step = stepValue; + this.__impliedStep = stepValue; + this.__precision = numDecimals(stepValue); return this; }; @@ -1973,8 +1964,6 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Number} [params.min] Minimum allowed value * @param {Number} [params.max] Maximum allowed value * @param {Number} [params.step] Increment by which to change value - * - * @member dat.controllers */ var NumberControllerBox = function (_NumberController) { @@ -1995,6 +1984,17 @@ return /******/ (function(modules) { // webpackBootstrap */ var prevY = void 0; + var mousewheelevt = /Firefox/i.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel'; + + function onMouseWheel(e) { + var value = _this.getValue(); + var delta = (e.deltaY || -e.wheelDelta || e.detail) >> 10 || 1; + e.preventDefault(); + + if (delta < 0) value += _this.__impliedStep;else value -= _this.__impliedStep; + _this.setValue(value); + } + function onChange() { var attempted = parseFloat(_this.__input.value); if (!_common2.default.isNaN(attempted)) { @@ -2039,6 +2039,7 @@ return /******/ (function(modules) { // webpackBootstrap _dom2.default.bind(_this2.__input, 'change', onChange); _dom2.default.bind(_this2.__input, 'blur', onBlur); _dom2.default.bind(_this2.__input, 'mousedown', onMouseDown); + _dom2.default.bind(_this2.__input, mousewheelevt, onMouseWheel); _dom2.default.bind(_this2.__input, 'keydown', function (e) { // When pressing enter, you can be as precise as you want. if (e.keyCode === 13) { @@ -2120,8 +2121,6 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Number} minValue Minimum allowed value * @param {Number} maxValue Maximum allowed value * @param {Number} stepValue Increment by which to change value - * - * @member dat.controllers */ var NumberControllerSlider = function (_NumberController) { @@ -2139,12 +2138,27 @@ return /******/ (function(modules) { // webpackBootstrap _dom2.default.bind(_this2.__background, 'mousedown', onMouseDown); + var mousewheelevt = /Firefox/i.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel'; + _dom2.default.bind(_this2.__background, mousewheelevt, onMouseWheel); + _dom2.default.addClass(_this2.__background, 'slider'); _dom2.default.addClass(_this2.__foreground, 'slider-fg'); + function onMouseWheel(e) { + var value = _this.getValue(); + var delta = (e.deltaY || -e.wheelDelta || e.detail) >> 10 || 1; + e.preventDefault(); + document.activeElement.blur(); + + if (delta < 0) value += _this.__impliedStep;else value -= _this.__impliedStep; + _this.setValue(value); + } + function onMouseDown(e) { document.activeElement.blur(); + window.console.log('delete this line'); + _dom2.default.bind(window, 'mousemove', onMouseDrag); _dom2.default.bind(window, 'mouseup', onMouseUp); @@ -2230,8 +2244,6 @@ return /******/ (function(modules) { // webpackBootstrap * * @param {Object} object The object to be manipulated * @param {string} property The name of the property to be manipulated - * - * @member dat.controllers */ var FunctionController = function (_Controller) { _inherits(FunctionController, _Controller); @@ -2321,6 +2333,11 @@ return /******/ (function(modules) { // webpackBootstrap * http://www.apache.org/licenses/LICENSE-2.0 */ + /** + * @class Represents a given property of an object that is a color. + * @param {Object} object + * @param {string} property + */ var ColorController = function (_Controller) { _inherits(ColorController, _Controller); @@ -2705,12 +2722,12 @@ return /******/ (function(modules) { // webpackBootstrap _css2.default.inject(_style2.default); - /** Outer-most className for GUI's */ + /** @ignore Outer-most className for GUI's */ var CSS_NAMESPACE = 'dg'; var HIDE_KEY_CODE = 72; - /** The only value shared between the JS and SCSS. Use caution. */ + /** @ignore The only value shared between the JS and SCSS. Use caution. */ var CLOSE_BUTTON_HEIGHT = 20; var DEFAULT_DEFAULT_PRESET_NAME = 'Default'; @@ -2725,24 +2742,32 @@ return /******/ (function(modules) { // webpackBootstrap var SAVE_DIALOGUE = void 0; - /** Have we yet to create an autoPlace GUI? */ + /** @ignore Have we yet to create an autoPlace GUI? */ var autoPlaceVirgin = true; - /** Fixed position div that auto place GUI's go inside */ + /** @ignore Fixed position div that auto place GUI's go inside */ var autoPlaceContainer = void 0; - /** Are we hiding the GUI's ? */ + /** @ignore Are we hiding the GUI's ? */ var hide = false; - /** GUI's which should be hidden */ + /** @private GUI's which should be hidden */ var hideableGuis = []; /** - * A lightweight controller library for JavaScript. It allows you to easily + * @class A lightweight controller library for JavaScript. It allows you to easily * manipulate variables and fire functions on the fly. - * @class * - * @member dat.gui + * @typicalname gui + * + * @example + * // Creating a GUI with options. + * var gui = new dat.GUI({name: 'My GUI'}); + * + * @example + * // Creating a GUI and a subfolder. + * var gui = new dat.GUI(); + * var folder1 = gui.addFolder('Flow Field'); * * @param {Object} [params] * @param {String} [params.name] The name of this GUI. @@ -2760,7 +2785,7 @@ return /******/ (function(modules) { // webpackBootstrap /** * Outermost DOM Element - * @type DOMElement + * @type {DOMElement} */ this.domElement = document.createElement('div'); this.__ul = document.createElement('ul'); @@ -2844,7 +2869,7 @@ return /******/ (function(modules) { // webpackBootstrap var saveToLocalStorage = void 0; Object.defineProperties(this, - /** @lends dat.gui.GUI.prototype */ + /** @lends GUI.prototype */ { /** * The parent GUI @@ -3149,14 +3174,31 @@ return /******/ (function(modules) { // webpackBootstrap _common2.default.extend(GUI.prototype, - /** @lends dat.gui.GUI */ + /** @lends GUI.prototype */ { /** - * @param object - * @param property - * @returns {dat.controllers.Controller} The new controller that was added. + * Adds a new {@link Controller} to the GUI. The type of controller created + * is inferred from the initial value of object[property]. For + * color properties, see {@link addColor}. + * + * @param {Object} object The object to be manipulated + * @param {String} property The name of the property to be manipulated + * @param {Number} [min] Minimum allowed value + * @param {Number} [max] Maximum allowed value + * @param {Number} [step] Increment by which to change value + * @returns {Controller} The controller that was added to the GUI. * @instance + * + * @example + * // Add a string controller. + * var person = {name: 'Sam'}; + * gui.add(person, 'name'); + * + * @example + * // Add a number controller slider. + * var person = {age: 45}; + * gui.add(person, 'age', 0, 100); */ add: function add(object, property) { return _add(this, object, property, { @@ -3165,10 +3207,24 @@ return /******/ (function(modules) { // webpackBootstrap }, /** + * Adds a new color controller to the GUI. + * * @param object * @param property - * @returns {dat.controllers.ColorController} The new controller that was added. + * @returns {Controller} The controller that was added to the GUI. * @instance + * + * @example + * var palette = { + * color1: '#FF0000', // CSS string + * color2: [ 0, 128, 255 ], // RGB array + * color3: [ 0, 128, 255, 0.3 ], // RGB with alpha + * color4: { h: 350, s: 0.9, v: 0.3 } // Hue, saturation, value + * }; + * gui.addColor(palette, 'color1'); + * gui.addColor(palette, 'color2'); + * gui.addColor(palette, 'color3'); + * gui.addColor(palette, 'color4'); */ addColor: function addColor(object, property) { return _add(this, object, property, { @@ -3177,7 +3233,8 @@ return /******/ (function(modules) { // webpackBootstrap }, /** - * @param controller + * Removes the given controller from the GUI. + * @param {Controller} controller * @instance */ remove: function remove(controller) { @@ -3190,6 +3247,10 @@ return /******/ (function(modules) { // webpackBootstrap }); }, + /** + * Removes the GUI from the document and unbinds all event listeners. + * @instance + */ destroy: function destroy() { if (this.autoPlace) { autoPlaceContainer.removeChild(this.domElement); @@ -3204,6 +3265,7 @@ return /******/ (function(modules) { // webpackBootstrap }, /** + * Creates a new subfolder GUI instance. * @param name * @returns {dat.gui.GUI} The new folder. * @throws {Error} if this GUI already has a folder by the specified @@ -3244,10 +3306,16 @@ return /******/ (function(modules) { // webpackBootstrap return gui; }, + /** + * Opens the GUI. + */ open: function open() { this.closed = false; }, + /** + * Closes the GUI. + */ close: function close() { this.closed = true; }, @@ -3294,9 +3362,10 @@ return /******/ (function(modules) { // webpackBootstrap * the GUI grows. When remembering new objects, append them to the end * of the list. * - * @param {Object...} objects + * @param {...Object} objects * @throws {Error} if not called on a top level GUI. * @instance + * @ignore */ remember: function remember() { if (_common2.default.isUndefined(SAVE_DIALOGUE)) { @@ -3436,6 +3505,8 @@ return /******/ (function(modules) { // webpackBootstrap * @param gui * @param [newDom] If specified, inserts the dom content in the new row * @param [liBefore] If specified, places the new row before another row + * + * @ignore */ function addRow(gui, newDom, liBefore) { var li = document.createElement('li'); @@ -4233,56 +4304,56 @@ return /******/ (function(modules) { // webpackBootstrap /* 24 */ /***/ function(module, exports) { - /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ - // css base code, injected by the css-loader - module.exports = function() { - var list = []; - - // return the list of modules as css string - list.toString = function toString() { - var result = []; - for(var i = 0; i < this.length; i++) { - var item = this[i]; - if(item[2]) { - result.push("@media " + item[2] + "{" + item[1] + "}"); - } else { - result.push(item[1]); - } - } - return result.join(""); - }; - - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; - }; + /* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ + // css base code, injected by the css-loader + module.exports = function() { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + var result = []; + for(var i = 0; i < this.length; i++) { + var item = this[i]; + if(item[2]) { + result.push("@media " + item[2] + "{" + item[1] + "}"); + } else { + result.push(item[1]); + } + } + return result.join(""); + }; + + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } + }; + return list; + }; /***/ } diff --git a/build/dat.gui.js.map b/build/dat.gui.js.map index ea3a4fc2..d47bbce7 100644 --- a/build/dat.gui.js.map +++ b/build/dat.gui.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 53fa7a5fc5b395ea8ce3","webpack:///../index.js","webpack:///./dat/index.js","webpack:///./dat/color/Color.js","webpack:///./dat/color/interpret.js","webpack:///./dat/color/toString.js","webpack:///./dat/utils/common.js","webpack:///./dat/color/math.js","webpack:///./dat/controllers/Controller.js","webpack:///./dat/controllers/BooleanController.js","webpack:///./dat/dom/dom.js","webpack:///./dat/controllers/OptionController.js","webpack:///./dat/controllers/StringController.js","webpack:///./dat/controllers/NumberController.js","webpack:///./dat/controllers/NumberControllerBox.js","webpack:///./dat/controllers/NumberControllerSlider.js","webpack:///./dat/controllers/FunctionController.js","webpack:///./dat/controllers/ColorController.js","webpack:///./dat/gui/GUI.js","webpack:///./dat/utils/css.js","webpack:///./dat/gui/saveDialogue.html","webpack:///./dat/controllers/ControllerFactory.js","webpack:///./dat/utils/requestAnimationFrame.js","webpack:///./dat/dom/CenteredDiv.js","webpack:///./dat/gui/style.scss","webpack:///../~/css-loader/lib/css-base.js"],"names":["color","Color","math","interpret","controllers","Controller","BooleanController","OptionController","StringController","NumberController","NumberControllerBox","NumberControllerSlider","FunctionController","ColorController","dom","gui","GUI","__state","apply","arguments","Error","a","toString","toHexString","toOriginal","conversion","write","defineRGBComponent","target","component","componentHexIndex","Object","defineProperty","get","space","recalculateRGB","set","v","defineHSVComponent","recalculateHSV","component_from_hex","hex","extend","hsv_to_rgb","h","s","result","rgb_to_hsv","r","g","b","isNaN","isUndefined","COMPONENTS","prototype","rgb_to_hex","INTERPRETATIONS","litmus","isString","conversions","THREE_CHAR_HEX","read","original","test","match","parseInt","SIX_CHAR_HEX","CSS_RGB","parseFloat","CSS_RGBA","isNumber","HEX","conversionName","isArray","RGB_ARRAY","length","RGBA_ARRAY","isObject","RGBA_OBJ","RGB_OBJ","HSVA_OBJ","HSV_OBJ","toReturn","toArray","each","family","BREAK","forceCSSHex","colorFormat","Math","round","toFixed","str","ARR_EACH","Array","forEach","ARR_SLICE","slice","Common","call","obj","keys","key","bind","defaults","compose","toCall","args","i","itr","scope","l","defer","fnc","setTimeout","debounce","func","threshold","callImmediately","timeout","delayed","callNow","clearTimeout","undefined","isNull","constructor","isBoolean","isFunction","tmpComponent","ColorMath","hi","floor","f","p","q","t","c","min","max","delta","NaN","hex_with_component","componentIndex","value","object","property","initialValue","domElement","document","createElement","__onChange","__onFinishChange","onChange","onFinishChange","setValue","newValue","updateDisplay","getValue","isModified","_this","__prev","__checkbox","setAttribute","appendChild","checked","EVENT_MAP","HTMLEvents","MouseEvents","KeyboardEvents","EVENT_MAP_INV","k","e","CSS_VALUE_PIXELS","cssValueToPixels","val","makeSelectable","elem","selectable","style","onselectstart","MozUserSelect","KhtmlUserSelect","unselectable","makeFullscreen","hor","vert","vertical","horizontal","position","left","right","top","bottom","fakeEvent","eventType","pars","aux","params","className","evt","createEvent","clientX","x","clientY","y","initMouseEvent","bubbles","cancelable","window","clickCount","init","initKeyboardEvent","initKeyEvent","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode","initEvent","dispatchEvent","event","newBool","bool","addEventListener","attachEvent","unbind","removeEventListener","detachEvent","addClass","classes","split","indexOf","push","join","replace","removeClass","removeAttribute","index","splice","hasClass","RegExp","getWidth","getComputedStyle","width","getHeight","height","getOffset","el","offset","offsetParent","offsetLeft","offsetTop","isActive","activeElement","type","href","opts","options","__select","map","element","opt","innerHTML","desiredValue","selectedIndex","__input","onBlur","blur","numDecimals","_x","_params","__min","__max","__step","step","__impliedStep","pow","log","abs","LN10","__precision","_v","roundToDecimal","decimals","tenTo","__truncationSuspended","prevY","attempted","onFinish","onMouseDrag","diff","onMouseUp","onMouseDown","i1","i2","o1","o2","__background","__foreground","preventDefault","bgRect","getBoundingClientRect","pct","text","__button","fire","__color","__temp","__selector","__saturation_field","__field_knob","__field_knob_border","__hue_knob","__hue_field","__input_textShadow","valueField","padding","backgroundColor","boxShadow","border","borderRadius","zIndex","borderRight","marginRight","display","cursor","background","linearGradient","hueGradient","outline","textAlign","fontWeight","textShadow","fieldDown","setH","fieldUpH","setSV","fieldUpSV","fieldRect","mismatch","flip","_flip","marginLeft","marginTop","vendors","vendor","cssText","inject","CSS_NAMESPACE","HIDE_KEY_CODE","CLOSE_BUTTON_HEIGHT","DEFAULT_DEFAULT_PRESET_NAME","SUPPORTS_LOCAL_STORAGE","localStorage","SAVE_DIALOGUE","autoPlaceVirgin","autoPlaceContainer","hide","hideableGuis","__ul","__folders","__controllers","__rememberedObjects","__rememberedObjectIndecesToControllers","__listening","closeOnTop","autoPlace","DEFAULT_WIDTH","resizable","hideable","load","preset","parent","scrollable","useLocalStorage","getItem","getLocalStorageHash","saveToLocalStorage","defineProperties","getRoot","setPresetSelectIndex","revert","setWidth","name","titleRowName","closed","CLASS_CLOSED","onResize","__closeButton","TEXT_OPEN","TEXT_CLOSED","setItem","CLASS_MAIN","savedGui","JSON","parse","CLASS_CLOSE_BUTTON","CLASS_CLOSE_TOP","insertBefore","childNodes","CLASS_CLOSE_BOTTOM","createTextNode","titleRow","addRow","onClickTitle","CLASS_AUTO_PLACE_CONTAINER","body","CLASS_AUTO_PLACE","__resizeHandler","onResizeDebounced","addResizeHandle","stringify","getSaveObject","saveToLocalStorageIfPossible","resetWidth","root","toggleHide","CLASS_CONTROLLER_ROW","CLASS_TOO_TALL","CLASS_DRAG","_keydownHandler","which","add","factoryArgs","addColor","remove","controller","removeChild","__li","destroy","addFolder","newGuiParams","folders","li","open","close","node","__save_row","innerHeight","__resize_handle","offsetHeight","remember","addSaveMenu","remembered","getCurrentPreset","save","markPresetModified","saveAs","presetName","addPresetOption","recallSavedValue","folder","listen","updateDisplays","newDom","liBefore","modified","__preset_select","augmentController","__gui","nextSibling","nextElementSibling","before","firstElementChild","box","method","pc","pb","returned","oldName","wasListening","newController","stopPropagation","borderLeftColor","matchedIndex","controllerMap","presetMap","concat","container","location","setSelected","showHideExplain","explain","div","firstChild","gears","button","button2","button3","select","getElementById","localStorageCheckBox","saveLocally","newConstructorTextArea","show","focus","prompt","pmouseX","drag","dragStop","dragStart","w","useInitialValues","savedValues","controllerArray","module","exports","url","indoc","doc","link","rel","getElementsByTagName","css","injected","head","ControllerFactory","requestAnimationFrame","callback","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","CenteredDiv","backgroundElement","opacity","WebkitTransition","transition","webkitTransform","layout","innerWidth"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;ACzBA;;;;;;oCAbA;;;;;;;;;;;;;;;;;;;;;;;ACaA;;;;AACA;;;;AACA;;;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AAEA;;;;AACA;;;;;;AA5BA;;;;;;;;;;;;;mBA8Be;AACbA,UAAO;AACLC,2BADK;AAELC,yBAFK;AAGLC;AAHK,IADM;;AAObC,gBAAa;AACXC,qCADW;AAEXC,mDAFW;AAGXC,iDAHW;AAIXC,iDAJW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yCAAyC,2BAA2B,4BAA4B,EAAE,yBAAyB,0BAA0B,uCAAuC,EAAE,qBAAqB,wBAAwB,0BAA0B,gBAAgB,EAAE,8BAA8B,yBAAyB,qBAAqB,EAAE,+BAA+B,yBAAyB,wBAAwB,2BAA2B,uBAAuB,yBAAyB,iCAAiC,4BAA4B,oBAAoB,qCAAqC,qCAAqC,wBAAwB,EAAE,uCAAuC,iDAAiD,mfAAmf,sBAAsB,qBAAqB,EAAE,uCAAuC,oCAAoC,uCAAuC,EAAE,mBAAmB,uBAAuB,EAAE,kBAAkB,yBAAyB,0CAA0C,wGAAwG,sBAAsB,wDAAwD,EAAE,0BAA0B,2CAA2C,qFAAqF,EAAE,qBAAqB,qCAAqC,EAAE,mBAAmB,6BAA6B,EAAE,sBAAsB,qCAAqC,EAAE,oBAAoB,qCAAqC,EAAE,uCAAuC,uBAAuB,EAAE,oBAAoB,qCAAqC,EAAE,uCAAuC,uBAAuB,EAAE,mDAAmD,uBAAuB,EAAE,6BAA6B,0BAA0B,oBAAoB,EAAE,qCAAqC,4BAA4B,EAAE,qCAAqC,4BAA4B,oBAAoB,EAAE,oBAAoB,0BAA0B,wBAAwB,EAAE,uBAAuB,0BAA0B,sBAAsB,EAAE,0BAA0B,0BAA0B,EAAE,uCAAuC,4BAA4B,EAAE;;AAErhR;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAgB,iBAAiB;AACjC;AACA;AACA,yCAAwC,gBAAgB;AACxD,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,aAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"dat.gui.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dat\"] = factory();\n\telse\n\t\troot[\"dat\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 53fa7a5fc5b395ea8ce3","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dat from './src/dat/index';\n\nexport default dat;\n\n\n\n// WEBPACK FOOTER //\n// ../index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Color from './color/Color';\nimport math from './color/math';\nimport interpret from './color/interpret';\n\nimport Controller from './controllers/Controller';\nimport BooleanController from './controllers/BooleanController';\nimport OptionController from './controllers/OptionController';\nimport StringController from './controllers/StringController';\nimport NumberController from './controllers/NumberController';\nimport NumberControllerBox from './controllers/NumberControllerBox';\nimport NumberControllerSlider from './controllers/NumberControllerSlider';\nimport FunctionController from './controllers/FunctionController';\nimport ColorController from './controllers/ColorController';\n\nimport dom from './dom/dom';\nimport GUI from './gui/GUI';\n\nexport default {\n color: {\n Color: Color,\n math: math,\n interpret: interpret\n },\n\n controllers: {\n Controller: Controller,\n BooleanController: BooleanController,\n OptionController: OptionController,\n StringController: StringController,\n NumberController: NumberController,\n NumberControllerBox: NumberControllerBox,\n NumberControllerSlider: NumberControllerSlider,\n FunctionController: FunctionController,\n ColorController: ColorController\n },\n\n dom: {\n dom: dom\n },\n\n gui: {\n GUI: GUI\n },\n\n GUI: GUI\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport interpret from './interpret';\nimport math from './math';\nimport colorToString from './toString';\nimport common from '../utils/common';\n\nclass Color {\n constructor() {\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw new Error('Failed to interpret color arguments');\n }\n\n this.__state.a = this.__state.a || 1;\n }\n\n toString() {\n return colorToString(this);\n }\n\n toHexString() {\n return colorToString(this, true);\n }\n\n toOriginal() {\n return this.__state.conversion.write(this);\n }\n}\n\nfunction defineRGBComponent(target, component, componentHexIndex) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n Color.recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'RGB') {\n Color.recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\nfunction defineHSVComponent(target, component) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'HSV') {\n return this.__state[component];\n }\n\n Color.recalculateHSV(this);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'HSV') {\n Color.recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\n\nColor.recalculateRGB = function(color, component, componentHexIndex) {\n if (color.__state.space === 'HEX') {\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n } else if (color.__state.space === 'HSV') {\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n } else {\n throw new Error('Corrupted color state');\n }\n};\n\nColor.recalculateHSV = function(color) {\n const result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n};\n\nColor.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a'];\n\ndefineRGBComponent(Color.prototype, 'r', 2);\ndefineRGBComponent(Color.prototype, 'g', 1);\ndefineRGBComponent(Color.prototype, 'b', 0);\n\ndefineHSVComponent(Color.prototype, 'h');\ndefineHSVComponent(Color.prototype, 's');\ndefineHSVComponent(Color.prototype, 'v');\n\nObject.defineProperty(Color.prototype, 'a', {\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n});\n\nObject.defineProperty(Color.prototype, 'hex', {\n get: function() {\n if (!this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n }\n\n return this.__state.hex;\n },\n\n set: function(v) {\n this.__state.space = 'HEX';\n this.__state.hex = v;\n }\n});\n\nexport default Color;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/Color.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport toString from './toString';\nimport common from '../utils/common';\n\nconst INTERPRETATIONS = [\n // Strings\n {\n litmus: common.isString,\n conversions: {\n THREE_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt(\n '0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString(), 0)\n };\n },\n\n write: toString\n },\n\n SIX_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString(), 0)\n };\n },\n\n write: toString\n },\n\n CSS_RGB: {\n read: function(original) {\n const test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n },\n\n write: toString\n },\n\n CSS_RGBA: {\n read: function(original) {\n const test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n },\n\n write: toString\n }\n }\n },\n\n // Numbers\n {\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n };\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n litmus: common.isArray,\n conversions: {\n RGB_ARRAY: {\n read: function(original) {\n if (original.length !== 3) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length !== 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n }\n }\n },\n\n // Objects\n {\n litmus: common.isObject,\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n };\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n };\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n };\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n };\n }\n }\n }\n }\n];\n\nlet result;\nlet toReturn;\n\nconst interpret = function() {\n toReturn = false;\n\n const original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n common.each(INTERPRETATIONS, function(family) {\n if (family.litmus(original)) {\n common.each(family.conversions, function(conversion, conversionName) {\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n }\n });\n\n return common.BREAK;\n }\n });\n\n return toReturn;\n};\n\nexport default interpret;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/interpret.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nexport default function(color, forceCSSHex) {\n const colorFormat = color.__state.conversionName.toString();\n\n const r = Math.round(color.r);\n const g = Math.round(color.g);\n const b = Math.round(color.b);\n const a = color.a;\n const h = Math.round(color.h);\n const s = color.s.toFixed(1);\n const v = color.v.toFixed(1);\n\n if (forceCSSHex || (colorFormat === 'THREE_CHAR_HEX') || (colorFormat === 'SIX_CHAR_HEX')) {\n let str = color.hex.toString(16);\n while (str.length < 6) {\n str = '0' + str;\n }\n return '#' + str;\n } else if (colorFormat === 'CSS_RGB') {\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n } else if (colorFormat === 'CSS_RGBA') {\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n } else if (colorFormat === 'HEX') {\n return '0x' + color.hex.toString(16);\n } else if (colorFormat === 'RGB_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ']';\n } else if (colorFormat === 'RGBA_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ',' + a + ']';\n } else if (colorFormat === 'RGB_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + '}';\n } else if (colorFormat === 'RGBA_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}';\n } else if (colorFormat === 'HSV_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + '}';\n } else if (colorFormat === 'HSVA_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}';\n }\n\n return 'unknown format';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/toString.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nconst ARR_EACH = Array.prototype.forEach;\nconst ARR_SLICE = Array.prototype.slice;\n\n/**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\nconst Common = {\n BREAK: {},\n\n extend: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (!this.isUndefined(obj[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n defaults: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (this.isUndefined(target[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n compose: function() {\n const toCall = ARR_SLICE.call(arguments);\n return function() {\n let args = ARR_SLICE.call(arguments);\n for (let i = toCall.length - 1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n };\n },\n\n each: function(obj, itr, scope) {\n if (!obj) {\n return;\n }\n\n if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) {\n obj.forEach(itr, scope);\n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n let key;\n let l;\n for (key = 0, l = obj.length; key < l; key++) {\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n } else {\n for (const key in obj) {\n if (itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n }\n },\n\n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n\n // if the function is called repeatedly, wait until threshold passes until we execute the function\n debounce: function(func, threshold, callImmediately) {\n let timeout;\n\n return function() {\n const obj = this;\n const args = arguments;\n function delayed() {\n timeout = null;\n if (!callImmediately) func.apply(obj, args);\n }\n\n const callNow = callImmediately || !timeout;\n\n clearTimeout(timeout);\n timeout = setTimeout(delayed, threshold);\n\n if (callNow) {\n func.apply(obj, args);\n }\n };\n },\n\n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n\n isNull: function(obj) {\n return obj === null;\n },\n\n isNaN: function(obj) {\n return isNaN(obj);\n },\n\n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n\n isObject: function(obj) {\n return obj === Object(obj);\n },\n\n isNumber: function(obj) {\n return obj === obj + 0;\n },\n\n isString: function(obj) {\n return obj === obj + '';\n },\n\n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n\n isFunction: function(obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n }\n\n};\n\nexport default Common;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/common.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nlet tmpComponent;\n\nconst ColorMath = {\n hsv_to_rgb: function(h, s, v) {\n const hi = Math.floor(h / 60) % 6;\n\n const f = h / 60 - Math.floor(h / 60);\n const p = v * (1.0 - s);\n const q = v * (1.0 - (f * s));\n const t = v * (1.0 - ((1.0 - f) * s));\n\n const c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n },\n\n rgb_to_hsv: function(r, g, b) {\n const min = Math.min(r, g, b);\n const max = Math.max(r, g, b);\n const delta = max - min;\n let h;\n let s;\n\n if (max !== 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n let hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~(0xFF << tmpComponent));\n }\n};\n\nexport default ColorMath;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/math.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/**\n * @class An \"abstract\" class that represents a given property of an object.\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\nclass Controller {\n constructor(object, property) {\n this.initialValue = object[property];\n\n /**\n * Those who extend this class will put their DOM elements in here.\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n\n /**\n * The object to manipulate\n * @type {Object}\n */\n this.object = object;\n\n /**\n * The name of the property to manipulate\n * @type {String}\n */\n this.property = property;\n\n /**\n * The function to be called on change.\n * @type {Function}\n * @ignore\n */\n this.__onChange = undefined;\n\n /**\n * The function to be called on finishing change.\n * @type {Function}\n * @ignore\n */\n this.__onFinishChange = undefined;\n }\n\n /**\n * Specify that a function fire every time someone changes the value with\n * this Controller.\n *\n * @param {Function} fnc This function will be called whenever the value\n * is modified via this Controller.\n * @returns {Controller} this\n */\n onChange(fnc) {\n this.__onChange = fnc;\n return this;\n }\n\n /**\n * Specify that a function fire every time someone \"finishes\" changing\n * the value wih this Controller. Useful for values that change\n * incrementally like numbers or strings.\n *\n * @param {Function} fnc This function will be called whenever\n * someone \"finishes\" changing the value via this Controller.\n * @returns {Controller} this\n */\n onFinishChange(fnc) {\n this.__onFinishChange = fnc;\n return this;\n }\n\n /**\n * Change the value of object[property]\n *\n * @param {Object} newValue The new value of object[property]\n */\n setValue(newValue) {\n this.object[this.property] = newValue;\n if (this.__onChange) {\n this.__onChange.call(this, newValue);\n }\n\n this.updateDisplay();\n return this;\n }\n\n /**\n * Gets the value of object[property]\n *\n * @returns {Object} The current value of object[property]\n */\n getValue() {\n return this.object[this.property];\n }\n\n /**\n * Refreshes the visual display of a Controller in order to keep sync\n * with the object's current value.\n * @returns {Controller} this\n */\n updateDisplay() {\n return this;\n }\n\n /**\n * @returns {Boolean} true if the value has deviated from initialValue\n */\n isModified() {\n return this.initialValue !== this.getValue();\n }\n}\n\nexport default Controller;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/Controller.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a checkbox input to alter the boolean property of an object.\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\nclass BooleanController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n this.__prev = this.getValue();\n\n this.__checkbox = document.createElement('input');\n this.__checkbox.setAttribute('type', 'checkbox');\n\n function onChange() {\n _this.setValue(!_this.__prev);\n }\n\n dom.bind(this.__checkbox, 'change', onChange, false);\n\n this.domElement.appendChild(this.__checkbox);\n\n // Match original value\n this.updateDisplay();\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.__prev = this.getValue();\n return toReturn;\n }\n\n updateDisplay() {\n if (this.getValue() === true) {\n this.__checkbox.setAttribute('checked', 'checked');\n this.__checkbox.checked = true;\n this.__prev = true;\n } else {\n this.__checkbox.checked = false;\n this.__prev = false;\n }\n\n return super.updateDisplay();\n }\n}\n\nexport default BooleanController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/BooleanController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport common from '../utils/common';\n\nconst EVENT_MAP = {\n HTMLEvents: ['change'],\n MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],\n KeyboardEvents: ['keydown']\n};\n\nconst EVENT_MAP_INV = {};\ncommon.each(EVENT_MAP, function(v, k) {\n common.each(v, function(e) {\n EVENT_MAP_INV[e] = k;\n });\n});\n\nconst CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\n\nfunction cssValueToPixels(val) {\n if (val === '0' || common.isUndefined(val)) {\n return 0;\n }\n\n const match = val.match(CSS_VALUE_PIXELS);\n\n if (!common.isNull(match)) {\n return parseFloat(match[1]);\n }\n\n // TODO ...ems? %?\n\n return 0;\n}\n\n/**\n * @namespace\n * @member dat.dom\n */\nconst dom = {\n\n /**\n *\n * @param elem\n * @param selectable\n */\n makeSelectable: function(elem, selectable) {\n if (elem === undefined || elem.style === undefined) return;\n\n elem.onselectstart = selectable ? function() {\n return false;\n } : function() {\n };\n\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\n elem.unselectable = selectable ? 'on' : 'off';\n },\n\n /**\n *\n * @param elem\n * @param horizontal\n * @param vert\n */\n makeFullscreen: function(elem, hor, vert) {\n let vertical = vert;\n let horizontal = hor;\n\n if (common.isUndefined(horizontal)) {\n horizontal = true;\n }\n\n if (common.isUndefined(vertical)) {\n vertical = true;\n }\n\n elem.style.position = 'absolute';\n\n if (horizontal) {\n elem.style.left = 0;\n elem.style.right = 0;\n }\n if (vertical) {\n elem.style.top = 0;\n elem.style.bottom = 0;\n }\n },\n\n /**\n *\n * @param elem\n * @param eventType\n * @param params\n */\n fakeEvent: function(elem, eventType, pars, aux) {\n const params = pars || {};\n const className = EVENT_MAP_INV[eventType];\n if (!className) {\n throw new Error('Event type ' + eventType + ' not supported.');\n }\n const evt = document.createEvent(className);\n switch (className) {\n case 'MouseEvents':\n {\n const clientX = params.x || params.clientX || 0;\n const clientY = params.y || params.clientY || 0;\n evt.initMouseEvent(eventType, params.bubbles || false,\n params.cancelable || true, window, params.clickCount || 1,\n 0, // screen X\n 0, // screen Y\n clientX, // client X\n clientY, // client Y\n false, false, false, false, 0, null);\n break;\n }\n case 'KeyboardEvents':\n {\n const init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz\n common.defaults(params, {\n cancelable: true,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n keyCode: undefined,\n charCode: undefined\n });\n init(eventType, params.bubbles || false,\n params.cancelable, window,\n params.ctrlKey, params.altKey,\n params.shiftKey, params.metaKey,\n params.keyCode, params.charCode);\n break;\n }\n default:\n {\n evt.initEvent(eventType, params.bubbles || false, params.cancelable || true);\n break;\n }\n }\n common.defaults(evt, aux);\n elem.dispatchEvent(evt);\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n bind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.addEventListener) {\n elem.addEventListener(event, func, bool);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n unbind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.removeEventListener) {\n elem.removeEventListener(event, func, bool);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n addClass: function(elem, className) {\n if (elem.className === undefined) {\n elem.className = className;\n } else if (elem.className !== className) {\n const classes = elem.className.split(/ +/);\n if (classes.indexOf(className) === -1) {\n classes.push(className);\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\n }\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n removeClass: function(elem, className) {\n if (className) {\n if (elem.className === className) {\n elem.removeAttribute('class');\n } else {\n const classes = elem.className.split(/ +/);\n const index = classes.indexOf(className);\n if (index !== -1) {\n classes.splice(index, 1);\n elem.className = classes.join(' ');\n }\n }\n } else {\n elem.className = undefined;\n }\n return dom;\n },\n\n hasClass: function(elem, className) {\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\n },\n\n /**\n *\n * @param elem\n */\n getWidth: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-left-width']) +\n cssValueToPixels(style['border-right-width']) +\n cssValueToPixels(style['padding-left']) +\n cssValueToPixels(style['padding-right']) +\n cssValueToPixels(style.width);\n },\n\n /**\n *\n * @param elem\n */\n getHeight: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-top-width']) +\n cssValueToPixels(style['border-bottom-width']) +\n cssValueToPixels(style['padding-top']) +\n cssValueToPixels(style['padding-bottom']) +\n cssValueToPixels(style.height);\n },\n\n /**\n *\n * @param el\n */\n getOffset: function(el) {\n let elem = el;\n const offset = { left: 0, top: 0 };\n if (elem.offsetParent) {\n do {\n offset.left += elem.offsetLeft;\n offset.top += elem.offsetTop;\n elem = elem.offsetParent;\n } while (elem);\n }\n return offset;\n },\n\n // http://stackoverflow.com/posts/2684561/revisions\n /**\n *\n * @param elem\n */\n isActive: function(elem) {\n return elem === document.activeElement && (elem.type || elem.href);\n }\n\n};\n\nexport default dom;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/dom.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\n/**\n * @class Provides a select input to alter the property of an object, using a\n * list of accepted values.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object|string[]} options A map of labels to acceptable values, or\n * a list of acceptable string values.\n *\n * @member dat.controllers\n */\nclass OptionController extends Controller {\n constructor(object, property, opts) {\n super(object, property);\n\n let options = opts;\n\n const _this = this;\n\n /**\n * The drop down menu\n * @ignore\n */\n this.__select = document.createElement('select');\n\n if (common.isArray(options)) {\n const map = {};\n common.each(options, function(element) {\n map[element] = element;\n });\n options = map;\n }\n\n common.each(options, function(value, key) {\n const opt = document.createElement('option');\n opt.innerHTML = key;\n opt.setAttribute('value', value);\n _this.__select.appendChild(opt);\n });\n\n // Acknowledge original value\n this.updateDisplay();\n\n dom.bind(this.__select, 'change', function() {\n const desiredValue = this.options[this.selectedIndex].value;\n _this.setValue(desiredValue);\n });\n\n this.domElement.appendChild(this.__select);\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n return toReturn;\n }\n\n updateDisplay() {\n if (dom.isActive(this.__select)) return this; // prevent number from updating if user is trying to manually update\n this.__select.value = this.getValue();\n return super.updateDisplay();\n }\n}\n\nexport default OptionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/OptionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a text input to alter the string property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\nclass StringController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n\n function onChange() {\n _this.setValue(_this.__input.value);\n }\n\n function onBlur() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n dom.bind(this.__input, 'keyup', onChange);\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) {\n this.blur();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n // Stops the caret from moving on account of:\n // keyup -> setValue -> updateDisplay\n if (!dom.isActive(this.__input)) {\n this.__input.value = this.getValue();\n }\n return super.updateDisplay();\n }\n}\n\nexport default StringController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/StringController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport common from '../utils/common';\n\nfunction numDecimals(x) {\n const _x = x.toString();\n if (_x.indexOf('.') > -1) {\n return _x.length - _x.indexOf('.') - 1;\n }\n\n return 0;\n}\n\n/**\n * @class Represents a given property of an object that is a number.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n *\n * @member dat.controllers\n */\nclass NumberController extends Controller {\n constructor(object, property, params) {\n super(object, property);\n\n const _params = params || {};\n\n this.__min = _params.min;\n this.__max = _params.max;\n this.__step = _params.step;\n\n if (common.isUndefined(this.__step)) {\n if (this.initialValue === 0) {\n this.__impliedStep = 1; // What are we, psychics?\n } else {\n // Hey Doug, check this out.\n this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(this.initialValue)) / Math.LN10)) / 10;\n }\n } else {\n this.__impliedStep = this.__step;\n }\n\n this.__precision = numDecimals(this.__impliedStep);\n }\n\n setValue(v) {\n let _v = v;\n\n if (this.__min !== undefined && _v < this.__min) {\n _v = this.__min;\n } else if (this.__max !== undefined && _v > this.__max) {\n _v = this.__max;\n }\n\n if (this.__step !== undefined && _v % this.__step !== 0) {\n _v = Math.round(_v / this.__step) * this.__step;\n }\n\n return super.setValue(_v);\n }\n\n /**\n * Specify a minimum value for object[property].\n *\n * @param {Number} minValue The minimum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n min(v) {\n this.__min = v;\n return this;\n }\n\n /**\n * Specify a maximum value for object[property].\n *\n * @param {Number} maxValue The maximum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n max(v) {\n this.__max = v;\n return this;\n }\n\n /**\n * Specify a step value that dat.controllers.NumberController\n * increments by.\n *\n * @param {Number} stepValue The step value for\n * dat.controllers.NumberController\n * @default if minimum and maximum specified increment is 1% of the\n * difference otherwise stepValue is 1\n * @returns {dat.controllers.NumberController} this\n */\n step(v) {\n this.__step = v;\n this.__impliedStep = v;\n this.__precision = numDecimals(v);\n return this;\n }\n}\n\nexport default NumberController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nfunction roundToDecimal(value, decimals) {\n const tenTo = Math.pow(10, decimals);\n return Math.round(value * tenTo) / tenTo;\n}\n\n/**\n * @class Represents a given property of an object that is a number and\n * provides an input element with which to manipulate it.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n *\n * @member dat.controllers\n */\nclass NumberControllerBox extends NumberController {\n constructor(object, property, params) {\n super(object, property, params);\n\n this.__truncationSuspended = false;\n\n const _this = this;\n\n /**\n * {Number} Previous mouse y position\n * @ignore\n */\n let prevY;\n\n function onChange() {\n const attempted = parseFloat(_this.__input.value);\n if (!common.isNaN(attempted)) {\n _this.setValue(attempted);\n }\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n function onBlur() {\n onFinish();\n }\n\n function onMouseDrag(e) {\n const diff = prevY - e.clientY;\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\n\n prevY = e.clientY;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n onFinish();\n }\n\n function onMouseDown(e) {\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n prevY = e.clientY;\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n // Makes it so manually specified values are not truncated.\n\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'mousedown', onMouseDown);\n dom.bind(this.__input, 'keydown', function(e) {\n // When pressing enter, you can be as precise as you want.\n if (e.keyCode === 13) {\n _this.__truncationSuspended = true;\n this.blur();\n _this.__truncationSuspended = false;\n onFinish();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerBox;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerBox.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\n\nfunction map(v, i1, i2, o1, o2) {\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\n}\n\n/**\n * @class Represents a given property of an object that is a number, contains\n * a minimum and maximum, and provides a slider element with which to\n * manipulate it. It should be noted that the slider element is made up of\n * <div> tags, not the html5\n * <slider> element.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Number} minValue Minimum allowed value\n * @param {Number} maxValue Maximum allowed value\n * @param {Number} stepValue Increment by which to change value\n *\n * @member dat.controllers\n */\nclass NumberControllerSlider extends NumberController {\n constructor(object, property, min, max, step) {\n super(object, property, { min: min, max: max, step: step });\n\n const _this = this;\n\n this.__background = document.createElement('div');\n this.__foreground = document.createElement('div');\n\n dom.bind(this.__background, 'mousedown', onMouseDown);\n\n dom.addClass(this.__background, 'slider');\n dom.addClass(this.__foreground, 'slider-fg');\n\n function onMouseDown(e) {\n document.activeElement.blur();\n\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n\n onMouseDrag(e);\n }\n\n function onMouseDrag(e) {\n e.preventDefault();\n\n const bgRect = _this.__background.getBoundingClientRect();\n\n _this.setValue(\n map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)\n );\n\n return false;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.__background.appendChild(this.__foreground);\n this.domElement.appendChild(this.__background);\n }\n\n updateDisplay() {\n const pct = (this.getValue() - this.__min) / (this.__max - this.__min);\n this.__foreground.style.width = pct * 100 + '%';\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerSlider.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a GUI interface to fire a specified method, a property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n *\n * @member dat.controllers\n */\nclass FunctionController extends Controller {\n constructor(object, property, text) {\n super(object, property);\n\n const _this = this;\n\n this.__button = document.createElement('div');\n this.__button.innerHTML = text === undefined ? 'Fire' : text;\n\n dom.bind(this.__button, 'click', function(e) {\n e.preventDefault();\n _this.fire();\n return false;\n });\n\n dom.addClass(this.__button, 'button');\n\n this.domElement.appendChild(this.__button);\n }\n\n fire() {\n if (this.__onChange) {\n this.__onChange.call(this);\n }\n this.getValue().call(this.object);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n }\n}\n\nexport default FunctionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/FunctionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport Color from '../color/Color';\nimport interpret from '../color/interpret';\nimport common from '../utils/common';\n\nclass ColorController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n this.__color = new Color(this.getValue());\n this.__temp = new Color(0);\n\n const _this = this;\n\n this.domElement = document.createElement('div');\n\n dom.makeSelectable(this.domElement, false);\n\n this.__selector = document.createElement('div');\n this.__selector.className = 'selector';\n\n this.__saturation_field = document.createElement('div');\n this.__saturation_field.className = 'saturation-field';\n\n this.__field_knob = document.createElement('div');\n this.__field_knob.className = 'field-knob';\n this.__field_knob_border = '2px solid ';\n\n this.__hue_knob = document.createElement('div');\n this.__hue_knob.className = 'hue-knob';\n\n this.__hue_field = document.createElement('div');\n this.__hue_field.className = 'hue-field';\n\n this.__input = document.createElement('input');\n this.__input.type = 'text';\n this.__input_textShadow = '0 1px 1px ';\n\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) { // on enter\n onBlur.call(this);\n }\n });\n\n dom.bind(this.__input, 'blur', onBlur);\n\n dom.bind(this.__selector, 'mousedown', function(/* e */) {\n dom\n .addClass(this, 'drag')\n .bind(window, 'mouseup', function(/* e */) {\n dom.removeClass(_this.__selector, 'drag');\n });\n });\n\n const valueField = document.createElement('div');\n\n common.extend(this.__selector.style, {\n width: '122px',\n height: '102px',\n padding: '3px',\n backgroundColor: '#222',\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\n });\n\n common.extend(this.__field_knob.style, {\n position: 'absolute',\n width: '12px',\n height: '12px',\n border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\n borderRadius: '12px',\n zIndex: 1\n });\n\n common.extend(this.__hue_knob.style, {\n position: 'absolute',\n width: '15px',\n height: '2px',\n borderRight: '4px solid #fff',\n zIndex: 1\n });\n\n common.extend(this.__saturation_field.style, {\n width: '100px',\n height: '100px',\n border: '1px solid #555',\n marginRight: '3px',\n display: 'inline-block',\n cursor: 'pointer'\n });\n\n common.extend(valueField.style, {\n width: '100%',\n height: '100%',\n background: 'none'\n });\n\n linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000');\n\n common.extend(this.__hue_field.style, {\n width: '15px',\n height: '100px',\n border: '1px solid #555',\n cursor: 'ns-resize',\n position: 'absolute',\n top: '3px',\n right: '3px'\n });\n\n hueGradient(this.__hue_field);\n\n common.extend(this.__input.style, {\n outline: 'none',\n// width: '120px',\n textAlign: 'center',\n// padding: '4px',\n// marginBottom: '6px',\n color: '#fff',\n border: 0,\n fontWeight: 'bold',\n textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'\n });\n\n dom.bind(this.__saturation_field, 'mousedown', fieldDown);\n dom.bind(this.__field_knob, 'mousedown', fieldDown);\n\n dom.bind(this.__hue_field, 'mousedown', function(e) {\n setH(e);\n dom.bind(window, 'mousemove', setH);\n dom.bind(window, 'mouseup', fieldUpH);\n });\n\n function fieldDown(e) {\n setSV(e);\n // document.body.style.cursor = 'none';\n dom.bind(window, 'mousemove', setSV);\n dom.bind(window, 'mouseup', fieldUpSV);\n }\n\n function fieldUpSV() {\n dom.unbind(window, 'mousemove', setSV);\n dom.unbind(window, 'mouseup', fieldUpSV);\n // document.body.style.cursor = 'default';\n onFinish();\n }\n\n function onBlur() {\n const i = interpret(this.value);\n if (i !== false) {\n _this.__color.__state = i;\n _this.setValue(_this.__color.toOriginal());\n } else {\n this.value = _this.__color.toString();\n }\n }\n\n function fieldUpH() {\n dom.unbind(window, 'mousemove', setH);\n dom.unbind(window, 'mouseup', fieldUpH);\n onFinish();\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.__color.toOriginal());\n }\n }\n\n this.__saturation_field.appendChild(valueField);\n this.__selector.appendChild(this.__field_knob);\n this.__selector.appendChild(this.__saturation_field);\n this.__selector.appendChild(this.__hue_field);\n this.__hue_field.appendChild(this.__hue_knob);\n\n this.domElement.appendChild(this.__input);\n this.domElement.appendChild(this.__selector);\n\n this.updateDisplay();\n\n function setSV(e) {\n e.preventDefault();\n\n const fieldRect = _this.__saturation_field.getBoundingClientRect();\n let s = (e.clientX - fieldRect.left) / (fieldRect.right - fieldRect.left);\n let v = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (v > 1) {\n v = 1;\n } else if (v < 0) {\n v = 0;\n }\n\n if (s > 1) {\n s = 1;\n } else if (s < 0) {\n s = 0;\n }\n\n _this.__color.v = v;\n _this.__color.s = s;\n\n _this.setValue(_this.__color.toOriginal());\n\n\n return false;\n }\n\n function setH(e) {\n e.preventDefault();\n\n const fieldRect = _this.__hue_field.getBoundingClientRect();\n let h = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (h > 1) {\n h = 1;\n } else if (h < 0) {\n h = 0;\n }\n\n _this.__color.h = h * 360;\n\n _this.setValue(_this.__color.toOriginal());\n\n return false;\n }\n }\n\n updateDisplay() {\n const i = interpret(this.getValue());\n\n if (i !== false) {\n let mismatch = false;\n\n // Check for mismatch on the interpreted value.\n\n common.each(Color.COMPONENTS, function(component) {\n if (!common.isUndefined(i[component]) && !common.isUndefined(this.__color.__state[component]) &&\n i[component] !== this.__color.__state[component]) {\n mismatch = true;\n return {}; // break\n }\n }, this);\n\n // If nothing diverges, we keep our previous values\n // for statefulness, otherwise we recalculate fresh\n if (mismatch) {\n common.extend(this.__color.__state, i);\n }\n }\n\n common.extend(this.__temp.__state, this.__color.__state);\n\n this.__temp.a = 1;\n\n const flip = (this.__color.v < 0.5 || this.__color.s > 0.5) ? 255 : 0;\n const _flip = 255 - flip;\n\n common.extend(this.__field_knob.style, {\n marginLeft: 100 * this.__color.s - 7 + 'px',\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\n backgroundColor: this.__temp.toHexString(),\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')'\n });\n\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px';\n\n this.__temp.s = 1;\n this.__temp.v = 1;\n\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString());\n\n this.__input.value = this.__color.toString();\n\n common.extend(this.__input.style, {\n backgroundColor: this.__color.toHexString(),\n color: 'rgb(' + flip + ',' + flip + ',' + flip + ')',\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)'\n });\n }\n}\n\nconst vendors = ['-moz-', '-o-', '-webkit-', '-ms-', ''];\n\nfunction linearGradient(elem, x, a, b) {\n elem.style.background = '';\n common.each(vendors, function(vendor) {\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); ';\n });\n}\n\nfunction hueGradient(elem) {\n elem.style.background = '';\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);';\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n}\n\nexport default ColorController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ColorController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport css from '../utils/css';\nimport saveDialogueContents from './saveDialogue.html';\nimport ControllerFactory from '../controllers/ControllerFactory';\nimport Controller from '../controllers/Controller';\nimport BooleanController from '../controllers/BooleanController';\nimport FunctionController from '../controllers/FunctionController';\nimport NumberControllerBox from '../controllers/NumberControllerBox';\nimport NumberControllerSlider from '../controllers/NumberControllerSlider';\nimport ColorController from '../controllers/ColorController';\nimport requestAnimationFrame from '../utils/requestAnimationFrame';\nimport CenteredDiv from '../dom/CenteredDiv';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nimport styleSheet from './style.scss'; // CSS to embed in build\n\ncss.inject(styleSheet);\n\n/** Outer-most className for GUI's */\nconst CSS_NAMESPACE = 'dg';\n\nconst HIDE_KEY_CODE = 72;\n\n/** The only value shared between the JS and SCSS. Use caution. */\nconst CLOSE_BUTTON_HEIGHT = 20;\n\nconst DEFAULT_DEFAULT_PRESET_NAME = 'Default';\n\nconst SUPPORTS_LOCAL_STORAGE = (function() {\n try {\n return 'localStorage' in window && window.localStorage !== null;\n } catch (e) {\n return false;\n }\n}());\n\nlet SAVE_DIALOGUE;\n\n/** Have we yet to create an autoPlace GUI? */\nlet autoPlaceVirgin = true;\n\n/** Fixed position div that auto place GUI's go inside */\nlet autoPlaceContainer;\n\n/** Are we hiding the GUI's ? */\nlet hide = false;\n\n/** GUI's which should be hidden */\nconst hideableGuis = [];\n\n/**\n * A lightweight controller library for JavaScript. It allows you to easily\n * manipulate variables and fire functions on the fly.\n * @class\n *\n * @member dat.gui\n *\n * @param {Object} [params]\n * @param {String} [params.name] The name of this GUI.\n * @param {Object} [params.load] JSON object representing the saved state of\n * this GUI.\n * @param {Boolean} [params.auto=true]\n * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.\n * @param {Boolean} [params.closed] If true, starts closed\n * @param {Boolean} [params.closeOnTop] If true, close/open button shows on top of the GUI\n */\nconst GUI = function(pars) {\n const _this = this;\n\n let params = pars || {};\n\n /**\n * Outermost DOM Element\n * @type DOMElement\n */\n this.domElement = document.createElement('div');\n this.__ul = document.createElement('ul');\n this.domElement.appendChild(this.__ul);\n\n dom.addClass(this.domElement, CSS_NAMESPACE);\n\n /**\n * Nested GUI's by name\n * @ignore\n */\n this.__folders = {};\n\n this.__controllers = [];\n\n /**\n * List of objects I'm remembering for save, only used in top level GUI\n * @ignore\n */\n this.__rememberedObjects = [];\n\n /**\n * Maps the index of remembered objects to a map of controllers, only used\n * in top level GUI.\n *\n * @private\n * @ignore\n *\n * @example\n * [\n * {\n * propertyName: Controller,\n * anotherPropertyName: Controller\n * },\n * {\n * propertyName: Controller\n * }\n * ]\n */\n this.__rememberedObjectIndecesToControllers = [];\n\n this.__listening = [];\n\n // Default parameters\n params = common.defaults(params, {\n closeOnTop: false,\n autoPlace: true,\n width: GUI.DEFAULT_WIDTH\n });\n\n params = common.defaults(params, {\n resizable: params.autoPlace,\n hideable: params.autoPlace\n });\n\n if (!common.isUndefined(params.load)) {\n // Explicit preset\n if (params.preset) {\n params.load.preset = params.preset;\n }\n } else {\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\n }\n\n if (common.isUndefined(params.parent) && params.hideable) {\n hideableGuis.push(this);\n }\n\n // Only root level GUI's are resizable.\n params.resizable = common.isUndefined(params.parent) && params.resizable;\n\n if (params.autoPlace && common.isUndefined(params.scrollable)) {\n params.scrollable = true;\n }\n// params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;\n\n // Not part of params because I don't want people passing this in via\n // constructor. Should be a 'remembered' value.\n let useLocalStorage =\n SUPPORTS_LOCAL_STORAGE &&\n localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\n\n let saveToLocalStorage;\n\n Object.defineProperties(this,\n /** @lends dat.gui.GUI.prototype */\n {\n /**\n * The parent GUI\n * @type dat.gui.GUI\n */\n parent: {\n get: function() {\n return params.parent;\n }\n },\n\n scrollable: {\n get: function() {\n return params.scrollable;\n }\n },\n\n /**\n * Handles GUI's element placement for you\n * @type Boolean\n */\n autoPlace: {\n get: function() {\n return params.autoPlace;\n }\n },\n\n /**\n * Handles GUI's position of open/close button\n * @type Boolean\n */\n closeOnTop: {\n get: function() {\n return params.closeOnTop;\n }\n },\n\n /**\n * The identifier for a set of saved values\n * @type String\n */\n preset: {\n get: function() {\n if (_this.parent) {\n return _this.getRoot().preset;\n }\n\n return params.load.preset;\n },\n\n set: function(v) {\n if (_this.parent) {\n _this.getRoot().preset = v;\n } else {\n params.load.preset = v;\n }\n setPresetSelectIndex(this);\n _this.revert();\n }\n },\n\n /**\n * The width of GUI element\n * @type Number\n */\n width: {\n get: function() {\n return params.width;\n },\n set: function(v) {\n params.width = v;\n setWidth(_this, v);\n }\n },\n\n /**\n * The name of GUI. Used for folders. i.e\n * a folder's name\n * @type String\n */\n name: {\n get: function() {\n return params.name;\n },\n set: function(v) {\n // TODO Check for collisions among sibling folders\n params.name = v;\n if (titleRowName) {\n titleRowName.innerHTML = params.name;\n }\n }\n },\n\n /**\n * Whether the GUI is collapsed or not\n * @type Boolean\n */\n closed: {\n get: function() {\n return params.closed;\n },\n set: function(v) {\n params.closed = v;\n if (params.closed) {\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\n } else {\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\n }\n // For browsers that aren't going to respect the CSS transition,\n // Lets just check our height against the window height right off\n // the bat.\n this.onResize();\n\n if (_this.__closeButton) {\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\n }\n }\n },\n\n /**\n * Contains all presets\n * @type Object\n */\n load: {\n get: function() {\n return params.load;\n }\n },\n\n /**\n * Determines whether or not to use localStorage as the means for\n * remembering\n * @type Boolean\n */\n useLocalStorage: {\n\n get: function() {\n return useLocalStorage;\n },\n set: function(bool) {\n if (SUPPORTS_LOCAL_STORAGE) {\n useLocalStorage = bool;\n if (bool) {\n dom.bind(window, 'unload', saveToLocalStorage);\n } else {\n dom.unbind(window, 'unload', saveToLocalStorage);\n }\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\n }\n }\n }\n });\n\n // Are we a root level GUI?\n if (common.isUndefined(params.parent)) {\n params.closed = false;\n\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\n dom.makeSelectable(this.domElement, false);\n\n // Are we supposed to be loading locally?\n if (SUPPORTS_LOCAL_STORAGE) {\n if (useLocalStorage) {\n _this.useLocalStorage = true;\n\n const savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\n\n if (savedGui) {\n params.load = JSON.parse(savedGui);\n }\n }\n }\n\n this.__closeButton = document.createElement('div');\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\n if (params.closeOnTop) {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP);\n this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]);\n } else {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM);\n this.domElement.appendChild(this.__closeButton);\n }\n\n dom.bind(this.__closeButton, 'click', function() {\n _this.closed = !_this.closed;\n });\n // Oh, you're a nested GUI!\n } else {\n if (params.closed === undefined) {\n params.closed = true;\n }\n\n const titleRowName = document.createTextNode(params.name);\n dom.addClass(titleRowName, 'controller-name');\n\n const titleRow = addRow(_this, titleRowName);\n\n const onClickTitle = function(e) {\n e.preventDefault();\n _this.closed = !_this.closed;\n return false;\n };\n\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\n\n dom.addClass(titleRow, 'title');\n dom.bind(titleRow, 'click', onClickTitle);\n\n if (!params.closed) {\n this.closed = false;\n }\n }\n\n if (params.autoPlace) {\n if (common.isUndefined(params.parent)) {\n if (autoPlaceVirgin) {\n autoPlaceContainer = document.createElement('div');\n dom.addClass(autoPlaceContainer, CSS_NAMESPACE);\n dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER);\n document.body.appendChild(autoPlaceContainer);\n autoPlaceVirgin = false;\n }\n\n // Put it in the dom for you.\n autoPlaceContainer.appendChild(this.domElement);\n\n // Apply the auto styles\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\n }\n\n\n // Make it not elastic.\n if (!this.parent) {\n setWidth(_this, params.width);\n }\n }\n\n this.__resizeHandler = function() {\n _this.onResizeDebounced();\n };\n\n dom.bind(window, 'resize', this.__resizeHandler);\n dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler);\n dom.bind(this.__ul, 'transitionend', this.__resizeHandler);\n dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler);\n this.onResize();\n\n if (params.resizable) {\n addResizeHandle(this);\n }\n\n saveToLocalStorage = function() {\n if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') {\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\n }\n };\n\n // expose this method publicly\n this.saveToLocalStorageIfPossible = saveToLocalStorage;\n\n function resetWidth() {\n const root = _this.getRoot();\n root.width += 1;\n common.defer(function() {\n root.width -= 1;\n });\n }\n\n if (!params.parent) {\n resetWidth();\n }\n};\n\nGUI.toggleHide = function() {\n hide = !hide;\n common.each(hideableGuis, function(gui) {\n gui.domElement.style.display = hide ? 'none' : '';\n });\n};\n\nGUI.CLASS_AUTO_PLACE = 'a';\nGUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\nGUI.CLASS_MAIN = 'main';\nGUI.CLASS_CONTROLLER_ROW = 'cr';\nGUI.CLASS_TOO_TALL = 'taller-than-window';\nGUI.CLASS_CLOSED = 'closed';\nGUI.CLASS_CLOSE_BUTTON = 'close-button';\nGUI.CLASS_CLOSE_TOP = 'close-top';\nGUI.CLASS_CLOSE_BOTTOM = 'close-bottom';\nGUI.CLASS_DRAG = 'drag';\n\nGUI.DEFAULT_WIDTH = 245;\nGUI.TEXT_CLOSED = 'Close Controls';\nGUI.TEXT_OPEN = 'Open Controls';\n\nGUI._keydownHandler = function(e) {\n if (document.activeElement.type !== 'text' &&\n (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) {\n GUI.toggleHide();\n }\n};\ndom.bind(window, 'keydown', GUI._keydownHandler, false);\n\ncommon.extend(\n GUI.prototype,\n\n /** @lends dat.gui.GUI */\n {\n\n /**\n * @param object\n * @param property\n * @returns {dat.controllers.Controller} The new controller that was added.\n * @instance\n */\n add: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n factoryArgs: Array.prototype.slice.call(arguments, 2)\n }\n );\n },\n\n /**\n * @param object\n * @param property\n * @returns {dat.controllers.ColorController} The new controller that was added.\n * @instance\n */\n addColor: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n color: true\n }\n );\n },\n\n /**\n * @param controller\n * @instance\n */\n remove: function(controller) {\n // TODO listening?\n this.__ul.removeChild(controller.__li);\n this.__controllers.splice(this.__controllers.indexOf(controller), 1);\n const _this = this;\n common.defer(function() {\n _this.onResize();\n });\n },\n\n destroy: function() {\n if (this.autoPlace) {\n autoPlaceContainer.removeChild(this.domElement);\n }\n\n dom.unbind(window, 'keydown', GUI._keydownHandler, false);\n dom.unbind(window, 'resize', this.__resizeHandler);\n\n if (this.saveToLocalStorageIfPossible) {\n dom.unbind(window, 'unload', this.saveToLocalStorageIfPossible);\n }\n },\n\n /**\n * @param name\n * @returns {dat.gui.GUI} The new folder.\n * @throws {Error} if this GUI already has a folder by the specified\n * name\n * @instance\n */\n addFolder: function(name) {\n // We have to prevent collisions on names in order to have a key\n // by which to remember saved values\n if (this.__folders[name] !== undefined) {\n throw new Error('You already have a folder in this GUI by the' +\n ' name \"' + name + '\"');\n }\n\n const newGuiParams = { name: name, parent: this };\n\n // We need to pass down the autoPlace trait so that we can\n // attach event listeners to open/close folder actions to\n // ensure that a scrollbar appears if the window is too short.\n newGuiParams.autoPlace = this.autoPlace;\n\n // Do we have saved appearance data for this folder?\n if (this.load && // Anything loaded?\n this.load.folders && // Was my parent a dead-end?\n this.load.folders[name]) { // Did daddy remember me?\n // Start me closed if I was closed\n newGuiParams.closed = this.load.folders[name].closed;\n\n // Pass down the loaded data\n newGuiParams.load = this.load.folders[name];\n }\n\n const gui = new GUI(newGuiParams);\n this.__folders[name] = gui;\n\n const li = addRow(this, gui.domElement);\n dom.addClass(li, 'folder');\n return gui;\n },\n\n open: function() {\n this.closed = false;\n },\n\n close: function() {\n this.closed = true;\n },\n\n\n onResize: function() {\n // we debounce this function to prevent performance issues when rotating on tablet/mobile\n const root = this.getRoot();\n if (root.scrollable) {\n const top = dom.getOffset(root.__ul).top;\n let h = 0;\n\n common.each(root.__ul.childNodes, function(node) {\n if (!(root.autoPlace && node === root.__save_row)) {\n h += dom.getHeight(node);\n }\n });\n\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\n } else {\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = 'auto';\n }\n }\n\n if (root.__resize_handle) {\n common.defer(function() {\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\n });\n }\n\n if (root.__closeButton) {\n root.__closeButton.style.width = root.width + 'px';\n }\n },\n\n onResizeDebounced: common.debounce(function() { this.onResize(); }, 50),\n\n /**\n * Mark objects for saving. The order of these objects cannot change as\n * the GUI grows. When remembering new objects, append them to the end\n * of the list.\n *\n * @param {Object...} objects\n * @throws {Error} if not called on a top level GUI.\n * @instance\n */\n remember: function() {\n if (common.isUndefined(SAVE_DIALOGUE)) {\n SAVE_DIALOGUE = new CenteredDiv();\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;\n }\n\n if (this.parent) {\n throw new Error('You can only call remember on a top level GUI.');\n }\n\n const _this = this;\n\n common.each(Array.prototype.slice.call(arguments), function(object) {\n if (_this.__rememberedObjects.length === 0) {\n addSaveMenu(_this);\n }\n if (_this.__rememberedObjects.indexOf(object) === -1) {\n _this.__rememberedObjects.push(object);\n }\n });\n\n if (this.autoPlace) {\n // Set save row width\n setWidth(this, this.width);\n }\n },\n\n /**\n * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.\n * @instance\n */\n getRoot: function() {\n let gui = this;\n while (gui.parent) {\n gui = gui.parent;\n }\n return gui;\n },\n\n /**\n * @returns {Object} a JSON object representing the current state of\n * this GUI as well as its remembered properties.\n * @instance\n */\n getSaveObject: function() {\n const toReturn = this.load;\n toReturn.closed = this.closed;\n\n // Am I remembering any values?\n if (this.__rememberedObjects.length > 0) {\n toReturn.preset = this.preset;\n\n if (!toReturn.remembered) {\n toReturn.remembered = {};\n }\n\n toReturn.remembered[this.preset] = getCurrentPreset(this);\n }\n\n toReturn.folders = {};\n common.each(this.__folders, function(element, key) {\n toReturn.folders[key] = element.getSaveObject();\n });\n\n return toReturn;\n },\n\n save: function() {\n if (!this.load.remembered) {\n this.load.remembered = {};\n }\n\n this.load.remembered[this.preset] = getCurrentPreset(this);\n markPresetModified(this, false);\n this.saveToLocalStorageIfPossible();\n },\n\n saveAs: function(presetName) {\n if (!this.load.remembered) {\n // Retain default values upon first save\n this.load.remembered = {};\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\n }\n\n this.load.remembered[presetName] = getCurrentPreset(this);\n this.preset = presetName;\n addPresetOption(this, presetName, true);\n this.saveToLocalStorageIfPossible();\n },\n\n revert: function(gui) {\n common.each(this.__controllers, function(controller) {\n // Make revert work on Default.\n if (!this.getRoot().load.remembered) {\n controller.setValue(controller.initialValue);\n } else {\n recallSavedValue(gui || this.getRoot(), controller);\n }\n\n // fire onFinishChange callback\n if (controller.__onFinishChange) {\n controller.__onFinishChange.call(controller, controller.getValue());\n }\n }, this);\n\n common.each(this.__folders, function(folder) {\n folder.revert(folder);\n });\n\n if (!gui) {\n markPresetModified(this.getRoot(), false);\n }\n },\n\n listen: function(controller) {\n const init = this.__listening.length === 0;\n this.__listening.push(controller);\n if (init) {\n updateDisplays(this.__listening);\n }\n },\n\n updateDisplay: function() {\n common.each(this.__controllers, function(controller) {\n controller.updateDisplay();\n });\n common.each(this.__folders, function(folder) {\n folder.updateDisplay();\n });\n }\n }\n);\n\n/**\n * Add a row to the end of the GUI or before another row.\n *\n * @param gui\n * @param [newDom] If specified, inserts the dom content in the new row\n * @param [liBefore] If specified, places the new row before another row\n */\nfunction addRow(gui, newDom, liBefore) {\n const li = document.createElement('li');\n if (newDom) {\n li.appendChild(newDom);\n }\n\n if (liBefore) {\n gui.__ul.insertBefore(li, liBefore);\n } else {\n gui.__ul.appendChild(li);\n }\n gui.onResize();\n return li;\n}\n\nfunction markPresetModified(gui, modified) {\n const opt = gui.__preset_select[gui.__preset_select.selectedIndex];\n\n // console.log('mark', modified, opt);\n if (modified) {\n opt.innerHTML = opt.value + '*';\n } else {\n opt.innerHTML = opt.value;\n }\n}\n\nfunction augmentController(gui, li, controller) {\n controller.__li = li;\n controller.__gui = gui;\n\n common.extend(controller, {\n options: function(options) {\n if (arguments.length > 1) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [common.toArray(arguments)]\n }\n );\n }\n\n if (common.isArray(options) || common.isObject(options)) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [options]\n }\n );\n }\n },\n\n name: function(v) {\n controller.__li.firstElementChild.firstElementChild.innerHTML = v;\n return controller;\n },\n\n listen: function() {\n controller.__gui.listen(controller);\n return controller;\n },\n\n remove: function() {\n controller.__gui.remove(controller);\n return controller;\n }\n });\n\n // All sliders should be accompanied by a box.\n if (controller instanceof NumberControllerSlider) {\n const box = new NumberControllerBox(controller.object, controller.property,\n { min: controller.__min, max: controller.__max, step: controller.__step });\n\n common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step'], function(method) {\n const pc = controller[method];\n const pb = box[method];\n controller[method] = box[method] = function() {\n const args = Array.prototype.slice.call(arguments);\n pb.apply(box, args);\n return pc.apply(controller, args);\n };\n });\n\n dom.addClass(li, 'has-slider');\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\n } else if (controller instanceof NumberControllerBox) {\n const r = function(returned) {\n // Have we defined both boundaries?\n if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {\n // Well, then lets just replace this with a slider.\n\n // lets remember if the old controller had a specific name or was listening\n const oldName = controller.__li.firstElementChild.firstElementChild.innerHTML;\n const wasListening = controller.__gui.__listening.indexOf(controller) > -1;\n\n controller.remove();\n const newController = add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [controller.__min, controller.__max, controller.__step]\n });\n\n newController.name(oldName);\n if (wasListening) newController.listen();\n\n return newController;\n }\n\n return returned;\n };\n\n controller.min = common.compose(r, controller.min);\n controller.max = common.compose(r, controller.max);\n } else if (controller instanceof BooleanController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__checkbox, 'click');\n });\n\n dom.bind(controller.__checkbox, 'click', function(e) {\n e.stopPropagation(); // Prevents double-toggle\n });\n } else if (controller instanceof FunctionController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__button, 'click');\n });\n\n dom.bind(li, 'mouseover', function() {\n dom.addClass(controller.__button, 'hover');\n });\n\n dom.bind(li, 'mouseout', function() {\n dom.removeClass(controller.__button, 'hover');\n });\n } else if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n controller.updateDisplay = common.compose(function(val) {\n li.style.borderLeftColor = controller.__color.toString();\n return val;\n }, controller.updateDisplay);\n\n controller.updateDisplay();\n }\n\n controller.setValue = common.compose(function(val) {\n if (gui.getRoot().__preset_select && controller.isModified()) {\n markPresetModified(gui.getRoot(), true);\n }\n\n return val;\n }, controller.setValue);\n}\n\nfunction recallSavedValue(gui, controller) {\n // Find the topmost GUI, that's where remembered objects live.\n const root = gui.getRoot();\n\n // Does the object we're controlling match anything we've been told to\n // remember?\n const matchedIndex = root.__rememberedObjects.indexOf(controller.object);\n\n // Why yes, it does!\n if (matchedIndex !== -1) {\n // Let me fetch a map of controllers for thcommon.isObject.\n let controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex];\n\n // Ohp, I believe this is the first controller we've created for this\n // object. Lets make the map fresh.\n if (controllerMap === undefined) {\n controllerMap = {};\n root.__rememberedObjectIndecesToControllers[matchedIndex] =\n controllerMap;\n }\n\n // Keep track of this controller\n controllerMap[controller.property] = controller;\n\n // Okay, now have we saved any values for this controller?\n if (root.load && root.load.remembered) {\n const presetMap = root.load.remembered;\n\n // Which preset are we trying to load?\n let preset;\n\n if (presetMap[gui.preset]) {\n preset = presetMap[gui.preset];\n } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) {\n // Uhh, you can have the default instead?\n preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME];\n } else {\n // Nada.\n return;\n }\n\n // Did the loaded object remember thcommon.isObject? && Did we remember this particular property?\n if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) {\n // We did remember something for this guy ...\n const value = preset[matchedIndex][controller.property];\n\n // And that's what it is.\n controller.initialValue = value;\n controller.setValue(value);\n }\n }\n }\n}\n\nfunction add(gui, object, property, params) {\n if (object[property] === undefined) {\n throw new Error(`Object \"${object}\" has no property \"${property}\"`);\n }\n\n let controller;\n\n if (params.color) {\n controller = new ColorController(object, property);\n } else {\n const factoryArgs = [object, property].concat(params.factoryArgs);\n controller = ControllerFactory.apply(gui, factoryArgs);\n }\n\n if (params.before instanceof Controller) {\n params.before = params.before.__li;\n }\n\n recallSavedValue(gui, controller);\n\n dom.addClass(controller.domElement, 'c');\n\n const name = document.createElement('span');\n dom.addClass(name, 'property-name');\n name.innerHTML = controller.property;\n\n const container = document.createElement('div');\n container.appendChild(name);\n container.appendChild(controller.domElement);\n\n const li = addRow(gui, container, params.before);\n\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\n if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n } else {\n dom.addClass(li, typeof controller.getValue());\n }\n\n augmentController(gui, li, controller);\n\n gui.__controllers.push(controller);\n\n return controller;\n}\n\nfunction getLocalStorageHash(gui, key) {\n // TODO how does this deal with multiple GUI's?\n return document.location.href + '.' + key;\n}\n\nfunction addPresetOption(gui, name, setSelected) {\n const opt = document.createElement('option');\n opt.innerHTML = name;\n opt.value = name;\n gui.__preset_select.appendChild(opt);\n if (setSelected) {\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\n }\n}\n\nfunction showHideExplain(gui, explain) {\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\n}\n\nfunction addSaveMenu(gui) {\n const div = gui.__save_row = document.createElement('li');\n\n dom.addClass(gui.domElement, 'has-save');\n\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\n\n dom.addClass(div, 'save-row');\n\n const gears = document.createElement('span');\n gears.innerHTML = ' ';\n dom.addClass(gears, 'button gears');\n\n // TODO replace with FunctionController\n const button = document.createElement('span');\n button.innerHTML = 'Save';\n dom.addClass(button, 'button');\n dom.addClass(button, 'save');\n\n const button2 = document.createElement('span');\n button2.innerHTML = 'New';\n dom.addClass(button2, 'button');\n dom.addClass(button2, 'save-as');\n\n const button3 = document.createElement('span');\n button3.innerHTML = 'Revert';\n dom.addClass(button3, 'button');\n dom.addClass(button3, 'revert');\n\n const select = gui.__preset_select = document.createElement('select');\n\n if (gui.load && gui.load.remembered) {\n common.each(gui.load.remembered, function(value, key) {\n addPresetOption(gui, key, key === gui.preset);\n });\n } else {\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\n }\n\n dom.bind(select, 'change', function() {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\n }\n\n gui.preset = this.value;\n });\n\n div.appendChild(select);\n div.appendChild(gears);\n div.appendChild(button);\n div.appendChild(button2);\n div.appendChild(button3);\n\n if (SUPPORTS_LOCAL_STORAGE) {\n const explain = document.getElementById('dg-local-explain');\n const localStorageCheckBox = document.getElementById('dg-local-storage');\n const saveLocally = document.getElementById('dg-save-locally');\n\n saveLocally.style.display = 'block';\n\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\n localStorageCheckBox.setAttribute('checked', 'checked');\n }\n\n showHideExplain(gui, explain);\n\n // TODO: Use a boolean controller, fool!\n dom.bind(localStorageCheckBox, 'change', function() {\n gui.useLocalStorage = !gui.useLocalStorage;\n showHideExplain(gui, explain);\n });\n }\n\n const newConstructorTextArea = document.getElementById('dg-new-constructor');\n\n dom.bind(newConstructorTextArea, 'keydown', function(e) {\n if (e.metaKey && (e.which === 67 || e.keyCode === 67)) {\n SAVE_DIALOGUE.hide();\n }\n });\n\n dom.bind(gears, 'click', function() {\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\n SAVE_DIALOGUE.show();\n newConstructorTextArea.focus();\n newConstructorTextArea.select();\n });\n\n dom.bind(button, 'click', function() {\n gui.save();\n });\n\n dom.bind(button2, 'click', function() {\n const presetName = prompt('Enter a new preset name.');\n if (presetName) {\n gui.saveAs(presetName);\n }\n });\n\n dom.bind(button3, 'click', function() {\n gui.revert();\n });\n\n // div.appendChild(button2);\n}\n\nfunction addResizeHandle(gui) {\n let pmouseX;\n\n gui.__resize_handle = document.createElement('div');\n\n common.extend(gui.__resize_handle.style, {\n\n width: '6px',\n marginLeft: '-3px',\n height: '200px',\n cursor: 'ew-resize',\n position: 'absolute'\n // border: '1px solid blue'\n\n });\n\n function drag(e) {\n e.preventDefault();\n\n gui.width += pmouseX - e.clientX;\n gui.onResize();\n pmouseX = e.clientX;\n\n return false;\n }\n\n function dragStop() {\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.unbind(window, 'mousemove', drag);\n dom.unbind(window, 'mouseup', dragStop);\n }\n\n function dragStart(e) {\n e.preventDefault();\n\n pmouseX = e.clientX;\n\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.bind(window, 'mousemove', drag);\n dom.bind(window, 'mouseup', dragStop);\n\n return false;\n }\n\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\n\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\n}\n\nfunction setWidth(gui, w) {\n gui.domElement.style.width = w + 'px';\n // Auto placed save-rows are position fixed, so we have to\n // set the width manually if we want it to bleed to the edge\n if (gui.__save_row && gui.autoPlace) {\n gui.__save_row.style.width = w + 'px';\n }\n if (gui.__closeButton) {\n gui.__closeButton.style.width = w + 'px';\n }\n}\n\nfunction getCurrentPreset(gui, useInitialValues) {\n const toReturn = {};\n\n // For each object I'm remembering\n common.each(gui.__rememberedObjects, function(val, index) {\n const savedValues = {};\n\n // The controllers I've made for thcommon.isObject by property\n const controllerMap =\n gui.__rememberedObjectIndecesToControllers[index];\n\n // Remember each value for each property\n common.each(controllerMap, function(controller, property) {\n savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue();\n });\n\n // Save the values for thcommon.isObject\n toReturn[index] = savedValues;\n });\n\n return toReturn;\n}\n\nfunction setPresetSelectIndex(gui) {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n if (gui.__preset_select[index].value === gui.preset) {\n gui.__preset_select.selectedIndex = index;\n }\n }\n}\n\nfunction updateDisplays(controllerArray) {\n if (controllerArray.length !== 0) {\n requestAnimationFrame.call(window, function() {\n updateDisplays(controllerArray);\n });\n }\n\n common.each(controllerArray, function(c) {\n c.updateDisplay();\n });\n}\n\nexport default GUI;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/gui/GUI.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nmodule.exports = {\n load: function(url, indoc) {\n const doc = indoc || document;\n const link = doc.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n doc.getElementsByTagName('head')[0].appendChild(link);\n },\n\n inject: function(css, indoc) {\n const doc = indoc || document;\n const injected = document.createElement('style');\n injected.type = 'text/css';\n injected.innerHTML = css;\n const head = doc.getElementsByTagName('head')[0];\n try {\n head.appendChild(injected);\n } catch (e) { // Unable to inject CSS, probably because of a Content Security Policy\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/css.js","module.exports = \"
\\n\\n Here's the new load parameter for your GUI's constructor:\\n\\n \\n\\n
\\n\\n Automatically save\\n values to localStorage on exit.\\n\\n
The values saved to localStorage will\\n override those passed to dat.GUI's constructor. This makes it\\n easier to work incrementally, but localStorage is fragile,\\n and your friends may not see the same values you do.\\n\\n
\\n\\n
\\n\\n
\";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/saveDialogue.html\n// module id = 19\n// module chunks = 0","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport OptionController from './OptionController';\nimport NumberControllerBox from './NumberControllerBox';\nimport NumberControllerSlider from './NumberControllerSlider';\nimport StringController from './StringController';\nimport FunctionController from './FunctionController';\nimport BooleanController from './BooleanController';\nimport common from '../utils/common';\n\nconst ControllerFactory = function(object, property) {\n const initialValue = object[property];\n\n // Providing options?\n if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {\n return new OptionController(object, property, arguments[2]);\n }\n\n // Providing a map?\n if (common.isNumber(initialValue)) {\n // Has min and max? (slider)\n if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {\n // has step?\n if (common.isNumber(arguments[4])) {\n return new NumberControllerSlider(object, property,\n arguments[2], arguments[3], arguments[4]);\n }\n\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\n }\n\n // number box\n if (common.isNumber(arguments[4])) { // has step\n return new NumberControllerBox(object, property,\n { min: arguments[2], max: arguments[3], step: arguments[4] });\n }\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\n }\n\n if (common.isString(initialValue)) {\n return new StringController(object, property);\n }\n\n if (common.isFunction(initialValue)) {\n return new FunctionController(object, property, '');\n }\n\n if (common.isBoolean(initialValue)) {\n return new BooleanController(object, property);\n }\n\n return null;\n};\n\nexport default ControllerFactory;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ControllerFactory.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction requestAnimationFrame(callback) {\n setTimeout(callback, 1000 / 60);\n}\n\nexport default window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n requestAnimationFrame;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/requestAnimationFrame.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nclass CenteredDiv {\n constructor() {\n this.backgroundElement = document.createElement('div');\n common.extend(this.backgroundElement.style, {\n backgroundColor: 'rgba(0,0,0,0.8)',\n top: 0,\n left: 0,\n display: 'none',\n zIndex: '1000',\n opacity: 0,\n WebkitTransition: 'opacity 0.2s linear',\n transition: 'opacity 0.2s linear'\n });\n\n dom.makeFullscreen(this.backgroundElement);\n this.backgroundElement.style.position = 'fixed';\n\n this.domElement = document.createElement('div');\n common.extend(this.domElement.style, {\n position: 'fixed',\n display: 'none',\n zIndex: '1001',\n opacity: 0,\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',\n transition: 'transform 0.2s ease-out, opacity 0.2s linear'\n });\n\n\n document.body.appendChild(this.backgroundElement);\n document.body.appendChild(this.domElement);\n\n const _this = this;\n dom.bind(this.backgroundElement, 'click', function() {\n _this.hide();\n });\n }\n\n show() {\n const _this = this;\n\n this.backgroundElement.style.display = 'block';\n\n this.domElement.style.display = 'block';\n this.domElement.style.opacity = 0;\n// this.domElement.style.top = '52%';\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n this.layout();\n\n common.defer(function() {\n _this.backgroundElement.style.opacity = 1;\n _this.domElement.style.opacity = 1;\n _this.domElement.style.webkitTransform = 'scale(1)';\n });\n }\n\n /**\n * Hide centered div\n */\n hide() {\n const _this = this;\n\n const hide = function() {\n _this.domElement.style.display = 'none';\n _this.backgroundElement.style.display = 'none';\n\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\n dom.unbind(_this.domElement, 'transitionend', hide);\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\n };\n\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\n dom.bind(this.domElement, 'transitionend', hide);\n dom.bind(this.domElement, 'oTransitionEnd', hide);\n\n this.backgroundElement.style.opacity = 0;\n// this.domElement.style.top = '48%';\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n }\n\n layout() {\n this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px';\n this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px';\n }\n}\n\nexport default CenteredDiv;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/CenteredDiv.js","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".dg {\\n /** Clear list styles */\\n /* Auto-place container */\\n /* Auto-placed GUI's */\\n /* Line items that don't contain folders. */\\n /** Folder names */\\n /** Hides closed items */\\n /** Controller row */\\n /** Name-half (left) */\\n /** Controller-half (right) */\\n /** Controller placement */\\n /** Shorter number boxes when slider is present. */\\n /** Ensure the entire boolean and function row shows a hand */\\n /** allow overflow for color selector */ }\\n .dg ul {\\n list-style: none;\\n margin: 0;\\n padding: 0;\\n width: 100%;\\n clear: both; }\\n .dg.ac {\\n position: fixed;\\n top: 0;\\n left: 0;\\n right: 0;\\n height: 0;\\n z-index: 0; }\\n .dg:not(.ac) .main {\\n /** Exclude mains in ac so that we don't hide close button */\\n overflow: hidden; }\\n .dg.main {\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear; }\\n .dg.main.taller-than-window {\\n overflow-y: auto; }\\n .dg.main.taller-than-window .close-button {\\n opacity: 1;\\n /* TODO, these are style notes */\\n margin-top: -1px;\\n border-top: 1px solid #2c2c2c; }\\n .dg.main ul.closed .close-button {\\n opacity: 1 !important; }\\n .dg.main:hover .close-button,\\n .dg.main .close-button.drag {\\n opacity: 1; }\\n .dg.main .close-button {\\n /*opacity: 0;*/\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear;\\n border: 0;\\n line-height: 19px;\\n height: 20px;\\n /* TODO, these are style notes */\\n cursor: pointer;\\n text-align: center;\\n background-color: #000; }\\n .dg.main .close-button.close-top {\\n position: relative; }\\n .dg.main .close-button.close-bottom {\\n position: absolute; }\\n .dg.main .close-button:hover {\\n background-color: #111; }\\n .dg.a {\\n float: right;\\n margin-right: 15px;\\n overflow-y: visible; }\\n .dg.a.has-save > ul.close-top {\\n margin-top: 0; }\\n .dg.a.has-save > ul.close-bottom {\\n margin-top: 27px; }\\n .dg.a.has-save > ul.closed {\\n margin-top: 0; }\\n .dg.a .save-row {\\n top: 0;\\n z-index: 1002; }\\n .dg.a .save-row.close-top {\\n position: relative; }\\n .dg.a .save-row.close-bottom {\\n position: fixed; }\\n .dg li {\\n -webkit-transition: height 0.1s ease-out;\\n -o-transition: height 0.1s ease-out;\\n -moz-transition: height 0.1s ease-out;\\n transition: height 0.1s ease-out;\\n -webkit-transition: overflow 0.1s linear;\\n -o-transition: overflow 0.1s linear;\\n -moz-transition: overflow 0.1s linear;\\n transition: overflow 0.1s linear; }\\n .dg li:not(.folder) {\\n cursor: auto;\\n height: 27px;\\n line-height: 27px;\\n padding: 0 4px 0 5px; }\\n .dg li.folder {\\n padding: 0;\\n border-left: 4px solid transparent; }\\n .dg li.title {\\n cursor: pointer;\\n margin-left: -4px; }\\n .dg .closed li:not(.title),\\n .dg .closed ul li,\\n .dg .closed ul li > * {\\n height: 0;\\n overflow: hidden;\\n border: 0; }\\n .dg .cr {\\n clear: both;\\n padding-left: 3px;\\n height: 27px;\\n overflow: hidden; }\\n .dg .property-name {\\n cursor: default;\\n float: left;\\n clear: left;\\n width: 40%;\\n overflow: hidden;\\n text-overflow: ellipsis; }\\n .dg .c {\\n float: left;\\n width: 60%;\\n position: relative; }\\n .dg .c input[type=text] {\\n border: 0;\\n margin-top: 4px;\\n padding: 3px;\\n width: 100%;\\n float: right; }\\n .dg .has-slider input[type=text] {\\n width: 30%;\\n /*display: none;*/\\n margin-left: 0; }\\n .dg .slider {\\n float: left;\\n width: 66%;\\n margin-left: -5px;\\n margin-right: 0;\\n height: 19px;\\n margin-top: 4px; }\\n .dg .slider-fg {\\n height: 100%; }\\n .dg .c input[type=checkbox] {\\n margin-top: 7px; }\\n .dg .c select {\\n margin-top: 5px; }\\n .dg .cr.function,\\n .dg .cr.function .property-name,\\n .dg .cr.function *,\\n .dg .cr.boolean,\\n .dg .cr.boolean * {\\n cursor: pointer; }\\n .dg .cr.color {\\n overflow: visible; }\\n .dg .selector {\\n display: none;\\n position: absolute;\\n margin-left: -9px;\\n margin-top: 23px;\\n z-index: 10; }\\n .dg .c:hover .selector,\\n .dg .selector.drag {\\n display: block; }\\n .dg li.save-row {\\n padding: 0; }\\n .dg li.save-row .button {\\n display: inline-block;\\n padding: 0px 6px; }\\n .dg.dialogue {\\n background-color: #222;\\n width: 460px;\\n padding: 15px;\\n font-size: 13px;\\n line-height: 15px; }\\n\\n/* TODO Separate style and structure */\\n#dg-new-constructor {\\n padding: 10px;\\n color: #222;\\n font-family: Monaco, monospace;\\n font-size: 10px;\\n border: 0;\\n resize: none;\\n box-shadow: inset 1px 1px 1px #888;\\n word-wrap: break-word;\\n margin: 12px 0;\\n display: block;\\n width: 440px;\\n overflow-y: scroll;\\n height: 100px;\\n position: relative; }\\n\\n#dg-local-explain {\\n display: none;\\n font-size: 11px;\\n line-height: 17px;\\n border-radius: 3px;\\n background-color: #333;\\n padding: 8px;\\n margin-top: 10px; }\\n #dg-local-explain code {\\n font-size: 10px; }\\n\\n#dat-gui-save-locally {\\n display: none; }\\n\\n/** Main type */\\n.dg {\\n color: #eee;\\n font: 11px 'Lucida Grande', sans-serif;\\n text-shadow: 0 -1px 0 #111;\\n /** Auto place */\\n /* Controller row,
  • */\\n /** Controllers */ }\\n .dg.main {\\n /** Scrollbar */ }\\n .dg.main::-webkit-scrollbar {\\n width: 5px;\\n background: #1a1a1a; }\\n .dg.main::-webkit-scrollbar-corner {\\n height: 0;\\n display: none; }\\n .dg.main::-webkit-scrollbar-thumb {\\n border-radius: 5px;\\n background: #676767; }\\n .dg li:not(.folder) {\\n background: #1a1a1a;\\n border-bottom: 1px solid #2c2c2c; }\\n .dg li.save-row {\\n line-height: 25px;\\n background: #dad5cb;\\n border: 0; }\\n .dg li.save-row select {\\n margin-left: 5px;\\n width: 108px; }\\n .dg li.save-row .button {\\n margin-left: 5px;\\n margin-top: 1px;\\n border-radius: 2px;\\n font-size: 9px;\\n line-height: 7px;\\n padding: 4px 4px 5px 4px;\\n background: #c5bdad;\\n color: #fff;\\n text-shadow: 0 1px 0 #b0a58f;\\n box-shadow: 0 -1px 0 #b0a58f;\\n cursor: pointer; }\\n .dg li.save-row .button.gears {\\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\\n height: 7px;\\n width: 8px; }\\n .dg li.save-row .button:hover {\\n background-color: #bab19e;\\n box-shadow: 0 -1px 0 #b0a58f; }\\n .dg li.folder {\\n border-bottom: 0; }\\n .dg li.title {\\n padding-left: 16px;\\n background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\\n cursor: pointer;\\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\\n .dg .closed li.title {\\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\\n .dg .cr.boolean {\\n border-left: 3px solid #806787; }\\n .dg .cr.color {\\n border-left: 3px solid; }\\n .dg .cr.function {\\n border-left: 3px solid #e61d5f; }\\n .dg .cr.number {\\n border-left: 3px solid #2FA1D6; }\\n .dg .cr.number input[type=text] {\\n color: #2FA1D6; }\\n .dg .cr.string {\\n border-left: 3px solid #1ed36f; }\\n .dg .cr.string input[type=text] {\\n color: #1ed36f; }\\n .dg .cr.function:hover, .dg .cr.boolean:hover {\\n background: #111; }\\n .dg .c input[type=text] {\\n background: #303030;\\n outline: none; }\\n .dg .c input[type=text]:hover {\\n background: #3c3c3c; }\\n .dg .c input[type=text]:focus {\\n background: #494949;\\n color: #fff; }\\n .dg .c .slider {\\n background: #303030;\\n cursor: ew-resize; }\\n .dg .c .slider-fg {\\n background: #2FA1D6;\\n max-width: 100%; }\\n .dg .c .slider:hover {\\n background: #3c3c3c; }\\n .dg .c .slider:hover .slider-fg {\\n background: #44abda; }\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/style.scss\n// module id = 23\n// module chunks = 0","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/css-loader/lib/css-base.js\n// module id = 24\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 1923ebf5946db2a04a7d","webpack:///../index.js","webpack:///./dat/index.js","webpack:///./dat/color/Color.js","webpack:///./dat/color/interpret.js","webpack:///./dat/color/toString.js","webpack:///./dat/utils/common.js","webpack:///./dat/color/math.js","webpack:///./dat/controllers/Controller.js","webpack:///./dat/controllers/BooleanController.js","webpack:///./dat/dom/dom.js","webpack:///./dat/controllers/OptionController.js","webpack:///./dat/controllers/StringController.js","webpack:///./dat/controllers/NumberController.js","webpack:///./dat/controllers/NumberControllerBox.js","webpack:///./dat/controllers/NumberControllerSlider.js","webpack:///./dat/controllers/FunctionController.js","webpack:///./dat/controllers/ColorController.js","webpack:///./dat/gui/GUI.js","webpack:///./dat/utils/css.js","webpack:///./dat/gui/saveDialogue.html","webpack:///./dat/controllers/ControllerFactory.js","webpack:///./dat/utils/requestAnimationFrame.js","webpack:///./dat/dom/CenteredDiv.js","webpack:///./dat/gui/style.scss","webpack:///../~/css-loader/lib/css-base.js"],"names":["color","Color","math","interpret","controllers","Controller","BooleanController","OptionController","StringController","NumberController","NumberControllerBox","NumberControllerSlider","FunctionController","ColorController","dom","gui","GUI","__state","apply","arguments","Error","a","toString","toHexString","toOriginal","conversion","write","defineRGBComponent","target","component","componentHexIndex","Object","defineProperty","get","space","recalculateRGB","set","v","defineHSVComponent","recalculateHSV","component_from_hex","hex","extend","hsv_to_rgb","h","s","result","rgb_to_hsv","r","g","b","isNaN","isUndefined","COMPONENTS","prototype","rgb_to_hex","INTERPRETATIONS","litmus","isString","conversions","THREE_CHAR_HEX","read","original","test","match","parseInt","SIX_CHAR_HEX","CSS_RGB","parseFloat","CSS_RGBA","isNumber","HEX","conversionName","isArray","RGB_ARRAY","length","RGBA_ARRAY","isObject","RGBA_OBJ","RGB_OBJ","HSVA_OBJ","HSV_OBJ","toReturn","toArray","each","family","BREAK","forceCSSHex","colorFormat","Math","round","toFixed","str","ARR_EACH","Array","forEach","ARR_SLICE","slice","Common","call","obj","keys","key","bind","defaults","compose","toCall","args","i","itr","scope","l","defer","fnc","setTimeout","debounce","func","threshold","callImmediately","timeout","delayed","callNow","clearTimeout","undefined","isNull","constructor","isBoolean","isFunction","tmpComponent","ColorMath","hi","floor","f","p","q","t","c","min","max","delta","NaN","hex_with_component","componentIndex","value","object","property","initialValue","domElement","document","createElement","__onChange","__onFinishChange","onChange","onFinishChange","setValue","newValue","updateDisplay","getValue","isModified","_this","__prev","__checkbox","setAttribute","appendChild","checked","EVENT_MAP","HTMLEvents","MouseEvents","KeyboardEvents","EVENT_MAP_INV","k","e","CSS_VALUE_PIXELS","cssValueToPixels","val","makeSelectable","elem","selectable","style","onselectstart","MozUserSelect","KhtmlUserSelect","unselectable","makeFullscreen","hor","vert","vertical","horizontal","position","left","right","top","bottom","fakeEvent","eventType","pars","aux","params","className","evt","createEvent","clientX","x","clientY","y","initMouseEvent","bubbles","cancelable","window","clickCount","init","initKeyboardEvent","initKeyEvent","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode","initEvent","dispatchEvent","event","newBool","bool","addEventListener","attachEvent","unbind","removeEventListener","detachEvent","addClass","classes","split","indexOf","push","join","replace","removeClass","removeAttribute","index","splice","hasClass","RegExp","getWidth","getComputedStyle","width","getHeight","height","getOffset","el","offset","offsetParent","offsetLeft","offsetTop","isActive","activeElement","type","href","opts","options","__select","map","element","opt","innerHTML","desiredValue","selectedIndex","__input","onBlur","blur","numDecimals","_x","_params","__min","__max","__step","step","__impliedStep","pow","log","abs","LN10","__precision","_v","minValue","maxValue","stepValue","roundToDecimal","decimals","tenTo","__truncationSuspended","prevY","mousewheelevt","navigator","userAgent","onMouseWheel","deltaY","wheelDelta","detail","preventDefault","attempted","onFinish","onMouseDrag","diff","onMouseUp","onMouseDown","i1","i2","o1","o2","__background","__foreground","console","bgRect","getBoundingClientRect","pct","text","__button","fire","__color","__temp","__selector","__saturation_field","__field_knob","__field_knob_border","__hue_knob","__hue_field","__input_textShadow","valueField","padding","backgroundColor","boxShadow","border","borderRadius","zIndex","borderRight","marginRight","display","cursor","background","linearGradient","hueGradient","outline","textAlign","fontWeight","textShadow","fieldDown","setH","fieldUpH","setSV","fieldUpSV","fieldRect","mismatch","flip","_flip","marginLeft","marginTop","vendors","vendor","cssText","inject","CSS_NAMESPACE","HIDE_KEY_CODE","CLOSE_BUTTON_HEIGHT","DEFAULT_DEFAULT_PRESET_NAME","SUPPORTS_LOCAL_STORAGE","localStorage","SAVE_DIALOGUE","autoPlaceVirgin","autoPlaceContainer","hide","hideableGuis","__ul","__folders","__controllers","__rememberedObjects","__rememberedObjectIndecesToControllers","__listening","closeOnTop","autoPlace","DEFAULT_WIDTH","resizable","hideable","load","preset","parent","scrollable","useLocalStorage","getItem","getLocalStorageHash","saveToLocalStorage","defineProperties","getRoot","setPresetSelectIndex","revert","setWidth","name","titleRowName","closed","CLASS_CLOSED","onResize","__closeButton","TEXT_OPEN","TEXT_CLOSED","setItem","CLASS_MAIN","savedGui","JSON","parse","CLASS_CLOSE_BUTTON","CLASS_CLOSE_TOP","insertBefore","childNodes","CLASS_CLOSE_BOTTOM","createTextNode","titleRow","addRow","onClickTitle","CLASS_AUTO_PLACE_CONTAINER","body","CLASS_AUTO_PLACE","__resizeHandler","onResizeDebounced","addResizeHandle","stringify","getSaveObject","saveToLocalStorageIfPossible","resetWidth","root","toggleHide","CLASS_CONTROLLER_ROW","CLASS_TOO_TALL","CLASS_DRAG","_keydownHandler","which","add","factoryArgs","addColor","remove","controller","removeChild","__li","destroy","addFolder","newGuiParams","folders","li","open","close","node","__save_row","innerHeight","__resize_handle","offsetHeight","remember","addSaveMenu","remembered","getCurrentPreset","save","markPresetModified","saveAs","presetName","addPresetOption","recallSavedValue","folder","listen","updateDisplays","newDom","liBefore","modified","__preset_select","augmentController","__gui","nextSibling","nextElementSibling","before","firstElementChild","box","method","pc","pb","returned","oldName","wasListening","newController","stopPropagation","borderLeftColor","matchedIndex","controllerMap","presetMap","concat","container","location","setSelected","showHideExplain","explain","div","firstChild","gears","button","button2","button3","select","getElementById","localStorageCheckBox","saveLocally","newConstructorTextArea","show","focus","prompt","pmouseX","drag","dragStop","dragStart","w","useInitialValues","savedValues","controllerArray","module","exports","url","indoc","doc","link","rel","getElementsByTagName","css","injected","head","ControllerFactory","requestAnimationFrame","callback","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","CenteredDiv","backgroundElement","opacity","WebkitTransition","transition","webkitTransform","layout","innerWidth"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AA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AACA,iBAAgB,iBAAiB;AACjC;AACA;AACA,yCAAwC,gBAAgB;AACxD,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,aAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"dat.gui.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dat\"] = factory();\n\telse\n\t\troot[\"dat\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 1923ebf5946db2a04a7d","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dat from './src/dat/index';\n\nexport default dat;\n\n\n\n// WEBPACK FOOTER //\n// ../index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Color from './color/Color';\nimport math from './color/math';\nimport interpret from './color/interpret';\n\nimport Controller from './controllers/Controller';\nimport BooleanController from './controllers/BooleanController';\nimport OptionController from './controllers/OptionController';\nimport StringController from './controllers/StringController';\nimport NumberController from './controllers/NumberController';\nimport NumberControllerBox from './controllers/NumberControllerBox';\nimport NumberControllerSlider from './controllers/NumberControllerSlider';\nimport FunctionController from './controllers/FunctionController';\nimport ColorController from './controllers/ColorController';\n\nimport dom from './dom/dom';\nimport GUI from './gui/GUI';\n\nexport default {\n color: {\n Color: Color,\n math: math,\n interpret: interpret\n },\n\n controllers: {\n Controller: Controller,\n BooleanController: BooleanController,\n OptionController: OptionController,\n StringController: StringController,\n NumberController: NumberController,\n NumberControllerBox: NumberControllerBox,\n NumberControllerSlider: NumberControllerSlider,\n FunctionController: FunctionController,\n ColorController: ColorController\n },\n\n dom: {\n dom: dom\n },\n\n gui: {\n GUI: GUI\n },\n\n GUI: GUI\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport interpret from './interpret';\nimport math from './math';\nimport colorToString from './toString';\nimport common from '../utils/common';\n\nclass Color {\n constructor() {\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw new Error('Failed to interpret color arguments');\n }\n\n this.__state.a = this.__state.a || 1;\n }\n\n toString() {\n return colorToString(this);\n }\n\n toHexString() {\n return colorToString(this, true);\n }\n\n toOriginal() {\n return this.__state.conversion.write(this);\n }\n}\n\nfunction defineRGBComponent(target, component, componentHexIndex) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n Color.recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'RGB') {\n Color.recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\nfunction defineHSVComponent(target, component) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'HSV') {\n return this.__state[component];\n }\n\n Color.recalculateHSV(this);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'HSV') {\n Color.recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\n\nColor.recalculateRGB = function(color, component, componentHexIndex) {\n if (color.__state.space === 'HEX') {\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n } else if (color.__state.space === 'HSV') {\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n } else {\n throw new Error('Corrupted color state');\n }\n};\n\nColor.recalculateHSV = function(color) {\n const result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n};\n\nColor.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a'];\n\ndefineRGBComponent(Color.prototype, 'r', 2);\ndefineRGBComponent(Color.prototype, 'g', 1);\ndefineRGBComponent(Color.prototype, 'b', 0);\n\ndefineHSVComponent(Color.prototype, 'h');\ndefineHSVComponent(Color.prototype, 's');\ndefineHSVComponent(Color.prototype, 'v');\n\nObject.defineProperty(Color.prototype, 'a', {\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n});\n\nObject.defineProperty(Color.prototype, 'hex', {\n get: function() {\n if (!this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n }\n\n return this.__state.hex;\n },\n\n set: function(v) {\n this.__state.space = 'HEX';\n this.__state.hex = v;\n }\n});\n\nexport default Color;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/Color.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport toString from './toString';\nimport common from '../utils/common';\n\nconst INTERPRETATIONS = [\n // Strings\n {\n litmus: common.isString,\n conversions: {\n THREE_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt(\n '0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString(), 0)\n };\n },\n\n write: toString\n },\n\n SIX_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString(), 0)\n };\n },\n\n write: toString\n },\n\n CSS_RGB: {\n read: function(original) {\n const test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n },\n\n write: toString\n },\n\n CSS_RGBA: {\n read: function(original) {\n const test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n },\n\n write: toString\n }\n }\n },\n\n // Numbers\n {\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n };\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n litmus: common.isArray,\n conversions: {\n RGB_ARRAY: {\n read: function(original) {\n if (original.length !== 3) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length !== 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n }\n }\n },\n\n // Objects\n {\n litmus: common.isObject,\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n };\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n };\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n };\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n };\n }\n }\n }\n }\n];\n\nlet result;\nlet toReturn;\n\nconst interpret = function() {\n toReturn = false;\n\n const original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n common.each(INTERPRETATIONS, function(family) {\n if (family.litmus(original)) {\n common.each(family.conversions, function(conversion, conversionName) {\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n }\n });\n\n return common.BREAK;\n }\n });\n\n return toReturn;\n};\n\nexport default interpret;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/interpret.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nexport default function(color, forceCSSHex) {\n const colorFormat = color.__state.conversionName.toString();\n\n const r = Math.round(color.r);\n const g = Math.round(color.g);\n const b = Math.round(color.b);\n const a = color.a;\n const h = Math.round(color.h);\n const s = color.s.toFixed(1);\n const v = color.v.toFixed(1);\n\n if (forceCSSHex || (colorFormat === 'THREE_CHAR_HEX') || (colorFormat === 'SIX_CHAR_HEX')) {\n let str = color.hex.toString(16);\n while (str.length < 6) {\n str = '0' + str;\n }\n return '#' + str;\n } else if (colorFormat === 'CSS_RGB') {\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n } else if (colorFormat === 'CSS_RGBA') {\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n } else if (colorFormat === 'HEX') {\n return '0x' + color.hex.toString(16);\n } else if (colorFormat === 'RGB_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ']';\n } else if (colorFormat === 'RGBA_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ',' + a + ']';\n } else if (colorFormat === 'RGB_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + '}';\n } else if (colorFormat === 'RGBA_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}';\n } else if (colorFormat === 'HSV_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + '}';\n } else if (colorFormat === 'HSVA_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}';\n }\n\n return 'unknown format';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/toString.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nconst ARR_EACH = Array.prototype.forEach;\nconst ARR_SLICE = Array.prototype.slice;\n\n/**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\nconst Common = {\n BREAK: {},\n\n extend: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (!this.isUndefined(obj[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n defaults: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (this.isUndefined(target[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n compose: function() {\n const toCall = ARR_SLICE.call(arguments);\n return function() {\n let args = ARR_SLICE.call(arguments);\n for (let i = toCall.length - 1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n };\n },\n\n each: function(obj, itr, scope) {\n if (!obj) {\n return;\n }\n\n if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) {\n obj.forEach(itr, scope);\n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n let key;\n let l;\n for (key = 0, l = obj.length; key < l; key++) {\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n } else {\n for (const key in obj) {\n if (itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n }\n },\n\n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n\n // if the function is called repeatedly, wait until threshold passes until we execute the function\n debounce: function(func, threshold, callImmediately) {\n let timeout;\n\n return function() {\n const obj = this;\n const args = arguments;\n function delayed() {\n timeout = null;\n if (!callImmediately) func.apply(obj, args);\n }\n\n const callNow = callImmediately || !timeout;\n\n clearTimeout(timeout);\n timeout = setTimeout(delayed, threshold);\n\n if (callNow) {\n func.apply(obj, args);\n }\n };\n },\n\n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n\n isNull: function(obj) {\n return obj === null;\n },\n\n isNaN: function(obj) {\n return isNaN(obj);\n },\n\n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n\n isObject: function(obj) {\n return obj === Object(obj);\n },\n\n isNumber: function(obj) {\n return obj === obj + 0;\n },\n\n isString: function(obj) {\n return obj === obj + '';\n },\n\n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n\n isFunction: function(obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n }\n\n};\n\nexport default Common;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/common.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nlet tmpComponent;\n\nconst ColorMath = {\n hsv_to_rgb: function(h, s, v) {\n const hi = Math.floor(h / 60) % 6;\n\n const f = h / 60 - Math.floor(h / 60);\n const p = v * (1.0 - s);\n const q = v * (1.0 - (f * s));\n const t = v * (1.0 - ((1.0 - f) * s));\n\n const c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n },\n\n rgb_to_hsv: function(r, g, b) {\n const min = Math.min(r, g, b);\n const max = Math.max(r, g, b);\n const delta = max - min;\n let h;\n let s;\n\n if (max !== 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n let hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~(0xFF << tmpComponent));\n }\n};\n\nexport default ColorMath;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/math.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/**\n * @class An \"abstract\" class that represents a given property of an object.\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass Controller {\n constructor(object, property) {\n this.initialValue = object[property];\n\n /**\n * Those who extend this class will put their DOM elements in here.\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n\n /**\n * The object to manipulate\n * @type {Object}\n */\n this.object = object;\n\n /**\n * The name of the property to manipulate\n * @type {String}\n */\n this.property = property;\n\n /**\n * The function to be called on change.\n * @type {Function}\n * @ignore\n */\n this.__onChange = undefined;\n\n /**\n * The function to be called on finishing change.\n * @type {Function}\n * @ignore\n */\n this.__onFinishChange = undefined;\n }\n\n /**\n * Specify that a function fire every time someone changes the value with\n * this Controller.\n *\n * @param {Function} fnc This function will be called whenever the value\n * is modified via this Controller.\n * @returns {Controller} this\n */\n onChange(fnc) {\n this.__onChange = fnc;\n return this;\n }\n\n /**\n * Specify that a function fire every time someone \"finishes\" changing\n * the value wih this Controller. Useful for values that change\n * incrementally like numbers or strings.\n *\n * @param {Function} fnc This function will be called whenever\n * someone \"finishes\" changing the value via this Controller.\n * @returns {Controller} this\n */\n onFinishChange(fnc) {\n this.__onFinishChange = fnc;\n return this;\n }\n\n /**\n * Change the value of object[property]\n *\n * @param {Object} newValue The new value of object[property]\n */\n setValue(newValue) {\n this.object[this.property] = newValue;\n if (this.__onChange) {\n this.__onChange.call(this, newValue);\n }\n\n this.updateDisplay();\n return this;\n }\n\n /**\n * Gets the value of object[property]\n *\n * @returns {Object} The current value of object[property]\n */\n getValue() {\n return this.object[this.property];\n }\n\n /**\n * Refreshes the visual display of a Controller in order to keep sync\n * with the object's current value.\n * @returns {Controller} this\n */\n updateDisplay() {\n return this;\n }\n\n /**\n * @returns {Boolean} true if the value has deviated from initialValue\n */\n isModified() {\n return this.initialValue !== this.getValue();\n }\n}\n\nexport default Controller;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/Controller.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a checkbox input to alter the boolean property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass BooleanController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n this.__prev = this.getValue();\n\n this.__checkbox = document.createElement('input');\n this.__checkbox.setAttribute('type', 'checkbox');\n\n function onChange() {\n _this.setValue(!_this.__prev);\n }\n\n dom.bind(this.__checkbox, 'change', onChange, false);\n\n this.domElement.appendChild(this.__checkbox);\n\n // Match original value\n this.updateDisplay();\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.__prev = this.getValue();\n return toReturn;\n }\n\n updateDisplay() {\n if (this.getValue() === true) {\n this.__checkbox.setAttribute('checked', 'checked');\n this.__checkbox.checked = true;\n this.__prev = true;\n } else {\n this.__checkbox.checked = false;\n this.__prev = false;\n }\n\n return super.updateDisplay();\n }\n}\n\nexport default BooleanController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/BooleanController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport common from '../utils/common';\n\nconst EVENT_MAP = {\n HTMLEvents: ['change'],\n MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],\n KeyboardEvents: ['keydown']\n};\n\nconst EVENT_MAP_INV = {};\ncommon.each(EVENT_MAP, function(v, k) {\n common.each(v, function(e) {\n EVENT_MAP_INV[e] = k;\n });\n});\n\nconst CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\n\nfunction cssValueToPixels(val) {\n if (val === '0' || common.isUndefined(val)) {\n return 0;\n }\n\n const match = val.match(CSS_VALUE_PIXELS);\n\n if (!common.isNull(match)) {\n return parseFloat(match[1]);\n }\n\n // TODO ...ems? %?\n\n return 0;\n}\n\n/**\n * @namespace\n * @member dat.dom\n */\nconst dom = {\n\n /**\n *\n * @param elem\n * @param selectable\n */\n makeSelectable: function(elem, selectable) {\n if (elem === undefined || elem.style === undefined) return;\n\n elem.onselectstart = selectable ? function() {\n return false;\n } : function() {\n };\n\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\n elem.unselectable = selectable ? 'on' : 'off';\n },\n\n /**\n *\n * @param elem\n * @param horizontal\n * @param vert\n */\n makeFullscreen: function(elem, hor, vert) {\n let vertical = vert;\n let horizontal = hor;\n\n if (common.isUndefined(horizontal)) {\n horizontal = true;\n }\n\n if (common.isUndefined(vertical)) {\n vertical = true;\n }\n\n elem.style.position = 'absolute';\n\n if (horizontal) {\n elem.style.left = 0;\n elem.style.right = 0;\n }\n if (vertical) {\n elem.style.top = 0;\n elem.style.bottom = 0;\n }\n },\n\n /**\n *\n * @param elem\n * @param eventType\n * @param params\n */\n fakeEvent: function(elem, eventType, pars, aux) {\n const params = pars || {};\n const className = EVENT_MAP_INV[eventType];\n if (!className) {\n throw new Error('Event type ' + eventType + ' not supported.');\n }\n const evt = document.createEvent(className);\n switch (className) {\n case 'MouseEvents':\n {\n const clientX = params.x || params.clientX || 0;\n const clientY = params.y || params.clientY || 0;\n evt.initMouseEvent(eventType, params.bubbles || false,\n params.cancelable || true, window, params.clickCount || 1,\n 0, // screen X\n 0, // screen Y\n clientX, // client X\n clientY, // client Y\n false, false, false, false, 0, null);\n break;\n }\n case 'KeyboardEvents':\n {\n const init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz\n common.defaults(params, {\n cancelable: true,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n keyCode: undefined,\n charCode: undefined\n });\n init(eventType, params.bubbles || false,\n params.cancelable, window,\n params.ctrlKey, params.altKey,\n params.shiftKey, params.metaKey,\n params.keyCode, params.charCode);\n break;\n }\n default:\n {\n evt.initEvent(eventType, params.bubbles || false, params.cancelable || true);\n break;\n }\n }\n common.defaults(evt, aux);\n elem.dispatchEvent(evt);\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n bind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.addEventListener) {\n elem.addEventListener(event, func, bool);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n unbind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.removeEventListener) {\n elem.removeEventListener(event, func, bool);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n addClass: function(elem, className) {\n if (elem.className === undefined) {\n elem.className = className;\n } else if (elem.className !== className) {\n const classes = elem.className.split(/ +/);\n if (classes.indexOf(className) === -1) {\n classes.push(className);\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\n }\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n removeClass: function(elem, className) {\n if (className) {\n if (elem.className === className) {\n elem.removeAttribute('class');\n } else {\n const classes = elem.className.split(/ +/);\n const index = classes.indexOf(className);\n if (index !== -1) {\n classes.splice(index, 1);\n elem.className = classes.join(' ');\n }\n }\n } else {\n elem.className = undefined;\n }\n return dom;\n },\n\n hasClass: function(elem, className) {\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\n },\n\n /**\n *\n * @param elem\n */\n getWidth: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-left-width']) +\n cssValueToPixels(style['border-right-width']) +\n cssValueToPixels(style['padding-left']) +\n cssValueToPixels(style['padding-right']) +\n cssValueToPixels(style.width);\n },\n\n /**\n *\n * @param elem\n */\n getHeight: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-top-width']) +\n cssValueToPixels(style['border-bottom-width']) +\n cssValueToPixels(style['padding-top']) +\n cssValueToPixels(style['padding-bottom']) +\n cssValueToPixels(style.height);\n },\n\n /**\n *\n * @param el\n */\n getOffset: function(el) {\n let elem = el;\n const offset = { left: 0, top: 0 };\n if (elem.offsetParent) {\n do {\n offset.left += elem.offsetLeft;\n offset.top += elem.offsetTop;\n elem = elem.offsetParent;\n } while (elem);\n }\n return offset;\n },\n\n // http://stackoverflow.com/posts/2684561/revisions\n /**\n *\n * @param elem\n */\n isActive: function(elem) {\n return elem === document.activeElement && (elem.type || elem.href);\n }\n\n};\n\nexport default dom;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/dom.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\n/**\n * @class Provides a select input to alter the property of an object, using a\n * list of accepted values.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object|string[]} options A map of labels to acceptable values, or\n * a list of acceptable string values.\n */\nclass OptionController extends Controller {\n constructor(object, property, opts) {\n super(object, property);\n\n let options = opts;\n\n const _this = this;\n\n /**\n * The drop down menu\n * @ignore\n */\n this.__select = document.createElement('select');\n\n if (common.isArray(options)) {\n const map = {};\n common.each(options, function(element) {\n map[element] = element;\n });\n options = map;\n }\n\n common.each(options, function(value, key) {\n const opt = document.createElement('option');\n opt.innerHTML = key;\n opt.setAttribute('value', value);\n _this.__select.appendChild(opt);\n });\n\n // Acknowledge original value\n this.updateDisplay();\n\n dom.bind(this.__select, 'change', function() {\n const desiredValue = this.options[this.selectedIndex].value;\n _this.setValue(desiredValue);\n });\n\n this.domElement.appendChild(this.__select);\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n return toReturn;\n }\n\n updateDisplay() {\n if (dom.isActive(this.__select)) return this; // prevent number from updating if user is trying to manually update\n this.__select.value = this.getValue();\n return super.updateDisplay();\n }\n}\n\nexport default OptionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/OptionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a text input to alter the string property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass StringController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n\n function onChange() {\n _this.setValue(_this.__input.value);\n }\n\n function onBlur() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n dom.bind(this.__input, 'keyup', onChange);\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) {\n this.blur();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n // Stops the caret from moving on account of:\n // keyup -> setValue -> updateDisplay\n if (!dom.isActive(this.__input)) {\n this.__input.value = this.getValue();\n }\n return super.updateDisplay();\n }\n}\n\nexport default StringController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/StringController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport common from '../utils/common';\n\nfunction numDecimals(x) {\n const _x = x.toString();\n if (_x.indexOf('.') > -1) {\n return _x.length - _x.indexOf('.') - 1;\n }\n\n return 0;\n}\n\n/**\n * @class Represents a given property of an object that is a number.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberController extends Controller {\n constructor(object, property, params) {\n super(object, property);\n\n const _params = params || {};\n\n this.__min = _params.min;\n this.__max = _params.max;\n this.__step = _params.step;\n\n if (common.isUndefined(this.__step)) {\n if (this.initialValue === 0) {\n this.__impliedStep = 1; // What are we, psychics?\n } else {\n // Hey Doug, check this out.\n this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(this.initialValue)) / Math.LN10)) / 10;\n }\n } else {\n this.__impliedStep = this.__step;\n }\n\n this.__precision = numDecimals(this.__impliedStep);\n }\n\n setValue(v) {\n let _v = v;\n\n if (this.__min !== undefined && _v < this.__min) {\n _v = this.__min;\n } else if (this.__max !== undefined && _v > this.__max) {\n _v = this.__max;\n }\n\n if (this.__step !== undefined && _v % this.__step !== 0) {\n _v = Math.round(_v / this.__step) * this.__step;\n }\n\n return super.setValue(_v);\n }\n\n /**\n * Specify a minimum value for object[property].\n *\n * @param {Number} minValue The minimum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n min(minValue) {\n this.__min = minValue;\n return this;\n }\n\n /**\n * Specify a maximum value for object[property].\n *\n * @param {Number} maxValue The maximum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n max(maxValue) {\n this.__max = maxValue;\n return this;\n }\n\n /**\n * Specify a step value that dat.controllers.NumberController\n * increments by.\n *\n * @param {Number} stepValue The step value for\n * dat.controllers.NumberController\n * @default if minimum and maximum specified increment is 1% of the\n * difference otherwise stepValue is 1\n * @returns {dat.controllers.NumberController} this\n */\n step(stepValue) {\n this.__step = stepValue;\n this.__impliedStep = stepValue;\n this.__precision = numDecimals(stepValue);\n return this;\n }\n}\n\nexport default NumberController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nfunction roundToDecimal(value, decimals) {\n const tenTo = Math.pow(10, decimals);\n return Math.round(value * tenTo) / tenTo;\n}\n\n/**\n * @class Represents a given property of an object that is a number and\n * provides an input element with which to manipulate it.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberControllerBox extends NumberController {\n constructor(object, property, params) {\n super(object, property, params);\n\n this.__truncationSuspended = false;\n\n const _this = this;\n\n /**\n * {Number} Previous mouse y position\n * @ignore\n */\n let prevY;\n\n const mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? 'DOMMouseScroll' : 'mousewheel';\n\n function onMouseWheel(e) {\n let value = _this.getValue();\n const delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1;\n e.preventDefault();\n\n if (delta < 0) value += _this.__impliedStep;\n else value -= _this.__impliedStep;\n _this.setValue(value);\n }\n\n function onChange() {\n const attempted = parseFloat(_this.__input.value);\n if (!common.isNaN(attempted)) {\n _this.setValue(attempted);\n }\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n function onBlur() {\n onFinish();\n }\n\n function onMouseDrag(e) {\n const diff = prevY - e.clientY;\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\n\n prevY = e.clientY;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n onFinish();\n }\n\n function onMouseDown(e) {\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n prevY = e.clientY;\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n // Makes it so manually specified values are not truncated.\n\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'mousedown', onMouseDown);\n dom.bind(this.__input, mousewheelevt, onMouseWheel);\n dom.bind(this.__input, 'keydown', function(e) {\n // When pressing enter, you can be as precise as you want.\n if (e.keyCode === 13) {\n _this.__truncationSuspended = true;\n this.blur();\n _this.__truncationSuspended = false;\n onFinish();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerBox;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerBox.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\n\nfunction map(v, i1, i2, o1, o2) {\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\n}\n\n/**\n * @class Represents a given property of an object that is a number, contains\n * a minimum and maximum, and provides a slider element with which to\n * manipulate it. It should be noted that the slider element is made up of\n * <div> tags, not the html5\n * <slider> element.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Number} minValue Minimum allowed value\n * @param {Number} maxValue Maximum allowed value\n * @param {Number} stepValue Increment by which to change value\n */\nclass NumberControllerSlider extends NumberController {\n constructor(object, property, min, max, step) {\n super(object, property, { min: min, max: max, step: step });\n\n const _this = this;\n\n this.__background = document.createElement('div');\n this.__foreground = document.createElement('div');\n\n dom.bind(this.__background, 'mousedown', onMouseDown);\n\n const mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? 'DOMMouseScroll' : 'mousewheel';\n dom.bind(this.__background, mousewheelevt, onMouseWheel);\n\n dom.addClass(this.__background, 'slider');\n dom.addClass(this.__foreground, 'slider-fg');\n\n function onMouseWheel(e) {\n let value = _this.getValue();\n const delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1;\n e.preventDefault();\n document.activeElement.blur();\n\n if (delta < 0) value += _this.__impliedStep;\n else value -= _this.__impliedStep;\n _this.setValue(value);\n }\n\n function onMouseDown(e) {\n document.activeElement.blur();\n\n window.console.log('delete this line');\n\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n\n onMouseDrag(e);\n }\n\n function onMouseDrag(e) {\n e.preventDefault();\n\n const bgRect = _this.__background.getBoundingClientRect();\n\n _this.setValue(\n map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)\n );\n\n return false;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.__background.appendChild(this.__foreground);\n this.domElement.appendChild(this.__background);\n }\n\n updateDisplay() {\n const pct = (this.getValue() - this.__min) / (this.__max - this.__min);\n this.__foreground.style.width = pct * 100 + '%';\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerSlider.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a GUI interface to fire a specified method, a property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass FunctionController extends Controller {\n constructor(object, property, text) {\n super(object, property);\n\n const _this = this;\n\n this.__button = document.createElement('div');\n this.__button.innerHTML = text === undefined ? 'Fire' : text;\n\n dom.bind(this.__button, 'click', function(e) {\n e.preventDefault();\n _this.fire();\n return false;\n });\n\n dom.addClass(this.__button, 'button');\n\n this.domElement.appendChild(this.__button);\n }\n\n fire() {\n if (this.__onChange) {\n this.__onChange.call(this);\n }\n this.getValue().call(this.object);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n }\n}\n\nexport default FunctionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/FunctionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport Color from '../color/Color';\nimport interpret from '../color/interpret';\nimport common from '../utils/common';\n\n/**\n * @class Represents a given property of an object that is a color.\n * @param {Object} object\n * @param {string} property\n */\nclass ColorController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n this.__color = new Color(this.getValue());\n this.__temp = new Color(0);\n\n const _this = this;\n\n this.domElement = document.createElement('div');\n\n dom.makeSelectable(this.domElement, false);\n\n this.__selector = document.createElement('div');\n this.__selector.className = 'selector';\n\n this.__saturation_field = document.createElement('div');\n this.__saturation_field.className = 'saturation-field';\n\n this.__field_knob = document.createElement('div');\n this.__field_knob.className = 'field-knob';\n this.__field_knob_border = '2px solid ';\n\n this.__hue_knob = document.createElement('div');\n this.__hue_knob.className = 'hue-knob';\n\n this.__hue_field = document.createElement('div');\n this.__hue_field.className = 'hue-field';\n\n this.__input = document.createElement('input');\n this.__input.type = 'text';\n this.__input_textShadow = '0 1px 1px ';\n\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) { // on enter\n onBlur.call(this);\n }\n });\n\n dom.bind(this.__input, 'blur', onBlur);\n\n dom.bind(this.__selector, 'mousedown', function(/* e */) {\n dom\n .addClass(this, 'drag')\n .bind(window, 'mouseup', function(/* e */) {\n dom.removeClass(_this.__selector, 'drag');\n });\n });\n\n const valueField = document.createElement('div');\n\n common.extend(this.__selector.style, {\n width: '122px',\n height: '102px',\n padding: '3px',\n backgroundColor: '#222',\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\n });\n\n common.extend(this.__field_knob.style, {\n position: 'absolute',\n width: '12px',\n height: '12px',\n border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\n borderRadius: '12px',\n zIndex: 1\n });\n\n common.extend(this.__hue_knob.style, {\n position: 'absolute',\n width: '15px',\n height: '2px',\n borderRight: '4px solid #fff',\n zIndex: 1\n });\n\n common.extend(this.__saturation_field.style, {\n width: '100px',\n height: '100px',\n border: '1px solid #555',\n marginRight: '3px',\n display: 'inline-block',\n cursor: 'pointer'\n });\n\n common.extend(valueField.style, {\n width: '100%',\n height: '100%',\n background: 'none'\n });\n\n linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000');\n\n common.extend(this.__hue_field.style, {\n width: '15px',\n height: '100px',\n border: '1px solid #555',\n cursor: 'ns-resize',\n position: 'absolute',\n top: '3px',\n right: '3px'\n });\n\n hueGradient(this.__hue_field);\n\n common.extend(this.__input.style, {\n outline: 'none',\n// width: '120px',\n textAlign: 'center',\n// padding: '4px',\n// marginBottom: '6px',\n color: '#fff',\n border: 0,\n fontWeight: 'bold',\n textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'\n });\n\n dom.bind(this.__saturation_field, 'mousedown', fieldDown);\n dom.bind(this.__field_knob, 'mousedown', fieldDown);\n\n dom.bind(this.__hue_field, 'mousedown', function(e) {\n setH(e);\n dom.bind(window, 'mousemove', setH);\n dom.bind(window, 'mouseup', fieldUpH);\n });\n\n function fieldDown(e) {\n setSV(e);\n // document.body.style.cursor = 'none';\n dom.bind(window, 'mousemove', setSV);\n dom.bind(window, 'mouseup', fieldUpSV);\n }\n\n function fieldUpSV() {\n dom.unbind(window, 'mousemove', setSV);\n dom.unbind(window, 'mouseup', fieldUpSV);\n // document.body.style.cursor = 'default';\n onFinish();\n }\n\n function onBlur() {\n const i = interpret(this.value);\n if (i !== false) {\n _this.__color.__state = i;\n _this.setValue(_this.__color.toOriginal());\n } else {\n this.value = _this.__color.toString();\n }\n }\n\n function fieldUpH() {\n dom.unbind(window, 'mousemove', setH);\n dom.unbind(window, 'mouseup', fieldUpH);\n onFinish();\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.__color.toOriginal());\n }\n }\n\n this.__saturation_field.appendChild(valueField);\n this.__selector.appendChild(this.__field_knob);\n this.__selector.appendChild(this.__saturation_field);\n this.__selector.appendChild(this.__hue_field);\n this.__hue_field.appendChild(this.__hue_knob);\n\n this.domElement.appendChild(this.__input);\n this.domElement.appendChild(this.__selector);\n\n this.updateDisplay();\n\n function setSV(e) {\n e.preventDefault();\n\n const fieldRect = _this.__saturation_field.getBoundingClientRect();\n let s = (e.clientX - fieldRect.left) / (fieldRect.right - fieldRect.left);\n let v = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (v > 1) {\n v = 1;\n } else if (v < 0) {\n v = 0;\n }\n\n if (s > 1) {\n s = 1;\n } else if (s < 0) {\n s = 0;\n }\n\n _this.__color.v = v;\n _this.__color.s = s;\n\n _this.setValue(_this.__color.toOriginal());\n\n\n return false;\n }\n\n function setH(e) {\n e.preventDefault();\n\n const fieldRect = _this.__hue_field.getBoundingClientRect();\n let h = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (h > 1) {\n h = 1;\n } else if (h < 0) {\n h = 0;\n }\n\n _this.__color.h = h * 360;\n\n _this.setValue(_this.__color.toOriginal());\n\n return false;\n }\n }\n\n updateDisplay() {\n const i = interpret(this.getValue());\n\n if (i !== false) {\n let mismatch = false;\n\n // Check for mismatch on the interpreted value.\n\n common.each(Color.COMPONENTS, function(component) {\n if (!common.isUndefined(i[component]) && !common.isUndefined(this.__color.__state[component]) &&\n i[component] !== this.__color.__state[component]) {\n mismatch = true;\n return {}; // break\n }\n }, this);\n\n // If nothing diverges, we keep our previous values\n // for statefulness, otherwise we recalculate fresh\n if (mismatch) {\n common.extend(this.__color.__state, i);\n }\n }\n\n common.extend(this.__temp.__state, this.__color.__state);\n\n this.__temp.a = 1;\n\n const flip = (this.__color.v < 0.5 || this.__color.s > 0.5) ? 255 : 0;\n const _flip = 255 - flip;\n\n common.extend(this.__field_knob.style, {\n marginLeft: 100 * this.__color.s - 7 + 'px',\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\n backgroundColor: this.__temp.toHexString(),\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')'\n });\n\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px';\n\n this.__temp.s = 1;\n this.__temp.v = 1;\n\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString());\n\n this.__input.value = this.__color.toString();\n\n common.extend(this.__input.style, {\n backgroundColor: this.__color.toHexString(),\n color: 'rgb(' + flip + ',' + flip + ',' + flip + ')',\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)'\n });\n }\n}\n\nconst vendors = ['-moz-', '-o-', '-webkit-', '-ms-', ''];\n\nfunction linearGradient(elem, x, a, b) {\n elem.style.background = '';\n common.each(vendors, function(vendor) {\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); ';\n });\n}\n\nfunction hueGradient(elem) {\n elem.style.background = '';\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);';\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n}\n\nexport default ColorController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ColorController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport css from '../utils/css';\nimport saveDialogueContents from './saveDialogue.html';\nimport ControllerFactory from '../controllers/ControllerFactory';\nimport Controller from '../controllers/Controller';\nimport BooleanController from '../controllers/BooleanController';\nimport FunctionController from '../controllers/FunctionController';\nimport NumberControllerBox from '../controllers/NumberControllerBox';\nimport NumberControllerSlider from '../controllers/NumberControllerSlider';\nimport ColorController from '../controllers/ColorController';\nimport requestAnimationFrame from '../utils/requestAnimationFrame';\nimport CenteredDiv from '../dom/CenteredDiv';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nimport styleSheet from './style.scss'; // CSS to embed in build\n\ncss.inject(styleSheet);\n\n/** @ignore Outer-most className for GUI's */\nconst CSS_NAMESPACE = 'dg';\n\nconst HIDE_KEY_CODE = 72;\n\n/** @ignore The only value shared between the JS and SCSS. Use caution. */\nconst CLOSE_BUTTON_HEIGHT = 20;\n\nconst DEFAULT_DEFAULT_PRESET_NAME = 'Default';\n\nconst SUPPORTS_LOCAL_STORAGE = (function() {\n try {\n return 'localStorage' in window && window.localStorage !== null;\n } catch (e) {\n return false;\n }\n}());\n\nlet SAVE_DIALOGUE;\n\n/** @ignore Have we yet to create an autoPlace GUI? */\nlet autoPlaceVirgin = true;\n\n/** @ignore Fixed position div that auto place GUI's go inside */\nlet autoPlaceContainer;\n\n/** @ignore Are we hiding the GUI's ? */\nlet hide = false;\n\n/** @private GUI's which should be hidden */\nconst hideableGuis = [];\n\n/**\n * @class A lightweight controller library for JavaScript. It allows you to easily\n * manipulate variables and fire functions on the fly.\n *\n * @typicalname gui\n *\n * @example\n * // Creating a GUI with options.\n * var gui = new dat.GUI({name: 'My GUI'});\n *\n * @example\n * // Creating a GUI and a subfolder.\n * var gui = new dat.GUI();\n * var folder1 = gui.addFolder('Flow Field');\n *\n * @param {Object} [params]\n * @param {String} [params.name] The name of this GUI.\n * @param {Object} [params.load] JSON object representing the saved state of\n * this GUI.\n * @param {Boolean} [params.auto=true]\n * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.\n * @param {Boolean} [params.closed] If true, starts closed\n * @param {Boolean} [params.closeOnTop] If true, close/open button shows on top of the GUI\n */\nconst GUI = function(pars) {\n const _this = this;\n\n let params = pars || {};\n\n /**\n * Outermost DOM Element\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n this.__ul = document.createElement('ul');\n this.domElement.appendChild(this.__ul);\n\n dom.addClass(this.domElement, CSS_NAMESPACE);\n\n /**\n * Nested GUI's by name\n * @ignore\n */\n this.__folders = {};\n\n this.__controllers = [];\n\n /**\n * List of objects I'm remembering for save, only used in top level GUI\n * @ignore\n */\n this.__rememberedObjects = [];\n\n /**\n * Maps the index of remembered objects to a map of controllers, only used\n * in top level GUI.\n *\n * @private\n * @ignore\n *\n * @example\n * [\n * {\n * propertyName: Controller,\n * anotherPropertyName: Controller\n * },\n * {\n * propertyName: Controller\n * }\n * ]\n */\n this.__rememberedObjectIndecesToControllers = [];\n\n this.__listening = [];\n\n // Default parameters\n params = common.defaults(params, {\n closeOnTop: false,\n autoPlace: true,\n width: GUI.DEFAULT_WIDTH\n });\n\n params = common.defaults(params, {\n resizable: params.autoPlace,\n hideable: params.autoPlace\n });\n\n if (!common.isUndefined(params.load)) {\n // Explicit preset\n if (params.preset) {\n params.load.preset = params.preset;\n }\n } else {\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\n }\n\n if (common.isUndefined(params.parent) && params.hideable) {\n hideableGuis.push(this);\n }\n\n // Only root level GUI's are resizable.\n params.resizable = common.isUndefined(params.parent) && params.resizable;\n\n if (params.autoPlace && common.isUndefined(params.scrollable)) {\n params.scrollable = true;\n }\n// params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;\n\n // Not part of params because I don't want people passing this in via\n // constructor. Should be a 'remembered' value.\n let useLocalStorage =\n SUPPORTS_LOCAL_STORAGE &&\n localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\n\n let saveToLocalStorage;\n\n Object.defineProperties(this,\n /** @lends GUI.prototype */\n {\n /**\n * The parent GUI\n * @type dat.gui.GUI\n */\n parent: {\n get: function() {\n return params.parent;\n }\n },\n\n scrollable: {\n get: function() {\n return params.scrollable;\n }\n },\n\n /**\n * Handles GUI's element placement for you\n * @type Boolean\n */\n autoPlace: {\n get: function() {\n return params.autoPlace;\n }\n },\n\n /**\n * Handles GUI's position of open/close button\n * @type Boolean\n */\n closeOnTop: {\n get: function() {\n return params.closeOnTop;\n }\n },\n\n /**\n * The identifier for a set of saved values\n * @type String\n */\n preset: {\n get: function() {\n if (_this.parent) {\n return _this.getRoot().preset;\n }\n\n return params.load.preset;\n },\n\n set: function(v) {\n if (_this.parent) {\n _this.getRoot().preset = v;\n } else {\n params.load.preset = v;\n }\n setPresetSelectIndex(this);\n _this.revert();\n }\n },\n\n /**\n * The width of GUI element\n * @type Number\n */\n width: {\n get: function() {\n return params.width;\n },\n set: function(v) {\n params.width = v;\n setWidth(_this, v);\n }\n },\n\n /**\n * The name of GUI. Used for folders. i.e\n * a folder's name\n * @type String\n */\n name: {\n get: function() {\n return params.name;\n },\n set: function(v) {\n // TODO Check for collisions among sibling folders\n params.name = v;\n if (titleRowName) {\n titleRowName.innerHTML = params.name;\n }\n }\n },\n\n /**\n * Whether the GUI is collapsed or not\n * @type Boolean\n */\n closed: {\n get: function() {\n return params.closed;\n },\n set: function(v) {\n params.closed = v;\n if (params.closed) {\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\n } else {\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\n }\n // For browsers that aren't going to respect the CSS transition,\n // Lets just check our height against the window height right off\n // the bat.\n this.onResize();\n\n if (_this.__closeButton) {\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\n }\n }\n },\n\n /**\n * Contains all presets\n * @type Object\n */\n load: {\n get: function() {\n return params.load;\n }\n },\n\n /**\n * Determines whether or not to use localStorage as the means for\n * remembering\n * @type Boolean\n */\n useLocalStorage: {\n\n get: function() {\n return useLocalStorage;\n },\n set: function(bool) {\n if (SUPPORTS_LOCAL_STORAGE) {\n useLocalStorage = bool;\n if (bool) {\n dom.bind(window, 'unload', saveToLocalStorage);\n } else {\n dom.unbind(window, 'unload', saveToLocalStorage);\n }\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\n }\n }\n }\n });\n\n // Are we a root level GUI?\n if (common.isUndefined(params.parent)) {\n params.closed = false;\n\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\n dom.makeSelectable(this.domElement, false);\n\n // Are we supposed to be loading locally?\n if (SUPPORTS_LOCAL_STORAGE) {\n if (useLocalStorage) {\n _this.useLocalStorage = true;\n\n const savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\n\n if (savedGui) {\n params.load = JSON.parse(savedGui);\n }\n }\n }\n\n this.__closeButton = document.createElement('div');\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\n if (params.closeOnTop) {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP);\n this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]);\n } else {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM);\n this.domElement.appendChild(this.__closeButton);\n }\n\n dom.bind(this.__closeButton, 'click', function() {\n _this.closed = !_this.closed;\n });\n // Oh, you're a nested GUI!\n } else {\n if (params.closed === undefined) {\n params.closed = true;\n }\n\n const titleRowName = document.createTextNode(params.name);\n dom.addClass(titleRowName, 'controller-name');\n\n const titleRow = addRow(_this, titleRowName);\n\n const onClickTitle = function(e) {\n e.preventDefault();\n _this.closed = !_this.closed;\n return false;\n };\n\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\n\n dom.addClass(titleRow, 'title');\n dom.bind(titleRow, 'click', onClickTitle);\n\n if (!params.closed) {\n this.closed = false;\n }\n }\n\n if (params.autoPlace) {\n if (common.isUndefined(params.parent)) {\n if (autoPlaceVirgin) {\n autoPlaceContainer = document.createElement('div');\n dom.addClass(autoPlaceContainer, CSS_NAMESPACE);\n dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER);\n document.body.appendChild(autoPlaceContainer);\n autoPlaceVirgin = false;\n }\n\n // Put it in the dom for you.\n autoPlaceContainer.appendChild(this.domElement);\n\n // Apply the auto styles\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\n }\n\n\n // Make it not elastic.\n if (!this.parent) {\n setWidth(_this, params.width);\n }\n }\n\n this.__resizeHandler = function() {\n _this.onResizeDebounced();\n };\n\n dom.bind(window, 'resize', this.__resizeHandler);\n dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler);\n dom.bind(this.__ul, 'transitionend', this.__resizeHandler);\n dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler);\n this.onResize();\n\n if (params.resizable) {\n addResizeHandle(this);\n }\n\n saveToLocalStorage = function() {\n if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') {\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\n }\n };\n\n // expose this method publicly\n this.saveToLocalStorageIfPossible = saveToLocalStorage;\n\n function resetWidth() {\n const root = _this.getRoot();\n root.width += 1;\n common.defer(function() {\n root.width -= 1;\n });\n }\n\n if (!params.parent) {\n resetWidth();\n }\n};\n\nGUI.toggleHide = function() {\n hide = !hide;\n common.each(hideableGuis, function(gui) {\n gui.domElement.style.display = hide ? 'none' : '';\n });\n};\n\nGUI.CLASS_AUTO_PLACE = 'a';\nGUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\nGUI.CLASS_MAIN = 'main';\nGUI.CLASS_CONTROLLER_ROW = 'cr';\nGUI.CLASS_TOO_TALL = 'taller-than-window';\nGUI.CLASS_CLOSED = 'closed';\nGUI.CLASS_CLOSE_BUTTON = 'close-button';\nGUI.CLASS_CLOSE_TOP = 'close-top';\nGUI.CLASS_CLOSE_BOTTOM = 'close-bottom';\nGUI.CLASS_DRAG = 'drag';\n\nGUI.DEFAULT_WIDTH = 245;\nGUI.TEXT_CLOSED = 'Close Controls';\nGUI.TEXT_OPEN = 'Open Controls';\n\nGUI._keydownHandler = function(e) {\n if (document.activeElement.type !== 'text' &&\n (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) {\n GUI.toggleHide();\n }\n};\ndom.bind(window, 'keydown', GUI._keydownHandler, false);\n\ncommon.extend(\n GUI.prototype,\n\n /** @lends GUI.prototype */\n {\n\n /**\n * Adds a new {@link Controller} to the GUI. The type of controller created\n * is inferred from the initial value of object[property]. For\n * color properties, see {@link addColor}.\n *\n * @param {Object} object The object to be manipulated\n * @param {String} property The name of the property to be manipulated\n * @param {Number} [min] Minimum allowed value\n * @param {Number} [max] Maximum allowed value\n * @param {Number} [step] Increment by which to change value\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * // Add a string controller.\n * var person = {name: 'Sam'};\n * gui.add(person, 'name');\n *\n * @example\n * // Add a number controller slider.\n * var person = {age: 45};\n * gui.add(person, 'age', 0, 100);\n */\n add: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n factoryArgs: Array.prototype.slice.call(arguments, 2)\n }\n );\n },\n\n /**\n * Adds a new color controller to the GUI.\n *\n * @param object\n * @param property\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * var palette = {\n * color1: '#FF0000', // CSS string\n * color2: [ 0, 128, 255 ], // RGB array\n * color3: [ 0, 128, 255, 0.3 ], // RGB with alpha\n * color4: { h: 350, s: 0.9, v: 0.3 } // Hue, saturation, value\n * };\n * gui.addColor(palette, 'color1');\n * gui.addColor(palette, 'color2');\n * gui.addColor(palette, 'color3');\n * gui.addColor(palette, 'color4');\n */\n addColor: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n color: true\n }\n );\n },\n\n /**\n * Removes the given controller from the GUI.\n * @param {Controller} controller\n * @instance\n */\n remove: function(controller) {\n // TODO listening?\n this.__ul.removeChild(controller.__li);\n this.__controllers.splice(this.__controllers.indexOf(controller), 1);\n const _this = this;\n common.defer(function() {\n _this.onResize();\n });\n },\n\n /**\n * Removes the GUI from the document and unbinds all event listeners.\n * @instance\n */\n destroy: function() {\n if (this.autoPlace) {\n autoPlaceContainer.removeChild(this.domElement);\n }\n\n dom.unbind(window, 'keydown', GUI._keydownHandler, false);\n dom.unbind(window, 'resize', this.__resizeHandler);\n\n if (this.saveToLocalStorageIfPossible) {\n dom.unbind(window, 'unload', this.saveToLocalStorageIfPossible);\n }\n },\n\n /**\n * Creates a new subfolder GUI instance.\n * @param name\n * @returns {dat.gui.GUI} The new folder.\n * @throws {Error} if this GUI already has a folder by the specified\n * name\n * @instance\n */\n addFolder: function(name) {\n // We have to prevent collisions on names in order to have a key\n // by which to remember saved values\n if (this.__folders[name] !== undefined) {\n throw new Error('You already have a folder in this GUI by the' +\n ' name \"' + name + '\"');\n }\n\n const newGuiParams = { name: name, parent: this };\n\n // We need to pass down the autoPlace trait so that we can\n // attach event listeners to open/close folder actions to\n // ensure that a scrollbar appears if the window is too short.\n newGuiParams.autoPlace = this.autoPlace;\n\n // Do we have saved appearance data for this folder?\n if (this.load && // Anything loaded?\n this.load.folders && // Was my parent a dead-end?\n this.load.folders[name]) { // Did daddy remember me?\n // Start me closed if I was closed\n newGuiParams.closed = this.load.folders[name].closed;\n\n // Pass down the loaded data\n newGuiParams.load = this.load.folders[name];\n }\n\n const gui = new GUI(newGuiParams);\n this.__folders[name] = gui;\n\n const li = addRow(this, gui.domElement);\n dom.addClass(li, 'folder');\n return gui;\n },\n\n /**\n * Opens the GUI.\n */\n open: function() {\n this.closed = false;\n },\n\n /**\n * Closes the GUI.\n */\n close: function() {\n this.closed = true;\n },\n\n\n onResize: function() {\n // we debounce this function to prevent performance issues when rotating on tablet/mobile\n const root = this.getRoot();\n if (root.scrollable) {\n const top = dom.getOffset(root.__ul).top;\n let h = 0;\n\n common.each(root.__ul.childNodes, function(node) {\n if (!(root.autoPlace && node === root.__save_row)) {\n h += dom.getHeight(node);\n }\n });\n\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\n } else {\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = 'auto';\n }\n }\n\n if (root.__resize_handle) {\n common.defer(function() {\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\n });\n }\n\n if (root.__closeButton) {\n root.__closeButton.style.width = root.width + 'px';\n }\n },\n\n onResizeDebounced: common.debounce(function() { this.onResize(); }, 50),\n\n /**\n * Mark objects for saving. The order of these objects cannot change as\n * the GUI grows. When remembering new objects, append them to the end\n * of the list.\n *\n * @param {...Object} objects\n * @throws {Error} if not called on a top level GUI.\n * @instance\n * @ignore\n */\n remember: function() {\n if (common.isUndefined(SAVE_DIALOGUE)) {\n SAVE_DIALOGUE = new CenteredDiv();\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;\n }\n\n if (this.parent) {\n throw new Error('You can only call remember on a top level GUI.');\n }\n\n const _this = this;\n\n common.each(Array.prototype.slice.call(arguments), function(object) {\n if (_this.__rememberedObjects.length === 0) {\n addSaveMenu(_this);\n }\n if (_this.__rememberedObjects.indexOf(object) === -1) {\n _this.__rememberedObjects.push(object);\n }\n });\n\n if (this.autoPlace) {\n // Set save row width\n setWidth(this, this.width);\n }\n },\n\n /**\n * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.\n * @instance\n */\n getRoot: function() {\n let gui = this;\n while (gui.parent) {\n gui = gui.parent;\n }\n return gui;\n },\n\n /**\n * @returns {Object} a JSON object representing the current state of\n * this GUI as well as its remembered properties.\n * @instance\n */\n getSaveObject: function() {\n const toReturn = this.load;\n toReturn.closed = this.closed;\n\n // Am I remembering any values?\n if (this.__rememberedObjects.length > 0) {\n toReturn.preset = this.preset;\n\n if (!toReturn.remembered) {\n toReturn.remembered = {};\n }\n\n toReturn.remembered[this.preset] = getCurrentPreset(this);\n }\n\n toReturn.folders = {};\n common.each(this.__folders, function(element, key) {\n toReturn.folders[key] = element.getSaveObject();\n });\n\n return toReturn;\n },\n\n save: function() {\n if (!this.load.remembered) {\n this.load.remembered = {};\n }\n\n this.load.remembered[this.preset] = getCurrentPreset(this);\n markPresetModified(this, false);\n this.saveToLocalStorageIfPossible();\n },\n\n saveAs: function(presetName) {\n if (!this.load.remembered) {\n // Retain default values upon first save\n this.load.remembered = {};\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\n }\n\n this.load.remembered[presetName] = getCurrentPreset(this);\n this.preset = presetName;\n addPresetOption(this, presetName, true);\n this.saveToLocalStorageIfPossible();\n },\n\n revert: function(gui) {\n common.each(this.__controllers, function(controller) {\n // Make revert work on Default.\n if (!this.getRoot().load.remembered) {\n controller.setValue(controller.initialValue);\n } else {\n recallSavedValue(gui || this.getRoot(), controller);\n }\n\n // fire onFinishChange callback\n if (controller.__onFinishChange) {\n controller.__onFinishChange.call(controller, controller.getValue());\n }\n }, this);\n\n common.each(this.__folders, function(folder) {\n folder.revert(folder);\n });\n\n if (!gui) {\n markPresetModified(this.getRoot(), false);\n }\n },\n\n listen: function(controller) {\n const init = this.__listening.length === 0;\n this.__listening.push(controller);\n if (init) {\n updateDisplays(this.__listening);\n }\n },\n\n updateDisplay: function() {\n common.each(this.__controllers, function(controller) {\n controller.updateDisplay();\n });\n common.each(this.__folders, function(folder) {\n folder.updateDisplay();\n });\n }\n }\n);\n\n/**\n * Add a row to the end of the GUI or before another row.\n *\n * @param gui\n * @param [newDom] If specified, inserts the dom content in the new row\n * @param [liBefore] If specified, places the new row before another row\n *\n * @ignore\n */\nfunction addRow(gui, newDom, liBefore) {\n const li = document.createElement('li');\n if (newDom) {\n li.appendChild(newDom);\n }\n\n if (liBefore) {\n gui.__ul.insertBefore(li, liBefore);\n } else {\n gui.__ul.appendChild(li);\n }\n gui.onResize();\n return li;\n}\n\nfunction markPresetModified(gui, modified) {\n const opt = gui.__preset_select[gui.__preset_select.selectedIndex];\n\n // console.log('mark', modified, opt);\n if (modified) {\n opt.innerHTML = opt.value + '*';\n } else {\n opt.innerHTML = opt.value;\n }\n}\n\nfunction augmentController(gui, li, controller) {\n controller.__li = li;\n controller.__gui = gui;\n\n common.extend(controller, {\n options: function(options) {\n if (arguments.length > 1) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [common.toArray(arguments)]\n }\n );\n }\n\n if (common.isArray(options) || common.isObject(options)) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [options]\n }\n );\n }\n },\n\n name: function(v) {\n controller.__li.firstElementChild.firstElementChild.innerHTML = v;\n return controller;\n },\n\n listen: function() {\n controller.__gui.listen(controller);\n return controller;\n },\n\n remove: function() {\n controller.__gui.remove(controller);\n return controller;\n }\n });\n\n // All sliders should be accompanied by a box.\n if (controller instanceof NumberControllerSlider) {\n const box = new NumberControllerBox(controller.object, controller.property,\n { min: controller.__min, max: controller.__max, step: controller.__step });\n\n common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step'], function(method) {\n const pc = controller[method];\n const pb = box[method];\n controller[method] = box[method] = function() {\n const args = Array.prototype.slice.call(arguments);\n pb.apply(box, args);\n return pc.apply(controller, args);\n };\n });\n\n dom.addClass(li, 'has-slider');\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\n } else if (controller instanceof NumberControllerBox) {\n const r = function(returned) {\n // Have we defined both boundaries?\n if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {\n // Well, then lets just replace this with a slider.\n\n // lets remember if the old controller had a specific name or was listening\n const oldName = controller.__li.firstElementChild.firstElementChild.innerHTML;\n const wasListening = controller.__gui.__listening.indexOf(controller) > -1;\n\n controller.remove();\n const newController = add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [controller.__min, controller.__max, controller.__step]\n });\n\n newController.name(oldName);\n if (wasListening) newController.listen();\n\n return newController;\n }\n\n return returned;\n };\n\n controller.min = common.compose(r, controller.min);\n controller.max = common.compose(r, controller.max);\n } else if (controller instanceof BooleanController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__checkbox, 'click');\n });\n\n dom.bind(controller.__checkbox, 'click', function(e) {\n e.stopPropagation(); // Prevents double-toggle\n });\n } else if (controller instanceof FunctionController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__button, 'click');\n });\n\n dom.bind(li, 'mouseover', function() {\n dom.addClass(controller.__button, 'hover');\n });\n\n dom.bind(li, 'mouseout', function() {\n dom.removeClass(controller.__button, 'hover');\n });\n } else if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n controller.updateDisplay = common.compose(function(val) {\n li.style.borderLeftColor = controller.__color.toString();\n return val;\n }, controller.updateDisplay);\n\n controller.updateDisplay();\n }\n\n controller.setValue = common.compose(function(val) {\n if (gui.getRoot().__preset_select && controller.isModified()) {\n markPresetModified(gui.getRoot(), true);\n }\n\n return val;\n }, controller.setValue);\n}\n\nfunction recallSavedValue(gui, controller) {\n // Find the topmost GUI, that's where remembered objects live.\n const root = gui.getRoot();\n\n // Does the object we're controlling match anything we've been told to\n // remember?\n const matchedIndex = root.__rememberedObjects.indexOf(controller.object);\n\n // Why yes, it does!\n if (matchedIndex !== -1) {\n // Let me fetch a map of controllers for thcommon.isObject.\n let controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex];\n\n // Ohp, I believe this is the first controller we've created for this\n // object. Lets make the map fresh.\n if (controllerMap === undefined) {\n controllerMap = {};\n root.__rememberedObjectIndecesToControllers[matchedIndex] =\n controllerMap;\n }\n\n // Keep track of this controller\n controllerMap[controller.property] = controller;\n\n // Okay, now have we saved any values for this controller?\n if (root.load && root.load.remembered) {\n const presetMap = root.load.remembered;\n\n // Which preset are we trying to load?\n let preset;\n\n if (presetMap[gui.preset]) {\n preset = presetMap[gui.preset];\n } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) {\n // Uhh, you can have the default instead?\n preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME];\n } else {\n // Nada.\n return;\n }\n\n // Did the loaded object remember thcommon.isObject? && Did we remember this particular property?\n if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) {\n // We did remember something for this guy ...\n const value = preset[matchedIndex][controller.property];\n\n // And that's what it is.\n controller.initialValue = value;\n controller.setValue(value);\n }\n }\n }\n}\n\nfunction add(gui, object, property, params) {\n if (object[property] === undefined) {\n throw new Error(`Object \"${object}\" has no property \"${property}\"`);\n }\n\n let controller;\n\n if (params.color) {\n controller = new ColorController(object, property);\n } else {\n const factoryArgs = [object, property].concat(params.factoryArgs);\n controller = ControllerFactory.apply(gui, factoryArgs);\n }\n\n if (params.before instanceof Controller) {\n params.before = params.before.__li;\n }\n\n recallSavedValue(gui, controller);\n\n dom.addClass(controller.domElement, 'c');\n\n const name = document.createElement('span');\n dom.addClass(name, 'property-name');\n name.innerHTML = controller.property;\n\n const container = document.createElement('div');\n container.appendChild(name);\n container.appendChild(controller.domElement);\n\n const li = addRow(gui, container, params.before);\n\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\n if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n } else {\n dom.addClass(li, typeof controller.getValue());\n }\n\n augmentController(gui, li, controller);\n\n gui.__controllers.push(controller);\n\n return controller;\n}\n\nfunction getLocalStorageHash(gui, key) {\n // TODO how does this deal with multiple GUI's?\n return document.location.href + '.' + key;\n}\n\nfunction addPresetOption(gui, name, setSelected) {\n const opt = document.createElement('option');\n opt.innerHTML = name;\n opt.value = name;\n gui.__preset_select.appendChild(opt);\n if (setSelected) {\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\n }\n}\n\nfunction showHideExplain(gui, explain) {\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\n}\n\nfunction addSaveMenu(gui) {\n const div = gui.__save_row = document.createElement('li');\n\n dom.addClass(gui.domElement, 'has-save');\n\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\n\n dom.addClass(div, 'save-row');\n\n const gears = document.createElement('span');\n gears.innerHTML = ' ';\n dom.addClass(gears, 'button gears');\n\n // TODO replace with FunctionController\n const button = document.createElement('span');\n button.innerHTML = 'Save';\n dom.addClass(button, 'button');\n dom.addClass(button, 'save');\n\n const button2 = document.createElement('span');\n button2.innerHTML = 'New';\n dom.addClass(button2, 'button');\n dom.addClass(button2, 'save-as');\n\n const button3 = document.createElement('span');\n button3.innerHTML = 'Revert';\n dom.addClass(button3, 'button');\n dom.addClass(button3, 'revert');\n\n const select = gui.__preset_select = document.createElement('select');\n\n if (gui.load && gui.load.remembered) {\n common.each(gui.load.remembered, function(value, key) {\n addPresetOption(gui, key, key === gui.preset);\n });\n } else {\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\n }\n\n dom.bind(select, 'change', function() {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\n }\n\n gui.preset = this.value;\n });\n\n div.appendChild(select);\n div.appendChild(gears);\n div.appendChild(button);\n div.appendChild(button2);\n div.appendChild(button3);\n\n if (SUPPORTS_LOCAL_STORAGE) {\n const explain = document.getElementById('dg-local-explain');\n const localStorageCheckBox = document.getElementById('dg-local-storage');\n const saveLocally = document.getElementById('dg-save-locally');\n\n saveLocally.style.display = 'block';\n\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\n localStorageCheckBox.setAttribute('checked', 'checked');\n }\n\n showHideExplain(gui, explain);\n\n // TODO: Use a boolean controller, fool!\n dom.bind(localStorageCheckBox, 'change', function() {\n gui.useLocalStorage = !gui.useLocalStorage;\n showHideExplain(gui, explain);\n });\n }\n\n const newConstructorTextArea = document.getElementById('dg-new-constructor');\n\n dom.bind(newConstructorTextArea, 'keydown', function(e) {\n if (e.metaKey && (e.which === 67 || e.keyCode === 67)) {\n SAVE_DIALOGUE.hide();\n }\n });\n\n dom.bind(gears, 'click', function() {\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\n SAVE_DIALOGUE.show();\n newConstructorTextArea.focus();\n newConstructorTextArea.select();\n });\n\n dom.bind(button, 'click', function() {\n gui.save();\n });\n\n dom.bind(button2, 'click', function() {\n const presetName = prompt('Enter a new preset name.');\n if (presetName) {\n gui.saveAs(presetName);\n }\n });\n\n dom.bind(button3, 'click', function() {\n gui.revert();\n });\n\n // div.appendChild(button2);\n}\n\nfunction addResizeHandle(gui) {\n let pmouseX;\n\n gui.__resize_handle = document.createElement('div');\n\n common.extend(gui.__resize_handle.style, {\n\n width: '6px',\n marginLeft: '-3px',\n height: '200px',\n cursor: 'ew-resize',\n position: 'absolute'\n // border: '1px solid blue'\n\n });\n\n function drag(e) {\n e.preventDefault();\n\n gui.width += pmouseX - e.clientX;\n gui.onResize();\n pmouseX = e.clientX;\n\n return false;\n }\n\n function dragStop() {\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.unbind(window, 'mousemove', drag);\n dom.unbind(window, 'mouseup', dragStop);\n }\n\n function dragStart(e) {\n e.preventDefault();\n\n pmouseX = e.clientX;\n\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.bind(window, 'mousemove', drag);\n dom.bind(window, 'mouseup', dragStop);\n\n return false;\n }\n\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\n\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\n}\n\nfunction setWidth(gui, w) {\n gui.domElement.style.width = w + 'px';\n // Auto placed save-rows are position fixed, so we have to\n // set the width manually if we want it to bleed to the edge\n if (gui.__save_row && gui.autoPlace) {\n gui.__save_row.style.width = w + 'px';\n }\n if (gui.__closeButton) {\n gui.__closeButton.style.width = w + 'px';\n }\n}\n\nfunction getCurrentPreset(gui, useInitialValues) {\n const toReturn = {};\n\n // For each object I'm remembering\n common.each(gui.__rememberedObjects, function(val, index) {\n const savedValues = {};\n\n // The controllers I've made for thcommon.isObject by property\n const controllerMap =\n gui.__rememberedObjectIndecesToControllers[index];\n\n // Remember each value for each property\n common.each(controllerMap, function(controller, property) {\n savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue();\n });\n\n // Save the values for thcommon.isObject\n toReturn[index] = savedValues;\n });\n\n return toReturn;\n}\n\nfunction setPresetSelectIndex(gui) {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n if (gui.__preset_select[index].value === gui.preset) {\n gui.__preset_select.selectedIndex = index;\n }\n }\n}\n\nfunction updateDisplays(controllerArray) {\n if (controllerArray.length !== 0) {\n requestAnimationFrame.call(window, function() {\n updateDisplays(controllerArray);\n });\n }\n\n common.each(controllerArray, function(c) {\n c.updateDisplay();\n });\n}\n\nexport default GUI;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/gui/GUI.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nmodule.exports = {\n load: function(url, indoc) {\n const doc = indoc || document;\n const link = doc.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n doc.getElementsByTagName('head')[0].appendChild(link);\n },\n\n inject: function(css, indoc) {\n const doc = indoc || document;\n const injected = document.createElement('style');\n injected.type = 'text/css';\n injected.innerHTML = css;\n const head = doc.getElementsByTagName('head')[0];\n try {\n head.appendChild(injected);\n } catch (e) { // Unable to inject CSS, probably because of a Content Security Policy\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/css.js","module.exports = \"
    \\n\\n Here's the new load parameter for your GUI's constructor:\\n\\n \\n\\n
    \\n\\n Automatically save\\n values to localStorage on exit.\\n\\n
    The values saved to localStorage will\\n override those passed to dat.GUI's constructor. This makes it\\n easier to work incrementally, but localStorage is fragile,\\n and your friends may not see the same values you do.\\n\\n
    \\n\\n
    \\n\\n
    \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/saveDialogue.html\n// module id = 19\n// module chunks = 0","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport OptionController from './OptionController';\nimport NumberControllerBox from './NumberControllerBox';\nimport NumberControllerSlider from './NumberControllerSlider';\nimport StringController from './StringController';\nimport FunctionController from './FunctionController';\nimport BooleanController from './BooleanController';\nimport common from '../utils/common';\n\nconst ControllerFactory = function(object, property) {\n const initialValue = object[property];\n\n // Providing options?\n if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {\n return new OptionController(object, property, arguments[2]);\n }\n\n // Providing a map?\n if (common.isNumber(initialValue)) {\n // Has min and max? (slider)\n if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {\n // has step?\n if (common.isNumber(arguments[4])) {\n return new NumberControllerSlider(object, property,\n arguments[2], arguments[3], arguments[4]);\n }\n\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\n }\n\n // number box\n if (common.isNumber(arguments[4])) { // has step\n return new NumberControllerBox(object, property,\n { min: arguments[2], max: arguments[3], step: arguments[4] });\n }\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\n }\n\n if (common.isString(initialValue)) {\n return new StringController(object, property);\n }\n\n if (common.isFunction(initialValue)) {\n return new FunctionController(object, property, '');\n }\n\n if (common.isBoolean(initialValue)) {\n return new BooleanController(object, property);\n }\n\n return null;\n};\n\nexport default ControllerFactory;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ControllerFactory.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction requestAnimationFrame(callback) {\n setTimeout(callback, 1000 / 60);\n}\n\nexport default window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n requestAnimationFrame;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/requestAnimationFrame.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nclass CenteredDiv {\n constructor() {\n this.backgroundElement = document.createElement('div');\n common.extend(this.backgroundElement.style, {\n backgroundColor: 'rgba(0,0,0,0.8)',\n top: 0,\n left: 0,\n display: 'none',\n zIndex: '1000',\n opacity: 0,\n WebkitTransition: 'opacity 0.2s linear',\n transition: 'opacity 0.2s linear'\n });\n\n dom.makeFullscreen(this.backgroundElement);\n this.backgroundElement.style.position = 'fixed';\n\n this.domElement = document.createElement('div');\n common.extend(this.domElement.style, {\n position: 'fixed',\n display: 'none',\n zIndex: '1001',\n opacity: 0,\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',\n transition: 'transform 0.2s ease-out, opacity 0.2s linear'\n });\n\n\n document.body.appendChild(this.backgroundElement);\n document.body.appendChild(this.domElement);\n\n const _this = this;\n dom.bind(this.backgroundElement, 'click', function() {\n _this.hide();\n });\n }\n\n show() {\n const _this = this;\n\n this.backgroundElement.style.display = 'block';\n\n this.domElement.style.display = 'block';\n this.domElement.style.opacity = 0;\n// this.domElement.style.top = '52%';\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n this.layout();\n\n common.defer(function() {\n _this.backgroundElement.style.opacity = 1;\n _this.domElement.style.opacity = 1;\n _this.domElement.style.webkitTransform = 'scale(1)';\n });\n }\n\n /**\n * Hide centered div\n */\n hide() {\n const _this = this;\n\n const hide = function() {\n _this.domElement.style.display = 'none';\n _this.backgroundElement.style.display = 'none';\n\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\n dom.unbind(_this.domElement, 'transitionend', hide);\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\n };\n\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\n dom.bind(this.domElement, 'transitionend', hide);\n dom.bind(this.domElement, 'oTransitionEnd', hide);\n\n this.backgroundElement.style.opacity = 0;\n// this.domElement.style.top = '48%';\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n }\n\n layout() {\n this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px';\n this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px';\n }\n}\n\nexport default CenteredDiv;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/CenteredDiv.js","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".dg {\\n /** Clear list styles */\\n /* Auto-place container */\\n /* Auto-placed GUI's */\\n /* Line items that don't contain folders. */\\n /** Folder names */\\n /** Hides closed items */\\n /** Controller row */\\n /** Name-half (left) */\\n /** Controller-half (right) */\\n /** Controller placement */\\n /** Shorter number boxes when slider is present. */\\n /** Ensure the entire boolean and function row shows a hand */\\n /** allow overflow for color selector */ }\\n .dg ul {\\n list-style: none;\\n margin: 0;\\n padding: 0;\\n width: 100%;\\n clear: both; }\\n .dg.ac {\\n position: fixed;\\n top: 0;\\n left: 0;\\n right: 0;\\n height: 0;\\n z-index: 0; }\\n .dg:not(.ac) .main {\\n /** Exclude mains in ac so that we don't hide close button */\\n overflow: hidden; }\\n .dg.main {\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear; }\\n .dg.main.taller-than-window {\\n overflow-y: auto; }\\n .dg.main.taller-than-window .close-button {\\n opacity: 1;\\n /* TODO, these are style notes */\\n margin-top: -1px;\\n border-top: 1px solid #2c2c2c; }\\n .dg.main ul.closed .close-button {\\n opacity: 1 !important; }\\n .dg.main:hover .close-button,\\n .dg.main .close-button.drag {\\n opacity: 1; }\\n .dg.main .close-button {\\n /*opacity: 0;*/\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear;\\n border: 0;\\n line-height: 19px;\\n height: 20px;\\n /* TODO, these are style notes */\\n cursor: pointer;\\n text-align: center;\\n background-color: #000; }\\n .dg.main .close-button.close-top {\\n position: relative; }\\n .dg.main .close-button.close-bottom {\\n position: absolute; }\\n .dg.main .close-button:hover {\\n background-color: #111; }\\n .dg.a {\\n float: right;\\n margin-right: 15px;\\n overflow-y: visible; }\\n .dg.a.has-save > ul.close-top {\\n margin-top: 0; }\\n .dg.a.has-save > ul.close-bottom {\\n margin-top: 27px; }\\n .dg.a.has-save > ul.closed {\\n margin-top: 0; }\\n .dg.a .save-row {\\n top: 0;\\n z-index: 1002; }\\n .dg.a .save-row.close-top {\\n position: relative; }\\n .dg.a .save-row.close-bottom {\\n position: fixed; }\\n .dg li {\\n -webkit-transition: height 0.1s ease-out;\\n -o-transition: height 0.1s ease-out;\\n -moz-transition: height 0.1s ease-out;\\n transition: height 0.1s ease-out;\\n -webkit-transition: overflow 0.1s linear;\\n -o-transition: overflow 0.1s linear;\\n -moz-transition: overflow 0.1s linear;\\n transition: overflow 0.1s linear; }\\n .dg li:not(.folder) {\\n cursor: auto;\\n height: 27px;\\n line-height: 27px;\\n padding: 0 4px 0 5px; }\\n .dg li.folder {\\n padding: 0;\\n border-left: 4px solid transparent; }\\n .dg li.title {\\n cursor: pointer;\\n margin-left: -4px; }\\n .dg .closed li:not(.title),\\n .dg .closed ul li,\\n .dg .closed ul li > * {\\n height: 0;\\n overflow: hidden;\\n border: 0; }\\n .dg .cr {\\n clear: both;\\n padding-left: 3px;\\n height: 27px;\\n overflow: hidden; }\\n .dg .property-name {\\n cursor: default;\\n float: left;\\n clear: left;\\n width: 40%;\\n overflow: hidden;\\n text-overflow: ellipsis; }\\n .dg .c {\\n float: left;\\n width: 60%;\\n position: relative; }\\n .dg .c input[type=text] {\\n border: 0;\\n margin-top: 4px;\\n padding: 3px;\\n width: 100%;\\n float: right; }\\n .dg .has-slider input[type=text] {\\n width: 30%;\\n /*display: none;*/\\n margin-left: 0; }\\n .dg .slider {\\n float: left;\\n width: 66%;\\n margin-left: -5px;\\n margin-right: 0;\\n height: 19px;\\n margin-top: 4px; }\\n .dg .slider-fg {\\n height: 100%; }\\n .dg .c input[type=checkbox] {\\n margin-top: 7px; }\\n .dg .c select {\\n margin-top: 5px; }\\n .dg .cr.function,\\n .dg .cr.function .property-name,\\n .dg .cr.function *,\\n .dg .cr.boolean,\\n .dg .cr.boolean * {\\n cursor: pointer; }\\n .dg .cr.color {\\n overflow: visible; }\\n .dg .selector {\\n display: none;\\n position: absolute;\\n margin-left: -9px;\\n margin-top: 23px;\\n z-index: 10; }\\n .dg .c:hover .selector,\\n .dg .selector.drag {\\n display: block; }\\n .dg li.save-row {\\n padding: 0; }\\n .dg li.save-row .button {\\n display: inline-block;\\n padding: 0px 6px; }\\n .dg.dialogue {\\n background-color: #222;\\n width: 460px;\\n padding: 15px;\\n font-size: 13px;\\n line-height: 15px; }\\n\\n/* TODO Separate style and structure */\\n#dg-new-constructor {\\n padding: 10px;\\n color: #222;\\n font-family: Monaco, monospace;\\n font-size: 10px;\\n border: 0;\\n resize: none;\\n box-shadow: inset 1px 1px 1px #888;\\n word-wrap: break-word;\\n margin: 12px 0;\\n display: block;\\n width: 440px;\\n overflow-y: scroll;\\n height: 100px;\\n position: relative; }\\n\\n#dg-local-explain {\\n display: none;\\n font-size: 11px;\\n line-height: 17px;\\n border-radius: 3px;\\n background-color: #333;\\n padding: 8px;\\n margin-top: 10px; }\\n #dg-local-explain code {\\n font-size: 10px; }\\n\\n#dat-gui-save-locally {\\n display: none; }\\n\\n/** Main type */\\n.dg {\\n color: #eee;\\n font: 11px 'Lucida Grande', sans-serif;\\n text-shadow: 0 -1px 0 #111;\\n /** Auto place */\\n /* Controller row,
  • */\\n /** Controllers */ }\\n .dg.main {\\n /** Scrollbar */ }\\n .dg.main::-webkit-scrollbar {\\n width: 5px;\\n background: #1a1a1a; }\\n .dg.main::-webkit-scrollbar-corner {\\n height: 0;\\n display: none; }\\n .dg.main::-webkit-scrollbar-thumb {\\n border-radius: 5px;\\n background: #676767; }\\n .dg li:not(.folder) {\\n background: #1a1a1a;\\n border-bottom: 1px solid #2c2c2c; }\\n .dg li.save-row {\\n line-height: 25px;\\n background: #dad5cb;\\n border: 0; }\\n .dg li.save-row select {\\n margin-left: 5px;\\n width: 108px; }\\n .dg li.save-row .button {\\n margin-left: 5px;\\n margin-top: 1px;\\n border-radius: 2px;\\n font-size: 9px;\\n line-height: 7px;\\n padding: 4px 4px 5px 4px;\\n background: #c5bdad;\\n color: #fff;\\n text-shadow: 0 1px 0 #b0a58f;\\n box-shadow: 0 -1px 0 #b0a58f;\\n cursor: pointer; }\\n .dg li.save-row .button.gears {\\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\\n height: 7px;\\n width: 8px; }\\n .dg li.save-row .button:hover {\\n background-color: #bab19e;\\n box-shadow: 0 -1px 0 #b0a58f; }\\n .dg li.folder {\\n border-bottom: 0; }\\n .dg li.title {\\n padding-left: 16px;\\n background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\\n cursor: pointer;\\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\\n .dg .closed li.title {\\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\\n .dg .cr.boolean {\\n border-left: 3px solid #806787; }\\n .dg .cr.color {\\n border-left: 3px solid; }\\n .dg .cr.function {\\n border-left: 3px solid #e61d5f; }\\n .dg .cr.number {\\n border-left: 3px solid #2FA1D6; }\\n .dg .cr.number input[type=text] {\\n color: #2FA1D6; }\\n .dg .cr.string {\\n border-left: 3px solid #1ed36f; }\\n .dg .cr.string input[type=text] {\\n color: #1ed36f; }\\n .dg .cr.function:hover, .dg .cr.boolean:hover {\\n background: #111; }\\n .dg .c input[type=text] {\\n background: #303030;\\n outline: none; }\\n .dg .c input[type=text]:hover {\\n background: #3c3c3c; }\\n .dg .c input[type=text]:focus {\\n background: #494949;\\n color: #fff; }\\n .dg .c .slider {\\n background: #303030;\\n cursor: ew-resize; }\\n .dg .c .slider-fg {\\n background: #2FA1D6;\\n max-width: 100%; }\\n .dg .c .slider:hover {\\n background: #3c3c3c; }\\n .dg .c .slider:hover .slider-fg {\\n background: #44abda; }\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/style.scss\n// module id = 23\n// module chunks = 0","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/css-loader/lib/css-base.js\n// module id = 24\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/build/dat.gui.min.js b/build/dat.gui.min.js index b148734c..df50e897 100644 --- a/build/dat.gui.min.js +++ b/build/dat.gui.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dat=t():e.dat=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(1),r=o(i);t.default=r.default,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(2),r=o(i),a=n(6),l=o(a),s=n(3),u=o(s),d=n(7),c=o(d),f=n(8),_=o(f),p=n(10),h=o(p),m=n(11),b=o(m),g=n(12),v=o(g),y=n(13),w=o(y),x=n(14),E=o(x),C=n(15),A=o(C),S=n(16),k=o(S),O=n(9),T=o(O),R=n(17),L=o(R);t.default={color:{Color:r.default,math:l.default,interpret:u.default},controllers:{Controller:c.default,BooleanController:_.default,OptionController:h.default,StringController:b.default,NumberController:v.default,NumberControllerBox:w.default,NumberControllerSlider:E.default,FunctionController:A.default,ColorController:k.default},dom:{dom:T.default},gui:{GUI:L.default},GUI:L.default},e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(h.recalculateRGB(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(h.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function a(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(h.recalculateHSV(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(h.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}t.__esModule=!0;var l=n(3),s=o(l),u=n(6),d=o(u),c=n(4),f=o(c),_=n(5),p=o(_),h=function(){function e(){if(i(this,e),this.__state=s.default.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return e.prototype.toString=function(){return(0,f.default)(this)},e.prototype.toHexString=function(){return(0,f.default)(this,!0)},e.prototype.toOriginal=function(){return this.__state.conversion.write(this)},e}();h.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=d.default.component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");p.default.extend(e.__state,d.default.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},h.recalculateHSV=function(e){var t=d.default.rgb_to_hsv(e.r,e.g,e.b);p.default.extend(e.__state,{s:t.s,v:t.v}),p.default.isNaN(t.h)?p.default.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},h.COMPONENTS=["r","g","b","h","s","v","hex","a"],r(h.prototype,"r",2),r(h.prototype,"g",1),r(h.prototype,"b",0),a(h.prototype,"h"),a(h.prototype,"s"),a(h.prototype,"v"),Object.defineProperty(h.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(h.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=d.default.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),t.default=h,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(4),r=o(i),a=n(5),l=o(a),s=[{litmus:l.default.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:r.default},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:r.default},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:r.default},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:r.default}}},{litmus:l.default.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:l.default.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:l.default.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(l.default.isNumber(e.r)&&l.default.isNumber(e.g)&&l.default.isNumber(e.b)&&l.default.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(l.default.isNumber(e.r)&&l.default.isNumber(e.g)&&l.default.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(l.default.isNumber(e.h)&&l.default.isNumber(e.s)&&l.default.isNumber(e.v)&&l.default.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(l.default.isNumber(e.h)&&l.default.isNumber(e.s)&&l.default.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],u=void 0,d=void 0,c=function(){d=!1;var e=arguments.length>1?l.default.toArray(arguments):arguments[0];return l.default.each(s,function(t){if(t.litmus(e))return l.default.each(t.conversions,function(t,n){if(u=t.read(e),d===!1&&u!==!1)return d=u,u.conversionName=n,u.conversion=t,l.default.BREAK}),l.default.BREAK}),d};t.default=c,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){var n=e.__state.conversionName.toString(),o=Math.round(e.r),i=Math.round(e.g),r=Math.round(e.b),a=e.a,l=Math.round(e.h),s=e.s.toFixed(1),u=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var d=e.hex.toString(16);d.length<6;)d="0"+d;return"#"+d}return"CSS_RGB"===n?"rgb("+o+","+i+","+r+")":"CSS_RGBA"===n?"rgba("+o+","+i+","+r+","+a+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+o+","+i+","+r+"]":"RGBA_ARRAY"===n?"["+o+","+i+","+r+","+a+"]":"RGB_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+"}":"RGBA_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+",a:"+a+"}":"HSV_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+"}":"HSVA_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+",a:"+a+"}":"unknown format"},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;var n=Array.prototype.forEach,o=Array.prototype.slice,i={BREAK:{},extend:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(t[n])||(e[n]=t[n])}.bind(this))},this),e},defaults:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(e[n])&&(e[n]=t[n])}.bind(this))},this),e},compose:function(){var e=o.call(arguments);return function(){for(var t=o.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,o){if(e)if(n&&e.forEach&&e.forEach===n)e.forEach(t,o);else if(e.length===e.length+0){var i=void 0,r=void 0;for(i=0,r=e.length;i>8*t&255},hex_with_component:function(e,t,o){return o<<(n=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}t.__esModule=!0;var s=n(7),u=o(s),d=n(5),c=o(d),f=function(e){function t(n,o,a){i(this,t);var s=r(this,e.call(this,n,o)),u=a||{};return s.__min=u.min,s.__max=u.max,s.__step=u.step,c.default.isUndefined(s.__step)?0===s.initialValue?s.__impliedStep=1:s.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(s.initialValue))/Math.LN10))/10:s.__impliedStep=s.__step,s.__precision=l(s.__impliedStep),s}return a(t,e),t.prototype.setValue=function(t){var n=t;return void 0!==this.__min&&nthis.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!==0&&(n=Math.round(n/this.__step)*this.__step),e.prototype.setValue.call(this,n)},t.prototype.min=function(e){return this.__min=e,this},t.prototype.max=function(e){return this.__max=e,this},t.prototype.step=function(e){return this.__step=e,this.__impliedStep=e,this.__precision=l(e),this},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=n(5),_=o(f),p=function(e){function t(n,o,a){function l(){var e=parseFloat(m.__input.value);_.default.isNaN(e)||m.setValue(e)}function s(){m.__onFinishChange&&m.__onFinishChange.call(m,m.getValue())}function u(){s()}function d(e){var t=b-e.clientY;m.setValue(m.getValue()+t*m.__impliedStep),b=e.clientY}function f(){c.default.unbind(window,"mousemove",d),c.default.unbind(window,"mouseup",f),s()}function p(e){c.default.bind(window,"mousemove",d),c.default.bind(window,"mouseup",f),b=e.clientY}i(this,t);var h=r(this,e.call(this,n,o,a));h.__truncationSuspended=!1;var m=h,b=void 0;return h.__input=document.createElement("input"),h.__input.setAttribute("type","text"),c.default.bind(h.__input,"change",l),c.default.bind(h.__input,"blur",u),c.default.bind(h.__input,"mousedown",p),c.default.bind(h.__input,"keydown",function(e){13===e.keyCode&&(m.__truncationSuspended=!0,this.blur(),m.__truncationSuspended=!1,s())}),h.updateDisplay(),h.domElement.appendChild(h.__input),h}return a(t,e),t.prototype.updateDisplay=function(){return this.__input.value=this.__truncationSuspended?this.getValue():l(this.getValue(),this.__precision),e.prototype.updateDisplay.call(this)},t}(u.default);t.default=p,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o,i){return o+(i-o)*((e-t)/(n-t))}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=function(e){function t(n,o,a,s,u){function d(e){document.activeElement.blur(),c.default.bind(window,"mousemove",f),c.default.bind(window,"mouseup",_),f(e)}function f(e){e.preventDefault();var t=h.__background.getBoundingClientRect();return h.setValue(l(e.clientX,t.left,t.right,h.__min,h.__max)),!1}function _(){c.default.unbind(window,"mousemove",f),c.default.unbind(window,"mouseup",_),h.__onFinishChange&&h.__onFinishChange.call(h,h.getValue())}i(this,t);var p=r(this,e.call(this,n,o,{min:a,max:s,step:u})),h=p;return p.__background=document.createElement("div"),p.__foreground=document.createElement("div"),c.default.bind(p.__background,"mousedown",d),c.default.addClass(p.__background,"slider"),c.default.addClass(p.__foreground,"slider-fg"),p.updateDisplay(),p.__background.appendChild(p.__foreground),p.domElement.appendChild(p.__background),p}return a(t,e),t.prototype.updateDisplay=function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",e.prototype.updateDisplay.call(this)},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var l=n(7),s=o(l),u=n(9),d=o(u),c=function(e){function t(n,o,a){i(this,t);var l=r(this,e.call(this,n,o)),s=l;return l.__button=document.createElement("div"),l.__button.innerHTML=void 0===a?"Fire":a,d.default.bind(l.__button,"click",function(e){return e.preventDefault(),s.fire(),!1}),d.default.addClass(l.__button,"button"),l.domElement.appendChild(l.__button),l}return a(t,e),t.prototype.fire=function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())},t}(s.default);t.default=c,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o){e.style.background="",g.default.each(y,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+o+" 100%); "})}function s(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}t.__esModule=!0;var u=n(7),d=o(u),c=n(9),f=o(c),_=n(2),p=o(_),h=n(3),m=o(h),b=n(5),g=o(b),v=function(e){function t(n,o){function a(e){h(e),f.default.bind(window,"mousemove",h),f.default.bind(window,"mouseup",u)}function u(){f.default.unbind(window,"mousemove",h),f.default.unbind(window,"mouseup",u),_()}function d(){var e=(0,m.default)(this.value);e!==!1?(y.__color.__state=e,y.setValue(y.__color.toOriginal())):this.value=y.__color.toString()}function c(){f.default.unbind(window,"mousemove",b),f.default.unbind(window,"mouseup",c),_()}function _(){y.__onFinishChange&&y.__onFinishChange.call(y,y.__color.toOriginal())}function h(e){e.preventDefault();var t=y.__saturation_field.getBoundingClientRect(),n=(e.clientX-t.left)/(t.right-t.left),o=1-(e.clientY-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),n>1?n=1:n<0&&(n=0),y.__color.v=o,y.__color.s=n,y.setValue(y.__color.toOriginal()),!1}function b(e){e.preventDefault();var t=y.__hue_field.getBoundingClientRect(),n=1-(e.clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),y.__color.h=360*n,y.setValue(y.__color.toOriginal()),!1}i(this,t);var v=r(this,e.call(this,n,o));v.__color=new p.default(v.getValue()),v.__temp=new p.default(0);var y=v;v.domElement=document.createElement("div"),f.default.makeSelectable(v.domElement,!1),v.__selector=document.createElement("div"),v.__selector.className="selector",v.__saturation_field=document.createElement("div"),v.__saturation_field.className="saturation-field",v.__field_knob=document.createElement("div"),v.__field_knob.className="field-knob",v.__field_knob_border="2px solid ",v.__hue_knob=document.createElement("div"),v.__hue_knob.className="hue-knob",v.__hue_field=document.createElement("div"),v.__hue_field.className="hue-field",v.__input=document.createElement("input"),v.__input.type="text",v.__input_textShadow="0 1px 1px ",f.default.bind(v.__input,"keydown",function(e){13===e.keyCode&&d.call(this)}),f.default.bind(v.__input,"blur",d),f.default.bind(v.__selector,"mousedown",function(){f.default.addClass(this,"drag").bind(window,"mouseup",function(){f.default.removeClass(y.__selector,"drag")})});var w=document.createElement("div");return g.default.extend(v.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),g.default.extend(v.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:v.__field_knob_border+(v.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),g.default.extend(v.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),g.default.extend(v.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),g.default.extend(w.style,{width:"100%",height:"100%",background:"none"}),l(w,"top","rgba(0,0,0,0)","#000"),g.default.extend(v.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),s(v.__hue_field),g.default.extend(v.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:v.__input_textShadow+"rgba(0,0,0,0.7)"}),f.default.bind(v.__saturation_field,"mousedown",a),f.default.bind(v.__field_knob,"mousedown",a),f.default.bind(v.__hue_field,"mousedown",function(e){b(e),f.default.bind(window,"mousemove",b),f.default.bind(window,"mouseup",c)}),v.__saturation_field.appendChild(w),v.__selector.appendChild(v.__field_knob),v.__selector.appendChild(v.__saturation_field),v.__selector.appendChild(v.__hue_field),v.__hue_field.appendChild(v.__hue_knob),v.domElement.appendChild(v.__input),v.domElement.appendChild(v.__selector),v.updateDisplay(),v}return a(t,e),t.prototype.updateDisplay=function(){var e=(0,m.default)(this.getValue());if(e!==!1){var t=!1;g.default.each(p.default.COMPONENTS,function(n){if(!g.default.isUndefined(e[n])&&!g.default.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&g.default.extend(this.__color.__state,e)}g.default.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,o=255-n;g.default.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,l(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),g.default.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})},t}(d.default),y=["-moz-","-o-","-webkit-","-ms-",""];t.default=v,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,n):e.__ul.appendChild(o),e.onResize(),o}function r(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];t?n.innerHTML=n.value+"*":n.innerHTML=n.value}function a(e,t,n){if(n.__li=t,n.__gui=e,U.default.extend(n,{options:function(t){if(arguments.length>1){var o=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:o,factoryArgs:[U.default.toArray(arguments)]})}if(U.default.isArray(t)||U.default.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof N.default){var o=new B.default(n.object,n.property,{ -min:n.__min,max:n.__max,step:n.__step});U.default.each(["updateDisplay","onChange","onFinishChange","step"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(o,e),t.apply(n,e)}}),z.default.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof B.default){var i=function(t){if(U.default.isNumber(n.__min)&&U.default.isNumber(n.__max)){var o=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var r=s(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return r.name(o),i&&r.listen(),r}return t};n.min=U.default.compose(i,n.min),n.max=U.default.compose(i,n.max)}else n instanceof O.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__checkbox,"click")}),z.default.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof R.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__button,"click")}),z.default.bind(t,"mouseover",function(){z.default.addClass(n.__button,"hover")}),z.default.bind(t,"mouseout",function(){z.default.removeClass(n.__button,"hover")})):n instanceof j.default&&(z.default.addClass(t,"color"),n.updateDisplay=U.default.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=U.default.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&r(e.getRoot(),!0),t},n.setValue)}function l(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(o!==-1){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r=n.load.remembered,a=void 0;if(r[e.preset])a=r[e.preset];else{if(!r[Q])return;a=r[Q]}if(a[o]&&void 0!==a[o][t.property]){var l=a[o][t.property];t.initialValue=l,t.setValue(l)}}}}function s(e,t,n,o){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var r=void 0;if(o.color)r=new j.default(t,n);else{var s=[t,n].concat(o.factoryArgs);r=C.default.apply(e,s)}o.before instanceof S.default&&(o.before=o.before.__li),l(e,r),z.default.addClass(r.domElement,"c");var u=document.createElement("span");z.default.addClass(u,"property-name"),u.innerHTML=r.property;var d=document.createElement("div");d.appendChild(u),d.appendChild(r.domElement);var c=i(e,d,o.before);return z.default.addClass(c,oe.CLASS_CONTROLLER_ROW),r instanceof j.default?z.default.addClass(c,"color"):z.default.addClass(c,g(r.getValue())),a(e,c,r),e.__controllers.push(r),r}function u(e,t){return document.location.href+"."+t}function d(e,t,n){var o=document.createElement("option");o.innerHTML=t,o.value=t,e.__preset_select.appendChild(o),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function c(e,t){t.style.display=e.useLocalStorage?"block":"none"}function f(e){var t=e.__save_row=document.createElement("li");z.default.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),z.default.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",z.default.addClass(n,"button gears");var o=document.createElement("span");o.innerHTML="Save",z.default.addClass(o,"button"),z.default.addClass(o,"save");var i=document.createElement("span");i.innerHTML="New",z.default.addClass(i,"button"),z.default.addClass(i,"save-as");var r=document.createElement("span");r.innerHTML="Revert",z.default.addClass(r,"button"),z.default.addClass(r,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?U.default.each(e.load.remembered,function(t,n){d(e,n,n===e.preset)}):d(e,Q,!1),z.default.bind(a,"change",function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=h(this)),e.folders={},U.default.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=h(this),r(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[Q]=h(this,!0)),this.load.remembered[e]=h(this),this.preset=e,d(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){U.default.each(this.__controllers,function(t){this.getRoot().load.remembered?l(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),U.default.each(this.__folders,function(e){e.revert(e)}),e||r(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&b(this.__listening)},updateDisplay:function(){U.default.each(this.__controllers,function(e){e.updateDisplay()}),U.default.each(this.__folders,function(e){e.updateDisplay()})}}),t.default=oe,e.exports=t.default},function(e,t){"use strict";e.exports={load:function(e,t){var n=t||document,o=n.createElement("link");o.type="text/css",o.rel="stylesheet",o.href=e,n.getElementsByTagName("head")[0].appendChild(o)},inject:function(e,t){var n=t||document,o=document.createElement("style");o.type="text/css",o.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(o)}catch(e){}}}},function(e,t){e.exports="
    Here's the new load parameter for your GUI's constructor:
    Automatically save values to localStorage on exit.
    The values saved to localStorage will override those passed to dat.GUI's constructor. This makes it easier to work incrementally, but localStorage is fragile, and your friends may not see the same values you do.
    "},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(10),r=o(i),a=n(13),l=o(a),s=n(14),u=o(s),d=n(11),c=o(d),f=n(15),_=o(f),p=n(8),h=o(p),m=n(5),b=o(m),g=function(e,t){var n=e[t];return b.default.isArray(arguments[2])||b.default.isObject(arguments[2])?new r.default(e,t,arguments[2]):b.default.isNumber(n)?b.default.isNumber(arguments[2])&&b.default.isNumber(arguments[3])?b.default.isNumber(arguments[4])?new u.default(e,t,arguments[2],arguments[3],arguments[4]):new u.default(e,t,arguments[2],arguments[3]):b.default.isNumber(arguments[4])?new l.default(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new l.default(e,t,{min:arguments[2],max:arguments[3]}):b.default.isString(n)?new c.default(e,t):b.default.isFunction(n)?new _.default(e,t,""):b.default.isBoolean(n)?new h.default(e,t):null};t.default=g,e.exports=t.default},function(e,t){"use strict";function n(e){setTimeout(e,1e3/60)}t.__esModule=!0,t.default=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||n,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=n(9),a=o(r),l=n(5),s=o(l),u=function(){function e(){i(this,e),this.backgroundElement=document.createElement("div"),s.default.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),a.default.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),s.default.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;a.default.bind(this.backgroundElement,"click",function(){t.hide()})}return e.prototype.show=function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),s.default.defer(function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"})},e.prototype.hide=function e(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",a.default.unbind(t.domElement,"webkitTransitionEnd",e),a.default.unbind(t.domElement,"transitionend",e),a.default.unbind(t.domElement,"oTransitionEnd",e)};a.default.bind(this.domElement,"webkitTransitionEnd",e),a.default.bind(this.domElement,"transitionend",e),a.default.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"},e.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-a.default.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-a.default.getHeight(this.domElement)/2+"px"},e}();t.default=u,e.exports=t.default},function(e,t,n){t=e.exports=n(24)(),t.push([e.id,".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{transition:height .1s ease-out;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px Lucida Grande,sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t1?l.default.toArray(arguments):arguments[0];return l.default.each(s,function(t){if(t.litmus(e))return l.default.each(t.conversions,function(t,n){if(u=t.read(e),d===!1&&u!==!1)return d=u,u.conversionName=n,u.conversion=t,l.default.BREAK}),l.default.BREAK}),d};t.default=c,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){var n=e.__state.conversionName.toString(),o=Math.round(e.r),i=Math.round(e.g),r=Math.round(e.b),a=e.a,l=Math.round(e.h),s=e.s.toFixed(1),u=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var d=e.hex.toString(16);d.length<6;)d="0"+d;return"#"+d}return"CSS_RGB"===n?"rgb("+o+","+i+","+r+")":"CSS_RGBA"===n?"rgba("+o+","+i+","+r+","+a+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+o+","+i+","+r+"]":"RGBA_ARRAY"===n?"["+o+","+i+","+r+","+a+"]":"RGB_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+"}":"RGBA_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+",a:"+a+"}":"HSV_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+"}":"HSVA_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+",a:"+a+"}":"unknown format"},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;var n=Array.prototype.forEach,o=Array.prototype.slice,i={BREAK:{},extend:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(t[n])||(e[n]=t[n])}.bind(this))},this),e},defaults:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(e[n])&&(e[n]=t[n])}.bind(this))},this),e},compose:function(){var e=o.call(arguments);return function(){for(var t=o.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,o){if(e)if(n&&e.forEach&&e.forEach===n)e.forEach(t,o);else if(e.length===e.length+0){var i=void 0,r=void 0;for(i=0,r=e.length;i>8*t&255},hex_with_component:function(e,t,o){return o<<(n=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}t.__esModule=!0;var s=n(7),u=o(s),d=n(5),c=o(d),f=function(e){function t(n,o,a){i(this,t);var s=r(this,e.call(this,n,o)),u=a||{};return s.__min=u.min,s.__max=u.max,s.__step=u.step,c.default.isUndefined(s.__step)?0===s.initialValue?s.__impliedStep=1:s.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(s.initialValue))/Math.LN10))/10:s.__impliedStep=s.__step,s.__precision=l(s.__impliedStep),s}return a(t,e),t.prototype.setValue=function(t){var n=t;return void 0!==this.__min&&nthis.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!==0&&(n=Math.round(n/this.__step)*this.__step),e.prototype.setValue.call(this,n)},t.prototype.min=function(e){return this.__min=e,this},t.prototype.max=function(e){return this.__max=e,this},t.prototype.step=function(e){return this.__step=e,this.__impliedStep=e,this.__precision=l(e),this},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=n(5),_=o(f),p=function(e){function t(n,o,a){function l(e){var t=b.getValue(),n=(e.deltaY||-e.wheelDelta||e.detail)>>10||1;e.preventDefault(),n<0?t+=b.__impliedStep:t-=b.__impliedStep,b.setValue(t)}function s(){var e=parseFloat(b.__input.value);_.default.isNaN(e)||b.setValue(e)}function u(){b.__onFinishChange&&b.__onFinishChange.call(b,b.getValue())}function d(){u()}function f(e){var t=g-e.clientY;b.setValue(b.getValue()+t*b.__impliedStep),g=e.clientY}function p(){c.default.unbind(window,"mousemove",f),c.default.unbind(window,"mouseup",p),u()}function h(e){c.default.bind(window,"mousemove",f),c.default.bind(window,"mouseup",p),g=e.clientY}i(this,t);var m=r(this,e.call(this,n,o,a));m.__truncationSuspended=!1;var b=m,g=void 0,v=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";return m.__input=document.createElement("input"),m.__input.setAttribute("type","text"),c.default.bind(m.__input,"change",s),c.default.bind(m.__input,"blur",d),c.default.bind(m.__input,"mousedown",h),c.default.bind(m.__input,v,l),c.default.bind(m.__input,"keydown",function(e){13===e.keyCode&&(b.__truncationSuspended=!0,this.blur(),b.__truncationSuspended=!1,u())}),m.updateDisplay(),m.domElement.appendChild(m.__input),m}return a(t,e),t.prototype.updateDisplay=function(){return this.__input.value=this.__truncationSuspended?this.getValue():l(this.getValue(),this.__precision),e.prototype.updateDisplay.call(this)},t}(u.default);t.default=p,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o,i){return o+(i-o)*((e-t)/(n-t))}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=function(e){function t(n,o,a,s,u){function d(e){var t=m.getValue(),n=(e.deltaY||-e.wheelDelta||e.detail)>>10||1;e.preventDefault(),document.activeElement.blur(),n<0?t+=m.__impliedStep:t-=m.__impliedStep,m.setValue(t)}function f(e){document.activeElement.blur(),window.console.log("delete this line"),c.default.bind(window,"mousemove",_),c.default.bind(window,"mouseup",p),_(e)}function _(e){e.preventDefault();var t=m.__background.getBoundingClientRect();return m.setValue(l(e.clientX,t.left,t.right,m.__min,m.__max)),!1}function p(){c.default.unbind(window,"mousemove",_),c.default.unbind(window,"mouseup",p),m.__onFinishChange&&m.__onFinishChange.call(m,m.getValue())}i(this,t);var h=r(this,e.call(this,n,o,{min:a,max:s,step:u})),m=h;h.__background=document.createElement("div"),h.__foreground=document.createElement("div"),c.default.bind(h.__background,"mousedown",f);var b=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";return c.default.bind(h.__background,b,d),c.default.addClass(h.__background,"slider"),c.default.addClass(h.__foreground,"slider-fg"),h.updateDisplay(),h.__background.appendChild(h.__foreground),h.domElement.appendChild(h.__background),h}return a(t,e),t.prototype.updateDisplay=function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",e.prototype.updateDisplay.call(this)},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var l=n(7),s=o(l),u=n(9),d=o(u),c=function(e){function t(n,o,a){i(this,t);var l=r(this,e.call(this,n,o)),s=l;return l.__button=document.createElement("div"),l.__button.innerHTML=void 0===a?"Fire":a,d.default.bind(l.__button,"click",function(e){return e.preventDefault(),s.fire(),!1}),d.default.addClass(l.__button,"button"),l.domElement.appendChild(l.__button),l}return a(t,e),t.prototype.fire=function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())},t}(s.default);t.default=c,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o){e.style.background="",g.default.each(y,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+o+" 100%); "})}function s(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}t.__esModule=!0;var u=n(7),d=o(u),c=n(9),f=o(c),_=n(2),p=o(_),h=n(3),m=o(h),b=n(5),g=o(b),v=function(e){function t(n,o){function a(e){h(e),f.default.bind(window,"mousemove",h),f.default.bind(window,"mouseup",u)}function u(){f.default.unbind(window,"mousemove",h),f.default.unbind(window,"mouseup",u),_()}function d(){var e=(0,m.default)(this.value);e!==!1?(y.__color.__state=e,y.setValue(y.__color.toOriginal())):this.value=y.__color.toString()}function c(){f.default.unbind(window,"mousemove",b),f.default.unbind(window,"mouseup",c),_()}function _(){y.__onFinishChange&&y.__onFinishChange.call(y,y.__color.toOriginal())}function h(e){e.preventDefault();var t=y.__saturation_field.getBoundingClientRect(),n=(e.clientX-t.left)/(t.right-t.left),o=1-(e.clientY-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),n>1?n=1:n<0&&(n=0),y.__color.v=o,y.__color.s=n,y.setValue(y.__color.toOriginal()),!1}function b(e){e.preventDefault();var t=y.__hue_field.getBoundingClientRect(),n=1-(e.clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),y.__color.h=360*n,y.setValue(y.__color.toOriginal()),!1}i(this,t);var v=r(this,e.call(this,n,o));v.__color=new p.default(v.getValue()),v.__temp=new p.default(0);var y=v;v.domElement=document.createElement("div"),f.default.makeSelectable(v.domElement,!1),v.__selector=document.createElement("div"),v.__selector.className="selector",v.__saturation_field=document.createElement("div"),v.__saturation_field.className="saturation-field",v.__field_knob=document.createElement("div"),v.__field_knob.className="field-knob",v.__field_knob_border="2px solid ",v.__hue_knob=document.createElement("div"),v.__hue_knob.className="hue-knob",v.__hue_field=document.createElement("div"),v.__hue_field.className="hue-field",v.__input=document.createElement("input"),v.__input.type="text",v.__input_textShadow="0 1px 1px ",f.default.bind(v.__input,"keydown",function(e){13===e.keyCode&&d.call(this)}),f.default.bind(v.__input,"blur",d),f.default.bind(v.__selector,"mousedown",function(){f.default.addClass(this,"drag").bind(window,"mouseup",function(){f.default.removeClass(y.__selector,"drag")})});var w=document.createElement("div");return g.default.extend(v.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),g.default.extend(v.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:v.__field_knob_border+(v.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),g.default.extend(v.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),g.default.extend(v.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),g.default.extend(w.style,{width:"100%",height:"100%",background:"none"}),l(w,"top","rgba(0,0,0,0)","#000"),g.default.extend(v.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),s(v.__hue_field),g.default.extend(v.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:v.__input_textShadow+"rgba(0,0,0,0.7)"}),f.default.bind(v.__saturation_field,"mousedown",a),f.default.bind(v.__field_knob,"mousedown",a),f.default.bind(v.__hue_field,"mousedown",function(e){b(e),f.default.bind(window,"mousemove",b),f.default.bind(window,"mouseup",c)}),v.__saturation_field.appendChild(w),v.__selector.appendChild(v.__field_knob),v.__selector.appendChild(v.__saturation_field),v.__selector.appendChild(v.__hue_field),v.__hue_field.appendChild(v.__hue_knob),v.domElement.appendChild(v.__input),v.domElement.appendChild(v.__selector),v.updateDisplay(),v}return a(t,e),t.prototype.updateDisplay=function(){var e=(0,m.default)(this.getValue());if(e!==!1){var t=!1;g.default.each(p.default.COMPONENTS,function(n){if(!g.default.isUndefined(e[n])&&!g.default.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&g.default.extend(this.__color.__state,e)}g.default.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,o=255-n;g.default.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,l(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),g.default.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})},t}(d.default),y=["-moz-","-o-","-webkit-","-ms-",""];t.default=v,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,n):e.__ul.appendChild(o),e.onResize(),o}function r(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];t?n.innerHTML=n.value+"*":n.innerHTML=n.value}function a(e,t,n){if(n.__li=t,n.__gui=e, +U.default.extend(n,{options:function(t){if(arguments.length>1){var o=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:o,factoryArgs:[U.default.toArray(arguments)]})}if(U.default.isArray(t)||U.default.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof N.default){var o=new M.default(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});U.default.each(["updateDisplay","onChange","onFinishChange","step"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(o,e),t.apply(n,e)}}),z.default.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof M.default){var i=function(t){if(U.default.isNumber(n.__min)&&U.default.isNumber(n.__max)){var o=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var r=s(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return r.name(o),i&&r.listen(),r}return t};n.min=U.default.compose(i,n.min),n.max=U.default.compose(i,n.max)}else n instanceof O.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__checkbox,"click")}),z.default.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof R.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__button,"click")}),z.default.bind(t,"mouseover",function(){z.default.addClass(n.__button,"hover")}),z.default.bind(t,"mouseout",function(){z.default.removeClass(n.__button,"hover")})):n instanceof j.default&&(z.default.addClass(t,"color"),n.updateDisplay=U.default.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=U.default.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&r(e.getRoot(),!0),t},n.setValue)}function l(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(o!==-1){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r=n.load.remembered,a=void 0;if(r[e.preset])a=r[e.preset];else{if(!r[Q])return;a=r[Q]}if(a[o]&&void 0!==a[o][t.property]){var l=a[o][t.property];t.initialValue=l,t.setValue(l)}}}}function s(e,t,n,o){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var r=void 0;if(o.color)r=new j.default(t,n);else{var s=[t,n].concat(o.factoryArgs);r=C.default.apply(e,s)}o.before instanceof S.default&&(o.before=o.before.__li),l(e,r),z.default.addClass(r.domElement,"c");var u=document.createElement("span");z.default.addClass(u,"property-name"),u.innerHTML=r.property;var d=document.createElement("div");d.appendChild(u),d.appendChild(r.domElement);var c=i(e,d,o.before);return z.default.addClass(c,oe.CLASS_CONTROLLER_ROW),r instanceof j.default?z.default.addClass(c,"color"):z.default.addClass(c,g(r.getValue())),a(e,c,r),e.__controllers.push(r),r}function u(e,t){return document.location.href+"."+t}function d(e,t,n){var o=document.createElement("option");o.innerHTML=t,o.value=t,e.__preset_select.appendChild(o),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function c(e,t){t.style.display=e.useLocalStorage?"block":"none"}function f(e){var t=e.__save_row=document.createElement("li");z.default.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),z.default.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",z.default.addClass(n,"button gears");var o=document.createElement("span");o.innerHTML="Save",z.default.addClass(o,"button"),z.default.addClass(o,"save");var i=document.createElement("span");i.innerHTML="New",z.default.addClass(i,"button"),z.default.addClass(i,"save-as");var r=document.createElement("span");r.innerHTML="Revert",z.default.addClass(r,"button"),z.default.addClass(r,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?U.default.each(e.load.remembered,function(t,n){d(e,n,n===e.preset)}):d(e,Q,!1),z.default.bind(a,"change",function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=h(this)),e.folders={},U.default.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=h(this),r(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[Q]=h(this,!0)),this.load.remembered[e]=h(this),this.preset=e,d(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){U.default.each(this.__controllers,function(t){this.getRoot().load.remembered?l(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),U.default.each(this.__folders,function(e){e.revert(e)}),e||r(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&b(this.__listening)},updateDisplay:function(){U.default.each(this.__controllers,function(e){e.updateDisplay()}),U.default.each(this.__folders,function(e){e.updateDisplay()})}}),t.default=oe,e.exports=t.default},function(e,t){"use strict";e.exports={load:function(e,t){var n=t||document,o=n.createElement("link");o.type="text/css",o.rel="stylesheet",o.href=e,n.getElementsByTagName("head")[0].appendChild(o)},inject:function(e,t){var n=t||document,o=document.createElement("style");o.type="text/css",o.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(o)}catch(e){}}}},function(e,t){e.exports="
    Here's the new load parameter for your GUI's constructor:
    Automatically save values to localStorage on exit.
    The values saved to localStorage will override those passed to dat.GUI's constructor. This makes it easier to work incrementally, but localStorage is fragile, and your friends may not see the same values you do.
    "},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(10),r=o(i),a=n(13),l=o(a),s=n(14),u=o(s),d=n(11),c=o(d),f=n(15),_=o(f),p=n(8),h=o(p),m=n(5),b=o(m),g=function(e,t){var n=e[t];return b.default.isArray(arguments[2])||b.default.isObject(arguments[2])?new r.default(e,t,arguments[2]):b.default.isNumber(n)?b.default.isNumber(arguments[2])&&b.default.isNumber(arguments[3])?b.default.isNumber(arguments[4])?new u.default(e,t,arguments[2],arguments[3],arguments[4]):new u.default(e,t,arguments[2],arguments[3]):b.default.isNumber(arguments[4])?new l.default(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new l.default(e,t,{min:arguments[2],max:arguments[3]}):b.default.isString(n)?new c.default(e,t):b.default.isFunction(n)?new _.default(e,t,""):b.default.isBoolean(n)?new h.default(e,t):null};t.default=g,e.exports=t.default},function(e,t){"use strict";function n(e){setTimeout(e,1e3/60)}t.__esModule=!0,t.default=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||n,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=n(9),a=o(r),l=n(5),s=o(l),u=function(){function e(){i(this,e),this.backgroundElement=document.createElement("div"),s.default.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),a.default.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),s.default.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;a.default.bind(this.backgroundElement,"click",function(){t.hide()})}return e.prototype.show=function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),s.default.defer(function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"})},e.prototype.hide=function e(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",a.default.unbind(t.domElement,"webkitTransitionEnd",e),a.default.unbind(t.domElement,"transitionend",e),a.default.unbind(t.domElement,"oTransitionEnd",e)};a.default.bind(this.domElement,"webkitTransitionEnd",e),a.default.bind(this.domElement,"transitionend",e),a.default.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"},e.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-a.default.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-a.default.getHeight(this.domElement)/2+"px"},e}();t.default=u,e.exports=t.default},function(e,t,n){t=e.exports=n(24)(),t.push([e.id,".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{transition:height .1s ease-out;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px Lucida Grande,sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t> 10) || 1; + e.preventDefault(); + + if (delta < 0) value += _this.__impliedStep; + else value -= _this.__impliedStep; + _this.setValue(value); + } + function onChange() { const attempted = parseFloat(_this.__input.value); if (!common.isNaN(attempted)) { @@ -92,6 +104,7 @@ class NumberControllerBox extends NumberController { dom.bind(this.__input, 'change', onChange); dom.bind(this.__input, 'blur', onBlur); dom.bind(this.__input, 'mousedown', onMouseDown); + dom.bind(this.__input, mousewheelevt, onMouseWheel); dom.bind(this.__input, 'keydown', function(e) { // When pressing enter, you can be as precise as you want. if (e.keyCode === 13) { diff --git a/src/dat/controllers/NumberControllerSlider.js b/src/dat/controllers/NumberControllerSlider.js index c711ad38..dd7cf6ef 100644 --- a/src/dat/controllers/NumberControllerSlider.js +++ b/src/dat/controllers/NumberControllerSlider.js @@ -45,12 +45,28 @@ class NumberControllerSlider extends NumberController { dom.bind(this.__background, 'mousedown', onMouseDown); + const mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? 'DOMMouseScroll' : 'mousewheel'; + dom.bind(this.__background, mousewheelevt, onMouseWheel); + dom.addClass(this.__background, 'slider'); dom.addClass(this.__foreground, 'slider-fg'); + function onMouseWheel(e) { + let value = _this.getValue(); + const delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1; + e.preventDefault(); + document.activeElement.blur(); + + if (delta < 0) value += _this.__impliedStep; + else value -= _this.__impliedStep; + _this.setValue(value); + } + function onMouseDown(e) { document.activeElement.blur(); + window.console.log('delete this line'); + dom.bind(window, 'mousemove', onMouseDrag); dom.bind(window, 'mouseup', onMouseUp); From 8fd3acd2cc2dba6511659b7523e11ca4f30aa77f Mon Sep 17 00:00:00 2001 From: argon24 Date: Tue, 19 Dec 2017 10:05:30 +0100 Subject: [PATCH 2/3] Deleted a comment --- build/dat.gui.js | 2 -- build/dat.gui.js.map | 2 +- build/dat.gui.min.js | 4 ++-- src/dat/controllers/NumberControllerSlider.js | 2 -- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/build/dat.gui.js b/build/dat.gui.js index a912149e..19388ce8 100644 --- a/build/dat.gui.js +++ b/build/dat.gui.js @@ -2157,8 +2157,6 @@ return /******/ (function(modules) { // webpackBootstrap function onMouseDown(e) { document.activeElement.blur(); - window.console.log('delete this line'); - _dom2.default.bind(window, 'mousemove', onMouseDrag); _dom2.default.bind(window, 'mouseup', onMouseUp); diff --git a/build/dat.gui.js.map b/build/dat.gui.js.map index d47bbce7..d346d2c1 100644 --- a/build/dat.gui.js.map +++ b/build/dat.gui.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 1923ebf5946db2a04a7d","webpack:///../index.js","webpack:///./dat/index.js","webpack:///./dat/color/Color.js","webpack:///./dat/color/interpret.js","webpack:///./dat/color/toString.js","webpack:///./dat/utils/common.js","webpack:///./dat/color/math.js","webpack:///./dat/controllers/Controller.js","webpack:///./dat/controllers/BooleanController.js","webpack:///./dat/dom/dom.js","webpack:///./dat/controllers/OptionController.js","webpack:///./dat/controllers/StringController.js","webpack:///./dat/controllers/NumberController.js","webpack:///./dat/controllers/NumberControllerBox.js","webpack:///./dat/controllers/NumberControllerSlider.js","webpack:///./dat/controllers/FunctionController.js","webpack:///./dat/controllers/ColorController.js","webpack:///./dat/gui/GUI.js","webpack:///./dat/utils/css.js","webpack:///./dat/gui/saveDialogue.html","webpack:///./dat/controllers/ControllerFactory.js","webpack:///./dat/utils/requestAnimationFrame.js","webpack:///./dat/dom/CenteredDiv.js","webpack:///./dat/gui/style.scss","webpack:///../~/css-loader/lib/css-base.js"],"names":["color","Color","math","interpret","controllers","Controller","BooleanController","OptionController","StringController","NumberController","NumberControllerBox","NumberControllerSlider","FunctionController","ColorController","dom","gui","GUI","__state","apply","arguments","Error","a","toString","toHexString","toOriginal","conversion","write","defineRGBComponent","target","component","componentHexIndex","Object","defineProperty","get","space","recalculateRGB","set","v","defineHSVComponent","recalculateHSV","component_from_hex","hex","extend","hsv_to_rgb","h","s","result","rgb_to_hsv","r","g","b","isNaN","isUndefined","COMPONENTS","prototype","rgb_to_hex","INTERPRETATIONS","litmus","isString","conversions","THREE_CHAR_HEX","read","original","test","match","parseInt","SIX_CHAR_HEX","CSS_RGB","parseFloat","CSS_RGBA","isNumber","HEX","conversionName","isArray","RGB_ARRAY","length","RGBA_ARRAY","isObject","RGBA_OBJ","RGB_OBJ","HSVA_OBJ","HSV_OBJ","toReturn","toArray","each","family","BREAK","forceCSSHex","colorFormat","Math","round","toFixed","str","ARR_EACH","Array","forEach","ARR_SLICE","slice","Common","call","obj","keys","key","bind","defaults","compose","toCall","args","i","itr","scope","l","defer","fnc","setTimeout","debounce","func","threshold","callImmediately","timeout","delayed","callNow","clearTimeout","undefined","isNull","constructor","isBoolean","isFunction","tmpComponent","ColorMath","hi","floor","f","p","q","t","c","min","max","delta","NaN","hex_with_component","componentIndex","value","object","property","initialValue","domElement","document","createElement","__onChange","__onFinishChange","onChange","onFinishChange","setValue","newValue","updateDisplay","getValue","isModified","_this","__prev","__checkbox","setAttribute","appendChild","checked","EVENT_MAP","HTMLEvents","MouseEvents","KeyboardEvents","EVENT_MAP_INV","k","e","CSS_VALUE_PIXELS","cssValueToPixels","val","makeSelectable","elem","selectable","style","onselectstart","MozUserSelect","KhtmlUserSelect","unselectable","makeFullscreen","hor","vert","vertical","horizontal","position","left","right","top","bottom","fakeEvent","eventType","pars","aux","params","className","evt","createEvent","clientX","x","clientY","y","initMouseEvent","bubbles","cancelable","window","clickCount","init","initKeyboardEvent","initKeyEvent","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode","initEvent","dispatchEvent","event","newBool","bool","addEventListener","attachEvent","unbind","removeEventListener","detachEvent","addClass","classes","split","indexOf","push","join","replace","removeClass","removeAttribute","index","splice","hasClass","RegExp","getWidth","getComputedStyle","width","getHeight","height","getOffset","el","offset","offsetParent","offsetLeft","offsetTop","isActive","activeElement","type","href","opts","options","__select","map","element","opt","innerHTML","desiredValue","selectedIndex","__input","onBlur","blur","numDecimals","_x","_params","__min","__max","__step","step","__impliedStep","pow","log","abs","LN10","__precision","_v","minValue","maxValue","stepValue","roundToDecimal","decimals","tenTo","__truncationSuspended","prevY","mousewheelevt","navigator","userAgent","onMouseWheel","deltaY","wheelDelta","detail","preventDefault","attempted","onFinish","onMouseDrag","diff","onMouseUp","onMouseDown","i1","i2","o1","o2","__background","__foreground","console","bgRect","getBoundingClientRect","pct","text","__button","fire","__color","__temp","__selector","__saturation_field","__field_knob","__field_knob_border","__hue_knob","__hue_field","__input_textShadow","valueField","padding","backgroundColor","boxShadow","border","borderRadius","zIndex","borderRight","marginRight","display","cursor","background","linearGradient","hueGradient","outline","textAlign","fontWeight","textShadow","fieldDown","setH","fieldUpH","setSV","fieldUpSV","fieldRect","mismatch","flip","_flip","marginLeft","marginTop","vendors","vendor","cssText","inject","CSS_NAMESPACE","HIDE_KEY_CODE","CLOSE_BUTTON_HEIGHT","DEFAULT_DEFAULT_PRESET_NAME","SUPPORTS_LOCAL_STORAGE","localStorage","SAVE_DIALOGUE","autoPlaceVirgin","autoPlaceContainer","hide","hideableGuis","__ul","__folders","__controllers","__rememberedObjects","__rememberedObjectIndecesToControllers","__listening","closeOnTop","autoPlace","DEFAULT_WIDTH","resizable","hideable","load","preset","parent","scrollable","useLocalStorage","getItem","getLocalStorageHash","saveToLocalStorage","defineProperties","getRoot","setPresetSelectIndex","revert","setWidth","name","titleRowName","closed","CLASS_CLOSED","onResize","__closeButton","TEXT_OPEN","TEXT_CLOSED","setItem","CLASS_MAIN","savedGui","JSON","parse","CLASS_CLOSE_BUTTON","CLASS_CLOSE_TOP","insertBefore","childNodes","CLASS_CLOSE_BOTTOM","createTextNode","titleRow","addRow","onClickTitle","CLASS_AUTO_PLACE_CONTAINER","body","CLASS_AUTO_PLACE","__resizeHandler","onResizeDebounced","addResizeHandle","stringify","getSaveObject","saveToLocalStorageIfPossible","resetWidth","root","toggleHide","CLASS_CONTROLLER_ROW","CLASS_TOO_TALL","CLASS_DRAG","_keydownHandler","which","add","factoryArgs","addColor","remove","controller","removeChild","__li","destroy","addFolder","newGuiParams","folders","li","open","close","node","__save_row","innerHeight","__resize_handle","offsetHeight","remember","addSaveMenu","remembered","getCurrentPreset","save","markPresetModified","saveAs","presetName","addPresetOption","recallSavedValue","folder","listen","updateDisplays","newDom","liBefore","modified","__preset_select","augmentController","__gui","nextSibling","nextElementSibling","before","firstElementChild","box","method","pc","pb","returned","oldName","wasListening","newController","stopPropagation","borderLeftColor","matchedIndex","controllerMap","presetMap","concat","container","location","setSelected","showHideExplain","explain","div","firstChild","gears","button","button2","button3","select","getElementById","localStorageCheckBox","saveLocally","newConstructorTextArea","show","focus","prompt","pmouseX","drag","dragStop","dragStart","w","useInitialValues","savedValues","controllerArray","module","exports","url","indoc","doc","link","rel","getElementsByTagName","css","injected","head","ControllerFactory","requestAnimationFrame","callback","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","CenteredDiv","backgroundElement","opacity","WebkitTransition","transition","webkitTransform","layout","innerWidth"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;ACzBA;;;;;;oCAbA;;;;;;;;;;;;;;;;;;;;;;;ACaA;;;;AACA;;;;AACA;;;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AAEA;;;;AACA;;;;;;AA5BA;;;;;;;;;;;;;mBA8Be;AACbA,UAAO;AACLC,2BADK;AAELC,yBAFK;AAGLC;AAHK,IADM;;AAObC,gBAAa;AACXC,qCADW;AAEXC,mDAFW;AAGXC,iDAHW;AAIXC,iDAJW;AAKXC,iDALW;AAMXC,uDANW;AAOXC,6DAPW;AAQXC,qDARW;AASXC;AATW,IAPA;;AAmBbC,QAAK;AACHA;AADG,IAnBQ;;AAuBbC,QAAK;AACHC;AADG,IAvBQ;;AA2BbA;AA3Ba,E;;;;;;;;;;;ACjBf;;;;AACA;;;;AACA;;;;AACA;;;;;;2JAhBA;;;;;;;;;;;;;KAkBMf,K;AACJ,oBAAc;AAAA;;AACZ,UAAKgB,OAAL,GAAe,oBAAUC,KAAV,CAAgB,IAAhB,EAAsBC,SAAtB,CAAf;;AAEA,SAAI,KAAKF,OAAL,KAAiB,KAArB,EAA4B;AAC1B,aAAM,IAAIG,KAAJ,CAAU,qCAAV,CAAN;AACD;;AAED,UAAKH,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,oBAAoB,qCAAqC,EAAE,uCAAuC,uBAAuB,EAAE,oBAAoB,qCAAqC,EAAE,uCAAuC,uBAAuB,EAAE,mDAAmD,uBAAuB,EAAE,6BAA6B,0BAA0B,oBAAoB,EAAE,qCAAqC,4BAA4B,EAAE,qCAAqC,4BAA4B,oBAAoB,EAAE,oBAAoB,0BAA0B,wBAAwB,EAAE,uBAAuB,0BAA0B,sBAAsB,EAAE,0BAA0B,0BAA0B,EAAE,uCAAuC,4BAA4B,EAAE;;AAErhR;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAgB,iBAAiB;AACjC;AACA;AACA,yCAAwC,gBAAgB;AACxD,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,aAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"dat.gui.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dat\"] = factory();\n\telse\n\t\troot[\"dat\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 1923ebf5946db2a04a7d","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dat from './src/dat/index';\n\nexport default dat;\n\n\n\n// WEBPACK FOOTER //\n// ../index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Color from './color/Color';\nimport math from './color/math';\nimport interpret from './color/interpret';\n\nimport Controller from './controllers/Controller';\nimport BooleanController from './controllers/BooleanController';\nimport OptionController from './controllers/OptionController';\nimport StringController from './controllers/StringController';\nimport NumberController from './controllers/NumberController';\nimport NumberControllerBox from './controllers/NumberControllerBox';\nimport NumberControllerSlider from './controllers/NumberControllerSlider';\nimport FunctionController from './controllers/FunctionController';\nimport ColorController from './controllers/ColorController';\n\nimport dom from './dom/dom';\nimport GUI from './gui/GUI';\n\nexport default {\n color: {\n Color: Color,\n math: math,\n interpret: interpret\n },\n\n controllers: {\n Controller: Controller,\n BooleanController: BooleanController,\n OptionController: OptionController,\n StringController: StringController,\n NumberController: NumberController,\n NumberControllerBox: NumberControllerBox,\n NumberControllerSlider: NumberControllerSlider,\n FunctionController: FunctionController,\n ColorController: ColorController\n },\n\n dom: {\n dom: dom\n },\n\n gui: {\n GUI: GUI\n },\n\n GUI: GUI\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport interpret from './interpret';\nimport math from './math';\nimport colorToString from './toString';\nimport common from '../utils/common';\n\nclass Color {\n constructor() {\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw new Error('Failed to interpret color arguments');\n }\n\n this.__state.a = this.__state.a || 1;\n }\n\n toString() {\n return colorToString(this);\n }\n\n toHexString() {\n return colorToString(this, true);\n }\n\n toOriginal() {\n return this.__state.conversion.write(this);\n }\n}\n\nfunction defineRGBComponent(target, component, componentHexIndex) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n Color.recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'RGB') {\n Color.recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\nfunction defineHSVComponent(target, component) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'HSV') {\n return this.__state[component];\n }\n\n Color.recalculateHSV(this);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'HSV') {\n Color.recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\n\nColor.recalculateRGB = function(color, component, componentHexIndex) {\n if (color.__state.space === 'HEX') {\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n } else if (color.__state.space === 'HSV') {\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n } else {\n throw new Error('Corrupted color state');\n }\n};\n\nColor.recalculateHSV = function(color) {\n const result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n};\n\nColor.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a'];\n\ndefineRGBComponent(Color.prototype, 'r', 2);\ndefineRGBComponent(Color.prototype, 'g', 1);\ndefineRGBComponent(Color.prototype, 'b', 0);\n\ndefineHSVComponent(Color.prototype, 'h');\ndefineHSVComponent(Color.prototype, 's');\ndefineHSVComponent(Color.prototype, 'v');\n\nObject.defineProperty(Color.prototype, 'a', {\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n});\n\nObject.defineProperty(Color.prototype, 'hex', {\n get: function() {\n if (!this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n }\n\n return this.__state.hex;\n },\n\n set: function(v) {\n this.__state.space = 'HEX';\n this.__state.hex = v;\n }\n});\n\nexport default Color;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/Color.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport toString from './toString';\nimport common from '../utils/common';\n\nconst INTERPRETATIONS = [\n // Strings\n {\n litmus: common.isString,\n conversions: {\n THREE_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt(\n '0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString(), 0)\n };\n },\n\n write: toString\n },\n\n SIX_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString(), 0)\n };\n },\n\n write: toString\n },\n\n CSS_RGB: {\n read: function(original) {\n const test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n },\n\n write: toString\n },\n\n CSS_RGBA: {\n read: function(original) {\n const test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n },\n\n write: toString\n }\n }\n },\n\n // Numbers\n {\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n };\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n litmus: common.isArray,\n conversions: {\n RGB_ARRAY: {\n read: function(original) {\n if (original.length !== 3) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length !== 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n }\n }\n },\n\n // Objects\n {\n litmus: common.isObject,\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n };\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n };\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n };\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n };\n }\n }\n }\n }\n];\n\nlet result;\nlet toReturn;\n\nconst interpret = function() {\n toReturn = false;\n\n const original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n common.each(INTERPRETATIONS, function(family) {\n if (family.litmus(original)) {\n common.each(family.conversions, function(conversion, conversionName) {\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n }\n });\n\n return common.BREAK;\n }\n });\n\n return toReturn;\n};\n\nexport default interpret;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/interpret.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nexport default function(color, forceCSSHex) {\n const colorFormat = color.__state.conversionName.toString();\n\n const r = Math.round(color.r);\n const g = Math.round(color.g);\n const b = Math.round(color.b);\n const a = color.a;\n const h = Math.round(color.h);\n const s = color.s.toFixed(1);\n const v = color.v.toFixed(1);\n\n if (forceCSSHex || (colorFormat === 'THREE_CHAR_HEX') || (colorFormat === 'SIX_CHAR_HEX')) {\n let str = color.hex.toString(16);\n while (str.length < 6) {\n str = '0' + str;\n }\n return '#' + str;\n } else if (colorFormat === 'CSS_RGB') {\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n } else if (colorFormat === 'CSS_RGBA') {\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n } else if (colorFormat === 'HEX') {\n return '0x' + color.hex.toString(16);\n } else if (colorFormat === 'RGB_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ']';\n } else if (colorFormat === 'RGBA_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ',' + a + ']';\n } else if (colorFormat === 'RGB_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + '}';\n } else if (colorFormat === 'RGBA_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}';\n } else if (colorFormat === 'HSV_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + '}';\n } else if (colorFormat === 'HSVA_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}';\n }\n\n return 'unknown format';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/toString.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nconst ARR_EACH = Array.prototype.forEach;\nconst ARR_SLICE = Array.prototype.slice;\n\n/**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\nconst Common = {\n BREAK: {},\n\n extend: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (!this.isUndefined(obj[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n defaults: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (this.isUndefined(target[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n compose: function() {\n const toCall = ARR_SLICE.call(arguments);\n return function() {\n let args = ARR_SLICE.call(arguments);\n for (let i = toCall.length - 1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n };\n },\n\n each: function(obj, itr, scope) {\n if (!obj) {\n return;\n }\n\n if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) {\n obj.forEach(itr, scope);\n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n let key;\n let l;\n for (key = 0, l = obj.length; key < l; key++) {\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n } else {\n for (const key in obj) {\n if (itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n }\n },\n\n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n\n // if the function is called repeatedly, wait until threshold passes until we execute the function\n debounce: function(func, threshold, callImmediately) {\n let timeout;\n\n return function() {\n const obj = this;\n const args = arguments;\n function delayed() {\n timeout = null;\n if (!callImmediately) func.apply(obj, args);\n }\n\n const callNow = callImmediately || !timeout;\n\n clearTimeout(timeout);\n timeout = setTimeout(delayed, threshold);\n\n if (callNow) {\n func.apply(obj, args);\n }\n };\n },\n\n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n\n isNull: function(obj) {\n return obj === null;\n },\n\n isNaN: function(obj) {\n return isNaN(obj);\n },\n\n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n\n isObject: function(obj) {\n return obj === Object(obj);\n },\n\n isNumber: function(obj) {\n return obj === obj + 0;\n },\n\n isString: function(obj) {\n return obj === obj + '';\n },\n\n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n\n isFunction: function(obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n }\n\n};\n\nexport default Common;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/common.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nlet tmpComponent;\n\nconst ColorMath = {\n hsv_to_rgb: function(h, s, v) {\n const hi = Math.floor(h / 60) % 6;\n\n const f = h / 60 - Math.floor(h / 60);\n const p = v * (1.0 - s);\n const q = v * (1.0 - (f * s));\n const t = v * (1.0 - ((1.0 - f) * s));\n\n const c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n },\n\n rgb_to_hsv: function(r, g, b) {\n const min = Math.min(r, g, b);\n const max = Math.max(r, g, b);\n const delta = max - min;\n let h;\n let s;\n\n if (max !== 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n let hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~(0xFF << tmpComponent));\n }\n};\n\nexport default ColorMath;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/math.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/**\n * @class An \"abstract\" class that represents a given property of an object.\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass Controller {\n constructor(object, property) {\n this.initialValue = object[property];\n\n /**\n * Those who extend this class will put their DOM elements in here.\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n\n /**\n * The object to manipulate\n * @type {Object}\n */\n this.object = object;\n\n /**\n * The name of the property to manipulate\n * @type {String}\n */\n this.property = property;\n\n /**\n * The function to be called on change.\n * @type {Function}\n * @ignore\n */\n this.__onChange = undefined;\n\n /**\n * The function to be called on finishing change.\n * @type {Function}\n * @ignore\n */\n this.__onFinishChange = undefined;\n }\n\n /**\n * Specify that a function fire every time someone changes the value with\n * this Controller.\n *\n * @param {Function} fnc This function will be called whenever the value\n * is modified via this Controller.\n * @returns {Controller} this\n */\n onChange(fnc) {\n this.__onChange = fnc;\n return this;\n }\n\n /**\n * Specify that a function fire every time someone \"finishes\" changing\n * the value wih this Controller. Useful for values that change\n * incrementally like numbers or strings.\n *\n * @param {Function} fnc This function will be called whenever\n * someone \"finishes\" changing the value via this Controller.\n * @returns {Controller} this\n */\n onFinishChange(fnc) {\n this.__onFinishChange = fnc;\n return this;\n }\n\n /**\n * Change the value of object[property]\n *\n * @param {Object} newValue The new value of object[property]\n */\n setValue(newValue) {\n this.object[this.property] = newValue;\n if (this.__onChange) {\n this.__onChange.call(this, newValue);\n }\n\n this.updateDisplay();\n return this;\n }\n\n /**\n * Gets the value of object[property]\n *\n * @returns {Object} The current value of object[property]\n */\n getValue() {\n return this.object[this.property];\n }\n\n /**\n * Refreshes the visual display of a Controller in order to keep sync\n * with the object's current value.\n * @returns {Controller} this\n */\n updateDisplay() {\n return this;\n }\n\n /**\n * @returns {Boolean} true if the value has deviated from initialValue\n */\n isModified() {\n return this.initialValue !== this.getValue();\n }\n}\n\nexport default Controller;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/Controller.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a checkbox input to alter the boolean property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass BooleanController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n this.__prev = this.getValue();\n\n this.__checkbox = document.createElement('input');\n this.__checkbox.setAttribute('type', 'checkbox');\n\n function onChange() {\n _this.setValue(!_this.__prev);\n }\n\n dom.bind(this.__checkbox, 'change', onChange, false);\n\n this.domElement.appendChild(this.__checkbox);\n\n // Match original value\n this.updateDisplay();\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.__prev = this.getValue();\n return toReturn;\n }\n\n updateDisplay() {\n if (this.getValue() === true) {\n this.__checkbox.setAttribute('checked', 'checked');\n this.__checkbox.checked = true;\n this.__prev = true;\n } else {\n this.__checkbox.checked = false;\n this.__prev = false;\n }\n\n return super.updateDisplay();\n }\n}\n\nexport default BooleanController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/BooleanController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport common from '../utils/common';\n\nconst EVENT_MAP = {\n HTMLEvents: ['change'],\n MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],\n KeyboardEvents: ['keydown']\n};\n\nconst EVENT_MAP_INV = {};\ncommon.each(EVENT_MAP, function(v, k) {\n common.each(v, function(e) {\n EVENT_MAP_INV[e] = k;\n });\n});\n\nconst CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\n\nfunction cssValueToPixels(val) {\n if (val === '0' || common.isUndefined(val)) {\n return 0;\n }\n\n const match = val.match(CSS_VALUE_PIXELS);\n\n if (!common.isNull(match)) {\n return parseFloat(match[1]);\n }\n\n // TODO ...ems? %?\n\n return 0;\n}\n\n/**\n * @namespace\n * @member dat.dom\n */\nconst dom = {\n\n /**\n *\n * @param elem\n * @param selectable\n */\n makeSelectable: function(elem, selectable) {\n if (elem === undefined || elem.style === undefined) return;\n\n elem.onselectstart = selectable ? function() {\n return false;\n } : function() {\n };\n\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\n elem.unselectable = selectable ? 'on' : 'off';\n },\n\n /**\n *\n * @param elem\n * @param horizontal\n * @param vert\n */\n makeFullscreen: function(elem, hor, vert) {\n let vertical = vert;\n let horizontal = hor;\n\n if (common.isUndefined(horizontal)) {\n horizontal = true;\n }\n\n if (common.isUndefined(vertical)) {\n vertical = true;\n }\n\n elem.style.position = 'absolute';\n\n if (horizontal) {\n elem.style.left = 0;\n elem.style.right = 0;\n }\n if (vertical) {\n elem.style.top = 0;\n elem.style.bottom = 0;\n }\n },\n\n /**\n *\n * @param elem\n * @param eventType\n * @param params\n */\n fakeEvent: function(elem, eventType, pars, aux) {\n const params = pars || {};\n const className = EVENT_MAP_INV[eventType];\n if (!className) {\n throw new Error('Event type ' + eventType + ' not supported.');\n }\n const evt = document.createEvent(className);\n switch (className) {\n case 'MouseEvents':\n {\n const clientX = params.x || params.clientX || 0;\n const clientY = params.y || params.clientY || 0;\n evt.initMouseEvent(eventType, params.bubbles || false,\n params.cancelable || true, window, params.clickCount || 1,\n 0, // screen X\n 0, // screen Y\n clientX, // client X\n clientY, // client Y\n false, false, false, false, 0, null);\n break;\n }\n case 'KeyboardEvents':\n {\n const init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz\n common.defaults(params, {\n cancelable: true,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n keyCode: undefined,\n charCode: undefined\n });\n init(eventType, params.bubbles || false,\n params.cancelable, window,\n params.ctrlKey, params.altKey,\n params.shiftKey, params.metaKey,\n params.keyCode, params.charCode);\n break;\n }\n default:\n {\n evt.initEvent(eventType, params.bubbles || false, params.cancelable || true);\n break;\n }\n }\n common.defaults(evt, aux);\n elem.dispatchEvent(evt);\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n bind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.addEventListener) {\n elem.addEventListener(event, func, bool);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n unbind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.removeEventListener) {\n elem.removeEventListener(event, func, bool);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n addClass: function(elem, className) {\n if (elem.className === undefined) {\n elem.className = className;\n } else if (elem.className !== className) {\n const classes = elem.className.split(/ +/);\n if (classes.indexOf(className) === -1) {\n classes.push(className);\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\n }\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n removeClass: function(elem, className) {\n if (className) {\n if (elem.className === className) {\n elem.removeAttribute('class');\n } else {\n const classes = elem.className.split(/ +/);\n const index = classes.indexOf(className);\n if (index !== -1) {\n classes.splice(index, 1);\n elem.className = classes.join(' ');\n }\n }\n } else {\n elem.className = undefined;\n }\n return dom;\n },\n\n hasClass: function(elem, className) {\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\n },\n\n /**\n *\n * @param elem\n */\n getWidth: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-left-width']) +\n cssValueToPixels(style['border-right-width']) +\n cssValueToPixels(style['padding-left']) +\n cssValueToPixels(style['padding-right']) +\n cssValueToPixels(style.width);\n },\n\n /**\n *\n * @param elem\n */\n getHeight: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-top-width']) +\n cssValueToPixels(style['border-bottom-width']) +\n cssValueToPixels(style['padding-top']) +\n cssValueToPixels(style['padding-bottom']) +\n cssValueToPixels(style.height);\n },\n\n /**\n *\n * @param el\n */\n getOffset: function(el) {\n let elem = el;\n const offset = { left: 0, top: 0 };\n if (elem.offsetParent) {\n do {\n offset.left += elem.offsetLeft;\n offset.top += elem.offsetTop;\n elem = elem.offsetParent;\n } while (elem);\n }\n return offset;\n },\n\n // http://stackoverflow.com/posts/2684561/revisions\n /**\n *\n * @param elem\n */\n isActive: function(elem) {\n return elem === document.activeElement && (elem.type || elem.href);\n }\n\n};\n\nexport default dom;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/dom.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\n/**\n * @class Provides a select input to alter the property of an object, using a\n * list of accepted values.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object|string[]} options A map of labels to acceptable values, or\n * a list of acceptable string values.\n */\nclass OptionController extends Controller {\n constructor(object, property, opts) {\n super(object, property);\n\n let options = opts;\n\n const _this = this;\n\n /**\n * The drop down menu\n * @ignore\n */\n this.__select = document.createElement('select');\n\n if (common.isArray(options)) {\n const map = {};\n common.each(options, function(element) {\n map[element] = element;\n });\n options = map;\n }\n\n common.each(options, function(value, key) {\n const opt = document.createElement('option');\n opt.innerHTML = key;\n opt.setAttribute('value', value);\n _this.__select.appendChild(opt);\n });\n\n // Acknowledge original value\n this.updateDisplay();\n\n dom.bind(this.__select, 'change', function() {\n const desiredValue = this.options[this.selectedIndex].value;\n _this.setValue(desiredValue);\n });\n\n this.domElement.appendChild(this.__select);\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n return toReturn;\n }\n\n updateDisplay() {\n if (dom.isActive(this.__select)) return this; // prevent number from updating if user is trying to manually update\n this.__select.value = this.getValue();\n return super.updateDisplay();\n }\n}\n\nexport default OptionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/OptionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a text input to alter the string property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass StringController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n\n function onChange() {\n _this.setValue(_this.__input.value);\n }\n\n function onBlur() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n dom.bind(this.__input, 'keyup', onChange);\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) {\n this.blur();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n // Stops the caret from moving on account of:\n // keyup -> setValue -> updateDisplay\n if (!dom.isActive(this.__input)) {\n this.__input.value = this.getValue();\n }\n return super.updateDisplay();\n }\n}\n\nexport default StringController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/StringController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport common from '../utils/common';\n\nfunction numDecimals(x) {\n const _x = x.toString();\n if (_x.indexOf('.') > -1) {\n return _x.length - _x.indexOf('.') - 1;\n }\n\n return 0;\n}\n\n/**\n * @class Represents a given property of an object that is a number.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberController extends Controller {\n constructor(object, property, params) {\n super(object, property);\n\n const _params = params || {};\n\n this.__min = _params.min;\n this.__max = _params.max;\n this.__step = _params.step;\n\n if (common.isUndefined(this.__step)) {\n if (this.initialValue === 0) {\n this.__impliedStep = 1; // What are we, psychics?\n } else {\n // Hey Doug, check this out.\n this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(this.initialValue)) / Math.LN10)) / 10;\n }\n } else {\n this.__impliedStep = this.__step;\n }\n\n this.__precision = numDecimals(this.__impliedStep);\n }\n\n setValue(v) {\n let _v = v;\n\n if (this.__min !== undefined && _v < this.__min) {\n _v = this.__min;\n } else if (this.__max !== undefined && _v > this.__max) {\n _v = this.__max;\n }\n\n if (this.__step !== undefined && _v % this.__step !== 0) {\n _v = Math.round(_v / this.__step) * this.__step;\n }\n\n return super.setValue(_v);\n }\n\n /**\n * Specify a minimum value for object[property].\n *\n * @param {Number} minValue The minimum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n min(minValue) {\n this.__min = minValue;\n return this;\n }\n\n /**\n * Specify a maximum value for object[property].\n *\n * @param {Number} maxValue The maximum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n max(maxValue) {\n this.__max = maxValue;\n return this;\n }\n\n /**\n * Specify a step value that dat.controllers.NumberController\n * increments by.\n *\n * @param {Number} stepValue The step value for\n * dat.controllers.NumberController\n * @default if minimum and maximum specified increment is 1% of the\n * difference otherwise stepValue is 1\n * @returns {dat.controllers.NumberController} this\n */\n step(stepValue) {\n this.__step = stepValue;\n this.__impliedStep = stepValue;\n this.__precision = numDecimals(stepValue);\n return this;\n }\n}\n\nexport default NumberController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nfunction roundToDecimal(value, decimals) {\n const tenTo = Math.pow(10, decimals);\n return Math.round(value * tenTo) / tenTo;\n}\n\n/**\n * @class Represents a given property of an object that is a number and\n * provides an input element with which to manipulate it.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberControllerBox extends NumberController {\n constructor(object, property, params) {\n super(object, property, params);\n\n this.__truncationSuspended = false;\n\n const _this = this;\n\n /**\n * {Number} Previous mouse y position\n * @ignore\n */\n let prevY;\n\n const mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? 'DOMMouseScroll' : 'mousewheel';\n\n function onMouseWheel(e) {\n let value = _this.getValue();\n const delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1;\n e.preventDefault();\n\n if (delta < 0) value += _this.__impliedStep;\n else value -= _this.__impliedStep;\n _this.setValue(value);\n }\n\n function onChange() {\n const attempted = parseFloat(_this.__input.value);\n if (!common.isNaN(attempted)) {\n _this.setValue(attempted);\n }\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n function onBlur() {\n onFinish();\n }\n\n function onMouseDrag(e) {\n const diff = prevY - e.clientY;\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\n\n prevY = e.clientY;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n onFinish();\n }\n\n function onMouseDown(e) {\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n prevY = e.clientY;\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n // Makes it so manually specified values are not truncated.\n\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'mousedown', onMouseDown);\n dom.bind(this.__input, mousewheelevt, onMouseWheel);\n dom.bind(this.__input, 'keydown', function(e) {\n // When pressing enter, you can be as precise as you want.\n if (e.keyCode === 13) {\n _this.__truncationSuspended = true;\n this.blur();\n _this.__truncationSuspended = false;\n onFinish();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerBox;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerBox.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\n\nfunction map(v, i1, i2, o1, o2) {\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\n}\n\n/**\n * @class Represents a given property of an object that is a number, contains\n * a minimum and maximum, and provides a slider element with which to\n * manipulate it. It should be noted that the slider element is made up of\n * <div> tags, not the html5\n * <slider> element.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Number} minValue Minimum allowed value\n * @param {Number} maxValue Maximum allowed value\n * @param {Number} stepValue Increment by which to change value\n */\nclass NumberControllerSlider extends NumberController {\n constructor(object, property, min, max, step) {\n super(object, property, { min: min, max: max, step: step });\n\n const _this = this;\n\n this.__background = document.createElement('div');\n this.__foreground = document.createElement('div');\n\n dom.bind(this.__background, 'mousedown', onMouseDown);\n\n const mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? 'DOMMouseScroll' : 'mousewheel';\n dom.bind(this.__background, mousewheelevt, onMouseWheel);\n\n dom.addClass(this.__background, 'slider');\n dom.addClass(this.__foreground, 'slider-fg');\n\n function onMouseWheel(e) {\n let value = _this.getValue();\n const delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1;\n e.preventDefault();\n document.activeElement.blur();\n\n if (delta < 0) value += _this.__impliedStep;\n else value -= _this.__impliedStep;\n _this.setValue(value);\n }\n\n function onMouseDown(e) {\n document.activeElement.blur();\n\n window.console.log('delete this line');\n\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n\n onMouseDrag(e);\n }\n\n function onMouseDrag(e) {\n e.preventDefault();\n\n const bgRect = _this.__background.getBoundingClientRect();\n\n _this.setValue(\n map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)\n );\n\n return false;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.__background.appendChild(this.__foreground);\n this.domElement.appendChild(this.__background);\n }\n\n updateDisplay() {\n const pct = (this.getValue() - this.__min) / (this.__max - this.__min);\n this.__foreground.style.width = pct * 100 + '%';\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerSlider.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a GUI interface to fire a specified method, a property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass FunctionController extends Controller {\n constructor(object, property, text) {\n super(object, property);\n\n const _this = this;\n\n this.__button = document.createElement('div');\n this.__button.innerHTML = text === undefined ? 'Fire' : text;\n\n dom.bind(this.__button, 'click', function(e) {\n e.preventDefault();\n _this.fire();\n return false;\n });\n\n dom.addClass(this.__button, 'button');\n\n this.domElement.appendChild(this.__button);\n }\n\n fire() {\n if (this.__onChange) {\n this.__onChange.call(this);\n }\n this.getValue().call(this.object);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n }\n}\n\nexport default FunctionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/FunctionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport Color from '../color/Color';\nimport interpret from '../color/interpret';\nimport common from '../utils/common';\n\n/**\n * @class Represents a given property of an object that is a color.\n * @param {Object} object\n * @param {string} property\n */\nclass ColorController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n this.__color = new Color(this.getValue());\n this.__temp = new Color(0);\n\n const _this = this;\n\n this.domElement = document.createElement('div');\n\n dom.makeSelectable(this.domElement, false);\n\n this.__selector = document.createElement('div');\n this.__selector.className = 'selector';\n\n this.__saturation_field = document.createElement('div');\n this.__saturation_field.className = 'saturation-field';\n\n this.__field_knob = document.createElement('div');\n this.__field_knob.className = 'field-knob';\n this.__field_knob_border = '2px solid ';\n\n this.__hue_knob = document.createElement('div');\n this.__hue_knob.className = 'hue-knob';\n\n this.__hue_field = document.createElement('div');\n this.__hue_field.className = 'hue-field';\n\n this.__input = document.createElement('input');\n this.__input.type = 'text';\n this.__input_textShadow = '0 1px 1px ';\n\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) { // on enter\n onBlur.call(this);\n }\n });\n\n dom.bind(this.__input, 'blur', onBlur);\n\n dom.bind(this.__selector, 'mousedown', function(/* e */) {\n dom\n .addClass(this, 'drag')\n .bind(window, 'mouseup', function(/* e */) {\n dom.removeClass(_this.__selector, 'drag');\n });\n });\n\n const valueField = document.createElement('div');\n\n common.extend(this.__selector.style, {\n width: '122px',\n height: '102px',\n padding: '3px',\n backgroundColor: '#222',\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\n });\n\n common.extend(this.__field_knob.style, {\n position: 'absolute',\n width: '12px',\n height: '12px',\n border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\n borderRadius: '12px',\n zIndex: 1\n });\n\n common.extend(this.__hue_knob.style, {\n position: 'absolute',\n width: '15px',\n height: '2px',\n borderRight: '4px solid #fff',\n zIndex: 1\n });\n\n common.extend(this.__saturation_field.style, {\n width: '100px',\n height: '100px',\n border: '1px solid #555',\n marginRight: '3px',\n display: 'inline-block',\n cursor: 'pointer'\n });\n\n common.extend(valueField.style, {\n width: '100%',\n height: '100%',\n background: 'none'\n });\n\n linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000');\n\n common.extend(this.__hue_field.style, {\n width: '15px',\n height: '100px',\n border: '1px solid #555',\n cursor: 'ns-resize',\n position: 'absolute',\n top: '3px',\n right: '3px'\n });\n\n hueGradient(this.__hue_field);\n\n common.extend(this.__input.style, {\n outline: 'none',\n// width: '120px',\n textAlign: 'center',\n// padding: '4px',\n// marginBottom: '6px',\n color: '#fff',\n border: 0,\n fontWeight: 'bold',\n textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'\n });\n\n dom.bind(this.__saturation_field, 'mousedown', fieldDown);\n dom.bind(this.__field_knob, 'mousedown', fieldDown);\n\n dom.bind(this.__hue_field, 'mousedown', function(e) {\n setH(e);\n dom.bind(window, 'mousemove', setH);\n dom.bind(window, 'mouseup', fieldUpH);\n });\n\n function fieldDown(e) {\n setSV(e);\n // document.body.style.cursor = 'none';\n dom.bind(window, 'mousemove', setSV);\n dom.bind(window, 'mouseup', fieldUpSV);\n }\n\n function fieldUpSV() {\n dom.unbind(window, 'mousemove', setSV);\n dom.unbind(window, 'mouseup', fieldUpSV);\n // document.body.style.cursor = 'default';\n onFinish();\n }\n\n function onBlur() {\n const i = interpret(this.value);\n if (i !== false) {\n _this.__color.__state = i;\n _this.setValue(_this.__color.toOriginal());\n } else {\n this.value = _this.__color.toString();\n }\n }\n\n function fieldUpH() {\n dom.unbind(window, 'mousemove', setH);\n dom.unbind(window, 'mouseup', fieldUpH);\n onFinish();\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.__color.toOriginal());\n }\n }\n\n this.__saturation_field.appendChild(valueField);\n this.__selector.appendChild(this.__field_knob);\n this.__selector.appendChild(this.__saturation_field);\n this.__selector.appendChild(this.__hue_field);\n this.__hue_field.appendChild(this.__hue_knob);\n\n this.domElement.appendChild(this.__input);\n this.domElement.appendChild(this.__selector);\n\n this.updateDisplay();\n\n function setSV(e) {\n e.preventDefault();\n\n const fieldRect = _this.__saturation_field.getBoundingClientRect();\n let s = (e.clientX - fieldRect.left) / (fieldRect.right - fieldRect.left);\n let v = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (v > 1) {\n v = 1;\n } else if (v < 0) {\n v = 0;\n }\n\n if (s > 1) {\n s = 1;\n } else if (s < 0) {\n s = 0;\n }\n\n _this.__color.v = v;\n _this.__color.s = s;\n\n _this.setValue(_this.__color.toOriginal());\n\n\n return false;\n }\n\n function setH(e) {\n e.preventDefault();\n\n const fieldRect = _this.__hue_field.getBoundingClientRect();\n let h = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (h > 1) {\n h = 1;\n } else if (h < 0) {\n h = 0;\n }\n\n _this.__color.h = h * 360;\n\n _this.setValue(_this.__color.toOriginal());\n\n return false;\n }\n }\n\n updateDisplay() {\n const i = interpret(this.getValue());\n\n if (i !== false) {\n let mismatch = false;\n\n // Check for mismatch on the interpreted value.\n\n common.each(Color.COMPONENTS, function(component) {\n if (!common.isUndefined(i[component]) && !common.isUndefined(this.__color.__state[component]) &&\n i[component] !== this.__color.__state[component]) {\n mismatch = true;\n return {}; // break\n }\n }, this);\n\n // If nothing diverges, we keep our previous values\n // for statefulness, otherwise we recalculate fresh\n if (mismatch) {\n common.extend(this.__color.__state, i);\n }\n }\n\n common.extend(this.__temp.__state, this.__color.__state);\n\n this.__temp.a = 1;\n\n const flip = (this.__color.v < 0.5 || this.__color.s > 0.5) ? 255 : 0;\n const _flip = 255 - flip;\n\n common.extend(this.__field_knob.style, {\n marginLeft: 100 * this.__color.s - 7 + 'px',\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\n backgroundColor: this.__temp.toHexString(),\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')'\n });\n\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px';\n\n this.__temp.s = 1;\n this.__temp.v = 1;\n\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString());\n\n this.__input.value = this.__color.toString();\n\n common.extend(this.__input.style, {\n backgroundColor: this.__color.toHexString(),\n color: 'rgb(' + flip + ',' + flip + ',' + flip + ')',\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)'\n });\n }\n}\n\nconst vendors = ['-moz-', '-o-', '-webkit-', '-ms-', ''];\n\nfunction linearGradient(elem, x, a, b) {\n elem.style.background = '';\n common.each(vendors, function(vendor) {\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); ';\n });\n}\n\nfunction hueGradient(elem) {\n elem.style.background = '';\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);';\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n}\n\nexport default ColorController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ColorController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport css from '../utils/css';\nimport saveDialogueContents from './saveDialogue.html';\nimport ControllerFactory from '../controllers/ControllerFactory';\nimport Controller from '../controllers/Controller';\nimport BooleanController from '../controllers/BooleanController';\nimport FunctionController from '../controllers/FunctionController';\nimport NumberControllerBox from '../controllers/NumberControllerBox';\nimport NumberControllerSlider from '../controllers/NumberControllerSlider';\nimport ColorController from '../controllers/ColorController';\nimport requestAnimationFrame from '../utils/requestAnimationFrame';\nimport CenteredDiv from '../dom/CenteredDiv';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nimport styleSheet from './style.scss'; // CSS to embed in build\n\ncss.inject(styleSheet);\n\n/** @ignore Outer-most className for GUI's */\nconst CSS_NAMESPACE = 'dg';\n\nconst HIDE_KEY_CODE = 72;\n\n/** @ignore The only value shared between the JS and SCSS. Use caution. */\nconst CLOSE_BUTTON_HEIGHT = 20;\n\nconst DEFAULT_DEFAULT_PRESET_NAME = 'Default';\n\nconst SUPPORTS_LOCAL_STORAGE = (function() {\n try {\n return 'localStorage' in window && window.localStorage !== null;\n } catch (e) {\n return false;\n }\n}());\n\nlet SAVE_DIALOGUE;\n\n/** @ignore Have we yet to create an autoPlace GUI? */\nlet autoPlaceVirgin = true;\n\n/** @ignore Fixed position div that auto place GUI's go inside */\nlet autoPlaceContainer;\n\n/** @ignore Are we hiding the GUI's ? */\nlet hide = false;\n\n/** @private GUI's which should be hidden */\nconst hideableGuis = [];\n\n/**\n * @class A lightweight controller library for JavaScript. It allows you to easily\n * manipulate variables and fire functions on the fly.\n *\n * @typicalname gui\n *\n * @example\n * // Creating a GUI with options.\n * var gui = new dat.GUI({name: 'My GUI'});\n *\n * @example\n * // Creating a GUI and a subfolder.\n * var gui = new dat.GUI();\n * var folder1 = gui.addFolder('Flow Field');\n *\n * @param {Object} [params]\n * @param {String} [params.name] The name of this GUI.\n * @param {Object} [params.load] JSON object representing the saved state of\n * this GUI.\n * @param {Boolean} [params.auto=true]\n * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.\n * @param {Boolean} [params.closed] If true, starts closed\n * @param {Boolean} [params.closeOnTop] If true, close/open button shows on top of the GUI\n */\nconst GUI = function(pars) {\n const _this = this;\n\n let params = pars || {};\n\n /**\n * Outermost DOM Element\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n this.__ul = document.createElement('ul');\n this.domElement.appendChild(this.__ul);\n\n dom.addClass(this.domElement, CSS_NAMESPACE);\n\n /**\n * Nested GUI's by name\n * @ignore\n */\n this.__folders = {};\n\n this.__controllers = [];\n\n /**\n * List of objects I'm remembering for save, only used in top level GUI\n * @ignore\n */\n this.__rememberedObjects = [];\n\n /**\n * Maps the index of remembered objects to a map of controllers, only used\n * in top level GUI.\n *\n * @private\n * @ignore\n *\n * @example\n * [\n * {\n * propertyName: Controller,\n * anotherPropertyName: Controller\n * },\n * {\n * propertyName: Controller\n * }\n * ]\n */\n this.__rememberedObjectIndecesToControllers = [];\n\n this.__listening = [];\n\n // Default parameters\n params = common.defaults(params, {\n closeOnTop: false,\n autoPlace: true,\n width: GUI.DEFAULT_WIDTH\n });\n\n params = common.defaults(params, {\n resizable: params.autoPlace,\n hideable: params.autoPlace\n });\n\n if (!common.isUndefined(params.load)) {\n // Explicit preset\n if (params.preset) {\n params.load.preset = params.preset;\n }\n } else {\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\n }\n\n if (common.isUndefined(params.parent) && params.hideable) {\n hideableGuis.push(this);\n }\n\n // Only root level GUI's are resizable.\n params.resizable = common.isUndefined(params.parent) && params.resizable;\n\n if (params.autoPlace && common.isUndefined(params.scrollable)) {\n params.scrollable = true;\n }\n// params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;\n\n // Not part of params because I don't want people passing this in via\n // constructor. Should be a 'remembered' value.\n let useLocalStorage =\n SUPPORTS_LOCAL_STORAGE &&\n localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\n\n let saveToLocalStorage;\n\n Object.defineProperties(this,\n /** @lends GUI.prototype */\n {\n /**\n * The parent GUI\n * @type dat.gui.GUI\n */\n parent: {\n get: function() {\n return params.parent;\n }\n },\n\n scrollable: {\n get: function() {\n return params.scrollable;\n }\n },\n\n /**\n * Handles GUI's element placement for you\n * @type Boolean\n */\n autoPlace: {\n get: function() {\n return params.autoPlace;\n }\n },\n\n /**\n * Handles GUI's position of open/close button\n * @type Boolean\n */\n closeOnTop: {\n get: function() {\n return params.closeOnTop;\n }\n },\n\n /**\n * The identifier for a set of saved values\n * @type String\n */\n preset: {\n get: function() {\n if (_this.parent) {\n return _this.getRoot().preset;\n }\n\n return params.load.preset;\n },\n\n set: function(v) {\n if (_this.parent) {\n _this.getRoot().preset = v;\n } else {\n params.load.preset = v;\n }\n setPresetSelectIndex(this);\n _this.revert();\n }\n },\n\n /**\n * The width of GUI element\n * @type Number\n */\n width: {\n get: function() {\n return params.width;\n },\n set: function(v) {\n params.width = v;\n setWidth(_this, v);\n }\n },\n\n /**\n * The name of GUI. Used for folders. i.e\n * a folder's name\n * @type String\n */\n name: {\n get: function() {\n return params.name;\n },\n set: function(v) {\n // TODO Check for collisions among sibling folders\n params.name = v;\n if (titleRowName) {\n titleRowName.innerHTML = params.name;\n }\n }\n },\n\n /**\n * Whether the GUI is collapsed or not\n * @type Boolean\n */\n closed: {\n get: function() {\n return params.closed;\n },\n set: function(v) {\n params.closed = v;\n if (params.closed) {\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\n } else {\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\n }\n // For browsers that aren't going to respect the CSS transition,\n // Lets just check our height against the window height right off\n // the bat.\n this.onResize();\n\n if (_this.__closeButton) {\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\n }\n }\n },\n\n /**\n * Contains all presets\n * @type Object\n */\n load: {\n get: function() {\n return params.load;\n }\n },\n\n /**\n * Determines whether or not to use localStorage as the means for\n * remembering\n * @type Boolean\n */\n useLocalStorage: {\n\n get: function() {\n return useLocalStorage;\n },\n set: function(bool) {\n if (SUPPORTS_LOCAL_STORAGE) {\n useLocalStorage = bool;\n if (bool) {\n dom.bind(window, 'unload', saveToLocalStorage);\n } else {\n dom.unbind(window, 'unload', saveToLocalStorage);\n }\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\n }\n }\n }\n });\n\n // Are we a root level GUI?\n if (common.isUndefined(params.parent)) {\n params.closed = false;\n\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\n dom.makeSelectable(this.domElement, false);\n\n // Are we supposed to be loading locally?\n if (SUPPORTS_LOCAL_STORAGE) {\n if (useLocalStorage) {\n _this.useLocalStorage = true;\n\n const savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\n\n if (savedGui) {\n params.load = JSON.parse(savedGui);\n }\n }\n }\n\n this.__closeButton = document.createElement('div');\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\n if (params.closeOnTop) {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP);\n this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]);\n } else {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM);\n this.domElement.appendChild(this.__closeButton);\n }\n\n dom.bind(this.__closeButton, 'click', function() {\n _this.closed = !_this.closed;\n });\n // Oh, you're a nested GUI!\n } else {\n if (params.closed === undefined) {\n params.closed = true;\n }\n\n const titleRowName = document.createTextNode(params.name);\n dom.addClass(titleRowName, 'controller-name');\n\n const titleRow = addRow(_this, titleRowName);\n\n const onClickTitle = function(e) {\n e.preventDefault();\n _this.closed = !_this.closed;\n return false;\n };\n\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\n\n dom.addClass(titleRow, 'title');\n dom.bind(titleRow, 'click', onClickTitle);\n\n if (!params.closed) {\n this.closed = false;\n }\n }\n\n if (params.autoPlace) {\n if (common.isUndefined(params.parent)) {\n if (autoPlaceVirgin) {\n autoPlaceContainer = document.createElement('div');\n dom.addClass(autoPlaceContainer, CSS_NAMESPACE);\n dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER);\n document.body.appendChild(autoPlaceContainer);\n autoPlaceVirgin = false;\n }\n\n // Put it in the dom for you.\n autoPlaceContainer.appendChild(this.domElement);\n\n // Apply the auto styles\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\n }\n\n\n // Make it not elastic.\n if (!this.parent) {\n setWidth(_this, params.width);\n }\n }\n\n this.__resizeHandler = function() {\n _this.onResizeDebounced();\n };\n\n dom.bind(window, 'resize', this.__resizeHandler);\n dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler);\n dom.bind(this.__ul, 'transitionend', this.__resizeHandler);\n dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler);\n this.onResize();\n\n if (params.resizable) {\n addResizeHandle(this);\n }\n\n saveToLocalStorage = function() {\n if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') {\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\n }\n };\n\n // expose this method publicly\n this.saveToLocalStorageIfPossible = saveToLocalStorage;\n\n function resetWidth() {\n const root = _this.getRoot();\n root.width += 1;\n common.defer(function() {\n root.width -= 1;\n });\n }\n\n if (!params.parent) {\n resetWidth();\n }\n};\n\nGUI.toggleHide = function() {\n hide = !hide;\n common.each(hideableGuis, function(gui) {\n gui.domElement.style.display = hide ? 'none' : '';\n });\n};\n\nGUI.CLASS_AUTO_PLACE = 'a';\nGUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\nGUI.CLASS_MAIN = 'main';\nGUI.CLASS_CONTROLLER_ROW = 'cr';\nGUI.CLASS_TOO_TALL = 'taller-than-window';\nGUI.CLASS_CLOSED = 'closed';\nGUI.CLASS_CLOSE_BUTTON = 'close-button';\nGUI.CLASS_CLOSE_TOP = 'close-top';\nGUI.CLASS_CLOSE_BOTTOM = 'close-bottom';\nGUI.CLASS_DRAG = 'drag';\n\nGUI.DEFAULT_WIDTH = 245;\nGUI.TEXT_CLOSED = 'Close Controls';\nGUI.TEXT_OPEN = 'Open Controls';\n\nGUI._keydownHandler = function(e) {\n if (document.activeElement.type !== 'text' &&\n (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) {\n GUI.toggleHide();\n }\n};\ndom.bind(window, 'keydown', GUI._keydownHandler, false);\n\ncommon.extend(\n GUI.prototype,\n\n /** @lends GUI.prototype */\n {\n\n /**\n * Adds a new {@link Controller} to the GUI. The type of controller created\n * is inferred from the initial value of object[property]. For\n * color properties, see {@link addColor}.\n *\n * @param {Object} object The object to be manipulated\n * @param {String} property The name of the property to be manipulated\n * @param {Number} [min] Minimum allowed value\n * @param {Number} [max] Maximum allowed value\n * @param {Number} [step] Increment by which to change value\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * // Add a string controller.\n * var person = {name: 'Sam'};\n * gui.add(person, 'name');\n *\n * @example\n * // Add a number controller slider.\n * var person = {age: 45};\n * gui.add(person, 'age', 0, 100);\n */\n add: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n factoryArgs: Array.prototype.slice.call(arguments, 2)\n }\n );\n },\n\n /**\n * Adds a new color controller to the GUI.\n *\n * @param object\n * @param property\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * var palette = {\n * color1: '#FF0000', // CSS string\n * color2: [ 0, 128, 255 ], // RGB array\n * color3: [ 0, 128, 255, 0.3 ], // RGB with alpha\n * color4: { h: 350, s: 0.9, v: 0.3 } // Hue, saturation, value\n * };\n * gui.addColor(palette, 'color1');\n * gui.addColor(palette, 'color2');\n * gui.addColor(palette, 'color3');\n * gui.addColor(palette, 'color4');\n */\n addColor: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n color: true\n }\n );\n },\n\n /**\n * Removes the given controller from the GUI.\n * @param {Controller} controller\n * @instance\n */\n remove: function(controller) {\n // TODO listening?\n this.__ul.removeChild(controller.__li);\n this.__controllers.splice(this.__controllers.indexOf(controller), 1);\n const _this = this;\n common.defer(function() {\n _this.onResize();\n });\n },\n\n /**\n * Removes the GUI from the document and unbinds all event listeners.\n * @instance\n */\n destroy: function() {\n if (this.autoPlace) {\n autoPlaceContainer.removeChild(this.domElement);\n }\n\n dom.unbind(window, 'keydown', GUI._keydownHandler, false);\n dom.unbind(window, 'resize', this.__resizeHandler);\n\n if (this.saveToLocalStorageIfPossible) {\n dom.unbind(window, 'unload', this.saveToLocalStorageIfPossible);\n }\n },\n\n /**\n * Creates a new subfolder GUI instance.\n * @param name\n * @returns {dat.gui.GUI} The new folder.\n * @throws {Error} if this GUI already has a folder by the specified\n * name\n * @instance\n */\n addFolder: function(name) {\n // We have to prevent collisions on names in order to have a key\n // by which to remember saved values\n if (this.__folders[name] !== undefined) {\n throw new Error('You already have a folder in this GUI by the' +\n ' name \"' + name + '\"');\n }\n\n const newGuiParams = { name: name, parent: this };\n\n // We need to pass down the autoPlace trait so that we can\n // attach event listeners to open/close folder actions to\n // ensure that a scrollbar appears if the window is too short.\n newGuiParams.autoPlace = this.autoPlace;\n\n // Do we have saved appearance data for this folder?\n if (this.load && // Anything loaded?\n this.load.folders && // Was my parent a dead-end?\n this.load.folders[name]) { // Did daddy remember me?\n // Start me closed if I was closed\n newGuiParams.closed = this.load.folders[name].closed;\n\n // Pass down the loaded data\n newGuiParams.load = this.load.folders[name];\n }\n\n const gui = new GUI(newGuiParams);\n this.__folders[name] = gui;\n\n const li = addRow(this, gui.domElement);\n dom.addClass(li, 'folder');\n return gui;\n },\n\n /**\n * Opens the GUI.\n */\n open: function() {\n this.closed = false;\n },\n\n /**\n * Closes the GUI.\n */\n close: function() {\n this.closed = true;\n },\n\n\n onResize: function() {\n // we debounce this function to prevent performance issues when rotating on tablet/mobile\n const root = this.getRoot();\n if (root.scrollable) {\n const top = dom.getOffset(root.__ul).top;\n let h = 0;\n\n common.each(root.__ul.childNodes, function(node) {\n if (!(root.autoPlace && node === root.__save_row)) {\n h += dom.getHeight(node);\n }\n });\n\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\n } else {\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = 'auto';\n }\n }\n\n if (root.__resize_handle) {\n common.defer(function() {\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\n });\n }\n\n if (root.__closeButton) {\n root.__closeButton.style.width = root.width + 'px';\n }\n },\n\n onResizeDebounced: common.debounce(function() { this.onResize(); }, 50),\n\n /**\n * Mark objects for saving. The order of these objects cannot change as\n * the GUI grows. When remembering new objects, append them to the end\n * of the list.\n *\n * @param {...Object} objects\n * @throws {Error} if not called on a top level GUI.\n * @instance\n * @ignore\n */\n remember: function() {\n if (common.isUndefined(SAVE_DIALOGUE)) {\n SAVE_DIALOGUE = new CenteredDiv();\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;\n }\n\n if (this.parent) {\n throw new Error('You can only call remember on a top level GUI.');\n }\n\n const _this = this;\n\n common.each(Array.prototype.slice.call(arguments), function(object) {\n if (_this.__rememberedObjects.length === 0) {\n addSaveMenu(_this);\n }\n if (_this.__rememberedObjects.indexOf(object) === -1) {\n _this.__rememberedObjects.push(object);\n }\n });\n\n if (this.autoPlace) {\n // Set save row width\n setWidth(this, this.width);\n }\n },\n\n /**\n * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.\n * @instance\n */\n getRoot: function() {\n let gui = this;\n while (gui.parent) {\n gui = gui.parent;\n }\n return gui;\n },\n\n /**\n * @returns {Object} a JSON object representing the current state of\n * this GUI as well as its remembered properties.\n * @instance\n */\n getSaveObject: function() {\n const toReturn = this.load;\n toReturn.closed = this.closed;\n\n // Am I remembering any values?\n if (this.__rememberedObjects.length > 0) {\n toReturn.preset = this.preset;\n\n if (!toReturn.remembered) {\n toReturn.remembered = {};\n }\n\n toReturn.remembered[this.preset] = getCurrentPreset(this);\n }\n\n toReturn.folders = {};\n common.each(this.__folders, function(element, key) {\n toReturn.folders[key] = element.getSaveObject();\n });\n\n return toReturn;\n },\n\n save: function() {\n if (!this.load.remembered) {\n this.load.remembered = {};\n }\n\n this.load.remembered[this.preset] = getCurrentPreset(this);\n markPresetModified(this, false);\n this.saveToLocalStorageIfPossible();\n },\n\n saveAs: function(presetName) {\n if (!this.load.remembered) {\n // Retain default values upon first save\n this.load.remembered = {};\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\n }\n\n this.load.remembered[presetName] = getCurrentPreset(this);\n this.preset = presetName;\n addPresetOption(this, presetName, true);\n this.saveToLocalStorageIfPossible();\n },\n\n revert: function(gui) {\n common.each(this.__controllers, function(controller) {\n // Make revert work on Default.\n if (!this.getRoot().load.remembered) {\n controller.setValue(controller.initialValue);\n } else {\n recallSavedValue(gui || this.getRoot(), controller);\n }\n\n // fire onFinishChange callback\n if (controller.__onFinishChange) {\n controller.__onFinishChange.call(controller, controller.getValue());\n }\n }, this);\n\n common.each(this.__folders, function(folder) {\n folder.revert(folder);\n });\n\n if (!gui) {\n markPresetModified(this.getRoot(), false);\n }\n },\n\n listen: function(controller) {\n const init = this.__listening.length === 0;\n this.__listening.push(controller);\n if (init) {\n updateDisplays(this.__listening);\n }\n },\n\n updateDisplay: function() {\n common.each(this.__controllers, function(controller) {\n controller.updateDisplay();\n });\n common.each(this.__folders, function(folder) {\n folder.updateDisplay();\n });\n }\n }\n);\n\n/**\n * Add a row to the end of the GUI or before another row.\n *\n * @param gui\n * @param [newDom] If specified, inserts the dom content in the new row\n * @param [liBefore] If specified, places the new row before another row\n *\n * @ignore\n */\nfunction addRow(gui, newDom, liBefore) {\n const li = document.createElement('li');\n if (newDom) {\n li.appendChild(newDom);\n }\n\n if (liBefore) {\n gui.__ul.insertBefore(li, liBefore);\n } else {\n gui.__ul.appendChild(li);\n }\n gui.onResize();\n return li;\n}\n\nfunction markPresetModified(gui, modified) {\n const opt = gui.__preset_select[gui.__preset_select.selectedIndex];\n\n // console.log('mark', modified, opt);\n if (modified) {\n opt.innerHTML = opt.value + '*';\n } else {\n opt.innerHTML = opt.value;\n }\n}\n\nfunction augmentController(gui, li, controller) {\n controller.__li = li;\n controller.__gui = gui;\n\n common.extend(controller, {\n options: function(options) {\n if (arguments.length > 1) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [common.toArray(arguments)]\n }\n );\n }\n\n if (common.isArray(options) || common.isObject(options)) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [options]\n }\n );\n }\n },\n\n name: function(v) {\n controller.__li.firstElementChild.firstElementChild.innerHTML = v;\n return controller;\n },\n\n listen: function() {\n controller.__gui.listen(controller);\n return controller;\n },\n\n remove: function() {\n controller.__gui.remove(controller);\n return controller;\n }\n });\n\n // All sliders should be accompanied by a box.\n if (controller instanceof NumberControllerSlider) {\n const box = new NumberControllerBox(controller.object, controller.property,\n { min: controller.__min, max: controller.__max, step: controller.__step });\n\n common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step'], function(method) {\n const pc = controller[method];\n const pb = box[method];\n controller[method] = box[method] = function() {\n const args = Array.prototype.slice.call(arguments);\n pb.apply(box, args);\n return pc.apply(controller, args);\n };\n });\n\n dom.addClass(li, 'has-slider');\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\n } else if (controller instanceof NumberControllerBox) {\n const r = function(returned) {\n // Have we defined both boundaries?\n if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {\n // Well, then lets just replace this with a slider.\n\n // lets remember if the old controller had a specific name or was listening\n const oldName = controller.__li.firstElementChild.firstElementChild.innerHTML;\n const wasListening = controller.__gui.__listening.indexOf(controller) > -1;\n\n controller.remove();\n const newController = add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [controller.__min, controller.__max, controller.__step]\n });\n\n newController.name(oldName);\n if (wasListening) newController.listen();\n\n return newController;\n }\n\n return returned;\n };\n\n controller.min = common.compose(r, controller.min);\n controller.max = common.compose(r, controller.max);\n } else if (controller instanceof BooleanController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__checkbox, 'click');\n });\n\n dom.bind(controller.__checkbox, 'click', function(e) {\n e.stopPropagation(); // Prevents double-toggle\n });\n } else if (controller instanceof FunctionController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__button, 'click');\n });\n\n dom.bind(li, 'mouseover', function() {\n dom.addClass(controller.__button, 'hover');\n });\n\n dom.bind(li, 'mouseout', function() {\n dom.removeClass(controller.__button, 'hover');\n });\n } else if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n controller.updateDisplay = common.compose(function(val) {\n li.style.borderLeftColor = controller.__color.toString();\n return val;\n }, controller.updateDisplay);\n\n controller.updateDisplay();\n }\n\n controller.setValue = common.compose(function(val) {\n if (gui.getRoot().__preset_select && controller.isModified()) {\n markPresetModified(gui.getRoot(), true);\n }\n\n return val;\n }, controller.setValue);\n}\n\nfunction recallSavedValue(gui, controller) {\n // Find the topmost GUI, that's where remembered objects live.\n const root = gui.getRoot();\n\n // Does the object we're controlling match anything we've been told to\n // remember?\n const matchedIndex = root.__rememberedObjects.indexOf(controller.object);\n\n // Why yes, it does!\n if (matchedIndex !== -1) {\n // Let me fetch a map of controllers for thcommon.isObject.\n let controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex];\n\n // Ohp, I believe this is the first controller we've created for this\n // object. Lets make the map fresh.\n if (controllerMap === undefined) {\n controllerMap = {};\n root.__rememberedObjectIndecesToControllers[matchedIndex] =\n controllerMap;\n }\n\n // Keep track of this controller\n controllerMap[controller.property] = controller;\n\n // Okay, now have we saved any values for this controller?\n if (root.load && root.load.remembered) {\n const presetMap = root.load.remembered;\n\n // Which preset are we trying to load?\n let preset;\n\n if (presetMap[gui.preset]) {\n preset = presetMap[gui.preset];\n } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) {\n // Uhh, you can have the default instead?\n preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME];\n } else {\n // Nada.\n return;\n }\n\n // Did the loaded object remember thcommon.isObject? && Did we remember this particular property?\n if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) {\n // We did remember something for this guy ...\n const value = preset[matchedIndex][controller.property];\n\n // And that's what it is.\n controller.initialValue = value;\n controller.setValue(value);\n }\n }\n }\n}\n\nfunction add(gui, object, property, params) {\n if (object[property] === undefined) {\n throw new Error(`Object \"${object}\" has no property \"${property}\"`);\n }\n\n let controller;\n\n if (params.color) {\n controller = new ColorController(object, property);\n } else {\n const factoryArgs = [object, property].concat(params.factoryArgs);\n controller = ControllerFactory.apply(gui, factoryArgs);\n }\n\n if (params.before instanceof Controller) {\n params.before = params.before.__li;\n }\n\n recallSavedValue(gui, controller);\n\n dom.addClass(controller.domElement, 'c');\n\n const name = document.createElement('span');\n dom.addClass(name, 'property-name');\n name.innerHTML = controller.property;\n\n const container = document.createElement('div');\n container.appendChild(name);\n container.appendChild(controller.domElement);\n\n const li = addRow(gui, container, params.before);\n\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\n if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n } else {\n dom.addClass(li, typeof controller.getValue());\n }\n\n augmentController(gui, li, controller);\n\n gui.__controllers.push(controller);\n\n return controller;\n}\n\nfunction getLocalStorageHash(gui, key) {\n // TODO how does this deal with multiple GUI's?\n return document.location.href + '.' + key;\n}\n\nfunction addPresetOption(gui, name, setSelected) {\n const opt = document.createElement('option');\n opt.innerHTML = name;\n opt.value = name;\n gui.__preset_select.appendChild(opt);\n if (setSelected) {\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\n }\n}\n\nfunction showHideExplain(gui, explain) {\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\n}\n\nfunction addSaveMenu(gui) {\n const div = gui.__save_row = document.createElement('li');\n\n dom.addClass(gui.domElement, 'has-save');\n\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\n\n dom.addClass(div, 'save-row');\n\n const gears = document.createElement('span');\n gears.innerHTML = ' ';\n dom.addClass(gears, 'button gears');\n\n // TODO replace with FunctionController\n const button = document.createElement('span');\n button.innerHTML = 'Save';\n dom.addClass(button, 'button');\n dom.addClass(button, 'save');\n\n const button2 = document.createElement('span');\n button2.innerHTML = 'New';\n dom.addClass(button2, 'button');\n dom.addClass(button2, 'save-as');\n\n const button3 = document.createElement('span');\n button3.innerHTML = 'Revert';\n dom.addClass(button3, 'button');\n dom.addClass(button3, 'revert');\n\n const select = gui.__preset_select = document.createElement('select');\n\n if (gui.load && gui.load.remembered) {\n common.each(gui.load.remembered, function(value, key) {\n addPresetOption(gui, key, key === gui.preset);\n });\n } else {\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\n }\n\n dom.bind(select, 'change', function() {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\n }\n\n gui.preset = this.value;\n });\n\n div.appendChild(select);\n div.appendChild(gears);\n div.appendChild(button);\n div.appendChild(button2);\n div.appendChild(button3);\n\n if (SUPPORTS_LOCAL_STORAGE) {\n const explain = document.getElementById('dg-local-explain');\n const localStorageCheckBox = document.getElementById('dg-local-storage');\n const saveLocally = document.getElementById('dg-save-locally');\n\n saveLocally.style.display = 'block';\n\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\n localStorageCheckBox.setAttribute('checked', 'checked');\n }\n\n showHideExplain(gui, explain);\n\n // TODO: Use a boolean controller, fool!\n dom.bind(localStorageCheckBox, 'change', function() {\n gui.useLocalStorage = !gui.useLocalStorage;\n showHideExplain(gui, explain);\n });\n }\n\n const newConstructorTextArea = document.getElementById('dg-new-constructor');\n\n dom.bind(newConstructorTextArea, 'keydown', function(e) {\n if (e.metaKey && (e.which === 67 || e.keyCode === 67)) {\n SAVE_DIALOGUE.hide();\n }\n });\n\n dom.bind(gears, 'click', function() {\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\n SAVE_DIALOGUE.show();\n newConstructorTextArea.focus();\n newConstructorTextArea.select();\n });\n\n dom.bind(button, 'click', function() {\n gui.save();\n });\n\n dom.bind(button2, 'click', function() {\n const presetName = prompt('Enter a new preset name.');\n if (presetName) {\n gui.saveAs(presetName);\n }\n });\n\n dom.bind(button3, 'click', function() {\n gui.revert();\n });\n\n // div.appendChild(button2);\n}\n\nfunction addResizeHandle(gui) {\n let pmouseX;\n\n gui.__resize_handle = document.createElement('div');\n\n common.extend(gui.__resize_handle.style, {\n\n width: '6px',\n marginLeft: '-3px',\n height: '200px',\n cursor: 'ew-resize',\n position: 'absolute'\n // border: '1px solid blue'\n\n });\n\n function drag(e) {\n e.preventDefault();\n\n gui.width += pmouseX - e.clientX;\n gui.onResize();\n pmouseX = e.clientX;\n\n return false;\n }\n\n function dragStop() {\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.unbind(window, 'mousemove', drag);\n dom.unbind(window, 'mouseup', dragStop);\n }\n\n function dragStart(e) {\n e.preventDefault();\n\n pmouseX = e.clientX;\n\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.bind(window, 'mousemove', drag);\n dom.bind(window, 'mouseup', dragStop);\n\n return false;\n }\n\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\n\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\n}\n\nfunction setWidth(gui, w) {\n gui.domElement.style.width = w + 'px';\n // Auto placed save-rows are position fixed, so we have to\n // set the width manually if we want it to bleed to the edge\n if (gui.__save_row && gui.autoPlace) {\n gui.__save_row.style.width = w + 'px';\n }\n if (gui.__closeButton) {\n gui.__closeButton.style.width = w + 'px';\n }\n}\n\nfunction getCurrentPreset(gui, useInitialValues) {\n const toReturn = {};\n\n // For each object I'm remembering\n common.each(gui.__rememberedObjects, function(val, index) {\n const savedValues = {};\n\n // The controllers I've made for thcommon.isObject by property\n const controllerMap =\n gui.__rememberedObjectIndecesToControllers[index];\n\n // Remember each value for each property\n common.each(controllerMap, function(controller, property) {\n savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue();\n });\n\n // Save the values for thcommon.isObject\n toReturn[index] = savedValues;\n });\n\n return toReturn;\n}\n\nfunction setPresetSelectIndex(gui) {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n if (gui.__preset_select[index].value === gui.preset) {\n gui.__preset_select.selectedIndex = index;\n }\n }\n}\n\nfunction updateDisplays(controllerArray) {\n if (controllerArray.length !== 0) {\n requestAnimationFrame.call(window, function() {\n updateDisplays(controllerArray);\n });\n }\n\n common.each(controllerArray, function(c) {\n c.updateDisplay();\n });\n}\n\nexport default GUI;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/gui/GUI.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nmodule.exports = {\n load: function(url, indoc) {\n const doc = indoc || document;\n const link = doc.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n doc.getElementsByTagName('head')[0].appendChild(link);\n },\n\n inject: function(css, indoc) {\n const doc = indoc || document;\n const injected = document.createElement('style');\n injected.type = 'text/css';\n injected.innerHTML = css;\n const head = doc.getElementsByTagName('head')[0];\n try {\n head.appendChild(injected);\n } catch (e) { // Unable to inject CSS, probably because of a Content Security Policy\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/css.js","module.exports = \"
    \\n\\n Here's the new load parameter for your GUI's constructor:\\n\\n \\n\\n
    \\n\\n Automatically save\\n values to localStorage on exit.\\n\\n
    The values saved to localStorage will\\n override those passed to dat.GUI's constructor. This makes it\\n easier to work incrementally, but localStorage is fragile,\\n and your friends may not see the same values you do.\\n\\n
    \\n\\n
    \\n\\n
    \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/saveDialogue.html\n// module id = 19\n// module chunks = 0","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport OptionController from './OptionController';\nimport NumberControllerBox from './NumberControllerBox';\nimport NumberControllerSlider from './NumberControllerSlider';\nimport StringController from './StringController';\nimport FunctionController from './FunctionController';\nimport BooleanController from './BooleanController';\nimport common from '../utils/common';\n\nconst ControllerFactory = function(object, property) {\n const initialValue = object[property];\n\n // Providing options?\n if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {\n return new OptionController(object, property, arguments[2]);\n }\n\n // Providing a map?\n if (common.isNumber(initialValue)) {\n // Has min and max? (slider)\n if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {\n // has step?\n if (common.isNumber(arguments[4])) {\n return new NumberControllerSlider(object, property,\n arguments[2], arguments[3], arguments[4]);\n }\n\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\n }\n\n // number box\n if (common.isNumber(arguments[4])) { // has step\n return new NumberControllerBox(object, property,\n { min: arguments[2], max: arguments[3], step: arguments[4] });\n }\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\n }\n\n if (common.isString(initialValue)) {\n return new StringController(object, property);\n }\n\n if (common.isFunction(initialValue)) {\n return new FunctionController(object, property, '');\n }\n\n if (common.isBoolean(initialValue)) {\n return new BooleanController(object, property);\n }\n\n return null;\n};\n\nexport default ControllerFactory;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ControllerFactory.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction requestAnimationFrame(callback) {\n setTimeout(callback, 1000 / 60);\n}\n\nexport default window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n requestAnimationFrame;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/requestAnimationFrame.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nclass CenteredDiv {\n constructor() {\n this.backgroundElement = document.createElement('div');\n common.extend(this.backgroundElement.style, {\n backgroundColor: 'rgba(0,0,0,0.8)',\n top: 0,\n left: 0,\n display: 'none',\n zIndex: '1000',\n opacity: 0,\n WebkitTransition: 'opacity 0.2s linear',\n transition: 'opacity 0.2s linear'\n });\n\n dom.makeFullscreen(this.backgroundElement);\n this.backgroundElement.style.position = 'fixed';\n\n this.domElement = document.createElement('div');\n common.extend(this.domElement.style, {\n position: 'fixed',\n display: 'none',\n zIndex: '1001',\n opacity: 0,\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',\n transition: 'transform 0.2s ease-out, opacity 0.2s linear'\n });\n\n\n document.body.appendChild(this.backgroundElement);\n document.body.appendChild(this.domElement);\n\n const _this = this;\n dom.bind(this.backgroundElement, 'click', function() {\n _this.hide();\n });\n }\n\n show() {\n const _this = this;\n\n this.backgroundElement.style.display = 'block';\n\n this.domElement.style.display = 'block';\n this.domElement.style.opacity = 0;\n// this.domElement.style.top = '52%';\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n this.layout();\n\n common.defer(function() {\n _this.backgroundElement.style.opacity = 1;\n _this.domElement.style.opacity = 1;\n _this.domElement.style.webkitTransform = 'scale(1)';\n });\n }\n\n /**\n * Hide centered div\n */\n hide() {\n const _this = this;\n\n const hide = function() {\n _this.domElement.style.display = 'none';\n _this.backgroundElement.style.display = 'none';\n\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\n dom.unbind(_this.domElement, 'transitionend', hide);\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\n };\n\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\n dom.bind(this.domElement, 'transitionend', hide);\n dom.bind(this.domElement, 'oTransitionEnd', hide);\n\n this.backgroundElement.style.opacity = 0;\n// this.domElement.style.top = '48%';\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n }\n\n layout() {\n this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px';\n this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px';\n }\n}\n\nexport default CenteredDiv;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/CenteredDiv.js","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".dg {\\n /** Clear list styles */\\n /* Auto-place container */\\n /* Auto-placed GUI's */\\n /* Line items that don't contain folders. */\\n /** Folder names */\\n /** Hides closed items */\\n /** Controller row */\\n /** Name-half (left) */\\n /** Controller-half (right) */\\n /** Controller placement */\\n /** Shorter number boxes when slider is present. */\\n /** Ensure the entire boolean and function row shows a hand */\\n /** allow overflow for color selector */ }\\n .dg ul {\\n list-style: none;\\n margin: 0;\\n padding: 0;\\n width: 100%;\\n clear: both; }\\n .dg.ac {\\n position: fixed;\\n top: 0;\\n left: 0;\\n right: 0;\\n height: 0;\\n z-index: 0; }\\n .dg:not(.ac) .main {\\n /** Exclude mains in ac so that we don't hide close button */\\n overflow: hidden; }\\n .dg.main {\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear; }\\n .dg.main.taller-than-window {\\n overflow-y: auto; }\\n .dg.main.taller-than-window .close-button {\\n opacity: 1;\\n /* TODO, these are style notes */\\n margin-top: -1px;\\n border-top: 1px solid #2c2c2c; }\\n .dg.main ul.closed .close-button {\\n opacity: 1 !important; }\\n .dg.main:hover .close-button,\\n .dg.main .close-button.drag {\\n opacity: 1; }\\n .dg.main .close-button {\\n /*opacity: 0;*/\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear;\\n border: 0;\\n line-height: 19px;\\n height: 20px;\\n /* TODO, these are style notes */\\n cursor: pointer;\\n text-align: center;\\n background-color: #000; }\\n .dg.main .close-button.close-top {\\n position: relative; }\\n .dg.main .close-button.close-bottom {\\n position: absolute; }\\n .dg.main .close-button:hover {\\n background-color: #111; }\\n .dg.a {\\n float: right;\\n margin-right: 15px;\\n overflow-y: visible; }\\n .dg.a.has-save > ul.close-top {\\n margin-top: 0; }\\n .dg.a.has-save > ul.close-bottom {\\n margin-top: 27px; }\\n .dg.a.has-save > ul.closed {\\n margin-top: 0; }\\n .dg.a .save-row {\\n top: 0;\\n z-index: 1002; }\\n .dg.a .save-row.close-top {\\n position: relative; }\\n .dg.a .save-row.close-bottom {\\n position: fixed; }\\n .dg li {\\n -webkit-transition: height 0.1s ease-out;\\n -o-transition: height 0.1s ease-out;\\n -moz-transition: height 0.1s ease-out;\\n transition: height 0.1s ease-out;\\n -webkit-transition: overflow 0.1s linear;\\n -o-transition: overflow 0.1s linear;\\n -moz-transition: overflow 0.1s linear;\\n transition: overflow 0.1s linear; }\\n .dg li:not(.folder) {\\n cursor: auto;\\n height: 27px;\\n line-height: 27px;\\n padding: 0 4px 0 5px; }\\n .dg li.folder {\\n padding: 0;\\n border-left: 4px solid transparent; }\\n .dg li.title {\\n cursor: pointer;\\n margin-left: -4px; }\\n .dg .closed li:not(.title),\\n .dg .closed ul li,\\n .dg .closed ul li > * {\\n height: 0;\\n overflow: hidden;\\n border: 0; }\\n .dg .cr {\\n clear: both;\\n padding-left: 3px;\\n height: 27px;\\n overflow: hidden; }\\n .dg .property-name {\\n cursor: default;\\n float: left;\\n clear: left;\\n width: 40%;\\n overflow: hidden;\\n text-overflow: ellipsis; }\\n .dg .c {\\n float: left;\\n width: 60%;\\n position: relative; }\\n .dg .c input[type=text] {\\n border: 0;\\n margin-top: 4px;\\n padding: 3px;\\n width: 100%;\\n float: right; }\\n .dg .has-slider input[type=text] {\\n width: 30%;\\n /*display: none;*/\\n margin-left: 0; }\\n .dg .slider {\\n float: left;\\n width: 66%;\\n margin-left: -5px;\\n margin-right: 0;\\n height: 19px;\\n margin-top: 4px; }\\n .dg .slider-fg {\\n height: 100%; }\\n .dg .c input[type=checkbox] {\\n margin-top: 7px; }\\n .dg .c select {\\n margin-top: 5px; }\\n .dg .cr.function,\\n .dg .cr.function .property-name,\\n .dg .cr.function *,\\n .dg .cr.boolean,\\n .dg .cr.boolean * {\\n cursor: pointer; }\\n .dg .cr.color {\\n overflow: visible; }\\n .dg .selector {\\n display: none;\\n position: absolute;\\n margin-left: -9px;\\n margin-top: 23px;\\n z-index: 10; }\\n .dg .c:hover .selector,\\n .dg .selector.drag {\\n display: block; }\\n .dg li.save-row {\\n padding: 0; }\\n .dg li.save-row .button {\\n display: inline-block;\\n padding: 0px 6px; }\\n .dg.dialogue {\\n background-color: #222;\\n width: 460px;\\n padding: 15px;\\n font-size: 13px;\\n line-height: 15px; }\\n\\n/* TODO Separate style and structure */\\n#dg-new-constructor {\\n padding: 10px;\\n color: #222;\\n font-family: Monaco, monospace;\\n font-size: 10px;\\n border: 0;\\n resize: none;\\n box-shadow: inset 1px 1px 1px #888;\\n word-wrap: break-word;\\n margin: 12px 0;\\n display: block;\\n width: 440px;\\n overflow-y: scroll;\\n height: 100px;\\n position: relative; }\\n\\n#dg-local-explain {\\n display: none;\\n font-size: 11px;\\n line-height: 17px;\\n border-radius: 3px;\\n background-color: #333;\\n padding: 8px;\\n margin-top: 10px; }\\n #dg-local-explain code {\\n font-size: 10px; }\\n\\n#dat-gui-save-locally {\\n display: none; }\\n\\n/** Main type */\\n.dg {\\n color: #eee;\\n font: 11px 'Lucida Grande', sans-serif;\\n text-shadow: 0 -1px 0 #111;\\n /** Auto place */\\n /* Controller row,
  • */\\n /** Controllers */ }\\n .dg.main {\\n /** Scrollbar */ }\\n .dg.main::-webkit-scrollbar {\\n width: 5px;\\n background: #1a1a1a; }\\n .dg.main::-webkit-scrollbar-corner {\\n height: 0;\\n display: none; }\\n .dg.main::-webkit-scrollbar-thumb {\\n border-radius: 5px;\\n background: #676767; }\\n .dg li:not(.folder) {\\n background: #1a1a1a;\\n border-bottom: 1px solid #2c2c2c; }\\n .dg li.save-row {\\n line-height: 25px;\\n background: #dad5cb;\\n border: 0; }\\n .dg li.save-row select {\\n margin-left: 5px;\\n width: 108px; }\\n .dg li.save-row .button {\\n margin-left: 5px;\\n margin-top: 1px;\\n border-radius: 2px;\\n font-size: 9px;\\n line-height: 7px;\\n padding: 4px 4px 5px 4px;\\n background: #c5bdad;\\n color: #fff;\\n text-shadow: 0 1px 0 #b0a58f;\\n box-shadow: 0 -1px 0 #b0a58f;\\n cursor: pointer; }\\n .dg li.save-row .button.gears {\\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\\n height: 7px;\\n width: 8px; }\\n .dg li.save-row .button:hover {\\n background-color: #bab19e;\\n box-shadow: 0 -1px 0 #b0a58f; }\\n .dg li.folder {\\n border-bottom: 0; }\\n .dg li.title {\\n padding-left: 16px;\\n background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\\n cursor: pointer;\\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\\n .dg .closed li.title {\\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\\n .dg .cr.boolean {\\n border-left: 3px solid #806787; }\\n .dg .cr.color {\\n border-left: 3px solid; }\\n .dg .cr.function {\\n border-left: 3px solid #e61d5f; }\\n .dg .cr.number {\\n border-left: 3px solid #2FA1D6; }\\n .dg .cr.number input[type=text] {\\n color: #2FA1D6; }\\n .dg .cr.string {\\n border-left: 3px solid #1ed36f; }\\n .dg .cr.string input[type=text] {\\n color: #1ed36f; }\\n .dg .cr.function:hover, .dg .cr.boolean:hover {\\n background: #111; }\\n .dg .c input[type=text] {\\n background: #303030;\\n outline: none; }\\n .dg .c input[type=text]:hover {\\n background: #3c3c3c; }\\n .dg .c input[type=text]:focus {\\n background: #494949;\\n color: #fff; }\\n .dg .c .slider {\\n background: #303030;\\n cursor: ew-resize; }\\n .dg .c .slider-fg {\\n background: #2FA1D6;\\n max-width: 100%; }\\n .dg .c .slider:hover {\\n background: #3c3c3c; }\\n .dg .c .slider:hover .slider-fg {\\n background: #44abda; }\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/style.scss\n// module id = 23\n// module chunks = 0","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/css-loader/lib/css-base.js\n// module id = 24\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 535dd16febcd8f0d91bf","webpack:///../index.js","webpack:///./dat/index.js","webpack:///./dat/color/Color.js","webpack:///./dat/color/interpret.js","webpack:///./dat/color/toString.js","webpack:///./dat/utils/common.js","webpack:///./dat/color/math.js","webpack:///./dat/controllers/Controller.js","webpack:///./dat/controllers/BooleanController.js","webpack:///./dat/dom/dom.js","webpack:///./dat/controllers/OptionController.js","webpack:///./dat/controllers/StringController.js","webpack:///./dat/controllers/NumberController.js","webpack:///./dat/controllers/NumberControllerBox.js","webpack:///./dat/controllers/NumberControllerSlider.js","webpack:///./dat/controllers/FunctionController.js","webpack:///./dat/controllers/ColorController.js","webpack:///./dat/gui/GUI.js","webpack:///./dat/utils/css.js","webpack:///./dat/gui/saveDialogue.html","webpack:///./dat/controllers/ControllerFactory.js","webpack:///./dat/utils/requestAnimationFrame.js","webpack:///./dat/dom/CenteredDiv.js","webpack:///./dat/gui/style.scss","webpack:///../~/css-loader/lib/css-base.js"],"names":["color","Color","math","interpret","controllers","Controller","BooleanController","OptionController","StringController","NumberController","NumberControllerBox","NumberControllerSlider","FunctionController","ColorController","dom","gui","GUI","__state","apply","arguments","Error","a","toString","toHexString","toOriginal","conversion","write","defineRGBComponent","target","component","componentHexIndex","Object","defineProperty","get","space","recalculateRGB","set","v","defineHSVComponent","recalculateHSV","component_from_hex","hex","extend","hsv_to_rgb","h","s","result","rgb_to_hsv","r","g","b","isNaN","isUndefined","COMPONENTS","prototype","rgb_to_hex","INTERPRETATIONS","litmus","isString","conversions","THREE_CHAR_HEX","read","original","test","match","parseInt","SIX_CHAR_HEX","CSS_RGB","parseFloat","CSS_RGBA","isNumber","HEX","conversionName","isArray","RGB_ARRAY","length","RGBA_ARRAY","isObject","RGBA_OBJ","RGB_OBJ","HSVA_OBJ","HSV_OBJ","toReturn","toArray","each","family","BREAK","forceCSSHex","colorFormat","Math","round","toFixed","str","ARR_EACH","Array","forEach","ARR_SLICE","slice","Common","call","obj","keys","key","bind","defaults","compose","toCall","args","i","itr","scope","l","defer","fnc","setTimeout","debounce","func","threshold","callImmediately","timeout","delayed","callNow","clearTimeout","undefined","isNull","constructor","isBoolean","isFunction","tmpComponent","ColorMath","hi","floor","f","p","q","t","c","min","max","delta","NaN","hex_with_component","componentIndex","value","object","property","initialValue","domElement","document","createElement","__onChange","__onFinishChange","onChange","onFinishChange","setValue","newValue","updateDisplay","getValue","isModified","_this","__prev","__checkbox","setAttribute","appendChild","checked","EVENT_MAP","HTMLEvents","MouseEvents","KeyboardEvents","EVENT_MAP_INV","k","e","CSS_VALUE_PIXELS","cssValueToPixels","val","makeSelectable","elem","selectable","style","onselectstart","MozUserSelect","KhtmlUserSelect","unselectable","makeFullscreen","hor","vert","vertical","horizontal","position","left","right","top","bottom","fakeEvent","eventType","pars","aux","params","className","evt","createEvent","clientX","x","clientY","y","initMouseEvent","bubbles","cancelable","window","clickCount","init","initKeyboardEvent","initKeyEvent","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode","initEvent","dispatchEvent","event","newBool","bool","addEventListener","attachEvent","unbind","removeEventListener","detachEvent","addClass","classes","split","indexOf","push","join","replace","removeClass","removeAttribute","index","splice","hasClass","RegExp","getWidth","getComputedStyle","width","getHeight","height","getOffset","el","offset","offsetParent","offsetLeft","offsetTop","isActive","activeElement","type","href","opts","options","__select","map","element","opt","innerHTML","desiredValue","selectedIndex","__input","onBlur","blur","numDecimals","_x","_params","__min","__max","__step","step","__impliedStep","pow","log","abs","LN10","__precision","_v","minValue","maxValue","stepValue","roundToDecimal","decimals","tenTo","__truncationSuspended","prevY","mousewheelevt","navigator","userAgent","onMouseWheel","deltaY","wheelDelta","detail","preventDefault","attempted","onFinish","onMouseDrag","diff","onMouseUp","onMouseDown","i1","i2","o1","o2","__background","__foreground","bgRect","getBoundingClientRect","pct","text","__button","fire","__color","__temp","__selector","__saturation_field","__field_knob","__field_knob_border","__hue_knob","__hue_field","__input_textShadow","valueField","padding","backgroundColor","boxShadow","border","borderRadius","zIndex","borderRight","marginRight","display","cursor","background","linearGradient","hueGradient","outline","textAlign","fontWeight","textShadow","fieldDown","setH","fieldUpH","setSV","fieldUpSV","fieldRect","mismatch","flip","_flip","marginLeft","marginTop","vendors","vendor","cssText","inject","CSS_NAMESPACE","HIDE_KEY_CODE","CLOSE_BUTTON_HEIGHT","DEFAULT_DEFAULT_PRESET_NAME","SUPPORTS_LOCAL_STORAGE","localStorage","SAVE_DIALOGUE","autoPlaceVirgin","autoPlaceContainer","hide","hideableGuis","__ul","__folders","__controllers","__rememberedObjects","__rememberedObjectIndecesToControllers","__listening","closeOnTop","autoPlace","DEFAULT_WIDTH","resizable","hideable","load","preset","parent","scrollable","useLocalStorage","getItem","getLocalStorageHash","saveToLocalStorage","defineProperties","getRoot","setPresetSelectIndex","revert","setWidth","name","titleRowName","closed","CLASS_CLOSED","onResize","__closeButton","TEXT_OPEN","TEXT_CLOSED","setItem","CLASS_MAIN","savedGui","JSON","parse","CLASS_CLOSE_BUTTON","CLASS_CLOSE_TOP","insertBefore","childNodes","CLASS_CLOSE_BOTTOM","createTextNode","titleRow","addRow","onClickTitle","CLASS_AUTO_PLACE_CONTAINER","body","CLASS_AUTO_PLACE","__resizeHandler","onResizeDebounced","addResizeHandle","stringify","getSaveObject","saveToLocalStorageIfPossible","resetWidth","root","toggleHide","CLASS_CONTROLLER_ROW","CLASS_TOO_TALL","CLASS_DRAG","_keydownHandler","which","add","factoryArgs","addColor","remove","controller","removeChild","__li","destroy","addFolder","newGuiParams","folders","li","open","close","node","__save_row","innerHeight","__resize_handle","offsetHeight","remember","addSaveMenu","remembered","getCurrentPreset","save","markPresetModified","saveAs","presetName","addPresetOption","recallSavedValue","folder","listen","updateDisplays","newDom","liBefore","modified","__preset_select","augmentController","__gui","nextSibling","nextElementSibling","before","firstElementChild","box","method","pc","pb","returned","oldName","wasListening","newController","stopPropagation","borderLeftColor","matchedIndex","controllerMap","presetMap","concat","container","location","setSelected","showHideExplain","explain","div","firstChild","gears","button","button2","button3","select","getElementById","localStorageCheckBox","saveLocally","newConstructorTextArea","show","focus","prompt","pmouseX","drag","dragStop","dragStart","w","useInitialValues","savedValues","controllerArray","module","exports","url","indoc","doc","link","rel","getElementsByTagName","css","injected","head","ControllerFactory","requestAnimationFrame","callback","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","CenteredDiv","backgroundElement","opacity","WebkitTransition","transition","webkitTransform","layout","innerWidth"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;ACzBA;;;;;;oCAbA;;;;;;;;;;;;;;;;;;;;;;;ACaA;;;;AACA;;;;AACA;;;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AAEA;;;;AACA;;;;;;AA5BA;;;;;;;;;;;;;mBA8Be;AACbA,UAAO;AACLC,2BADK;AAELC,yBAFK;AAGLC;AAHK,IADM;;AAObC,gBAAa;AACXC,qCADW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,0BAA0B,uCAAuC,EAAE,qBAAqB,wBAAwB,0BAA0B,gBAAgB,EAAE,8BAA8B,yBAAyB,qBAAqB,EAAE,+BAA+B,yBAAyB,wBAAwB,2BAA2B,uBAAuB,yBAAyB,iCAAiC,4BAA4B,oBAAoB,qCAAqC,qCAAqC,wBAAwB,EAAE,uCAAuC,iDAAiD,mfAAmf,sBAAsB,qBAAqB,EAAE,uCAAuC,oCAAoC,uCAAuC,EAAE,mBAAmB,uBAAuB,EAAE,kBAAkB,yBAAyB,0CAA0C,wGAAwG,sBAAsB,wDAAwD,EAAE,0BAA0B,2CAA2C,qFAAqF,EAAE,qBAAqB,qCAAqC,EAAE,mBAAmB,6BAA6B,EAAE,sBAAsB,qCAAqC,EAAE,oBAAoB,qCAAqC,EAAE,uCAAuC,uBAAuB,EAAE,oBAAoB,qCAAqC,EAAE,uCAAuC,uBAAuB,EAAE,mDAAmD,uBAAuB,EAAE,6BAA6B,0BAA0B,oBAAoB,EAAE,qCAAqC,4BAA4B,EAAE,qCAAqC,4BAA4B,oBAAoB,EAAE,oBAAoB,0BAA0B,wBAAwB,EAAE,uBAAuB,0BAA0B,sBAAsB,EAAE,0BAA0B,0BAA0B,EAAE,uCAAuC,4BAA4B,EAAE;;AAErhR;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAgB,iBAAiB;AACjC;AACA;AACA,yCAAwC,gBAAgB;AACxD,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,aAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"dat.gui.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dat\"] = factory();\n\telse\n\t\troot[\"dat\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 535dd16febcd8f0d91bf","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dat from './src/dat/index';\n\nexport default dat;\n\n\n\n// WEBPACK FOOTER //\n// ../index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Color from './color/Color';\nimport math from './color/math';\nimport interpret from './color/interpret';\n\nimport Controller from './controllers/Controller';\nimport BooleanController from './controllers/BooleanController';\nimport OptionController from './controllers/OptionController';\nimport StringController from './controllers/StringController';\nimport NumberController from './controllers/NumberController';\nimport NumberControllerBox from './controllers/NumberControllerBox';\nimport NumberControllerSlider from './controllers/NumberControllerSlider';\nimport FunctionController from './controllers/FunctionController';\nimport ColorController from './controllers/ColorController';\n\nimport dom from './dom/dom';\nimport GUI from './gui/GUI';\n\nexport default {\n color: {\n Color: Color,\n math: math,\n interpret: interpret\n },\n\n controllers: {\n Controller: Controller,\n BooleanController: BooleanController,\n OptionController: OptionController,\n StringController: StringController,\n NumberController: NumberController,\n NumberControllerBox: NumberControllerBox,\n NumberControllerSlider: NumberControllerSlider,\n FunctionController: FunctionController,\n ColorController: ColorController\n },\n\n dom: {\n dom: dom\n },\n\n gui: {\n GUI: GUI\n },\n\n GUI: GUI\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport interpret from './interpret';\nimport math from './math';\nimport colorToString from './toString';\nimport common from '../utils/common';\n\nclass Color {\n constructor() {\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw new Error('Failed to interpret color arguments');\n }\n\n this.__state.a = this.__state.a || 1;\n }\n\n toString() {\n return colorToString(this);\n }\n\n toHexString() {\n return colorToString(this, true);\n }\n\n toOriginal() {\n return this.__state.conversion.write(this);\n }\n}\n\nfunction defineRGBComponent(target, component, componentHexIndex) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n Color.recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'RGB') {\n Color.recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\nfunction defineHSVComponent(target, component) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'HSV') {\n return this.__state[component];\n }\n\n Color.recalculateHSV(this);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'HSV') {\n Color.recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\n\nColor.recalculateRGB = function(color, component, componentHexIndex) {\n if (color.__state.space === 'HEX') {\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n } else if (color.__state.space === 'HSV') {\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n } else {\n throw new Error('Corrupted color state');\n }\n};\n\nColor.recalculateHSV = function(color) {\n const result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n};\n\nColor.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a'];\n\ndefineRGBComponent(Color.prototype, 'r', 2);\ndefineRGBComponent(Color.prototype, 'g', 1);\ndefineRGBComponent(Color.prototype, 'b', 0);\n\ndefineHSVComponent(Color.prototype, 'h');\ndefineHSVComponent(Color.prototype, 's');\ndefineHSVComponent(Color.prototype, 'v');\n\nObject.defineProperty(Color.prototype, 'a', {\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n});\n\nObject.defineProperty(Color.prototype, 'hex', {\n get: function() {\n if (!this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n }\n\n return this.__state.hex;\n },\n\n set: function(v) {\n this.__state.space = 'HEX';\n this.__state.hex = v;\n }\n});\n\nexport default Color;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/Color.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport toString from './toString';\nimport common from '../utils/common';\n\nconst INTERPRETATIONS = [\n // Strings\n {\n litmus: common.isString,\n conversions: {\n THREE_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt(\n '0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString(), 0)\n };\n },\n\n write: toString\n },\n\n SIX_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString(), 0)\n };\n },\n\n write: toString\n },\n\n CSS_RGB: {\n read: function(original) {\n const test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n },\n\n write: toString\n },\n\n CSS_RGBA: {\n read: function(original) {\n const test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n },\n\n write: toString\n }\n }\n },\n\n // Numbers\n {\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n };\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n litmus: common.isArray,\n conversions: {\n RGB_ARRAY: {\n read: function(original) {\n if (original.length !== 3) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length !== 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n }\n }\n },\n\n // Objects\n {\n litmus: common.isObject,\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n };\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n };\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n };\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n };\n }\n }\n }\n }\n];\n\nlet result;\nlet toReturn;\n\nconst interpret = function() {\n toReturn = false;\n\n const original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n common.each(INTERPRETATIONS, function(family) {\n if (family.litmus(original)) {\n common.each(family.conversions, function(conversion, conversionName) {\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n }\n });\n\n return common.BREAK;\n }\n });\n\n return toReturn;\n};\n\nexport default interpret;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/interpret.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nexport default function(color, forceCSSHex) {\n const colorFormat = color.__state.conversionName.toString();\n\n const r = Math.round(color.r);\n const g = Math.round(color.g);\n const b = Math.round(color.b);\n const a = color.a;\n const h = Math.round(color.h);\n const s = color.s.toFixed(1);\n const v = color.v.toFixed(1);\n\n if (forceCSSHex || (colorFormat === 'THREE_CHAR_HEX') || (colorFormat === 'SIX_CHAR_HEX')) {\n let str = color.hex.toString(16);\n while (str.length < 6) {\n str = '0' + str;\n }\n return '#' + str;\n } else if (colorFormat === 'CSS_RGB') {\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n } else if (colorFormat === 'CSS_RGBA') {\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n } else if (colorFormat === 'HEX') {\n return '0x' + color.hex.toString(16);\n } else if (colorFormat === 'RGB_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ']';\n } else if (colorFormat === 'RGBA_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ',' + a + ']';\n } else if (colorFormat === 'RGB_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + '}';\n } else if (colorFormat === 'RGBA_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}';\n } else if (colorFormat === 'HSV_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + '}';\n } else if (colorFormat === 'HSVA_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}';\n }\n\n return 'unknown format';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/toString.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nconst ARR_EACH = Array.prototype.forEach;\nconst ARR_SLICE = Array.prototype.slice;\n\n/**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\nconst Common = {\n BREAK: {},\n\n extend: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (!this.isUndefined(obj[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n defaults: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (this.isUndefined(target[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n compose: function() {\n const toCall = ARR_SLICE.call(arguments);\n return function() {\n let args = ARR_SLICE.call(arguments);\n for (let i = toCall.length - 1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n };\n },\n\n each: function(obj, itr, scope) {\n if (!obj) {\n return;\n }\n\n if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) {\n obj.forEach(itr, scope);\n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n let key;\n let l;\n for (key = 0, l = obj.length; key < l; key++) {\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n } else {\n for (const key in obj) {\n if (itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n }\n },\n\n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n\n // if the function is called repeatedly, wait until threshold passes until we execute the function\n debounce: function(func, threshold, callImmediately) {\n let timeout;\n\n return function() {\n const obj = this;\n const args = arguments;\n function delayed() {\n timeout = null;\n if (!callImmediately) func.apply(obj, args);\n }\n\n const callNow = callImmediately || !timeout;\n\n clearTimeout(timeout);\n timeout = setTimeout(delayed, threshold);\n\n if (callNow) {\n func.apply(obj, args);\n }\n };\n },\n\n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n\n isNull: function(obj) {\n return obj === null;\n },\n\n isNaN: function(obj) {\n return isNaN(obj);\n },\n\n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n\n isObject: function(obj) {\n return obj === Object(obj);\n },\n\n isNumber: function(obj) {\n return obj === obj + 0;\n },\n\n isString: function(obj) {\n return obj === obj + '';\n },\n\n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n\n isFunction: function(obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n }\n\n};\n\nexport default Common;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/common.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nlet tmpComponent;\n\nconst ColorMath = {\n hsv_to_rgb: function(h, s, v) {\n const hi = Math.floor(h / 60) % 6;\n\n const f = h / 60 - Math.floor(h / 60);\n const p = v * (1.0 - s);\n const q = v * (1.0 - (f * s));\n const t = v * (1.0 - ((1.0 - f) * s));\n\n const c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n },\n\n rgb_to_hsv: function(r, g, b) {\n const min = Math.min(r, g, b);\n const max = Math.max(r, g, b);\n const delta = max - min;\n let h;\n let s;\n\n if (max !== 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n let hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~(0xFF << tmpComponent));\n }\n};\n\nexport default ColorMath;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/math.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/**\n * @class An \"abstract\" class that represents a given property of an object.\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass Controller {\n constructor(object, property) {\n this.initialValue = object[property];\n\n /**\n * Those who extend this class will put their DOM elements in here.\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n\n /**\n * The object to manipulate\n * @type {Object}\n */\n this.object = object;\n\n /**\n * The name of the property to manipulate\n * @type {String}\n */\n this.property = property;\n\n /**\n * The function to be called on change.\n * @type {Function}\n * @ignore\n */\n this.__onChange = undefined;\n\n /**\n * The function to be called on finishing change.\n * @type {Function}\n * @ignore\n */\n this.__onFinishChange = undefined;\n }\n\n /**\n * Specify that a function fire every time someone changes the value with\n * this Controller.\n *\n * @param {Function} fnc This function will be called whenever the value\n * is modified via this Controller.\n * @returns {Controller} this\n */\n onChange(fnc) {\n this.__onChange = fnc;\n return this;\n }\n\n /**\n * Specify that a function fire every time someone \"finishes\" changing\n * the value wih this Controller. Useful for values that change\n * incrementally like numbers or strings.\n *\n * @param {Function} fnc This function will be called whenever\n * someone \"finishes\" changing the value via this Controller.\n * @returns {Controller} this\n */\n onFinishChange(fnc) {\n this.__onFinishChange = fnc;\n return this;\n }\n\n /**\n * Change the value of object[property]\n *\n * @param {Object} newValue The new value of object[property]\n */\n setValue(newValue) {\n this.object[this.property] = newValue;\n if (this.__onChange) {\n this.__onChange.call(this, newValue);\n }\n\n this.updateDisplay();\n return this;\n }\n\n /**\n * Gets the value of object[property]\n *\n * @returns {Object} The current value of object[property]\n */\n getValue() {\n return this.object[this.property];\n }\n\n /**\n * Refreshes the visual display of a Controller in order to keep sync\n * with the object's current value.\n * @returns {Controller} this\n */\n updateDisplay() {\n return this;\n }\n\n /**\n * @returns {Boolean} true if the value has deviated from initialValue\n */\n isModified() {\n return this.initialValue !== this.getValue();\n }\n}\n\nexport default Controller;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/Controller.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a checkbox input to alter the boolean property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass BooleanController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n this.__prev = this.getValue();\n\n this.__checkbox = document.createElement('input');\n this.__checkbox.setAttribute('type', 'checkbox');\n\n function onChange() {\n _this.setValue(!_this.__prev);\n }\n\n dom.bind(this.__checkbox, 'change', onChange, false);\n\n this.domElement.appendChild(this.__checkbox);\n\n // Match original value\n this.updateDisplay();\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.__prev = this.getValue();\n return toReturn;\n }\n\n updateDisplay() {\n if (this.getValue() === true) {\n this.__checkbox.setAttribute('checked', 'checked');\n this.__checkbox.checked = true;\n this.__prev = true;\n } else {\n this.__checkbox.checked = false;\n this.__prev = false;\n }\n\n return super.updateDisplay();\n }\n}\n\nexport default BooleanController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/BooleanController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport common from '../utils/common';\n\nconst EVENT_MAP = {\n HTMLEvents: ['change'],\n MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],\n KeyboardEvents: ['keydown']\n};\n\nconst EVENT_MAP_INV = {};\ncommon.each(EVENT_MAP, function(v, k) {\n common.each(v, function(e) {\n EVENT_MAP_INV[e] = k;\n });\n});\n\nconst CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\n\nfunction cssValueToPixels(val) {\n if (val === '0' || common.isUndefined(val)) {\n return 0;\n }\n\n const match = val.match(CSS_VALUE_PIXELS);\n\n if (!common.isNull(match)) {\n return parseFloat(match[1]);\n }\n\n // TODO ...ems? %?\n\n return 0;\n}\n\n/**\n * @namespace\n * @member dat.dom\n */\nconst dom = {\n\n /**\n *\n * @param elem\n * @param selectable\n */\n makeSelectable: function(elem, selectable) {\n if (elem === undefined || elem.style === undefined) return;\n\n elem.onselectstart = selectable ? function() {\n return false;\n } : function() {\n };\n\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\n elem.unselectable = selectable ? 'on' : 'off';\n },\n\n /**\n *\n * @param elem\n * @param horizontal\n * @param vert\n */\n makeFullscreen: function(elem, hor, vert) {\n let vertical = vert;\n let horizontal = hor;\n\n if (common.isUndefined(horizontal)) {\n horizontal = true;\n }\n\n if (common.isUndefined(vertical)) {\n vertical = true;\n }\n\n elem.style.position = 'absolute';\n\n if (horizontal) {\n elem.style.left = 0;\n elem.style.right = 0;\n }\n if (vertical) {\n elem.style.top = 0;\n elem.style.bottom = 0;\n }\n },\n\n /**\n *\n * @param elem\n * @param eventType\n * @param params\n */\n fakeEvent: function(elem, eventType, pars, aux) {\n const params = pars || {};\n const className = EVENT_MAP_INV[eventType];\n if (!className) {\n throw new Error('Event type ' + eventType + ' not supported.');\n }\n const evt = document.createEvent(className);\n switch (className) {\n case 'MouseEvents':\n {\n const clientX = params.x || params.clientX || 0;\n const clientY = params.y || params.clientY || 0;\n evt.initMouseEvent(eventType, params.bubbles || false,\n params.cancelable || true, window, params.clickCount || 1,\n 0, // screen X\n 0, // screen Y\n clientX, // client X\n clientY, // client Y\n false, false, false, false, 0, null);\n break;\n }\n case 'KeyboardEvents':\n {\n const init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz\n common.defaults(params, {\n cancelable: true,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n keyCode: undefined,\n charCode: undefined\n });\n init(eventType, params.bubbles || false,\n params.cancelable, window,\n params.ctrlKey, params.altKey,\n params.shiftKey, params.metaKey,\n params.keyCode, params.charCode);\n break;\n }\n default:\n {\n evt.initEvent(eventType, params.bubbles || false, params.cancelable || true);\n break;\n }\n }\n common.defaults(evt, aux);\n elem.dispatchEvent(evt);\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n bind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.addEventListener) {\n elem.addEventListener(event, func, bool);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n unbind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.removeEventListener) {\n elem.removeEventListener(event, func, bool);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n addClass: function(elem, className) {\n if (elem.className === undefined) {\n elem.className = className;\n } else if (elem.className !== className) {\n const classes = elem.className.split(/ +/);\n if (classes.indexOf(className) === -1) {\n classes.push(className);\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\n }\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n removeClass: function(elem, className) {\n if (className) {\n if (elem.className === className) {\n elem.removeAttribute('class');\n } else {\n const classes = elem.className.split(/ +/);\n const index = classes.indexOf(className);\n if (index !== -1) {\n classes.splice(index, 1);\n elem.className = classes.join(' ');\n }\n }\n } else {\n elem.className = undefined;\n }\n return dom;\n },\n\n hasClass: function(elem, className) {\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\n },\n\n /**\n *\n * @param elem\n */\n getWidth: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-left-width']) +\n cssValueToPixels(style['border-right-width']) +\n cssValueToPixels(style['padding-left']) +\n cssValueToPixels(style['padding-right']) +\n cssValueToPixels(style.width);\n },\n\n /**\n *\n * @param elem\n */\n getHeight: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-top-width']) +\n cssValueToPixels(style['border-bottom-width']) +\n cssValueToPixels(style['padding-top']) +\n cssValueToPixels(style['padding-bottom']) +\n cssValueToPixels(style.height);\n },\n\n /**\n *\n * @param el\n */\n getOffset: function(el) {\n let elem = el;\n const offset = { left: 0, top: 0 };\n if (elem.offsetParent) {\n do {\n offset.left += elem.offsetLeft;\n offset.top += elem.offsetTop;\n elem = elem.offsetParent;\n } while (elem);\n }\n return offset;\n },\n\n // http://stackoverflow.com/posts/2684561/revisions\n /**\n *\n * @param elem\n */\n isActive: function(elem) {\n return elem === document.activeElement && (elem.type || elem.href);\n }\n\n};\n\nexport default dom;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/dom.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\n/**\n * @class Provides a select input to alter the property of an object, using a\n * list of accepted values.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object|string[]} options A map of labels to acceptable values, or\n * a list of acceptable string values.\n */\nclass OptionController extends Controller {\n constructor(object, property, opts) {\n super(object, property);\n\n let options = opts;\n\n const _this = this;\n\n /**\n * The drop down menu\n * @ignore\n */\n this.__select = document.createElement('select');\n\n if (common.isArray(options)) {\n const map = {};\n common.each(options, function(element) {\n map[element] = element;\n });\n options = map;\n }\n\n common.each(options, function(value, key) {\n const opt = document.createElement('option');\n opt.innerHTML = key;\n opt.setAttribute('value', value);\n _this.__select.appendChild(opt);\n });\n\n // Acknowledge original value\n this.updateDisplay();\n\n dom.bind(this.__select, 'change', function() {\n const desiredValue = this.options[this.selectedIndex].value;\n _this.setValue(desiredValue);\n });\n\n this.domElement.appendChild(this.__select);\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n return toReturn;\n }\n\n updateDisplay() {\n if (dom.isActive(this.__select)) return this; // prevent number from updating if user is trying to manually update\n this.__select.value = this.getValue();\n return super.updateDisplay();\n }\n}\n\nexport default OptionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/OptionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a text input to alter the string property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass StringController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n\n function onChange() {\n _this.setValue(_this.__input.value);\n }\n\n function onBlur() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n dom.bind(this.__input, 'keyup', onChange);\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) {\n this.blur();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n // Stops the caret from moving on account of:\n // keyup -> setValue -> updateDisplay\n if (!dom.isActive(this.__input)) {\n this.__input.value = this.getValue();\n }\n return super.updateDisplay();\n }\n}\n\nexport default StringController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/StringController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport common from '../utils/common';\n\nfunction numDecimals(x) {\n const _x = x.toString();\n if (_x.indexOf('.') > -1) {\n return _x.length - _x.indexOf('.') - 1;\n }\n\n return 0;\n}\n\n/**\n * @class Represents a given property of an object that is a number.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberController extends Controller {\n constructor(object, property, params) {\n super(object, property);\n\n const _params = params || {};\n\n this.__min = _params.min;\n this.__max = _params.max;\n this.__step = _params.step;\n\n if (common.isUndefined(this.__step)) {\n if (this.initialValue === 0) {\n this.__impliedStep = 1; // What are we, psychics?\n } else {\n // Hey Doug, check this out.\n this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(this.initialValue)) / Math.LN10)) / 10;\n }\n } else {\n this.__impliedStep = this.__step;\n }\n\n this.__precision = numDecimals(this.__impliedStep);\n }\n\n setValue(v) {\n let _v = v;\n\n if (this.__min !== undefined && _v < this.__min) {\n _v = this.__min;\n } else if (this.__max !== undefined && _v > this.__max) {\n _v = this.__max;\n }\n\n if (this.__step !== undefined && _v % this.__step !== 0) {\n _v = Math.round(_v / this.__step) * this.__step;\n }\n\n return super.setValue(_v);\n }\n\n /**\n * Specify a minimum value for object[property].\n *\n * @param {Number} minValue The minimum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n min(minValue) {\n this.__min = minValue;\n return this;\n }\n\n /**\n * Specify a maximum value for object[property].\n *\n * @param {Number} maxValue The maximum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n max(maxValue) {\n this.__max = maxValue;\n return this;\n }\n\n /**\n * Specify a step value that dat.controllers.NumberController\n * increments by.\n *\n * @param {Number} stepValue The step value for\n * dat.controllers.NumberController\n * @default if minimum and maximum specified increment is 1% of the\n * difference otherwise stepValue is 1\n * @returns {dat.controllers.NumberController} this\n */\n step(stepValue) {\n this.__step = stepValue;\n this.__impliedStep = stepValue;\n this.__precision = numDecimals(stepValue);\n return this;\n }\n}\n\nexport default NumberController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nfunction roundToDecimal(value, decimals) {\n const tenTo = Math.pow(10, decimals);\n return Math.round(value * tenTo) / tenTo;\n}\n\n/**\n * @class Represents a given property of an object that is a number and\n * provides an input element with which to manipulate it.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberControllerBox extends NumberController {\n constructor(object, property, params) {\n super(object, property, params);\n\n this.__truncationSuspended = false;\n\n const _this = this;\n\n /**\n * {Number} Previous mouse y position\n * @ignore\n */\n let prevY;\n\n const mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? 'DOMMouseScroll' : 'mousewheel';\n\n function onMouseWheel(e) {\n let value = _this.getValue();\n const delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1;\n e.preventDefault();\n\n if (delta < 0) value += _this.__impliedStep;\n else value -= _this.__impliedStep;\n _this.setValue(value);\n }\n\n function onChange() {\n const attempted = parseFloat(_this.__input.value);\n if (!common.isNaN(attempted)) {\n _this.setValue(attempted);\n }\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n function onBlur() {\n onFinish();\n }\n\n function onMouseDrag(e) {\n const diff = prevY - e.clientY;\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\n\n prevY = e.clientY;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n onFinish();\n }\n\n function onMouseDown(e) {\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n prevY = e.clientY;\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n // Makes it so manually specified values are not truncated.\n\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'mousedown', onMouseDown);\n dom.bind(this.__input, mousewheelevt, onMouseWheel);\n dom.bind(this.__input, 'keydown', function(e) {\n // When pressing enter, you can be as precise as you want.\n if (e.keyCode === 13) {\n _this.__truncationSuspended = true;\n this.blur();\n _this.__truncationSuspended = false;\n onFinish();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerBox;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerBox.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\n\nfunction map(v, i1, i2, o1, o2) {\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\n}\n\n/**\n * @class Represents a given property of an object that is a number, contains\n * a minimum and maximum, and provides a slider element with which to\n * manipulate it. It should be noted that the slider element is made up of\n * <div> tags, not the html5\n * <slider> element.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Number} minValue Minimum allowed value\n * @param {Number} maxValue Maximum allowed value\n * @param {Number} stepValue Increment by which to change value\n */\nclass NumberControllerSlider extends NumberController {\n constructor(object, property, min, max, step) {\n super(object, property, { min: min, max: max, step: step });\n\n const _this = this;\n\n this.__background = document.createElement('div');\n this.__foreground = document.createElement('div');\n\n dom.bind(this.__background, 'mousedown', onMouseDown);\n\n const mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? 'DOMMouseScroll' : 'mousewheel';\n dom.bind(this.__background, mousewheelevt, onMouseWheel);\n\n dom.addClass(this.__background, 'slider');\n dom.addClass(this.__foreground, 'slider-fg');\n\n function onMouseWheel(e) {\n let value = _this.getValue();\n const delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1;\n e.preventDefault();\n document.activeElement.blur();\n\n if (delta < 0) value += _this.__impliedStep;\n else value -= _this.__impliedStep;\n _this.setValue(value);\n }\n\n function onMouseDown(e) {\n document.activeElement.blur();\n\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n\n onMouseDrag(e);\n }\n\n function onMouseDrag(e) {\n e.preventDefault();\n\n const bgRect = _this.__background.getBoundingClientRect();\n\n _this.setValue(\n map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)\n );\n\n return false;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.__background.appendChild(this.__foreground);\n this.domElement.appendChild(this.__background);\n }\n\n updateDisplay() {\n const pct = (this.getValue() - this.__min) / (this.__max - this.__min);\n this.__foreground.style.width = pct * 100 + '%';\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerSlider.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a GUI interface to fire a specified method, a property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass FunctionController extends Controller {\n constructor(object, property, text) {\n super(object, property);\n\n const _this = this;\n\n this.__button = document.createElement('div');\n this.__button.innerHTML = text === undefined ? 'Fire' : text;\n\n dom.bind(this.__button, 'click', function(e) {\n e.preventDefault();\n _this.fire();\n return false;\n });\n\n dom.addClass(this.__button, 'button');\n\n this.domElement.appendChild(this.__button);\n }\n\n fire() {\n if (this.__onChange) {\n this.__onChange.call(this);\n }\n this.getValue().call(this.object);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n }\n}\n\nexport default FunctionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/FunctionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport Color from '../color/Color';\nimport interpret from '../color/interpret';\nimport common from '../utils/common';\n\n/**\n * @class Represents a given property of an object that is a color.\n * @param {Object} object\n * @param {string} property\n */\nclass ColorController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n this.__color = new Color(this.getValue());\n this.__temp = new Color(0);\n\n const _this = this;\n\n this.domElement = document.createElement('div');\n\n dom.makeSelectable(this.domElement, false);\n\n this.__selector = document.createElement('div');\n this.__selector.className = 'selector';\n\n this.__saturation_field = document.createElement('div');\n this.__saturation_field.className = 'saturation-field';\n\n this.__field_knob = document.createElement('div');\n this.__field_knob.className = 'field-knob';\n this.__field_knob_border = '2px solid ';\n\n this.__hue_knob = document.createElement('div');\n this.__hue_knob.className = 'hue-knob';\n\n this.__hue_field = document.createElement('div');\n this.__hue_field.className = 'hue-field';\n\n this.__input = document.createElement('input');\n this.__input.type = 'text';\n this.__input_textShadow = '0 1px 1px ';\n\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) { // on enter\n onBlur.call(this);\n }\n });\n\n dom.bind(this.__input, 'blur', onBlur);\n\n dom.bind(this.__selector, 'mousedown', function(/* e */) {\n dom\n .addClass(this, 'drag')\n .bind(window, 'mouseup', function(/* e */) {\n dom.removeClass(_this.__selector, 'drag');\n });\n });\n\n const valueField = document.createElement('div');\n\n common.extend(this.__selector.style, {\n width: '122px',\n height: '102px',\n padding: '3px',\n backgroundColor: '#222',\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\n });\n\n common.extend(this.__field_knob.style, {\n position: 'absolute',\n width: '12px',\n height: '12px',\n border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\n borderRadius: '12px',\n zIndex: 1\n });\n\n common.extend(this.__hue_knob.style, {\n position: 'absolute',\n width: '15px',\n height: '2px',\n borderRight: '4px solid #fff',\n zIndex: 1\n });\n\n common.extend(this.__saturation_field.style, {\n width: '100px',\n height: '100px',\n border: '1px solid #555',\n marginRight: '3px',\n display: 'inline-block',\n cursor: 'pointer'\n });\n\n common.extend(valueField.style, {\n width: '100%',\n height: '100%',\n background: 'none'\n });\n\n linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000');\n\n common.extend(this.__hue_field.style, {\n width: '15px',\n height: '100px',\n border: '1px solid #555',\n cursor: 'ns-resize',\n position: 'absolute',\n top: '3px',\n right: '3px'\n });\n\n hueGradient(this.__hue_field);\n\n common.extend(this.__input.style, {\n outline: 'none',\n// width: '120px',\n textAlign: 'center',\n// padding: '4px',\n// marginBottom: '6px',\n color: '#fff',\n border: 0,\n fontWeight: 'bold',\n textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'\n });\n\n dom.bind(this.__saturation_field, 'mousedown', fieldDown);\n dom.bind(this.__field_knob, 'mousedown', fieldDown);\n\n dom.bind(this.__hue_field, 'mousedown', function(e) {\n setH(e);\n dom.bind(window, 'mousemove', setH);\n dom.bind(window, 'mouseup', fieldUpH);\n });\n\n function fieldDown(e) {\n setSV(e);\n // document.body.style.cursor = 'none';\n dom.bind(window, 'mousemove', setSV);\n dom.bind(window, 'mouseup', fieldUpSV);\n }\n\n function fieldUpSV() {\n dom.unbind(window, 'mousemove', setSV);\n dom.unbind(window, 'mouseup', fieldUpSV);\n // document.body.style.cursor = 'default';\n onFinish();\n }\n\n function onBlur() {\n const i = interpret(this.value);\n if (i !== false) {\n _this.__color.__state = i;\n _this.setValue(_this.__color.toOriginal());\n } else {\n this.value = _this.__color.toString();\n }\n }\n\n function fieldUpH() {\n dom.unbind(window, 'mousemove', setH);\n dom.unbind(window, 'mouseup', fieldUpH);\n onFinish();\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.__color.toOriginal());\n }\n }\n\n this.__saturation_field.appendChild(valueField);\n this.__selector.appendChild(this.__field_knob);\n this.__selector.appendChild(this.__saturation_field);\n this.__selector.appendChild(this.__hue_field);\n this.__hue_field.appendChild(this.__hue_knob);\n\n this.domElement.appendChild(this.__input);\n this.domElement.appendChild(this.__selector);\n\n this.updateDisplay();\n\n function setSV(e) {\n e.preventDefault();\n\n const fieldRect = _this.__saturation_field.getBoundingClientRect();\n let s = (e.clientX - fieldRect.left) / (fieldRect.right - fieldRect.left);\n let v = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (v > 1) {\n v = 1;\n } else if (v < 0) {\n v = 0;\n }\n\n if (s > 1) {\n s = 1;\n } else if (s < 0) {\n s = 0;\n }\n\n _this.__color.v = v;\n _this.__color.s = s;\n\n _this.setValue(_this.__color.toOriginal());\n\n\n return false;\n }\n\n function setH(e) {\n e.preventDefault();\n\n const fieldRect = _this.__hue_field.getBoundingClientRect();\n let h = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (h > 1) {\n h = 1;\n } else if (h < 0) {\n h = 0;\n }\n\n _this.__color.h = h * 360;\n\n _this.setValue(_this.__color.toOriginal());\n\n return false;\n }\n }\n\n updateDisplay() {\n const i = interpret(this.getValue());\n\n if (i !== false) {\n let mismatch = false;\n\n // Check for mismatch on the interpreted value.\n\n common.each(Color.COMPONENTS, function(component) {\n if (!common.isUndefined(i[component]) && !common.isUndefined(this.__color.__state[component]) &&\n i[component] !== this.__color.__state[component]) {\n mismatch = true;\n return {}; // break\n }\n }, this);\n\n // If nothing diverges, we keep our previous values\n // for statefulness, otherwise we recalculate fresh\n if (mismatch) {\n common.extend(this.__color.__state, i);\n }\n }\n\n common.extend(this.__temp.__state, this.__color.__state);\n\n this.__temp.a = 1;\n\n const flip = (this.__color.v < 0.5 || this.__color.s > 0.5) ? 255 : 0;\n const _flip = 255 - flip;\n\n common.extend(this.__field_knob.style, {\n marginLeft: 100 * this.__color.s - 7 + 'px',\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\n backgroundColor: this.__temp.toHexString(),\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')'\n });\n\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px';\n\n this.__temp.s = 1;\n this.__temp.v = 1;\n\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString());\n\n this.__input.value = this.__color.toString();\n\n common.extend(this.__input.style, {\n backgroundColor: this.__color.toHexString(),\n color: 'rgb(' + flip + ',' + flip + ',' + flip + ')',\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)'\n });\n }\n}\n\nconst vendors = ['-moz-', '-o-', '-webkit-', '-ms-', ''];\n\nfunction linearGradient(elem, x, a, b) {\n elem.style.background = '';\n common.each(vendors, function(vendor) {\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); ';\n });\n}\n\nfunction hueGradient(elem) {\n elem.style.background = '';\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);';\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n}\n\nexport default ColorController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ColorController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport css from '../utils/css';\nimport saveDialogueContents from './saveDialogue.html';\nimport ControllerFactory from '../controllers/ControllerFactory';\nimport Controller from '../controllers/Controller';\nimport BooleanController from '../controllers/BooleanController';\nimport FunctionController from '../controllers/FunctionController';\nimport NumberControllerBox from '../controllers/NumberControllerBox';\nimport NumberControllerSlider from '../controllers/NumberControllerSlider';\nimport ColorController from '../controllers/ColorController';\nimport requestAnimationFrame from '../utils/requestAnimationFrame';\nimport CenteredDiv from '../dom/CenteredDiv';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nimport styleSheet from './style.scss'; // CSS to embed in build\n\ncss.inject(styleSheet);\n\n/** @ignore Outer-most className for GUI's */\nconst CSS_NAMESPACE = 'dg';\n\nconst HIDE_KEY_CODE = 72;\n\n/** @ignore The only value shared between the JS and SCSS. Use caution. */\nconst CLOSE_BUTTON_HEIGHT = 20;\n\nconst DEFAULT_DEFAULT_PRESET_NAME = 'Default';\n\nconst SUPPORTS_LOCAL_STORAGE = (function() {\n try {\n return 'localStorage' in window && window.localStorage !== null;\n } catch (e) {\n return false;\n }\n}());\n\nlet SAVE_DIALOGUE;\n\n/** @ignore Have we yet to create an autoPlace GUI? */\nlet autoPlaceVirgin = true;\n\n/** @ignore Fixed position div that auto place GUI's go inside */\nlet autoPlaceContainer;\n\n/** @ignore Are we hiding the GUI's ? */\nlet hide = false;\n\n/** @private GUI's which should be hidden */\nconst hideableGuis = [];\n\n/**\n * @class A lightweight controller library for JavaScript. It allows you to easily\n * manipulate variables and fire functions on the fly.\n *\n * @typicalname gui\n *\n * @example\n * // Creating a GUI with options.\n * var gui = new dat.GUI({name: 'My GUI'});\n *\n * @example\n * // Creating a GUI and a subfolder.\n * var gui = new dat.GUI();\n * var folder1 = gui.addFolder('Flow Field');\n *\n * @param {Object} [params]\n * @param {String} [params.name] The name of this GUI.\n * @param {Object} [params.load] JSON object representing the saved state of\n * this GUI.\n * @param {Boolean} [params.auto=true]\n * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.\n * @param {Boolean} [params.closed] If true, starts closed\n * @param {Boolean} [params.closeOnTop] If true, close/open button shows on top of the GUI\n */\nconst GUI = function(pars) {\n const _this = this;\n\n let params = pars || {};\n\n /**\n * Outermost DOM Element\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n this.__ul = document.createElement('ul');\n this.domElement.appendChild(this.__ul);\n\n dom.addClass(this.domElement, CSS_NAMESPACE);\n\n /**\n * Nested GUI's by name\n * @ignore\n */\n this.__folders = {};\n\n this.__controllers = [];\n\n /**\n * List of objects I'm remembering for save, only used in top level GUI\n * @ignore\n */\n this.__rememberedObjects = [];\n\n /**\n * Maps the index of remembered objects to a map of controllers, only used\n * in top level GUI.\n *\n * @private\n * @ignore\n *\n * @example\n * [\n * {\n * propertyName: Controller,\n * anotherPropertyName: Controller\n * },\n * {\n * propertyName: Controller\n * }\n * ]\n */\n this.__rememberedObjectIndecesToControllers = [];\n\n this.__listening = [];\n\n // Default parameters\n params = common.defaults(params, {\n closeOnTop: false,\n autoPlace: true,\n width: GUI.DEFAULT_WIDTH\n });\n\n params = common.defaults(params, {\n resizable: params.autoPlace,\n hideable: params.autoPlace\n });\n\n if (!common.isUndefined(params.load)) {\n // Explicit preset\n if (params.preset) {\n params.load.preset = params.preset;\n }\n } else {\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\n }\n\n if (common.isUndefined(params.parent) && params.hideable) {\n hideableGuis.push(this);\n }\n\n // Only root level GUI's are resizable.\n params.resizable = common.isUndefined(params.parent) && params.resizable;\n\n if (params.autoPlace && common.isUndefined(params.scrollable)) {\n params.scrollable = true;\n }\n// params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;\n\n // Not part of params because I don't want people passing this in via\n // constructor. Should be a 'remembered' value.\n let useLocalStorage =\n SUPPORTS_LOCAL_STORAGE &&\n localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\n\n let saveToLocalStorage;\n\n Object.defineProperties(this,\n /** @lends GUI.prototype */\n {\n /**\n * The parent GUI\n * @type dat.gui.GUI\n */\n parent: {\n get: function() {\n return params.parent;\n }\n },\n\n scrollable: {\n get: function() {\n return params.scrollable;\n }\n },\n\n /**\n * Handles GUI's element placement for you\n * @type Boolean\n */\n autoPlace: {\n get: function() {\n return params.autoPlace;\n }\n },\n\n /**\n * Handles GUI's position of open/close button\n * @type Boolean\n */\n closeOnTop: {\n get: function() {\n return params.closeOnTop;\n }\n },\n\n /**\n * The identifier for a set of saved values\n * @type String\n */\n preset: {\n get: function() {\n if (_this.parent) {\n return _this.getRoot().preset;\n }\n\n return params.load.preset;\n },\n\n set: function(v) {\n if (_this.parent) {\n _this.getRoot().preset = v;\n } else {\n params.load.preset = v;\n }\n setPresetSelectIndex(this);\n _this.revert();\n }\n },\n\n /**\n * The width of GUI element\n * @type Number\n */\n width: {\n get: function() {\n return params.width;\n },\n set: function(v) {\n params.width = v;\n setWidth(_this, v);\n }\n },\n\n /**\n * The name of GUI. Used for folders. i.e\n * a folder's name\n * @type String\n */\n name: {\n get: function() {\n return params.name;\n },\n set: function(v) {\n // TODO Check for collisions among sibling folders\n params.name = v;\n if (titleRowName) {\n titleRowName.innerHTML = params.name;\n }\n }\n },\n\n /**\n * Whether the GUI is collapsed or not\n * @type Boolean\n */\n closed: {\n get: function() {\n return params.closed;\n },\n set: function(v) {\n params.closed = v;\n if (params.closed) {\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\n } else {\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\n }\n // For browsers that aren't going to respect the CSS transition,\n // Lets just check our height against the window height right off\n // the bat.\n this.onResize();\n\n if (_this.__closeButton) {\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\n }\n }\n },\n\n /**\n * Contains all presets\n * @type Object\n */\n load: {\n get: function() {\n return params.load;\n }\n },\n\n /**\n * Determines whether or not to use localStorage as the means for\n * remembering\n * @type Boolean\n */\n useLocalStorage: {\n\n get: function() {\n return useLocalStorage;\n },\n set: function(bool) {\n if (SUPPORTS_LOCAL_STORAGE) {\n useLocalStorage = bool;\n if (bool) {\n dom.bind(window, 'unload', saveToLocalStorage);\n } else {\n dom.unbind(window, 'unload', saveToLocalStorage);\n }\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\n }\n }\n }\n });\n\n // Are we a root level GUI?\n if (common.isUndefined(params.parent)) {\n params.closed = false;\n\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\n dom.makeSelectable(this.domElement, false);\n\n // Are we supposed to be loading locally?\n if (SUPPORTS_LOCAL_STORAGE) {\n if (useLocalStorage) {\n _this.useLocalStorage = true;\n\n const savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\n\n if (savedGui) {\n params.load = JSON.parse(savedGui);\n }\n }\n }\n\n this.__closeButton = document.createElement('div');\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\n if (params.closeOnTop) {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP);\n this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]);\n } else {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM);\n this.domElement.appendChild(this.__closeButton);\n }\n\n dom.bind(this.__closeButton, 'click', function() {\n _this.closed = !_this.closed;\n });\n // Oh, you're a nested GUI!\n } else {\n if (params.closed === undefined) {\n params.closed = true;\n }\n\n const titleRowName = document.createTextNode(params.name);\n dom.addClass(titleRowName, 'controller-name');\n\n const titleRow = addRow(_this, titleRowName);\n\n const onClickTitle = function(e) {\n e.preventDefault();\n _this.closed = !_this.closed;\n return false;\n };\n\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\n\n dom.addClass(titleRow, 'title');\n dom.bind(titleRow, 'click', onClickTitle);\n\n if (!params.closed) {\n this.closed = false;\n }\n }\n\n if (params.autoPlace) {\n if (common.isUndefined(params.parent)) {\n if (autoPlaceVirgin) {\n autoPlaceContainer = document.createElement('div');\n dom.addClass(autoPlaceContainer, CSS_NAMESPACE);\n dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER);\n document.body.appendChild(autoPlaceContainer);\n autoPlaceVirgin = false;\n }\n\n // Put it in the dom for you.\n autoPlaceContainer.appendChild(this.domElement);\n\n // Apply the auto styles\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\n }\n\n\n // Make it not elastic.\n if (!this.parent) {\n setWidth(_this, params.width);\n }\n }\n\n this.__resizeHandler = function() {\n _this.onResizeDebounced();\n };\n\n dom.bind(window, 'resize', this.__resizeHandler);\n dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler);\n dom.bind(this.__ul, 'transitionend', this.__resizeHandler);\n dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler);\n this.onResize();\n\n if (params.resizable) {\n addResizeHandle(this);\n }\n\n saveToLocalStorage = function() {\n if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') {\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\n }\n };\n\n // expose this method publicly\n this.saveToLocalStorageIfPossible = saveToLocalStorage;\n\n function resetWidth() {\n const root = _this.getRoot();\n root.width += 1;\n common.defer(function() {\n root.width -= 1;\n });\n }\n\n if (!params.parent) {\n resetWidth();\n }\n};\n\nGUI.toggleHide = function() {\n hide = !hide;\n common.each(hideableGuis, function(gui) {\n gui.domElement.style.display = hide ? 'none' : '';\n });\n};\n\nGUI.CLASS_AUTO_PLACE = 'a';\nGUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\nGUI.CLASS_MAIN = 'main';\nGUI.CLASS_CONTROLLER_ROW = 'cr';\nGUI.CLASS_TOO_TALL = 'taller-than-window';\nGUI.CLASS_CLOSED = 'closed';\nGUI.CLASS_CLOSE_BUTTON = 'close-button';\nGUI.CLASS_CLOSE_TOP = 'close-top';\nGUI.CLASS_CLOSE_BOTTOM = 'close-bottom';\nGUI.CLASS_DRAG = 'drag';\n\nGUI.DEFAULT_WIDTH = 245;\nGUI.TEXT_CLOSED = 'Close Controls';\nGUI.TEXT_OPEN = 'Open Controls';\n\nGUI._keydownHandler = function(e) {\n if (document.activeElement.type !== 'text' &&\n (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) {\n GUI.toggleHide();\n }\n};\ndom.bind(window, 'keydown', GUI._keydownHandler, false);\n\ncommon.extend(\n GUI.prototype,\n\n /** @lends GUI.prototype */\n {\n\n /**\n * Adds a new {@link Controller} to the GUI. The type of controller created\n * is inferred from the initial value of object[property]. For\n * color properties, see {@link addColor}.\n *\n * @param {Object} object The object to be manipulated\n * @param {String} property The name of the property to be manipulated\n * @param {Number} [min] Minimum allowed value\n * @param {Number} [max] Maximum allowed value\n * @param {Number} [step] Increment by which to change value\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * // Add a string controller.\n * var person = {name: 'Sam'};\n * gui.add(person, 'name');\n *\n * @example\n * // Add a number controller slider.\n * var person = {age: 45};\n * gui.add(person, 'age', 0, 100);\n */\n add: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n factoryArgs: Array.prototype.slice.call(arguments, 2)\n }\n );\n },\n\n /**\n * Adds a new color controller to the GUI.\n *\n * @param object\n * @param property\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * var palette = {\n * color1: '#FF0000', // CSS string\n * color2: [ 0, 128, 255 ], // RGB array\n * color3: [ 0, 128, 255, 0.3 ], // RGB with alpha\n * color4: { h: 350, s: 0.9, v: 0.3 } // Hue, saturation, value\n * };\n * gui.addColor(palette, 'color1');\n * gui.addColor(palette, 'color2');\n * gui.addColor(palette, 'color3');\n * gui.addColor(palette, 'color4');\n */\n addColor: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n color: true\n }\n );\n },\n\n /**\n * Removes the given controller from the GUI.\n * @param {Controller} controller\n * @instance\n */\n remove: function(controller) {\n // TODO listening?\n this.__ul.removeChild(controller.__li);\n this.__controllers.splice(this.__controllers.indexOf(controller), 1);\n const _this = this;\n common.defer(function() {\n _this.onResize();\n });\n },\n\n /**\n * Removes the GUI from the document and unbinds all event listeners.\n * @instance\n */\n destroy: function() {\n if (this.autoPlace) {\n autoPlaceContainer.removeChild(this.domElement);\n }\n\n dom.unbind(window, 'keydown', GUI._keydownHandler, false);\n dom.unbind(window, 'resize', this.__resizeHandler);\n\n if (this.saveToLocalStorageIfPossible) {\n dom.unbind(window, 'unload', this.saveToLocalStorageIfPossible);\n }\n },\n\n /**\n * Creates a new subfolder GUI instance.\n * @param name\n * @returns {dat.gui.GUI} The new folder.\n * @throws {Error} if this GUI already has a folder by the specified\n * name\n * @instance\n */\n addFolder: function(name) {\n // We have to prevent collisions on names in order to have a key\n // by which to remember saved values\n if (this.__folders[name] !== undefined) {\n throw new Error('You already have a folder in this GUI by the' +\n ' name \"' + name + '\"');\n }\n\n const newGuiParams = { name: name, parent: this };\n\n // We need to pass down the autoPlace trait so that we can\n // attach event listeners to open/close folder actions to\n // ensure that a scrollbar appears if the window is too short.\n newGuiParams.autoPlace = this.autoPlace;\n\n // Do we have saved appearance data for this folder?\n if (this.load && // Anything loaded?\n this.load.folders && // Was my parent a dead-end?\n this.load.folders[name]) { // Did daddy remember me?\n // Start me closed if I was closed\n newGuiParams.closed = this.load.folders[name].closed;\n\n // Pass down the loaded data\n newGuiParams.load = this.load.folders[name];\n }\n\n const gui = new GUI(newGuiParams);\n this.__folders[name] = gui;\n\n const li = addRow(this, gui.domElement);\n dom.addClass(li, 'folder');\n return gui;\n },\n\n /**\n * Opens the GUI.\n */\n open: function() {\n this.closed = false;\n },\n\n /**\n * Closes the GUI.\n */\n close: function() {\n this.closed = true;\n },\n\n\n onResize: function() {\n // we debounce this function to prevent performance issues when rotating on tablet/mobile\n const root = this.getRoot();\n if (root.scrollable) {\n const top = dom.getOffset(root.__ul).top;\n let h = 0;\n\n common.each(root.__ul.childNodes, function(node) {\n if (!(root.autoPlace && node === root.__save_row)) {\n h += dom.getHeight(node);\n }\n });\n\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\n } else {\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = 'auto';\n }\n }\n\n if (root.__resize_handle) {\n common.defer(function() {\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\n });\n }\n\n if (root.__closeButton) {\n root.__closeButton.style.width = root.width + 'px';\n }\n },\n\n onResizeDebounced: common.debounce(function() { this.onResize(); }, 50),\n\n /**\n * Mark objects for saving. The order of these objects cannot change as\n * the GUI grows. When remembering new objects, append them to the end\n * of the list.\n *\n * @param {...Object} objects\n * @throws {Error} if not called on a top level GUI.\n * @instance\n * @ignore\n */\n remember: function() {\n if (common.isUndefined(SAVE_DIALOGUE)) {\n SAVE_DIALOGUE = new CenteredDiv();\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;\n }\n\n if (this.parent) {\n throw new Error('You can only call remember on a top level GUI.');\n }\n\n const _this = this;\n\n common.each(Array.prototype.slice.call(arguments), function(object) {\n if (_this.__rememberedObjects.length === 0) {\n addSaveMenu(_this);\n }\n if (_this.__rememberedObjects.indexOf(object) === -1) {\n _this.__rememberedObjects.push(object);\n }\n });\n\n if (this.autoPlace) {\n // Set save row width\n setWidth(this, this.width);\n }\n },\n\n /**\n * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.\n * @instance\n */\n getRoot: function() {\n let gui = this;\n while (gui.parent) {\n gui = gui.parent;\n }\n return gui;\n },\n\n /**\n * @returns {Object} a JSON object representing the current state of\n * this GUI as well as its remembered properties.\n * @instance\n */\n getSaveObject: function() {\n const toReturn = this.load;\n toReturn.closed = this.closed;\n\n // Am I remembering any values?\n if (this.__rememberedObjects.length > 0) {\n toReturn.preset = this.preset;\n\n if (!toReturn.remembered) {\n toReturn.remembered = {};\n }\n\n toReturn.remembered[this.preset] = getCurrentPreset(this);\n }\n\n toReturn.folders = {};\n common.each(this.__folders, function(element, key) {\n toReturn.folders[key] = element.getSaveObject();\n });\n\n return toReturn;\n },\n\n save: function() {\n if (!this.load.remembered) {\n this.load.remembered = {};\n }\n\n this.load.remembered[this.preset] = getCurrentPreset(this);\n markPresetModified(this, false);\n this.saveToLocalStorageIfPossible();\n },\n\n saveAs: function(presetName) {\n if (!this.load.remembered) {\n // Retain default values upon first save\n this.load.remembered = {};\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\n }\n\n this.load.remembered[presetName] = getCurrentPreset(this);\n this.preset = presetName;\n addPresetOption(this, presetName, true);\n this.saveToLocalStorageIfPossible();\n },\n\n revert: function(gui) {\n common.each(this.__controllers, function(controller) {\n // Make revert work on Default.\n if (!this.getRoot().load.remembered) {\n controller.setValue(controller.initialValue);\n } else {\n recallSavedValue(gui || this.getRoot(), controller);\n }\n\n // fire onFinishChange callback\n if (controller.__onFinishChange) {\n controller.__onFinishChange.call(controller, controller.getValue());\n }\n }, this);\n\n common.each(this.__folders, function(folder) {\n folder.revert(folder);\n });\n\n if (!gui) {\n markPresetModified(this.getRoot(), false);\n }\n },\n\n listen: function(controller) {\n const init = this.__listening.length === 0;\n this.__listening.push(controller);\n if (init) {\n updateDisplays(this.__listening);\n }\n },\n\n updateDisplay: function() {\n common.each(this.__controllers, function(controller) {\n controller.updateDisplay();\n });\n common.each(this.__folders, function(folder) {\n folder.updateDisplay();\n });\n }\n }\n);\n\n/**\n * Add a row to the end of the GUI or before another row.\n *\n * @param gui\n * @param [newDom] If specified, inserts the dom content in the new row\n * @param [liBefore] If specified, places the new row before another row\n *\n * @ignore\n */\nfunction addRow(gui, newDom, liBefore) {\n const li = document.createElement('li');\n if (newDom) {\n li.appendChild(newDom);\n }\n\n if (liBefore) {\n gui.__ul.insertBefore(li, liBefore);\n } else {\n gui.__ul.appendChild(li);\n }\n gui.onResize();\n return li;\n}\n\nfunction markPresetModified(gui, modified) {\n const opt = gui.__preset_select[gui.__preset_select.selectedIndex];\n\n // console.log('mark', modified, opt);\n if (modified) {\n opt.innerHTML = opt.value + '*';\n } else {\n opt.innerHTML = opt.value;\n }\n}\n\nfunction augmentController(gui, li, controller) {\n controller.__li = li;\n controller.__gui = gui;\n\n common.extend(controller, {\n options: function(options) {\n if (arguments.length > 1) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [common.toArray(arguments)]\n }\n );\n }\n\n if (common.isArray(options) || common.isObject(options)) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [options]\n }\n );\n }\n },\n\n name: function(v) {\n controller.__li.firstElementChild.firstElementChild.innerHTML = v;\n return controller;\n },\n\n listen: function() {\n controller.__gui.listen(controller);\n return controller;\n },\n\n remove: function() {\n controller.__gui.remove(controller);\n return controller;\n }\n });\n\n // All sliders should be accompanied by a box.\n if (controller instanceof NumberControllerSlider) {\n const box = new NumberControllerBox(controller.object, controller.property,\n { min: controller.__min, max: controller.__max, step: controller.__step });\n\n common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step'], function(method) {\n const pc = controller[method];\n const pb = box[method];\n controller[method] = box[method] = function() {\n const args = Array.prototype.slice.call(arguments);\n pb.apply(box, args);\n return pc.apply(controller, args);\n };\n });\n\n dom.addClass(li, 'has-slider');\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\n } else if (controller instanceof NumberControllerBox) {\n const r = function(returned) {\n // Have we defined both boundaries?\n if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {\n // Well, then lets just replace this with a slider.\n\n // lets remember if the old controller had a specific name or was listening\n const oldName = controller.__li.firstElementChild.firstElementChild.innerHTML;\n const wasListening = controller.__gui.__listening.indexOf(controller) > -1;\n\n controller.remove();\n const newController = add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [controller.__min, controller.__max, controller.__step]\n });\n\n newController.name(oldName);\n if (wasListening) newController.listen();\n\n return newController;\n }\n\n return returned;\n };\n\n controller.min = common.compose(r, controller.min);\n controller.max = common.compose(r, controller.max);\n } else if (controller instanceof BooleanController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__checkbox, 'click');\n });\n\n dom.bind(controller.__checkbox, 'click', function(e) {\n e.stopPropagation(); // Prevents double-toggle\n });\n } else if (controller instanceof FunctionController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__button, 'click');\n });\n\n dom.bind(li, 'mouseover', function() {\n dom.addClass(controller.__button, 'hover');\n });\n\n dom.bind(li, 'mouseout', function() {\n dom.removeClass(controller.__button, 'hover');\n });\n } else if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n controller.updateDisplay = common.compose(function(val) {\n li.style.borderLeftColor = controller.__color.toString();\n return val;\n }, controller.updateDisplay);\n\n controller.updateDisplay();\n }\n\n controller.setValue = common.compose(function(val) {\n if (gui.getRoot().__preset_select && controller.isModified()) {\n markPresetModified(gui.getRoot(), true);\n }\n\n return val;\n }, controller.setValue);\n}\n\nfunction recallSavedValue(gui, controller) {\n // Find the topmost GUI, that's where remembered objects live.\n const root = gui.getRoot();\n\n // Does the object we're controlling match anything we've been told to\n // remember?\n const matchedIndex = root.__rememberedObjects.indexOf(controller.object);\n\n // Why yes, it does!\n if (matchedIndex !== -1) {\n // Let me fetch a map of controllers for thcommon.isObject.\n let controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex];\n\n // Ohp, I believe this is the first controller we've created for this\n // object. Lets make the map fresh.\n if (controllerMap === undefined) {\n controllerMap = {};\n root.__rememberedObjectIndecesToControllers[matchedIndex] =\n controllerMap;\n }\n\n // Keep track of this controller\n controllerMap[controller.property] = controller;\n\n // Okay, now have we saved any values for this controller?\n if (root.load && root.load.remembered) {\n const presetMap = root.load.remembered;\n\n // Which preset are we trying to load?\n let preset;\n\n if (presetMap[gui.preset]) {\n preset = presetMap[gui.preset];\n } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) {\n // Uhh, you can have the default instead?\n preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME];\n } else {\n // Nada.\n return;\n }\n\n // Did the loaded object remember thcommon.isObject? && Did we remember this particular property?\n if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) {\n // We did remember something for this guy ...\n const value = preset[matchedIndex][controller.property];\n\n // And that's what it is.\n controller.initialValue = value;\n controller.setValue(value);\n }\n }\n }\n}\n\nfunction add(gui, object, property, params) {\n if (object[property] === undefined) {\n throw new Error(`Object \"${object}\" has no property \"${property}\"`);\n }\n\n let controller;\n\n if (params.color) {\n controller = new ColorController(object, property);\n } else {\n const factoryArgs = [object, property].concat(params.factoryArgs);\n controller = ControllerFactory.apply(gui, factoryArgs);\n }\n\n if (params.before instanceof Controller) {\n params.before = params.before.__li;\n }\n\n recallSavedValue(gui, controller);\n\n dom.addClass(controller.domElement, 'c');\n\n const name = document.createElement('span');\n dom.addClass(name, 'property-name');\n name.innerHTML = controller.property;\n\n const container = document.createElement('div');\n container.appendChild(name);\n container.appendChild(controller.domElement);\n\n const li = addRow(gui, container, params.before);\n\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\n if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n } else {\n dom.addClass(li, typeof controller.getValue());\n }\n\n augmentController(gui, li, controller);\n\n gui.__controllers.push(controller);\n\n return controller;\n}\n\nfunction getLocalStorageHash(gui, key) {\n // TODO how does this deal with multiple GUI's?\n return document.location.href + '.' + key;\n}\n\nfunction addPresetOption(gui, name, setSelected) {\n const opt = document.createElement('option');\n opt.innerHTML = name;\n opt.value = name;\n gui.__preset_select.appendChild(opt);\n if (setSelected) {\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\n }\n}\n\nfunction showHideExplain(gui, explain) {\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\n}\n\nfunction addSaveMenu(gui) {\n const div = gui.__save_row = document.createElement('li');\n\n dom.addClass(gui.domElement, 'has-save');\n\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\n\n dom.addClass(div, 'save-row');\n\n const gears = document.createElement('span');\n gears.innerHTML = ' ';\n dom.addClass(gears, 'button gears');\n\n // TODO replace with FunctionController\n const button = document.createElement('span');\n button.innerHTML = 'Save';\n dom.addClass(button, 'button');\n dom.addClass(button, 'save');\n\n const button2 = document.createElement('span');\n button2.innerHTML = 'New';\n dom.addClass(button2, 'button');\n dom.addClass(button2, 'save-as');\n\n const button3 = document.createElement('span');\n button3.innerHTML = 'Revert';\n dom.addClass(button3, 'button');\n dom.addClass(button3, 'revert');\n\n const select = gui.__preset_select = document.createElement('select');\n\n if (gui.load && gui.load.remembered) {\n common.each(gui.load.remembered, function(value, key) {\n addPresetOption(gui, key, key === gui.preset);\n });\n } else {\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\n }\n\n dom.bind(select, 'change', function() {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\n }\n\n gui.preset = this.value;\n });\n\n div.appendChild(select);\n div.appendChild(gears);\n div.appendChild(button);\n div.appendChild(button2);\n div.appendChild(button3);\n\n if (SUPPORTS_LOCAL_STORAGE) {\n const explain = document.getElementById('dg-local-explain');\n const localStorageCheckBox = document.getElementById('dg-local-storage');\n const saveLocally = document.getElementById('dg-save-locally');\n\n saveLocally.style.display = 'block';\n\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\n localStorageCheckBox.setAttribute('checked', 'checked');\n }\n\n showHideExplain(gui, explain);\n\n // TODO: Use a boolean controller, fool!\n dom.bind(localStorageCheckBox, 'change', function() {\n gui.useLocalStorage = !gui.useLocalStorage;\n showHideExplain(gui, explain);\n });\n }\n\n const newConstructorTextArea = document.getElementById('dg-new-constructor');\n\n dom.bind(newConstructorTextArea, 'keydown', function(e) {\n if (e.metaKey && (e.which === 67 || e.keyCode === 67)) {\n SAVE_DIALOGUE.hide();\n }\n });\n\n dom.bind(gears, 'click', function() {\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\n SAVE_DIALOGUE.show();\n newConstructorTextArea.focus();\n newConstructorTextArea.select();\n });\n\n dom.bind(button, 'click', function() {\n gui.save();\n });\n\n dom.bind(button2, 'click', function() {\n const presetName = prompt('Enter a new preset name.');\n if (presetName) {\n gui.saveAs(presetName);\n }\n });\n\n dom.bind(button3, 'click', function() {\n gui.revert();\n });\n\n // div.appendChild(button2);\n}\n\nfunction addResizeHandle(gui) {\n let pmouseX;\n\n gui.__resize_handle = document.createElement('div');\n\n common.extend(gui.__resize_handle.style, {\n\n width: '6px',\n marginLeft: '-3px',\n height: '200px',\n cursor: 'ew-resize',\n position: 'absolute'\n // border: '1px solid blue'\n\n });\n\n function drag(e) {\n e.preventDefault();\n\n gui.width += pmouseX - e.clientX;\n gui.onResize();\n pmouseX = e.clientX;\n\n return false;\n }\n\n function dragStop() {\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.unbind(window, 'mousemove', drag);\n dom.unbind(window, 'mouseup', dragStop);\n }\n\n function dragStart(e) {\n e.preventDefault();\n\n pmouseX = e.clientX;\n\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.bind(window, 'mousemove', drag);\n dom.bind(window, 'mouseup', dragStop);\n\n return false;\n }\n\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\n\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\n}\n\nfunction setWidth(gui, w) {\n gui.domElement.style.width = w + 'px';\n // Auto placed save-rows are position fixed, so we have to\n // set the width manually if we want it to bleed to the edge\n if (gui.__save_row && gui.autoPlace) {\n gui.__save_row.style.width = w + 'px';\n }\n if (gui.__closeButton) {\n gui.__closeButton.style.width = w + 'px';\n }\n}\n\nfunction getCurrentPreset(gui, useInitialValues) {\n const toReturn = {};\n\n // For each object I'm remembering\n common.each(gui.__rememberedObjects, function(val, index) {\n const savedValues = {};\n\n // The controllers I've made for thcommon.isObject by property\n const controllerMap =\n gui.__rememberedObjectIndecesToControllers[index];\n\n // Remember each value for each property\n common.each(controllerMap, function(controller, property) {\n savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue();\n });\n\n // Save the values for thcommon.isObject\n toReturn[index] = savedValues;\n });\n\n return toReturn;\n}\n\nfunction setPresetSelectIndex(gui) {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n if (gui.__preset_select[index].value === gui.preset) {\n gui.__preset_select.selectedIndex = index;\n }\n }\n}\n\nfunction updateDisplays(controllerArray) {\n if (controllerArray.length !== 0) {\n requestAnimationFrame.call(window, function() {\n updateDisplays(controllerArray);\n });\n }\n\n common.each(controllerArray, function(c) {\n c.updateDisplay();\n });\n}\n\nexport default GUI;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/gui/GUI.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nmodule.exports = {\n load: function(url, indoc) {\n const doc = indoc || document;\n const link = doc.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n doc.getElementsByTagName('head')[0].appendChild(link);\n },\n\n inject: function(css, indoc) {\n const doc = indoc || document;\n const injected = document.createElement('style');\n injected.type = 'text/css';\n injected.innerHTML = css;\n const head = doc.getElementsByTagName('head')[0];\n try {\n head.appendChild(injected);\n } catch (e) { // Unable to inject CSS, probably because of a Content Security Policy\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/css.js","module.exports = \"
    \\n\\n Here's the new load parameter for your GUI's constructor:\\n\\n \\n\\n
    \\n\\n Automatically save\\n values to localStorage on exit.\\n\\n
    The values saved to localStorage will\\n override those passed to dat.GUI's constructor. This makes it\\n easier to work incrementally, but localStorage is fragile,\\n and your friends may not see the same values you do.\\n\\n
    \\n\\n
    \\n\\n
    \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/saveDialogue.html\n// module id = 19\n// module chunks = 0","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport OptionController from './OptionController';\nimport NumberControllerBox from './NumberControllerBox';\nimport NumberControllerSlider from './NumberControllerSlider';\nimport StringController from './StringController';\nimport FunctionController from './FunctionController';\nimport BooleanController from './BooleanController';\nimport common from '../utils/common';\n\nconst ControllerFactory = function(object, property) {\n const initialValue = object[property];\n\n // Providing options?\n if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {\n return new OptionController(object, property, arguments[2]);\n }\n\n // Providing a map?\n if (common.isNumber(initialValue)) {\n // Has min and max? (slider)\n if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {\n // has step?\n if (common.isNumber(arguments[4])) {\n return new NumberControllerSlider(object, property,\n arguments[2], arguments[3], arguments[4]);\n }\n\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\n }\n\n // number box\n if (common.isNumber(arguments[4])) { // has step\n return new NumberControllerBox(object, property,\n { min: arguments[2], max: arguments[3], step: arguments[4] });\n }\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\n }\n\n if (common.isString(initialValue)) {\n return new StringController(object, property);\n }\n\n if (common.isFunction(initialValue)) {\n return new FunctionController(object, property, '');\n }\n\n if (common.isBoolean(initialValue)) {\n return new BooleanController(object, property);\n }\n\n return null;\n};\n\nexport default ControllerFactory;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ControllerFactory.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction requestAnimationFrame(callback) {\n setTimeout(callback, 1000 / 60);\n}\n\nexport default window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n requestAnimationFrame;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/requestAnimationFrame.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nclass CenteredDiv {\n constructor() {\n this.backgroundElement = document.createElement('div');\n common.extend(this.backgroundElement.style, {\n backgroundColor: 'rgba(0,0,0,0.8)',\n top: 0,\n left: 0,\n display: 'none',\n zIndex: '1000',\n opacity: 0,\n WebkitTransition: 'opacity 0.2s linear',\n transition: 'opacity 0.2s linear'\n });\n\n dom.makeFullscreen(this.backgroundElement);\n this.backgroundElement.style.position = 'fixed';\n\n this.domElement = document.createElement('div');\n common.extend(this.domElement.style, {\n position: 'fixed',\n display: 'none',\n zIndex: '1001',\n opacity: 0,\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',\n transition: 'transform 0.2s ease-out, opacity 0.2s linear'\n });\n\n\n document.body.appendChild(this.backgroundElement);\n document.body.appendChild(this.domElement);\n\n const _this = this;\n dom.bind(this.backgroundElement, 'click', function() {\n _this.hide();\n });\n }\n\n show() {\n const _this = this;\n\n this.backgroundElement.style.display = 'block';\n\n this.domElement.style.display = 'block';\n this.domElement.style.opacity = 0;\n// this.domElement.style.top = '52%';\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n this.layout();\n\n common.defer(function() {\n _this.backgroundElement.style.opacity = 1;\n _this.domElement.style.opacity = 1;\n _this.domElement.style.webkitTransform = 'scale(1)';\n });\n }\n\n /**\n * Hide centered div\n */\n hide() {\n const _this = this;\n\n const hide = function() {\n _this.domElement.style.display = 'none';\n _this.backgroundElement.style.display = 'none';\n\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\n dom.unbind(_this.domElement, 'transitionend', hide);\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\n };\n\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\n dom.bind(this.domElement, 'transitionend', hide);\n dom.bind(this.domElement, 'oTransitionEnd', hide);\n\n this.backgroundElement.style.opacity = 0;\n// this.domElement.style.top = '48%';\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n }\n\n layout() {\n this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px';\n this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px';\n }\n}\n\nexport default CenteredDiv;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/CenteredDiv.js","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".dg {\\n /** Clear list styles */\\n /* Auto-place container */\\n /* Auto-placed GUI's */\\n /* Line items that don't contain folders. */\\n /** Folder names */\\n /** Hides closed items */\\n /** Controller row */\\n /** Name-half (left) */\\n /** Controller-half (right) */\\n /** Controller placement */\\n /** Shorter number boxes when slider is present. */\\n /** Ensure the entire boolean and function row shows a hand */\\n /** allow overflow for color selector */ }\\n .dg ul {\\n list-style: none;\\n margin: 0;\\n padding: 0;\\n width: 100%;\\n clear: both; }\\n .dg.ac {\\n position: fixed;\\n top: 0;\\n left: 0;\\n right: 0;\\n height: 0;\\n z-index: 0; }\\n .dg:not(.ac) .main {\\n /** Exclude mains in ac so that we don't hide close button */\\n overflow: hidden; }\\n .dg.main {\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear; }\\n .dg.main.taller-than-window {\\n overflow-y: auto; }\\n .dg.main.taller-than-window .close-button {\\n opacity: 1;\\n /* TODO, these are style notes */\\n margin-top: -1px;\\n border-top: 1px solid #2c2c2c; }\\n .dg.main ul.closed .close-button {\\n opacity: 1 !important; }\\n .dg.main:hover .close-button,\\n .dg.main .close-button.drag {\\n opacity: 1; }\\n .dg.main .close-button {\\n /*opacity: 0;*/\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear;\\n border: 0;\\n line-height: 19px;\\n height: 20px;\\n /* TODO, these are style notes */\\n cursor: pointer;\\n text-align: center;\\n background-color: #000; }\\n .dg.main .close-button.close-top {\\n position: relative; }\\n .dg.main .close-button.close-bottom {\\n position: absolute; }\\n .dg.main .close-button:hover {\\n background-color: #111; }\\n .dg.a {\\n float: right;\\n margin-right: 15px;\\n overflow-y: visible; }\\n .dg.a.has-save > ul.close-top {\\n margin-top: 0; }\\n .dg.a.has-save > ul.close-bottom {\\n margin-top: 27px; }\\n .dg.a.has-save > ul.closed {\\n margin-top: 0; }\\n .dg.a .save-row {\\n top: 0;\\n z-index: 1002; }\\n .dg.a .save-row.close-top {\\n position: relative; }\\n .dg.a .save-row.close-bottom {\\n position: fixed; }\\n .dg li {\\n -webkit-transition: height 0.1s ease-out;\\n -o-transition: height 0.1s ease-out;\\n -moz-transition: height 0.1s ease-out;\\n transition: height 0.1s ease-out;\\n -webkit-transition: overflow 0.1s linear;\\n -o-transition: overflow 0.1s linear;\\n -moz-transition: overflow 0.1s linear;\\n transition: overflow 0.1s linear; }\\n .dg li:not(.folder) {\\n cursor: auto;\\n height: 27px;\\n line-height: 27px;\\n padding: 0 4px 0 5px; }\\n .dg li.folder {\\n padding: 0;\\n border-left: 4px solid transparent; }\\n .dg li.title {\\n cursor: pointer;\\n margin-left: -4px; }\\n .dg .closed li:not(.title),\\n .dg .closed ul li,\\n .dg .closed ul li > * {\\n height: 0;\\n overflow: hidden;\\n border: 0; }\\n .dg .cr {\\n clear: both;\\n padding-left: 3px;\\n height: 27px;\\n overflow: hidden; }\\n .dg .property-name {\\n cursor: default;\\n float: left;\\n clear: left;\\n width: 40%;\\n overflow: hidden;\\n text-overflow: ellipsis; }\\n .dg .c {\\n float: left;\\n width: 60%;\\n position: relative; }\\n .dg .c input[type=text] {\\n border: 0;\\n margin-top: 4px;\\n padding: 3px;\\n width: 100%;\\n float: right; }\\n .dg .has-slider input[type=text] {\\n width: 30%;\\n /*display: none;*/\\n margin-left: 0; }\\n .dg .slider {\\n float: left;\\n width: 66%;\\n margin-left: -5px;\\n margin-right: 0;\\n height: 19px;\\n margin-top: 4px; }\\n .dg .slider-fg {\\n height: 100%; }\\n .dg .c input[type=checkbox] {\\n margin-top: 7px; }\\n .dg .c select {\\n margin-top: 5px; }\\n .dg .cr.function,\\n .dg .cr.function .property-name,\\n .dg .cr.function *,\\n .dg .cr.boolean,\\n .dg .cr.boolean * {\\n cursor: pointer; }\\n .dg .cr.color {\\n overflow: visible; }\\n .dg .selector {\\n display: none;\\n position: absolute;\\n margin-left: -9px;\\n margin-top: 23px;\\n z-index: 10; }\\n .dg .c:hover .selector,\\n .dg .selector.drag {\\n display: block; }\\n .dg li.save-row {\\n padding: 0; }\\n .dg li.save-row .button {\\n display: inline-block;\\n padding: 0px 6px; }\\n .dg.dialogue {\\n background-color: #222;\\n width: 460px;\\n padding: 15px;\\n font-size: 13px;\\n line-height: 15px; }\\n\\n/* TODO Separate style and structure */\\n#dg-new-constructor {\\n padding: 10px;\\n color: #222;\\n font-family: Monaco, monospace;\\n font-size: 10px;\\n border: 0;\\n resize: none;\\n box-shadow: inset 1px 1px 1px #888;\\n word-wrap: break-word;\\n margin: 12px 0;\\n display: block;\\n width: 440px;\\n overflow-y: scroll;\\n height: 100px;\\n position: relative; }\\n\\n#dg-local-explain {\\n display: none;\\n font-size: 11px;\\n line-height: 17px;\\n border-radius: 3px;\\n background-color: #333;\\n padding: 8px;\\n margin-top: 10px; }\\n #dg-local-explain code {\\n font-size: 10px; }\\n\\n#dat-gui-save-locally {\\n display: none; }\\n\\n/** Main type */\\n.dg {\\n color: #eee;\\n font: 11px 'Lucida Grande', sans-serif;\\n text-shadow: 0 -1px 0 #111;\\n /** Auto place */\\n /* Controller row,
  • */\\n /** Controllers */ }\\n .dg.main {\\n /** Scrollbar */ }\\n .dg.main::-webkit-scrollbar {\\n width: 5px;\\n background: #1a1a1a; }\\n .dg.main::-webkit-scrollbar-corner {\\n height: 0;\\n display: none; }\\n .dg.main::-webkit-scrollbar-thumb {\\n border-radius: 5px;\\n background: #676767; }\\n .dg li:not(.folder) {\\n background: #1a1a1a;\\n border-bottom: 1px solid #2c2c2c; }\\n .dg li.save-row {\\n line-height: 25px;\\n background: #dad5cb;\\n border: 0; }\\n .dg li.save-row select {\\n margin-left: 5px;\\n width: 108px; }\\n .dg li.save-row .button {\\n margin-left: 5px;\\n margin-top: 1px;\\n border-radius: 2px;\\n font-size: 9px;\\n line-height: 7px;\\n padding: 4px 4px 5px 4px;\\n background: #c5bdad;\\n color: #fff;\\n text-shadow: 0 1px 0 #b0a58f;\\n box-shadow: 0 -1px 0 #b0a58f;\\n cursor: pointer; }\\n .dg li.save-row .button.gears {\\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\\n height: 7px;\\n width: 8px; }\\n .dg li.save-row .button:hover {\\n background-color: #bab19e;\\n box-shadow: 0 -1px 0 #b0a58f; }\\n .dg li.folder {\\n border-bottom: 0; }\\n .dg li.title {\\n padding-left: 16px;\\n background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\\n cursor: pointer;\\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\\n .dg .closed li.title {\\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\\n .dg .cr.boolean {\\n border-left: 3px solid #806787; }\\n .dg .cr.color {\\n border-left: 3px solid; }\\n .dg .cr.function {\\n border-left: 3px solid #e61d5f; }\\n .dg .cr.number {\\n border-left: 3px solid #2FA1D6; }\\n .dg .cr.number input[type=text] {\\n color: #2FA1D6; }\\n .dg .cr.string {\\n border-left: 3px solid #1ed36f; }\\n .dg .cr.string input[type=text] {\\n color: #1ed36f; }\\n .dg .cr.function:hover, .dg .cr.boolean:hover {\\n background: #111; }\\n .dg .c input[type=text] {\\n background: #303030;\\n outline: none; }\\n .dg .c input[type=text]:hover {\\n background: #3c3c3c; }\\n .dg .c input[type=text]:focus {\\n background: #494949;\\n color: #fff; }\\n .dg .c .slider {\\n background: #303030;\\n cursor: ew-resize; }\\n .dg .c .slider-fg {\\n background: #2FA1D6;\\n max-width: 100%; }\\n .dg .c .slider:hover {\\n background: #3c3c3c; }\\n .dg .c .slider:hover .slider-fg {\\n background: #44abda; }\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/style.scss\n// module id = 23\n// module chunks = 0","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/css-loader/lib/css-base.js\n// module id = 24\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/build/dat.gui.min.js b/build/dat.gui.min.js index df50e897..e0b597c6 100644 --- a/build/dat.gui.min.js +++ b/build/dat.gui.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dat=t():e.dat=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(1),r=o(i);t.default=r.default,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(2),r=o(i),a=n(6),l=o(a),s=n(3),u=o(s),d=n(7),c=o(d),f=n(8),_=o(f),p=n(10),h=o(p),m=n(11),b=o(m),g=n(12),v=o(g),y=n(13),w=o(y),x=n(14),E=o(x),C=n(15),A=o(C),S=n(16),k=o(S),O=n(9),T=o(O),R=n(17),L=o(R);t.default={color:{Color:r.default,math:l.default,interpret:u.default},controllers:{Controller:c.default,BooleanController:_.default,OptionController:h.default,StringController:b.default,NumberController:v.default,NumberControllerBox:w.default,NumberControllerSlider:E.default,FunctionController:A.default,ColorController:k.default},dom:{dom:T.default},gui:{GUI:L.default},GUI:L.default},e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(h.recalculateRGB(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(h.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function a(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(h.recalculateHSV(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(h.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}t.__esModule=!0;var l=n(3),s=o(l),u=n(6),d=o(u),c=n(4),f=o(c),_=n(5),p=o(_),h=function(){function e(){if(i(this,e),this.__state=s.default.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return e.prototype.toString=function(){return(0,f.default)(this)},e.prototype.toHexString=function(){return(0,f.default)(this,!0)},e.prototype.toOriginal=function(){return this.__state.conversion.write(this)},e}();h.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=d.default.component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");p.default.extend(e.__state,d.default.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},h.recalculateHSV=function(e){var t=d.default.rgb_to_hsv(e.r,e.g,e.b);p.default.extend(e.__state,{s:t.s,v:t.v}),p.default.isNaN(t.h)?p.default.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},h.COMPONENTS=["r","g","b","h","s","v","hex","a"],r(h.prototype,"r",2),r(h.prototype,"g",1),r(h.prototype,"b",0),a(h.prototype,"h"),a(h.prototype,"s"),a(h.prototype,"v"),Object.defineProperty(h.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(h.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=d.default.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),t.default=h,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(4),r=o(i),a=n(5),l=o(a),s=[{litmus:l.default.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:r.default},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:r.default},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:r.default},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:r.default}}},{litmus:l.default.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:l.default.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:l.default.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(l.default.isNumber(e.r)&&l.default.isNumber(e.g)&&l.default.isNumber(e.b)&&l.default.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(l.default.isNumber(e.r)&&l.default.isNumber(e.g)&&l.default.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(l.default.isNumber(e.h)&&l.default.isNumber(e.s)&&l.default.isNumber(e.v)&&l.default.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(l.default.isNumber(e.h)&&l.default.isNumber(e.s)&&l.default.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],u=void 0,d=void 0,c=function(){d=!1;var e=arguments.length>1?l.default.toArray(arguments):arguments[0];return l.default.each(s,function(t){if(t.litmus(e))return l.default.each(t.conversions,function(t,n){if(u=t.read(e),d===!1&&u!==!1)return d=u,u.conversionName=n,u.conversion=t,l.default.BREAK}),l.default.BREAK}),d};t.default=c,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){var n=e.__state.conversionName.toString(),o=Math.round(e.r),i=Math.round(e.g),r=Math.round(e.b),a=e.a,l=Math.round(e.h),s=e.s.toFixed(1),u=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var d=e.hex.toString(16);d.length<6;)d="0"+d;return"#"+d}return"CSS_RGB"===n?"rgb("+o+","+i+","+r+")":"CSS_RGBA"===n?"rgba("+o+","+i+","+r+","+a+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+o+","+i+","+r+"]":"RGBA_ARRAY"===n?"["+o+","+i+","+r+","+a+"]":"RGB_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+"}":"RGBA_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+",a:"+a+"}":"HSV_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+"}":"HSVA_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+",a:"+a+"}":"unknown format"},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;var n=Array.prototype.forEach,o=Array.prototype.slice,i={BREAK:{},extend:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(t[n])||(e[n]=t[n])}.bind(this))},this),e},defaults:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(e[n])&&(e[n]=t[n])}.bind(this))},this),e},compose:function(){var e=o.call(arguments);return function(){for(var t=o.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,o){if(e)if(n&&e.forEach&&e.forEach===n)e.forEach(t,o);else if(e.length===e.length+0){var i=void 0,r=void 0;for(i=0,r=e.length;i>8*t&255},hex_with_component:function(e,t,o){return o<<(n=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}t.__esModule=!0;var s=n(7),u=o(s),d=n(5),c=o(d),f=function(e){function t(n,o,a){i(this,t);var s=r(this,e.call(this,n,o)),u=a||{};return s.__min=u.min,s.__max=u.max,s.__step=u.step,c.default.isUndefined(s.__step)?0===s.initialValue?s.__impliedStep=1:s.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(s.initialValue))/Math.LN10))/10:s.__impliedStep=s.__step,s.__precision=l(s.__impliedStep),s}return a(t,e),t.prototype.setValue=function(t){var n=t;return void 0!==this.__min&&nthis.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!==0&&(n=Math.round(n/this.__step)*this.__step),e.prototype.setValue.call(this,n)},t.prototype.min=function(e){return this.__min=e,this},t.prototype.max=function(e){return this.__max=e,this},t.prototype.step=function(e){return this.__step=e,this.__impliedStep=e,this.__precision=l(e),this},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=n(5),_=o(f),p=function(e){function t(n,o,a){function l(e){var t=b.getValue(),n=(e.deltaY||-e.wheelDelta||e.detail)>>10||1;e.preventDefault(),n<0?t+=b.__impliedStep:t-=b.__impliedStep,b.setValue(t)}function s(){var e=parseFloat(b.__input.value);_.default.isNaN(e)||b.setValue(e)}function u(){b.__onFinishChange&&b.__onFinishChange.call(b,b.getValue())}function d(){u()}function f(e){var t=g-e.clientY;b.setValue(b.getValue()+t*b.__impliedStep),g=e.clientY}function p(){c.default.unbind(window,"mousemove",f),c.default.unbind(window,"mouseup",p),u()}function h(e){c.default.bind(window,"mousemove",f),c.default.bind(window,"mouseup",p),g=e.clientY}i(this,t);var m=r(this,e.call(this,n,o,a));m.__truncationSuspended=!1;var b=m,g=void 0,v=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";return m.__input=document.createElement("input"),m.__input.setAttribute("type","text"),c.default.bind(m.__input,"change",s),c.default.bind(m.__input,"blur",d),c.default.bind(m.__input,"mousedown",h),c.default.bind(m.__input,v,l),c.default.bind(m.__input,"keydown",function(e){13===e.keyCode&&(b.__truncationSuspended=!0,this.blur(),b.__truncationSuspended=!1,u())}),m.updateDisplay(),m.domElement.appendChild(m.__input),m}return a(t,e),t.prototype.updateDisplay=function(){return this.__input.value=this.__truncationSuspended?this.getValue():l(this.getValue(),this.__precision),e.prototype.updateDisplay.call(this)},t}(u.default);t.default=p,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o,i){return o+(i-o)*((e-t)/(n-t))}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=function(e){function t(n,o,a,s,u){function d(e){var t=m.getValue(),n=(e.deltaY||-e.wheelDelta||e.detail)>>10||1;e.preventDefault(),document.activeElement.blur(),n<0?t+=m.__impliedStep:t-=m.__impliedStep,m.setValue(t)}function f(e){document.activeElement.blur(),window.console.log("delete this line"),c.default.bind(window,"mousemove",_),c.default.bind(window,"mouseup",p),_(e)}function _(e){e.preventDefault();var t=m.__background.getBoundingClientRect();return m.setValue(l(e.clientX,t.left,t.right,m.__min,m.__max)),!1}function p(){c.default.unbind(window,"mousemove",_),c.default.unbind(window,"mouseup",p),m.__onFinishChange&&m.__onFinishChange.call(m,m.getValue())}i(this,t);var h=r(this,e.call(this,n,o,{min:a,max:s,step:u})),m=h;h.__background=document.createElement("div"),h.__foreground=document.createElement("div"),c.default.bind(h.__background,"mousedown",f);var b=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";return c.default.bind(h.__background,b,d),c.default.addClass(h.__background,"slider"),c.default.addClass(h.__foreground,"slider-fg"),h.updateDisplay(),h.__background.appendChild(h.__foreground),h.domElement.appendChild(h.__background),h}return a(t,e),t.prototype.updateDisplay=function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",e.prototype.updateDisplay.call(this)},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var l=n(7),s=o(l),u=n(9),d=o(u),c=function(e){function t(n,o,a){i(this,t);var l=r(this,e.call(this,n,o)),s=l;return l.__button=document.createElement("div"),l.__button.innerHTML=void 0===a?"Fire":a,d.default.bind(l.__button,"click",function(e){return e.preventDefault(),s.fire(),!1}),d.default.addClass(l.__button,"button"),l.domElement.appendChild(l.__button),l}return a(t,e),t.prototype.fire=function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())},t}(s.default);t.default=c,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o){e.style.background="",g.default.each(y,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+o+" 100%); "})}function s(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}t.__esModule=!0;var u=n(7),d=o(u),c=n(9),f=o(c),_=n(2),p=o(_),h=n(3),m=o(h),b=n(5),g=o(b),v=function(e){function t(n,o){function a(e){h(e),f.default.bind(window,"mousemove",h),f.default.bind(window,"mouseup",u)}function u(){f.default.unbind(window,"mousemove",h),f.default.unbind(window,"mouseup",u),_()}function d(){var e=(0,m.default)(this.value);e!==!1?(y.__color.__state=e,y.setValue(y.__color.toOriginal())):this.value=y.__color.toString()}function c(){f.default.unbind(window,"mousemove",b),f.default.unbind(window,"mouseup",c),_()}function _(){y.__onFinishChange&&y.__onFinishChange.call(y,y.__color.toOriginal())}function h(e){e.preventDefault();var t=y.__saturation_field.getBoundingClientRect(),n=(e.clientX-t.left)/(t.right-t.left),o=1-(e.clientY-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),n>1?n=1:n<0&&(n=0),y.__color.v=o,y.__color.s=n,y.setValue(y.__color.toOriginal()),!1}function b(e){e.preventDefault();var t=y.__hue_field.getBoundingClientRect(),n=1-(e.clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),y.__color.h=360*n,y.setValue(y.__color.toOriginal()),!1}i(this,t);var v=r(this,e.call(this,n,o));v.__color=new p.default(v.getValue()),v.__temp=new p.default(0);var y=v;v.domElement=document.createElement("div"),f.default.makeSelectable(v.domElement,!1),v.__selector=document.createElement("div"),v.__selector.className="selector",v.__saturation_field=document.createElement("div"),v.__saturation_field.className="saturation-field",v.__field_knob=document.createElement("div"),v.__field_knob.className="field-knob",v.__field_knob_border="2px solid ",v.__hue_knob=document.createElement("div"),v.__hue_knob.className="hue-knob",v.__hue_field=document.createElement("div"),v.__hue_field.className="hue-field",v.__input=document.createElement("input"),v.__input.type="text",v.__input_textShadow="0 1px 1px ",f.default.bind(v.__input,"keydown",function(e){13===e.keyCode&&d.call(this)}),f.default.bind(v.__input,"blur",d),f.default.bind(v.__selector,"mousedown",function(){f.default.addClass(this,"drag").bind(window,"mouseup",function(){f.default.removeClass(y.__selector,"drag")})});var w=document.createElement("div");return g.default.extend(v.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),g.default.extend(v.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:v.__field_knob_border+(v.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),g.default.extend(v.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),g.default.extend(v.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),g.default.extend(w.style,{width:"100%",height:"100%",background:"none"}),l(w,"top","rgba(0,0,0,0)","#000"),g.default.extend(v.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),s(v.__hue_field),g.default.extend(v.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:v.__input_textShadow+"rgba(0,0,0,0.7)"}),f.default.bind(v.__saturation_field,"mousedown",a),f.default.bind(v.__field_knob,"mousedown",a),f.default.bind(v.__hue_field,"mousedown",function(e){b(e),f.default.bind(window,"mousemove",b),f.default.bind(window,"mouseup",c)}),v.__saturation_field.appendChild(w),v.__selector.appendChild(v.__field_knob),v.__selector.appendChild(v.__saturation_field),v.__selector.appendChild(v.__hue_field),v.__hue_field.appendChild(v.__hue_knob),v.domElement.appendChild(v.__input),v.domElement.appendChild(v.__selector),v.updateDisplay(),v}return a(t,e),t.prototype.updateDisplay=function(){var e=(0,m.default)(this.getValue());if(e!==!1){var t=!1;g.default.each(p.default.COMPONENTS,function(n){if(!g.default.isUndefined(e[n])&&!g.default.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&g.default.extend(this.__color.__state,e)}g.default.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,o=255-n;g.default.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,l(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),g.default.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})},t}(d.default),y=["-moz-","-o-","-webkit-","-ms-",""];t.default=v,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,n):e.__ul.appendChild(o),e.onResize(),o}function r(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];t?n.innerHTML=n.value+"*":n.innerHTML=n.value}function a(e,t,n){if(n.__li=t,n.__gui=e, -U.default.extend(n,{options:function(t){if(arguments.length>1){var o=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:o,factoryArgs:[U.default.toArray(arguments)]})}if(U.default.isArray(t)||U.default.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof N.default){var o=new M.default(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});U.default.each(["updateDisplay","onChange","onFinishChange","step"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(o,e),t.apply(n,e)}}),z.default.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof M.default){var i=function(t){if(U.default.isNumber(n.__min)&&U.default.isNumber(n.__max)){var o=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var r=s(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return r.name(o),i&&r.listen(),r}return t};n.min=U.default.compose(i,n.min),n.max=U.default.compose(i,n.max)}else n instanceof O.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__checkbox,"click")}),z.default.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof R.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__button,"click")}),z.default.bind(t,"mouseover",function(){z.default.addClass(n.__button,"hover")}),z.default.bind(t,"mouseout",function(){z.default.removeClass(n.__button,"hover")})):n instanceof j.default&&(z.default.addClass(t,"color"),n.updateDisplay=U.default.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=U.default.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&r(e.getRoot(),!0),t},n.setValue)}function l(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(o!==-1){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r=n.load.remembered,a=void 0;if(r[e.preset])a=r[e.preset];else{if(!r[Q])return;a=r[Q]}if(a[o]&&void 0!==a[o][t.property]){var l=a[o][t.property];t.initialValue=l,t.setValue(l)}}}}function s(e,t,n,o){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var r=void 0;if(o.color)r=new j.default(t,n);else{var s=[t,n].concat(o.factoryArgs);r=C.default.apply(e,s)}o.before instanceof S.default&&(o.before=o.before.__li),l(e,r),z.default.addClass(r.domElement,"c");var u=document.createElement("span");z.default.addClass(u,"property-name"),u.innerHTML=r.property;var d=document.createElement("div");d.appendChild(u),d.appendChild(r.domElement);var c=i(e,d,o.before);return z.default.addClass(c,oe.CLASS_CONTROLLER_ROW),r instanceof j.default?z.default.addClass(c,"color"):z.default.addClass(c,g(r.getValue())),a(e,c,r),e.__controllers.push(r),r}function u(e,t){return document.location.href+"."+t}function d(e,t,n){var o=document.createElement("option");o.innerHTML=t,o.value=t,e.__preset_select.appendChild(o),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function c(e,t){t.style.display=e.useLocalStorage?"block":"none"}function f(e){var t=e.__save_row=document.createElement("li");z.default.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),z.default.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",z.default.addClass(n,"button gears");var o=document.createElement("span");o.innerHTML="Save",z.default.addClass(o,"button"),z.default.addClass(o,"save");var i=document.createElement("span");i.innerHTML="New",z.default.addClass(i,"button"),z.default.addClass(i,"save-as");var r=document.createElement("span");r.innerHTML="Revert",z.default.addClass(r,"button"),z.default.addClass(r,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?U.default.each(e.load.remembered,function(t,n){d(e,n,n===e.preset)}):d(e,Q,!1),z.default.bind(a,"change",function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=h(this)),e.folders={},U.default.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=h(this),r(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[Q]=h(this,!0)),this.load.remembered[e]=h(this),this.preset=e,d(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){U.default.each(this.__controllers,function(t){this.getRoot().load.remembered?l(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),U.default.each(this.__folders,function(e){e.revert(e)}),e||r(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&b(this.__listening)},updateDisplay:function(){U.default.each(this.__controllers,function(e){e.updateDisplay()}),U.default.each(this.__folders,function(e){e.updateDisplay()})}}),t.default=oe,e.exports=t.default},function(e,t){"use strict";e.exports={load:function(e,t){var n=t||document,o=n.createElement("link");o.type="text/css",o.rel="stylesheet",o.href=e,n.getElementsByTagName("head")[0].appendChild(o)},inject:function(e,t){var n=t||document,o=document.createElement("style");o.type="text/css",o.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(o)}catch(e){}}}},function(e,t){e.exports="
    Here's the new load parameter for your GUI's constructor:
    Automatically save values to localStorage on exit.
    The values saved to localStorage will override those passed to dat.GUI's constructor. This makes it easier to work incrementally, but localStorage is fragile, and your friends may not see the same values you do.
    "},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(10),r=o(i),a=n(13),l=o(a),s=n(14),u=o(s),d=n(11),c=o(d),f=n(15),_=o(f),p=n(8),h=o(p),m=n(5),b=o(m),g=function(e,t){var n=e[t];return b.default.isArray(arguments[2])||b.default.isObject(arguments[2])?new r.default(e,t,arguments[2]):b.default.isNumber(n)?b.default.isNumber(arguments[2])&&b.default.isNumber(arguments[3])?b.default.isNumber(arguments[4])?new u.default(e,t,arguments[2],arguments[3],arguments[4]):new u.default(e,t,arguments[2],arguments[3]):b.default.isNumber(arguments[4])?new l.default(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new l.default(e,t,{min:arguments[2],max:arguments[3]}):b.default.isString(n)?new c.default(e,t):b.default.isFunction(n)?new _.default(e,t,""):b.default.isBoolean(n)?new h.default(e,t):null};t.default=g,e.exports=t.default},function(e,t){"use strict";function n(e){setTimeout(e,1e3/60)}t.__esModule=!0,t.default=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||n,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=n(9),a=o(r),l=n(5),s=o(l),u=function(){function e(){i(this,e),this.backgroundElement=document.createElement("div"),s.default.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),a.default.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),s.default.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;a.default.bind(this.backgroundElement,"click",function(){t.hide()})}return e.prototype.show=function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),s.default.defer(function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"})},e.prototype.hide=function e(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",a.default.unbind(t.domElement,"webkitTransitionEnd",e),a.default.unbind(t.domElement,"transitionend",e),a.default.unbind(t.domElement,"oTransitionEnd",e)};a.default.bind(this.domElement,"webkitTransitionEnd",e),a.default.bind(this.domElement,"transitionend",e),a.default.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"},e.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-a.default.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-a.default.getHeight(this.domElement)/2+"px"},e}();t.default=u,e.exports=t.default},function(e,t,n){t=e.exports=n(24)(),t.push([e.id,".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{transition:height .1s ease-out;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px Lucida Grande,sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t1?l.default.toArray(arguments):arguments[0];return l.default.each(s,function(t){if(t.litmus(e))return l.default.each(t.conversions,function(t,n){if(u=t.read(e),d===!1&&u!==!1)return d=u,u.conversionName=n,u.conversion=t,l.default.BREAK}),l.default.BREAK}),d};t.default=c,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){var n=e.__state.conversionName.toString(),o=Math.round(e.r),i=Math.round(e.g),r=Math.round(e.b),a=e.a,l=Math.round(e.h),s=e.s.toFixed(1),u=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var d=e.hex.toString(16);d.length<6;)d="0"+d;return"#"+d}return"CSS_RGB"===n?"rgb("+o+","+i+","+r+")":"CSS_RGBA"===n?"rgba("+o+","+i+","+r+","+a+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+o+","+i+","+r+"]":"RGBA_ARRAY"===n?"["+o+","+i+","+r+","+a+"]":"RGB_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+"}":"RGBA_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+",a:"+a+"}":"HSV_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+"}":"HSVA_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+",a:"+a+"}":"unknown format"},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;var n=Array.prototype.forEach,o=Array.prototype.slice,i={BREAK:{},extend:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(t[n])||(e[n]=t[n])}.bind(this))},this),e},defaults:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(e[n])&&(e[n]=t[n])}.bind(this))},this),e},compose:function(){var e=o.call(arguments);return function(){for(var t=o.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,o){if(e)if(n&&e.forEach&&e.forEach===n)e.forEach(t,o);else if(e.length===e.length+0){var i=void 0,r=void 0;for(i=0,r=e.length;i>8*t&255},hex_with_component:function(e,t,o){return o<<(n=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}t.__esModule=!0;var s=n(7),u=o(s),d=n(5),c=o(d),f=function(e){function t(n,o,a){i(this,t);var s=r(this,e.call(this,n,o)),u=a||{};return s.__min=u.min,s.__max=u.max,s.__step=u.step,c.default.isUndefined(s.__step)?0===s.initialValue?s.__impliedStep=1:s.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(s.initialValue))/Math.LN10))/10:s.__impliedStep=s.__step,s.__precision=l(s.__impliedStep),s}return a(t,e),t.prototype.setValue=function(t){var n=t;return void 0!==this.__min&&nthis.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!==0&&(n=Math.round(n/this.__step)*this.__step),e.prototype.setValue.call(this,n)},t.prototype.min=function(e){return this.__min=e,this},t.prototype.max=function(e){return this.__max=e,this},t.prototype.step=function(e){return this.__step=e,this.__impliedStep=e,this.__precision=l(e),this},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=n(5),_=o(f),p=function(e){function t(n,o,a){function l(e){var t=b.getValue(),n=(e.deltaY||-e.wheelDelta||e.detail)>>10||1;e.preventDefault(),n<0?t+=b.__impliedStep:t-=b.__impliedStep,b.setValue(t)}function s(){var e=parseFloat(b.__input.value);_.default.isNaN(e)||b.setValue(e)}function u(){b.__onFinishChange&&b.__onFinishChange.call(b,b.getValue())}function d(){u()}function f(e){var t=g-e.clientY;b.setValue(b.getValue()+t*b.__impliedStep),g=e.clientY}function p(){c.default.unbind(window,"mousemove",f),c.default.unbind(window,"mouseup",p),u()}function h(e){c.default.bind(window,"mousemove",f),c.default.bind(window,"mouseup",p),g=e.clientY}i(this,t);var m=r(this,e.call(this,n,o,a));m.__truncationSuspended=!1;var b=m,g=void 0,v=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";return m.__input=document.createElement("input"),m.__input.setAttribute("type","text"),c.default.bind(m.__input,"change",s),c.default.bind(m.__input,"blur",d),c.default.bind(m.__input,"mousedown",h),c.default.bind(m.__input,v,l),c.default.bind(m.__input,"keydown",function(e){13===e.keyCode&&(b.__truncationSuspended=!0,this.blur(),b.__truncationSuspended=!1,u())}),m.updateDisplay(),m.domElement.appendChild(m.__input),m}return a(t,e),t.prototype.updateDisplay=function(){return this.__input.value=this.__truncationSuspended?this.getValue():l(this.getValue(),this.__precision),e.prototype.updateDisplay.call(this)},t}(u.default);t.default=p,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o,i){return o+(i-o)*((e-t)/(n-t))}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=function(e){function t(n,o,a,s,u){function d(e){var t=m.getValue(),n=(e.deltaY||-e.wheelDelta||e.detail)>>10||1;e.preventDefault(),document.activeElement.blur(),n<0?t+=m.__impliedStep:t-=m.__impliedStep,m.setValue(t)}function f(e){document.activeElement.blur(),c.default.bind(window,"mousemove",_),c.default.bind(window,"mouseup",p),_(e)}function _(e){e.preventDefault();var t=m.__background.getBoundingClientRect();return m.setValue(l(e.clientX,t.left,t.right,m.__min,m.__max)),!1}function p(){c.default.unbind(window,"mousemove",_),c.default.unbind(window,"mouseup",p),m.__onFinishChange&&m.__onFinishChange.call(m,m.getValue())}i(this,t);var h=r(this,e.call(this,n,o,{min:a,max:s,step:u})),m=h;h.__background=document.createElement("div"),h.__foreground=document.createElement("div"),c.default.bind(h.__background,"mousedown",f);var b=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";return c.default.bind(h.__background,b,d),c.default.addClass(h.__background,"slider"),c.default.addClass(h.__foreground,"slider-fg"),h.updateDisplay(),h.__background.appendChild(h.__foreground),h.domElement.appendChild(h.__background),h}return a(t,e),t.prototype.updateDisplay=function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",e.prototype.updateDisplay.call(this)},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var l=n(7),s=o(l),u=n(9),d=o(u),c=function(e){function t(n,o,a){i(this,t);var l=r(this,e.call(this,n,o)),s=l;return l.__button=document.createElement("div"),l.__button.innerHTML=void 0===a?"Fire":a,d.default.bind(l.__button,"click",function(e){return e.preventDefault(),s.fire(),!1}),d.default.addClass(l.__button,"button"),l.domElement.appendChild(l.__button),l}return a(t,e),t.prototype.fire=function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())},t}(s.default);t.default=c,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o){e.style.background="",g.default.each(y,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+o+" 100%); "})}function s(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}t.__esModule=!0;var u=n(7),d=o(u),c=n(9),f=o(c),_=n(2),p=o(_),h=n(3),m=o(h),b=n(5),g=o(b),v=function(e){function t(n,o){function a(e){h(e),f.default.bind(window,"mousemove",h),f.default.bind(window,"mouseup",u)}function u(){f.default.unbind(window,"mousemove",h),f.default.unbind(window,"mouseup",u),_()}function d(){var e=(0,m.default)(this.value);e!==!1?(y.__color.__state=e,y.setValue(y.__color.toOriginal())):this.value=y.__color.toString()}function c(){f.default.unbind(window,"mousemove",b),f.default.unbind(window,"mouseup",c),_()}function _(){y.__onFinishChange&&y.__onFinishChange.call(y,y.__color.toOriginal())}function h(e){e.preventDefault();var t=y.__saturation_field.getBoundingClientRect(),n=(e.clientX-t.left)/(t.right-t.left),o=1-(e.clientY-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),n>1?n=1:n<0&&(n=0),y.__color.v=o,y.__color.s=n,y.setValue(y.__color.toOriginal()),!1}function b(e){e.preventDefault();var t=y.__hue_field.getBoundingClientRect(),n=1-(e.clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),y.__color.h=360*n,y.setValue(y.__color.toOriginal()),!1}i(this,t);var v=r(this,e.call(this,n,o));v.__color=new p.default(v.getValue()),v.__temp=new p.default(0);var y=v;v.domElement=document.createElement("div"),f.default.makeSelectable(v.domElement,!1),v.__selector=document.createElement("div"),v.__selector.className="selector",v.__saturation_field=document.createElement("div"),v.__saturation_field.className="saturation-field",v.__field_knob=document.createElement("div"),v.__field_knob.className="field-knob",v.__field_knob_border="2px solid ",v.__hue_knob=document.createElement("div"),v.__hue_knob.className="hue-knob",v.__hue_field=document.createElement("div"),v.__hue_field.className="hue-field",v.__input=document.createElement("input"),v.__input.type="text",v.__input_textShadow="0 1px 1px ",f.default.bind(v.__input,"keydown",function(e){13===e.keyCode&&d.call(this)}),f.default.bind(v.__input,"blur",d),f.default.bind(v.__selector,"mousedown",function(){f.default.addClass(this,"drag").bind(window,"mouseup",function(){f.default.removeClass(y.__selector,"drag")})});var w=document.createElement("div");return g.default.extend(v.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),g.default.extend(v.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:v.__field_knob_border+(v.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),g.default.extend(v.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),g.default.extend(v.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),g.default.extend(w.style,{width:"100%",height:"100%",background:"none"}),l(w,"top","rgba(0,0,0,0)","#000"),g.default.extend(v.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),s(v.__hue_field),g.default.extend(v.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:v.__input_textShadow+"rgba(0,0,0,0.7)"}),f.default.bind(v.__saturation_field,"mousedown",a),f.default.bind(v.__field_knob,"mousedown",a),f.default.bind(v.__hue_field,"mousedown",function(e){b(e),f.default.bind(window,"mousemove",b),f.default.bind(window,"mouseup",c)}),v.__saturation_field.appendChild(w),v.__selector.appendChild(v.__field_knob),v.__selector.appendChild(v.__saturation_field),v.__selector.appendChild(v.__hue_field),v.__hue_field.appendChild(v.__hue_knob),v.domElement.appendChild(v.__input),v.domElement.appendChild(v.__selector),v.updateDisplay(),v}return a(t,e),t.prototype.updateDisplay=function(){var e=(0,m.default)(this.getValue());if(e!==!1){var t=!1;g.default.each(p.default.COMPONENTS,function(n){if(!g.default.isUndefined(e[n])&&!g.default.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&g.default.extend(this.__color.__state,e)}g.default.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,o=255-n;g.default.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,l(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),g.default.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})},t}(d.default),y=["-moz-","-o-","-webkit-","-ms-",""];t.default=v,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,n):e.__ul.appendChild(o),e.onResize(),o}function r(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];t?n.innerHTML=n.value+"*":n.innerHTML=n.value}function a(e,t,n){if(n.__li=t,n.__gui=e,U.default.extend(n,{options:function(t){ +if(arguments.length>1){var o=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:o,factoryArgs:[U.default.toArray(arguments)]})}if(U.default.isArray(t)||U.default.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof N.default){var o=new M.default(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});U.default.each(["updateDisplay","onChange","onFinishChange","step"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(o,e),t.apply(n,e)}}),z.default.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof M.default){var i=function(t){if(U.default.isNumber(n.__min)&&U.default.isNumber(n.__max)){var o=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var r=s(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return r.name(o),i&&r.listen(),r}return t};n.min=U.default.compose(i,n.min),n.max=U.default.compose(i,n.max)}else n instanceof O.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__checkbox,"click")}),z.default.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof R.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__button,"click")}),z.default.bind(t,"mouseover",function(){z.default.addClass(n.__button,"hover")}),z.default.bind(t,"mouseout",function(){z.default.removeClass(n.__button,"hover")})):n instanceof j.default&&(z.default.addClass(t,"color"),n.updateDisplay=U.default.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=U.default.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&r(e.getRoot(),!0),t},n.setValue)}function l(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(o!==-1){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r=n.load.remembered,a=void 0;if(r[e.preset])a=r[e.preset];else{if(!r[Q])return;a=r[Q]}if(a[o]&&void 0!==a[o][t.property]){var l=a[o][t.property];t.initialValue=l,t.setValue(l)}}}}function s(e,t,n,o){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var r=void 0;if(o.color)r=new j.default(t,n);else{var s=[t,n].concat(o.factoryArgs);r=C.default.apply(e,s)}o.before instanceof S.default&&(o.before=o.before.__li),l(e,r),z.default.addClass(r.domElement,"c");var u=document.createElement("span");z.default.addClass(u,"property-name"),u.innerHTML=r.property;var d=document.createElement("div");d.appendChild(u),d.appendChild(r.domElement);var c=i(e,d,o.before);return z.default.addClass(c,oe.CLASS_CONTROLLER_ROW),r instanceof j.default?z.default.addClass(c,"color"):z.default.addClass(c,g(r.getValue())),a(e,c,r),e.__controllers.push(r),r}function u(e,t){return document.location.href+"."+t}function d(e,t,n){var o=document.createElement("option");o.innerHTML=t,o.value=t,e.__preset_select.appendChild(o),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function c(e,t){t.style.display=e.useLocalStorage?"block":"none"}function f(e){var t=e.__save_row=document.createElement("li");z.default.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),z.default.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",z.default.addClass(n,"button gears");var o=document.createElement("span");o.innerHTML="Save",z.default.addClass(o,"button"),z.default.addClass(o,"save");var i=document.createElement("span");i.innerHTML="New",z.default.addClass(i,"button"),z.default.addClass(i,"save-as");var r=document.createElement("span");r.innerHTML="Revert",z.default.addClass(r,"button"),z.default.addClass(r,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?U.default.each(e.load.remembered,function(t,n){d(e,n,n===e.preset)}):d(e,Q,!1),z.default.bind(a,"change",function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=h(this)),e.folders={},U.default.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=h(this),r(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[Q]=h(this,!0)),this.load.remembered[e]=h(this),this.preset=e,d(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){U.default.each(this.__controllers,function(t){this.getRoot().load.remembered?l(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),U.default.each(this.__folders,function(e){e.revert(e)}),e||r(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&b(this.__listening)},updateDisplay:function(){U.default.each(this.__controllers,function(e){e.updateDisplay()}),U.default.each(this.__folders,function(e){e.updateDisplay()})}}),t.default=oe,e.exports=t.default},function(e,t){"use strict";e.exports={load:function(e,t){var n=t||document,o=n.createElement("link");o.type="text/css",o.rel="stylesheet",o.href=e,n.getElementsByTagName("head")[0].appendChild(o)},inject:function(e,t){var n=t||document,o=document.createElement("style");o.type="text/css",o.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(o)}catch(e){}}}},function(e,t){e.exports="
    Here's the new load parameter for your GUI's constructor:
    Automatically save values to localStorage on exit.
    The values saved to localStorage will override those passed to dat.GUI's constructor. This makes it easier to work incrementally, but localStorage is fragile, and your friends may not see the same values you do.
    "},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(10),r=o(i),a=n(13),l=o(a),s=n(14),u=o(s),d=n(11),c=o(d),f=n(15),_=o(f),p=n(8),h=o(p),m=n(5),b=o(m),g=function(e,t){var n=e[t];return b.default.isArray(arguments[2])||b.default.isObject(arguments[2])?new r.default(e,t,arguments[2]):b.default.isNumber(n)?b.default.isNumber(arguments[2])&&b.default.isNumber(arguments[3])?b.default.isNumber(arguments[4])?new u.default(e,t,arguments[2],arguments[3],arguments[4]):new u.default(e,t,arguments[2],arguments[3]):b.default.isNumber(arguments[4])?new l.default(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new l.default(e,t,{min:arguments[2],max:arguments[3]}):b.default.isString(n)?new c.default(e,t):b.default.isFunction(n)?new _.default(e,t,""):b.default.isBoolean(n)?new h.default(e,t):null};t.default=g,e.exports=t.default},function(e,t){"use strict";function n(e){setTimeout(e,1e3/60)}t.__esModule=!0,t.default=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||n,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=n(9),a=o(r),l=n(5),s=o(l),u=function(){function e(){i(this,e),this.backgroundElement=document.createElement("div"),s.default.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),a.default.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),s.default.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;a.default.bind(this.backgroundElement,"click",function(){t.hide()})}return e.prototype.show=function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),s.default.defer(function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"})},e.prototype.hide=function e(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",a.default.unbind(t.domElement,"webkitTransitionEnd",e),a.default.unbind(t.domElement,"transitionend",e),a.default.unbind(t.domElement,"oTransitionEnd",e)};a.default.bind(this.domElement,"webkitTransitionEnd",e),a.default.bind(this.domElement,"transitionend",e),a.default.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"},e.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-a.default.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-a.default.getHeight(this.domElement)/2+"px"},e}();t.default=u,e.exports=t.default},function(e,t,n){t=e.exports=n(24)(),t.push([e.id,".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{transition:height .1s ease-out;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px Lucida Grande,sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t Date: Tue, 19 Dec 2017 22:29:13 +0100 Subject: [PATCH 3/3] Deleted build/* files --- build/dat.gui.css | 299 --- build/dat.gui.js | 4361 ------------------------------------------ build/dat.gui.js.map | 1 - build/dat.gui.min.js | 2 - 4 files changed, 4663 deletions(-) delete mode 100644 build/dat.gui.css delete mode 100644 build/dat.gui.js delete mode 100644 build/dat.gui.js.map delete mode 100644 build/dat.gui.min.js diff --git a/build/dat.gui.css b/build/dat.gui.css deleted file mode 100644 index 9c21e938..00000000 --- a/build/dat.gui.css +++ /dev/null @@ -1,299 +0,0 @@ -.dg { - /** Clear list styles */ - /* Auto-place container */ - /* Auto-placed GUI's */ - /* Line items that don't contain folders. */ - /** Folder names */ - /** Hides closed items */ - /** Controller row */ - /** Name-half (left) */ - /** Controller-half (right) */ - /** Controller placement */ - /** Shorter number boxes when slider is present. */ - /** Ensure the entire boolean and function row shows a hand */ - /** allow overflow for color selector */ } - .dg ul { - list-style: none; - margin: 0; - padding: 0; - width: 100%; - clear: both; } - .dg.ac { - position: fixed; - top: 0; - left: 0; - right: 0; - height: 0; - z-index: 0; } - .dg:not(.ac) .main { - /** Exclude mains in ac so that we don't hide close button */ - overflow: hidden; } - .dg.main { - -webkit-transition: opacity 0.1s linear; - -o-transition: opacity 0.1s linear; - -moz-transition: opacity 0.1s linear; - transition: opacity 0.1s linear; } - .dg.main.taller-than-window { - overflow-y: auto; } - .dg.main.taller-than-window .close-button { - opacity: 1; - /* TODO, these are style notes */ - margin-top: -1px; - border-top: 1px solid #2c2c2c; } - .dg.main ul.closed .close-button { - opacity: 1 !important; } - .dg.main:hover .close-button, - .dg.main .close-button.drag { - opacity: 1; } - .dg.main .close-button { - /*opacity: 0;*/ - -webkit-transition: opacity 0.1s linear; - -o-transition: opacity 0.1s linear; - -moz-transition: opacity 0.1s linear; - transition: opacity 0.1s linear; - border: 0; - line-height: 19px; - height: 20px; - /* TODO, these are style notes */ - cursor: pointer; - text-align: center; - background-color: #000; } - .dg.main .close-button.close-top { - position: relative; } - .dg.main .close-button.close-bottom { - position: absolute; } - .dg.main .close-button:hover { - background-color: #111; } - .dg.a { - float: right; - margin-right: 15px; - overflow-y: visible; } - .dg.a.has-save > ul.close-top { - margin-top: 0; } - .dg.a.has-save > ul.close-bottom { - margin-top: 27px; } - .dg.a.has-save > ul.closed { - margin-top: 0; } - .dg.a .save-row { - top: 0; - z-index: 1002; } - .dg.a .save-row.close-top { - position: relative; } - .dg.a .save-row.close-bottom { - position: fixed; } - .dg li { - -webkit-transition: height 0.1s ease-out; - -o-transition: height 0.1s ease-out; - -moz-transition: height 0.1s ease-out; - transition: height 0.1s ease-out; - -webkit-transition: overflow 0.1s linear; - -o-transition: overflow 0.1s linear; - -moz-transition: overflow 0.1s linear; - transition: overflow 0.1s linear; } - .dg li:not(.folder) { - cursor: auto; - height: 27px; - line-height: 27px; - padding: 0 4px 0 5px; } - .dg li.folder { - padding: 0; - border-left: 4px solid transparent; } - .dg li.title { - cursor: pointer; - margin-left: -4px; } - .dg .closed li:not(.title), - .dg .closed ul li, - .dg .closed ul li > * { - height: 0; - overflow: hidden; - border: 0; } - .dg .cr { - clear: both; - padding-left: 3px; - height: 27px; - overflow: hidden; } - .dg .property-name { - cursor: default; - float: left; - clear: left; - width: 40%; - overflow: hidden; - text-overflow: ellipsis; } - .dg .c { - float: left; - width: 60%; - position: relative; } - .dg .c input[type=text] { - border: 0; - margin-top: 4px; - padding: 3px; - width: 100%; - float: right; } - .dg .has-slider input[type=text] { - width: 30%; - /*display: none;*/ - margin-left: 0; } - .dg .slider { - float: left; - width: 66%; - margin-left: -5px; - margin-right: 0; - height: 19px; - margin-top: 4px; } - .dg .slider-fg { - height: 100%; } - .dg .c input[type=checkbox] { - margin-top: 7px; } - .dg .c select { - margin-top: 5px; } - .dg .cr.function, - .dg .cr.function .property-name, - .dg .cr.function *, - .dg .cr.boolean, - .dg .cr.boolean * { - cursor: pointer; } - .dg .cr.color { - overflow: visible; } - .dg .selector { - display: none; - position: absolute; - margin-left: -9px; - margin-top: 23px; - z-index: 10; } - .dg .c:hover .selector, - .dg .selector.drag { - display: block; } - .dg li.save-row { - padding: 0; } - .dg li.save-row .button { - display: inline-block; - padding: 0px 6px; } - .dg.dialogue { - background-color: #222; - width: 460px; - padding: 15px; - font-size: 13px; - line-height: 15px; } - -/* TODO Separate style and structure */ -#dg-new-constructor { - padding: 10px; - color: #222; - font-family: Monaco, monospace; - font-size: 10px; - border: 0; - resize: none; - box-shadow: inset 1px 1px 1px #888; - word-wrap: break-word; - margin: 12px 0; - display: block; - width: 440px; - overflow-y: scroll; - height: 100px; - position: relative; } - -#dg-local-explain { - display: none; - font-size: 11px; - line-height: 17px; - border-radius: 3px; - background-color: #333; - padding: 8px; - margin-top: 10px; } - #dg-local-explain code { - font-size: 10px; } - -#dat-gui-save-locally { - display: none; } - -/** Main type */ -.dg { - color: #eee; - font: 11px 'Lucida Grande', sans-serif; - text-shadow: 0 -1px 0 #111; - /** Auto place */ - /* Controller row,
  • */ - /** Controllers */ } - .dg.main { - /** Scrollbar */ } - .dg.main::-webkit-scrollbar { - width: 5px; - background: #1a1a1a; } - .dg.main::-webkit-scrollbar-corner { - height: 0; - display: none; } - .dg.main::-webkit-scrollbar-thumb { - border-radius: 5px; - background: #676767; } - .dg li:not(.folder) { - background: #1a1a1a; - border-bottom: 1px solid #2c2c2c; } - .dg li.save-row { - line-height: 25px; - background: #dad5cb; - border: 0; } - .dg li.save-row select { - margin-left: 5px; - width: 108px; } - .dg li.save-row .button { - margin-left: 5px; - margin-top: 1px; - border-radius: 2px; - font-size: 9px; - line-height: 7px; - padding: 4px 4px 5px 4px; - background: #c5bdad; - color: #fff; - text-shadow: 0 1px 0 #b0a58f; - box-shadow: 0 -1px 0 #b0a58f; - cursor: pointer; } - .dg li.save-row .button.gears { - background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat; - height: 7px; - width: 8px; } - .dg li.save-row .button:hover { - background-color: #bab19e; - box-shadow: 0 -1px 0 #b0a58f; } - .dg li.folder { - border-bottom: 0; } - .dg li.title { - padding-left: 16px; - background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat; - cursor: pointer; - border-bottom: 1px solid rgba(255, 255, 255, 0.2); } - .dg .closed li.title { - background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); } - .dg .cr.boolean { - border-left: 3px solid #806787; } - .dg .cr.color { - border-left: 3px solid; } - .dg .cr.function { - border-left: 3px solid #e61d5f; } - .dg .cr.number { - border-left: 3px solid #2FA1D6; } - .dg .cr.number input[type=text] { - color: #2FA1D6; } - .dg .cr.string { - border-left: 3px solid #1ed36f; } - .dg .cr.string input[type=text] { - color: #1ed36f; } - .dg .cr.function:hover, .dg .cr.boolean:hover { - background: #111; } - .dg .c input[type=text] { - background: #303030; - outline: none; } - .dg .c input[type=text]:hover { - background: #3c3c3c; } - .dg .c input[type=text]:focus { - background: #494949; - color: #fff; } - .dg .c .slider { - background: #303030; - cursor: ew-resize; } - .dg .c .slider-fg { - background: #2FA1D6; - max-width: 100%; } - .dg .c .slider:hover { - background: #3c3c3c; } - .dg .c .slider:hover .slider-fg { - background: #44abda; } diff --git a/build/dat.gui.js b/build/dat.gui.js deleted file mode 100644 index 19388ce8..00000000 --- a/build/dat.gui.js +++ /dev/null @@ -1,4361 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["dat"] = factory(); - else - root["dat"] = factory(); -})(this, function() { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _index = __webpack_require__(1); - - var _index2 = _interopRequireDefault(_index); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - exports.default = _index2.default; /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - module.exports = exports['default']; - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _Color = __webpack_require__(2); - - var _Color2 = _interopRequireDefault(_Color); - - var _math = __webpack_require__(6); - - var _math2 = _interopRequireDefault(_math); - - var _interpret = __webpack_require__(3); - - var _interpret2 = _interopRequireDefault(_interpret); - - var _Controller = __webpack_require__(7); - - var _Controller2 = _interopRequireDefault(_Controller); - - var _BooleanController = __webpack_require__(8); - - var _BooleanController2 = _interopRequireDefault(_BooleanController); - - var _OptionController = __webpack_require__(10); - - var _OptionController2 = _interopRequireDefault(_OptionController); - - var _StringController = __webpack_require__(11); - - var _StringController2 = _interopRequireDefault(_StringController); - - var _NumberController = __webpack_require__(12); - - var _NumberController2 = _interopRequireDefault(_NumberController); - - var _NumberControllerBox = __webpack_require__(13); - - var _NumberControllerBox2 = _interopRequireDefault(_NumberControllerBox); - - var _NumberControllerSlider = __webpack_require__(14); - - var _NumberControllerSlider2 = _interopRequireDefault(_NumberControllerSlider); - - var _FunctionController = __webpack_require__(15); - - var _FunctionController2 = _interopRequireDefault(_FunctionController); - - var _ColorController = __webpack_require__(16); - - var _ColorController2 = _interopRequireDefault(_ColorController); - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - var _GUI = __webpack_require__(17); - - var _GUI2 = _interopRequireDefault(_GUI); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - exports.default = { - color: { - Color: _Color2.default, - math: _math2.default, - interpret: _interpret2.default - }, - - controllers: { - Controller: _Controller2.default, - BooleanController: _BooleanController2.default, - OptionController: _OptionController2.default, - StringController: _StringController2.default, - NumberController: _NumberController2.default, - NumberControllerBox: _NumberControllerBox2.default, - NumberControllerSlider: _NumberControllerSlider2.default, - FunctionController: _FunctionController2.default, - ColorController: _ColorController2.default - }, - - dom: { - dom: _dom2.default - }, - - gui: { - GUI: _GUI2.default - }, - - GUI: _GUI2.default - }; - module.exports = exports['default']; - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _interpret = __webpack_require__(3); - - var _interpret2 = _interopRequireDefault(_interpret); - - var _math = __webpack_require__(6); - - var _math2 = _interopRequireDefault(_math); - - var _toString = __webpack_require__(4); - - var _toString2 = _interopRequireDefault(_toString); - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - var Color = function () { - function Color() { - _classCallCheck(this, Color); - - this.__state = _interpret2.default.apply(this, arguments); - - if (this.__state === false) { - throw new Error('Failed to interpret color arguments'); - } - - this.__state.a = this.__state.a || 1; - } - - Color.prototype.toString = function toString() { - return (0, _toString2.default)(this); - }; - - Color.prototype.toHexString = function toHexString() { - return (0, _toString2.default)(this, true); - }; - - Color.prototype.toOriginal = function toOriginal() { - return this.__state.conversion.write(this); - }; - - return Color; - }(); - - function defineRGBComponent(target, component, componentHexIndex) { - Object.defineProperty(target, component, { - get: function get() { - if (this.__state.space === 'RGB') { - return this.__state[component]; - } - - Color.recalculateRGB(this, component, componentHexIndex); - - return this.__state[component]; - }, - - set: function set(v) { - if (this.__state.space !== 'RGB') { - Color.recalculateRGB(this, component, componentHexIndex); - this.__state.space = 'RGB'; - } - - this.__state[component] = v; - } - }); - } - - function defineHSVComponent(target, component) { - Object.defineProperty(target, component, { - get: function get() { - if (this.__state.space === 'HSV') { - return this.__state[component]; - } - - Color.recalculateHSV(this); - - return this.__state[component]; - }, - - set: function set(v) { - if (this.__state.space !== 'HSV') { - Color.recalculateHSV(this); - this.__state.space = 'HSV'; - } - - this.__state[component] = v; - } - }); - } - - Color.recalculateRGB = function (color, component, componentHexIndex) { - if (color.__state.space === 'HEX') { - color.__state[component] = _math2.default.component_from_hex(color.__state.hex, componentHexIndex); - } else if (color.__state.space === 'HSV') { - _common2.default.extend(color.__state, _math2.default.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v)); - } else { - throw new Error('Corrupted color state'); - } - }; - - Color.recalculateHSV = function (color) { - var result = _math2.default.rgb_to_hsv(color.r, color.g, color.b); - - _common2.default.extend(color.__state, { - s: result.s, - v: result.v - }); - - if (!_common2.default.isNaN(result.h)) { - color.__state.h = result.h; - } else if (_common2.default.isUndefined(color.__state.h)) { - color.__state.h = 0; - } - }; - - Color.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']; - - defineRGBComponent(Color.prototype, 'r', 2); - defineRGBComponent(Color.prototype, 'g', 1); - defineRGBComponent(Color.prototype, 'b', 0); - - defineHSVComponent(Color.prototype, 'h'); - defineHSVComponent(Color.prototype, 's'); - defineHSVComponent(Color.prototype, 'v'); - - Object.defineProperty(Color.prototype, 'a', { - get: function get() { - return this.__state.a; - }, - - set: function set(v) { - this.__state.a = v; - } - }); - - Object.defineProperty(Color.prototype, 'hex', { - get: function get() { - if (!this.__state.space !== 'HEX') { - this.__state.hex = _math2.default.rgb_to_hex(this.r, this.g, this.b); - } - - return this.__state.hex; - }, - - set: function set(v) { - this.__state.space = 'HEX'; - this.__state.hex = v; - } - }); - - exports.default = Color; - module.exports = exports['default']; - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _toString = __webpack_require__(4); - - var _toString2 = _interopRequireDefault(_toString); - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - var INTERPRETATIONS = [ - // Strings - { - litmus: _common2.default.isString, - conversions: { - THREE_CHAR_HEX: { - read: function read(original) { - var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i); - if (test === null) { - return false; - } - - return { - space: 'HEX', - hex: parseInt('0x' + test[1].toString() + test[1].toString() + test[2].toString() + test[2].toString() + test[3].toString() + test[3].toString(), 0) - }; - }, - - write: _toString2.default - }, - - SIX_CHAR_HEX: { - read: function read(original) { - var test = original.match(/^#([A-F0-9]{6})$/i); - if (test === null) { - return false; - } - - return { - space: 'HEX', - hex: parseInt('0x' + test[1].toString(), 0) - }; - }, - - write: _toString2.default - }, - - CSS_RGB: { - read: function read(original) { - var test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); - if (test === null) { - return false; - } - - return { - space: 'RGB', - r: parseFloat(test[1]), - g: parseFloat(test[2]), - b: parseFloat(test[3]) - }; - }, - - write: _toString2.default - }, - - CSS_RGBA: { - read: function read(original) { - var test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); - if (test === null) { - return false; - } - - return { - space: 'RGB', - r: parseFloat(test[1]), - g: parseFloat(test[2]), - b: parseFloat(test[3]), - a: parseFloat(test[4]) - }; - }, - - write: _toString2.default - } - } - }, - - // Numbers - { - litmus: _common2.default.isNumber, - - conversions: { - - HEX: { - read: function read(original) { - return { - space: 'HEX', - hex: original, - conversionName: 'HEX' - }; - }, - - write: function write(color) { - return color.hex; - } - } - - } - - }, - - // Arrays - { - litmus: _common2.default.isArray, - conversions: { - RGB_ARRAY: { - read: function read(original) { - if (original.length !== 3) { - return false; - } - - return { - space: 'RGB', - r: original[0], - g: original[1], - b: original[2] - }; - }, - - write: function write(color) { - return [color.r, color.g, color.b]; - } - }, - - RGBA_ARRAY: { - read: function read(original) { - if (original.length !== 4) return false; - return { - space: 'RGB', - r: original[0], - g: original[1], - b: original[2], - a: original[3] - }; - }, - - write: function write(color) { - return [color.r, color.g, color.b, color.a]; - } - } - } - }, - - // Objects - { - litmus: _common2.default.isObject, - conversions: { - - RGBA_OBJ: { - read: function read(original) { - if (_common2.default.isNumber(original.r) && _common2.default.isNumber(original.g) && _common2.default.isNumber(original.b) && _common2.default.isNumber(original.a)) { - return { - space: 'RGB', - r: original.r, - g: original.g, - b: original.b, - a: original.a - }; - } - return false; - }, - - write: function write(color) { - return { - r: color.r, - g: color.g, - b: color.b, - a: color.a - }; - } - }, - - RGB_OBJ: { - read: function read(original) { - if (_common2.default.isNumber(original.r) && _common2.default.isNumber(original.g) && _common2.default.isNumber(original.b)) { - return { - space: 'RGB', - r: original.r, - g: original.g, - b: original.b - }; - } - return false; - }, - - write: function write(color) { - return { - r: color.r, - g: color.g, - b: color.b - }; - } - }, - - HSVA_OBJ: { - read: function read(original) { - if (_common2.default.isNumber(original.h) && _common2.default.isNumber(original.s) && _common2.default.isNumber(original.v) && _common2.default.isNumber(original.a)) { - return { - space: 'HSV', - h: original.h, - s: original.s, - v: original.v, - a: original.a - }; - } - return false; - }, - - write: function write(color) { - return { - h: color.h, - s: color.s, - v: color.v, - a: color.a - }; - } - }, - - HSV_OBJ: { - read: function read(original) { - if (_common2.default.isNumber(original.h) && _common2.default.isNumber(original.s) && _common2.default.isNumber(original.v)) { - return { - space: 'HSV', - h: original.h, - s: original.s, - v: original.v - }; - } - return false; - }, - - write: function write(color) { - return { - h: color.h, - s: color.s, - v: color.v - }; - } - } - } - }]; - - var result = void 0; - var toReturn = void 0; - - var interpret = function interpret() { - toReturn = false; - - var original = arguments.length > 1 ? _common2.default.toArray(arguments) : arguments[0]; - _common2.default.each(INTERPRETATIONS, function (family) { - if (family.litmus(original)) { - _common2.default.each(family.conversions, function (conversion, conversionName) { - result = conversion.read(original); - - if (toReturn === false && result !== false) { - toReturn = result; - result.conversionName = conversionName; - result.conversion = conversion; - return _common2.default.BREAK; - } - }); - - return _common2.default.BREAK; - } - }); - - return toReturn; - }; - - exports.default = interpret; - module.exports = exports['default']; - -/***/ }, -/* 4 */ -/***/ function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - - exports.default = function (color, forceCSSHex) { - var colorFormat = color.__state.conversionName.toString(); - - var r = Math.round(color.r); - var g = Math.round(color.g); - var b = Math.round(color.b); - var a = color.a; - var h = Math.round(color.h); - var s = color.s.toFixed(1); - var v = color.v.toFixed(1); - - if (forceCSSHex || colorFormat === 'THREE_CHAR_HEX' || colorFormat === 'SIX_CHAR_HEX') { - var str = color.hex.toString(16); - while (str.length < 6) { - str = '0' + str; - } - return '#' + str; - } else if (colorFormat === 'CSS_RGB') { - return 'rgb(' + r + ',' + g + ',' + b + ')'; - } else if (colorFormat === 'CSS_RGBA') { - return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; - } else if (colorFormat === 'HEX') { - return '0x' + color.hex.toString(16); - } else if (colorFormat === 'RGB_ARRAY') { - return '[' + r + ',' + g + ',' + b + ']'; - } else if (colorFormat === 'RGBA_ARRAY') { - return '[' + r + ',' + g + ',' + b + ',' + a + ']'; - } else if (colorFormat === 'RGB_OBJ') { - return '{r:' + r + ',g:' + g + ',b:' + b + '}'; - } else if (colorFormat === 'RGBA_OBJ') { - return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}'; - } else if (colorFormat === 'HSV_OBJ') { - return '{h:' + h + ',s:' + s + ',v:' + v + '}'; - } else if (colorFormat === 'HSVA_OBJ') { - return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}'; - } - - return 'unknown format'; - }; - - module.exports = exports['default']; /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - -/***/ }, -/* 5 */ -/***/ function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - var ARR_EACH = Array.prototype.forEach; - var ARR_SLICE = Array.prototype.slice; - - /** - * Band-aid methods for things that should be a lot easier in JavaScript. - * Implementation and structure inspired by underscore.js - * http://documentcloud.github.com/underscore/ - */ - - var Common = { - BREAK: {}, - - extend: function extend(target) { - this.each(ARR_SLICE.call(arguments, 1), function (obj) { - var keys = this.isObject(obj) ? Object.keys(obj) : []; - keys.forEach(function (key) { - if (!this.isUndefined(obj[key])) { - target[key] = obj[key]; - } - }.bind(this)); - }, this); - - return target; - }, - - defaults: function defaults(target) { - this.each(ARR_SLICE.call(arguments, 1), function (obj) { - var keys = this.isObject(obj) ? Object.keys(obj) : []; - keys.forEach(function (key) { - if (this.isUndefined(target[key])) { - target[key] = obj[key]; - } - }.bind(this)); - }, this); - - return target; - }, - - compose: function compose() { - var toCall = ARR_SLICE.call(arguments); - return function () { - var args = ARR_SLICE.call(arguments); - for (var i = toCall.length - 1; i >= 0; i--) { - args = [toCall[i].apply(this, args)]; - } - return args[0]; - }; - }, - - each: function each(obj, itr, scope) { - if (!obj) { - return; - } - - if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) { - obj.forEach(itr, scope); - } else if (obj.length === obj.length + 0) { - // Is number but not NaN - var key = void 0; - var l = void 0; - for (key = 0, l = obj.length; key < l; key++) { - if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) { - return; - } - } - } else { - for (var _key in obj) { - if (itr.call(scope, obj[_key], _key) === this.BREAK) { - return; - } - } - } - }, - - defer: function defer(fnc) { - setTimeout(fnc, 0); - }, - - // if the function is called repeatedly, wait until threshold passes until we execute the function - debounce: function debounce(func, threshold, callImmediately) { - var timeout = void 0; - - return function () { - var obj = this; - var args = arguments; - function delayed() { - timeout = null; - if (!callImmediately) func.apply(obj, args); - } - - var callNow = callImmediately || !timeout; - - clearTimeout(timeout); - timeout = setTimeout(delayed, threshold); - - if (callNow) { - func.apply(obj, args); - } - }; - }, - - toArray: function toArray(obj) { - if (obj.toArray) return obj.toArray(); - return ARR_SLICE.call(obj); - }, - - isUndefined: function isUndefined(obj) { - return obj === undefined; - }, - - isNull: function isNull(obj) { - return obj === null; - }, - - isNaN: function (_isNaN) { - function isNaN(_x) { - return _isNaN.apply(this, arguments); - } - - isNaN.toString = function () { - return _isNaN.toString(); - }; - - return isNaN; - }(function (obj) { - return isNaN(obj); - }), - - isArray: Array.isArray || function (obj) { - return obj.constructor === Array; - }, - - isObject: function isObject(obj) { - return obj === Object(obj); - }, - - isNumber: function isNumber(obj) { - return obj === obj + 0; - }, - - isString: function isString(obj) { - return obj === obj + ''; - }, - - isBoolean: function isBoolean(obj) { - return obj === false || obj === true; - }, - - isFunction: function isFunction(obj) { - return Object.prototype.toString.call(obj) === '[object Function]'; - } - - }; - - exports.default = Common; - module.exports = exports['default']; - -/***/ }, -/* 6 */ -/***/ function(module, exports) { - - "use strict"; - - exports.__esModule = true; - /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - var tmpComponent = void 0; - - var ColorMath = { - hsv_to_rgb: function hsv_to_rgb(h, s, v) { - var hi = Math.floor(h / 60) % 6; - - var f = h / 60 - Math.floor(h / 60); - var p = v * (1.0 - s); - var q = v * (1.0 - f * s); - var t = v * (1.0 - (1.0 - f) * s); - - var c = [[v, t, p], [q, v, p], [p, v, t], [p, q, v], [t, p, v], [v, p, q]][hi]; - - return { - r: c[0] * 255, - g: c[1] * 255, - b: c[2] * 255 - }; - }, - - rgb_to_hsv: function rgb_to_hsv(r, g, b) { - var min = Math.min(r, g, b); - var max = Math.max(r, g, b); - var delta = max - min; - var h = void 0; - var s = void 0; - - if (max !== 0) { - s = delta / max; - } else { - return { - h: NaN, - s: 0, - v: 0 - }; - } - - if (r === max) { - h = (g - b) / delta; - } else if (g === max) { - h = 2 + (b - r) / delta; - } else { - h = 4 + (r - g) / delta; - } - h /= 6; - if (h < 0) { - h += 1; - } - - return { - h: h * 360, - s: s, - v: max / 255 - }; - }, - - rgb_to_hex: function rgb_to_hex(r, g, b) { - var hex = this.hex_with_component(0, 2, r); - hex = this.hex_with_component(hex, 1, g); - hex = this.hex_with_component(hex, 0, b); - return hex; - }, - - component_from_hex: function component_from_hex(hex, componentIndex) { - return hex >> componentIndex * 8 & 0xFF; - }, - - hex_with_component: function hex_with_component(hex, componentIndex, value) { - return value << (tmpComponent = componentIndex * 8) | hex & ~(0xFF << tmpComponent); - } - }; - - exports.default = ColorMath; - module.exports = exports["default"]; - -/***/ }, -/* 7 */ -/***/ function(module, exports) { - - 'use strict'; - - exports.__esModule = true; - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - /** - * @class An "abstract" class that represents a given property of an object. - * - * @param {Object} object The object to be manipulated - * @param {string} property The name of the property to be manipulated - */ - var Controller = function () { - function Controller(object, property) { - _classCallCheck(this, Controller); - - this.initialValue = object[property]; - - /** - * Those who extend this class will put their DOM elements in here. - * @type {DOMElement} - */ - this.domElement = document.createElement('div'); - - /** - * The object to manipulate - * @type {Object} - */ - this.object = object; - - /** - * The name of the property to manipulate - * @type {String} - */ - this.property = property; - - /** - * The function to be called on change. - * @type {Function} - * @ignore - */ - this.__onChange = undefined; - - /** - * The function to be called on finishing change. - * @type {Function} - * @ignore - */ - this.__onFinishChange = undefined; - } - - /** - * Specify that a function fire every time someone changes the value with - * this Controller. - * - * @param {Function} fnc This function will be called whenever the value - * is modified via this Controller. - * @returns {Controller} this - */ - - - Controller.prototype.onChange = function onChange(fnc) { - this.__onChange = fnc; - return this; - }; - - /** - * Specify that a function fire every time someone "finishes" changing - * the value wih this Controller. Useful for values that change - * incrementally like numbers or strings. - * - * @param {Function} fnc This function will be called whenever - * someone "finishes" changing the value via this Controller. - * @returns {Controller} this - */ - - - Controller.prototype.onFinishChange = function onFinishChange(fnc) { - this.__onFinishChange = fnc; - return this; - }; - - /** - * Change the value of object[property] - * - * @param {Object} newValue The new value of object[property] - */ - - - Controller.prototype.setValue = function setValue(newValue) { - this.object[this.property] = newValue; - if (this.__onChange) { - this.__onChange.call(this, newValue); - } - - this.updateDisplay(); - return this; - }; - - /** - * Gets the value of object[property] - * - * @returns {Object} The current value of object[property] - */ - - - Controller.prototype.getValue = function getValue() { - return this.object[this.property]; - }; - - /** - * Refreshes the visual display of a Controller in order to keep sync - * with the object's current value. - * @returns {Controller} this - */ - - - Controller.prototype.updateDisplay = function updateDisplay() { - return this; - }; - - /** - * @returns {Boolean} true if the value has deviated from initialValue - */ - - - Controller.prototype.isModified = function isModified() { - return this.initialValue !== this.getValue(); - }; - - return Controller; - }(); - - exports.default = Controller; - module.exports = exports['default']; - -/***/ }, -/* 8 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _Controller2 = __webpack_require__(7); - - var _Controller3 = _interopRequireDefault(_Controller2); - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - /** - * @class Provides a checkbox input to alter the boolean property of an object. - * - * @extends dat.controllers.Controller - * - * @param {Object} object The object to be manipulated - * @param {string} property The name of the property to be manipulated - */ - var BooleanController = function (_Controller) { - _inherits(BooleanController, _Controller); - - function BooleanController(object, property) { - _classCallCheck(this, BooleanController); - - var _this2 = _possibleConstructorReturn(this, _Controller.call(this, object, property)); - - var _this = _this2; - _this2.__prev = _this2.getValue(); - - _this2.__checkbox = document.createElement('input'); - _this2.__checkbox.setAttribute('type', 'checkbox'); - - function onChange() { - _this.setValue(!_this.__prev); - } - - _dom2.default.bind(_this2.__checkbox, 'change', onChange, false); - - _this2.domElement.appendChild(_this2.__checkbox); - - // Match original value - _this2.updateDisplay(); - return _this2; - } - - BooleanController.prototype.setValue = function setValue(v) { - var toReturn = _Controller.prototype.setValue.call(this, v); - if (this.__onFinishChange) { - this.__onFinishChange.call(this, this.getValue()); - } - this.__prev = this.getValue(); - return toReturn; - }; - - BooleanController.prototype.updateDisplay = function updateDisplay() { - if (this.getValue() === true) { - this.__checkbox.setAttribute('checked', 'checked'); - this.__checkbox.checked = true; - this.__prev = true; - } else { - this.__checkbox.checked = false; - this.__prev = false; - } - - return _Controller.prototype.updateDisplay.call(this); - }; - - return BooleanController; - }(_Controller3.default); - - exports.default = BooleanController; - module.exports = exports['default']; - -/***/ }, -/* 9 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var EVENT_MAP = { - HTMLEvents: ['change'], - MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'], - KeyboardEvents: ['keydown'] - }; /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - var EVENT_MAP_INV = {}; - _common2.default.each(EVENT_MAP, function (v, k) { - _common2.default.each(v, function (e) { - EVENT_MAP_INV[e] = k; - }); - }); - - var CSS_VALUE_PIXELS = /(\d+(\.\d+)?)px/; - - function cssValueToPixels(val) { - if (val === '0' || _common2.default.isUndefined(val)) { - return 0; - } - - var match = val.match(CSS_VALUE_PIXELS); - - if (!_common2.default.isNull(match)) { - return parseFloat(match[1]); - } - - // TODO ...ems? %? - - return 0; - } - - /** - * @namespace - * @member dat.dom - */ - var dom = { - - /** - * - * @param elem - * @param selectable - */ - makeSelectable: function makeSelectable(elem, selectable) { - if (elem === undefined || elem.style === undefined) return; - - elem.onselectstart = selectable ? function () { - return false; - } : function () {}; - - elem.style.MozUserSelect = selectable ? 'auto' : 'none'; - elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none'; - elem.unselectable = selectable ? 'on' : 'off'; - }, - - /** - * - * @param elem - * @param horizontal - * @param vert - */ - makeFullscreen: function makeFullscreen(elem, hor, vert) { - var vertical = vert; - var horizontal = hor; - - if (_common2.default.isUndefined(horizontal)) { - horizontal = true; - } - - if (_common2.default.isUndefined(vertical)) { - vertical = true; - } - - elem.style.position = 'absolute'; - - if (horizontal) { - elem.style.left = 0; - elem.style.right = 0; - } - if (vertical) { - elem.style.top = 0; - elem.style.bottom = 0; - } - }, - - /** - * - * @param elem - * @param eventType - * @param params - */ - fakeEvent: function fakeEvent(elem, eventType, pars, aux) { - var params = pars || {}; - var className = EVENT_MAP_INV[eventType]; - if (!className) { - throw new Error('Event type ' + eventType + ' not supported.'); - } - var evt = document.createEvent(className); - switch (className) { - case 'MouseEvents': - { - var clientX = params.x || params.clientX || 0; - var clientY = params.y || params.clientY || 0; - evt.initMouseEvent(eventType, params.bubbles || false, params.cancelable || true, window, params.clickCount || 1, 0, // screen X - 0, // screen Y - clientX, // client X - clientY, // client Y - false, false, false, false, 0, null); - break; - } - case 'KeyboardEvents': - { - var init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz - _common2.default.defaults(params, { - cancelable: true, - ctrlKey: false, - altKey: false, - shiftKey: false, - metaKey: false, - keyCode: undefined, - charCode: undefined - }); - init(eventType, params.bubbles || false, params.cancelable, window, params.ctrlKey, params.altKey, params.shiftKey, params.metaKey, params.keyCode, params.charCode); - break; - } - default: - { - evt.initEvent(eventType, params.bubbles || false, params.cancelable || true); - break; - } - } - _common2.default.defaults(evt, aux); - elem.dispatchEvent(evt); - }, - - /** - * - * @param elem - * @param event - * @param func - * @param bool - */ - bind: function bind(elem, event, func, newBool) { - var bool = newBool || false; - if (elem.addEventListener) { - elem.addEventListener(event, func, bool); - } else if (elem.attachEvent) { - elem.attachEvent('on' + event, func); - } - return dom; - }, - - /** - * - * @param elem - * @param event - * @param func - * @param bool - */ - unbind: function unbind(elem, event, func, newBool) { - var bool = newBool || false; - if (elem.removeEventListener) { - elem.removeEventListener(event, func, bool); - } else if (elem.detachEvent) { - elem.detachEvent('on' + event, func); - } - return dom; - }, - - /** - * - * @param elem - * @param className - */ - addClass: function addClass(elem, className) { - if (elem.className === undefined) { - elem.className = className; - } else if (elem.className !== className) { - var classes = elem.className.split(/ +/); - if (classes.indexOf(className) === -1) { - classes.push(className); - elem.className = classes.join(' ').replace(/^\s+/, '').replace(/\s+$/, ''); - } - } - return dom; - }, - - /** - * - * @param elem - * @param className - */ - removeClass: function removeClass(elem, className) { - if (className) { - if (elem.className === className) { - elem.removeAttribute('class'); - } else { - var classes = elem.className.split(/ +/); - var index = classes.indexOf(className); - if (index !== -1) { - classes.splice(index, 1); - elem.className = classes.join(' '); - } - } - } else { - elem.className = undefined; - } - return dom; - }, - - hasClass: function hasClass(elem, className) { - return new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)').test(elem.className) || false; - }, - - /** - * - * @param elem - */ - getWidth: function getWidth(elem) { - var style = getComputedStyle(elem); - - return cssValueToPixels(style['border-left-width']) + cssValueToPixels(style['border-right-width']) + cssValueToPixels(style['padding-left']) + cssValueToPixels(style['padding-right']) + cssValueToPixels(style.width); - }, - - /** - * - * @param elem - */ - getHeight: function getHeight(elem) { - var style = getComputedStyle(elem); - - return cssValueToPixels(style['border-top-width']) + cssValueToPixels(style['border-bottom-width']) + cssValueToPixels(style['padding-top']) + cssValueToPixels(style['padding-bottom']) + cssValueToPixels(style.height); - }, - - /** - * - * @param el - */ - getOffset: function getOffset(el) { - var elem = el; - var offset = { left: 0, top: 0 }; - if (elem.offsetParent) { - do { - offset.left += elem.offsetLeft; - offset.top += elem.offsetTop; - elem = elem.offsetParent; - } while (elem); - } - return offset; - }, - - // http://stackoverflow.com/posts/2684561/revisions - /** - * - * @param elem - */ - isActive: function isActive(elem) { - return elem === document.activeElement && (elem.type || elem.href); - } - - }; - - exports.default = dom; - module.exports = exports['default']; - -/***/ }, -/* 10 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _Controller2 = __webpack_require__(7); - - var _Controller3 = _interopRequireDefault(_Controller2); - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - /** - * @class Provides a select input to alter the property of an object, using a - * list of accepted values. - * - * @extends dat.controllers.Controller - * - * @param {Object} object The object to be manipulated - * @param {string} property The name of the property to be manipulated - * @param {Object|string[]} options A map of labels to acceptable values, or - * a list of acceptable string values. - */ - var OptionController = function (_Controller) { - _inherits(OptionController, _Controller); - - function OptionController(object, property, opts) { - _classCallCheck(this, OptionController); - - var _this2 = _possibleConstructorReturn(this, _Controller.call(this, object, property)); - - var options = opts; - - var _this = _this2; - - /** - * The drop down menu - * @ignore - */ - _this2.__select = document.createElement('select'); - - if (_common2.default.isArray(options)) { - var map = {}; - _common2.default.each(options, function (element) { - map[element] = element; - }); - options = map; - } - - _common2.default.each(options, function (value, key) { - var opt = document.createElement('option'); - opt.innerHTML = key; - opt.setAttribute('value', value); - _this.__select.appendChild(opt); - }); - - // Acknowledge original value - _this2.updateDisplay(); - - _dom2.default.bind(_this2.__select, 'change', function () { - var desiredValue = this.options[this.selectedIndex].value; - _this.setValue(desiredValue); - }); - - _this2.domElement.appendChild(_this2.__select); - return _this2; - } - - OptionController.prototype.setValue = function setValue(v) { - var toReturn = _Controller.prototype.setValue.call(this, v); - - if (this.__onFinishChange) { - this.__onFinishChange.call(this, this.getValue()); - } - return toReturn; - }; - - OptionController.prototype.updateDisplay = function updateDisplay() { - if (_dom2.default.isActive(this.__select)) return this; // prevent number from updating if user is trying to manually update - this.__select.value = this.getValue(); - return _Controller.prototype.updateDisplay.call(this); - }; - - return OptionController; - }(_Controller3.default); - - exports.default = OptionController; - module.exports = exports['default']; - -/***/ }, -/* 11 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _Controller2 = __webpack_require__(7); - - var _Controller3 = _interopRequireDefault(_Controller2); - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - /** - * @class Provides a text input to alter the string property of an object. - * - * @extends dat.controllers.Controller - * - * @param {Object} object The object to be manipulated - * @param {string} property The name of the property to be manipulated - */ - var StringController = function (_Controller) { - _inherits(StringController, _Controller); - - function StringController(object, property) { - _classCallCheck(this, StringController); - - var _this2 = _possibleConstructorReturn(this, _Controller.call(this, object, property)); - - var _this = _this2; - - function onChange() { - _this.setValue(_this.__input.value); - } - - function onBlur() { - if (_this.__onFinishChange) { - _this.__onFinishChange.call(_this, _this.getValue()); - } - } - - _this2.__input = document.createElement('input'); - _this2.__input.setAttribute('type', 'text'); - - _dom2.default.bind(_this2.__input, 'keyup', onChange); - _dom2.default.bind(_this2.__input, 'change', onChange); - _dom2.default.bind(_this2.__input, 'blur', onBlur); - _dom2.default.bind(_this2.__input, 'keydown', function (e) { - if (e.keyCode === 13) { - this.blur(); - } - }); - - _this2.updateDisplay(); - - _this2.domElement.appendChild(_this2.__input); - return _this2; - } - - StringController.prototype.updateDisplay = function updateDisplay() { - // Stops the caret from moving on account of: - // keyup -> setValue -> updateDisplay - if (!_dom2.default.isActive(this.__input)) { - this.__input.value = this.getValue(); - } - return _Controller.prototype.updateDisplay.call(this); - }; - - return StringController; - }(_Controller3.default); - - exports.default = StringController; - module.exports = exports['default']; - -/***/ }, -/* 12 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _Controller2 = __webpack_require__(7); - - var _Controller3 = _interopRequireDefault(_Controller2); - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - function numDecimals(x) { - var _x = x.toString(); - if (_x.indexOf('.') > -1) { - return _x.length - _x.indexOf('.') - 1; - } - - return 0; - } - - /** - * @class Represents a given property of an object that is a number. - * - * @extends dat.controllers.Controller - * - * @param {Object} object The object to be manipulated - * @param {string} property The name of the property to be manipulated - * @param {Object} [params] Optional parameters - * @param {Number} [params.min] Minimum allowed value - * @param {Number} [params.max] Maximum allowed value - * @param {Number} [params.step] Increment by which to change value - */ - - var NumberController = function (_Controller) { - _inherits(NumberController, _Controller); - - function NumberController(object, property, params) { - _classCallCheck(this, NumberController); - - var _this = _possibleConstructorReturn(this, _Controller.call(this, object, property)); - - var _params = params || {}; - - _this.__min = _params.min; - _this.__max = _params.max; - _this.__step = _params.step; - - if (_common2.default.isUndefined(_this.__step)) { - if (_this.initialValue === 0) { - _this.__impliedStep = 1; // What are we, psychics? - } else { - // Hey Doug, check this out. - _this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(_this.initialValue)) / Math.LN10)) / 10; - } - } else { - _this.__impliedStep = _this.__step; - } - - _this.__precision = numDecimals(_this.__impliedStep); - return _this; - } - - NumberController.prototype.setValue = function setValue(v) { - var _v = v; - - if (this.__min !== undefined && _v < this.__min) { - _v = this.__min; - } else if (this.__max !== undefined && _v > this.__max) { - _v = this.__max; - } - - if (this.__step !== undefined && _v % this.__step !== 0) { - _v = Math.round(_v / this.__step) * this.__step; - } - - return _Controller.prototype.setValue.call(this, _v); - }; - - /** - * Specify a minimum value for object[property]. - * - * @param {Number} minValue The minimum value for - * object[property] - * @returns {dat.controllers.NumberController} this - */ - - - NumberController.prototype.min = function min(minValue) { - this.__min = minValue; - return this; - }; - - /** - * Specify a maximum value for object[property]. - * - * @param {Number} maxValue The maximum value for - * object[property] - * @returns {dat.controllers.NumberController} this - */ - - - NumberController.prototype.max = function max(maxValue) { - this.__max = maxValue; - return this; - }; - - /** - * Specify a step value that dat.controllers.NumberController - * increments by. - * - * @param {Number} stepValue The step value for - * dat.controllers.NumberController - * @default if minimum and maximum specified increment is 1% of the - * difference otherwise stepValue is 1 - * @returns {dat.controllers.NumberController} this - */ - - - NumberController.prototype.step = function step(stepValue) { - this.__step = stepValue; - this.__impliedStep = stepValue; - this.__precision = numDecimals(stepValue); - return this; - }; - - return NumberController; - }(_Controller3.default); - - exports.default = NumberController; - module.exports = exports['default']; - -/***/ }, -/* 13 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _NumberController2 = __webpack_require__(12); - - var _NumberController3 = _interopRequireDefault(_NumberController2); - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - function roundToDecimal(value, decimals) { - var tenTo = Math.pow(10, decimals); - return Math.round(value * tenTo) / tenTo; - } - - /** - * @class Represents a given property of an object that is a number and - * provides an input element with which to manipulate it. - * - * @extends dat.controllers.Controller - * @extends dat.controllers.NumberController - * - * @param {Object} object The object to be manipulated - * @param {string} property The name of the property to be manipulated - * @param {Object} [params] Optional parameters - * @param {Number} [params.min] Minimum allowed value - * @param {Number} [params.max] Maximum allowed value - * @param {Number} [params.step] Increment by which to change value - */ - - var NumberControllerBox = function (_NumberController) { - _inherits(NumberControllerBox, _NumberController); - - function NumberControllerBox(object, property, params) { - _classCallCheck(this, NumberControllerBox); - - var _this2 = _possibleConstructorReturn(this, _NumberController.call(this, object, property, params)); - - _this2.__truncationSuspended = false; - - var _this = _this2; - - /** - * {Number} Previous mouse y position - * @ignore - */ - var prevY = void 0; - - var mousewheelevt = /Firefox/i.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel'; - - function onMouseWheel(e) { - var value = _this.getValue(); - var delta = (e.deltaY || -e.wheelDelta || e.detail) >> 10 || 1; - e.preventDefault(); - - if (delta < 0) value += _this.__impliedStep;else value -= _this.__impliedStep; - _this.setValue(value); - } - - function onChange() { - var attempted = parseFloat(_this.__input.value); - if (!_common2.default.isNaN(attempted)) { - _this.setValue(attempted); - } - } - - function onFinish() { - if (_this.__onFinishChange) { - _this.__onFinishChange.call(_this, _this.getValue()); - } - } - - function onBlur() { - onFinish(); - } - - function onMouseDrag(e) { - var diff = prevY - e.clientY; - _this.setValue(_this.getValue() + diff * _this.__impliedStep); - - prevY = e.clientY; - } - - function onMouseUp() { - _dom2.default.unbind(window, 'mousemove', onMouseDrag); - _dom2.default.unbind(window, 'mouseup', onMouseUp); - onFinish(); - } - - function onMouseDown(e) { - _dom2.default.bind(window, 'mousemove', onMouseDrag); - _dom2.default.bind(window, 'mouseup', onMouseUp); - prevY = e.clientY; - } - - _this2.__input = document.createElement('input'); - _this2.__input.setAttribute('type', 'text'); - - // Makes it so manually specified values are not truncated. - - _dom2.default.bind(_this2.__input, 'change', onChange); - _dom2.default.bind(_this2.__input, 'blur', onBlur); - _dom2.default.bind(_this2.__input, 'mousedown', onMouseDown); - _dom2.default.bind(_this2.__input, mousewheelevt, onMouseWheel); - _dom2.default.bind(_this2.__input, 'keydown', function (e) { - // When pressing enter, you can be as precise as you want. - if (e.keyCode === 13) { - _this.__truncationSuspended = true; - this.blur(); - _this.__truncationSuspended = false; - onFinish(); - } - }); - - _this2.updateDisplay(); - - _this2.domElement.appendChild(_this2.__input); - return _this2; - } - - NumberControllerBox.prototype.updateDisplay = function updateDisplay() { - this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision); - return _NumberController.prototype.updateDisplay.call(this); - }; - - return NumberControllerBox; - }(_NumberController3.default); - - exports.default = NumberControllerBox; - module.exports = exports['default']; - -/***/ }, -/* 14 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _NumberController2 = __webpack_require__(12); - - var _NumberController3 = _interopRequireDefault(_NumberController2); - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - function map(v, i1, i2, o1, o2) { - return o1 + (o2 - o1) * ((v - i1) / (i2 - i1)); - } - - /** - * @class Represents a given property of an object that is a number, contains - * a minimum and maximum, and provides a slider element with which to - * manipulate it. It should be noted that the slider element is made up of - * <div> tags, not the html5 - * <slider> element. - * - * @extends dat.controllers.Controller - * @extends dat.controllers.NumberController - * - * @param {Object} object The object to be manipulated - * @param {string} property The name of the property to be manipulated - * @param {Number} minValue Minimum allowed value - * @param {Number} maxValue Maximum allowed value - * @param {Number} stepValue Increment by which to change value - */ - - var NumberControllerSlider = function (_NumberController) { - _inherits(NumberControllerSlider, _NumberController); - - function NumberControllerSlider(object, property, min, max, step) { - _classCallCheck(this, NumberControllerSlider); - - var _this2 = _possibleConstructorReturn(this, _NumberController.call(this, object, property, { min: min, max: max, step: step })); - - var _this = _this2; - - _this2.__background = document.createElement('div'); - _this2.__foreground = document.createElement('div'); - - _dom2.default.bind(_this2.__background, 'mousedown', onMouseDown); - - var mousewheelevt = /Firefox/i.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel'; - _dom2.default.bind(_this2.__background, mousewheelevt, onMouseWheel); - - _dom2.default.addClass(_this2.__background, 'slider'); - _dom2.default.addClass(_this2.__foreground, 'slider-fg'); - - function onMouseWheel(e) { - var value = _this.getValue(); - var delta = (e.deltaY || -e.wheelDelta || e.detail) >> 10 || 1; - e.preventDefault(); - document.activeElement.blur(); - - if (delta < 0) value += _this.__impliedStep;else value -= _this.__impliedStep; - _this.setValue(value); - } - - function onMouseDown(e) { - document.activeElement.blur(); - - _dom2.default.bind(window, 'mousemove', onMouseDrag); - _dom2.default.bind(window, 'mouseup', onMouseUp); - - onMouseDrag(e); - } - - function onMouseDrag(e) { - e.preventDefault(); - - var bgRect = _this.__background.getBoundingClientRect(); - - _this.setValue(map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)); - - return false; - } - - function onMouseUp() { - _dom2.default.unbind(window, 'mousemove', onMouseDrag); - _dom2.default.unbind(window, 'mouseup', onMouseUp); - if (_this.__onFinishChange) { - _this.__onFinishChange.call(_this, _this.getValue()); - } - } - - _this2.updateDisplay(); - - _this2.__background.appendChild(_this2.__foreground); - _this2.domElement.appendChild(_this2.__background); - return _this2; - } - - NumberControllerSlider.prototype.updateDisplay = function updateDisplay() { - var pct = (this.getValue() - this.__min) / (this.__max - this.__min); - this.__foreground.style.width = pct * 100 + '%'; - return _NumberController.prototype.updateDisplay.call(this); - }; - - return NumberControllerSlider; - }(_NumberController3.default); - - exports.default = NumberControllerSlider; - module.exports = exports['default']; - -/***/ }, -/* 15 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _Controller2 = __webpack_require__(7); - - var _Controller3 = _interopRequireDefault(_Controller2); - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - /** - * @class Provides a GUI interface to fire a specified method, a property of an object. - * - * @extends dat.controllers.Controller - * - * @param {Object} object The object to be manipulated - * @param {string} property The name of the property to be manipulated - */ - var FunctionController = function (_Controller) { - _inherits(FunctionController, _Controller); - - function FunctionController(object, property, text) { - _classCallCheck(this, FunctionController); - - var _this2 = _possibleConstructorReturn(this, _Controller.call(this, object, property)); - - var _this = _this2; - - _this2.__button = document.createElement('div'); - _this2.__button.innerHTML = text === undefined ? 'Fire' : text; - - _dom2.default.bind(_this2.__button, 'click', function (e) { - e.preventDefault(); - _this.fire(); - return false; - }); - - _dom2.default.addClass(_this2.__button, 'button'); - - _this2.domElement.appendChild(_this2.__button); - return _this2; - } - - FunctionController.prototype.fire = function fire() { - if (this.__onChange) { - this.__onChange.call(this); - } - this.getValue().call(this.object); - if (this.__onFinishChange) { - this.__onFinishChange.call(this, this.getValue()); - } - }; - - return FunctionController; - }(_Controller3.default); - - exports.default = FunctionController; - module.exports = exports['default']; - -/***/ }, -/* 16 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _Controller2 = __webpack_require__(7); - - var _Controller3 = _interopRequireDefault(_Controller2); - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - var _Color = __webpack_require__(2); - - var _Color2 = _interopRequireDefault(_Color); - - var _interpret = __webpack_require__(3); - - var _interpret2 = _interopRequireDefault(_interpret); - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - - function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - - function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - /** - * @class Represents a given property of an object that is a color. - * @param {Object} object - * @param {string} property - */ - var ColorController = function (_Controller) { - _inherits(ColorController, _Controller); - - function ColorController(object, property) { - _classCallCheck(this, ColorController); - - var _this2 = _possibleConstructorReturn(this, _Controller.call(this, object, property)); - - _this2.__color = new _Color2.default(_this2.getValue()); - _this2.__temp = new _Color2.default(0); - - var _this = _this2; - - _this2.domElement = document.createElement('div'); - - _dom2.default.makeSelectable(_this2.domElement, false); - - _this2.__selector = document.createElement('div'); - _this2.__selector.className = 'selector'; - - _this2.__saturation_field = document.createElement('div'); - _this2.__saturation_field.className = 'saturation-field'; - - _this2.__field_knob = document.createElement('div'); - _this2.__field_knob.className = 'field-knob'; - _this2.__field_knob_border = '2px solid '; - - _this2.__hue_knob = document.createElement('div'); - _this2.__hue_knob.className = 'hue-knob'; - - _this2.__hue_field = document.createElement('div'); - _this2.__hue_field.className = 'hue-field'; - - _this2.__input = document.createElement('input'); - _this2.__input.type = 'text'; - _this2.__input_textShadow = '0 1px 1px '; - - _dom2.default.bind(_this2.__input, 'keydown', function (e) { - if (e.keyCode === 13) { - // on enter - onBlur.call(this); - } - }); - - _dom2.default.bind(_this2.__input, 'blur', onBlur); - - _dom2.default.bind(_this2.__selector, 'mousedown', function () /* e */{ - _dom2.default.addClass(this, 'drag').bind(window, 'mouseup', function () /* e */{ - _dom2.default.removeClass(_this.__selector, 'drag'); - }); - }); - - var valueField = document.createElement('div'); - - _common2.default.extend(_this2.__selector.style, { - width: '122px', - height: '102px', - padding: '3px', - backgroundColor: '#222', - boxShadow: '0px 1px 3px rgba(0,0,0,0.3)' - }); - - _common2.default.extend(_this2.__field_knob.style, { - position: 'absolute', - width: '12px', - height: '12px', - border: _this2.__field_knob_border + (_this2.__color.v < 0.5 ? '#fff' : '#000'), - boxShadow: '0px 1px 3px rgba(0,0,0,0.5)', - borderRadius: '12px', - zIndex: 1 - }); - - _common2.default.extend(_this2.__hue_knob.style, { - position: 'absolute', - width: '15px', - height: '2px', - borderRight: '4px solid #fff', - zIndex: 1 - }); - - _common2.default.extend(_this2.__saturation_field.style, { - width: '100px', - height: '100px', - border: '1px solid #555', - marginRight: '3px', - display: 'inline-block', - cursor: 'pointer' - }); - - _common2.default.extend(valueField.style, { - width: '100%', - height: '100%', - background: 'none' - }); - - linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000'); - - _common2.default.extend(_this2.__hue_field.style, { - width: '15px', - height: '100px', - border: '1px solid #555', - cursor: 'ns-resize', - position: 'absolute', - top: '3px', - right: '3px' - }); - - hueGradient(_this2.__hue_field); - - _common2.default.extend(_this2.__input.style, { - outline: 'none', - // width: '120px', - textAlign: 'center', - // padding: '4px', - // marginBottom: '6px', - color: '#fff', - border: 0, - fontWeight: 'bold', - textShadow: _this2.__input_textShadow + 'rgba(0,0,0,0.7)' - }); - - _dom2.default.bind(_this2.__saturation_field, 'mousedown', fieldDown); - _dom2.default.bind(_this2.__field_knob, 'mousedown', fieldDown); - - _dom2.default.bind(_this2.__hue_field, 'mousedown', function (e) { - setH(e); - _dom2.default.bind(window, 'mousemove', setH); - _dom2.default.bind(window, 'mouseup', fieldUpH); - }); - - function fieldDown(e) { - setSV(e); - // document.body.style.cursor = 'none'; - _dom2.default.bind(window, 'mousemove', setSV); - _dom2.default.bind(window, 'mouseup', fieldUpSV); - } - - function fieldUpSV() { - _dom2.default.unbind(window, 'mousemove', setSV); - _dom2.default.unbind(window, 'mouseup', fieldUpSV); - // document.body.style.cursor = 'default'; - onFinish(); - } - - function onBlur() { - var i = (0, _interpret2.default)(this.value); - if (i !== false) { - _this.__color.__state = i; - _this.setValue(_this.__color.toOriginal()); - } else { - this.value = _this.__color.toString(); - } - } - - function fieldUpH() { - _dom2.default.unbind(window, 'mousemove', setH); - _dom2.default.unbind(window, 'mouseup', fieldUpH); - onFinish(); - } - - function onFinish() { - if (_this.__onFinishChange) { - _this.__onFinishChange.call(_this, _this.__color.toOriginal()); - } - } - - _this2.__saturation_field.appendChild(valueField); - _this2.__selector.appendChild(_this2.__field_knob); - _this2.__selector.appendChild(_this2.__saturation_field); - _this2.__selector.appendChild(_this2.__hue_field); - _this2.__hue_field.appendChild(_this2.__hue_knob); - - _this2.domElement.appendChild(_this2.__input); - _this2.domElement.appendChild(_this2.__selector); - - _this2.updateDisplay(); - - function setSV(e) { - e.preventDefault(); - - var fieldRect = _this.__saturation_field.getBoundingClientRect(); - var s = (e.clientX - fieldRect.left) / (fieldRect.right - fieldRect.left); - var v = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top); - - if (v > 1) { - v = 1; - } else if (v < 0) { - v = 0; - } - - if (s > 1) { - s = 1; - } else if (s < 0) { - s = 0; - } - - _this.__color.v = v; - _this.__color.s = s; - - _this.setValue(_this.__color.toOriginal()); - - return false; - } - - function setH(e) { - e.preventDefault(); - - var fieldRect = _this.__hue_field.getBoundingClientRect(); - var h = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top); - - if (h > 1) { - h = 1; - } else if (h < 0) { - h = 0; - } - - _this.__color.h = h * 360; - - _this.setValue(_this.__color.toOriginal()); - - return false; - } - return _this2; - } - - ColorController.prototype.updateDisplay = function updateDisplay() { - var i = (0, _interpret2.default)(this.getValue()); - - if (i !== false) { - var mismatch = false; - - // Check for mismatch on the interpreted value. - - _common2.default.each(_Color2.default.COMPONENTS, function (component) { - if (!_common2.default.isUndefined(i[component]) && !_common2.default.isUndefined(this.__color.__state[component]) && i[component] !== this.__color.__state[component]) { - mismatch = true; - return {}; // break - } - }, this); - - // If nothing diverges, we keep our previous values - // for statefulness, otherwise we recalculate fresh - if (mismatch) { - _common2.default.extend(this.__color.__state, i); - } - } - - _common2.default.extend(this.__temp.__state, this.__color.__state); - - this.__temp.a = 1; - - var flip = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0; - var _flip = 255 - flip; - - _common2.default.extend(this.__field_knob.style, { - marginLeft: 100 * this.__color.s - 7 + 'px', - marginTop: 100 * (1 - this.__color.v) - 7 + 'px', - backgroundColor: this.__temp.toHexString(), - border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')' - }); - - this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px'; - - this.__temp.s = 1; - this.__temp.v = 1; - - linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString()); - - this.__input.value = this.__color.toString(); - - _common2.default.extend(this.__input.style, { - backgroundColor: this.__color.toHexString(), - color: 'rgb(' + flip + ',' + flip + ',' + flip + ')', - textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)' - }); - }; - - return ColorController; - }(_Controller3.default); - - var vendors = ['-moz-', '-o-', '-webkit-', '-ms-', '']; - - function linearGradient(elem, x, a, b) { - elem.style.background = ''; - _common2.default.each(vendors, function (vendor) { - elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); '; - }); - } - - function hueGradient(elem) { - elem.style.background = ''; - elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'; - elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; - elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; - elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; - elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; - } - - exports.default = ColorController; - module.exports = exports['default']; - -/***/ }, -/* 17 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - var _css = __webpack_require__(18); - - var _css2 = _interopRequireDefault(_css); - - var _saveDialogue = __webpack_require__(19); - - var _saveDialogue2 = _interopRequireDefault(_saveDialogue); - - var _ControllerFactory = __webpack_require__(20); - - var _ControllerFactory2 = _interopRequireDefault(_ControllerFactory); - - var _Controller = __webpack_require__(7); - - var _Controller2 = _interopRequireDefault(_Controller); - - var _BooleanController = __webpack_require__(8); - - var _BooleanController2 = _interopRequireDefault(_BooleanController); - - var _FunctionController = __webpack_require__(15); - - var _FunctionController2 = _interopRequireDefault(_FunctionController); - - var _NumberControllerBox = __webpack_require__(13); - - var _NumberControllerBox2 = _interopRequireDefault(_NumberControllerBox); - - var _NumberControllerSlider = __webpack_require__(14); - - var _NumberControllerSlider2 = _interopRequireDefault(_NumberControllerSlider); - - var _ColorController = __webpack_require__(16); - - var _ColorController2 = _interopRequireDefault(_ColorController); - - var _requestAnimationFrame = __webpack_require__(21); - - var _requestAnimationFrame2 = _interopRequireDefault(_requestAnimationFrame); - - var _CenteredDiv = __webpack_require__(22); - - var _CenteredDiv2 = _interopRequireDefault(_CenteredDiv); - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - var _style = __webpack_require__(23); - - var _style2 = _interopRequireDefault(_style); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - // CSS to embed in build - - _css2.default.inject(_style2.default); - - /** @ignore Outer-most className for GUI's */ - var CSS_NAMESPACE = 'dg'; - - var HIDE_KEY_CODE = 72; - - /** @ignore The only value shared between the JS and SCSS. Use caution. */ - var CLOSE_BUTTON_HEIGHT = 20; - - var DEFAULT_DEFAULT_PRESET_NAME = 'Default'; - - var SUPPORTS_LOCAL_STORAGE = function () { - try { - return 'localStorage' in window && window.localStorage !== null; - } catch (e) { - return false; - } - }(); - - var SAVE_DIALOGUE = void 0; - - /** @ignore Have we yet to create an autoPlace GUI? */ - var autoPlaceVirgin = true; - - /** @ignore Fixed position div that auto place GUI's go inside */ - var autoPlaceContainer = void 0; - - /** @ignore Are we hiding the GUI's ? */ - var hide = false; - - /** @private GUI's which should be hidden */ - var hideableGuis = []; - - /** - * @class A lightweight controller library for JavaScript. It allows you to easily - * manipulate variables and fire functions on the fly. - * - * @typicalname gui - * - * @example - * // Creating a GUI with options. - * var gui = new dat.GUI({name: 'My GUI'}); - * - * @example - * // Creating a GUI and a subfolder. - * var gui = new dat.GUI(); - * var folder1 = gui.addFolder('Flow Field'); - * - * @param {Object} [params] - * @param {String} [params.name] The name of this GUI. - * @param {Object} [params.load] JSON object representing the saved state of - * this GUI. - * @param {Boolean} [params.auto=true] - * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in. - * @param {Boolean} [params.closed] If true, starts closed - * @param {Boolean} [params.closeOnTop] If true, close/open button shows on top of the GUI - */ - var GUI = function GUI(pars) { - var _this = this; - - var params = pars || {}; - - /** - * Outermost DOM Element - * @type {DOMElement} - */ - this.domElement = document.createElement('div'); - this.__ul = document.createElement('ul'); - this.domElement.appendChild(this.__ul); - - _dom2.default.addClass(this.domElement, CSS_NAMESPACE); - - /** - * Nested GUI's by name - * @ignore - */ - this.__folders = {}; - - this.__controllers = []; - - /** - * List of objects I'm remembering for save, only used in top level GUI - * @ignore - */ - this.__rememberedObjects = []; - - /** - * Maps the index of remembered objects to a map of controllers, only used - * in top level GUI. - * - * @private - * @ignore - * - * @example - * [ - * { - * propertyName: Controller, - * anotherPropertyName: Controller - * }, - * { - * propertyName: Controller - * } - * ] - */ - this.__rememberedObjectIndecesToControllers = []; - - this.__listening = []; - - // Default parameters - params = _common2.default.defaults(params, { - closeOnTop: false, - autoPlace: true, - width: GUI.DEFAULT_WIDTH - }); - - params = _common2.default.defaults(params, { - resizable: params.autoPlace, - hideable: params.autoPlace - }); - - if (!_common2.default.isUndefined(params.load)) { - // Explicit preset - if (params.preset) { - params.load.preset = params.preset; - } - } else { - params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME }; - } - - if (_common2.default.isUndefined(params.parent) && params.hideable) { - hideableGuis.push(this); - } - - // Only root level GUI's are resizable. - params.resizable = _common2.default.isUndefined(params.parent) && params.resizable; - - if (params.autoPlace && _common2.default.isUndefined(params.scrollable)) { - params.scrollable = true; - } - // params.scrollable = common.isUndefined(params.parent) && params.scrollable === true; - - // Not part of params because I don't want people passing this in via - // constructor. Should be a 'remembered' value. - var useLocalStorage = SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true'; - - var saveToLocalStorage = void 0; - - Object.defineProperties(this, - /** @lends GUI.prototype */ - { - /** - * The parent GUI - * @type dat.gui.GUI - */ - parent: { - get: function get() { - return params.parent; - } - }, - - scrollable: { - get: function get() { - return params.scrollable; - } - }, - - /** - * Handles GUI's element placement for you - * @type Boolean - */ - autoPlace: { - get: function get() { - return params.autoPlace; - } - }, - - /** - * Handles GUI's position of open/close button - * @type Boolean - */ - closeOnTop: { - get: function get() { - return params.closeOnTop; - } - }, - - /** - * The identifier for a set of saved values - * @type String - */ - preset: { - get: function get() { - if (_this.parent) { - return _this.getRoot().preset; - } - - return params.load.preset; - }, - - set: function set(v) { - if (_this.parent) { - _this.getRoot().preset = v; - } else { - params.load.preset = v; - } - setPresetSelectIndex(this); - _this.revert(); - } - }, - - /** - * The width of GUI element - * @type Number - */ - width: { - get: function get() { - return params.width; - }, - set: function set(v) { - params.width = v; - setWidth(_this, v); - } - }, - - /** - * The name of GUI. Used for folders. i.e - * a folder's name - * @type String - */ - name: { - get: function get() { - return params.name; - }, - set: function set(v) { - // TODO Check for collisions among sibling folders - params.name = v; - if (titleRowName) { - titleRowName.innerHTML = params.name; - } - } - }, - - /** - * Whether the GUI is collapsed or not - * @type Boolean - */ - closed: { - get: function get() { - return params.closed; - }, - set: function set(v) { - params.closed = v; - if (params.closed) { - _dom2.default.addClass(_this.__ul, GUI.CLASS_CLOSED); - } else { - _dom2.default.removeClass(_this.__ul, GUI.CLASS_CLOSED); - } - // For browsers that aren't going to respect the CSS transition, - // Lets just check our height against the window height right off - // the bat. - this.onResize(); - - if (_this.__closeButton) { - _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED; - } - } - }, - - /** - * Contains all presets - * @type Object - */ - load: { - get: function get() { - return params.load; - } - }, - - /** - * Determines whether or not to use localStorage as the means for - * remembering - * @type Boolean - */ - useLocalStorage: { - - get: function get() { - return useLocalStorage; - }, - set: function set(bool) { - if (SUPPORTS_LOCAL_STORAGE) { - useLocalStorage = bool; - if (bool) { - _dom2.default.bind(window, 'unload', saveToLocalStorage); - } else { - _dom2.default.unbind(window, 'unload', saveToLocalStorage); - } - localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool); - } - } - } - }); - - // Are we a root level GUI? - if (_common2.default.isUndefined(params.parent)) { - params.closed = false; - - _dom2.default.addClass(this.domElement, GUI.CLASS_MAIN); - _dom2.default.makeSelectable(this.domElement, false); - - // Are we supposed to be loading locally? - if (SUPPORTS_LOCAL_STORAGE) { - if (useLocalStorage) { - _this.useLocalStorage = true; - - var savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui')); - - if (savedGui) { - params.load = JSON.parse(savedGui); - } - } - } - - this.__closeButton = document.createElement('div'); - this.__closeButton.innerHTML = GUI.TEXT_CLOSED; - _dom2.default.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON); - if (params.closeOnTop) { - _dom2.default.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP); - this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]); - } else { - _dom2.default.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM); - this.domElement.appendChild(this.__closeButton); - } - - _dom2.default.bind(this.__closeButton, 'click', function () { - _this.closed = !_this.closed; - }); - // Oh, you're a nested GUI! - } else { - if (params.closed === undefined) { - params.closed = true; - } - - var _titleRowName = document.createTextNode(params.name); - _dom2.default.addClass(_titleRowName, 'controller-name'); - - var titleRow = addRow(_this, _titleRowName); - - var onClickTitle = function onClickTitle(e) { - e.preventDefault(); - _this.closed = !_this.closed; - return false; - }; - - _dom2.default.addClass(this.__ul, GUI.CLASS_CLOSED); - - _dom2.default.addClass(titleRow, 'title'); - _dom2.default.bind(titleRow, 'click', onClickTitle); - - if (!params.closed) { - this.closed = false; - } - } - - if (params.autoPlace) { - if (_common2.default.isUndefined(params.parent)) { - if (autoPlaceVirgin) { - autoPlaceContainer = document.createElement('div'); - _dom2.default.addClass(autoPlaceContainer, CSS_NAMESPACE); - _dom2.default.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER); - document.body.appendChild(autoPlaceContainer); - autoPlaceVirgin = false; - } - - // Put it in the dom for you. - autoPlaceContainer.appendChild(this.domElement); - - // Apply the auto styles - _dom2.default.addClass(this.domElement, GUI.CLASS_AUTO_PLACE); - } - - // Make it not elastic. - if (!this.parent) { - setWidth(_this, params.width); - } - } - - this.__resizeHandler = function () { - _this.onResizeDebounced(); - }; - - _dom2.default.bind(window, 'resize', this.__resizeHandler); - _dom2.default.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler); - _dom2.default.bind(this.__ul, 'transitionend', this.__resizeHandler); - _dom2.default.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler); - this.onResize(); - - if (params.resizable) { - addResizeHandle(this); - } - - saveToLocalStorage = function saveToLocalStorage() { - if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') { - localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject())); - } - }; - - // expose this method publicly - this.saveToLocalStorageIfPossible = saveToLocalStorage; - - function resetWidth() { - var root = _this.getRoot(); - root.width += 1; - _common2.default.defer(function () { - root.width -= 1; - }); - } - - if (!params.parent) { - resetWidth(); - } - }; - - GUI.toggleHide = function () { - hide = !hide; - _common2.default.each(hideableGuis, function (gui) { - gui.domElement.style.display = hide ? 'none' : ''; - }); - }; - - GUI.CLASS_AUTO_PLACE = 'a'; - GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac'; - GUI.CLASS_MAIN = 'main'; - GUI.CLASS_CONTROLLER_ROW = 'cr'; - GUI.CLASS_TOO_TALL = 'taller-than-window'; - GUI.CLASS_CLOSED = 'closed'; - GUI.CLASS_CLOSE_BUTTON = 'close-button'; - GUI.CLASS_CLOSE_TOP = 'close-top'; - GUI.CLASS_CLOSE_BOTTOM = 'close-bottom'; - GUI.CLASS_DRAG = 'drag'; - - GUI.DEFAULT_WIDTH = 245; - GUI.TEXT_CLOSED = 'Close Controls'; - GUI.TEXT_OPEN = 'Open Controls'; - - GUI._keydownHandler = function (e) { - if (document.activeElement.type !== 'text' && (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) { - GUI.toggleHide(); - } - }; - _dom2.default.bind(window, 'keydown', GUI._keydownHandler, false); - - _common2.default.extend(GUI.prototype, - - /** @lends GUI.prototype */ - { - - /** - * Adds a new {@link Controller} to the GUI. The type of controller created - * is inferred from the initial value of object[property]. For - * color properties, see {@link addColor}. - * - * @param {Object} object The object to be manipulated - * @param {String} property The name of the property to be manipulated - * @param {Number} [min] Minimum allowed value - * @param {Number} [max] Maximum allowed value - * @param {Number} [step] Increment by which to change value - * @returns {Controller} The controller that was added to the GUI. - * @instance - * - * @example - * // Add a string controller. - * var person = {name: 'Sam'}; - * gui.add(person, 'name'); - * - * @example - * // Add a number controller slider. - * var person = {age: 45}; - * gui.add(person, 'age', 0, 100); - */ - add: function add(object, property) { - return _add(this, object, property, { - factoryArgs: Array.prototype.slice.call(arguments, 2) - }); - }, - - /** - * Adds a new color controller to the GUI. - * - * @param object - * @param property - * @returns {Controller} The controller that was added to the GUI. - * @instance - * - * @example - * var palette = { - * color1: '#FF0000', // CSS string - * color2: [ 0, 128, 255 ], // RGB array - * color3: [ 0, 128, 255, 0.3 ], // RGB with alpha - * color4: { h: 350, s: 0.9, v: 0.3 } // Hue, saturation, value - * }; - * gui.addColor(palette, 'color1'); - * gui.addColor(palette, 'color2'); - * gui.addColor(palette, 'color3'); - * gui.addColor(palette, 'color4'); - */ - addColor: function addColor(object, property) { - return _add(this, object, property, { - color: true - }); - }, - - /** - * Removes the given controller from the GUI. - * @param {Controller} controller - * @instance - */ - remove: function remove(controller) { - // TODO listening? - this.__ul.removeChild(controller.__li); - this.__controllers.splice(this.__controllers.indexOf(controller), 1); - var _this = this; - _common2.default.defer(function () { - _this.onResize(); - }); - }, - - /** - * Removes the GUI from the document and unbinds all event listeners. - * @instance - */ - destroy: function destroy() { - if (this.autoPlace) { - autoPlaceContainer.removeChild(this.domElement); - } - - _dom2.default.unbind(window, 'keydown', GUI._keydownHandler, false); - _dom2.default.unbind(window, 'resize', this.__resizeHandler); - - if (this.saveToLocalStorageIfPossible) { - _dom2.default.unbind(window, 'unload', this.saveToLocalStorageIfPossible); - } - }, - - /** - * Creates a new subfolder GUI instance. - * @param name - * @returns {dat.gui.GUI} The new folder. - * @throws {Error} if this GUI already has a folder by the specified - * name - * @instance - */ - addFolder: function addFolder(name) { - // We have to prevent collisions on names in order to have a key - // by which to remember saved values - if (this.__folders[name] !== undefined) { - throw new Error('You already have a folder in this GUI by the' + ' name "' + name + '"'); - } - - var newGuiParams = { name: name, parent: this }; - - // We need to pass down the autoPlace trait so that we can - // attach event listeners to open/close folder actions to - // ensure that a scrollbar appears if the window is too short. - newGuiParams.autoPlace = this.autoPlace; - - // Do we have saved appearance data for this folder? - if (this.load && // Anything loaded? - this.load.folders && // Was my parent a dead-end? - this.load.folders[name]) { - // Did daddy remember me? - // Start me closed if I was closed - newGuiParams.closed = this.load.folders[name].closed; - - // Pass down the loaded data - newGuiParams.load = this.load.folders[name]; - } - - var gui = new GUI(newGuiParams); - this.__folders[name] = gui; - - var li = addRow(this, gui.domElement); - _dom2.default.addClass(li, 'folder'); - return gui; - }, - - /** - * Opens the GUI. - */ - open: function open() { - this.closed = false; - }, - - /** - * Closes the GUI. - */ - close: function close() { - this.closed = true; - }, - - onResize: function onResize() { - // we debounce this function to prevent performance issues when rotating on tablet/mobile - var root = this.getRoot(); - if (root.scrollable) { - var top = _dom2.default.getOffset(root.__ul).top; - var h = 0; - - _common2.default.each(root.__ul.childNodes, function (node) { - if (!(root.autoPlace && node === root.__save_row)) { - h += _dom2.default.getHeight(node); - } - }); - - if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) { - _dom2.default.addClass(root.domElement, GUI.CLASS_TOO_TALL); - root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px'; - } else { - _dom2.default.removeClass(root.domElement, GUI.CLASS_TOO_TALL); - root.__ul.style.height = 'auto'; - } - } - - if (root.__resize_handle) { - _common2.default.defer(function () { - root.__resize_handle.style.height = root.__ul.offsetHeight + 'px'; - }); - } - - if (root.__closeButton) { - root.__closeButton.style.width = root.width + 'px'; - } - }, - - onResizeDebounced: _common2.default.debounce(function () { - this.onResize(); - }, 50), - - /** - * Mark objects for saving. The order of these objects cannot change as - * the GUI grows. When remembering new objects, append them to the end - * of the list. - * - * @param {...Object} objects - * @throws {Error} if not called on a top level GUI. - * @instance - * @ignore - */ - remember: function remember() { - if (_common2.default.isUndefined(SAVE_DIALOGUE)) { - SAVE_DIALOGUE = new _CenteredDiv2.default(); - SAVE_DIALOGUE.domElement.innerHTML = _saveDialogue2.default; - } - - if (this.parent) { - throw new Error('You can only call remember on a top level GUI.'); - } - - var _this = this; - - _common2.default.each(Array.prototype.slice.call(arguments), function (object) { - if (_this.__rememberedObjects.length === 0) { - addSaveMenu(_this); - } - if (_this.__rememberedObjects.indexOf(object) === -1) { - _this.__rememberedObjects.push(object); - } - }); - - if (this.autoPlace) { - // Set save row width - setWidth(this, this.width); - } - }, - - /** - * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI. - * @instance - */ - getRoot: function getRoot() { - var gui = this; - while (gui.parent) { - gui = gui.parent; - } - return gui; - }, - - /** - * @returns {Object} a JSON object representing the current state of - * this GUI as well as its remembered properties. - * @instance - */ - getSaveObject: function getSaveObject() { - var toReturn = this.load; - toReturn.closed = this.closed; - - // Am I remembering any values? - if (this.__rememberedObjects.length > 0) { - toReturn.preset = this.preset; - - if (!toReturn.remembered) { - toReturn.remembered = {}; - } - - toReturn.remembered[this.preset] = getCurrentPreset(this); - } - - toReturn.folders = {}; - _common2.default.each(this.__folders, function (element, key) { - toReturn.folders[key] = element.getSaveObject(); - }); - - return toReturn; - }, - - save: function save() { - if (!this.load.remembered) { - this.load.remembered = {}; - } - - this.load.remembered[this.preset] = getCurrentPreset(this); - markPresetModified(this, false); - this.saveToLocalStorageIfPossible(); - }, - - saveAs: function saveAs(presetName) { - if (!this.load.remembered) { - // Retain default values upon first save - this.load.remembered = {}; - this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true); - } - - this.load.remembered[presetName] = getCurrentPreset(this); - this.preset = presetName; - addPresetOption(this, presetName, true); - this.saveToLocalStorageIfPossible(); - }, - - revert: function revert(gui) { - _common2.default.each(this.__controllers, function (controller) { - // Make revert work on Default. - if (!this.getRoot().load.remembered) { - controller.setValue(controller.initialValue); - } else { - recallSavedValue(gui || this.getRoot(), controller); - } - - // fire onFinishChange callback - if (controller.__onFinishChange) { - controller.__onFinishChange.call(controller, controller.getValue()); - } - }, this); - - _common2.default.each(this.__folders, function (folder) { - folder.revert(folder); - }); - - if (!gui) { - markPresetModified(this.getRoot(), false); - } - }, - - listen: function listen(controller) { - var init = this.__listening.length === 0; - this.__listening.push(controller); - if (init) { - updateDisplays(this.__listening); - } - }, - - updateDisplay: function updateDisplay() { - _common2.default.each(this.__controllers, function (controller) { - controller.updateDisplay(); - }); - _common2.default.each(this.__folders, function (folder) { - folder.updateDisplay(); - }); - } - }); - - /** - * Add a row to the end of the GUI or before another row. - * - * @param gui - * @param [newDom] If specified, inserts the dom content in the new row - * @param [liBefore] If specified, places the new row before another row - * - * @ignore - */ - function addRow(gui, newDom, liBefore) { - var li = document.createElement('li'); - if (newDom) { - li.appendChild(newDom); - } - - if (liBefore) { - gui.__ul.insertBefore(li, liBefore); - } else { - gui.__ul.appendChild(li); - } - gui.onResize(); - return li; - } - - function markPresetModified(gui, modified) { - var opt = gui.__preset_select[gui.__preset_select.selectedIndex]; - - // console.log('mark', modified, opt); - if (modified) { - opt.innerHTML = opt.value + '*'; - } else { - opt.innerHTML = opt.value; - } - } - - function augmentController(gui, li, controller) { - controller.__li = li; - controller.__gui = gui; - - _common2.default.extend(controller, { - options: function options(_options) { - if (arguments.length > 1) { - var nextSibling = controller.__li.nextElementSibling; - controller.remove(); - - return _add(gui, controller.object, controller.property, { - before: nextSibling, - factoryArgs: [_common2.default.toArray(arguments)] - }); - } - - if (_common2.default.isArray(_options) || _common2.default.isObject(_options)) { - var _nextSibling = controller.__li.nextElementSibling; - controller.remove(); - - return _add(gui, controller.object, controller.property, { - before: _nextSibling, - factoryArgs: [_options] - }); - } - }, - - name: function name(v) { - controller.__li.firstElementChild.firstElementChild.innerHTML = v; - return controller; - }, - - listen: function listen() { - controller.__gui.listen(controller); - return controller; - }, - - remove: function remove() { - controller.__gui.remove(controller); - return controller; - } - }); - - // All sliders should be accompanied by a box. - if (controller instanceof _NumberControllerSlider2.default) { - var box = new _NumberControllerBox2.default(controller.object, controller.property, { min: controller.__min, max: controller.__max, step: controller.__step }); - - _common2.default.each(['updateDisplay', 'onChange', 'onFinishChange', 'step'], function (method) { - var pc = controller[method]; - var pb = box[method]; - controller[method] = box[method] = function () { - var args = Array.prototype.slice.call(arguments); - pb.apply(box, args); - return pc.apply(controller, args); - }; - }); - - _dom2.default.addClass(li, 'has-slider'); - controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild); - } else if (controller instanceof _NumberControllerBox2.default) { - var r = function r(returned) { - // Have we defined both boundaries? - if (_common2.default.isNumber(controller.__min) && _common2.default.isNumber(controller.__max)) { - // Well, then lets just replace this with a slider. - - // lets remember if the old controller had a specific name or was listening - var oldName = controller.__li.firstElementChild.firstElementChild.innerHTML; - var wasListening = controller.__gui.__listening.indexOf(controller) > -1; - - controller.remove(); - var newController = _add(gui, controller.object, controller.property, { - before: controller.__li.nextElementSibling, - factoryArgs: [controller.__min, controller.__max, controller.__step] - }); - - newController.name(oldName); - if (wasListening) newController.listen(); - - return newController; - } - - return returned; - }; - - controller.min = _common2.default.compose(r, controller.min); - controller.max = _common2.default.compose(r, controller.max); - } else if (controller instanceof _BooleanController2.default) { - _dom2.default.bind(li, 'click', function () { - _dom2.default.fakeEvent(controller.__checkbox, 'click'); - }); - - _dom2.default.bind(controller.__checkbox, 'click', function (e) { - e.stopPropagation(); // Prevents double-toggle - }); - } else if (controller instanceof _FunctionController2.default) { - _dom2.default.bind(li, 'click', function () { - _dom2.default.fakeEvent(controller.__button, 'click'); - }); - - _dom2.default.bind(li, 'mouseover', function () { - _dom2.default.addClass(controller.__button, 'hover'); - }); - - _dom2.default.bind(li, 'mouseout', function () { - _dom2.default.removeClass(controller.__button, 'hover'); - }); - } else if (controller instanceof _ColorController2.default) { - _dom2.default.addClass(li, 'color'); - controller.updateDisplay = _common2.default.compose(function (val) { - li.style.borderLeftColor = controller.__color.toString(); - return val; - }, controller.updateDisplay); - - controller.updateDisplay(); - } - - controller.setValue = _common2.default.compose(function (val) { - if (gui.getRoot().__preset_select && controller.isModified()) { - markPresetModified(gui.getRoot(), true); - } - - return val; - }, controller.setValue); - } - - function recallSavedValue(gui, controller) { - // Find the topmost GUI, that's where remembered objects live. - var root = gui.getRoot(); - - // Does the object we're controlling match anything we've been told to - // remember? - var matchedIndex = root.__rememberedObjects.indexOf(controller.object); - - // Why yes, it does! - if (matchedIndex !== -1) { - // Let me fetch a map of controllers for thcommon.isObject. - var controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex]; - - // Ohp, I believe this is the first controller we've created for this - // object. Lets make the map fresh. - if (controllerMap === undefined) { - controllerMap = {}; - root.__rememberedObjectIndecesToControllers[matchedIndex] = controllerMap; - } - - // Keep track of this controller - controllerMap[controller.property] = controller; - - // Okay, now have we saved any values for this controller? - if (root.load && root.load.remembered) { - var presetMap = root.load.remembered; - - // Which preset are we trying to load? - var preset = void 0; - - if (presetMap[gui.preset]) { - preset = presetMap[gui.preset]; - } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) { - // Uhh, you can have the default instead? - preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME]; - } else { - // Nada. - return; - } - - // Did the loaded object remember thcommon.isObject? && Did we remember this particular property? - if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) { - // We did remember something for this guy ... - var value = preset[matchedIndex][controller.property]; - - // And that's what it is. - controller.initialValue = value; - controller.setValue(value); - } - } - } - } - - function _add(gui, object, property, params) { - if (object[property] === undefined) { - throw new Error('Object "' + object + '" has no property "' + property + '"'); - } - - var controller = void 0; - - if (params.color) { - controller = new _ColorController2.default(object, property); - } else { - var factoryArgs = [object, property].concat(params.factoryArgs); - controller = _ControllerFactory2.default.apply(gui, factoryArgs); - } - - if (params.before instanceof _Controller2.default) { - params.before = params.before.__li; - } - - recallSavedValue(gui, controller); - - _dom2.default.addClass(controller.domElement, 'c'); - - var name = document.createElement('span'); - _dom2.default.addClass(name, 'property-name'); - name.innerHTML = controller.property; - - var container = document.createElement('div'); - container.appendChild(name); - container.appendChild(controller.domElement); - - var li = addRow(gui, container, params.before); - - _dom2.default.addClass(li, GUI.CLASS_CONTROLLER_ROW); - if (controller instanceof _ColorController2.default) { - _dom2.default.addClass(li, 'color'); - } else { - _dom2.default.addClass(li, _typeof(controller.getValue())); - } - - augmentController(gui, li, controller); - - gui.__controllers.push(controller); - - return controller; - } - - function getLocalStorageHash(gui, key) { - // TODO how does this deal with multiple GUI's? - return document.location.href + '.' + key; - } - - function addPresetOption(gui, name, setSelected) { - var opt = document.createElement('option'); - opt.innerHTML = name; - opt.value = name; - gui.__preset_select.appendChild(opt); - if (setSelected) { - gui.__preset_select.selectedIndex = gui.__preset_select.length - 1; - } - } - - function showHideExplain(gui, explain) { - explain.style.display = gui.useLocalStorage ? 'block' : 'none'; - } - - function addSaveMenu(gui) { - var div = gui.__save_row = document.createElement('li'); - - _dom2.default.addClass(gui.domElement, 'has-save'); - - gui.__ul.insertBefore(div, gui.__ul.firstChild); - - _dom2.default.addClass(div, 'save-row'); - - var gears = document.createElement('span'); - gears.innerHTML = ' '; - _dom2.default.addClass(gears, 'button gears'); - - // TODO replace with FunctionController - var button = document.createElement('span'); - button.innerHTML = 'Save'; - _dom2.default.addClass(button, 'button'); - _dom2.default.addClass(button, 'save'); - - var button2 = document.createElement('span'); - button2.innerHTML = 'New'; - _dom2.default.addClass(button2, 'button'); - _dom2.default.addClass(button2, 'save-as'); - - var button3 = document.createElement('span'); - button3.innerHTML = 'Revert'; - _dom2.default.addClass(button3, 'button'); - _dom2.default.addClass(button3, 'revert'); - - var select = gui.__preset_select = document.createElement('select'); - - if (gui.load && gui.load.remembered) { - _common2.default.each(gui.load.remembered, function (value, key) { - addPresetOption(gui, key, key === gui.preset); - }); - } else { - addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false); - } - - _dom2.default.bind(select, 'change', function () { - for (var index = 0; index < gui.__preset_select.length; index++) { - gui.__preset_select[index].innerHTML = gui.__preset_select[index].value; - } - - gui.preset = this.value; - }); - - div.appendChild(select); - div.appendChild(gears); - div.appendChild(button); - div.appendChild(button2); - div.appendChild(button3); - - if (SUPPORTS_LOCAL_STORAGE) { - var explain = document.getElementById('dg-local-explain'); - var localStorageCheckBox = document.getElementById('dg-local-storage'); - var saveLocally = document.getElementById('dg-save-locally'); - - saveLocally.style.display = 'block'; - - if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') { - localStorageCheckBox.setAttribute('checked', 'checked'); - } - - showHideExplain(gui, explain); - - // TODO: Use a boolean controller, fool! - _dom2.default.bind(localStorageCheckBox, 'change', function () { - gui.useLocalStorage = !gui.useLocalStorage; - showHideExplain(gui, explain); - }); - } - - var newConstructorTextArea = document.getElementById('dg-new-constructor'); - - _dom2.default.bind(newConstructorTextArea, 'keydown', function (e) { - if (e.metaKey && (e.which === 67 || e.keyCode === 67)) { - SAVE_DIALOGUE.hide(); - } - }); - - _dom2.default.bind(gears, 'click', function () { - newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2); - SAVE_DIALOGUE.show(); - newConstructorTextArea.focus(); - newConstructorTextArea.select(); - }); - - _dom2.default.bind(button, 'click', function () { - gui.save(); - }); - - _dom2.default.bind(button2, 'click', function () { - var presetName = prompt('Enter a new preset name.'); - if (presetName) { - gui.saveAs(presetName); - } - }); - - _dom2.default.bind(button3, 'click', function () { - gui.revert(); - }); - - // div.appendChild(button2); - } - - function addResizeHandle(gui) { - var pmouseX = void 0; - - gui.__resize_handle = document.createElement('div'); - - _common2.default.extend(gui.__resize_handle.style, { - - width: '6px', - marginLeft: '-3px', - height: '200px', - cursor: 'ew-resize', - position: 'absolute' - // border: '1px solid blue' - - }); - - function drag(e) { - e.preventDefault(); - - gui.width += pmouseX - e.clientX; - gui.onResize(); - pmouseX = e.clientX; - - return false; - } - - function dragStop() { - _dom2.default.removeClass(gui.__closeButton, GUI.CLASS_DRAG); - _dom2.default.unbind(window, 'mousemove', drag); - _dom2.default.unbind(window, 'mouseup', dragStop); - } - - function dragStart(e) { - e.preventDefault(); - - pmouseX = e.clientX; - - _dom2.default.addClass(gui.__closeButton, GUI.CLASS_DRAG); - _dom2.default.bind(window, 'mousemove', drag); - _dom2.default.bind(window, 'mouseup', dragStop); - - return false; - } - - _dom2.default.bind(gui.__resize_handle, 'mousedown', dragStart); - _dom2.default.bind(gui.__closeButton, 'mousedown', dragStart); - - gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild); - } - - function setWidth(gui, w) { - gui.domElement.style.width = w + 'px'; - // Auto placed save-rows are position fixed, so we have to - // set the width manually if we want it to bleed to the edge - if (gui.__save_row && gui.autoPlace) { - gui.__save_row.style.width = w + 'px'; - } - if (gui.__closeButton) { - gui.__closeButton.style.width = w + 'px'; - } - } - - function getCurrentPreset(gui, useInitialValues) { - var toReturn = {}; - - // For each object I'm remembering - _common2.default.each(gui.__rememberedObjects, function (val, index) { - var savedValues = {}; - - // The controllers I've made for thcommon.isObject by property - var controllerMap = gui.__rememberedObjectIndecesToControllers[index]; - - // Remember each value for each property - _common2.default.each(controllerMap, function (controller, property) { - savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue(); - }); - - // Save the values for thcommon.isObject - toReturn[index] = savedValues; - }); - - return toReturn; - } - - function setPresetSelectIndex(gui) { - for (var index = 0; index < gui.__preset_select.length; index++) { - if (gui.__preset_select[index].value === gui.preset) { - gui.__preset_select.selectedIndex = index; - } - } - } - - function updateDisplays(controllerArray) { - if (controllerArray.length !== 0) { - _requestAnimationFrame2.default.call(window, function () { - updateDisplays(controllerArray); - }); - } - - _common2.default.each(controllerArray, function (c) { - c.updateDisplay(); - }); - } - - exports.default = GUI; - module.exports = exports['default']; - -/***/ }, -/* 18 */ -/***/ function(module, exports) { - - 'use strict'; - - /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - module.exports = { - load: function load(url, indoc) { - var doc = indoc || document; - var link = doc.createElement('link'); - link.type = 'text/css'; - link.rel = 'stylesheet'; - link.href = url; - doc.getElementsByTagName('head')[0].appendChild(link); - }, - - inject: function inject(css, indoc) { - var doc = indoc || document; - var injected = document.createElement('style'); - injected.type = 'text/css'; - injected.innerHTML = css; - var head = doc.getElementsByTagName('head')[0]; - try { - head.appendChild(injected); - } catch (e) {// Unable to inject CSS, probably because of a Content Security Policy - } - } - }; - -/***/ }, -/* 19 */ -/***/ function(module, exports) { - - module.exports = "
    \n\n Here's the new load parameter for your GUI's constructor:\n\n \n\n
    \n\n Automatically save\n values to localStorage on exit.\n\n
    The values saved to localStorage will\n override those passed to dat.GUI's constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
    \n\n
    \n\n
    "; - -/***/ }, -/* 20 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _OptionController = __webpack_require__(10); - - var _OptionController2 = _interopRequireDefault(_OptionController); - - var _NumberControllerBox = __webpack_require__(13); - - var _NumberControllerBox2 = _interopRequireDefault(_NumberControllerBox); - - var _NumberControllerSlider = __webpack_require__(14); - - var _NumberControllerSlider2 = _interopRequireDefault(_NumberControllerSlider); - - var _StringController = __webpack_require__(11); - - var _StringController2 = _interopRequireDefault(_StringController); - - var _FunctionController = __webpack_require__(15); - - var _FunctionController2 = _interopRequireDefault(_FunctionController); - - var _BooleanController = __webpack_require__(8); - - var _BooleanController2 = _interopRequireDefault(_BooleanController); - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var ControllerFactory = function ControllerFactory(object, property) { - var initialValue = object[property]; - - // Providing options? - if (_common2.default.isArray(arguments[2]) || _common2.default.isObject(arguments[2])) { - return new _OptionController2.default(object, property, arguments[2]); - } - - // Providing a map? - if (_common2.default.isNumber(initialValue)) { - // Has min and max? (slider) - if (_common2.default.isNumber(arguments[2]) && _common2.default.isNumber(arguments[3])) { - // has step? - if (_common2.default.isNumber(arguments[4])) { - return new _NumberControllerSlider2.default(object, property, arguments[2], arguments[3], arguments[4]); - } - - return new _NumberControllerSlider2.default(object, property, arguments[2], arguments[3]); - } - - // number box - if (_common2.default.isNumber(arguments[4])) { - // has step - return new _NumberControllerBox2.default(object, property, { min: arguments[2], max: arguments[3], step: arguments[4] }); - } - return new _NumberControllerBox2.default(object, property, { min: arguments[2], max: arguments[3] }); - } - - if (_common2.default.isString(initialValue)) { - return new _StringController2.default(object, property); - } - - if (_common2.default.isFunction(initialValue)) { - return new _FunctionController2.default(object, property, ''); - } - - if (_common2.default.isBoolean(initialValue)) { - return new _BooleanController2.default(object, property); - } - - return null; - }; /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - exports.default = ControllerFactory; - module.exports = exports['default']; - -/***/ }, -/* 21 */ -/***/ function(module, exports) { - - "use strict"; - - exports.__esModule = true; - /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - function requestAnimationFrame(callback) { - setTimeout(callback, 1000 / 60); - } - - exports.default = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || requestAnimationFrame; - module.exports = exports["default"]; - -/***/ }, -/* 22 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - exports.__esModule = true; - - var _dom = __webpack_require__(9); - - var _dom2 = _interopRequireDefault(_dom); - - var _common = __webpack_require__(5); - - var _common2 = _interopRequireDefault(_common); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - - var CenteredDiv = function () { - function CenteredDiv() { - _classCallCheck(this, CenteredDiv); - - this.backgroundElement = document.createElement('div'); - _common2.default.extend(this.backgroundElement.style, { - backgroundColor: 'rgba(0,0,0,0.8)', - top: 0, - left: 0, - display: 'none', - zIndex: '1000', - opacity: 0, - WebkitTransition: 'opacity 0.2s linear', - transition: 'opacity 0.2s linear' - }); - - _dom2.default.makeFullscreen(this.backgroundElement); - this.backgroundElement.style.position = 'fixed'; - - this.domElement = document.createElement('div'); - _common2.default.extend(this.domElement.style, { - position: 'fixed', - display: 'none', - zIndex: '1001', - opacity: 0, - WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear', - transition: 'transform 0.2s ease-out, opacity 0.2s linear' - }); - - document.body.appendChild(this.backgroundElement); - document.body.appendChild(this.domElement); - - var _this = this; - _dom2.default.bind(this.backgroundElement, 'click', function () { - _this.hide(); - }); - } - - CenteredDiv.prototype.show = function show() { - var _this = this; - - this.backgroundElement.style.display = 'block'; - - this.domElement.style.display = 'block'; - this.domElement.style.opacity = 0; - // this.domElement.style.top = '52%'; - this.domElement.style.webkitTransform = 'scale(1.1)'; - - this.layout(); - - _common2.default.defer(function () { - _this.backgroundElement.style.opacity = 1; - _this.domElement.style.opacity = 1; - _this.domElement.style.webkitTransform = 'scale(1)'; - }); - }; - - /** - * Hide centered div - */ - - - CenteredDiv.prototype.hide = function hide() { - var _this = this; - - var hide = function hide() { - _this.domElement.style.display = 'none'; - _this.backgroundElement.style.display = 'none'; - - _dom2.default.unbind(_this.domElement, 'webkitTransitionEnd', hide); - _dom2.default.unbind(_this.domElement, 'transitionend', hide); - _dom2.default.unbind(_this.domElement, 'oTransitionEnd', hide); - }; - - _dom2.default.bind(this.domElement, 'webkitTransitionEnd', hide); - _dom2.default.bind(this.domElement, 'transitionend', hide); - _dom2.default.bind(this.domElement, 'oTransitionEnd', hide); - - this.backgroundElement.style.opacity = 0; - // this.domElement.style.top = '48%'; - this.domElement.style.opacity = 0; - this.domElement.style.webkitTransform = 'scale(1.1)'; - }; - - CenteredDiv.prototype.layout = function layout() { - this.domElement.style.left = window.innerWidth / 2 - _dom2.default.getWidth(this.domElement) / 2 + 'px'; - this.domElement.style.top = window.innerHeight / 2 - _dom2.default.getHeight(this.domElement) / 2 + 'px'; - }; - - return CenteredDiv; - }(); - - exports.default = CenteredDiv; - module.exports = exports['default']; - -/***/ }, -/* 23 */ -/***/ function(module, exports, __webpack_require__) { - - exports = module.exports = __webpack_require__(24)(); - // imports - - - // module - exports.push([module.id, ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */\n /** allow overflow for color selector */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button.close-top {\n position: relative; }\n .dg.main .close-button.close-bottom {\n position: absolute; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-y: visible; }\n .dg.a.has-save > ul.close-top {\n margin-top: 0; }\n .dg.a.has-save > ul.close-bottom {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n top: 0;\n z-index: 1002; }\n .dg.a .save-row.close-top {\n position: relative; }\n .dg.a .save-row.close-bottom {\n position: fixed; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out;\n -webkit-transition: overflow 0.1s linear;\n -o-transition: overflow 0.1s linear;\n -moz-transition: overflow 0.1s linear;\n transition: overflow 0.1s linear; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid transparent; }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px;\n overflow: hidden; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%;\n position: relative; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 7px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .cr.color {\n overflow: visible; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row,
  • */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.color {\n border-left: 3px solid; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2FA1D6; }\n .dg .cr.number input[type=text] {\n color: #2FA1D6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2FA1D6;\n max-width: 100%; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", ""]); - - // exports - - -/***/ }, -/* 24 */ -/***/ function(module, exports) { - - /* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra - */ - // css base code, injected by the css-loader - module.exports = function() { - var list = []; - - // return the list of modules as css string - list.toString = function toString() { - var result = []; - for(var i = 0; i < this.length; i++) { - var item = this[i]; - if(item[2]) { - result.push("@media " + item[2] + "{" + item[1] + "}"); - } else { - result.push(item[1]); - } - } - return result.join(""); - }; - - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; - }; - - -/***/ } -/******/ ]) -}); -; -//# sourceMappingURL=dat.gui.js.map \ No newline at end of file diff --git a/build/dat.gui.js.map b/build/dat.gui.js.map deleted file mode 100644 index d346d2c1..00000000 --- a/build/dat.gui.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 535dd16febcd8f0d91bf","webpack:///../index.js","webpack:///./dat/index.js","webpack:///./dat/color/Color.js","webpack:///./dat/color/interpret.js","webpack:///./dat/color/toString.js","webpack:///./dat/utils/common.js","webpack:///./dat/color/math.js","webpack:///./dat/controllers/Controller.js","webpack:///./dat/controllers/BooleanController.js","webpack:///./dat/dom/dom.js","webpack:///./dat/controllers/OptionController.js","webpack:///./dat/controllers/StringController.js","webpack:///./dat/controllers/NumberController.js","webpack:///./dat/controllers/NumberControllerBox.js","webpack:///./dat/controllers/NumberControllerSlider.js","webpack:///./dat/controllers/FunctionController.js","webpack:///./dat/controllers/ColorController.js","webpack:///./dat/gui/GUI.js","webpack:///./dat/utils/css.js","webpack:///./dat/gui/saveDialogue.html","webpack:///./dat/controllers/ControllerFactory.js","webpack:///./dat/utils/requestAnimationFrame.js","webpack:///./dat/dom/CenteredDiv.js","webpack:///./dat/gui/style.scss","webpack:///../~/css-loader/lib/css-base.js"],"names":["color","Color","math","interpret","controllers","Controller","BooleanController","OptionController","StringController","NumberController","NumberControllerBox","NumberControllerSlider","FunctionController","ColorController","dom","gui","GUI","__state","apply","arguments","Error","a","toString","toHexString","toOriginal","conversion","write","defineRGBComponent","target","component","componentHexIndex","Object","defineProperty","get","space","recalculateRGB","set","v","defineHSVComponent","recalculateHSV","component_from_hex","hex","extend","hsv_to_rgb","h","s","result","rgb_to_hsv","r","g","b","isNaN","isUndefined","COMPONENTS","prototype","rgb_to_hex","INTERPRETATIONS","litmus","isString","conversions","THREE_CHAR_HEX","read","original","test","match","parseInt","SIX_CHAR_HEX","CSS_RGB","parseFloat","CSS_RGBA","isNumber","HEX","conversionName","isArray","RGB_ARRAY","length","RGBA_ARRAY","isObject","RGBA_OBJ","RGB_OBJ","HSVA_OBJ","HSV_OBJ","toReturn","toArray","each","family","BREAK","forceCSSHex","colorFormat","Math","round","toFixed","str","ARR_EACH","Array","forEach","ARR_SLICE","slice","Common","call","obj","keys","key","bind","defaults","compose","toCall","args","i","itr","scope","l","defer","fnc","setTimeout","debounce","func","threshold","callImmediately","timeout","delayed","callNow","clearTimeout","undefined","isNull","constructor","isBoolean","isFunction","tmpComponent","ColorMath","hi","floor","f","p","q","t","c","min","max","delta","NaN","hex_with_component","componentIndex","value","object","property","initialValue","domElement","document","createElement","__onChange","__onFinishChange","onChange","onFinishChange","setValue","newValue","updateDisplay","getValue","isModified","_this","__prev","__checkbox","setAttribute","appendChild","checked","EVENT_MAP","HTMLEvents","MouseEvents","KeyboardEvents","EVENT_MAP_INV","k","e","CSS_VALUE_PIXELS","cssValueToPixels","val","makeSelectable","elem","selectable","style","onselectstart","MozUserSelect","KhtmlUserSelect","unselectable","makeFullscreen","hor","vert","vertical","horizontal","position","left","right","top","bottom","fakeEvent","eventType","pars","aux","params","className","evt","createEvent","clientX","x","clientY","y","initMouseEvent","bubbles","cancelable","window","clickCount","init","initKeyboardEvent","initKeyEvent","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode","initEvent","dispatchEvent","event","newBool","bool","addEventListener","attachEvent","unbind","removeEventListener","detachEvent","addClass","classes","split","indexOf","push","join","replace","removeClass","removeAttribute","index","splice","hasClass","RegExp","getWidth","getComputedStyle","width","getHeight","height","getOffset","el","offset","offsetParent","offsetLeft","offsetTop","isActive","activeElement","type","href","opts","options","__select","map","element","opt","innerHTML","desiredValue","selectedIndex","__input","onBlur","blur","numDecimals","_x","_params","__min","__max","__step","step","__impliedStep","pow","log","abs","LN10","__precision","_v","minValue","maxValue","stepValue","roundToDecimal","decimals","tenTo","__truncationSuspended","prevY","mousewheelevt","navigator","userAgent","onMouseWheel","deltaY","wheelDelta","detail","preventDefault","attempted","onFinish","onMouseDrag","diff","onMouseUp","onMouseDown","i1","i2","o1","o2","__background","__foreground","bgRect","getBoundingClientRect","pct","text","__button","fire","__color","__temp","__selector","__saturation_field","__field_knob","__field_knob_border","__hue_knob","__hue_field","__input_textShadow","valueField","padding","backgroundColor","boxShadow","border","borderRadius","zIndex","borderRight","marginRight","display","cursor","background","linearGradient","hueGradient","outline","textAlign","fontWeight","textShadow","fieldDown","setH","fieldUpH","setSV","fieldUpSV","fieldRect","mismatch","flip","_flip","marginLeft","marginTop","vendors","vendor","cssText","inject","CSS_NAMESPACE","HIDE_KEY_CODE","CLOSE_BUTTON_HEIGHT","DEFAULT_DEFAULT_PRESET_NAME","SUPPORTS_LOCAL_STORAGE","localStorage","SAVE_DIALOGUE","autoPlaceVirgin","autoPlaceContainer","hide","hideableGuis","__ul","__folders","__controllers","__rememberedObjects","__rememberedObjectIndecesToControllers","__listening","closeOnTop","autoPlace","DEFAULT_WIDTH","resizable","hideable","load","preset","parent","scrollable","useLocalStorage","getItem","getLocalStorageHash","saveToLocalStorage","defineProperties","getRoot","setPresetSelectIndex","revert","setWidth","name","titleRowName","closed","CLASS_CLOSED","onResize","__closeButton","TEXT_OPEN","TEXT_CLOSED","setItem","CLASS_MAIN","savedGui","JSON","parse","CLASS_CLOSE_BUTTON","CLASS_CLOSE_TOP","insertBefore","childNodes","CLASS_CLOSE_BOTTOM","createTextNode","titleRow","addRow","onClickTitle","CLASS_AUTO_PLACE_CONTAINER","body","CLASS_AUTO_PLACE","__resizeHandler","onResizeDebounced","addResizeHandle","stringify","getSaveObject","saveToLocalStorageIfPossible","resetWidth","root","toggleHide","CLASS_CONTROLLER_ROW","CLASS_TOO_TALL","CLASS_DRAG","_keydownHandler","which","add","factoryArgs","addColor","remove","controller","removeChild","__li","destroy","addFolder","newGuiParams","folders","li","open","close","node","__save_row","innerHeight","__resize_handle","offsetHeight","remember","addSaveMenu","remembered","getCurrentPreset","save","markPresetModified","saveAs","presetName","addPresetOption","recallSavedValue","folder","listen","updateDisplays","newDom","liBefore","modified","__preset_select","augmentController","__gui","nextSibling","nextElementSibling","before","firstElementChild","box","method","pc","pb","returned","oldName","wasListening","newController","stopPropagation","borderLeftColor","matchedIndex","controllerMap","presetMap","concat","container","location","setSelected","showHideExplain","explain","div","firstChild","gears","button","button2","button3","select","getElementById","localStorageCheckBox","saveLocally","newConstructorTextArea","show","focus","prompt","pmouseX","drag","dragStop","dragStart","w","useInitialValues","savedValues","controllerArray","module","exports","url","indoc","doc","link","rel","getElementsByTagName","css","injected","head","ControllerFactory","requestAnimationFrame","callback","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","CenteredDiv","backgroundElement","opacity","WebkitTransition","transition","webkitTransform","layout","innerWidth"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;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AACA;AACA;AACA;AACA,iBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,aAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"dat.gui.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"dat\"] = factory();\n\telse\n\t\troot[\"dat\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 535dd16febcd8f0d91bf","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dat from './src/dat/index';\n\nexport default dat;\n\n\n\n// WEBPACK FOOTER //\n// ../index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Color from './color/Color';\nimport math from './color/math';\nimport interpret from './color/interpret';\n\nimport Controller from './controllers/Controller';\nimport BooleanController from './controllers/BooleanController';\nimport OptionController from './controllers/OptionController';\nimport StringController from './controllers/StringController';\nimport NumberController from './controllers/NumberController';\nimport NumberControllerBox from './controllers/NumberControllerBox';\nimport NumberControllerSlider from './controllers/NumberControllerSlider';\nimport FunctionController from './controllers/FunctionController';\nimport ColorController from './controllers/ColorController';\n\nimport dom from './dom/dom';\nimport GUI from './gui/GUI';\n\nexport default {\n color: {\n Color: Color,\n math: math,\n interpret: interpret\n },\n\n controllers: {\n Controller: Controller,\n BooleanController: BooleanController,\n OptionController: OptionController,\n StringController: StringController,\n NumberController: NumberController,\n NumberControllerBox: NumberControllerBox,\n NumberControllerSlider: NumberControllerSlider,\n FunctionController: FunctionController,\n ColorController: ColorController\n },\n\n dom: {\n dom: dom\n },\n\n gui: {\n GUI: GUI\n },\n\n GUI: GUI\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/index.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport interpret from './interpret';\nimport math from './math';\nimport colorToString from './toString';\nimport common from '../utils/common';\n\nclass Color {\n constructor() {\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw new Error('Failed to interpret color arguments');\n }\n\n this.__state.a = this.__state.a || 1;\n }\n\n toString() {\n return colorToString(this);\n }\n\n toHexString() {\n return colorToString(this, true);\n }\n\n toOriginal() {\n return this.__state.conversion.write(this);\n }\n}\n\nfunction defineRGBComponent(target, component, componentHexIndex) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n Color.recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'RGB') {\n Color.recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\nfunction defineHSVComponent(target, component) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'HSV') {\n return this.__state[component];\n }\n\n Color.recalculateHSV(this);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'HSV') {\n Color.recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\n\nColor.recalculateRGB = function(color, component, componentHexIndex) {\n if (color.__state.space === 'HEX') {\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n } else if (color.__state.space === 'HSV') {\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n } else {\n throw new Error('Corrupted color state');\n }\n};\n\nColor.recalculateHSV = function(color) {\n const result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n};\n\nColor.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a'];\n\ndefineRGBComponent(Color.prototype, 'r', 2);\ndefineRGBComponent(Color.prototype, 'g', 1);\ndefineRGBComponent(Color.prototype, 'b', 0);\n\ndefineHSVComponent(Color.prototype, 'h');\ndefineHSVComponent(Color.prototype, 's');\ndefineHSVComponent(Color.prototype, 'v');\n\nObject.defineProperty(Color.prototype, 'a', {\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n});\n\nObject.defineProperty(Color.prototype, 'hex', {\n get: function() {\n if (!this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n }\n\n return this.__state.hex;\n },\n\n set: function(v) {\n this.__state.space = 'HEX';\n this.__state.hex = v;\n }\n});\n\nexport default Color;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/Color.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport toString from './toString';\nimport common from '../utils/common';\n\nconst INTERPRETATIONS = [\n // Strings\n {\n litmus: common.isString,\n conversions: {\n THREE_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt(\n '0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString(), 0)\n };\n },\n\n write: toString\n },\n\n SIX_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString(), 0)\n };\n },\n\n write: toString\n },\n\n CSS_RGB: {\n read: function(original) {\n const test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n },\n\n write: toString\n },\n\n CSS_RGBA: {\n read: function(original) {\n const test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n },\n\n write: toString\n }\n }\n },\n\n // Numbers\n {\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n };\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n litmus: common.isArray,\n conversions: {\n RGB_ARRAY: {\n read: function(original) {\n if (original.length !== 3) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length !== 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n }\n }\n },\n\n // Objects\n {\n litmus: common.isObject,\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n };\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n };\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n };\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n };\n }\n }\n }\n }\n];\n\nlet result;\nlet toReturn;\n\nconst interpret = function() {\n toReturn = false;\n\n const original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n common.each(INTERPRETATIONS, function(family) {\n if (family.litmus(original)) {\n common.each(family.conversions, function(conversion, conversionName) {\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n }\n });\n\n return common.BREAK;\n }\n });\n\n return toReturn;\n};\n\nexport default interpret;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/interpret.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nexport default function(color, forceCSSHex) {\n const colorFormat = color.__state.conversionName.toString();\n\n const r = Math.round(color.r);\n const g = Math.round(color.g);\n const b = Math.round(color.b);\n const a = color.a;\n const h = Math.round(color.h);\n const s = color.s.toFixed(1);\n const v = color.v.toFixed(1);\n\n if (forceCSSHex || (colorFormat === 'THREE_CHAR_HEX') || (colorFormat === 'SIX_CHAR_HEX')) {\n let str = color.hex.toString(16);\n while (str.length < 6) {\n str = '0' + str;\n }\n return '#' + str;\n } else if (colorFormat === 'CSS_RGB') {\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n } else if (colorFormat === 'CSS_RGBA') {\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n } else if (colorFormat === 'HEX') {\n return '0x' + color.hex.toString(16);\n } else if (colorFormat === 'RGB_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ']';\n } else if (colorFormat === 'RGBA_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ',' + a + ']';\n } else if (colorFormat === 'RGB_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + '}';\n } else if (colorFormat === 'RGBA_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}';\n } else if (colorFormat === 'HSV_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + '}';\n } else if (colorFormat === 'HSVA_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}';\n }\n\n return 'unknown format';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/toString.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nconst ARR_EACH = Array.prototype.forEach;\nconst ARR_SLICE = Array.prototype.slice;\n\n/**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\nconst Common = {\n BREAK: {},\n\n extend: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (!this.isUndefined(obj[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n defaults: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (this.isUndefined(target[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n compose: function() {\n const toCall = ARR_SLICE.call(arguments);\n return function() {\n let args = ARR_SLICE.call(arguments);\n for (let i = toCall.length - 1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n };\n },\n\n each: function(obj, itr, scope) {\n if (!obj) {\n return;\n }\n\n if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) {\n obj.forEach(itr, scope);\n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n let key;\n let l;\n for (key = 0, l = obj.length; key < l; key++) {\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n } else {\n for (const key in obj) {\n if (itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n }\n },\n\n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n\n // if the function is called repeatedly, wait until threshold passes until we execute the function\n debounce: function(func, threshold, callImmediately) {\n let timeout;\n\n return function() {\n const obj = this;\n const args = arguments;\n function delayed() {\n timeout = null;\n if (!callImmediately) func.apply(obj, args);\n }\n\n const callNow = callImmediately || !timeout;\n\n clearTimeout(timeout);\n timeout = setTimeout(delayed, threshold);\n\n if (callNow) {\n func.apply(obj, args);\n }\n };\n },\n\n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n\n isNull: function(obj) {\n return obj === null;\n },\n\n isNaN: function(obj) {\n return isNaN(obj);\n },\n\n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n\n isObject: function(obj) {\n return obj === Object(obj);\n },\n\n isNumber: function(obj) {\n return obj === obj + 0;\n },\n\n isString: function(obj) {\n return obj === obj + '';\n },\n\n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n\n isFunction: function(obj) {\n return Object.prototype.toString.call(obj) === '[object Function]';\n }\n\n};\n\nexport default Common;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/common.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nlet tmpComponent;\n\nconst ColorMath = {\n hsv_to_rgb: function(h, s, v) {\n const hi = Math.floor(h / 60) % 6;\n\n const f = h / 60 - Math.floor(h / 60);\n const p = v * (1.0 - s);\n const q = v * (1.0 - (f * s));\n const t = v * (1.0 - ((1.0 - f) * s));\n\n const c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n },\n\n rgb_to_hsv: function(r, g, b) {\n const min = Math.min(r, g, b);\n const max = Math.max(r, g, b);\n const delta = max - min;\n let h;\n let s;\n\n if (max !== 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n let hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~(0xFF << tmpComponent));\n }\n};\n\nexport default ColorMath;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/color/math.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/**\n * @class An \"abstract\" class that represents a given property of an object.\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass Controller {\n constructor(object, property) {\n this.initialValue = object[property];\n\n /**\n * Those who extend this class will put their DOM elements in here.\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n\n /**\n * The object to manipulate\n * @type {Object}\n */\n this.object = object;\n\n /**\n * The name of the property to manipulate\n * @type {String}\n */\n this.property = property;\n\n /**\n * The function to be called on change.\n * @type {Function}\n * @ignore\n */\n this.__onChange = undefined;\n\n /**\n * The function to be called on finishing change.\n * @type {Function}\n * @ignore\n */\n this.__onFinishChange = undefined;\n }\n\n /**\n * Specify that a function fire every time someone changes the value with\n * this Controller.\n *\n * @param {Function} fnc This function will be called whenever the value\n * is modified via this Controller.\n * @returns {Controller} this\n */\n onChange(fnc) {\n this.__onChange = fnc;\n return this;\n }\n\n /**\n * Specify that a function fire every time someone \"finishes\" changing\n * the value wih this Controller. Useful for values that change\n * incrementally like numbers or strings.\n *\n * @param {Function} fnc This function will be called whenever\n * someone \"finishes\" changing the value via this Controller.\n * @returns {Controller} this\n */\n onFinishChange(fnc) {\n this.__onFinishChange = fnc;\n return this;\n }\n\n /**\n * Change the value of object[property]\n *\n * @param {Object} newValue The new value of object[property]\n */\n setValue(newValue) {\n this.object[this.property] = newValue;\n if (this.__onChange) {\n this.__onChange.call(this, newValue);\n }\n\n this.updateDisplay();\n return this;\n }\n\n /**\n * Gets the value of object[property]\n *\n * @returns {Object} The current value of object[property]\n */\n getValue() {\n return this.object[this.property];\n }\n\n /**\n * Refreshes the visual display of a Controller in order to keep sync\n * with the object's current value.\n * @returns {Controller} this\n */\n updateDisplay() {\n return this;\n }\n\n /**\n * @returns {Boolean} true if the value has deviated from initialValue\n */\n isModified() {\n return this.initialValue !== this.getValue();\n }\n}\n\nexport default Controller;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/Controller.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a checkbox input to alter the boolean property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass BooleanController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n this.__prev = this.getValue();\n\n this.__checkbox = document.createElement('input');\n this.__checkbox.setAttribute('type', 'checkbox');\n\n function onChange() {\n _this.setValue(!_this.__prev);\n }\n\n dom.bind(this.__checkbox, 'change', onChange, false);\n\n this.domElement.appendChild(this.__checkbox);\n\n // Match original value\n this.updateDisplay();\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.__prev = this.getValue();\n return toReturn;\n }\n\n updateDisplay() {\n if (this.getValue() === true) {\n this.__checkbox.setAttribute('checked', 'checked');\n this.__checkbox.checked = true;\n this.__prev = true;\n } else {\n this.__checkbox.checked = false;\n this.__prev = false;\n }\n\n return super.updateDisplay();\n }\n}\n\nexport default BooleanController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/BooleanController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport common from '../utils/common';\n\nconst EVENT_MAP = {\n HTMLEvents: ['change'],\n MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],\n KeyboardEvents: ['keydown']\n};\n\nconst EVENT_MAP_INV = {};\ncommon.each(EVENT_MAP, function(v, k) {\n common.each(v, function(e) {\n EVENT_MAP_INV[e] = k;\n });\n});\n\nconst CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\n\nfunction cssValueToPixels(val) {\n if (val === '0' || common.isUndefined(val)) {\n return 0;\n }\n\n const match = val.match(CSS_VALUE_PIXELS);\n\n if (!common.isNull(match)) {\n return parseFloat(match[1]);\n }\n\n // TODO ...ems? %?\n\n return 0;\n}\n\n/**\n * @namespace\n * @member dat.dom\n */\nconst dom = {\n\n /**\n *\n * @param elem\n * @param selectable\n */\n makeSelectable: function(elem, selectable) {\n if (elem === undefined || elem.style === undefined) return;\n\n elem.onselectstart = selectable ? function() {\n return false;\n } : function() {\n };\n\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\n elem.unselectable = selectable ? 'on' : 'off';\n },\n\n /**\n *\n * @param elem\n * @param horizontal\n * @param vert\n */\n makeFullscreen: function(elem, hor, vert) {\n let vertical = vert;\n let horizontal = hor;\n\n if (common.isUndefined(horizontal)) {\n horizontal = true;\n }\n\n if (common.isUndefined(vertical)) {\n vertical = true;\n }\n\n elem.style.position = 'absolute';\n\n if (horizontal) {\n elem.style.left = 0;\n elem.style.right = 0;\n }\n if (vertical) {\n elem.style.top = 0;\n elem.style.bottom = 0;\n }\n },\n\n /**\n *\n * @param elem\n * @param eventType\n * @param params\n */\n fakeEvent: function(elem, eventType, pars, aux) {\n const params = pars || {};\n const className = EVENT_MAP_INV[eventType];\n if (!className) {\n throw new Error('Event type ' + eventType + ' not supported.');\n }\n const evt = document.createEvent(className);\n switch (className) {\n case 'MouseEvents':\n {\n const clientX = params.x || params.clientX || 0;\n const clientY = params.y || params.clientY || 0;\n evt.initMouseEvent(eventType, params.bubbles || false,\n params.cancelable || true, window, params.clickCount || 1,\n 0, // screen X\n 0, // screen Y\n clientX, // client X\n clientY, // client Y\n false, false, false, false, 0, null);\n break;\n }\n case 'KeyboardEvents':\n {\n const init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz\n common.defaults(params, {\n cancelable: true,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n keyCode: undefined,\n charCode: undefined\n });\n init(eventType, params.bubbles || false,\n params.cancelable, window,\n params.ctrlKey, params.altKey,\n params.shiftKey, params.metaKey,\n params.keyCode, params.charCode);\n break;\n }\n default:\n {\n evt.initEvent(eventType, params.bubbles || false, params.cancelable || true);\n break;\n }\n }\n common.defaults(evt, aux);\n elem.dispatchEvent(evt);\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n bind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.addEventListener) {\n elem.addEventListener(event, func, bool);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n unbind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.removeEventListener) {\n elem.removeEventListener(event, func, bool);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n addClass: function(elem, className) {\n if (elem.className === undefined) {\n elem.className = className;\n } else if (elem.className !== className) {\n const classes = elem.className.split(/ +/);\n if (classes.indexOf(className) === -1) {\n classes.push(className);\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\n }\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n removeClass: function(elem, className) {\n if (className) {\n if (elem.className === className) {\n elem.removeAttribute('class');\n } else {\n const classes = elem.className.split(/ +/);\n const index = classes.indexOf(className);\n if (index !== -1) {\n classes.splice(index, 1);\n elem.className = classes.join(' ');\n }\n }\n } else {\n elem.className = undefined;\n }\n return dom;\n },\n\n hasClass: function(elem, className) {\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\n },\n\n /**\n *\n * @param elem\n */\n getWidth: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-left-width']) +\n cssValueToPixels(style['border-right-width']) +\n cssValueToPixels(style['padding-left']) +\n cssValueToPixels(style['padding-right']) +\n cssValueToPixels(style.width);\n },\n\n /**\n *\n * @param elem\n */\n getHeight: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-top-width']) +\n cssValueToPixels(style['border-bottom-width']) +\n cssValueToPixels(style['padding-top']) +\n cssValueToPixels(style['padding-bottom']) +\n cssValueToPixels(style.height);\n },\n\n /**\n *\n * @param el\n */\n getOffset: function(el) {\n let elem = el;\n const offset = { left: 0, top: 0 };\n if (elem.offsetParent) {\n do {\n offset.left += elem.offsetLeft;\n offset.top += elem.offsetTop;\n elem = elem.offsetParent;\n } while (elem);\n }\n return offset;\n },\n\n // http://stackoverflow.com/posts/2684561/revisions\n /**\n *\n * @param elem\n */\n isActive: function(elem) {\n return elem === document.activeElement && (elem.type || elem.href);\n }\n\n};\n\nexport default dom;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/dom.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\n/**\n * @class Provides a select input to alter the property of an object, using a\n * list of accepted values.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object|string[]} options A map of labels to acceptable values, or\n * a list of acceptable string values.\n */\nclass OptionController extends Controller {\n constructor(object, property, opts) {\n super(object, property);\n\n let options = opts;\n\n const _this = this;\n\n /**\n * The drop down menu\n * @ignore\n */\n this.__select = document.createElement('select');\n\n if (common.isArray(options)) {\n const map = {};\n common.each(options, function(element) {\n map[element] = element;\n });\n options = map;\n }\n\n common.each(options, function(value, key) {\n const opt = document.createElement('option');\n opt.innerHTML = key;\n opt.setAttribute('value', value);\n _this.__select.appendChild(opt);\n });\n\n // Acknowledge original value\n this.updateDisplay();\n\n dom.bind(this.__select, 'change', function() {\n const desiredValue = this.options[this.selectedIndex].value;\n _this.setValue(desiredValue);\n });\n\n this.domElement.appendChild(this.__select);\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n return toReturn;\n }\n\n updateDisplay() {\n if (dom.isActive(this.__select)) return this; // prevent number from updating if user is trying to manually update\n this.__select.value = this.getValue();\n return super.updateDisplay();\n }\n}\n\nexport default OptionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/OptionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a text input to alter the string property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass StringController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n\n function onChange() {\n _this.setValue(_this.__input.value);\n }\n\n function onBlur() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n dom.bind(this.__input, 'keyup', onChange);\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) {\n this.blur();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n // Stops the caret from moving on account of:\n // keyup -> setValue -> updateDisplay\n if (!dom.isActive(this.__input)) {\n this.__input.value = this.getValue();\n }\n return super.updateDisplay();\n }\n}\n\nexport default StringController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/StringController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport common from '../utils/common';\n\nfunction numDecimals(x) {\n const _x = x.toString();\n if (_x.indexOf('.') > -1) {\n return _x.length - _x.indexOf('.') - 1;\n }\n\n return 0;\n}\n\n/**\n * @class Represents a given property of an object that is a number.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberController extends Controller {\n constructor(object, property, params) {\n super(object, property);\n\n const _params = params || {};\n\n this.__min = _params.min;\n this.__max = _params.max;\n this.__step = _params.step;\n\n if (common.isUndefined(this.__step)) {\n if (this.initialValue === 0) {\n this.__impliedStep = 1; // What are we, psychics?\n } else {\n // Hey Doug, check this out.\n this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(this.initialValue)) / Math.LN10)) / 10;\n }\n } else {\n this.__impliedStep = this.__step;\n }\n\n this.__precision = numDecimals(this.__impliedStep);\n }\n\n setValue(v) {\n let _v = v;\n\n if (this.__min !== undefined && _v < this.__min) {\n _v = this.__min;\n } else if (this.__max !== undefined && _v > this.__max) {\n _v = this.__max;\n }\n\n if (this.__step !== undefined && _v % this.__step !== 0) {\n _v = Math.round(_v / this.__step) * this.__step;\n }\n\n return super.setValue(_v);\n }\n\n /**\n * Specify a minimum value for object[property].\n *\n * @param {Number} minValue The minimum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n min(minValue) {\n this.__min = minValue;\n return this;\n }\n\n /**\n * Specify a maximum value for object[property].\n *\n * @param {Number} maxValue The maximum value for\n * object[property]\n * @returns {dat.controllers.NumberController} this\n */\n max(maxValue) {\n this.__max = maxValue;\n return this;\n }\n\n /**\n * Specify a step value that dat.controllers.NumberController\n * increments by.\n *\n * @param {Number} stepValue The step value for\n * dat.controllers.NumberController\n * @default if minimum and maximum specified increment is 1% of the\n * difference otherwise stepValue is 1\n * @returns {dat.controllers.NumberController} this\n */\n step(stepValue) {\n this.__step = stepValue;\n this.__impliedStep = stepValue;\n this.__precision = numDecimals(stepValue);\n return this;\n }\n}\n\nexport default NumberController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nfunction roundToDecimal(value, decimals) {\n const tenTo = Math.pow(10, decimals);\n return Math.round(value * tenTo) / tenTo;\n}\n\n/**\n * @class Represents a given property of an object that is a number and\n * provides an input element with which to manipulate it.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberControllerBox extends NumberController {\n constructor(object, property, params) {\n super(object, property, params);\n\n this.__truncationSuspended = false;\n\n const _this = this;\n\n /**\n * {Number} Previous mouse y position\n * @ignore\n */\n let prevY;\n\n const mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? 'DOMMouseScroll' : 'mousewheel';\n\n function onMouseWheel(e) {\n let value = _this.getValue();\n const delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1;\n e.preventDefault();\n\n if (delta < 0) value += _this.__impliedStep;\n else value -= _this.__impliedStep;\n _this.setValue(value);\n }\n\n function onChange() {\n const attempted = parseFloat(_this.__input.value);\n if (!common.isNaN(attempted)) {\n _this.setValue(attempted);\n }\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n function onBlur() {\n onFinish();\n }\n\n function onMouseDrag(e) {\n const diff = prevY - e.clientY;\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\n\n prevY = e.clientY;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n onFinish();\n }\n\n function onMouseDown(e) {\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n prevY = e.clientY;\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n // Makes it so manually specified values are not truncated.\n\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'mousedown', onMouseDown);\n dom.bind(this.__input, mousewheelevt, onMouseWheel);\n dom.bind(this.__input, 'keydown', function(e) {\n // When pressing enter, you can be as precise as you want.\n if (e.keyCode === 13) {\n _this.__truncationSuspended = true;\n this.blur();\n _this.__truncationSuspended = false;\n onFinish();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerBox;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerBox.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\n\nfunction map(v, i1, i2, o1, o2) {\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\n}\n\n/**\n * @class Represents a given property of an object that is a number, contains\n * a minimum and maximum, and provides a slider element with which to\n * manipulate it. It should be noted that the slider element is made up of\n * <div> tags, not the html5\n * <slider> element.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Number} minValue Minimum allowed value\n * @param {Number} maxValue Maximum allowed value\n * @param {Number} stepValue Increment by which to change value\n */\nclass NumberControllerSlider extends NumberController {\n constructor(object, property, min, max, step) {\n super(object, property, { min: min, max: max, step: step });\n\n const _this = this;\n\n this.__background = document.createElement('div');\n this.__foreground = document.createElement('div');\n\n dom.bind(this.__background, 'mousedown', onMouseDown);\n\n const mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? 'DOMMouseScroll' : 'mousewheel';\n dom.bind(this.__background, mousewheelevt, onMouseWheel);\n\n dom.addClass(this.__background, 'slider');\n dom.addClass(this.__foreground, 'slider-fg');\n\n function onMouseWheel(e) {\n let value = _this.getValue();\n const delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1;\n e.preventDefault();\n document.activeElement.blur();\n\n if (delta < 0) value += _this.__impliedStep;\n else value -= _this.__impliedStep;\n _this.setValue(value);\n }\n\n function onMouseDown(e) {\n document.activeElement.blur();\n\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n\n onMouseDrag(e);\n }\n\n function onMouseDrag(e) {\n e.preventDefault();\n\n const bgRect = _this.__background.getBoundingClientRect();\n\n _this.setValue(\n map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)\n );\n\n return false;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.__background.appendChild(this.__foreground);\n this.domElement.appendChild(this.__background);\n }\n\n updateDisplay() {\n const pct = (this.getValue() - this.__min) / (this.__max - this.__min);\n this.__foreground.style.width = pct * 100 + '%';\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/NumberControllerSlider.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a GUI interface to fire a specified method, a property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass FunctionController extends Controller {\n constructor(object, property, text) {\n super(object, property);\n\n const _this = this;\n\n this.__button = document.createElement('div');\n this.__button.innerHTML = text === undefined ? 'Fire' : text;\n\n dom.bind(this.__button, 'click', function(e) {\n e.preventDefault();\n _this.fire();\n return false;\n });\n\n dom.addClass(this.__button, 'button');\n\n this.domElement.appendChild(this.__button);\n }\n\n fire() {\n if (this.__onChange) {\n this.__onChange.call(this);\n }\n this.getValue().call(this.object);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n }\n}\n\nexport default FunctionController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/FunctionController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport Color from '../color/Color';\nimport interpret from '../color/interpret';\nimport common from '../utils/common';\n\n/**\n * @class Represents a given property of an object that is a color.\n * @param {Object} object\n * @param {string} property\n */\nclass ColorController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n this.__color = new Color(this.getValue());\n this.__temp = new Color(0);\n\n const _this = this;\n\n this.domElement = document.createElement('div');\n\n dom.makeSelectable(this.domElement, false);\n\n this.__selector = document.createElement('div');\n this.__selector.className = 'selector';\n\n this.__saturation_field = document.createElement('div');\n this.__saturation_field.className = 'saturation-field';\n\n this.__field_knob = document.createElement('div');\n this.__field_knob.className = 'field-knob';\n this.__field_knob_border = '2px solid ';\n\n this.__hue_knob = document.createElement('div');\n this.__hue_knob.className = 'hue-knob';\n\n this.__hue_field = document.createElement('div');\n this.__hue_field.className = 'hue-field';\n\n this.__input = document.createElement('input');\n this.__input.type = 'text';\n this.__input_textShadow = '0 1px 1px ';\n\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) { // on enter\n onBlur.call(this);\n }\n });\n\n dom.bind(this.__input, 'blur', onBlur);\n\n dom.bind(this.__selector, 'mousedown', function(/* e */) {\n dom\n .addClass(this, 'drag')\n .bind(window, 'mouseup', function(/* e */) {\n dom.removeClass(_this.__selector, 'drag');\n });\n });\n\n const valueField = document.createElement('div');\n\n common.extend(this.__selector.style, {\n width: '122px',\n height: '102px',\n padding: '3px',\n backgroundColor: '#222',\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\n });\n\n common.extend(this.__field_knob.style, {\n position: 'absolute',\n width: '12px',\n height: '12px',\n border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\n borderRadius: '12px',\n zIndex: 1\n });\n\n common.extend(this.__hue_knob.style, {\n position: 'absolute',\n width: '15px',\n height: '2px',\n borderRight: '4px solid #fff',\n zIndex: 1\n });\n\n common.extend(this.__saturation_field.style, {\n width: '100px',\n height: '100px',\n border: '1px solid #555',\n marginRight: '3px',\n display: 'inline-block',\n cursor: 'pointer'\n });\n\n common.extend(valueField.style, {\n width: '100%',\n height: '100%',\n background: 'none'\n });\n\n linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000');\n\n common.extend(this.__hue_field.style, {\n width: '15px',\n height: '100px',\n border: '1px solid #555',\n cursor: 'ns-resize',\n position: 'absolute',\n top: '3px',\n right: '3px'\n });\n\n hueGradient(this.__hue_field);\n\n common.extend(this.__input.style, {\n outline: 'none',\n// width: '120px',\n textAlign: 'center',\n// padding: '4px',\n// marginBottom: '6px',\n color: '#fff',\n border: 0,\n fontWeight: 'bold',\n textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'\n });\n\n dom.bind(this.__saturation_field, 'mousedown', fieldDown);\n dom.bind(this.__field_knob, 'mousedown', fieldDown);\n\n dom.bind(this.__hue_field, 'mousedown', function(e) {\n setH(e);\n dom.bind(window, 'mousemove', setH);\n dom.bind(window, 'mouseup', fieldUpH);\n });\n\n function fieldDown(e) {\n setSV(e);\n // document.body.style.cursor = 'none';\n dom.bind(window, 'mousemove', setSV);\n dom.bind(window, 'mouseup', fieldUpSV);\n }\n\n function fieldUpSV() {\n dom.unbind(window, 'mousemove', setSV);\n dom.unbind(window, 'mouseup', fieldUpSV);\n // document.body.style.cursor = 'default';\n onFinish();\n }\n\n function onBlur() {\n const i = interpret(this.value);\n if (i !== false) {\n _this.__color.__state = i;\n _this.setValue(_this.__color.toOriginal());\n } else {\n this.value = _this.__color.toString();\n }\n }\n\n function fieldUpH() {\n dom.unbind(window, 'mousemove', setH);\n dom.unbind(window, 'mouseup', fieldUpH);\n onFinish();\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.__color.toOriginal());\n }\n }\n\n this.__saturation_field.appendChild(valueField);\n this.__selector.appendChild(this.__field_knob);\n this.__selector.appendChild(this.__saturation_field);\n this.__selector.appendChild(this.__hue_field);\n this.__hue_field.appendChild(this.__hue_knob);\n\n this.domElement.appendChild(this.__input);\n this.domElement.appendChild(this.__selector);\n\n this.updateDisplay();\n\n function setSV(e) {\n e.preventDefault();\n\n const fieldRect = _this.__saturation_field.getBoundingClientRect();\n let s = (e.clientX - fieldRect.left) / (fieldRect.right - fieldRect.left);\n let v = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (v > 1) {\n v = 1;\n } else if (v < 0) {\n v = 0;\n }\n\n if (s > 1) {\n s = 1;\n } else if (s < 0) {\n s = 0;\n }\n\n _this.__color.v = v;\n _this.__color.s = s;\n\n _this.setValue(_this.__color.toOriginal());\n\n\n return false;\n }\n\n function setH(e) {\n e.preventDefault();\n\n const fieldRect = _this.__hue_field.getBoundingClientRect();\n let h = 1 - (e.clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (h > 1) {\n h = 1;\n } else if (h < 0) {\n h = 0;\n }\n\n _this.__color.h = h * 360;\n\n _this.setValue(_this.__color.toOriginal());\n\n return false;\n }\n }\n\n updateDisplay() {\n const i = interpret(this.getValue());\n\n if (i !== false) {\n let mismatch = false;\n\n // Check for mismatch on the interpreted value.\n\n common.each(Color.COMPONENTS, function(component) {\n if (!common.isUndefined(i[component]) && !common.isUndefined(this.__color.__state[component]) &&\n i[component] !== this.__color.__state[component]) {\n mismatch = true;\n return {}; // break\n }\n }, this);\n\n // If nothing diverges, we keep our previous values\n // for statefulness, otherwise we recalculate fresh\n if (mismatch) {\n common.extend(this.__color.__state, i);\n }\n }\n\n common.extend(this.__temp.__state, this.__color.__state);\n\n this.__temp.a = 1;\n\n const flip = (this.__color.v < 0.5 || this.__color.s > 0.5) ? 255 : 0;\n const _flip = 255 - flip;\n\n common.extend(this.__field_knob.style, {\n marginLeft: 100 * this.__color.s - 7 + 'px',\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\n backgroundColor: this.__temp.toHexString(),\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')'\n });\n\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px';\n\n this.__temp.s = 1;\n this.__temp.v = 1;\n\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString());\n\n this.__input.value = this.__color.toString();\n\n common.extend(this.__input.style, {\n backgroundColor: this.__color.toHexString(),\n color: 'rgb(' + flip + ',' + flip + ',' + flip + ')',\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)'\n });\n }\n}\n\nconst vendors = ['-moz-', '-o-', '-webkit-', '-ms-', ''];\n\nfunction linearGradient(elem, x, a, b) {\n elem.style.background = '';\n common.each(vendors, function(vendor) {\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); ';\n });\n}\n\nfunction hueGradient(elem) {\n elem.style.background = '';\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);';\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n}\n\nexport default ColorController;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ColorController.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport css from '../utils/css';\nimport saveDialogueContents from './saveDialogue.html';\nimport ControllerFactory from '../controllers/ControllerFactory';\nimport Controller from '../controllers/Controller';\nimport BooleanController from '../controllers/BooleanController';\nimport FunctionController from '../controllers/FunctionController';\nimport NumberControllerBox from '../controllers/NumberControllerBox';\nimport NumberControllerSlider from '../controllers/NumberControllerSlider';\nimport ColorController from '../controllers/ColorController';\nimport requestAnimationFrame from '../utils/requestAnimationFrame';\nimport CenteredDiv from '../dom/CenteredDiv';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nimport styleSheet from './style.scss'; // CSS to embed in build\n\ncss.inject(styleSheet);\n\n/** @ignore Outer-most className for GUI's */\nconst CSS_NAMESPACE = 'dg';\n\nconst HIDE_KEY_CODE = 72;\n\n/** @ignore The only value shared between the JS and SCSS. Use caution. */\nconst CLOSE_BUTTON_HEIGHT = 20;\n\nconst DEFAULT_DEFAULT_PRESET_NAME = 'Default';\n\nconst SUPPORTS_LOCAL_STORAGE = (function() {\n try {\n return 'localStorage' in window && window.localStorage !== null;\n } catch (e) {\n return false;\n }\n}());\n\nlet SAVE_DIALOGUE;\n\n/** @ignore Have we yet to create an autoPlace GUI? */\nlet autoPlaceVirgin = true;\n\n/** @ignore Fixed position div that auto place GUI's go inside */\nlet autoPlaceContainer;\n\n/** @ignore Are we hiding the GUI's ? */\nlet hide = false;\n\n/** @private GUI's which should be hidden */\nconst hideableGuis = [];\n\n/**\n * @class A lightweight controller library for JavaScript. It allows you to easily\n * manipulate variables and fire functions on the fly.\n *\n * @typicalname gui\n *\n * @example\n * // Creating a GUI with options.\n * var gui = new dat.GUI({name: 'My GUI'});\n *\n * @example\n * // Creating a GUI and a subfolder.\n * var gui = new dat.GUI();\n * var folder1 = gui.addFolder('Flow Field');\n *\n * @param {Object} [params]\n * @param {String} [params.name] The name of this GUI.\n * @param {Object} [params.load] JSON object representing the saved state of\n * this GUI.\n * @param {Boolean} [params.auto=true]\n * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.\n * @param {Boolean} [params.closed] If true, starts closed\n * @param {Boolean} [params.closeOnTop] If true, close/open button shows on top of the GUI\n */\nconst GUI = function(pars) {\n const _this = this;\n\n let params = pars || {};\n\n /**\n * Outermost DOM Element\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n this.__ul = document.createElement('ul');\n this.domElement.appendChild(this.__ul);\n\n dom.addClass(this.domElement, CSS_NAMESPACE);\n\n /**\n * Nested GUI's by name\n * @ignore\n */\n this.__folders = {};\n\n this.__controllers = [];\n\n /**\n * List of objects I'm remembering for save, only used in top level GUI\n * @ignore\n */\n this.__rememberedObjects = [];\n\n /**\n * Maps the index of remembered objects to a map of controllers, only used\n * in top level GUI.\n *\n * @private\n * @ignore\n *\n * @example\n * [\n * {\n * propertyName: Controller,\n * anotherPropertyName: Controller\n * },\n * {\n * propertyName: Controller\n * }\n * ]\n */\n this.__rememberedObjectIndecesToControllers = [];\n\n this.__listening = [];\n\n // Default parameters\n params = common.defaults(params, {\n closeOnTop: false,\n autoPlace: true,\n width: GUI.DEFAULT_WIDTH\n });\n\n params = common.defaults(params, {\n resizable: params.autoPlace,\n hideable: params.autoPlace\n });\n\n if (!common.isUndefined(params.load)) {\n // Explicit preset\n if (params.preset) {\n params.load.preset = params.preset;\n }\n } else {\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\n }\n\n if (common.isUndefined(params.parent) && params.hideable) {\n hideableGuis.push(this);\n }\n\n // Only root level GUI's are resizable.\n params.resizable = common.isUndefined(params.parent) && params.resizable;\n\n if (params.autoPlace && common.isUndefined(params.scrollable)) {\n params.scrollable = true;\n }\n// params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;\n\n // Not part of params because I don't want people passing this in via\n // constructor. Should be a 'remembered' value.\n let useLocalStorage =\n SUPPORTS_LOCAL_STORAGE &&\n localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\n\n let saveToLocalStorage;\n\n Object.defineProperties(this,\n /** @lends GUI.prototype */\n {\n /**\n * The parent GUI\n * @type dat.gui.GUI\n */\n parent: {\n get: function() {\n return params.parent;\n }\n },\n\n scrollable: {\n get: function() {\n return params.scrollable;\n }\n },\n\n /**\n * Handles GUI's element placement for you\n * @type Boolean\n */\n autoPlace: {\n get: function() {\n return params.autoPlace;\n }\n },\n\n /**\n * Handles GUI's position of open/close button\n * @type Boolean\n */\n closeOnTop: {\n get: function() {\n return params.closeOnTop;\n }\n },\n\n /**\n * The identifier for a set of saved values\n * @type String\n */\n preset: {\n get: function() {\n if (_this.parent) {\n return _this.getRoot().preset;\n }\n\n return params.load.preset;\n },\n\n set: function(v) {\n if (_this.parent) {\n _this.getRoot().preset = v;\n } else {\n params.load.preset = v;\n }\n setPresetSelectIndex(this);\n _this.revert();\n }\n },\n\n /**\n * The width of GUI element\n * @type Number\n */\n width: {\n get: function() {\n return params.width;\n },\n set: function(v) {\n params.width = v;\n setWidth(_this, v);\n }\n },\n\n /**\n * The name of GUI. Used for folders. i.e\n * a folder's name\n * @type String\n */\n name: {\n get: function() {\n return params.name;\n },\n set: function(v) {\n // TODO Check for collisions among sibling folders\n params.name = v;\n if (titleRowName) {\n titleRowName.innerHTML = params.name;\n }\n }\n },\n\n /**\n * Whether the GUI is collapsed or not\n * @type Boolean\n */\n closed: {\n get: function() {\n return params.closed;\n },\n set: function(v) {\n params.closed = v;\n if (params.closed) {\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\n } else {\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\n }\n // For browsers that aren't going to respect the CSS transition,\n // Lets just check our height against the window height right off\n // the bat.\n this.onResize();\n\n if (_this.__closeButton) {\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\n }\n }\n },\n\n /**\n * Contains all presets\n * @type Object\n */\n load: {\n get: function() {\n return params.load;\n }\n },\n\n /**\n * Determines whether or not to use localStorage as the means for\n * remembering\n * @type Boolean\n */\n useLocalStorage: {\n\n get: function() {\n return useLocalStorage;\n },\n set: function(bool) {\n if (SUPPORTS_LOCAL_STORAGE) {\n useLocalStorage = bool;\n if (bool) {\n dom.bind(window, 'unload', saveToLocalStorage);\n } else {\n dom.unbind(window, 'unload', saveToLocalStorage);\n }\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\n }\n }\n }\n });\n\n // Are we a root level GUI?\n if (common.isUndefined(params.parent)) {\n params.closed = false;\n\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\n dom.makeSelectable(this.domElement, false);\n\n // Are we supposed to be loading locally?\n if (SUPPORTS_LOCAL_STORAGE) {\n if (useLocalStorage) {\n _this.useLocalStorage = true;\n\n const savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\n\n if (savedGui) {\n params.load = JSON.parse(savedGui);\n }\n }\n }\n\n this.__closeButton = document.createElement('div');\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\n if (params.closeOnTop) {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP);\n this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]);\n } else {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM);\n this.domElement.appendChild(this.__closeButton);\n }\n\n dom.bind(this.__closeButton, 'click', function() {\n _this.closed = !_this.closed;\n });\n // Oh, you're a nested GUI!\n } else {\n if (params.closed === undefined) {\n params.closed = true;\n }\n\n const titleRowName = document.createTextNode(params.name);\n dom.addClass(titleRowName, 'controller-name');\n\n const titleRow = addRow(_this, titleRowName);\n\n const onClickTitle = function(e) {\n e.preventDefault();\n _this.closed = !_this.closed;\n return false;\n };\n\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\n\n dom.addClass(titleRow, 'title');\n dom.bind(titleRow, 'click', onClickTitle);\n\n if (!params.closed) {\n this.closed = false;\n }\n }\n\n if (params.autoPlace) {\n if (common.isUndefined(params.parent)) {\n if (autoPlaceVirgin) {\n autoPlaceContainer = document.createElement('div');\n dom.addClass(autoPlaceContainer, CSS_NAMESPACE);\n dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER);\n document.body.appendChild(autoPlaceContainer);\n autoPlaceVirgin = false;\n }\n\n // Put it in the dom for you.\n autoPlaceContainer.appendChild(this.domElement);\n\n // Apply the auto styles\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\n }\n\n\n // Make it not elastic.\n if (!this.parent) {\n setWidth(_this, params.width);\n }\n }\n\n this.__resizeHandler = function() {\n _this.onResizeDebounced();\n };\n\n dom.bind(window, 'resize', this.__resizeHandler);\n dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler);\n dom.bind(this.__ul, 'transitionend', this.__resizeHandler);\n dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler);\n this.onResize();\n\n if (params.resizable) {\n addResizeHandle(this);\n }\n\n saveToLocalStorage = function() {\n if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') {\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\n }\n };\n\n // expose this method publicly\n this.saveToLocalStorageIfPossible = saveToLocalStorage;\n\n function resetWidth() {\n const root = _this.getRoot();\n root.width += 1;\n common.defer(function() {\n root.width -= 1;\n });\n }\n\n if (!params.parent) {\n resetWidth();\n }\n};\n\nGUI.toggleHide = function() {\n hide = !hide;\n common.each(hideableGuis, function(gui) {\n gui.domElement.style.display = hide ? 'none' : '';\n });\n};\n\nGUI.CLASS_AUTO_PLACE = 'a';\nGUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\nGUI.CLASS_MAIN = 'main';\nGUI.CLASS_CONTROLLER_ROW = 'cr';\nGUI.CLASS_TOO_TALL = 'taller-than-window';\nGUI.CLASS_CLOSED = 'closed';\nGUI.CLASS_CLOSE_BUTTON = 'close-button';\nGUI.CLASS_CLOSE_TOP = 'close-top';\nGUI.CLASS_CLOSE_BOTTOM = 'close-bottom';\nGUI.CLASS_DRAG = 'drag';\n\nGUI.DEFAULT_WIDTH = 245;\nGUI.TEXT_CLOSED = 'Close Controls';\nGUI.TEXT_OPEN = 'Open Controls';\n\nGUI._keydownHandler = function(e) {\n if (document.activeElement.type !== 'text' &&\n (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) {\n GUI.toggleHide();\n }\n};\ndom.bind(window, 'keydown', GUI._keydownHandler, false);\n\ncommon.extend(\n GUI.prototype,\n\n /** @lends GUI.prototype */\n {\n\n /**\n * Adds a new {@link Controller} to the GUI. The type of controller created\n * is inferred from the initial value of object[property]. For\n * color properties, see {@link addColor}.\n *\n * @param {Object} object The object to be manipulated\n * @param {String} property The name of the property to be manipulated\n * @param {Number} [min] Minimum allowed value\n * @param {Number} [max] Maximum allowed value\n * @param {Number} [step] Increment by which to change value\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * // Add a string controller.\n * var person = {name: 'Sam'};\n * gui.add(person, 'name');\n *\n * @example\n * // Add a number controller slider.\n * var person = {age: 45};\n * gui.add(person, 'age', 0, 100);\n */\n add: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n factoryArgs: Array.prototype.slice.call(arguments, 2)\n }\n );\n },\n\n /**\n * Adds a new color controller to the GUI.\n *\n * @param object\n * @param property\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * var palette = {\n * color1: '#FF0000', // CSS string\n * color2: [ 0, 128, 255 ], // RGB array\n * color3: [ 0, 128, 255, 0.3 ], // RGB with alpha\n * color4: { h: 350, s: 0.9, v: 0.3 } // Hue, saturation, value\n * };\n * gui.addColor(palette, 'color1');\n * gui.addColor(palette, 'color2');\n * gui.addColor(palette, 'color3');\n * gui.addColor(palette, 'color4');\n */\n addColor: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n color: true\n }\n );\n },\n\n /**\n * Removes the given controller from the GUI.\n * @param {Controller} controller\n * @instance\n */\n remove: function(controller) {\n // TODO listening?\n this.__ul.removeChild(controller.__li);\n this.__controllers.splice(this.__controllers.indexOf(controller), 1);\n const _this = this;\n common.defer(function() {\n _this.onResize();\n });\n },\n\n /**\n * Removes the GUI from the document and unbinds all event listeners.\n * @instance\n */\n destroy: function() {\n if (this.autoPlace) {\n autoPlaceContainer.removeChild(this.domElement);\n }\n\n dom.unbind(window, 'keydown', GUI._keydownHandler, false);\n dom.unbind(window, 'resize', this.__resizeHandler);\n\n if (this.saveToLocalStorageIfPossible) {\n dom.unbind(window, 'unload', this.saveToLocalStorageIfPossible);\n }\n },\n\n /**\n * Creates a new subfolder GUI instance.\n * @param name\n * @returns {dat.gui.GUI} The new folder.\n * @throws {Error} if this GUI already has a folder by the specified\n * name\n * @instance\n */\n addFolder: function(name) {\n // We have to prevent collisions on names in order to have a key\n // by which to remember saved values\n if (this.__folders[name] !== undefined) {\n throw new Error('You already have a folder in this GUI by the' +\n ' name \"' + name + '\"');\n }\n\n const newGuiParams = { name: name, parent: this };\n\n // We need to pass down the autoPlace trait so that we can\n // attach event listeners to open/close folder actions to\n // ensure that a scrollbar appears if the window is too short.\n newGuiParams.autoPlace = this.autoPlace;\n\n // Do we have saved appearance data for this folder?\n if (this.load && // Anything loaded?\n this.load.folders && // Was my parent a dead-end?\n this.load.folders[name]) { // Did daddy remember me?\n // Start me closed if I was closed\n newGuiParams.closed = this.load.folders[name].closed;\n\n // Pass down the loaded data\n newGuiParams.load = this.load.folders[name];\n }\n\n const gui = new GUI(newGuiParams);\n this.__folders[name] = gui;\n\n const li = addRow(this, gui.domElement);\n dom.addClass(li, 'folder');\n return gui;\n },\n\n /**\n * Opens the GUI.\n */\n open: function() {\n this.closed = false;\n },\n\n /**\n * Closes the GUI.\n */\n close: function() {\n this.closed = true;\n },\n\n\n onResize: function() {\n // we debounce this function to prevent performance issues when rotating on tablet/mobile\n const root = this.getRoot();\n if (root.scrollable) {\n const top = dom.getOffset(root.__ul).top;\n let h = 0;\n\n common.each(root.__ul.childNodes, function(node) {\n if (!(root.autoPlace && node === root.__save_row)) {\n h += dom.getHeight(node);\n }\n });\n\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\n } else {\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = 'auto';\n }\n }\n\n if (root.__resize_handle) {\n common.defer(function() {\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\n });\n }\n\n if (root.__closeButton) {\n root.__closeButton.style.width = root.width + 'px';\n }\n },\n\n onResizeDebounced: common.debounce(function() { this.onResize(); }, 50),\n\n /**\n * Mark objects for saving. The order of these objects cannot change as\n * the GUI grows. When remembering new objects, append them to the end\n * of the list.\n *\n * @param {...Object} objects\n * @throws {Error} if not called on a top level GUI.\n * @instance\n * @ignore\n */\n remember: function() {\n if (common.isUndefined(SAVE_DIALOGUE)) {\n SAVE_DIALOGUE = new CenteredDiv();\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;\n }\n\n if (this.parent) {\n throw new Error('You can only call remember on a top level GUI.');\n }\n\n const _this = this;\n\n common.each(Array.prototype.slice.call(arguments), function(object) {\n if (_this.__rememberedObjects.length === 0) {\n addSaveMenu(_this);\n }\n if (_this.__rememberedObjects.indexOf(object) === -1) {\n _this.__rememberedObjects.push(object);\n }\n });\n\n if (this.autoPlace) {\n // Set save row width\n setWidth(this, this.width);\n }\n },\n\n /**\n * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.\n * @instance\n */\n getRoot: function() {\n let gui = this;\n while (gui.parent) {\n gui = gui.parent;\n }\n return gui;\n },\n\n /**\n * @returns {Object} a JSON object representing the current state of\n * this GUI as well as its remembered properties.\n * @instance\n */\n getSaveObject: function() {\n const toReturn = this.load;\n toReturn.closed = this.closed;\n\n // Am I remembering any values?\n if (this.__rememberedObjects.length > 0) {\n toReturn.preset = this.preset;\n\n if (!toReturn.remembered) {\n toReturn.remembered = {};\n }\n\n toReturn.remembered[this.preset] = getCurrentPreset(this);\n }\n\n toReturn.folders = {};\n common.each(this.__folders, function(element, key) {\n toReturn.folders[key] = element.getSaveObject();\n });\n\n return toReturn;\n },\n\n save: function() {\n if (!this.load.remembered) {\n this.load.remembered = {};\n }\n\n this.load.remembered[this.preset] = getCurrentPreset(this);\n markPresetModified(this, false);\n this.saveToLocalStorageIfPossible();\n },\n\n saveAs: function(presetName) {\n if (!this.load.remembered) {\n // Retain default values upon first save\n this.load.remembered = {};\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\n }\n\n this.load.remembered[presetName] = getCurrentPreset(this);\n this.preset = presetName;\n addPresetOption(this, presetName, true);\n this.saveToLocalStorageIfPossible();\n },\n\n revert: function(gui) {\n common.each(this.__controllers, function(controller) {\n // Make revert work on Default.\n if (!this.getRoot().load.remembered) {\n controller.setValue(controller.initialValue);\n } else {\n recallSavedValue(gui || this.getRoot(), controller);\n }\n\n // fire onFinishChange callback\n if (controller.__onFinishChange) {\n controller.__onFinishChange.call(controller, controller.getValue());\n }\n }, this);\n\n common.each(this.__folders, function(folder) {\n folder.revert(folder);\n });\n\n if (!gui) {\n markPresetModified(this.getRoot(), false);\n }\n },\n\n listen: function(controller) {\n const init = this.__listening.length === 0;\n this.__listening.push(controller);\n if (init) {\n updateDisplays(this.__listening);\n }\n },\n\n updateDisplay: function() {\n common.each(this.__controllers, function(controller) {\n controller.updateDisplay();\n });\n common.each(this.__folders, function(folder) {\n folder.updateDisplay();\n });\n }\n }\n);\n\n/**\n * Add a row to the end of the GUI or before another row.\n *\n * @param gui\n * @param [newDom] If specified, inserts the dom content in the new row\n * @param [liBefore] If specified, places the new row before another row\n *\n * @ignore\n */\nfunction addRow(gui, newDom, liBefore) {\n const li = document.createElement('li');\n if (newDom) {\n li.appendChild(newDom);\n }\n\n if (liBefore) {\n gui.__ul.insertBefore(li, liBefore);\n } else {\n gui.__ul.appendChild(li);\n }\n gui.onResize();\n return li;\n}\n\nfunction markPresetModified(gui, modified) {\n const opt = gui.__preset_select[gui.__preset_select.selectedIndex];\n\n // console.log('mark', modified, opt);\n if (modified) {\n opt.innerHTML = opt.value + '*';\n } else {\n opt.innerHTML = opt.value;\n }\n}\n\nfunction augmentController(gui, li, controller) {\n controller.__li = li;\n controller.__gui = gui;\n\n common.extend(controller, {\n options: function(options) {\n if (arguments.length > 1) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [common.toArray(arguments)]\n }\n );\n }\n\n if (common.isArray(options) || common.isObject(options)) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [options]\n }\n );\n }\n },\n\n name: function(v) {\n controller.__li.firstElementChild.firstElementChild.innerHTML = v;\n return controller;\n },\n\n listen: function() {\n controller.__gui.listen(controller);\n return controller;\n },\n\n remove: function() {\n controller.__gui.remove(controller);\n return controller;\n }\n });\n\n // All sliders should be accompanied by a box.\n if (controller instanceof NumberControllerSlider) {\n const box = new NumberControllerBox(controller.object, controller.property,\n { min: controller.__min, max: controller.__max, step: controller.__step });\n\n common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step'], function(method) {\n const pc = controller[method];\n const pb = box[method];\n controller[method] = box[method] = function() {\n const args = Array.prototype.slice.call(arguments);\n pb.apply(box, args);\n return pc.apply(controller, args);\n };\n });\n\n dom.addClass(li, 'has-slider');\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\n } else if (controller instanceof NumberControllerBox) {\n const r = function(returned) {\n // Have we defined both boundaries?\n if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {\n // Well, then lets just replace this with a slider.\n\n // lets remember if the old controller had a specific name or was listening\n const oldName = controller.__li.firstElementChild.firstElementChild.innerHTML;\n const wasListening = controller.__gui.__listening.indexOf(controller) > -1;\n\n controller.remove();\n const newController = add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [controller.__min, controller.__max, controller.__step]\n });\n\n newController.name(oldName);\n if (wasListening) newController.listen();\n\n return newController;\n }\n\n return returned;\n };\n\n controller.min = common.compose(r, controller.min);\n controller.max = common.compose(r, controller.max);\n } else if (controller instanceof BooleanController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__checkbox, 'click');\n });\n\n dom.bind(controller.__checkbox, 'click', function(e) {\n e.stopPropagation(); // Prevents double-toggle\n });\n } else if (controller instanceof FunctionController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__button, 'click');\n });\n\n dom.bind(li, 'mouseover', function() {\n dom.addClass(controller.__button, 'hover');\n });\n\n dom.bind(li, 'mouseout', function() {\n dom.removeClass(controller.__button, 'hover');\n });\n } else if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n controller.updateDisplay = common.compose(function(val) {\n li.style.borderLeftColor = controller.__color.toString();\n return val;\n }, controller.updateDisplay);\n\n controller.updateDisplay();\n }\n\n controller.setValue = common.compose(function(val) {\n if (gui.getRoot().__preset_select && controller.isModified()) {\n markPresetModified(gui.getRoot(), true);\n }\n\n return val;\n }, controller.setValue);\n}\n\nfunction recallSavedValue(gui, controller) {\n // Find the topmost GUI, that's where remembered objects live.\n const root = gui.getRoot();\n\n // Does the object we're controlling match anything we've been told to\n // remember?\n const matchedIndex = root.__rememberedObjects.indexOf(controller.object);\n\n // Why yes, it does!\n if (matchedIndex !== -1) {\n // Let me fetch a map of controllers for thcommon.isObject.\n let controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex];\n\n // Ohp, I believe this is the first controller we've created for this\n // object. Lets make the map fresh.\n if (controllerMap === undefined) {\n controllerMap = {};\n root.__rememberedObjectIndecesToControllers[matchedIndex] =\n controllerMap;\n }\n\n // Keep track of this controller\n controllerMap[controller.property] = controller;\n\n // Okay, now have we saved any values for this controller?\n if (root.load && root.load.remembered) {\n const presetMap = root.load.remembered;\n\n // Which preset are we trying to load?\n let preset;\n\n if (presetMap[gui.preset]) {\n preset = presetMap[gui.preset];\n } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) {\n // Uhh, you can have the default instead?\n preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME];\n } else {\n // Nada.\n return;\n }\n\n // Did the loaded object remember thcommon.isObject? && Did we remember this particular property?\n if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) {\n // We did remember something for this guy ...\n const value = preset[matchedIndex][controller.property];\n\n // And that's what it is.\n controller.initialValue = value;\n controller.setValue(value);\n }\n }\n }\n}\n\nfunction add(gui, object, property, params) {\n if (object[property] === undefined) {\n throw new Error(`Object \"${object}\" has no property \"${property}\"`);\n }\n\n let controller;\n\n if (params.color) {\n controller = new ColorController(object, property);\n } else {\n const factoryArgs = [object, property].concat(params.factoryArgs);\n controller = ControllerFactory.apply(gui, factoryArgs);\n }\n\n if (params.before instanceof Controller) {\n params.before = params.before.__li;\n }\n\n recallSavedValue(gui, controller);\n\n dom.addClass(controller.domElement, 'c');\n\n const name = document.createElement('span');\n dom.addClass(name, 'property-name');\n name.innerHTML = controller.property;\n\n const container = document.createElement('div');\n container.appendChild(name);\n container.appendChild(controller.domElement);\n\n const li = addRow(gui, container, params.before);\n\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\n if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n } else {\n dom.addClass(li, typeof controller.getValue());\n }\n\n augmentController(gui, li, controller);\n\n gui.__controllers.push(controller);\n\n return controller;\n}\n\nfunction getLocalStorageHash(gui, key) {\n // TODO how does this deal with multiple GUI's?\n return document.location.href + '.' + key;\n}\n\nfunction addPresetOption(gui, name, setSelected) {\n const opt = document.createElement('option');\n opt.innerHTML = name;\n opt.value = name;\n gui.__preset_select.appendChild(opt);\n if (setSelected) {\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\n }\n}\n\nfunction showHideExplain(gui, explain) {\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\n}\n\nfunction addSaveMenu(gui) {\n const div = gui.__save_row = document.createElement('li');\n\n dom.addClass(gui.domElement, 'has-save');\n\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\n\n dom.addClass(div, 'save-row');\n\n const gears = document.createElement('span');\n gears.innerHTML = ' ';\n dom.addClass(gears, 'button gears');\n\n // TODO replace with FunctionController\n const button = document.createElement('span');\n button.innerHTML = 'Save';\n dom.addClass(button, 'button');\n dom.addClass(button, 'save');\n\n const button2 = document.createElement('span');\n button2.innerHTML = 'New';\n dom.addClass(button2, 'button');\n dom.addClass(button2, 'save-as');\n\n const button3 = document.createElement('span');\n button3.innerHTML = 'Revert';\n dom.addClass(button3, 'button');\n dom.addClass(button3, 'revert');\n\n const select = gui.__preset_select = document.createElement('select');\n\n if (gui.load && gui.load.remembered) {\n common.each(gui.load.remembered, function(value, key) {\n addPresetOption(gui, key, key === gui.preset);\n });\n } else {\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\n }\n\n dom.bind(select, 'change', function() {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\n }\n\n gui.preset = this.value;\n });\n\n div.appendChild(select);\n div.appendChild(gears);\n div.appendChild(button);\n div.appendChild(button2);\n div.appendChild(button3);\n\n if (SUPPORTS_LOCAL_STORAGE) {\n const explain = document.getElementById('dg-local-explain');\n const localStorageCheckBox = document.getElementById('dg-local-storage');\n const saveLocally = document.getElementById('dg-save-locally');\n\n saveLocally.style.display = 'block';\n\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\n localStorageCheckBox.setAttribute('checked', 'checked');\n }\n\n showHideExplain(gui, explain);\n\n // TODO: Use a boolean controller, fool!\n dom.bind(localStorageCheckBox, 'change', function() {\n gui.useLocalStorage = !gui.useLocalStorage;\n showHideExplain(gui, explain);\n });\n }\n\n const newConstructorTextArea = document.getElementById('dg-new-constructor');\n\n dom.bind(newConstructorTextArea, 'keydown', function(e) {\n if (e.metaKey && (e.which === 67 || e.keyCode === 67)) {\n SAVE_DIALOGUE.hide();\n }\n });\n\n dom.bind(gears, 'click', function() {\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\n SAVE_DIALOGUE.show();\n newConstructorTextArea.focus();\n newConstructorTextArea.select();\n });\n\n dom.bind(button, 'click', function() {\n gui.save();\n });\n\n dom.bind(button2, 'click', function() {\n const presetName = prompt('Enter a new preset name.');\n if (presetName) {\n gui.saveAs(presetName);\n }\n });\n\n dom.bind(button3, 'click', function() {\n gui.revert();\n });\n\n // div.appendChild(button2);\n}\n\nfunction addResizeHandle(gui) {\n let pmouseX;\n\n gui.__resize_handle = document.createElement('div');\n\n common.extend(gui.__resize_handle.style, {\n\n width: '6px',\n marginLeft: '-3px',\n height: '200px',\n cursor: 'ew-resize',\n position: 'absolute'\n // border: '1px solid blue'\n\n });\n\n function drag(e) {\n e.preventDefault();\n\n gui.width += pmouseX - e.clientX;\n gui.onResize();\n pmouseX = e.clientX;\n\n return false;\n }\n\n function dragStop() {\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.unbind(window, 'mousemove', drag);\n dom.unbind(window, 'mouseup', dragStop);\n }\n\n function dragStart(e) {\n e.preventDefault();\n\n pmouseX = e.clientX;\n\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.bind(window, 'mousemove', drag);\n dom.bind(window, 'mouseup', dragStop);\n\n return false;\n }\n\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\n\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\n}\n\nfunction setWidth(gui, w) {\n gui.domElement.style.width = w + 'px';\n // Auto placed save-rows are position fixed, so we have to\n // set the width manually if we want it to bleed to the edge\n if (gui.__save_row && gui.autoPlace) {\n gui.__save_row.style.width = w + 'px';\n }\n if (gui.__closeButton) {\n gui.__closeButton.style.width = w + 'px';\n }\n}\n\nfunction getCurrentPreset(gui, useInitialValues) {\n const toReturn = {};\n\n // For each object I'm remembering\n common.each(gui.__rememberedObjects, function(val, index) {\n const savedValues = {};\n\n // The controllers I've made for thcommon.isObject by property\n const controllerMap =\n gui.__rememberedObjectIndecesToControllers[index];\n\n // Remember each value for each property\n common.each(controllerMap, function(controller, property) {\n savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue();\n });\n\n // Save the values for thcommon.isObject\n toReturn[index] = savedValues;\n });\n\n return toReturn;\n}\n\nfunction setPresetSelectIndex(gui) {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n if (gui.__preset_select[index].value === gui.preset) {\n gui.__preset_select.selectedIndex = index;\n }\n }\n}\n\nfunction updateDisplays(controllerArray) {\n if (controllerArray.length !== 0) {\n requestAnimationFrame.call(window, function() {\n updateDisplays(controllerArray);\n });\n }\n\n common.each(controllerArray, function(c) {\n c.updateDisplay();\n });\n}\n\nexport default GUI;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/gui/GUI.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nmodule.exports = {\n load: function(url, indoc) {\n const doc = indoc || document;\n const link = doc.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n doc.getElementsByTagName('head')[0].appendChild(link);\n },\n\n inject: function(css, indoc) {\n const doc = indoc || document;\n const injected = document.createElement('style');\n injected.type = 'text/css';\n injected.innerHTML = css;\n const head = doc.getElementsByTagName('head')[0];\n try {\n head.appendChild(injected);\n } catch (e) { // Unable to inject CSS, probably because of a Content Security Policy\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/css.js","module.exports = \"
    \\n\\n Here's the new load parameter for your GUI's constructor:\\n\\n \\n\\n
    \\n\\n Automatically save\\n values to localStorage on exit.\\n\\n
    The values saved to localStorage will\\n override those passed to dat.GUI's constructor. This makes it\\n easier to work incrementally, but localStorage is fragile,\\n and your friends may not see the same values you do.\\n\\n
    \\n\\n
    \\n\\n
    \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/saveDialogue.html\n// module id = 19\n// module chunks = 0","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport OptionController from './OptionController';\nimport NumberControllerBox from './NumberControllerBox';\nimport NumberControllerSlider from './NumberControllerSlider';\nimport StringController from './StringController';\nimport FunctionController from './FunctionController';\nimport BooleanController from './BooleanController';\nimport common from '../utils/common';\n\nconst ControllerFactory = function(object, property) {\n const initialValue = object[property];\n\n // Providing options?\n if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {\n return new OptionController(object, property, arguments[2]);\n }\n\n // Providing a map?\n if (common.isNumber(initialValue)) {\n // Has min and max? (slider)\n if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {\n // has step?\n if (common.isNumber(arguments[4])) {\n return new NumberControllerSlider(object, property,\n arguments[2], arguments[3], arguments[4]);\n }\n\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\n }\n\n // number box\n if (common.isNumber(arguments[4])) { // has step\n return new NumberControllerBox(object, property,\n { min: arguments[2], max: arguments[3], step: arguments[4] });\n }\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\n }\n\n if (common.isString(initialValue)) {\n return new StringController(object, property);\n }\n\n if (common.isFunction(initialValue)) {\n return new FunctionController(object, property, '');\n }\n\n if (common.isBoolean(initialValue)) {\n return new BooleanController(object, property);\n }\n\n return null;\n};\n\nexport default ControllerFactory;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/controllers/ControllerFactory.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction requestAnimationFrame(callback) {\n setTimeout(callback, 1000 / 60);\n}\n\nexport default window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n requestAnimationFrame;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/utils/requestAnimationFrame.js","/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nclass CenteredDiv {\n constructor() {\n this.backgroundElement = document.createElement('div');\n common.extend(this.backgroundElement.style, {\n backgroundColor: 'rgba(0,0,0,0.8)',\n top: 0,\n left: 0,\n display: 'none',\n zIndex: '1000',\n opacity: 0,\n WebkitTransition: 'opacity 0.2s linear',\n transition: 'opacity 0.2s linear'\n });\n\n dom.makeFullscreen(this.backgroundElement);\n this.backgroundElement.style.position = 'fixed';\n\n this.domElement = document.createElement('div');\n common.extend(this.domElement.style, {\n position: 'fixed',\n display: 'none',\n zIndex: '1001',\n opacity: 0,\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',\n transition: 'transform 0.2s ease-out, opacity 0.2s linear'\n });\n\n\n document.body.appendChild(this.backgroundElement);\n document.body.appendChild(this.domElement);\n\n const _this = this;\n dom.bind(this.backgroundElement, 'click', function() {\n _this.hide();\n });\n }\n\n show() {\n const _this = this;\n\n this.backgroundElement.style.display = 'block';\n\n this.domElement.style.display = 'block';\n this.domElement.style.opacity = 0;\n// this.domElement.style.top = '52%';\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n this.layout();\n\n common.defer(function() {\n _this.backgroundElement.style.opacity = 1;\n _this.domElement.style.opacity = 1;\n _this.domElement.style.webkitTransform = 'scale(1)';\n });\n }\n\n /**\n * Hide centered div\n */\n hide() {\n const _this = this;\n\n const hide = function() {\n _this.domElement.style.display = 'none';\n _this.backgroundElement.style.display = 'none';\n\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\n dom.unbind(_this.domElement, 'transitionend', hide);\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\n };\n\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\n dom.bind(this.domElement, 'transitionend', hide);\n dom.bind(this.domElement, 'oTransitionEnd', hide);\n\n this.backgroundElement.style.opacity = 0;\n// this.domElement.style.top = '48%';\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n }\n\n layout() {\n this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px';\n this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px';\n }\n}\n\nexport default CenteredDiv;\n\n\n\n// WEBPACK FOOTER //\n// ./dat/dom/CenteredDiv.js","exports = module.exports = require(\"../../../node_modules/css-loader/lib/css-base.js\")();\n// imports\n\n\n// module\nexports.push([module.id, \".dg {\\n /** Clear list styles */\\n /* Auto-place container */\\n /* Auto-placed GUI's */\\n /* Line items that don't contain folders. */\\n /** Folder names */\\n /** Hides closed items */\\n /** Controller row */\\n /** Name-half (left) */\\n /** Controller-half (right) */\\n /** Controller placement */\\n /** Shorter number boxes when slider is present. */\\n /** Ensure the entire boolean and function row shows a hand */\\n /** allow overflow for color selector */ }\\n .dg ul {\\n list-style: none;\\n margin: 0;\\n padding: 0;\\n width: 100%;\\n clear: both; }\\n .dg.ac {\\n position: fixed;\\n top: 0;\\n left: 0;\\n right: 0;\\n height: 0;\\n z-index: 0; }\\n .dg:not(.ac) .main {\\n /** Exclude mains in ac so that we don't hide close button */\\n overflow: hidden; }\\n .dg.main {\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear; }\\n .dg.main.taller-than-window {\\n overflow-y: auto; }\\n .dg.main.taller-than-window .close-button {\\n opacity: 1;\\n /* TODO, these are style notes */\\n margin-top: -1px;\\n border-top: 1px solid #2c2c2c; }\\n .dg.main ul.closed .close-button {\\n opacity: 1 !important; }\\n .dg.main:hover .close-button,\\n .dg.main .close-button.drag {\\n opacity: 1; }\\n .dg.main .close-button {\\n /*opacity: 0;*/\\n -webkit-transition: opacity 0.1s linear;\\n -o-transition: opacity 0.1s linear;\\n -moz-transition: opacity 0.1s linear;\\n transition: opacity 0.1s linear;\\n border: 0;\\n line-height: 19px;\\n height: 20px;\\n /* TODO, these are style notes */\\n cursor: pointer;\\n text-align: center;\\n background-color: #000; }\\n .dg.main .close-button.close-top {\\n position: relative; }\\n .dg.main .close-button.close-bottom {\\n position: absolute; }\\n .dg.main .close-button:hover {\\n background-color: #111; }\\n .dg.a {\\n float: right;\\n margin-right: 15px;\\n overflow-y: visible; }\\n .dg.a.has-save > ul.close-top {\\n margin-top: 0; }\\n .dg.a.has-save > ul.close-bottom {\\n margin-top: 27px; }\\n .dg.a.has-save > ul.closed {\\n margin-top: 0; }\\n .dg.a .save-row {\\n top: 0;\\n z-index: 1002; }\\n .dg.a .save-row.close-top {\\n position: relative; }\\n .dg.a .save-row.close-bottom {\\n position: fixed; }\\n .dg li {\\n -webkit-transition: height 0.1s ease-out;\\n -o-transition: height 0.1s ease-out;\\n -moz-transition: height 0.1s ease-out;\\n transition: height 0.1s ease-out;\\n -webkit-transition: overflow 0.1s linear;\\n -o-transition: overflow 0.1s linear;\\n -moz-transition: overflow 0.1s linear;\\n transition: overflow 0.1s linear; }\\n .dg li:not(.folder) {\\n cursor: auto;\\n height: 27px;\\n line-height: 27px;\\n padding: 0 4px 0 5px; }\\n .dg li.folder {\\n padding: 0;\\n border-left: 4px solid transparent; }\\n .dg li.title {\\n cursor: pointer;\\n margin-left: -4px; }\\n .dg .closed li:not(.title),\\n .dg .closed ul li,\\n .dg .closed ul li > * {\\n height: 0;\\n overflow: hidden;\\n border: 0; }\\n .dg .cr {\\n clear: both;\\n padding-left: 3px;\\n height: 27px;\\n overflow: hidden; }\\n .dg .property-name {\\n cursor: default;\\n float: left;\\n clear: left;\\n width: 40%;\\n overflow: hidden;\\n text-overflow: ellipsis; }\\n .dg .c {\\n float: left;\\n width: 60%;\\n position: relative; }\\n .dg .c input[type=text] {\\n border: 0;\\n margin-top: 4px;\\n padding: 3px;\\n width: 100%;\\n float: right; }\\n .dg .has-slider input[type=text] {\\n width: 30%;\\n /*display: none;*/\\n margin-left: 0; }\\n .dg .slider {\\n float: left;\\n width: 66%;\\n margin-left: -5px;\\n margin-right: 0;\\n height: 19px;\\n margin-top: 4px; }\\n .dg .slider-fg {\\n height: 100%; }\\n .dg .c input[type=checkbox] {\\n margin-top: 7px; }\\n .dg .c select {\\n margin-top: 5px; }\\n .dg .cr.function,\\n .dg .cr.function .property-name,\\n .dg .cr.function *,\\n .dg .cr.boolean,\\n .dg .cr.boolean * {\\n cursor: pointer; }\\n .dg .cr.color {\\n overflow: visible; }\\n .dg .selector {\\n display: none;\\n position: absolute;\\n margin-left: -9px;\\n margin-top: 23px;\\n z-index: 10; }\\n .dg .c:hover .selector,\\n .dg .selector.drag {\\n display: block; }\\n .dg li.save-row {\\n padding: 0; }\\n .dg li.save-row .button {\\n display: inline-block;\\n padding: 0px 6px; }\\n .dg.dialogue {\\n background-color: #222;\\n width: 460px;\\n padding: 15px;\\n font-size: 13px;\\n line-height: 15px; }\\n\\n/* TODO Separate style and structure */\\n#dg-new-constructor {\\n padding: 10px;\\n color: #222;\\n font-family: Monaco, monospace;\\n font-size: 10px;\\n border: 0;\\n resize: none;\\n box-shadow: inset 1px 1px 1px #888;\\n word-wrap: break-word;\\n margin: 12px 0;\\n display: block;\\n width: 440px;\\n overflow-y: scroll;\\n height: 100px;\\n position: relative; }\\n\\n#dg-local-explain {\\n display: none;\\n font-size: 11px;\\n line-height: 17px;\\n border-radius: 3px;\\n background-color: #333;\\n padding: 8px;\\n margin-top: 10px; }\\n #dg-local-explain code {\\n font-size: 10px; }\\n\\n#dat-gui-save-locally {\\n display: none; }\\n\\n/** Main type */\\n.dg {\\n color: #eee;\\n font: 11px 'Lucida Grande', sans-serif;\\n text-shadow: 0 -1px 0 #111;\\n /** Auto place */\\n /* Controller row,
  • */\\n /** Controllers */ }\\n .dg.main {\\n /** Scrollbar */ }\\n .dg.main::-webkit-scrollbar {\\n width: 5px;\\n background: #1a1a1a; }\\n .dg.main::-webkit-scrollbar-corner {\\n height: 0;\\n display: none; }\\n .dg.main::-webkit-scrollbar-thumb {\\n border-radius: 5px;\\n background: #676767; }\\n .dg li:not(.folder) {\\n background: #1a1a1a;\\n border-bottom: 1px solid #2c2c2c; }\\n .dg li.save-row {\\n line-height: 25px;\\n background: #dad5cb;\\n border: 0; }\\n .dg li.save-row select {\\n margin-left: 5px;\\n width: 108px; }\\n .dg li.save-row .button {\\n margin-left: 5px;\\n margin-top: 1px;\\n border-radius: 2px;\\n font-size: 9px;\\n line-height: 7px;\\n padding: 4px 4px 5px 4px;\\n background: #c5bdad;\\n color: #fff;\\n text-shadow: 0 1px 0 #b0a58f;\\n box-shadow: 0 -1px 0 #b0a58f;\\n cursor: pointer; }\\n .dg li.save-row .button.gears {\\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\\n height: 7px;\\n width: 8px; }\\n .dg li.save-row .button:hover {\\n background-color: #bab19e;\\n box-shadow: 0 -1px 0 #b0a58f; }\\n .dg li.folder {\\n border-bottom: 0; }\\n .dg li.title {\\n padding-left: 16px;\\n background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\\n cursor: pointer;\\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\\n .dg .closed li.title {\\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\\n .dg .cr.boolean {\\n border-left: 3px solid #806787; }\\n .dg .cr.color {\\n border-left: 3px solid; }\\n .dg .cr.function {\\n border-left: 3px solid #e61d5f; }\\n .dg .cr.number {\\n border-left: 3px solid #2FA1D6; }\\n .dg .cr.number input[type=text] {\\n color: #2FA1D6; }\\n .dg .cr.string {\\n border-left: 3px solid #1ed36f; }\\n .dg .cr.string input[type=text] {\\n color: #1ed36f; }\\n .dg .cr.function:hover, .dg .cr.boolean:hover {\\n background: #111; }\\n .dg .c input[type=text] {\\n background: #303030;\\n outline: none; }\\n .dg .c input[type=text]:hover {\\n background: #3c3c3c; }\\n .dg .c input[type=text]:focus {\\n background: #494949;\\n color: #fff; }\\n .dg .c .slider {\\n background: #303030;\\n cursor: ew-resize; }\\n .dg .c .slider-fg {\\n background: #2FA1D6;\\n max-width: 100%; }\\n .dg .c .slider:hover {\\n background: #3c3c3c; }\\n .dg .c .slider:hover .slider-fg {\\n background: #44abda; }\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dat/gui/style.scss\n// module id = 23\n// module chunks = 0","/*\r\n\tMIT License http://www.opensource.org/licenses/mit-license.php\r\n\tAuthor Tobias Koppers @sokra\r\n*/\r\n// css base code, injected by the css-loader\r\nmodule.exports = function() {\r\n\tvar list = [];\r\n\r\n\t// return the list of modules as css string\r\n\tlist.toString = function toString() {\r\n\t\tvar result = [];\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar item = this[i];\r\n\t\t\tif(item[2]) {\r\n\t\t\t\tresult.push(\"@media \" + item[2] + \"{\" + item[1] + \"}\");\r\n\t\t\t} else {\r\n\t\t\t\tresult.push(item[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result.join(\"\");\r\n\t};\r\n\r\n\t// import a list of modules into the list\r\n\tlist.i = function(modules, mediaQuery) {\r\n\t\tif(typeof modules === \"string\")\r\n\t\t\tmodules = [[null, modules, \"\"]];\r\n\t\tvar alreadyImportedModules = {};\r\n\t\tfor(var i = 0; i < this.length; i++) {\r\n\t\t\tvar id = this[i][0];\r\n\t\t\tif(typeof id === \"number\")\r\n\t\t\t\talreadyImportedModules[id] = true;\r\n\t\t}\r\n\t\tfor(i = 0; i < modules.length; i++) {\r\n\t\t\tvar item = modules[i];\r\n\t\t\t// skip already imported module\r\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\r\n\t\t\t// when a module is imported multiple times with different media queries.\r\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\r\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\r\n\t\t\t\tif(mediaQuery && !item[2]) {\r\n\t\t\t\t\titem[2] = mediaQuery;\r\n\t\t\t\t} else if(mediaQuery) {\r\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\r\n\t\t\t\t}\r\n\t\t\t\tlist.push(item);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\treturn list;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../~/css-loader/lib/css-base.js\n// module id = 24\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/build/dat.gui.min.js b/build/dat.gui.min.js deleted file mode 100644 index e0b597c6..00000000 --- a/build/dat.gui.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dat=t():e.dat=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(1),r=o(i);t.default=r.default,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(2),r=o(i),a=n(6),l=o(a),s=n(3),u=o(s),d=n(7),c=o(d),f=n(8),_=o(f),p=n(10),h=o(p),m=n(11),b=o(m),g=n(12),v=o(g),y=n(13),w=o(y),x=n(14),E=o(x),C=n(15),A=o(C),S=n(16),k=o(S),O=n(9),T=o(O),R=n(17),L=o(R);t.default={color:{Color:r.default,math:l.default,interpret:u.default},controllers:{Controller:c.default,BooleanController:_.default,OptionController:h.default,StringController:b.default,NumberController:v.default,NumberControllerBox:w.default,NumberControllerSlider:E.default,FunctionController:A.default,ColorController:k.default},dom:{dom:T.default},gui:{GUI:L.default},GUI:L.default},e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(h.recalculateRGB(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(h.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function a(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(h.recalculateHSV(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(h.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}t.__esModule=!0;var l=n(3),s=o(l),u=n(6),d=o(u),c=n(4),f=o(c),_=n(5),p=o(_),h=function(){function e(){if(i(this,e),this.__state=s.default.apply(this,arguments),this.__state===!1)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return e.prototype.toString=function(){return(0,f.default)(this)},e.prototype.toHexString=function(){return(0,f.default)(this,!0)},e.prototype.toOriginal=function(){return this.__state.conversion.write(this)},e}();h.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=d.default.component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");p.default.extend(e.__state,d.default.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},h.recalculateHSV=function(e){var t=d.default.rgb_to_hsv(e.r,e.g,e.b);p.default.extend(e.__state,{s:t.s,v:t.v}),p.default.isNaN(t.h)?p.default.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},h.COMPONENTS=["r","g","b","h","s","v","hex","a"],r(h.prototype,"r",2),r(h.prototype,"g",1),r(h.prototype,"b",0),a(h.prototype,"h"),a(h.prototype,"s"),a(h.prototype,"v"),Object.defineProperty(h.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(h.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=d.default.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),t.default=h,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(4),r=o(i),a=n(5),l=o(a),s=[{litmus:l.default.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:r.default},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:r.default},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:r.default},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:r.default}}},{litmus:l.default.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:l.default.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:l.default.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(l.default.isNumber(e.r)&&l.default.isNumber(e.g)&&l.default.isNumber(e.b)&&l.default.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(l.default.isNumber(e.r)&&l.default.isNumber(e.g)&&l.default.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(l.default.isNumber(e.h)&&l.default.isNumber(e.s)&&l.default.isNumber(e.v)&&l.default.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(l.default.isNumber(e.h)&&l.default.isNumber(e.s)&&l.default.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],u=void 0,d=void 0,c=function(){d=!1;var e=arguments.length>1?l.default.toArray(arguments):arguments[0];return l.default.each(s,function(t){if(t.litmus(e))return l.default.each(t.conversions,function(t,n){if(u=t.read(e),d===!1&&u!==!1)return d=u,u.conversionName=n,u.conversion=t,l.default.BREAK}),l.default.BREAK}),d};t.default=c,e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e,t){var n=e.__state.conversionName.toString(),o=Math.round(e.r),i=Math.round(e.g),r=Math.round(e.b),a=e.a,l=Math.round(e.h),s=e.s.toFixed(1),u=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var d=e.hex.toString(16);d.length<6;)d="0"+d;return"#"+d}return"CSS_RGB"===n?"rgb("+o+","+i+","+r+")":"CSS_RGBA"===n?"rgba("+o+","+i+","+r+","+a+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+o+","+i+","+r+"]":"RGBA_ARRAY"===n?"["+o+","+i+","+r+","+a+"]":"RGB_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+"}":"RGBA_OBJ"===n?"{r:"+o+",g:"+i+",b:"+r+",a:"+a+"}":"HSV_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+"}":"HSVA_OBJ"===n?"{h:"+l+",s:"+s+",v:"+u+",a:"+a+"}":"unknown format"},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;var n=Array.prototype.forEach,o=Array.prototype.slice,i={BREAK:{},extend:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(t[n])||(e[n]=t[n])}.bind(this))},this),e},defaults:function(e){return this.each(o.call(arguments,1),function(t){var n=this.isObject(t)?Object.keys(t):[];n.forEach(function(n){this.isUndefined(e[n])&&(e[n]=t[n])}.bind(this))},this),e},compose:function(){var e=o.call(arguments);return function(){for(var t=o.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,o){if(e)if(n&&e.forEach&&e.forEach===n)e.forEach(t,o);else if(e.length===e.length+0){var i=void 0,r=void 0;for(i=0,r=e.length;i>8*t&255},hex_with_component:function(e,t,o){return o<<(n=8*t)|e&~(255<-1?t.length-t.indexOf(".")-1:0}t.__esModule=!0;var s=n(7),u=o(s),d=n(5),c=o(d),f=function(e){function t(n,o,a){i(this,t);var s=r(this,e.call(this,n,o)),u=a||{};return s.__min=u.min,s.__max=u.max,s.__step=u.step,c.default.isUndefined(s.__step)?0===s.initialValue?s.__impliedStep=1:s.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(s.initialValue))/Math.LN10))/10:s.__impliedStep=s.__step,s.__precision=l(s.__impliedStep),s}return a(t,e),t.prototype.setValue=function(t){var n=t;return void 0!==this.__min&&nthis.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!==0&&(n=Math.round(n/this.__step)*this.__step),e.prototype.setValue.call(this,n)},t.prototype.min=function(e){return this.__min=e,this},t.prototype.max=function(e){return this.__max=e,this},t.prototype.step=function(e){return this.__step=e,this.__impliedStep=e,this.__precision=l(e),this},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=n(5),_=o(f),p=function(e){function t(n,o,a){function l(e){var t=b.getValue(),n=(e.deltaY||-e.wheelDelta||e.detail)>>10||1;e.preventDefault(),n<0?t+=b.__impliedStep:t-=b.__impliedStep,b.setValue(t)}function s(){var e=parseFloat(b.__input.value);_.default.isNaN(e)||b.setValue(e)}function u(){b.__onFinishChange&&b.__onFinishChange.call(b,b.getValue())}function d(){u()}function f(e){var t=g-e.clientY;b.setValue(b.getValue()+t*b.__impliedStep),g=e.clientY}function p(){c.default.unbind(window,"mousemove",f),c.default.unbind(window,"mouseup",p),u()}function h(e){c.default.bind(window,"mousemove",f),c.default.bind(window,"mouseup",p),g=e.clientY}i(this,t);var m=r(this,e.call(this,n,o,a));m.__truncationSuspended=!1;var b=m,g=void 0,v=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";return m.__input=document.createElement("input"),m.__input.setAttribute("type","text"),c.default.bind(m.__input,"change",s),c.default.bind(m.__input,"blur",d),c.default.bind(m.__input,"mousedown",h),c.default.bind(m.__input,v,l),c.default.bind(m.__input,"keydown",function(e){13===e.keyCode&&(b.__truncationSuspended=!0,this.blur(),b.__truncationSuspended=!1,u())}),m.updateDisplay(),m.domElement.appendChild(m.__input),m}return a(t,e),t.prototype.updateDisplay=function(){return this.__input.value=this.__truncationSuspended?this.getValue():l(this.getValue(),this.__precision),e.prototype.updateDisplay.call(this)},t}(u.default);t.default=p,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o,i){return o+(i-o)*((e-t)/(n-t))}t.__esModule=!0;var s=n(12),u=o(s),d=n(9),c=o(d),f=function(e){function t(n,o,a,s,u){function d(e){var t=m.getValue(),n=(e.deltaY||-e.wheelDelta||e.detail)>>10||1;e.preventDefault(),document.activeElement.blur(),n<0?t+=m.__impliedStep:t-=m.__impliedStep,m.setValue(t)}function f(e){document.activeElement.blur(),c.default.bind(window,"mousemove",_),c.default.bind(window,"mouseup",p),_(e)}function _(e){e.preventDefault();var t=m.__background.getBoundingClientRect();return m.setValue(l(e.clientX,t.left,t.right,m.__min,m.__max)),!1}function p(){c.default.unbind(window,"mousemove",_),c.default.unbind(window,"mouseup",p),m.__onFinishChange&&m.__onFinishChange.call(m,m.getValue())}i(this,t);var h=r(this,e.call(this,n,o,{min:a,max:s,step:u})),m=h;h.__background=document.createElement("div"),h.__foreground=document.createElement("div"),c.default.bind(h.__background,"mousedown",f);var b=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";return c.default.bind(h.__background,b,d),c.default.addClass(h.__background,"slider"),c.default.addClass(h.__foreground,"slider-fg"),h.updateDisplay(),h.__background.appendChild(h.__foreground),h.domElement.appendChild(h.__background),h}return a(t,e),t.prototype.updateDisplay=function(){var t=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*t+"%",e.prototype.updateDisplay.call(this)},t}(u.default);t.default=f,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var l=n(7),s=o(l),u=n(9),d=o(u),c=function(e){function t(n,o,a){i(this,t);var l=r(this,e.call(this,n,o)),s=l;return l.__button=document.createElement("div"),l.__button.innerHTML=void 0===a?"Fire":a,d.default.bind(l.__button,"click",function(e){return e.preventDefault(),s.fire(),!1}),d.default.addClass(l.__button,"button"),l.domElement.appendChild(l.__button),l}return a(t,e),t.prototype.fire=function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())},t}(s.default);t.default=c,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function l(e,t,n,o){e.style.background="",g.default.each(y,function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+o+" 100%); "})}function s(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}t.__esModule=!0;var u=n(7),d=o(u),c=n(9),f=o(c),_=n(2),p=o(_),h=n(3),m=o(h),b=n(5),g=o(b),v=function(e){function t(n,o){function a(e){h(e),f.default.bind(window,"mousemove",h),f.default.bind(window,"mouseup",u)}function u(){f.default.unbind(window,"mousemove",h),f.default.unbind(window,"mouseup",u),_()}function d(){var e=(0,m.default)(this.value);e!==!1?(y.__color.__state=e,y.setValue(y.__color.toOriginal())):this.value=y.__color.toString()}function c(){f.default.unbind(window,"mousemove",b),f.default.unbind(window,"mouseup",c),_()}function _(){y.__onFinishChange&&y.__onFinishChange.call(y,y.__color.toOriginal())}function h(e){e.preventDefault();var t=y.__saturation_field.getBoundingClientRect(),n=(e.clientX-t.left)/(t.right-t.left),o=1-(e.clientY-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),n>1?n=1:n<0&&(n=0),y.__color.v=o,y.__color.s=n,y.setValue(y.__color.toOriginal()),!1}function b(e){e.preventDefault();var t=y.__hue_field.getBoundingClientRect(),n=1-(e.clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),y.__color.h=360*n,y.setValue(y.__color.toOriginal()),!1}i(this,t);var v=r(this,e.call(this,n,o));v.__color=new p.default(v.getValue()),v.__temp=new p.default(0);var y=v;v.domElement=document.createElement("div"),f.default.makeSelectable(v.domElement,!1),v.__selector=document.createElement("div"),v.__selector.className="selector",v.__saturation_field=document.createElement("div"),v.__saturation_field.className="saturation-field",v.__field_knob=document.createElement("div"),v.__field_knob.className="field-knob",v.__field_knob_border="2px solid ",v.__hue_knob=document.createElement("div"),v.__hue_knob.className="hue-knob",v.__hue_field=document.createElement("div"),v.__hue_field.className="hue-field",v.__input=document.createElement("input"),v.__input.type="text",v.__input_textShadow="0 1px 1px ",f.default.bind(v.__input,"keydown",function(e){13===e.keyCode&&d.call(this)}),f.default.bind(v.__input,"blur",d),f.default.bind(v.__selector,"mousedown",function(){f.default.addClass(this,"drag").bind(window,"mouseup",function(){f.default.removeClass(y.__selector,"drag")})});var w=document.createElement("div");return g.default.extend(v.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),g.default.extend(v.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:v.__field_knob_border+(v.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),g.default.extend(v.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),g.default.extend(v.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),g.default.extend(w.style,{width:"100%",height:"100%",background:"none"}),l(w,"top","rgba(0,0,0,0)","#000"),g.default.extend(v.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),s(v.__hue_field),g.default.extend(v.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:v.__input_textShadow+"rgba(0,0,0,0.7)"}),f.default.bind(v.__saturation_field,"mousedown",a),f.default.bind(v.__field_knob,"mousedown",a),f.default.bind(v.__hue_field,"mousedown",function(e){b(e),f.default.bind(window,"mousemove",b),f.default.bind(window,"mouseup",c)}),v.__saturation_field.appendChild(w),v.__selector.appendChild(v.__field_knob),v.__selector.appendChild(v.__saturation_field),v.__selector.appendChild(v.__hue_field),v.__hue_field.appendChild(v.__hue_knob),v.domElement.appendChild(v.__input),v.domElement.appendChild(v.__selector),v.updateDisplay(),v}return a(t,e),t.prototype.updateDisplay=function(){var e=(0,m.default)(this.getValue());if(e!==!1){var t=!1;g.default.each(p.default.COMPONENTS,function(n){if(!g.default.isUndefined(e[n])&&!g.default.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&g.default.extend(this.__color.__state,e)}g.default.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,o=255-n;g.default.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,l(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),g.default.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})},t}(d.default),y=["-moz-","-o-","-webkit-","-ms-",""];t.default=v,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t,n){var o=document.createElement("li");return t&&o.appendChild(t),n?e.__ul.insertBefore(o,n):e.__ul.appendChild(o),e.onResize(),o}function r(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];t?n.innerHTML=n.value+"*":n.innerHTML=n.value}function a(e,t,n){if(n.__li=t,n.__gui=e,U.default.extend(n,{options:function(t){ -if(arguments.length>1){var o=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:o,factoryArgs:[U.default.toArray(arguments)]})}if(U.default.isArray(t)||U.default.isObject(t)){var i=n.__li.nextElementSibling;return n.remove(),s(e,n.object,n.property,{before:i,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof N.default){var o=new M.default(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});U.default.each(["updateDisplay","onChange","onFinishChange","step"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return i.apply(o,e),t.apply(n,e)}}),z.default.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof M.default){var i=function(t){if(U.default.isNumber(n.__min)&&U.default.isNumber(n.__max)){var o=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();var r=s(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return r.name(o),i&&r.listen(),r}return t};n.min=U.default.compose(i,n.min),n.max=U.default.compose(i,n.max)}else n instanceof O.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__checkbox,"click")}),z.default.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof R.default?(z.default.bind(t,"click",function(){z.default.fakeEvent(n.__button,"click")}),z.default.bind(t,"mouseover",function(){z.default.addClass(n.__button,"hover")}),z.default.bind(t,"mouseout",function(){z.default.removeClass(n.__button,"hover")})):n instanceof j.default&&(z.default.addClass(t,"color"),n.updateDisplay=U.default.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=U.default.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&r(e.getRoot(),!0),t},n.setValue)}function l(e,t){var n=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(o!==-1){var i=n.__rememberedObjectIndecesToControllers[o];if(void 0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){var r=n.load.remembered,a=void 0;if(r[e.preset])a=r[e.preset];else{if(!r[Q])return;a=r[Q]}if(a[o]&&void 0!==a[o][t.property]){var l=a[o][t.property];t.initialValue=l,t.setValue(l)}}}}function s(e,t,n,o){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var r=void 0;if(o.color)r=new j.default(t,n);else{var s=[t,n].concat(o.factoryArgs);r=C.default.apply(e,s)}o.before instanceof S.default&&(o.before=o.before.__li),l(e,r),z.default.addClass(r.domElement,"c");var u=document.createElement("span");z.default.addClass(u,"property-name"),u.innerHTML=r.property;var d=document.createElement("div");d.appendChild(u),d.appendChild(r.domElement);var c=i(e,d,o.before);return z.default.addClass(c,oe.CLASS_CONTROLLER_ROW),r instanceof j.default?z.default.addClass(c,"color"):z.default.addClass(c,g(r.getValue())),a(e,c,r),e.__controllers.push(r),r}function u(e,t){return document.location.href+"."+t}function d(e,t,n){var o=document.createElement("option");o.innerHTML=t,o.value=t,e.__preset_select.appendChild(o),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function c(e,t){t.style.display=e.useLocalStorage?"block":"none"}function f(e){var t=e.__save_row=document.createElement("li");z.default.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),z.default.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML=" ",z.default.addClass(n,"button gears");var o=document.createElement("span");o.innerHTML="Save",z.default.addClass(o,"button"),z.default.addClass(o,"save");var i=document.createElement("span");i.innerHTML="New",z.default.addClass(i,"button"),z.default.addClass(i,"save-as");var r=document.createElement("span");r.innerHTML="Revert",z.default.addClass(r,"button"),z.default.addClass(r,"revert");var a=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?U.default.each(e.load.remembered,function(t,n){d(e,n,n===e.preset)}):d(e,Q,!1),z.default.bind(a,"change",function(){for(var t=0;t0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=h(this)),e.folders={},U.default.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=h(this),r(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[Q]=h(this,!0)),this.load.remembered[e]=h(this),this.preset=e,d(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){U.default.each(this.__controllers,function(t){this.getRoot().load.remembered?l(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())},this),U.default.each(this.__folders,function(e){e.revert(e)}),e||r(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&b(this.__listening)},updateDisplay:function(){U.default.each(this.__controllers,function(e){e.updateDisplay()}),U.default.each(this.__folders,function(e){e.updateDisplay()})}}),t.default=oe,e.exports=t.default},function(e,t){"use strict";e.exports={load:function(e,t){var n=t||document,o=n.createElement("link");o.type="text/css",o.rel="stylesheet",o.href=e,n.getElementsByTagName("head")[0].appendChild(o)},inject:function(e,t){var n=t||document,o=document.createElement("style");o.type="text/css",o.innerHTML=e;var i=n.getElementsByTagName("head")[0];try{i.appendChild(o)}catch(e){}}}},function(e,t){e.exports="
    Here's the new load parameter for your GUI's constructor:
    Automatically save values to localStorage on exit.
    The values saved to localStorage will override those passed to dat.GUI's constructor. This makes it easier to work incrementally, but localStorage is fragile, and your friends may not see the same values you do.
    "},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(10),r=o(i),a=n(13),l=o(a),s=n(14),u=o(s),d=n(11),c=o(d),f=n(15),_=o(f),p=n(8),h=o(p),m=n(5),b=o(m),g=function(e,t){var n=e[t];return b.default.isArray(arguments[2])||b.default.isObject(arguments[2])?new r.default(e,t,arguments[2]):b.default.isNumber(n)?b.default.isNumber(arguments[2])&&b.default.isNumber(arguments[3])?b.default.isNumber(arguments[4])?new u.default(e,t,arguments[2],arguments[3],arguments[4]):new u.default(e,t,arguments[2],arguments[3]):b.default.isNumber(arguments[4])?new l.default(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new l.default(e,t,{min:arguments[2],max:arguments[3]}):b.default.isString(n)?new c.default(e,t):b.default.isFunction(n)?new _.default(e,t,""):b.default.isBoolean(n)?new h.default(e,t):null};t.default=g,e.exports=t.default},function(e,t){"use strict";function n(e){setTimeout(e,1e3/60)}t.__esModule=!0,t.default=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||n,e.exports=t.default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var r=n(9),a=o(r),l=n(5),s=o(l),u=function(){function e(){i(this,e),this.backgroundElement=document.createElement("div"),s.default.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),a.default.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),s.default.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;a.default.bind(this.backgroundElement,"click",function(){t.hide()})}return e.prototype.show=function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),s.default.defer(function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"})},e.prototype.hide=function e(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",a.default.unbind(t.domElement,"webkitTransitionEnd",e),a.default.unbind(t.domElement,"transitionend",e),a.default.unbind(t.domElement,"oTransitionEnd",e)};a.default.bind(this.domElement,"webkitTransitionEnd",e),a.default.bind(this.domElement,"transitionend",e),a.default.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"},e.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-a.default.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-a.default.getHeight(this.domElement)/2+"px"},e}();t.default=u,e.exports=t.default},function(e,t,n){t=e.exports=n(24)(),t.push([e.id,".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{transition:height .1s ease-out;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px Lucida Grande,sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t