mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
2 lines
47 KiB
JavaScript
2 lines
47 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):"object"==typeof exports?exports.dat=t():e.dat=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return e[i].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){e.exports={color:{Color:n(2),math:n(6),interpret:n(3)},controllers:{Controller:n(7),BooleanController:n(8),OptionController:n(10),StringController:n(11),NumberController:n(12),NumberControllerBox:n(13),NumberControllerSlider:n(14),FunctionController:n(20),ColorController:n(21)},dom:{dom:n(9)},gui:{GUI:n(22)}}},function(e,t,n){function i(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(r(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(r(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function o(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(s(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(s(this),this.__state.space="HSV"),this.__state[t]=e}})}function r(e,t,n){if("HEX"===e.__state.space)e.__state[t]=l.component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw"Corrupted color state";c.extend(e.__state,l.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}}function s(e){var t=l.rgb_to_hsv(e.r,e.g,e.b);c.extend(e.__state,{s:t.s,v:t.v}),c.isNaN(t.h)?c.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h}var a=n(3),l=n(6),d=n(4),c=n(5),u=function(){if(this.__state=a.apply(this,arguments),this.__state===!1)throw"Failed to interpret color arguments";this.__state.a=this.__state.a||1};u.COMPONENTS=["r","g","b","h","s","v","hex","a"],c.extend(u.prototype,{toString:function(){return d(this)},toOriginal:function(){return this.__state.conversion.write(this)}}),i(u.prototype,"r",2),i(u.prototype,"g",1),i(u.prototype,"b",0),o(u.prototype,"h"),o(u.prototype,"s"),o(u.prototype,"v"),Object.defineProperty(u.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(u.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=l.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),e.exports=u},function(e,t,n){var i,o,r=n(4),s=n(5),a=function(){o=!1;var e=arguments.length>1?s.toArray(arguments):arguments[0];return s.each(l,function(t){return t.litmus(e)?(s.each(t.conversions,function(t,n){return i=t.read(e),o===!1&&i!==!1?(o=i,i.conversionName=n,i.conversion=t,s.BREAK):void 0}),s.BREAK):void 0}),o},l=[{litmus:s.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null===t?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString())}},write:r},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null===t?!1:{space:"HEX",hex:parseInt("0x"+t[1].toString())}},write:r},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null===t?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:r},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return null===t?!1:{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:r}}},{litmus:s.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:s.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3!=e.length?!1:{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4!=e.length?!1:{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:s.isObject,conversions:{RGBA_OBJ:{read:function(e){return s.isNumber(e.r)&&s.isNumber(e.g)&&s.isNumber(e.b)&&s.isNumber(e.a)?{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return s.isNumber(e.r)&&s.isNumber(e.g)&&s.isNumber(e.b)?{space:"RGB",r:e.r,g:e.g,b:e.b}:!1},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return s.isNumber(e.h)&&s.isNumber(e.s)&&s.isNumber(e.v)&&s.isNumber(e.a)?{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return s.isNumber(e.h)&&s.isNumber(e.s)&&s.isNumber(e.v)?{space:"HSV",h:e.h,s:e.s,v:e.v}:!1},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}];e.exports=a},function(e,t,n){var i=n(5);e.exports=function(e){if(1==e.a||i.isUndefined(e.a)){for(var t=e.hex.toString(16);t.length<6;)t="0"+t;return"#"+t}return"rgba("+Math.round(e.r)+","+Math.round(e.g)+","+Math.round(e.b)+","+e.a+")"}},function(e,t){var n=Array.prototype.forEach,i=Array.prototype.slice,o={BREAK:{},extend:function(e){return this.each(i.call(arguments,1),function(t){for(var n in t)this.isUndefined(t[n])||(e[n]=t[n])},this),e},defaults:function(e){return this.each(i.call(arguments,1),function(t){for(var n in t)this.isUndefined(e[n])&&(e[n]=t[n])},this),e},compose:function(){var e=i.call(arguments);return function(){for(var t=i.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,i){if(e)if(n&&e.forEach&&e.forEach===n)e.forEach(t,i);else if(e.length===e.length+0){for(var o=0,r=e.length;r>o;o++)if(o in e&&t.call(i,e[o],o)===this.BREAK)return}else for(var o in e)if(t.call(i,e[o],o)===this.BREAK)return},defer:function(e){setTimeout(e,0)},toArray:function(e){return e.toArray?e.toArray():i.call(e)},isUndefined:function(e){return void 0===e},isNull:function(e){return null===e},isNaN:function(e){return e!==e},isArray:Array.isArray||function(e){return e.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return e===!1||e===!0},isFunction:function(e){return"[object Function]"===Object.prototype.toString.call(e)}};e.exports=o},function(e,t){var n,i={hsv_to_rgb:function(e,t,n){var i=Math.floor(e/60)%6,o=e/60-Math.floor(e/60),r=n*(1-t),s=n*(1-o*t),a=n*(1-(1-o)*t),l=[[n,a,r],[s,n,r],[r,n,a],[r,s,n],[a,r,n],[n,r,s]][i];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,n){var i,o,r=Math.min(e,t,n),s=Math.max(e,t,n),a=s-r;return 0==s?{h:NaN,s:0,v:0}:(o=a/s,i=e==s?(t-n)/a:t==s?2+(n-e)/a:4+(e-t)/a,i/=6,0>i&&(i+=1),{h:360*i,s:o,v:s/255})},rgb_to_hex:function(e,t,n){var i=this.hex_with_component(0,2,e);return i=this.hex_with_component(i,1,t),i=this.hex_with_component(i,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,i){return i<<(n=8*t)|e&~(255<<n)}};e.exports=i},function(e,t,n){var i=n(5),o=function(e,t){this.initialValue=e[t],this.domElement=document.createElement("div"),this.object=e,this.property=t,this.__onChange=void 0,this.__onFinishChange=void 0};i.extend(o.prototype,{onChange:function(e){return this.__onChange=e,this},onFinishChange:function(e){return this.__onFinishChange=e,this},setValue:function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this},getValue:function(){return this.object[this.property]},updateDisplay:function(){return this},isModified:function(){return this.initialValue!==this.getValue()}}),e.exports=o},function(e,t,n){var i=n(7),o=n(9),r=n(5),s=function(e,t){function n(){i.setValue(!i.__prev)}s.superclass.call(this,e,t);var i=this;this.__prev=this.getValue(),this.__checkbox=document.createElement("input"),this.__checkbox.setAttribute("type","checkbox"),o.bind(this.__checkbox,"change",n,!1),this.domElement.appendChild(this.__checkbox),this.updateDisplay()};s.superclass=i,r.extend(s.prototype,i.prototype,{setValue:function(e){var t=s.superclass.prototype.setValue.call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),t},updateDisplay:function(){return this.getValue()===!0?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0):this.__checkbox.checked=!1,s.superclass.prototype.updateDisplay.call(this)}}),e.exports=s},function(e,t,n){function i(e){if("0"===e||o.isUndefined(e))return 0;var t=e.match(a);return o.isNull(t)?0:parseFloat(t[1])}var o=n(5),r={HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},s={};o.each(r,function(e,t){o.each(e,function(e){s[e]=t})});var a=/(\d+(\.\d+)?)px/,l={makeSelectable:function(e,t){void 0!==e&&void 0!==e.style&&(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(e,t,n){o.isUndefined(t)&&(t=!0),o.isUndefined(n)&&(n=!0),e.style.position="absolute",t&&(e.style.left=0,e.style.right=0),n&&(e.style.top=0,e.style.bottom=0)},fakeEvent:function(e,t,n,i){n=n||{};var r=s[t];if(!r)throw new Error("Event type "+t+" not supported.");var a=document.createEvent(r);switch(r){case"MouseEvents":var l=n.x||n.clientX||0,d=n.y||n.clientY||0;a.initMouseEvent(t,n.bubbles||!1,n.cancelable||!0,window,n.clickCount||1,0,0,l,d,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var c=a.initKeyboardEvent||a.initKeyEvent;o.defaults(n,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),c(t,n.bubbles||!1,n.cancelable,window,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,n.keyCode,n.charCode);break;default:a.initEvent(t,n.bubbles||!1,n.cancelable||!0)}o.defaults(a,i),e.dispatchEvent(a)},bind:function(e,t,n,i){return i=i||!1,e.addEventListener?e.addEventListener(t,n,i):e.attachEvent&&e.attachEvent("on"+t,n),l},unbind:function(e,t,n,i){return i=i||!1,e.removeEventListener?e.removeEventListener(t,n,i):e.detachEvent&&e.detachEvent("on"+t,n),l},addClass:function(e,t){if(void 0===e.className)e.className=t;else if(e.className!==t){var n=e.className.split(/ +/);-1==n.indexOf(t)&&(n.push(t),e.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return l},removeClass:function(e,t){if(t)if(void 0===e.className);else if(e.className===t)e.removeAttribute("class");else{var n=e.className.split(/ +/),i=n.indexOf(t);-1!=i&&(n.splice(i,1),e.className=n.join(" "))}else e.className=void 0;return l},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){var t=getComputedStyle(e);return i(t["border-left-width"])+i(t["border-right-width"])+i(t["padding-left"])+i(t["padding-right"])+i(t.width)},getHeight:function(e){var t=getComputedStyle(e);return i(t["border-top-width"])+i(t["border-bottom-width"])+i(t["padding-top"])+i(t["padding-bottom"])+i(t.height)},getOffset:function(e){var t={left:0,top:0};if(e.offsetParent)do t.left+=e.offsetLeft,t.top+=e.offsetTop;while(e=e.offsetParent);return t},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}};e.exports=l},function(e,t,n){var i=n(7),o=n(9),r=n(5),s=function(e,t,n){s.superclass.call(this,e,t);var i=this;if(this.__select=document.createElement("select"),r.isArray(n)){var a={};r.each(n,function(e){a[e]=e}),n=a}r.each(n,function(e,t){var n=document.createElement("option");n.innerHTML=t,n.setAttribute("value",e),i.__select.appendChild(n)}),this.updateDisplay(),o.bind(this.__select,"change",function(){var e=this.options[this.selectedIndex].value;i.setValue(e)}),this.domElement.appendChild(this.__select)};s.superclass=i,r.extend(s.prototype,i.prototype,{setValue:function(e){var t=s.superclass.prototype.setValue.call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),t},updateDisplay:function(){return this.__select.value=this.getValue(),s.superclass.prototype.updateDisplay.call(this)}}),e.exports=s},function(e,t,n){var i=n(7),o=n(9),r=n(5),s=function(e,t){function n(){r.setValue(r.__input.value)}function i(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())}s.superclass.call(this,e,t);var r=this;this.__input=document.createElement("input"),this.__input.setAttribute("type","text"),o.bind(this.__input,"keyup",n),o.bind(this.__input,"change",n),o.bind(this.__input,"blur",i),o.bind(this.__input,"keydown",function(e){13===e.keyCode&&this.blur()}),this.updateDisplay(),this.domElement.appendChild(this.__input)};s.superclass=i,r.extend(s.prototype,i.prototype,{updateDisplay:function(){return o.isActive(this.__input)||(this.__input.value=this.getValue()),s.superclass.prototype.updateDisplay.call(this)}}),e.exports=s},function(e,t,n){function i(e){return e=e.toString(),e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}var o=n(7),r=n(5),s=function(e,t,n){s.superclass.call(this,e,t),n=n||{},this.__min=n.min,this.__max=n.max,this.__step=n.step,r.isUndefined(this.__step)?0==this.initialValue?this.__impliedStep=1:this.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(this.initialValue))/Math.LN10))/10:this.__impliedStep=this.__step,this.__precision=i(this.__impliedStep)};s.superclass=o,r.extend(s.prototype,o.prototype,{setValue:function(e){return void 0!==this.__min&&e<this.__min?e=this.__min:void 0!==this.__max&&e>this.__max&&(e=this.__max),void 0!==this.__step&&e%this.__step!=0&&(e=Math.round(e/this.__step)*this.__step),s.superclass.prototype.setValue.call(this,e)},min:function(e){return this.__min=e,this},max:function(e){return this.__max=e,this},step:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=i(e),this}}),e.exports=s},function(e,t,n){function i(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}var o=(n(7),n(12)),r=n(9),s=n(5),a=function(e,t,n){function i(){var e=parseFloat(h.__input.value);s.isNaN(e)||h.setValue(e)}function o(){i(),h.__onFinishChange&&h.__onFinishChange.call(h,h.getValue())}function l(e){r.bind(window,"mousemove",d),r.bind(window,"mouseup",c),u=e.clientY}function d(e){var t=u-e.clientY;h.setValue(h.getValue()+t*h.__impliedStep),u=e.clientY}function c(){r.unbind(window,"mousemove",d),r.unbind(window,"mouseup",c)}this.__truncationSuspended=!1,a.superclass.call(this,e,t,n);var u,h=this;this.__input=document.createElement("input"),this.__input.setAttribute("type","text"),r.bind(this.__input,"change",i),r.bind(this.__input,"blur",o),r.bind(this.__input,"mousedown",l),r.bind(this.__input,"keydown",function(e){13===e.keyCode&&(h.__truncationSuspended=!0,this.blur(),h.__truncationSuspended=!1)}),this.updateDisplay(),this.domElement.appendChild(this.__input)};a.superclass=o,s.extend(a.prototype,o.prototype,{updateDisplay:function(){return this.__input.value=this.__truncationSuspended?this.getValue():i(this.getValue(),this.__precision),a.superclass.prototype.updateDisplay.call(this)}}),e.exports=a},function(e,t,n){function i(e,t,n,i,o){return i+(o-i)*((e-t)/(n-t))}var o=n(12),r=n(9),s=n(15),a=n(5),l=n(16),d=function(e,t,n,o,s){function a(e){r.bind(window,"mousemove",l),r.bind(window,"mouseup",c),l(e)}function l(e){e.preventDefault();var t=r.getOffset(u.__background),n=r.getWidth(u.__background);return u.setValue(i(e.clientX,t.left,t.left+n,u.__min,u.__max)),!1}function c(){r.unbind(window,"mousemove",l),r.unbind(window,"mouseup",c),u.__onFinishChange&&u.__onFinishChange.call(u,u.getValue())}d.superclass.call(this,e,t,{min:n,max:o,step:s});var u=this;this.__background=document.createElement("div"),this.__foreground=document.createElement("div"),r.bind(this.__background,"mousedown",a),r.addClass(this.__background,"slider"),r.addClass(this.__foreground,"slider-fg"),this.updateDisplay(),this.__background.appendChild(this.__foreground),this.domElement.appendChild(this.__background)};d.superclass=o,d.useDefaultStyles=function(){s.inject(l)},a.extend(d.prototype,o.prototype,{updateDisplay:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",d.superclass.prototype.updateDisplay.call(this)}}),e.exports=d},function(e,t){e.exports={load:function(e,t){t=t||document;var n=t.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e,t.getElementsByTagName("head")[0].appendChild(n)},inject:function(e,t){t=t||document;var n=document.createElement("style");n.type="text/css",n.innerHTML=e,t.getElementsByTagName("head")[0].appendChild(n)}}},function(e,t,n){var i=n(17);"string"==typeof i&&(i=[[e.id,i,""]]);n(19)(i,{});i.locals&&(e.exports=i.locals)},function(e,t,n){t=e.exports=n(18)(),t.push([e.id,".slider{box-shadow:inset 0 2px 4px rgba(0,0,0,.15);height:1em;border-radius:1em;background-color:#eee;padding:0 .5em;overflow:hidden}.slider-fg{padding:1px 0 2px;background-color:#aaa;height:1em;margin-left:-.5em;padding-right:.5em;border-radius:1em 0 0 1em}.slider-fg:after{display:inline-block;border-radius:1em;background-color:#fff;border:1px solid #aaa;content:'';float:right;margin-right:-1em;margin-top:-1px;height:.9em;width:.9em}",""])},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t];n[2]?e.push("@media "+n[2]+"{"+n[1]+"}"):e.push(n[1])}return e.join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},o=0;o<this.length;o++){var r=this[o][0];"number"==typeof r&&(i[r]=!0)}for(o=0;o<t.length;o++){var s=t[o];"number"==typeof s[0]&&i[s[0]]||(n&&!s[2]?s[2]=n:n&&(s[2]="("+s[2]+") and ("+n+")"),e.push(s))}},e}},function(e,t,n){function i(e,t){for(var n=0;n<e.length;n++){var i=e[n],o=u[i.id];if(o){o.refs++;for(var r=0;r<o.parts.length;r++)o.parts[r](i.parts[r]);for(;r<i.parts.length;r++)o.parts.push(a(i.parts[r],t))}else{for(var s=[],r=0;r<i.parts.length;r++)s.push(a(i.parts[r],t));u[i.id]={id:i.id,refs:1,parts:s}}}}function o(e){for(var t=[],n={},i=0;i<e.length;i++){var o=e[i],r=o[0],s=o[1],a=o[2],l=o[3],d={css:s,media:a,sourceMap:l};n[r]?n[r].parts.push(d):t.push(n[r]={id:r,parts:[d]})}return t}function r(){var e=document.createElement("style"),t=f();return e.type="text/css",t.appendChild(e),e}function s(){var e=document.createElement("link"),t=f();return e.rel="stylesheet",t.appendChild(e),e}function a(e,t){var n,i,o;if(t.singleton){var a=m++;n=_||(_=r()),i=l.bind(null,n,a,!1),o=l.bind(null,n,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=s(),i=c.bind(null,n),o=function(){n.parentNode.removeChild(n),n.href&&URL.revokeObjectURL(n.href)}):(n=r(),i=d.bind(null,n),o=function(){n.parentNode.removeChild(n)});return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else o()}}function l(e,t,n,i){var o=n?"":i.css;if(e.styleSheet)e.styleSheet.cssText=g(t,o);else{var r=document.createTextNode(o),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(r,s[t]):e.appendChild(r)}}function d(e,t){var n=t.css,i=t.media;t.sourceMap;if(i&&e.setAttribute("media",i),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function c(e,t){var n=t.css,i=(t.media,t.sourceMap);i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([n],{type:"text/css"}),r=e.href;e.href=URL.createObjectURL(o),r&&URL.revokeObjectURL(r)}var u={},h=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},p=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),f=h(function(){return document.head||document.getElementsByTagName("head")[0]}),_=null,m=0;e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=p());var n=o(e);return i(n,t),function(e){for(var r=[],s=0;s<n.length;s++){var a=n[s],l=u[a.id];l.refs--,r.push(l)}if(e){var d=o(e);i(d,t)}for(var s=0;s<r.length;s++){var l=r[s];if(0===l.refs){for(var c=0;c<l.parts.length;c++)l.parts[c]();delete u[l.id]}}}};var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){var i=n(7),o=n(9),r=n(5),s=function(e,t,n){s.superclass.call(this,e,t);var i=this;this.__button=document.createElement("div"),this.__button.innerHTML=void 0===n?"Fire":n,o.bind(this.__button,"click",function(e){return e.preventDefault(),i.fire(),!1}),o.addClass(this.__button,"button"),this.domElement.appendChild(this.__button)};s.superclass=i,r.extend(s.prototype,i.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}),e.exports=s},function(e,t,n){function i(e,t,n,i){e.style.background="",d.each(u,function(o){e.style.cssText+="background: "+o+"linear-gradient("+t+", "+n+" 0%, "+i+" 100%); "})}function o(e){e.style.background="",e.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",e.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",e.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var r=n(7),s=n(9),a=n(2),l=n(3),d=n(5),c=function(e,t){function n(e){p(e),s.bind(window,"mousemove",p),s.bind(window,"mouseup",r)}function r(){s.unbind(window,"mousemove",p),s.unbind(window,"mouseup",r)}function u(){var e=l(this.value);e!==!1?(_.__color.__state=e,_.setValue(_.__color.toOriginal())):this.value=_.__color.toString()}function h(){s.unbind(window,"mousemove",f),s.unbind(window,"mouseup",h)}function p(e){e.preventDefault();var t=s.getWidth(_.__saturation_field),n=s.getOffset(_.__saturation_field),i=(e.clientX-n.left+document.body.scrollLeft)/t,o=1-(e.clientY-n.top+document.body.scrollTop)/t;return o>1?o=1:0>o&&(o=0),i>1?i=1:0>i&&(i=0),_.__color.v=o,_.__color.s=i,_.setValue(_.__color.toOriginal()),!1}function f(e){e.preventDefault();var t=s.getHeight(_.__hue_field),n=s.getOffset(_.__hue_field),i=1-(e.clientY-n.top+document.body.scrollTop)/t;return i>1?i=1:0>i&&(i=0),_.__color.h=360*i,_.setValue(_.__color.toOriginal()),!1}c.superclass.call(this,e,t),this.__color=new a(this.getValue()),this.__temp=new a(0);var _=this;this.domElement=document.createElement("div"),s.makeSelectable(this.domElement,!1),this.__selector=document.createElement("div"),this.__selector.className="selector",this.__saturation_field=document.createElement("div"),this.__saturation_field.className="saturation-field",this.__field_knob=document.createElement("div"),this.__field_knob.className="field-knob",this.__field_knob_border="2px solid ",this.__hue_knob=document.createElement("div"),this.__hue_knob.className="hue-knob",this.__hue_field=document.createElement("div"),this.__hue_field.className="hue-field",this.__input=document.createElement("input"),this.__input.type="text",this.__input_textShadow="0 1px 1px ",s.bind(this.__input,"keydown",function(e){13===e.keyCode&&u.call(this)}),s.bind(this.__input,"blur",u),s.bind(this.__selector,"mousedown",function(e){s.addClass(this,"drag").bind(window,"mouseup",function(e){s.removeClass(_.__selector,"drag")})});var m=document.createElement("div");d.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),d.extend(this.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(this.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),d.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),d.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),d.extend(m.style,{width:"100%",height:"100%",background:"none"}),i(m,"top","rgba(0,0,0,0)","#000"),d.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"}),o(this.__hue_field),d.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"}),s.bind(this.__saturation_field,"mousedown",n),s.bind(this.__field_knob,"mousedown",n),s.bind(this.__hue_field,"mousedown",function(e){f(e),s.bind(window,"mousemove",f),s.bind(window,"mouseup",h)}),this.__saturation_field.appendChild(m),this.__selector.appendChild(this.__field_knob),this.__selector.appendChild(this.__saturation_field),this.__selector.appendChild(this.__hue_field),this.__hue_field.appendChild(this.__hue_knob),this.domElement.appendChild(this.__input),this.domElement.appendChild(this.__selector),this.updateDisplay()};c.superclass=r,d.extend(c.prototype,r.prototype,{updateDisplay:function(){var e=l(this.getValue());if(e!==!1){var t=!1;d.each(a.COMPONENTS,function(n){return d.isUndefined(e[n])||d.isUndefined(this.__color.__state[n])||e[n]===this.__color.__state[n]?void 0:(t=!0,{})},this),t&&d.extend(this.__color.__state,e)}d.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,o=255-n;d.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,i(this.__saturation_field,"left","#fff",this.__temp.toString()),d.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+o+","+o+","+o+",.7)"})}});var u=["-moz-","-o-","-webkit-","-ms-",""];e.exports=c},function(e,t,n){function i(e,t,n,i){if(void 0===t[n])throw new Error("Object "+t+' has no property "'+n+'"');var a;if(i.color)a=new A(t,n);else{var l=[t,n].concat(i.factoryArgs);a=v.apply(e,l)}i.before instanceof y&&(i.before=i.before.__li),s(e,a),L.addClass(a.domElement,"c");var d=document.createElement("span");L.addClass(d,"property-name"),d.innerHTML=a.property;var c=document.createElement("div");c.appendChild(d),c.appendChild(a.domElement);var u=o(e,c,i.before);return L.addClass(u,U.CLASS_CONTROLLER_ROW),a instanceof A?L.addClass(u,"color"):L.addClass(u,typeof a.getValue()),r(e,u,a),e.__controllers.push(a),a}function o(e,t,n){var i=document.createElement("li");return t&&i.appendChild(t),n?e.__ul.insertBefore(i,params.before):e.__ul.appendChild(i),e.onResize(),i}function r(e,t,n){if(n.__li=t,n.__gui=e,O.extend(n,{options:function(t){return arguments.length>1?(n.remove(),i(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[O.toArray(arguments)]})):O.isArray(t)||O.isObject(t)?(n.remove(),i(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[t]})):void 0},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof C){var o=new E(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});O.each(["updateDisplay","onChange","onFinishChange"],function(e){var t=n[e],i=o[e];n[e]=o[e]=function(){var e=Array.prototype.slice.call(arguments);return t.apply(n,e),i.apply(o,e)}}),L.addClass(t,"has-slider"),n.domElement.insertBefore(o.domElement,n.domElement.firstElementChild)}else if(n instanceof E){var r=function(t){return O.isNumber(n.__min)&&O.isNumber(n.__max)?(n.remove(),i(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]})):t};n.min=O.compose(r,n.min),n.max=O.compose(r,n.max)}else n instanceof x?(L.bind(t,"click",function(){L.fakeEvent(n.__checkbox,"click")}),L.bind(n.__checkbox,"click",function(e){e.stopPropagation()})):n instanceof w?(L.bind(t,"click",function(){L.fakeEvent(n.__button,"click")}),L.bind(t,"mouseover",function(){L.addClass(n.__button,"hover")}),L.bind(t,"mouseout",function(){L.removeClass(n.__button,"hover")})):n instanceof A&&(L.addClass(t,"color"),n.updateDisplay=O.compose(function(e){return t.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=O.compose(function(t){return e.getRoot().__preset_select&&n.isModified()&&f(e.getRoot(),!0),t},n.setValue)}function s(e,t){var n=e.getRoot(),i=n.__rememberedObjects.indexOf(t.object);if(-1!=i){var o=n.__rememberedObjectIndecesToControllers[i];if(void 0===o&&(o={},n.__rememberedObjectIndecesToControllers[i]=o),o[t.property]=t,n.load&&n.load.remembered){var r,s=n.load.remembered;if(s[e.preset])r=s[e.preset];else{if(!s[V])return;r=s[V]}if(r[i]&&void 0!==r[i][t.property]){var a=r[i][t.property];t.initialValue=a,t.setValue(a)}}}}function a(e,t){return document.location.href+"."+t}function l(e){function t(){c.style.display=e.useLocalStorage?"block":"none"}var n=e.__save_row=document.createElement("li");L.addClass(e.domElement,"has-save"),e.__ul.insertBefore(n,e.__ul.firstChild),L.addClass(n,"save-row");var i=document.createElement("span");i.innerHTML=" ",L.addClass(i,"button gears");var o=document.createElement("span");o.innerHTML="Save",L.addClass(o,"button"),L.addClass(o,"save");var r=document.createElement("span");r.innerHTML="New",L.addClass(r,"button"),L.addClass(r,"save-as");var s=document.createElement("span");s.innerHTML="Revert",L.addClass(s,"button"),L.addClass(s,"revert");var l=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?O.each(e.load.remembered,function(t,n){h(e,n,n==e.preset)}):h(e,V,!1),L.bind(l,"change",function(){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].innerHTML=e.__preset_select[t].value;e.preset=this.value}),n.appendChild(l),n.appendChild(i),n.appendChild(o),n.appendChild(r),n.appendChild(s),F){var d=document.getElementById("dg-save-locally"),c=document.getElementById("dg-local-explain");d.style.display="block";var u=document.getElementById("dg-local-storage");"true"===localStorage.getItem(a(e,"isLocal"))&&u.setAttribute("checked","checked"),t(),L.bind(u,"change",function(){e.useLocalStorage=!e.useLocalStorage,t()})}var p=document.getElementById("dg-new-constructor");L.bind(p,"keydown",function(e){!e.metaKey||67!==e.which&&67!=e.keyCode||T.hide()}),L.bind(i,"click",function(){p.innerHTML=JSON.stringify(e.getSaveObject(),void 0,2),T.show(),p.focus(),p.select()}),L.bind(o,"click",function(){e.save()}),L.bind(r,"click",function(){var t=prompt("Enter a new preset name.");t&&e.saveAs(t)}),L.bind(s,"click",function(){e.revert()})}function d(e){function t(t){return t.preventDefault(),o=t.clientX,L.addClass(e.__closeButton,U.CLASS_DRAG),L.bind(window,"mousemove",n),L.bind(window,"mouseup",i),!1}function n(t){return t.preventDefault(),e.width+=o-t.clientX,e.onResize(),o=t.clientX,!1}function i(){L.removeClass(e.__closeButton,U.CLASS_DRAG),L.unbind(window,"mousemove",n),L.unbind(window,"mouseup",i)}e.__resize_handle=document.createElement("div"),O.extend(e.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"});var o;L.bind(e.__resize_handle,"mousedown",t),L.bind(e.__closeButton,"mousedown",t),e.domElement.insertBefore(e.__resize_handle,e.domElement.firstElementChild)}function c(e,t){e.domElement.style.width=t+"px",e.__save_row&&e.autoPlace&&(e.__save_row.style.width=t+"px"),e.__closeButton&&(e.__closeButton.style.width=t+"px")}function u(e,t){
|
|
var n={};return O.each(e.__rememberedObjects,function(i,o){var r={},s=e.__rememberedObjectIndecesToControllers[o];O.each(s,function(e,n){r[n]=t?e.initialValue:e.getValue()}),n[o]=r}),n}function h(e,t,n){var i=document.createElement("option");i.innerHTML=t,i.value=t,e.__preset_select.appendChild(i),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function p(e){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].value==e.preset&&(e.__preset_select.selectedIndex=t)}function f(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];t?n.innerHTML=n.value+"*":n.innerHTML=n.value}function _(e){0!=e.length&&k(function(){_(e)}),O.each(e,function(e){e.updateDisplay()})}var m=n(15),g=n(23),b=n(24),v=n(26),y=n(7),x=n(8),w=n(20),E=n(13),C=n(14),A=(n(10),n(21)),k=n(27),S=n(28),L=n(9),O=n(5);m.inject(b);var T,R,N="dg",B=72,D=20,V="Default",F=function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}(),H=!0,M=!1,I=[],U=function(e){function t(){var e=n.getRoot();e.width+=1,O.defer(function(){e.width-=1})}var n=this;this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),L.addClass(this.domElement,N),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],e=e||{},e=O.defaults(e,{autoPlace:!0,width:U.DEFAULT_WIDTH}),e=O.defaults(e,{resizable:e.autoPlace,hideable:e.autoPlace}),O.isUndefined(e.load)?e.load={preset:V}:e.preset&&(e.load.preset=e.preset),O.isUndefined(e.parent)&&e.hideable&&I.push(this),e.resizable=O.isUndefined(e.parent)&&e.resizable,e.autoPlace&&O.isUndefined(e.scrollable)&&(e.scrollable=!0);var i,r=F&&"true"===localStorage.getItem(a(this,"isLocal"));if(Object.defineProperties(this,{parent:{get:function(){return e.parent}},scrollable:{get:function(){return e.scrollable}},autoPlace:{get:function(){return e.autoPlace}},preset:{get:function(){return n.parent?n.getRoot().preset:e.load.preset},set:function(t){n.parent?n.getRoot().preset=t:e.load.preset=t,p(this),n.revert()}},width:{get:function(){return e.width},set:function(t){e.width=t,c(n,t)}},name:{get:function(){return e.name},set:function(t){e.name=t,l&&(l.innerHTML=e.name)}},closed:{get:function(){return e.closed},set:function(t){e.closed=t,e.closed?L.addClass(n.__ul,U.CLASS_CLOSED):L.removeClass(n.__ul,U.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=t?U.TEXT_OPEN:U.TEXT_CLOSED)}},load:{get:function(){return e.load}},useLocalStorage:{get:function(){return r},set:function(e){F&&(r=e,e?L.bind(window,"unload",i):L.unbind(window,"unload",i),localStorage.setItem(a(n,"isLocal"),e))}}}),O.isUndefined(e.parent)){if(e.closed=!1,L.addClass(this.domElement,U.CLASS_MAIN),L.makeSelectable(this.domElement,!1),F&&r){n.useLocalStorage=!0;var s=localStorage.getItem(a(this,"gui"));s&&(e.load=JSON.parse(s))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=U.TEXT_CLOSED,L.addClass(this.__closeButton,U.CLASS_CLOSE_BUTTON),this.domElement.appendChild(this.__closeButton),L.bind(this.__closeButton,"click",function(){n.closed=!n.closed})}else{void 0===e.closed&&(e.closed=!0);var l=document.createTextNode(e.name);L.addClass(l,"controller-name");var u=o(n,l),h=function(e){return e.preventDefault(),n.closed=!n.closed,!1};L.addClass(this.__ul,U.CLASS_CLOSED),L.addClass(u,"title"),L.bind(u,"click",h),e.closed||(this.closed=!1)}e.autoPlace&&(O.isUndefined(e.parent)&&(H&&(R=document.createElement("div"),L.addClass(R,N),L.addClass(R,U.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(R),H=!1),R.appendChild(this.domElement),L.addClass(this.domElement,U.CLASS_AUTO_PLACE)),this.parent||c(n,e.width)),L.bind(window,"resize",function(){n.onResize()}),L.bind(this.__ul,"webkitTransitionEnd",function(){n.onResize()}),L.bind(this.__ul,"transitionend",function(){n.onResize()}),L.bind(this.__ul,"oTransitionEnd",function(){n.onResize()}),this.onResize(),e.resizable&&d(this),i=function(){F&&"true"===localStorage.getItem(a(n,"isLocal"))&&localStorage.setItem(a(n,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=i;n.getRoot();e.parent||t()};U.toggleHide=function(){M=!M,O.each(I,function(e){e.domElement.style.zIndex=M?-999:999,e.domElement.style.opacity=M?0:1})},U.CLASS_AUTO_PLACE="a",U.CLASS_AUTO_PLACE_CONTAINER="ac",U.CLASS_MAIN="main",U.CLASS_CONTROLLER_ROW="cr",U.CLASS_TOO_TALL="taller-than-window",U.CLASS_CLOSED="closed",U.CLASS_CLOSE_BUTTON="close-button",U.CLASS_DRAG="drag",U.DEFAULT_WIDTH=245,U.TEXT_CLOSED="Close Controls",U.TEXT_OPEN="Open Controls",L.bind(window,"keydown",function(e){"text"===document.activeElement.type||e.which!==B&&e.keyCode!=B||U.toggleHide()},!1),O.extend(U.prototype,{add:function(e,t){return i(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return i(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;O.defer(function(){t.onResize()})},destroy:function(){this.autoPlace&&R.removeChild(this.domElement)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new U(t);this.__folders[e]=n;var i=o(this,n.domElement);return L.addClass(i,"folder"),n},open:function(){this.closed=!1},close:function(){this.closed=!0},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=L.getOffset(e.__ul).top,n=0;O.each(e.__ul.childNodes,function(t){e.autoPlace&&t===e.__save_row||(n+=L.getHeight(t))}),window.innerHeight-t-D<n?(L.addClass(e.domElement,U.CLASS_TOO_TALL),e.__ul.style.height=window.innerHeight-t-D+"px"):(L.removeClass(e.domElement,U.CLASS_TOO_TALL),e.__ul.style.height="auto")}e.__resize_handle&&O.defer(function(){e.__resize_handle.style.height=e.__ul.offsetHeight+"px"}),e.__closeButton&&(e.__closeButton.style.width=e.width+"px")},remember:function(){if(O.isUndefined(T)&&(T=new S,T.domElement.innerHTML=g),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;O.each(Array.prototype.slice.call(arguments),function(t){0==e.__rememberedObjects.length&&l(e),-1==e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)}),this.autoPlace&&c(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=u(this)),e.folders={},O.each(this.__folders,function(t,n){e.folders[n]=t.getSaveObject()}),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=u(this),f(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[V]=u(this,!0)),this.load.remembered[e]=u(this),this.preset=e,h(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){O.each(this.__controllers,function(t){this.getRoot().load.remembered?s(e||this.getRoot(),t):t.setValue(t.initialValue)},this),O.each(this.__folders,function(e){e.revert(e)}),e||f(this.getRoot(),!1)},listen:function(e){var t=0==this.__listening.length;this.__listening.push(e),t&&_(this.__listening)}}),e.exports=U},function(e,t){e.exports='<div id=dg-save class="dg dialogue">Here\'s the new load parameter for your <code>GUI</code>\'s constructor:<textarea id=dg-new-constructor></textarea><div id=dg-save-locally><input id=dg-local-storage type="checkbox"> Automatically save values to <code>localStorage</code> on exit.<div id=dg-local-explain>The values saved to <code>localStorage</code> will override those passed to <code>dat.GUI</code>\'s constructor. This makes it easier to work incrementally, but <code>localStorage</code> is fragile, and your friends may not see the same values you do.</div></div></div>'},function(e,t,n){var i=n(25);"string"==typeof i&&(i=[[e.id,i,""]]);n(19)(i,{});i.locals&&(e.exports=i.locals)},function(e,t,n){t=e.exports=n(18)(),t.push([e.id,".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;transition:opacity .1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save>ul{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height .1s ease-out;transition:height .1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:9pt 0;display:block;width:440px;overflow-y:scroll;height:75pt;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande',sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:81pt}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:1pc;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:0}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}",""])},function(e,t,n){var i=n(10),o=n(13),r=n(14),s=n(11),a=n(20),l=n(8),d=n(5);e.exports=function(e,t){var n=e[t];return d.isArray(arguments[2])||d.isObject(arguments[2])?new i(e,t,arguments[2]):d.isNumber(n)?d.isNumber(arguments[2])&&d.isNumber(arguments[3])?new r(e,t,arguments[2],arguments[3]):new o(e,t,{min:arguments[2],max:arguments[3]}):d.isString(n)?new s(e,t):d.isFunction(n)?new a(e,t,""):d.isBoolean(n)?new l(e,t):void 0}},function(e,t){e.exports=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){window.setTimeout(e,1e3/60)}}},function(e,t,n){var i=n(9),o=n(5),r=function(){this.backgroundElement=document.createElement("div"),o.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),i.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),o.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;i.bind(this.backgroundElement,"click",function(){e.hide()})};r.prototype.show=function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),o.defer(function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"})},r.prototype.hide=function(){var e=this,t=function(){e.domElement.style.display="none",e.backgroundElement.style.display="none",i.unbind(e.domElement,"webkitTransitionEnd",t),i.unbind(e.domElement,"transitionend",t),i.unbind(e.domElement,"oTransitionEnd",t)};i.bind(this.domElement,"webkitTransitionEnd",t),i.bind(this.domElement,"transitionend",t),i.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"},r.prototype.layout=function(){this.domElement.style.left=window.innerWidth/2-i.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-i.getHeight(this.domElement)/2+"px"},e.exports=r}])}); |