dat.gui/build/dat.gui.module.js.map
efokschaner fdcd266249 Add named exports.
`import dat from 'dat.gui'` is now interchangeable with
`import * as dat from 'dat.gui'`
2018-05-05 14:48:56 -07:00

1 line
179 KiB
Plaintext

{"version":3,"file":"dat.gui.module.js","sources":["../src/dat/color/toString.js","../src/dat/utils/common.js","../src/dat/color/interpret.js","../src/dat/color/math.js","../src/dat/color/Color.js","../src/dat/controllers/Controller.js","../src/dat/dom/dom.js","../src/dat/controllers/BooleanController.js","../src/dat/controllers/OptionController.js","../src/dat/controllers/StringController.js","../src/dat/controllers/NumberController.js","../src/dat/controllers/NumberControllerBox.js","../src/dat/controllers/NumberControllerSlider.js","../src/dat/controllers/FunctionController.js","../src/dat/controllers/ColorController.js","../src/dat/utils/css.js","../src/dat/gui/saveDialogue.html.js","../src/dat/controllers/ControllerFactory.js","../src/dat/utils/requestAnimationFrame.js","../src/dat/dom/CenteredDiv.js","../src/dat/gui/GUI.js","../src/dat/index.js"],"sourcesContent":["/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nexport default function(color, forceCSSHex) {\r\n const colorFormat = color.__state.conversionName.toString();\r\n\r\n const r = Math.round(color.r);\r\n const g = Math.round(color.g);\r\n const b = Math.round(color.b);\r\n const a = color.a;\r\n const h = Math.round(color.h);\r\n const s = color.s.toFixed(1);\r\n const v = color.v.toFixed(1);\r\n\r\n if (forceCSSHex || (colorFormat === 'THREE_CHAR_HEX') || (colorFormat === 'SIX_CHAR_HEX')) {\r\n let str = color.hex.toString(16);\r\n while (str.length < 6) {\r\n str = '0' + str;\r\n }\r\n return '#' + str;\r\n } else if (colorFormat === 'CSS_RGB') {\r\n return 'rgb(' + r + ',' + g + ',' + b + ')';\r\n } else if (colorFormat === 'CSS_RGBA') {\r\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\r\n } else if (colorFormat === 'HEX') {\r\n return '0x' + color.hex.toString(16);\r\n } else if (colorFormat === 'RGB_ARRAY') {\r\n return '[' + r + ',' + g + ',' + b + ']';\r\n } else if (colorFormat === 'RGBA_ARRAY') {\r\n return '[' + r + ',' + g + ',' + b + ',' + a + ']';\r\n } else if (colorFormat === 'RGB_OBJ') {\r\n return '{r:' + r + ',g:' + g + ',b:' + b + '}';\r\n } else if (colorFormat === 'RGBA_OBJ') {\r\n return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}';\r\n } else if (colorFormat === 'HSV_OBJ') {\r\n return '{h:' + h + ',s:' + s + ',v:' + v + '}';\r\n } else if (colorFormat === 'HSVA_OBJ') {\r\n return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}';\r\n }\r\n\r\n return 'unknown format';\r\n}\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nconst ARR_EACH = Array.prototype.forEach;\r\nconst ARR_SLICE = Array.prototype.slice;\r\n\r\n/**\r\n * Band-aid methods for things that should be a lot easier in JavaScript.\r\n * Implementation and structure inspired by underscore.js\r\n * http://documentcloud.github.com/underscore/\r\n */\r\n\r\nconst Common = {\r\n BREAK: {},\r\n\r\n extend: function(target) {\r\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\r\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\r\n keys.forEach(function(key) {\r\n if (!this.isUndefined(obj[key])) {\r\n target[key] = obj[key];\r\n }\r\n }.bind(this));\r\n }, this);\r\n\r\n return target;\r\n },\r\n\r\n defaults: function(target) {\r\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\r\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\r\n keys.forEach(function(key) {\r\n if (this.isUndefined(target[key])) {\r\n target[key] = obj[key];\r\n }\r\n }.bind(this));\r\n }, this);\r\n\r\n return target;\r\n },\r\n\r\n compose: function() {\r\n const toCall = ARR_SLICE.call(arguments);\r\n return function() {\r\n let args = ARR_SLICE.call(arguments);\r\n for (let i = toCall.length - 1; i >= 0; i--) {\r\n args = [toCall[i].apply(this, args)];\r\n }\r\n return args[0];\r\n };\r\n },\r\n\r\n each: function(obj, itr, scope) {\r\n if (!obj) {\r\n return;\r\n }\r\n\r\n if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) {\r\n obj.forEach(itr, scope);\r\n } else if (obj.length === obj.length + 0) { // Is number but not NaN\r\n let key;\r\n let l;\r\n for (key = 0, l = obj.length; key < l; key++) {\r\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) {\r\n return;\r\n }\r\n }\r\n } else {\r\n for (const key in obj) {\r\n if (itr.call(scope, obj[key], key) === this.BREAK) {\r\n return;\r\n }\r\n }\r\n }\r\n },\r\n\r\n defer: function(fnc) {\r\n setTimeout(fnc, 0);\r\n },\r\n\r\n // if the function is called repeatedly, wait until threshold passes until we execute the function\r\n debounce: function(func, threshold, callImmediately) {\r\n let timeout;\r\n\r\n return function() {\r\n const obj = this;\r\n const args = arguments;\r\n function delayed() {\r\n timeout = null;\r\n if (!callImmediately) func.apply(obj, args);\r\n }\r\n\r\n const callNow = callImmediately || !timeout;\r\n\r\n clearTimeout(timeout);\r\n timeout = setTimeout(delayed, threshold);\r\n\r\n if (callNow) {\r\n func.apply(obj, args);\r\n }\r\n };\r\n },\r\n\r\n toArray: function(obj) {\r\n if (obj.toArray) return obj.toArray();\r\n return ARR_SLICE.call(obj);\r\n },\r\n\r\n isUndefined: function(obj) {\r\n return obj === undefined;\r\n },\r\n\r\n isNull: function(obj) {\r\n return obj === null;\r\n },\r\n\r\n isNaN: function(obj) {\r\n return isNaN(obj);\r\n },\r\n\r\n isArray: Array.isArray || function(obj) {\r\n return obj.constructor === Array;\r\n },\r\n\r\n isObject: function(obj) {\r\n return obj === Object(obj);\r\n },\r\n\r\n isNumber: function(obj) {\r\n return obj === obj + 0;\r\n },\r\n\r\n isString: function(obj) {\r\n return obj === obj + '';\r\n },\r\n\r\n isBoolean: function(obj) {\r\n return obj === false || obj === true;\r\n },\r\n\r\n isFunction: function(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Function]';\r\n }\r\n\r\n};\r\n\r\nexport default Common;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport toString from './toString';\r\nimport common from '../utils/common';\r\n\r\nconst INTERPRETATIONS = [\r\n // Strings\r\n {\r\n litmus: common.isString,\r\n conversions: {\r\n THREE_CHAR_HEX: {\r\n read: function(original) {\r\n const test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\r\n if (test === null) {\r\n return false;\r\n }\r\n\r\n return {\r\n space: 'HEX',\r\n hex: parseInt(\r\n '0x' +\r\n test[1].toString() + test[1].toString() +\r\n test[2].toString() + test[2].toString() +\r\n test[3].toString() + test[3].toString(), 0)\r\n };\r\n },\r\n\r\n write: toString\r\n },\r\n\r\n SIX_CHAR_HEX: {\r\n read: function(original) {\r\n const test = original.match(/^#([A-F0-9]{6})$/i);\r\n if (test === null) {\r\n return false;\r\n }\r\n\r\n return {\r\n space: 'HEX',\r\n hex: parseInt('0x' + test[1].toString(), 0)\r\n };\r\n },\r\n\r\n write: toString\r\n },\r\n\r\n CSS_RGB: {\r\n read: function(original) {\r\n const test = original.match(/^rgb\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\r\n if (test === null) {\r\n return false;\r\n }\r\n\r\n return {\r\n space: 'RGB',\r\n r: parseFloat(test[1]),\r\n g: parseFloat(test[2]),\r\n b: parseFloat(test[3])\r\n };\r\n },\r\n\r\n write: toString\r\n },\r\n\r\n CSS_RGBA: {\r\n read: function(original) {\r\n const test = original.match(/^rgba\\(\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*,\\s*(.+)\\s*\\)/);\r\n if (test === null) {\r\n return false;\r\n }\r\n\r\n return {\r\n space: 'RGB',\r\n r: parseFloat(test[1]),\r\n g: parseFloat(test[2]),\r\n b: parseFloat(test[3]),\r\n a: parseFloat(test[4])\r\n };\r\n },\r\n\r\n write: toString\r\n }\r\n }\r\n },\r\n\r\n // Numbers\r\n {\r\n litmus: common.isNumber,\r\n\r\n conversions: {\r\n\r\n HEX: {\r\n read: function(original) {\r\n return {\r\n space: 'HEX',\r\n hex: original,\r\n conversionName: 'HEX'\r\n };\r\n },\r\n\r\n write: function(color) {\r\n return color.hex;\r\n }\r\n }\r\n\r\n }\r\n\r\n },\r\n\r\n // Arrays\r\n {\r\n litmus: common.isArray,\r\n conversions: {\r\n RGB_ARRAY: {\r\n read: function(original) {\r\n if (original.length !== 3) {\r\n return false;\r\n }\r\n\r\n return {\r\n space: 'RGB',\r\n r: original[0],\r\n g: original[1],\r\n b: original[2]\r\n };\r\n },\r\n\r\n write: function(color) {\r\n return [color.r, color.g, color.b];\r\n }\r\n },\r\n\r\n RGBA_ARRAY: {\r\n read: function(original) {\r\n if (original.length !== 4) return false;\r\n return {\r\n space: 'RGB',\r\n r: original[0],\r\n g: original[1],\r\n b: original[2],\r\n a: original[3]\r\n };\r\n },\r\n\r\n write: function(color) {\r\n return [color.r, color.g, color.b, color.a];\r\n }\r\n }\r\n }\r\n },\r\n\r\n // Objects\r\n {\r\n litmus: common.isObject,\r\n conversions: {\r\n\r\n RGBA_OBJ: {\r\n read: function(original) {\r\n if (common.isNumber(original.r) &&\r\n common.isNumber(original.g) &&\r\n common.isNumber(original.b) &&\r\n common.isNumber(original.a)) {\r\n return {\r\n space: 'RGB',\r\n r: original.r,\r\n g: original.g,\r\n b: original.b,\r\n a: original.a\r\n };\r\n }\r\n return false;\r\n },\r\n\r\n write: function(color) {\r\n return {\r\n r: color.r,\r\n g: color.g,\r\n b: color.b,\r\n a: color.a\r\n };\r\n }\r\n },\r\n\r\n RGB_OBJ: {\r\n read: function(original) {\r\n if (common.isNumber(original.r) &&\r\n common.isNumber(original.g) &&\r\n common.isNumber(original.b)) {\r\n return {\r\n space: 'RGB',\r\n r: original.r,\r\n g: original.g,\r\n b: original.b\r\n };\r\n }\r\n return false;\r\n },\r\n\r\n write: function(color) {\r\n return {\r\n r: color.r,\r\n g: color.g,\r\n b: color.b\r\n };\r\n }\r\n },\r\n\r\n HSVA_OBJ: {\r\n read: function(original) {\r\n if (common.isNumber(original.h) &&\r\n common.isNumber(original.s) &&\r\n common.isNumber(original.v) &&\r\n common.isNumber(original.a)) {\r\n return {\r\n space: 'HSV',\r\n h: original.h,\r\n s: original.s,\r\n v: original.v,\r\n a: original.a\r\n };\r\n }\r\n return false;\r\n },\r\n\r\n write: function(color) {\r\n return {\r\n h: color.h,\r\n s: color.s,\r\n v: color.v,\r\n a: color.a\r\n };\r\n }\r\n },\r\n\r\n HSV_OBJ: {\r\n read: function(original) {\r\n if (common.isNumber(original.h) &&\r\n common.isNumber(original.s) &&\r\n common.isNumber(original.v)) {\r\n return {\r\n space: 'HSV',\r\n h: original.h,\r\n s: original.s,\r\n v: original.v\r\n };\r\n }\r\n return false;\r\n },\r\n\r\n write: function(color) {\r\n return {\r\n h: color.h,\r\n s: color.s,\r\n v: color.v\r\n };\r\n }\r\n }\r\n }\r\n }\r\n];\r\n\r\nlet result;\r\nlet toReturn;\r\n\r\nconst interpret = function() {\r\n toReturn = false;\r\n\r\n const original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\r\n common.each(INTERPRETATIONS, function(family) {\r\n if (family.litmus(original)) {\r\n common.each(family.conversions, function(conversion, conversionName) {\r\n result = conversion.read(original);\r\n\r\n if (toReturn === false && result !== false) {\r\n toReturn = result;\r\n result.conversionName = conversionName;\r\n result.conversion = conversion;\r\n return common.BREAK;\r\n }\r\n });\r\n\r\n return common.BREAK;\r\n }\r\n });\r\n\r\n return toReturn;\r\n};\r\n\r\nexport default interpret;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nlet tmpComponent;\r\n\r\nconst ColorMath = {\r\n hsv_to_rgb: function(h, s, v) {\r\n const hi = Math.floor(h / 60) % 6;\r\n\r\n const f = h / 60 - Math.floor(h / 60);\r\n const p = v * (1.0 - s);\r\n const q = v * (1.0 - (f * s));\r\n const t = v * (1.0 - ((1.0 - f) * s));\r\n\r\n const c = [\r\n [v, t, p],\r\n [q, v, p],\r\n [p, v, t],\r\n [p, q, v],\r\n [t, p, v],\r\n [v, p, q]\r\n ][hi];\r\n\r\n return {\r\n r: c[0] * 255,\r\n g: c[1] * 255,\r\n b: c[2] * 255\r\n };\r\n },\r\n\r\n rgb_to_hsv: function(r, g, b) {\r\n const min = Math.min(r, g, b);\r\n const max = Math.max(r, g, b);\r\n const delta = max - min;\r\n let h;\r\n let s;\r\n\r\n if (max !== 0) {\r\n s = delta / max;\r\n } else {\r\n return {\r\n h: NaN,\r\n s: 0,\r\n v: 0\r\n };\r\n }\r\n\r\n if (r === max) {\r\n h = (g - b) / delta;\r\n } else if (g === max) {\r\n h = 2 + (b - r) / delta;\r\n } else {\r\n h = 4 + (r - g) / delta;\r\n }\r\n h /= 6;\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n\r\n return {\r\n h: h * 360,\r\n s: s,\r\n v: max / 255\r\n };\r\n },\r\n\r\n rgb_to_hex: function(r, g, b) {\r\n let hex = this.hex_with_component(0, 2, r);\r\n hex = this.hex_with_component(hex, 1, g);\r\n hex = this.hex_with_component(hex, 0, b);\r\n return hex;\r\n },\r\n\r\n component_from_hex: function(hex, componentIndex) {\r\n return (hex >> (componentIndex * 8)) & 0xFF;\r\n },\r\n\r\n hex_with_component: function(hex, componentIndex, value) {\r\n return value << (tmpComponent = componentIndex * 8) | (hex & ~(0xFF << tmpComponent));\r\n }\r\n};\r\n\r\nexport default ColorMath;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport interpret from './interpret';\r\nimport math from './math';\r\nimport colorToString from './toString';\r\nimport common from '../utils/common';\r\n\r\nclass Color {\r\n constructor() {\r\n this.__state = interpret.apply(this, arguments);\r\n\r\n if (this.__state === false) {\r\n throw new Error('Failed to interpret color arguments');\r\n }\r\n\r\n this.__state.a = this.__state.a || 1;\r\n }\r\n\r\n toString() {\r\n return colorToString(this);\r\n }\r\n\r\n toHexString() {\r\n return colorToString(this, true);\r\n }\r\n\r\n toOriginal() {\r\n return this.__state.conversion.write(this);\r\n }\r\n}\r\n\r\nfunction defineRGBComponent(target, component, componentHexIndex) {\r\n Object.defineProperty(target, component, {\r\n get: function() {\r\n if (this.__state.space === 'RGB') {\r\n return this.__state[component];\r\n }\r\n\r\n Color.recalculateRGB(this, component, componentHexIndex);\r\n\r\n return this.__state[component];\r\n },\r\n\r\n set: function(v) {\r\n if (this.__state.space !== 'RGB') {\r\n Color.recalculateRGB(this, component, componentHexIndex);\r\n this.__state.space = 'RGB';\r\n }\r\n\r\n this.__state[component] = v;\r\n }\r\n });\r\n}\r\n\r\nfunction defineHSVComponent(target, component) {\r\n Object.defineProperty(target, component, {\r\n get: function() {\r\n if (this.__state.space === 'HSV') {\r\n return this.__state[component];\r\n }\r\n\r\n Color.recalculateHSV(this);\r\n\r\n return this.__state[component];\r\n },\r\n\r\n set: function(v) {\r\n if (this.__state.space !== 'HSV') {\r\n Color.recalculateHSV(this);\r\n this.__state.space = 'HSV';\r\n }\r\n\r\n this.__state[component] = v;\r\n }\r\n });\r\n}\r\n\r\n\r\nColor.recalculateRGB = function(color, component, componentHexIndex) {\r\n if (color.__state.space === 'HEX') {\r\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\r\n } else if (color.__state.space === 'HSV') {\r\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\r\n } else {\r\n throw new Error('Corrupted color state');\r\n }\r\n};\r\n\r\nColor.recalculateHSV = function(color) {\r\n const result = math.rgb_to_hsv(color.r, color.g, color.b);\r\n\r\n common.extend(color.__state,\r\n {\r\n s: result.s,\r\n v: result.v\r\n }\r\n );\r\n\r\n if (!common.isNaN(result.h)) {\r\n color.__state.h = result.h;\r\n } else if (common.isUndefined(color.__state.h)) {\r\n color.__state.h = 0;\r\n }\r\n};\r\n\r\nColor.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a'];\r\n\r\ndefineRGBComponent(Color.prototype, 'r', 2);\r\ndefineRGBComponent(Color.prototype, 'g', 1);\r\ndefineRGBComponent(Color.prototype, 'b', 0);\r\n\r\ndefineHSVComponent(Color.prototype, 'h');\r\ndefineHSVComponent(Color.prototype, 's');\r\ndefineHSVComponent(Color.prototype, 'v');\r\n\r\nObject.defineProperty(Color.prototype, 'a', {\r\n get: function() {\r\n return this.__state.a;\r\n },\r\n\r\n set: function(v) {\r\n this.__state.a = v;\r\n }\r\n});\r\n\r\nObject.defineProperty(Color.prototype, 'hex', {\r\n get: function() {\r\n if (!this.__state.space !== 'HEX') {\r\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\r\n }\r\n\r\n return this.__state.hex;\r\n },\r\n\r\n set: function(v) {\r\n this.__state.space = 'HEX';\r\n this.__state.hex = v;\r\n }\r\n});\r\n\r\nexport default Color;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\n/**\r\n * @class An \"abstract\" class that represents a given property of an object.\r\n *\r\n * @param {Object} object The object to be manipulated\r\n * @param {string} property The name of the property to be manipulated\r\n */\r\nclass Controller {\r\n constructor(object, property) {\r\n this.initialValue = object[property];\r\n\r\n /**\r\n * Those who extend this class will put their DOM elements in here.\r\n * @type {DOMElement}\r\n */\r\n this.domElement = document.createElement('div');\r\n\r\n /**\r\n * The object to manipulate\r\n * @type {Object}\r\n */\r\n this.object = object;\r\n\r\n /**\r\n * The name of the property to manipulate\r\n * @type {String}\r\n */\r\n this.property = property;\r\n\r\n /**\r\n * The function to be called on change.\r\n * @type {Function}\r\n * @ignore\r\n */\r\n this.__onChange = undefined;\r\n\r\n /**\r\n * The function to be called on finishing change.\r\n * @type {Function}\r\n * @ignore\r\n */\r\n this.__onFinishChange = undefined;\r\n }\r\n\r\n /**\r\n * Specify that a function fire every time someone changes the value with\r\n * this Controller.\r\n *\r\n * @param {Function} fnc This function will be called whenever the value\r\n * is modified via this Controller.\r\n * @returns {Controller} this\r\n */\r\n onChange(fnc) {\r\n this.__onChange = fnc;\r\n return this;\r\n }\r\n\r\n /**\r\n * Specify that a function fire every time someone \"finishes\" changing\r\n * the value wih this Controller. Useful for values that change\r\n * incrementally like numbers or strings.\r\n *\r\n * @param {Function} fnc This function will be called whenever\r\n * someone \"finishes\" changing the value via this Controller.\r\n * @returns {Controller} this\r\n */\r\n onFinishChange(fnc) {\r\n this.__onFinishChange = fnc;\r\n return this;\r\n }\r\n\r\n /**\r\n * Change the value of <code>object[property]</code>\r\n *\r\n * @param {Object} newValue The new value of <code>object[property]</code>\r\n */\r\n setValue(newValue) {\r\n this.object[this.property] = newValue;\r\n if (this.__onChange) {\r\n this.__onChange.call(this, newValue);\r\n }\r\n\r\n this.updateDisplay();\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the value of <code>object[property]</code>\r\n *\r\n * @returns {Object} The current value of <code>object[property]</code>\r\n */\r\n getValue() {\r\n return this.object[this.property];\r\n }\r\n\r\n /**\r\n * Refreshes the visual display of a Controller in order to keep sync\r\n * with the object's current value.\r\n * @returns {Controller} this\r\n */\r\n updateDisplay() {\r\n return this;\r\n }\r\n\r\n /**\r\n * @returns {Boolean} true if the value has deviated from initialValue\r\n */\r\n isModified() {\r\n return this.initialValue !== this.getValue();\r\n }\r\n}\r\n\r\nexport default Controller;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport common from '../utils/common';\r\n\r\nconst EVENT_MAP = {\r\n HTMLEvents: ['change'],\r\n MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],\r\n KeyboardEvents: ['keydown']\r\n};\r\n\r\nconst EVENT_MAP_INV = {};\r\ncommon.each(EVENT_MAP, function(v, k) {\r\n common.each(v, function(e) {\r\n EVENT_MAP_INV[e] = k;\r\n });\r\n});\r\n\r\nconst CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\r\n\r\nfunction cssValueToPixels(val) {\r\n if (val === '0' || common.isUndefined(val)) {\r\n return 0;\r\n }\r\n\r\n const match = val.match(CSS_VALUE_PIXELS);\r\n\r\n if (!common.isNull(match)) {\r\n return parseFloat(match[1]);\r\n }\r\n\r\n // TODO ...ems? %?\r\n\r\n return 0;\r\n}\r\n\r\n/**\r\n * @namespace\r\n * @member dat.dom\r\n */\r\nconst dom = {\r\n\r\n /**\r\n *\r\n * @param elem\r\n * @param selectable\r\n */\r\n makeSelectable: function(elem, selectable) {\r\n if (elem === undefined || elem.style === undefined) return;\r\n\r\n elem.onselectstart = selectable ? function() {\r\n return false;\r\n } : function() {\r\n };\r\n\r\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\r\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\r\n elem.unselectable = selectable ? 'on' : 'off';\r\n },\r\n\r\n /**\r\n *\r\n * @param elem\r\n * @param horizontal\r\n * @param vert\r\n */\r\n makeFullscreen: function(elem, hor, vert) {\r\n let vertical = vert;\r\n let horizontal = hor;\r\n\r\n if (common.isUndefined(horizontal)) {\r\n horizontal = true;\r\n }\r\n\r\n if (common.isUndefined(vertical)) {\r\n vertical = true;\r\n }\r\n\r\n elem.style.position = 'absolute';\r\n\r\n if (horizontal) {\r\n elem.style.left = 0;\r\n elem.style.right = 0;\r\n }\r\n if (vertical) {\r\n elem.style.top = 0;\r\n elem.style.bottom = 0;\r\n }\r\n },\r\n\r\n /**\r\n *\r\n * @param elem\r\n * @param eventType\r\n * @param params\r\n */\r\n fakeEvent: function(elem, eventType, pars, aux) {\r\n const params = pars || {};\r\n const className = EVENT_MAP_INV[eventType];\r\n if (!className) {\r\n throw new Error('Event type ' + eventType + ' not supported.');\r\n }\r\n const evt = document.createEvent(className);\r\n switch (className) {\r\n case 'MouseEvents':\r\n {\r\n const clientX = params.x || params.clientX || 0;\r\n const clientY = params.y || params.clientY || 0;\r\n evt.initMouseEvent(eventType, params.bubbles || false,\r\n params.cancelable || true, window, params.clickCount || 1,\r\n 0, // screen X\r\n 0, // screen Y\r\n clientX, // client X\r\n clientY, // client Y\r\n false, false, false, false, 0, null);\r\n break;\r\n }\r\n case 'KeyboardEvents':\r\n {\r\n const init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz\r\n common.defaults(params, {\r\n cancelable: true,\r\n ctrlKey: false,\r\n altKey: false,\r\n shiftKey: false,\r\n metaKey: false,\r\n keyCode: undefined,\r\n charCode: undefined\r\n });\r\n init(eventType, params.bubbles || false,\r\n params.cancelable, window,\r\n params.ctrlKey, params.altKey,\r\n params.shiftKey, params.metaKey,\r\n params.keyCode, params.charCode);\r\n break;\r\n }\r\n default:\r\n {\r\n evt.initEvent(eventType, params.bubbles || false, params.cancelable || true);\r\n break;\r\n }\r\n }\r\n common.defaults(evt, aux);\r\n elem.dispatchEvent(evt);\r\n },\r\n\r\n /**\r\n *\r\n * @param elem\r\n * @param event\r\n * @param func\r\n * @param bool\r\n */\r\n bind: function(elem, event, func, newBool) {\r\n const bool = newBool || false;\r\n if (elem.addEventListener) {\r\n elem.addEventListener(event, func, bool);\r\n } else if (elem.attachEvent) {\r\n elem.attachEvent('on' + event, func);\r\n }\r\n return dom;\r\n },\r\n\r\n /**\r\n *\r\n * @param elem\r\n * @param event\r\n * @param func\r\n * @param bool\r\n */\r\n unbind: function(elem, event, func, newBool) {\r\n const bool = newBool || false;\r\n if (elem.removeEventListener) {\r\n elem.removeEventListener(event, func, bool);\r\n } else if (elem.detachEvent) {\r\n elem.detachEvent('on' + event, func);\r\n }\r\n return dom;\r\n },\r\n\r\n /**\r\n *\r\n * @param elem\r\n * @param className\r\n */\r\n addClass: function(elem, className) {\r\n if (elem.className === undefined) {\r\n elem.className = className;\r\n } else if (elem.className !== className) {\r\n const classes = elem.className.split(/ +/);\r\n if (classes.indexOf(className) === -1) {\r\n classes.push(className);\r\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\r\n }\r\n }\r\n return dom;\r\n },\r\n\r\n /**\r\n *\r\n * @param elem\r\n * @param className\r\n */\r\n removeClass: function(elem, className) {\r\n if (className) {\r\n if (elem.className === className) {\r\n elem.removeAttribute('class');\r\n } else {\r\n const classes = elem.className.split(/ +/);\r\n const index = classes.indexOf(className);\r\n if (index !== -1) {\r\n classes.splice(index, 1);\r\n elem.className = classes.join(' ');\r\n }\r\n }\r\n } else {\r\n elem.className = undefined;\r\n }\r\n return dom;\r\n },\r\n\r\n hasClass: function(elem, className) {\r\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\r\n },\r\n\r\n /**\r\n *\r\n * @param elem\r\n */\r\n getWidth: function(elem) {\r\n const style = getComputedStyle(elem);\r\n\r\n return cssValueToPixels(style['border-left-width']) +\r\n cssValueToPixels(style['border-right-width']) +\r\n cssValueToPixels(style['padding-left']) +\r\n cssValueToPixels(style['padding-right']) +\r\n cssValueToPixels(style.width);\r\n },\r\n\r\n /**\r\n *\r\n * @param elem\r\n */\r\n getHeight: function(elem) {\r\n const style = getComputedStyle(elem);\r\n\r\n return cssValueToPixels(style['border-top-width']) +\r\n cssValueToPixels(style['border-bottom-width']) +\r\n cssValueToPixels(style['padding-top']) +\r\n cssValueToPixels(style['padding-bottom']) +\r\n cssValueToPixels(style.height);\r\n },\r\n\r\n /**\r\n *\r\n * @param el\r\n */\r\n getOffset: function(el) {\r\n let elem = el;\r\n const offset = { left: 0, top: 0 };\r\n if (elem.offsetParent) {\r\n do {\r\n offset.left += elem.offsetLeft;\r\n offset.top += elem.offsetTop;\r\n elem = elem.offsetParent;\r\n } while (elem);\r\n }\r\n return offset;\r\n },\r\n\r\n // http://stackoverflow.com/posts/2684561/revisions\r\n /**\r\n *\r\n * @param elem\r\n */\r\n isActive: function(elem) {\r\n return elem === document.activeElement && (elem.type || elem.href);\r\n }\r\n\r\n};\r\n\r\nexport default dom;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport Controller from './Controller';\r\nimport dom from '../dom/dom';\r\n\r\n/**\r\n * @class Provides a checkbox input to alter the boolean property of an object.\r\n *\r\n * @extends dat.controllers.Controller\r\n *\r\n * @param {Object} object The object to be manipulated\r\n * @param {string} property The name of the property to be manipulated\r\n */\r\nclass BooleanController extends Controller {\r\n constructor(object, property) {\r\n super(object, property);\r\n\r\n const _this = this;\r\n this.__prev = this.getValue();\r\n\r\n this.__checkbox = document.createElement('input');\r\n this.__checkbox.setAttribute('type', 'checkbox');\r\n\r\n function onChange() {\r\n _this.setValue(!_this.__prev);\r\n }\r\n\r\n dom.bind(this.__checkbox, 'change', onChange, false);\r\n\r\n this.domElement.appendChild(this.__checkbox);\r\n\r\n // Match original value\r\n this.updateDisplay();\r\n }\r\n\r\n setValue(v) {\r\n const toReturn = super.setValue(v);\r\n if (this.__onFinishChange) {\r\n this.__onFinishChange.call(this, this.getValue());\r\n }\r\n this.__prev = this.getValue();\r\n return toReturn;\r\n }\r\n\r\n updateDisplay() {\r\n if (this.getValue() === true) {\r\n this.__checkbox.setAttribute('checked', 'checked');\r\n this.__checkbox.checked = true;\r\n this.__prev = true;\r\n } else {\r\n this.__checkbox.checked = false;\r\n this.__prev = false;\r\n }\r\n\r\n return super.updateDisplay();\r\n }\r\n}\r\n\r\nexport default BooleanController;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport Controller from './Controller';\r\nimport dom from '../dom/dom';\r\nimport common from '../utils/common';\r\n\r\n/**\r\n * @class Provides a select input to alter the property of an object, using a\r\n * list of accepted values.\r\n *\r\n * @extends dat.controllers.Controller\r\n *\r\n * @param {Object} object The object to be manipulated\r\n * @param {string} property The name of the property to be manipulated\r\n * @param {Object|string[]} options A map of labels to acceptable values, or\r\n * a list of acceptable string values.\r\n */\r\nclass OptionController extends Controller {\r\n constructor(object, property, opts) {\r\n super(object, property);\r\n\r\n let options = opts;\r\n\r\n const _this = this;\r\n\r\n /**\r\n * The drop down menu\r\n * @ignore\r\n */\r\n this.__select = document.createElement('select');\r\n\r\n if (common.isArray(options)) {\r\n const map = {};\r\n common.each(options, function(element) {\r\n map[element] = element;\r\n });\r\n options = map;\r\n }\r\n\r\n common.each(options, function(value, key) {\r\n const opt = document.createElement('option');\r\n opt.innerHTML = key;\r\n opt.setAttribute('value', value);\r\n _this.__select.appendChild(opt);\r\n });\r\n\r\n // Acknowledge original value\r\n this.updateDisplay();\r\n\r\n dom.bind(this.__select, 'change', function() {\r\n const desiredValue = this.options[this.selectedIndex].value;\r\n _this.setValue(desiredValue);\r\n });\r\n\r\n this.domElement.appendChild(this.__select);\r\n }\r\n\r\n setValue(v) {\r\n const toReturn = super.setValue(v);\r\n\r\n if (this.__onFinishChange) {\r\n this.__onFinishChange.call(this, this.getValue());\r\n }\r\n return toReturn;\r\n }\r\n\r\n updateDisplay() {\r\n if (dom.isActive(this.__select)) return this; // prevent number from updating if user is trying to manually update\r\n this.__select.value = this.getValue();\r\n return super.updateDisplay();\r\n }\r\n}\r\n\r\nexport default OptionController;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport Controller from './Controller';\r\nimport dom from '../dom/dom';\r\n\r\n/**\r\n * @class Provides a text input to alter the string property of an object.\r\n *\r\n * @extends dat.controllers.Controller\r\n *\r\n * @param {Object} object The object to be manipulated\r\n * @param {string} property The name of the property to be manipulated\r\n */\r\nclass StringController extends Controller {\r\n constructor(object, property) {\r\n super(object, property);\r\n\r\n const _this = this;\r\n\r\n function onChange() {\r\n _this.setValue(_this.__input.value);\r\n }\r\n\r\n function onBlur() {\r\n if (_this.__onFinishChange) {\r\n _this.__onFinishChange.call(_this, _this.getValue());\r\n }\r\n }\r\n\r\n this.__input = document.createElement('input');\r\n this.__input.setAttribute('type', 'text');\r\n\r\n dom.bind(this.__input, 'keyup', onChange);\r\n dom.bind(this.__input, 'change', onChange);\r\n dom.bind(this.__input, 'blur', onBlur);\r\n dom.bind(this.__input, 'keydown', function(e) {\r\n if (e.keyCode === 13) {\r\n this.blur();\r\n }\r\n });\r\n\r\n this.updateDisplay();\r\n\r\n this.domElement.appendChild(this.__input);\r\n }\r\n\r\n updateDisplay() {\r\n // Stops the caret from moving on account of:\r\n // keyup -> setValue -> updateDisplay\r\n if (!dom.isActive(this.__input)) {\r\n this.__input.value = this.getValue();\r\n }\r\n return super.updateDisplay();\r\n }\r\n}\r\n\r\nexport default StringController;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport Controller from './Controller';\r\nimport common from '../utils/common';\r\n\r\nfunction numDecimals(x) {\r\n const _x = x.toString();\r\n if (_x.indexOf('.') > -1) {\r\n return _x.length - _x.indexOf('.') - 1;\r\n }\r\n\r\n return 0;\r\n}\r\n\r\n/**\r\n * @class Represents a given property of an object that is a number.\r\n *\r\n * @extends dat.controllers.Controller\r\n *\r\n * @param {Object} object The object to be manipulated\r\n * @param {string} property The name of the property to be manipulated\r\n * @param {Object} [params] Optional parameters\r\n * @param {Number} [params.min] Minimum allowed value\r\n * @param {Number} [params.max] Maximum allowed value\r\n * @param {Number} [params.step] Increment by which to change value\r\n */\r\nclass NumberController extends Controller {\r\n constructor(object, property, params) {\r\n super(object, property);\r\n\r\n const _params = params || {};\r\n\r\n this.__min = _params.min;\r\n this.__max = _params.max;\r\n this.__step = _params.step;\r\n\r\n if (common.isUndefined(this.__step)) {\r\n if (this.initialValue === 0) {\r\n this.__impliedStep = 1; // What are we, psychics?\r\n } else {\r\n // Hey Doug, check this out.\r\n this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(this.initialValue)) / Math.LN10)) / 10;\r\n }\r\n } else {\r\n this.__impliedStep = this.__step;\r\n }\r\n\r\n this.__precision = numDecimals(this.__impliedStep);\r\n }\r\n\r\n setValue(v) {\r\n let _v = v;\r\n\r\n if (this.__min !== undefined && _v < this.__min) {\r\n _v = this.__min;\r\n } else if (this.__max !== undefined && _v > this.__max) {\r\n _v = this.__max;\r\n }\r\n\r\n if (this.__step !== undefined && _v % this.__step !== 0) {\r\n _v = Math.round(_v / this.__step) * this.__step;\r\n }\r\n\r\n return super.setValue(_v);\r\n }\r\n\r\n /**\r\n * Specify a minimum value for <code>object[property]</code>.\r\n *\r\n * @param {Number} minValue The minimum value for\r\n * <code>object[property]</code>\r\n * @returns {dat.controllers.NumberController} this\r\n */\r\n min(minValue) {\r\n this.__min = minValue;\r\n return this;\r\n }\r\n\r\n /**\r\n * Specify a maximum value for <code>object[property]</code>.\r\n *\r\n * @param {Number} maxValue The maximum value for\r\n * <code>object[property]</code>\r\n * @returns {dat.controllers.NumberController} this\r\n */\r\n max(maxValue) {\r\n this.__max = maxValue;\r\n return this;\r\n }\r\n\r\n /**\r\n * Specify a step value that dat.controllers.NumberController\r\n * increments by.\r\n *\r\n * @param {Number} stepValue The step value for\r\n * dat.controllers.NumberController\r\n * @default if minimum and maximum specified increment is 1% of the\r\n * difference otherwise stepValue is 1\r\n * @returns {dat.controllers.NumberController} this\r\n */\r\n step(stepValue) {\r\n this.__step = stepValue;\r\n this.__impliedStep = stepValue;\r\n this.__precision = numDecimals(stepValue);\r\n return this;\r\n }\r\n}\r\n\r\nexport default NumberController;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport NumberController from './NumberController';\r\nimport dom from '../dom/dom';\r\nimport common from '../utils/common';\r\n\r\nfunction roundToDecimal(value, decimals) {\r\n const tenTo = Math.pow(10, decimals);\r\n return Math.round(value * tenTo) / tenTo;\r\n}\r\n\r\n/**\r\n * @class Represents a given property of an object that is a number and\r\n * provides an input element with which to manipulate it.\r\n *\r\n * @extends dat.controllers.Controller\r\n * @extends dat.controllers.NumberController\r\n *\r\n * @param {Object} object The object to be manipulated\r\n * @param {string} property The name of the property to be manipulated\r\n * @param {Object} [params] Optional parameters\r\n * @param {Number} [params.min] Minimum allowed value\r\n * @param {Number} [params.max] Maximum allowed value\r\n * @param {Number} [params.step] Increment by which to change value\r\n */\r\nclass NumberControllerBox extends NumberController {\r\n constructor(object, property, params) {\r\n super(object, property, params);\r\n\r\n this.__truncationSuspended = false;\r\n\r\n const _this = this;\r\n\r\n /**\r\n * {Number} Previous mouse y position\r\n * @ignore\r\n */\r\n let prevY;\r\n\r\n function onChange() {\r\n const attempted = parseFloat(_this.__input.value);\r\n if (!common.isNaN(attempted)) {\r\n _this.setValue(attempted);\r\n }\r\n }\r\n\r\n function onFinish() {\r\n if (_this.__onFinishChange) {\r\n _this.__onFinishChange.call(_this, _this.getValue());\r\n }\r\n }\r\n\r\n function onBlur() {\r\n onFinish();\r\n }\r\n\r\n function onMouseDrag(e) {\r\n const diff = prevY - e.clientY;\r\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\r\n\r\n prevY = e.clientY;\r\n }\r\n\r\n function onMouseUp() {\r\n dom.unbind(window, 'mousemove', onMouseDrag);\r\n dom.unbind(window, 'mouseup', onMouseUp);\r\n onFinish();\r\n }\r\n\r\n function onMouseDown(e) {\r\n dom.bind(window, 'mousemove', onMouseDrag);\r\n dom.bind(window, 'mouseup', onMouseUp);\r\n prevY = e.clientY;\r\n }\r\n\r\n this.__input = document.createElement('input');\r\n this.__input.setAttribute('type', 'text');\r\n\r\n // Makes it so manually specified values are not truncated.\r\n\r\n dom.bind(this.__input, 'change', onChange);\r\n dom.bind(this.__input, 'blur', onBlur);\r\n dom.bind(this.__input, 'mousedown', onMouseDown);\r\n dom.bind(this.__input, 'keydown', function(e) {\r\n // When pressing enter, you can be as precise as you want.\r\n if (e.keyCode === 13) {\r\n _this.__truncationSuspended = true;\r\n this.blur();\r\n _this.__truncationSuspended = false;\r\n onFinish();\r\n }\r\n });\r\n\r\n this.updateDisplay();\r\n\r\n this.domElement.appendChild(this.__input);\r\n }\r\n\r\n updateDisplay() {\r\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\r\n return super.updateDisplay();\r\n }\r\n}\r\n\r\nexport default NumberControllerBox;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport NumberController from './NumberController';\r\nimport dom from '../dom/dom';\r\n\r\nfunction map(v, i1, i2, o1, o2) {\r\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\r\n}\r\n\r\n/**\r\n * @class Represents a given property of an object that is a number, contains\r\n * a minimum and maximum, and provides a slider element with which to\r\n * manipulate it. It should be noted that the slider element is made up of\r\n * <code>&lt;div&gt;</code> tags, <strong>not</strong> the html5\r\n * <code>&lt;slider&gt;</code> element.\r\n *\r\n * @extends dat.controllers.Controller\r\n * @extends dat.controllers.NumberController\r\n *\r\n * @param {Object} object The object to be manipulated\r\n * @param {string} property The name of the property to be manipulated\r\n * @param {Number} minValue Minimum allowed value\r\n * @param {Number} maxValue Maximum allowed value\r\n * @param {Number} stepValue Increment by which to change value\r\n */\r\nclass NumberControllerSlider extends NumberController {\r\n constructor(object, property, min, max, step) {\r\n super(object, property, { min: min, max: max, step: step });\r\n\r\n const _this = this;\r\n\r\n this.__background = document.createElement('div');\r\n this.__foreground = document.createElement('div');\r\n\r\n dom.bind(this.__background, 'mousedown', onMouseDown);\r\n dom.bind(this.__background, 'touchstart', onTouchStart);\r\n\r\n dom.addClass(this.__background, 'slider');\r\n dom.addClass(this.__foreground, 'slider-fg');\r\n\r\n function onMouseDown(e) {\r\n document.activeElement.blur();\r\n\r\n dom.bind(window, 'mousemove', onMouseDrag);\r\n dom.bind(window, 'mouseup', onMouseUp);\r\n\r\n onMouseDrag(e);\r\n }\r\n\r\n function onMouseDrag(e) {\r\n e.preventDefault();\r\n\r\n const bgRect = _this.__background.getBoundingClientRect();\r\n\r\n _this.setValue(\r\n map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)\r\n );\r\n\r\n return false;\r\n }\r\n\r\n function onMouseUp() {\r\n dom.unbind(window, 'mousemove', onMouseDrag);\r\n dom.unbind(window, 'mouseup', onMouseUp);\r\n if (_this.__onFinishChange) {\r\n _this.__onFinishChange.call(_this, _this.getValue());\r\n }\r\n }\r\n\r\n function onTouchStart(e) {\r\n if (e.touches.length !== 1) { return; }\r\n dom.bind(window, 'touchmove', onTouchMove);\r\n dom.bind(window, 'touchend', onTouchEnd);\r\n onTouchMove(e);\r\n }\r\n\r\n function onTouchMove(e) {\r\n const clientX = e.touches[0].clientX;\r\n const bgRect = _this.__background.getBoundingClientRect();\r\n\r\n _this.setValue(\r\n map(clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)\r\n );\r\n }\r\n\r\n function onTouchEnd() {\r\n dom.unbind(window, 'touchmove', onTouchMove);\r\n dom.unbind(window, 'touchend', onTouchEnd);\r\n if (_this.__onFinishChange) {\r\n _this.__onFinishChange.call(_this, _this.getValue());\r\n }\r\n }\r\n\r\n this.updateDisplay();\r\n\r\n this.__background.appendChild(this.__foreground);\r\n this.domElement.appendChild(this.__background);\r\n }\r\n\r\n updateDisplay() {\r\n const pct = (this.getValue() - this.__min) / (this.__max - this.__min);\r\n this.__foreground.style.width = pct * 100 + '%';\r\n return super.updateDisplay();\r\n }\r\n}\r\n\r\nexport default NumberControllerSlider;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport Controller from './Controller';\r\nimport dom from '../dom/dom';\r\n\r\n/**\r\n * @class Provides a GUI interface to fire a specified method, a property of an object.\r\n *\r\n * @extends dat.controllers.Controller\r\n *\r\n * @param {Object} object The object to be manipulated\r\n * @param {string} property The name of the property to be manipulated\r\n */\r\nclass FunctionController extends Controller {\r\n constructor(object, property, text) {\r\n super(object, property);\r\n\r\n const _this = this;\r\n\r\n this.__button = document.createElement('div');\r\n this.__button.innerHTML = text === undefined ? 'Fire' : text;\r\n\r\n dom.bind(this.__button, 'click', function(e) {\r\n e.preventDefault();\r\n _this.fire();\r\n return false;\r\n });\r\n\r\n dom.addClass(this.__button, 'button');\r\n\r\n this.domElement.appendChild(this.__button);\r\n }\r\n\r\n fire() {\r\n if (this.__onChange) {\r\n this.__onChange.call(this);\r\n }\r\n this.getValue().call(this.object);\r\n if (this.__onFinishChange) {\r\n this.__onFinishChange.call(this, this.getValue());\r\n }\r\n }\r\n}\r\n\r\nexport default FunctionController;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport Controller from './Controller';\r\nimport dom from '../dom/dom';\r\nimport Color from '../color/Color';\r\nimport interpret from '../color/interpret';\r\nimport common from '../utils/common';\r\n\r\n/**\r\n * @class Represents a given property of an object that is a color.\r\n * @param {Object} object\r\n * @param {string} property\r\n */\r\nclass ColorController extends Controller {\r\n constructor(object, property) {\r\n super(object, property);\r\n\r\n this.__color = new Color(this.getValue());\r\n this.__temp = new Color(0);\r\n\r\n const _this = this;\r\n\r\n this.domElement = document.createElement('div');\r\n\r\n dom.makeSelectable(this.domElement, false);\r\n\r\n this.__selector = document.createElement('div');\r\n this.__selector.className = 'selector';\r\n\r\n this.__saturation_field = document.createElement('div');\r\n this.__saturation_field.className = 'saturation-field';\r\n\r\n this.__field_knob = document.createElement('div');\r\n this.__field_knob.className = 'field-knob';\r\n this.__field_knob_border = '2px solid ';\r\n\r\n this.__hue_knob = document.createElement('div');\r\n this.__hue_knob.className = 'hue-knob';\r\n\r\n this.__hue_field = document.createElement('div');\r\n this.__hue_field.className = 'hue-field';\r\n\r\n this.__input = document.createElement('input');\r\n this.__input.type = 'text';\r\n this.__input_textShadow = '0 1px 1px ';\r\n\r\n dom.bind(this.__input, 'keydown', function(e) {\r\n if (e.keyCode === 13) { // on enter\r\n onBlur.call(this);\r\n }\r\n });\r\n\r\n dom.bind(this.__input, 'blur', onBlur);\r\n\r\n dom.bind(this.__selector, 'mousedown', function(/* e */) {\r\n dom\r\n .addClass(this, 'drag')\r\n .bind(window, 'mouseup', function(/* e */) {\r\n dom.removeClass(_this.__selector, 'drag');\r\n });\r\n });\r\n\r\n dom.bind(this.__selector, 'touchstart', function(/* e */) {\r\n dom\r\n .addClass(this, 'drag')\r\n .bind(window, 'touchend', function(/* e */) {\r\n dom.removeClass(_this.__selector, 'drag');\r\n });\r\n });\r\n\r\n const valueField = document.createElement('div');\r\n\r\n common.extend(this.__selector.style, {\r\n width: '122px',\r\n height: '102px',\r\n padding: '3px',\r\n backgroundColor: '#222',\r\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\r\n });\r\n\r\n common.extend(this.__field_knob.style, {\r\n position: 'absolute',\r\n width: '12px',\r\n height: '12px',\r\n border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),\r\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\r\n borderRadius: '12px',\r\n zIndex: 1\r\n });\r\n\r\n common.extend(this.__hue_knob.style, {\r\n position: 'absolute',\r\n width: '15px',\r\n height: '2px',\r\n borderRight: '4px solid #fff',\r\n zIndex: 1\r\n });\r\n\r\n common.extend(this.__saturation_field.style, {\r\n width: '100px',\r\n height: '100px',\r\n border: '1px solid #555',\r\n marginRight: '3px',\r\n display: 'inline-block',\r\n cursor: 'pointer'\r\n });\r\n\r\n common.extend(valueField.style, {\r\n width: '100%',\r\n height: '100%',\r\n background: 'none'\r\n });\r\n\r\n linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000');\r\n\r\n common.extend(this.__hue_field.style, {\r\n width: '15px',\r\n height: '100px',\r\n border: '1px solid #555',\r\n cursor: 'ns-resize',\r\n position: 'absolute',\r\n top: '3px',\r\n right: '3px'\r\n });\r\n\r\n hueGradient(this.__hue_field);\r\n\r\n common.extend(this.__input.style, {\r\n outline: 'none',\r\n// width: '120px',\r\n textAlign: 'center',\r\n// padding: '4px',\r\n// marginBottom: '6px',\r\n color: '#fff',\r\n border: 0,\r\n fontWeight: 'bold',\r\n textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'\r\n });\r\n\r\n dom.bind(this.__saturation_field, 'mousedown', fieldDown);\r\n dom.bind(this.__saturation_field, 'touchstart', fieldDown);\r\n\r\n dom.bind(this.__field_knob, 'mousedown', fieldDown);\r\n dom.bind(this.__field_knob, 'touchstart', fieldDown);\r\n\r\n dom.bind(this.__hue_field, 'mousedown', fieldDownH);\r\n dom.bind(this.__hue_field, 'touchstart', fieldDownH);\r\n\r\n function fieldDown(e) {\r\n setSV(e);\r\n dom.bind(window, 'mousemove', setSV);\r\n dom.bind(window, 'touchmove', setSV);\r\n dom.bind(window, 'mouseup', fieldUpSV);\r\n dom.bind(window, 'touchend', fieldUpSV);\r\n }\r\n\r\n function fieldDownH(e) {\r\n setH(e);\r\n dom.bind(window, 'mousemove', setH);\r\n dom.bind(window, 'touchmove', setH);\r\n dom.bind(window, 'mouseup', fieldUpH);\r\n dom.bind(window, 'touchend', fieldUpH);\r\n }\r\n\r\n function fieldUpSV() {\r\n dom.unbind(window, 'mousemove', setSV);\r\n dom.unbind(window, 'touchmove', setSV);\r\n dom.unbind(window, 'mouseup', fieldUpSV);\r\n dom.unbind(window, 'touchend', fieldUpSV);\r\n onFinish();\r\n }\r\n\r\n function fieldUpH() {\r\n dom.unbind(window, 'mousemove', setH);\r\n dom.unbind(window, 'touchmove', setH);\r\n dom.unbind(window, 'mouseup', fieldUpH);\r\n dom.unbind(window, 'touchend', fieldUpH);\r\n onFinish();\r\n }\r\n\r\n function onBlur() {\r\n const i = interpret(this.value);\r\n if (i !== false) {\r\n _this.__color.__state = i;\r\n _this.setValue(_this.__color.toOriginal());\r\n } else {\r\n this.value = _this.__color.toString();\r\n }\r\n }\r\n\r\n function onFinish() {\r\n if (_this.__onFinishChange) {\r\n _this.__onFinishChange.call(_this, _this.__color.toOriginal());\r\n }\r\n }\r\n\r\n this.__saturation_field.appendChild(valueField);\r\n this.__selector.appendChild(this.__field_knob);\r\n this.__selector.appendChild(this.__saturation_field);\r\n this.__selector.appendChild(this.__hue_field);\r\n this.__hue_field.appendChild(this.__hue_knob);\r\n\r\n this.domElement.appendChild(this.__input);\r\n this.domElement.appendChild(this.__selector);\r\n\r\n this.updateDisplay();\r\n\r\n function setSV(e) {\r\n if (e.type.indexOf('touch') === -1) { e.preventDefault(); }\r\n\r\n const fieldRect = _this.__saturation_field.getBoundingClientRect();\r\n const { clientX, clientY } = (e.touches && e.touches[0]) || e;\r\n let s = (clientX - fieldRect.left) / (fieldRect.right - fieldRect.left);\r\n let v = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\r\n\r\n if (v > 1) {\r\n v = 1;\r\n } else if (v < 0) {\r\n v = 0;\r\n }\r\n\r\n if (s > 1) {\r\n s = 1;\r\n } else if (s < 0) {\r\n s = 0;\r\n }\r\n\r\n _this.__color.v = v;\r\n _this.__color.s = s;\r\n\r\n _this.setValue(_this.__color.toOriginal());\r\n\r\n\r\n return false;\r\n }\r\n\r\n function setH(e) {\r\n if (e.type.indexOf('touch') === -1) { e.preventDefault(); }\r\n\r\n const fieldRect = _this.__hue_field.getBoundingClientRect();\r\n const { clientY } = (e.touches && e.touches[0]) || e;\r\n let h = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\r\n\r\n if (h > 1) {\r\n h = 1;\r\n } else if (h < 0) {\r\n h = 0;\r\n }\r\n\r\n _this.__color.h = h * 360;\r\n\r\n _this.setValue(_this.__color.toOriginal());\r\n\r\n return false;\r\n }\r\n }\r\n\r\n updateDisplay() {\r\n const i = interpret(this.getValue());\r\n\r\n if (i !== false) {\r\n let mismatch = false;\r\n\r\n // Check for mismatch on the interpreted value.\r\n\r\n common.each(Color.COMPONENTS, function(component) {\r\n if (!common.isUndefined(i[component]) && !common.isUndefined(this.__color.__state[component]) &&\r\n i[component] !== this.__color.__state[component]) {\r\n mismatch = true;\r\n return {}; // break\r\n }\r\n }, this);\r\n\r\n // If nothing diverges, we keep our previous values\r\n // for statefulness, otherwise we recalculate fresh\r\n if (mismatch) {\r\n common.extend(this.__color.__state, i);\r\n }\r\n }\r\n\r\n common.extend(this.__temp.__state, this.__color.__state);\r\n\r\n this.__temp.a = 1;\r\n\r\n const flip = (this.__color.v < 0.5 || this.__color.s > 0.5) ? 255 : 0;\r\n const _flip = 255 - flip;\r\n\r\n common.extend(this.__field_knob.style, {\r\n marginLeft: 100 * this.__color.s - 7 + 'px',\r\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\r\n backgroundColor: this.__temp.toHexString(),\r\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')'\r\n });\r\n\r\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px';\r\n\r\n this.__temp.s = 1;\r\n this.__temp.v = 1;\r\n\r\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString());\r\n\r\n this.__input.value = this.__color.toString();\r\n\r\n common.extend(this.__input.style, {\r\n backgroundColor: this.__color.toHexString(),\r\n color: 'rgb(' + flip + ',' + flip + ',' + flip + ')',\r\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)'\r\n });\r\n }\r\n}\r\n\r\nconst vendors = ['-moz-', '-o-', '-webkit-', '-ms-', ''];\r\n\r\nfunction linearGradient(elem, x, a, b) {\r\n elem.style.background = '';\r\n common.each(vendors, function(vendor) {\r\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); ';\r\n });\r\n}\r\n\r\nfunction hueGradient(elem) {\r\n elem.style.background = '';\r\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);';\r\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\r\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\r\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\r\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\r\n}\r\n\r\nexport default ColorController;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nconst css = {\r\n load: function(url, indoc) {\r\n const doc = indoc || document;\r\n const link = doc.createElement('link');\r\n link.type = 'text/css';\r\n link.rel = 'stylesheet';\r\n link.href = url;\r\n doc.getElementsByTagName('head')[0].appendChild(link);\r\n },\r\n\r\n inject: function(cssContent, indoc) {\r\n const doc = indoc || document;\r\n const injected = document.createElement('style');\r\n injected.type = 'text/css';\r\n injected.innerHTML = cssContent;\r\n const head = doc.getElementsByTagName('head')[0];\r\n try {\r\n head.appendChild(injected);\r\n } catch (e) { // Unable to inject CSS, probably because of a Content Security Policy\r\n }\r\n }\r\n};\r\n\r\nexport default css;\r\n","const saveDialogContents = `<div id=\"dg-save\" class=\"dg dialogue\">\r\n\r\n Here's the new load parameter for your <code>GUI</code>'s constructor:\r\n\r\n <textarea id=\"dg-new-constructor\"></textarea>\r\n\r\n <div id=\"dg-save-locally\">\r\n\r\n <input id=\"dg-local-storage\" type=\"checkbox\"/> Automatically save\r\n values to <code>localStorage</code> on exit.\r\n\r\n <div id=\"dg-local-explain\">The values saved to <code>localStorage</code> will\r\n override those passed to <code>dat.GUI</code>'s constructor. This makes it\r\n easier to work incrementally, but <code>localStorage</code> is fragile,\r\n and your friends may not see the same values you do.\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n</div>`;\r\n\r\nexport default saveDialogContents;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport OptionController from './OptionController';\r\nimport NumberControllerBox from './NumberControllerBox';\r\nimport NumberControllerSlider from './NumberControllerSlider';\r\nimport StringController from './StringController';\r\nimport FunctionController from './FunctionController';\r\nimport BooleanController from './BooleanController';\r\nimport common from '../utils/common';\r\n\r\nconst ControllerFactory = function(object, property) {\r\n const initialValue = object[property];\r\n\r\n // Providing options?\r\n if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {\r\n return new OptionController(object, property, arguments[2]);\r\n }\r\n\r\n // Providing a map?\r\n if (common.isNumber(initialValue)) {\r\n // Has min and max? (slider)\r\n if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {\r\n // has step?\r\n if (common.isNumber(arguments[4])) {\r\n return new NumberControllerSlider(object, property,\r\n arguments[2], arguments[3], arguments[4]);\r\n }\r\n\r\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\r\n }\r\n\r\n // number box\r\n if (common.isNumber(arguments[4])) { // has step\r\n return new NumberControllerBox(object, property,\r\n { min: arguments[2], max: arguments[3], step: arguments[4] });\r\n }\r\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\r\n }\r\n\r\n if (common.isString(initialValue)) {\r\n return new StringController(object, property);\r\n }\r\n\r\n if (common.isFunction(initialValue)) {\r\n return new FunctionController(object, property, '');\r\n }\r\n\r\n if (common.isBoolean(initialValue)) {\r\n return new BooleanController(object, property);\r\n }\r\n\r\n return null;\r\n};\r\n\r\nexport default ControllerFactory;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nfunction requestAnimationFrame(callback) {\r\n setTimeout(callback, 1000 / 60);\r\n}\r\n\r\nexport default window.requestAnimationFrame ||\r\n window.webkitRequestAnimationFrame ||\r\n window.mozRequestAnimationFrame ||\r\n window.oRequestAnimationFrame ||\r\n window.msRequestAnimationFrame ||\r\n requestAnimationFrame;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport dom from '../dom/dom';\r\nimport common from '../utils/common';\r\n\r\nclass CenteredDiv {\r\n constructor() {\r\n this.backgroundElement = document.createElement('div');\r\n common.extend(this.backgroundElement.style, {\r\n backgroundColor: 'rgba(0,0,0,0.8)',\r\n top: 0,\r\n left: 0,\r\n display: 'none',\r\n zIndex: '1000',\r\n opacity: 0,\r\n WebkitTransition: 'opacity 0.2s linear',\r\n transition: 'opacity 0.2s linear'\r\n });\r\n\r\n dom.makeFullscreen(this.backgroundElement);\r\n this.backgroundElement.style.position = 'fixed';\r\n\r\n this.domElement = document.createElement('div');\r\n common.extend(this.domElement.style, {\r\n position: 'fixed',\r\n display: 'none',\r\n zIndex: '1001',\r\n opacity: 0,\r\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',\r\n transition: 'transform 0.2s ease-out, opacity 0.2s linear'\r\n });\r\n\r\n\r\n document.body.appendChild(this.backgroundElement);\r\n document.body.appendChild(this.domElement);\r\n\r\n const _this = this;\r\n dom.bind(this.backgroundElement, 'click', function() {\r\n _this.hide();\r\n });\r\n }\r\n\r\n show() {\r\n const _this = this;\r\n\r\n this.backgroundElement.style.display = 'block';\r\n\r\n this.domElement.style.display = 'block';\r\n this.domElement.style.opacity = 0;\r\n// this.domElement.style.top = '52%';\r\n this.domElement.style.webkitTransform = 'scale(1.1)';\r\n\r\n this.layout();\r\n\r\n common.defer(function() {\r\n _this.backgroundElement.style.opacity = 1;\r\n _this.domElement.style.opacity = 1;\r\n _this.domElement.style.webkitTransform = 'scale(1)';\r\n });\r\n }\r\n\r\n /**\r\n * Hide centered div\r\n */\r\n hide() {\r\n const _this = this;\r\n\r\n const hide = function() {\r\n _this.domElement.style.display = 'none';\r\n _this.backgroundElement.style.display = 'none';\r\n\r\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\r\n dom.unbind(_this.domElement, 'transitionend', hide);\r\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\r\n };\r\n\r\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\r\n dom.bind(this.domElement, 'transitionend', hide);\r\n dom.bind(this.domElement, 'oTransitionEnd', hide);\r\n\r\n this.backgroundElement.style.opacity = 0;\r\n// this.domElement.style.top = '48%';\r\n this.domElement.style.opacity = 0;\r\n this.domElement.style.webkitTransform = 'scale(1.1)';\r\n }\r\n\r\n layout() {\r\n this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px';\r\n this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px';\r\n }\r\n}\r\n\r\nexport default CenteredDiv;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport css from '../utils/css';\r\nimport saveDialogueContents from './saveDialogue.html';\r\nimport ControllerFactory from '../controllers/ControllerFactory';\r\nimport Controller from '../controllers/Controller';\r\nimport BooleanController from '../controllers/BooleanController';\r\nimport FunctionController from '../controllers/FunctionController';\r\nimport NumberControllerBox from '../controllers/NumberControllerBox';\r\nimport NumberControllerSlider from '../controllers/NumberControllerSlider';\r\nimport ColorController from '../controllers/ColorController';\r\nimport requestAnimationFrame from '../utils/requestAnimationFrame';\r\nimport CenteredDiv from '../dom/CenteredDiv';\r\nimport dom from '../dom/dom';\r\nimport common from '../utils/common';\r\n\r\nimport styleSheet from './style.scss'; // CSS to embed in build\r\n\r\ncss.inject(styleSheet);\r\n\r\n/** @ignore Outer-most className for GUI's */\r\nconst CSS_NAMESPACE = 'dg';\r\n\r\nconst HIDE_KEY_CODE = 72;\r\n\r\n/** @ignore The only value shared between the JS and SCSS. Use caution. */\r\nconst CLOSE_BUTTON_HEIGHT = 20;\r\n\r\nconst DEFAULT_DEFAULT_PRESET_NAME = 'Default';\r\n\r\nconst SUPPORTS_LOCAL_STORAGE = (function() {\r\n try {\r\n return !!window.localStorage;\r\n } catch (e) {\r\n return false;\r\n }\r\n}());\r\n\r\nlet SAVE_DIALOGUE;\r\n\r\n/** @ignore Have we yet to create an autoPlace GUI? */\r\nlet autoPlaceVirgin = true;\r\n\r\n/** @ignore Fixed position div that auto place GUI's go inside */\r\nlet autoPlaceContainer;\r\n\r\n/** @ignore Are we hiding the GUI's ? */\r\nlet hide = false;\r\n\r\n/** @private GUI's which should be hidden */\r\nconst hideableGuis = [];\r\n\r\n/**\r\n * @class A lightweight controller library for JavaScript. It allows you to easily\r\n * manipulate variables and fire functions on the fly.\r\n *\r\n * @typicalname gui\r\n *\r\n * @example\r\n * // Creating a GUI with options.\r\n * var gui = new dat.GUI({name: 'My GUI'});\r\n *\r\n * @example\r\n * // Creating a GUI and a subfolder.\r\n * var gui = new dat.GUI();\r\n * var folder1 = gui.addFolder('Flow Field');\r\n *\r\n * @param {Object} [params]\r\n * @param {String} [params.name] The name of this GUI.\r\n * @param {Object} [params.load] JSON object representing the saved state of\r\n * this GUI.\r\n * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.\r\n * @param {Boolean} [params.autoPlace=true]\r\n * @param {Boolean} [params.hideable=true] If true, GUI is shown/hidden by <kbd>h</kbd> keypress.\r\n * @param {Boolean} [params.closed=false] If true, starts closed\r\n * @param {Boolean} [params.closeOnTop=false] If true, close/open button shows on top of the GUI\r\n */\r\nconst GUI = function(pars) {\r\n const _this = this;\r\n\r\n let params = pars || {};\r\n\r\n /**\r\n * Outermost DOM Element\r\n * @type {DOMElement}\r\n */\r\n this.domElement = document.createElement('div');\r\n this.__ul = document.createElement('ul');\r\n this.domElement.appendChild(this.__ul);\r\n\r\n dom.addClass(this.domElement, CSS_NAMESPACE);\r\n\r\n /**\r\n * Nested GUI's by name\r\n * @ignore\r\n */\r\n this.__folders = {};\r\n\r\n this.__controllers = [];\r\n\r\n /**\r\n * List of objects I'm remembering for save, only used in top level GUI\r\n * @ignore\r\n */\r\n this.__rememberedObjects = [];\r\n\r\n /**\r\n * Maps the index of remembered objects to a map of controllers, only used\r\n * in top level GUI.\r\n *\r\n * @private\r\n * @ignore\r\n *\r\n * @example\r\n * [\r\n * {\r\n * propertyName: Controller,\r\n * anotherPropertyName: Controller\r\n * },\r\n * {\r\n * propertyName: Controller\r\n * }\r\n * ]\r\n */\r\n this.__rememberedObjectIndecesToControllers = [];\r\n\r\n this.__listening = [];\r\n\r\n // Default parameters\r\n params = common.defaults(params, {\r\n closeOnTop: false,\r\n autoPlace: true,\r\n width: GUI.DEFAULT_WIDTH\r\n });\r\n\r\n params = common.defaults(params, {\r\n resizable: params.autoPlace,\r\n hideable: params.autoPlace\r\n });\r\n\r\n if (!common.isUndefined(params.load)) {\r\n // Explicit preset\r\n if (params.preset) {\r\n params.load.preset = params.preset;\r\n }\r\n } else {\r\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\r\n }\r\n\r\n if (common.isUndefined(params.parent) && params.hideable) {\r\n hideableGuis.push(this);\r\n }\r\n\r\n // Only root level GUI's are resizable.\r\n params.resizable = common.isUndefined(params.parent) && params.resizable;\r\n\r\n if (params.autoPlace && common.isUndefined(params.scrollable)) {\r\n params.scrollable = true;\r\n }\r\n// params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;\r\n\r\n // Not part of params because I don't want people passing this in via\r\n // constructor. Should be a 'remembered' value.\r\n let useLocalStorage =\r\n SUPPORTS_LOCAL_STORAGE &&\r\n localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\r\n\r\n let saveToLocalStorage;\r\n\r\n Object.defineProperties(this,\r\n /** @lends GUI.prototype */\r\n {\r\n /**\r\n * The parent <code>GUI</code>\r\n * @type dat.gui.GUI\r\n */\r\n parent: {\r\n get: function() {\r\n return params.parent;\r\n }\r\n },\r\n\r\n scrollable: {\r\n get: function() {\r\n return params.scrollable;\r\n }\r\n },\r\n\r\n /**\r\n * Handles <code>GUI</code>'s element placement for you\r\n * @type Boolean\r\n */\r\n autoPlace: {\r\n get: function() {\r\n return params.autoPlace;\r\n }\r\n },\r\n\r\n /**\r\n * Handles <code>GUI</code>'s position of open/close button\r\n * @type Boolean\r\n */\r\n closeOnTop: {\r\n get: function() {\r\n return params.closeOnTop;\r\n }\r\n },\r\n\r\n /**\r\n * The identifier for a set of saved values\r\n * @type String\r\n */\r\n preset: {\r\n get: function() {\r\n if (_this.parent) {\r\n return _this.getRoot().preset;\r\n }\r\n\r\n return params.load.preset;\r\n },\r\n\r\n set: function(v) {\r\n if (_this.parent) {\r\n _this.getRoot().preset = v;\r\n } else {\r\n params.load.preset = v;\r\n }\r\n setPresetSelectIndex(this);\r\n _this.revert();\r\n }\r\n },\r\n\r\n /**\r\n * The width of <code>GUI</code> element\r\n * @type Number\r\n */\r\n width: {\r\n get: function() {\r\n return params.width;\r\n },\r\n set: function(v) {\r\n params.width = v;\r\n setWidth(_this, v);\r\n }\r\n },\r\n\r\n /**\r\n * The name of <code>GUI</code>. Used for folders. i.e\r\n * a folder's name\r\n * @type String\r\n */\r\n name: {\r\n get: function() {\r\n return params.name;\r\n },\r\n set: function(v) {\r\n // TODO Check for collisions among sibling folders\r\n params.name = v;\r\n if (titleRowName) {\r\n titleRowName.innerHTML = params.name;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Whether the <code>GUI</code> is collapsed or not\r\n * @type Boolean\r\n */\r\n closed: {\r\n get: function() {\r\n return params.closed;\r\n },\r\n set: function(v) {\r\n params.closed = v;\r\n if (params.closed) {\r\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\r\n } else {\r\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\r\n }\r\n // For browsers that aren't going to respect the CSS transition,\r\n // Lets just check our height against the window height right off\r\n // the bat.\r\n this.onResize();\r\n\r\n if (_this.__closeButton) {\r\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Contains all presets\r\n * @type Object\r\n */\r\n load: {\r\n get: function() {\r\n return params.load;\r\n }\r\n },\r\n\r\n /**\r\n * Determines whether or not to use <a href=\"https://developer.mozilla.org/en/DOM/Storage#localStorage\">localStorage</a> as the means for\r\n * <code>remember</code>ing\r\n * @type Boolean\r\n */\r\n useLocalStorage: {\r\n\r\n get: function() {\r\n return useLocalStorage;\r\n },\r\n set: function(bool) {\r\n if (SUPPORTS_LOCAL_STORAGE) {\r\n useLocalStorage = bool;\r\n if (bool) {\r\n dom.bind(window, 'unload', saveToLocalStorage);\r\n } else {\r\n dom.unbind(window, 'unload', saveToLocalStorage);\r\n }\r\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\r\n }\r\n }\r\n }\r\n });\r\n\r\n // Are we a root level GUI?\r\n if (common.isUndefined(params.parent)) {\r\n params.closed = false;\r\n\r\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\r\n dom.makeSelectable(this.domElement, false);\r\n\r\n // Are we supposed to be loading locally?\r\n if (SUPPORTS_LOCAL_STORAGE) {\r\n if (useLocalStorage) {\r\n _this.useLocalStorage = true;\r\n\r\n const savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\r\n\r\n if (savedGui) {\r\n params.load = JSON.parse(savedGui);\r\n }\r\n }\r\n }\r\n\r\n this.__closeButton = document.createElement('div');\r\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\r\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\r\n if (params.closeOnTop) {\r\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP);\r\n this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]);\r\n } else {\r\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM);\r\n this.domElement.appendChild(this.__closeButton);\r\n }\r\n\r\n dom.bind(this.__closeButton, 'click', function() {\r\n _this.closed = !_this.closed;\r\n });\r\n // Oh, you're a nested GUI!\r\n } else {\r\n if (params.closed === undefined) {\r\n params.closed = true;\r\n }\r\n\r\n const titleRowName = document.createTextNode(params.name);\r\n dom.addClass(titleRowName, 'controller-name');\r\n\r\n const titleRow = addRow(_this, titleRowName);\r\n\r\n const onClickTitle = function(e) {\r\n e.preventDefault();\r\n _this.closed = !_this.closed;\r\n return false;\r\n };\r\n\r\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\r\n\r\n dom.addClass(titleRow, 'title');\r\n dom.bind(titleRow, 'click', onClickTitle);\r\n\r\n if (!params.closed) {\r\n this.closed = false;\r\n }\r\n }\r\n\r\n if (params.autoPlace) {\r\n if (common.isUndefined(params.parent)) {\r\n if (autoPlaceVirgin) {\r\n autoPlaceContainer = document.createElement('div');\r\n dom.addClass(autoPlaceContainer, CSS_NAMESPACE);\r\n dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER);\r\n document.body.appendChild(autoPlaceContainer);\r\n autoPlaceVirgin = false;\r\n }\r\n\r\n // Put it in the dom for you.\r\n autoPlaceContainer.appendChild(this.domElement);\r\n\r\n // Apply the auto styles\r\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\r\n }\r\n\r\n\r\n // Make it not elastic.\r\n if (!this.parent) {\r\n setWidth(_this, params.width);\r\n }\r\n }\r\n\r\n this.__resizeHandler = function() {\r\n _this.onResizeDebounced();\r\n };\r\n\r\n dom.bind(window, 'resize', this.__resizeHandler);\r\n dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler);\r\n dom.bind(this.__ul, 'transitionend', this.__resizeHandler);\r\n dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler);\r\n this.onResize();\r\n\r\n if (params.resizable) {\r\n addResizeHandle(this);\r\n }\r\n\r\n saveToLocalStorage = function() {\r\n if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') {\r\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\r\n }\r\n };\r\n\r\n // expose this method publicly\r\n this.saveToLocalStorageIfPossible = saveToLocalStorage;\r\n\r\n function resetWidth() {\r\n const root = _this.getRoot();\r\n root.width += 1;\r\n common.defer(function() {\r\n root.width -= 1;\r\n });\r\n }\r\n\r\n if (!params.parent) {\r\n resetWidth();\r\n }\r\n};\r\n\r\nGUI.toggleHide = function() {\r\n hide = !hide;\r\n common.each(hideableGuis, function(gui) {\r\n gui.domElement.style.display = hide ? 'none' : '';\r\n });\r\n};\r\n\r\nGUI.CLASS_AUTO_PLACE = 'a';\r\nGUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\r\nGUI.CLASS_MAIN = 'main';\r\nGUI.CLASS_CONTROLLER_ROW = 'cr';\r\nGUI.CLASS_TOO_TALL = 'taller-than-window';\r\nGUI.CLASS_CLOSED = 'closed';\r\nGUI.CLASS_CLOSE_BUTTON = 'close-button';\r\nGUI.CLASS_CLOSE_TOP = 'close-top';\r\nGUI.CLASS_CLOSE_BOTTOM = 'close-bottom';\r\nGUI.CLASS_DRAG = 'drag';\r\n\r\nGUI.DEFAULT_WIDTH = 245;\r\nGUI.TEXT_CLOSED = 'Close Controls';\r\nGUI.TEXT_OPEN = 'Open Controls';\r\n\r\nGUI._keydownHandler = function(e) {\r\n if (document.activeElement.type !== 'text' &&\r\n (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) {\r\n GUI.toggleHide();\r\n }\r\n};\r\ndom.bind(window, 'keydown', GUI._keydownHandler, false);\r\n\r\ncommon.extend(\r\n GUI.prototype,\r\n\r\n /** @lends GUI.prototype */\r\n {\r\n\r\n /**\r\n * Adds a new {@link Controller} to the GUI. The type of controller created\r\n * is inferred from the initial value of <code>object[property]</code>. For\r\n * color properties, see {@link addColor}.\r\n *\r\n * @param {Object} object The object to be manipulated\r\n * @param {String} property The name of the property to be manipulated\r\n * @param {Number} [min] Minimum allowed value\r\n * @param {Number} [max] Maximum allowed value\r\n * @param {Number} [step] Increment by which to change value\r\n * @returns {Controller} The controller that was added to the GUI.\r\n * @instance\r\n *\r\n * @example\r\n * // Add a string controller.\r\n * var person = {name: 'Sam'};\r\n * gui.add(person, 'name');\r\n *\r\n * @example\r\n * // Add a number controller slider.\r\n * var person = {age: 45};\r\n * gui.add(person, 'age', 0, 100);\r\n */\r\n add: function(object, property) {\r\n return add(\r\n this,\r\n object,\r\n property,\r\n {\r\n factoryArgs: Array.prototype.slice.call(arguments, 2)\r\n }\r\n );\r\n },\r\n\r\n /**\r\n * Adds a new color controller to the GUI.\r\n *\r\n * @param object\r\n * @param property\r\n * @returns {Controller} The controller that was added to the GUI.\r\n * @instance\r\n *\r\n * @example\r\n * var palette = {\r\n * color1: '#FF0000', // CSS string\r\n * color2: [ 0, 128, 255 ], // RGB array\r\n * color3: [ 0, 128, 255, 0.3 ], // RGB with alpha\r\n * color4: { h: 350, s: 0.9, v: 0.3 } // Hue, saturation, value\r\n * };\r\n * gui.addColor(palette, 'color1');\r\n * gui.addColor(palette, 'color2');\r\n * gui.addColor(palette, 'color3');\r\n * gui.addColor(palette, 'color4');\r\n */\r\n addColor: function(object, property) {\r\n return add(\r\n this,\r\n object,\r\n property,\r\n {\r\n color: true\r\n }\r\n );\r\n },\r\n\r\n /**\r\n * Removes the given controller from the GUI.\r\n * @param {Controller} controller\r\n * @instance\r\n */\r\n remove: function(controller) {\r\n // TODO listening?\r\n this.__ul.removeChild(controller.__li);\r\n this.__controllers.splice(this.__controllers.indexOf(controller), 1);\r\n const _this = this;\r\n common.defer(function() {\r\n _this.onResize();\r\n });\r\n },\r\n\r\n /**\r\n * Removes the root GUI from the document and unbinds all event listeners.\r\n * For subfolders, use `gui.removeFolder(folder)` instead.\r\n * @instance\r\n */\r\n destroy: function() {\r\n if (this.parent) {\r\n throw new Error(\r\n 'Only the root GUI should be removed with .destroy(). ' +\r\n 'For subfolders, use gui.removeFolder(folder) instead.'\r\n );\r\n }\r\n\r\n if (this.autoPlace) {\r\n autoPlaceContainer.removeChild(this.domElement);\r\n }\r\n\r\n const _this = this;\r\n common.each(this.__folders, function(subfolder) {\r\n _this.removeFolder(subfolder);\r\n });\r\n\r\n dom.unbind(window, 'keydown', GUI._keydownHandler, false);\r\n\r\n removeListeners(this);\r\n },\r\n\r\n /**\r\n * Creates a new subfolder GUI instance.\r\n * @param name\r\n * @returns {dat.gui.GUI} The new folder.\r\n * @throws {Error} if this GUI already has a folder by the specified\r\n * name\r\n * @instance\r\n */\r\n addFolder: function(name) {\r\n // We have to prevent collisions on names in order to have a key\r\n // by which to remember saved values\r\n if (this.__folders[name] !== undefined) {\r\n throw new Error('You already have a folder in this GUI by the' +\r\n ' name \"' + name + '\"');\r\n }\r\n\r\n const newGuiParams = { name: name, parent: this };\r\n\r\n // We need to pass down the autoPlace trait so that we can\r\n // attach event listeners to open/close folder actions to\r\n // ensure that a scrollbar appears if the window is too short.\r\n newGuiParams.autoPlace = this.autoPlace;\r\n\r\n // Do we have saved appearance data for this folder?\r\n if (this.load && // Anything loaded?\r\n this.load.folders && // Was my parent a dead-end?\r\n this.load.folders[name]) { // Did daddy remember me?\r\n // Start me closed if I was closed\r\n newGuiParams.closed = this.load.folders[name].closed;\r\n\r\n // Pass down the loaded data\r\n newGuiParams.load = this.load.folders[name];\r\n }\r\n\r\n const gui = new GUI(newGuiParams);\r\n this.__folders[name] = gui;\r\n\r\n const li = addRow(this, gui.domElement);\r\n dom.addClass(li, 'folder');\r\n return gui;\r\n },\r\n\r\n /**\r\n * Removes a subfolder GUI instance.\r\n * @param {dat.gui.GUI} folder The folder to remove.\r\n * @instance\r\n */\r\n removeFolder: function(folder) {\r\n this.__ul.removeChild(folder.domElement.parentElement);\r\n\r\n delete this.__folders[folder.name];\r\n\r\n // Do we have saved appearance data for this folder?\r\n if (this.load && // Anything loaded?\r\n this.load.folders && // Was my parent a dead-end?\r\n this.load.folders[folder.name]) {\r\n delete this.load.folders[folder.name];\r\n }\r\n\r\n removeListeners(folder);\r\n\r\n const _this = this;\r\n\r\n common.each(folder.__folders, function(subfolder) {\r\n folder.removeFolder(subfolder);\r\n });\r\n\r\n common.defer(function() {\r\n _this.onResize();\r\n });\r\n },\r\n\r\n /**\r\n * Opens the GUI.\r\n */\r\n open: function() {\r\n this.closed = false;\r\n },\r\n\r\n /**\r\n * Closes the GUI.\r\n */\r\n close: function() {\r\n this.closed = true;\r\n },\r\n\r\n\r\n onResize: function() {\r\n // we debounce this function to prevent performance issues when rotating on tablet/mobile\r\n const root = this.getRoot();\r\n if (root.scrollable) {\r\n const top = dom.getOffset(root.__ul).top;\r\n let h = 0;\r\n\r\n common.each(root.__ul.childNodes, function(node) {\r\n if (!(root.autoPlace && node === root.__save_row)) {\r\n h += dom.getHeight(node);\r\n }\r\n });\r\n\r\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\r\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\r\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\r\n } else {\r\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\r\n root.__ul.style.height = 'auto';\r\n }\r\n }\r\n\r\n if (root.__resize_handle) {\r\n common.defer(function() {\r\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\r\n });\r\n }\r\n\r\n if (root.__closeButton) {\r\n root.__closeButton.style.width = root.width + 'px';\r\n }\r\n },\r\n\r\n onResizeDebounced: common.debounce(function() { this.onResize(); }, 50),\r\n\r\n /**\r\n * Mark objects for saving. The order of these objects cannot change as\r\n * the GUI grows. When remembering new objects, append them to the end\r\n * of the list.\r\n *\r\n * @param {...Object} objects\r\n * @throws {Error} if not called on a top level GUI.\r\n * @instance\r\n * @ignore\r\n */\r\n remember: function() {\r\n if (common.isUndefined(SAVE_DIALOGUE)) {\r\n SAVE_DIALOGUE = new CenteredDiv();\r\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;\r\n }\r\n\r\n if (this.parent) {\r\n throw new Error('You can only call remember on a top level GUI.');\r\n }\r\n\r\n const _this = this;\r\n\r\n common.each(Array.prototype.slice.call(arguments), function(object) {\r\n if (_this.__rememberedObjects.length === 0) {\r\n addSaveMenu(_this);\r\n }\r\n if (_this.__rememberedObjects.indexOf(object) === -1) {\r\n _this.__rememberedObjects.push(object);\r\n }\r\n });\r\n\r\n if (this.autoPlace) {\r\n // Set save row width\r\n setWidth(this, this.width);\r\n }\r\n },\r\n\r\n /**\r\n * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.\r\n * @instance\r\n */\r\n getRoot: function() {\r\n let gui = this;\r\n while (gui.parent) {\r\n gui = gui.parent;\r\n }\r\n return gui;\r\n },\r\n\r\n /**\r\n * @returns {Object} a JSON object representing the current state of\r\n * this GUI as well as its remembered properties.\r\n * @instance\r\n */\r\n getSaveObject: function() {\r\n const toReturn = this.load;\r\n toReturn.closed = this.closed;\r\n\r\n // Am I remembering any values?\r\n if (this.__rememberedObjects.length > 0) {\r\n toReturn.preset = this.preset;\r\n\r\n if (!toReturn.remembered) {\r\n toReturn.remembered = {};\r\n }\r\n\r\n toReturn.remembered[this.preset] = getCurrentPreset(this);\r\n }\r\n\r\n toReturn.folders = {};\r\n common.each(this.__folders, function(element, key) {\r\n toReturn.folders[key] = element.getSaveObject();\r\n });\r\n\r\n return toReturn;\r\n },\r\n\r\n save: function() {\r\n if (!this.load.remembered) {\r\n this.load.remembered = {};\r\n }\r\n\r\n this.load.remembered[this.preset] = getCurrentPreset(this);\r\n markPresetModified(this, false);\r\n this.saveToLocalStorageIfPossible();\r\n },\r\n\r\n saveAs: function(presetName) {\r\n if (!this.load.remembered) {\r\n // Retain default values upon first save\r\n this.load.remembered = {};\r\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\r\n }\r\n\r\n this.load.remembered[presetName] = getCurrentPreset(this);\r\n this.preset = presetName;\r\n addPresetOption(this, presetName, true);\r\n this.saveToLocalStorageIfPossible();\r\n },\r\n\r\n revert: function(gui) {\r\n common.each(this.__controllers, function(controller) {\r\n // Make revert work on Default.\r\n if (!this.getRoot().load.remembered) {\r\n controller.setValue(controller.initialValue);\r\n } else {\r\n recallSavedValue(gui || this.getRoot(), controller);\r\n }\r\n\r\n // fire onFinishChange callback\r\n if (controller.__onFinishChange) {\r\n controller.__onFinishChange.call(controller, controller.getValue());\r\n }\r\n }, this);\r\n\r\n common.each(this.__folders, function(folder) {\r\n folder.revert(folder);\r\n });\r\n\r\n if (!gui) {\r\n markPresetModified(this.getRoot(), false);\r\n }\r\n },\r\n\r\n listen: function(controller) {\r\n const init = this.__listening.length === 0;\r\n this.__listening.push(controller);\r\n if (init) {\r\n updateDisplays(this.__listening);\r\n }\r\n },\r\n\r\n updateDisplay: function() {\r\n common.each(this.__controllers, function(controller) {\r\n controller.updateDisplay();\r\n });\r\n common.each(this.__folders, function(folder) {\r\n folder.updateDisplay();\r\n });\r\n }\r\n }\r\n);\r\n\r\n/**\r\n * Add a row to the end of the GUI or before another row.\r\n *\r\n * @param gui\r\n * @param [newDom] If specified, inserts the dom content in the new row\r\n * @param [liBefore] If specified, places the new row before another row\r\n *\r\n * @ignore\r\n */\r\nfunction addRow(gui, newDom, liBefore) {\r\n const li = document.createElement('li');\r\n if (newDom) {\r\n li.appendChild(newDom);\r\n }\r\n\r\n if (liBefore) {\r\n gui.__ul.insertBefore(li, liBefore);\r\n } else {\r\n gui.__ul.appendChild(li);\r\n }\r\n gui.onResize();\r\n return li;\r\n}\r\n\r\nfunction removeListeners(gui) {\r\n dom.unbind(window, 'resize', gui.__resizeHandler);\r\n\r\n if (gui.saveToLocalStorageIfPossible) {\r\n dom.unbind(window, 'unload', gui.saveToLocalStorageIfPossible);\r\n }\r\n}\r\n\r\nfunction markPresetModified(gui, modified) {\r\n const opt = gui.__preset_select[gui.__preset_select.selectedIndex];\r\n\r\n if (modified) {\r\n opt.innerHTML = opt.value + '*';\r\n } else {\r\n opt.innerHTML = opt.value;\r\n }\r\n}\r\n\r\nfunction augmentController(gui, li, controller) {\r\n controller.__li = li;\r\n controller.__gui = gui;\r\n\r\n common.extend(controller, /** @lends Controller.prototype */ {\r\n /**\r\n * @param {Array|Object} options\r\n * @return {Controller}\r\n */\r\n options: function(options) {\r\n if (arguments.length > 1) {\r\n const nextSibling = controller.__li.nextElementSibling;\r\n controller.remove();\r\n\r\n return add(\r\n gui,\r\n controller.object,\r\n controller.property,\r\n {\r\n before: nextSibling,\r\n factoryArgs: [common.toArray(arguments)]\r\n }\r\n );\r\n }\r\n\r\n if (common.isArray(options) || common.isObject(options)) {\r\n const nextSibling = controller.__li.nextElementSibling;\r\n controller.remove();\r\n\r\n return add(\r\n gui,\r\n controller.object,\r\n controller.property,\r\n {\r\n before: nextSibling,\r\n factoryArgs: [options]\r\n }\r\n );\r\n }\r\n },\r\n\r\n /**\r\n * Sets the name of the controller.\r\n * @param {string} name\r\n * @return {Controller}\r\n */\r\n name: function(name) {\r\n controller.__li.firstElementChild.firstElementChild.innerHTML = name;\r\n return controller;\r\n },\r\n\r\n /**\r\n * Sets controller to listen for changes on its underlying object.\r\n * @return {Controller}\r\n */\r\n listen: function() {\r\n controller.__gui.listen(controller);\r\n return controller;\r\n },\r\n\r\n /**\r\n * Removes the controller from its parent GUI.\r\n * @return {Controller}\r\n */\r\n remove: function() {\r\n controller.__gui.remove(controller);\r\n return controller;\r\n }\r\n });\r\n\r\n // All sliders should be accompanied by a box.\r\n if (controller instanceof NumberControllerSlider) {\r\n const box = new NumberControllerBox(controller.object, controller.property,\r\n { min: controller.__min, max: controller.__max, step: controller.__step });\r\n\r\n common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step'], function(method) {\r\n const pc = controller[method];\r\n const pb = box[method];\r\n controller[method] = box[method] = function() {\r\n const args = Array.prototype.slice.call(arguments);\r\n pb.apply(box, args);\r\n return pc.apply(controller, args);\r\n };\r\n });\r\n\r\n dom.addClass(li, 'has-slider');\r\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\r\n } else if (controller instanceof NumberControllerBox) {\r\n const r = function(returned) {\r\n // Have we defined both boundaries?\r\n if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {\r\n // Well, then lets just replace this with a slider.\r\n\r\n // lets remember if the old controller had a specific name or was listening\r\n const oldName = controller.__li.firstElementChild.firstElementChild.innerHTML;\r\n const wasListening = controller.__gui.__listening.indexOf(controller) > -1;\r\n\r\n controller.remove();\r\n const newController = add(\r\n gui,\r\n controller.object,\r\n controller.property,\r\n {\r\n before: controller.__li.nextElementSibling,\r\n factoryArgs: [controller.__min, controller.__max, controller.__step]\r\n });\r\n\r\n newController.name(oldName);\r\n if (wasListening) newController.listen();\r\n\r\n return newController;\r\n }\r\n\r\n return returned;\r\n };\r\n\r\n controller.min = common.compose(r, controller.min);\r\n controller.max = common.compose(r, controller.max);\r\n } else if (controller instanceof BooleanController) {\r\n dom.bind(li, 'click', function() {\r\n dom.fakeEvent(controller.__checkbox, 'click');\r\n });\r\n\r\n dom.bind(controller.__checkbox, 'click', function(e) {\r\n e.stopPropagation(); // Prevents double-toggle\r\n });\r\n } else if (controller instanceof FunctionController) {\r\n dom.bind(li, 'click', function() {\r\n dom.fakeEvent(controller.__button, 'click');\r\n });\r\n\r\n dom.bind(li, 'mouseover', function() {\r\n dom.addClass(controller.__button, 'hover');\r\n });\r\n\r\n dom.bind(li, 'mouseout', function() {\r\n dom.removeClass(controller.__button, 'hover');\r\n });\r\n } else if (controller instanceof ColorController) {\r\n dom.addClass(li, 'color');\r\n controller.updateDisplay = common.compose(function(val) {\r\n li.style.borderLeftColor = controller.__color.toString();\r\n return val;\r\n }, controller.updateDisplay);\r\n\r\n controller.updateDisplay();\r\n }\r\n\r\n controller.setValue = common.compose(function(val) {\r\n if (gui.getRoot().__preset_select && controller.isModified()) {\r\n markPresetModified(gui.getRoot(), true);\r\n }\r\n\r\n return val;\r\n }, controller.setValue);\r\n}\r\n\r\nfunction recallSavedValue(gui, controller) {\r\n // Find the topmost GUI, that's where remembered objects live.\r\n const root = gui.getRoot();\r\n\r\n // Does the object we're controlling match anything we've been told to\r\n // remember?\r\n const matchedIndex = root.__rememberedObjects.indexOf(controller.object);\r\n\r\n // Why yes, it does!\r\n if (matchedIndex !== -1) {\r\n // Let me fetch a map of controllers for thcommon.isObject.\r\n let controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex];\r\n\r\n // Ohp, I believe this is the first controller we've created for this\r\n // object. Lets make the map fresh.\r\n if (controllerMap === undefined) {\r\n controllerMap = {};\r\n root.__rememberedObjectIndecesToControllers[matchedIndex] =\r\n controllerMap;\r\n }\r\n\r\n // Keep track of this controller\r\n controllerMap[controller.property] = controller;\r\n\r\n // Okay, now have we saved any values for this controller?\r\n if (root.load && root.load.remembered) {\r\n const presetMap = root.load.remembered;\r\n\r\n // Which preset are we trying to load?\r\n let preset;\r\n\r\n if (presetMap[gui.preset]) {\r\n preset = presetMap[gui.preset];\r\n } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) {\r\n // Uhh, you can have the default instead?\r\n preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME];\r\n } else {\r\n // Nada.\r\n return;\r\n }\r\n\r\n // Did the loaded object remember thcommon.isObject? && Did we remember this particular property?\r\n if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) {\r\n // We did remember something for this guy ...\r\n const value = preset[matchedIndex][controller.property];\r\n\r\n // And that's what it is.\r\n controller.initialValue = value;\r\n controller.setValue(value);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction add(gui, object, property, params) {\r\n if (object[property] === undefined) {\r\n throw new Error(`Object \"${object}\" has no property \"${property}\"`);\r\n }\r\n\r\n let controller;\r\n\r\n if (params.color) {\r\n controller = new ColorController(object, property);\r\n } else {\r\n const factoryArgs = [object, property].concat(params.factoryArgs);\r\n controller = ControllerFactory.apply(gui, factoryArgs);\r\n }\r\n\r\n if (params.before instanceof Controller) {\r\n params.before = params.before.__li;\r\n }\r\n\r\n recallSavedValue(gui, controller);\r\n\r\n dom.addClass(controller.domElement, 'c');\r\n\r\n const name = document.createElement('span');\r\n dom.addClass(name, 'property-name');\r\n name.innerHTML = controller.property;\r\n\r\n const container = document.createElement('div');\r\n container.appendChild(name);\r\n container.appendChild(controller.domElement);\r\n\r\n const li = addRow(gui, container, params.before);\r\n\r\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\r\n if (controller instanceof ColorController) {\r\n dom.addClass(li, 'color');\r\n } else {\r\n dom.addClass(li, typeof controller.getValue());\r\n }\r\n\r\n augmentController(gui, li, controller);\r\n\r\n gui.__controllers.push(controller);\r\n\r\n return controller;\r\n}\r\n\r\nfunction getLocalStorageHash(gui, key) {\r\n // TODO how does this deal with multiple GUI's?\r\n return document.location.href + '.' + key;\r\n}\r\n\r\nfunction addPresetOption(gui, name, setSelected) {\r\n const opt = document.createElement('option');\r\n opt.innerHTML = name;\r\n opt.value = name;\r\n gui.__preset_select.appendChild(opt);\r\n if (setSelected) {\r\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\r\n }\r\n}\r\n\r\nfunction showHideExplain(gui, explain) {\r\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\r\n}\r\n\r\nfunction addSaveMenu(gui) {\r\n const div = gui.__save_row = document.createElement('li');\r\n\r\n dom.addClass(gui.domElement, 'has-save');\r\n\r\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\r\n\r\n dom.addClass(div, 'save-row');\r\n\r\n const gears = document.createElement('span');\r\n gears.innerHTML = '&nbsp;';\r\n dom.addClass(gears, 'button gears');\r\n\r\n // TODO replace with FunctionController\r\n const button = document.createElement('span');\r\n button.innerHTML = 'Save';\r\n dom.addClass(button, 'button');\r\n dom.addClass(button, 'save');\r\n\r\n const button2 = document.createElement('span');\r\n button2.innerHTML = 'New';\r\n dom.addClass(button2, 'button');\r\n dom.addClass(button2, 'save-as');\r\n\r\n const button3 = document.createElement('span');\r\n button3.innerHTML = 'Revert';\r\n dom.addClass(button3, 'button');\r\n dom.addClass(button3, 'revert');\r\n\r\n const select = gui.__preset_select = document.createElement('select');\r\n\r\n if (gui.load && gui.load.remembered) {\r\n common.each(gui.load.remembered, function(value, key) {\r\n addPresetOption(gui, key, key === gui.preset);\r\n });\r\n } else {\r\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\r\n }\r\n\r\n dom.bind(select, 'change', function() {\r\n for (let index = 0; index < gui.__preset_select.length; index++) {\r\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\r\n }\r\n\r\n gui.preset = this.value;\r\n });\r\n\r\n div.appendChild(select);\r\n div.appendChild(gears);\r\n div.appendChild(button);\r\n div.appendChild(button2);\r\n div.appendChild(button3);\r\n\r\n if (SUPPORTS_LOCAL_STORAGE) {\r\n const explain = document.getElementById('dg-local-explain');\r\n const localStorageCheckBox = document.getElementById('dg-local-storage');\r\n const saveLocally = document.getElementById('dg-save-locally');\r\n\r\n saveLocally.style.display = 'block';\r\n\r\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\r\n localStorageCheckBox.setAttribute('checked', 'checked');\r\n }\r\n\r\n showHideExplain(gui, explain);\r\n\r\n // TODO: Use a boolean controller, fool!\r\n dom.bind(localStorageCheckBox, 'change', function() {\r\n gui.useLocalStorage = !gui.useLocalStorage;\r\n showHideExplain(gui, explain);\r\n });\r\n }\r\n\r\n const newConstructorTextArea = document.getElementById('dg-new-constructor');\r\n\r\n dom.bind(newConstructorTextArea, 'keydown', function(e) {\r\n if (e.metaKey && (e.which === 67 || e.keyCode === 67)) {\r\n SAVE_DIALOGUE.hide();\r\n }\r\n });\r\n\r\n dom.bind(gears, 'click', function() {\r\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\r\n SAVE_DIALOGUE.show();\r\n newConstructorTextArea.focus();\r\n newConstructorTextArea.select();\r\n });\r\n\r\n dom.bind(button, 'click', function() {\r\n gui.save();\r\n });\r\n\r\n dom.bind(button2, 'click', function() {\r\n const presetName = prompt('Enter a new preset name.');\r\n if (presetName) {\r\n gui.saveAs(presetName);\r\n }\r\n });\r\n\r\n dom.bind(button3, 'click', function() {\r\n gui.revert();\r\n });\r\n\r\n // div.appendChild(button2);\r\n}\r\n\r\nfunction addResizeHandle(gui) {\r\n let pmouseX;\r\n\r\n gui.__resize_handle = document.createElement('div');\r\n\r\n common.extend(gui.__resize_handle.style, {\r\n\r\n width: '6px',\r\n marginLeft: '-3px',\r\n height: '200px',\r\n cursor: 'ew-resize',\r\n position: 'absolute'\r\n // border: '1px solid blue'\r\n\r\n });\r\n\r\n function drag(e) {\r\n e.preventDefault();\r\n\r\n gui.width += pmouseX - e.clientX;\r\n gui.onResize();\r\n pmouseX = e.clientX;\r\n\r\n return false;\r\n }\r\n\r\n function dragStop() {\r\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\r\n dom.unbind(window, 'mousemove', drag);\r\n dom.unbind(window, 'mouseup', dragStop);\r\n }\r\n\r\n function dragStart(e) {\r\n e.preventDefault();\r\n\r\n pmouseX = e.clientX;\r\n\r\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\r\n dom.bind(window, 'mousemove', drag);\r\n dom.bind(window, 'mouseup', dragStop);\r\n\r\n return false;\r\n }\r\n\r\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\r\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\r\n\r\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\r\n}\r\n\r\nfunction setWidth(gui, w) {\r\n gui.domElement.style.width = w + 'px';\r\n // Auto placed save-rows are position fixed, so we have to\r\n // set the width manually if we want it to bleed to the edge\r\n if (gui.__save_row && gui.autoPlace) {\r\n gui.__save_row.style.width = w + 'px';\r\n }\r\n if (gui.__closeButton) {\r\n gui.__closeButton.style.width = w + 'px';\r\n }\r\n}\r\n\r\nfunction getCurrentPreset(gui, useInitialValues) {\r\n const toReturn = {};\r\n\r\n // For each object I'm remembering\r\n common.each(gui.__rememberedObjects, function(val, index) {\r\n const savedValues = {};\r\n\r\n // The controllers I've made for thcommon.isObject by property\r\n const controllerMap =\r\n gui.__rememberedObjectIndecesToControllers[index];\r\n\r\n // Remember each value for each property\r\n common.each(controllerMap, function(controller, property) {\r\n savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue();\r\n });\r\n\r\n // Save the values for thcommon.isObject\r\n toReturn[index] = savedValues;\r\n });\r\n\r\n return toReturn;\r\n}\r\n\r\nfunction setPresetSelectIndex(gui) {\r\n for (let index = 0; index < gui.__preset_select.length; index++) {\r\n if (gui.__preset_select[index].value === gui.preset) {\r\n gui.__preset_select.selectedIndex = index;\r\n }\r\n }\r\n}\r\n\r\nfunction updateDisplays(controllerArray) {\r\n if (controllerArray.length !== 0) {\r\n requestAnimationFrame.call(window, function() {\r\n updateDisplays(controllerArray);\r\n });\r\n }\r\n\r\n common.each(controllerArray, function(c) {\r\n c.updateDisplay();\r\n });\r\n}\r\n\r\nexport default GUI;\r\n","/**\r\n * dat-gui JavaScript Controller Library\r\n * http://code.google.com/p/dat-gui\r\n *\r\n * Copyright 2011 Data Arts Team, Google Creative Lab\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n */\r\n\r\nimport Color from './color/Color';\r\nimport math from './color/math';\r\nimport interpret from './color/interpret';\r\n\r\nimport Controller from './controllers/Controller';\r\nimport BooleanController from './controllers/BooleanController';\r\nimport OptionController from './controllers/OptionController';\r\nimport StringController from './controllers/StringController';\r\nimport NumberController from './controllers/NumberController';\r\nimport NumberControllerBox from './controllers/NumberControllerBox';\r\nimport NumberControllerSlider from './controllers/NumberControllerSlider';\r\nimport FunctionController from './controllers/FunctionController';\r\nimport ColorController from './controllers/ColorController';\r\n\r\nimport domImport from './dom/dom';\r\nimport GUIImport from './gui/GUI';\r\n\r\nexport const color = {\r\n Color: Color,\r\n math: math,\r\n interpret: interpret\r\n};\r\n\r\nexport const controllers = {\r\n Controller: Controller,\r\n BooleanController: BooleanController,\r\n OptionController: OptionController,\r\n StringController: StringController,\r\n NumberController: NumberController,\r\n NumberControllerBox: NumberControllerBox,\r\n NumberControllerSlider: NumberControllerSlider,\r\n FunctionController: FunctionController,\r\n ColorController: ColorController\r\n};\r\n\r\nexport const dom = { dom: domImport };\r\n\r\nexport const gui = { GUI: GUIImport };\r\n\r\nexport const GUI = GUIImport;\r\n\r\nexport default {\r\n color,\r\n controllers,\r\n dom,\r\n gui,\r\n GUI\r\n};\r\n"],"names":["color","forceCSSHex","colorFormat","__state","conversionName","toString","r","Math","round","g","b","a","h","s","toFixed","v","str","hex","length","ARR_EACH","Array","prototype","forEach","ARR_SLICE","slice","Common","target","each","call","arguments","obj","keys","isObject","Object","key","isUndefined","bind","toCall","args","i","apply","itr","scope","l","BREAK","fnc","func","threshold","callImmediately","timeout","delayed","callNow","setTimeout","toArray","undefined","isNaN","isArray","constructor","INTERPRETATIONS","common","isString","original","test","match","parseInt","parseFloat","isNumber","result","toReturn","interpret","family","litmus","conversions","conversion","read","tmpComponent","ColorMath","hi","floor","f","p","q","t","c","min","max","delta","NaN","hex_with_component","componentIndex","value","Color","Error","colorToString","write","defineRGBComponent","component","componentHexIndex","defineProperty","space","recalculateRGB","defineHSVComponent","recalculateHSV","math","component_from_hex","extend","hsv_to_rgb","rgb_to_hsv","COMPONENTS","rgb_to_hex","Controller","object","property","initialValue","domElement","document","createElement","__onChange","__onFinishChange","newValue","updateDisplay","getValue","EVENT_MAP","EVENT_MAP_INV","k","e","CSS_VALUE_PIXELS","cssValueToPixels","val","isNull","dom","elem","selectable","style","onselectstart","MozUserSelect","KhtmlUserSelect","unselectable","hor","vert","vertical","horizontal","position","left","right","top","bottom","eventType","pars","aux","params","className","evt","createEvent","clientX","x","clientY","y","initMouseEvent","bubbles","cancelable","window","clickCount","init","initKeyboardEvent","initKeyEvent","defaults","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode","initEvent","dispatchEvent","event","newBool","bool","addEventListener","attachEvent","removeEventListener","detachEvent","classes","split","indexOf","push","join","replace","removeAttribute","index","splice","RegExp","getComputedStyle","width","height","el","offset","offsetParent","offsetLeft","offsetTop","activeElement","type","href","BooleanController","_this","__prev","__checkbox","setAttribute","onChange","setValue","appendChild","checked","OptionController","opts","options","__select","map","element","opt","innerHTML","desiredValue","selectedIndex","isActive","StringController","__input","onBlur","blur","numDecimals","_x","NumberController","_params","__min","__max","__step","step","__impliedStep","pow","log","abs","LN10","__precision","_v","minValue","maxValue","stepValue","roundToDecimal","decimals","tenTo","NumberControllerBox","__truncationSuspended","prevY","attempted","onFinish","onMouseDrag","diff","onMouseUp","unbind","onMouseDown","i1","i2","o1","o2","NumberControllerSlider","__background","__foreground","onTouchStart","addClass","preventDefault","bgRect","getBoundingClientRect","touches","onTouchMove","onTouchEnd","pct","FunctionController","text","__button","fire","ColorController","__color","__temp","makeSelectable","__selector","__saturation_field","__field_knob","__field_knob_border","__hue_knob","__hue_field","__input_textShadow","removeClass","valueField","fieldDown","fieldDownH","setSV","fieldUpSV","setH","fieldUpH","toOriginal","fieldRect","mismatch","flip","_flip","toHexString","marginTop","vendors","linearGradient","background","vendor","cssText","hueGradient","css","url","indoc","doc","link","rel","getElementsByTagName","cssContent","injected","head","saveDialogContents","ControllerFactory","isFunction","isBoolean","requestAnimationFrame","callback","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","CenteredDiv","backgroundElement","makeFullscreen","body","hide","display","opacity","webkitTransform","layout","defer","innerWidth","getWidth","innerHeight","getHeight","inject","styleSheet","CSS_NAMESPACE","HIDE_KEY_CODE","CLOSE_BUTTON_HEIGHT","DEFAULT_DEFAULT_PRESET_NAME","SUPPORTS_LOCAL_STORAGE","localStorage","SAVE_DIALOGUE","autoPlaceVirgin","autoPlaceContainer","hideableGuis","GUI","__ul","__folders","__controllers","__rememberedObjects","__rememberedObjectIndecesToControllers","__listening","DEFAULT_WIDTH","autoPlace","load","preset","parent","hideable","resizable","scrollable","useLocalStorage","getItem","getLocalStorageHash","saveToLocalStorage","defineProperties","closeOnTop","getRoot","revert","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","CLASS_AUTO_PLACE","__resizeHandler","onResizeDebounced","stringify","getSaveObject","saveToLocalStorageIfPossible","resetWidth","root","toggleHide","gui","CLASS_CONTROLLER_ROW","CLASS_TOO_TALL","CLASS_DRAG","_keydownHandler","which","add","controller","removeChild","__li","subfolder","removeFolder","newGuiParams","folders","li","folder","parentElement","getOffset","node","__save_row","__resize_handle","offsetHeight","debounce","saveDialogueContents","remembered","getCurrentPreset","presetName","newDom","liBefore","removeListeners","markPresetModified","modified","__preset_select","augmentController","__gui","nextSibling","nextElementSibling","remove","firstElementChild","listen","box","method","pc","pb","returned","oldName","wasListening","newController","compose","fakeEvent","stopPropagation","borderLeftColor","isModified","recallSavedValue","matchedIndex","controllerMap","presetMap","factoryArgs","concat","before","container","location","addPresetOption","setSelected","showHideExplain","explain","addSaveMenu","div","firstChild","gears","button","button2","button3","select","getElementById","localStorageCheckBox","saveLocally","newConstructorTextArea","show","focus","save","prompt","saveAs","addResizeHandle","pmouseX","drag","dragStop","dragStart","setWidth","w","useInitialValues","savedValues","setPresetSelectIndex","updateDisplays","controllerArray","controllers","domImport","GUIImport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAae,wBAASA,KAAT,EAAgBC,WAAhB,EAA6B;MACpCC,cAAcF,MAAMG,OAAN,CAAcC,cAAd,CAA6BC,QAA7B,EAApB;MAEMC,IAAIC,KAAKC,KAAL,CAAWR,MAAMM,CAAjB,CAAV;MACMG,IAAIF,KAAKC,KAAL,CAAWR,MAAMS,CAAjB,CAAV;MACMC,IAAIH,KAAKC,KAAL,CAAWR,MAAMU,CAAjB,CAAV;MACMC,IAAIX,MAAMW,CAAhB;MACMC,IAAIL,KAAKC,KAAL,CAAWR,MAAMY,CAAjB,CAAV;MACMC,IAAIb,MAAMa,CAAN,CAAQC,OAAR,CAAgB,CAAhB,CAAV;MACMC,IAAIf,MAAMe,CAAN,CAAQD,OAAR,CAAgB,CAAhB,CAAV;MAEIb,eAAgBC,gBAAgB,gBAAhC,IAAsDA,gBAAgB,cAA1E,EAA2F;QACrFc,MAAMhB,MAAMiB,GAAN,CAAUZ,QAAV,CAAmB,EAAnB,CAAV;WACOW,IAAIE,MAAJ,GAAa,CAApB,EAAuB;YACf,MAAMF,GAAZ;;WAEK,MAAMA,GAAb;GALF,MAMO,IAAId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