diff --git a/dist/tui-color-picker.css b/dist/tui-color-picker.css index d86b007..2b2f258 100644 --- a/dist/tui-color-picker.css +++ b/dist/tui-color-picker.css @@ -1,7 +1,7 @@ /*! * TOAST UI Color Picker - * @version 2.2.7 - * @author NHN FE Development Team + * @version 2.2.8 + * @author NHN Cloud FE Development Team * @license MIT */ .tui-colorpicker-clearfix { diff --git a/dist/tui-color-picker.js b/dist/tui-color-picker.js index 0061237..df769d0 100644 --- a/dist/tui-color-picker.js +++ b/dist/tui-color-picker.js @@ -1,7 +1,7 @@ /*! * TOAST UI Color Picker - * @version 2.2.7 - * @author NHN FE Development Team + * @version 2.2.8 + * @author NHN Cloud FE Development Team * @license MIT */ (function webpackUniversalModuleDefinition(root, factory) { @@ -260,7 +260,6 @@ module.exports = isUndefined; "use strict"; /** * @fileoverview Utils for ColorPicker component - * @author NHN. FE dev Lab. */ @@ -522,7 +521,6 @@ module.exports = forEachOwnProperties; "use strict"; /** * @fileoverview The base class of views. - * @author NHN. FE Development Team */ @@ -729,7 +727,6 @@ module.exports = View; "use strict"; /** * @fileoverview Utility modules for manipulate DOM elements. - * @author NHN. FE Development Team */ @@ -1366,7 +1363,6 @@ module.exports = isString; "use strict"; /** * @fileoverview Utility methods to manipulate colors - * @author NHN. FE Development Team */ @@ -1930,7 +1926,6 @@ module.exports = inherit; "use strict"; /** * @fileoverview Common collections. - * @author NHN. FE Development Team */ @@ -2582,7 +2577,6 @@ module.exports = getClass; "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/** * @fileoverview General drag handler - * @author NHN. FE Development Team */ @@ -2929,7 +2923,6 @@ module.exports = getTarget; "use strict"; /** * @fileoverview Color palette view - * @author NHN. FE Development Team */ @@ -3138,7 +3131,6 @@ module.exports = hasClass; "use strict"; /** * @fileoverview Slider view - * @author NHN. FE Development Team */ @@ -3168,8 +3160,10 @@ var tmpl = __webpack_require__(57); // Limitation position of point element insi // Minimum value can to be negative because that using color point of handle element is center point. not left, top point. -var COLORSLIDER_POS_LIMIT_RANGE = [-7, 112]; -var HUEBAR_POS_LIMIT_RANGE = [-3, 115]; +var DEFAULT_COLORSLIDER_POS_LIMIT_MIN = -7; +var DEFAULT_COLORSLIDER_POS_LIMIT_MAX = 112; +var DEFAULT_HUEBAR_POS_LIMIT_MIN = -3; +var DEFAULT_HUEBAR_POS_LIMIT_MAX = 115; var HUE_WHEEL_MAX = 359.99; /** * @constructor @@ -3227,7 +3221,9 @@ function Slider(options, container) { this.drag = new Drag({ distance: 0 - }, container); // bind drag events + }, container); + this.colorSliderPosLimitRange = [DEFAULT_COLORSLIDER_POS_LIMIT_MIN, DEFAULT_COLORSLIDER_POS_LIMIT_MAX]; + this.huebarPosLimitRange = [DEFAULT_HUEBAR_POS_LIMIT_MIN, DEFAULT_HUEBAR_POS_LIMIT_MAX]; // bind drag events this.drag.on({ dragStart: this._onDragStart, @@ -3286,6 +3282,8 @@ Slider.prototype.render = function (colorStr) { html = html.replace(/{{cssPrefix}}/g, options.cssPrefix); html = html.replace(/{{id}}/g, options.id); this.container.innerHTML = html; + this.sliderSvgElement = container.querySelector('.' + options.cssPrefix + 'svg-slider'); + this.huebarSvgElement = container.querySelector('.' + options.cssPrefix + 'svg-huebar'); this.sliderHandleElement = container.querySelector('.' + options.cssPrefix + 'slider-handle'); this.huebarHandleElement = container.querySelector('.' + options.cssPrefix + 'huebar-handle'); this.baseColorElement = container.querySelector('.' + options.cssPrefix + 'slider-basecolor'); @@ -3294,6 +3292,14 @@ Slider.prototype.render = function (colorStr) { this.moveHue(hsv[0], true); this.moveSaturationAndValue(hsv[1], hsv[2], true); }; + +Slider.prototype._setColorSliderPosMax = function () { + var sliderRects = this.sliderSvgElement.getClientRects()[0]; + + if (sliderRects) { + this.colorSliderPosLimitRange[1] = sliderRects.height - 10; + } +}; /** * Move colorslider by newLeft(X), newTop(Y) value * @private @@ -3307,10 +3313,10 @@ Slider.prototype._moveColorSliderHandle = function (newLeft, newTop, silent) { var handle = this.sliderHandleElement; var handleColor; // Check position limitation. - newTop = Math.max(COLORSLIDER_POS_LIMIT_RANGE[0], newTop); - newTop = Math.min(COLORSLIDER_POS_LIMIT_RANGE[1], newTop); - newLeft = Math.max(COLORSLIDER_POS_LIMIT_RANGE[0], newLeft); - newLeft = Math.min(COLORSLIDER_POS_LIMIT_RANGE[1], newLeft); + newTop = Math.max(this.colorSliderPosLimitRange[0], newTop); + newTop = Math.min(this.colorSliderPosLimitRange[1], newTop); + newLeft = Math.max(this.colorSliderPosLimitRange[0], newLeft); + newLeft = Math.min(this.colorSliderPosLimitRange[1], newLeft); svgvml.setTranslateXY(handle, newLeft, newTop); handleColor = newTop > 50 ? 'white' : 'black'; svgvml.setStrokeColor(handle, handleColor); @@ -3335,8 +3341,8 @@ Slider.prototype.moveSaturationAndValue = function (saturation, value, silent) { var absMin, maxValue, newLeft, newTop; saturation = saturation || 0; value = value || 0; - absMin = Math.abs(COLORSLIDER_POS_LIMIT_RANGE[0]); - maxValue = COLORSLIDER_POS_LIMIT_RANGE[1]; // subtract absMin value because current color position is not left, top of handle element. + absMin = Math.abs(this.colorSliderPosLimitRange[0]); + maxValue = this.colorSliderPosLimitRange[1]; // subtract absMin value because current color position is not left, top of handle element. // The saturation. from left 0 to right 100 newLeft = saturation * maxValue / 100 - absMin; // The Value. from top 100 to bottom 0. that why newTop subtract by maxValue. @@ -3356,7 +3362,7 @@ Slider.prototype.moveSaturationAndValue = function (saturation, value, silent) { Slider.prototype._moveColorSliderByPosition = function (x, y) { - var offset = COLORSLIDER_POS_LIMIT_RANGE[0]; + var offset = this.colorSliderPosLimitRange[0]; this._moveColorSliderHandle(x + offset, y + offset); }; @@ -3367,8 +3373,8 @@ Slider.prototype._moveColorSliderByPosition = function (x, y) { Slider.prototype.getSaturationAndValue = function () { - var absMin = Math.abs(COLORSLIDER_POS_LIMIT_RANGE[0]); - var maxValue = absMin + COLORSLIDER_POS_LIMIT_RANGE[1]; + var absMin = Math.abs(this.colorSliderPosLimitRange[0]); + var maxValue = absMin + this.colorSliderPosLimitRange[1]; var position = svgvml.getTranslateXY(this.sliderHandleElement); var saturation, value; saturation = (position[1] + absMin) / maxValue * 100; // The value of HSV color model is inverted. top 100 ~ bottom 0. so subtract by 100 @@ -3376,6 +3382,14 @@ Slider.prototype.getSaturationAndValue = function () { value = 100 - (position[0] + absMin) / maxValue * 100; return [saturation, value]; }; + +Slider.prototype._setHueBarPosMax = function () { + var huebarRects = this.huebarSvgElement.getClientRects()[0]; + + if (huebarRects) { + this.huebarPosLimitRange[1] = huebarRects.height - 7; + } +}; /** * Move hue handle supplied pixel value * @private @@ -3388,8 +3402,8 @@ Slider.prototype._moveHueHandle = function (newTop, silent) { var hueHandleElement = this.huebarHandleElement; var baseColorElement = this.baseColorElement; var newGradientColor, hexStr; - newTop = Math.max(HUEBAR_POS_LIMIT_RANGE[0], newTop); - newTop = Math.min(HUEBAR_POS_LIMIT_RANGE[1], newTop); + newTop = Math.max(this.huebarPosLimitRange[0], newTop); + newTop = Math.min(this.huebarPosLimitRange[1], newTop); svgvml.setTranslateY(hueHandleElement, newTop); newGradientColor = colorUtil.hsvToRGB(this.getHue(), 100, 100); hexStr = colorUtil.rgbToHEX.apply(null, newGradientColor); @@ -3411,8 +3425,8 @@ Slider.prototype._moveHueHandle = function (newTop, silent) { Slider.prototype.moveHue = function (degree, silent) { var newTop = 0; var absMin, maxValue; - absMin = Math.abs(HUEBAR_POS_LIMIT_RANGE[0]); - maxValue = absMin + HUEBAR_POS_LIMIT_RANGE[1]; + absMin = Math.abs(this.huebarPosLimitRange[0]); + maxValue = absMin + this.huebarPosLimitRange[1]; degree = degree || 0; newTop = maxValue * degree / HUE_WHEEL_MAX - absMin; @@ -3426,7 +3440,7 @@ Slider.prototype.moveHue = function (degree, silent) { Slider.prototype._moveHueByPosition = function (y) { - var offset = HUEBAR_POS_LIMIT_RANGE[0]; + var offset = this.huebarPosLimitRange[0]; this._moveHueHandle(y + offset); }; @@ -3440,8 +3454,8 @@ Slider.prototype.getHue = function () { var handle = this.huebarHandleElement; var position = svgvml.getTranslateXY(handle); var absMin, maxValue; - absMin = Math.abs(HUEBAR_POS_LIMIT_RANGE[0]); - maxValue = absMin + HUEBAR_POS_LIMIT_RANGE[1]; // maxValue : 359.99 = pos.y : x + absMin = Math.abs(this.huebarPosLimitRange[0]); + maxValue = absMin + this.huebarPosLimitRange[1]; // maxValue : 359.99 = pos.y : x return (position[0] + absMin) * HUE_WHEEL_MAX / maxValue; }; @@ -3512,6 +3526,10 @@ Slider.prototype._onClick = function (clickEvent) { Slider.prototype._onDragStart = function (dragStartEvent) { + this._setColorSliderPosMax(); + + this._setHueBarPosMax(); + this._prepareColorSliderForMouseEvent(dragStartEvent); }; /** @@ -3549,7 +3567,6 @@ module.exports = Slider; "use strict"; /** * @fileoverview module for manipulate SVG or VML object - * @author NHN. FE Development Team */ @@ -4249,7 +4266,6 @@ module.exports = getMouseButton; "use strict"; /** * @fileoverview ColorPicker factory module - * @author NHN. FE Development Team */ @@ -4522,7 +4538,6 @@ module.exports = ColorPicker; "use strict"; /** * @fileoverview ColorPicker layout module - * @author NHN. FE Development Team */ @@ -4609,7 +4624,6 @@ module.exports = createObject; "use strict"; /** * @fileoverview Palette view template - * @author NHN. FE Development Team */ @@ -5199,7 +5213,6 @@ module.exports = toArray; "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/** * @fileoverview Slider template - * @author NHN. FE Development Team */ diff --git a/dist/tui-color-picker.min.css b/dist/tui-color-picker.min.css index 20a64df..afcdc03 100644 --- a/dist/tui-color-picker.min.css +++ b/dist/tui-color-picker.min.css @@ -1,6 +1,6 @@ /*! * TOAST UI Color Picker - * @version 2.2.7 - * @author NHN FE Development Team + * @version 2.2.8 + * @author NHN Cloud FE Development Team * @license MIT */.tui-colorpicker-clearfix{zoom:1}.tui-colorpicker-clearfix:after{content:"";display:block;clear:both}.tui-colorpicker-vml{behavior:url(#default#VML);display:block}.tui-colorpicker-container,.tui-colorpicker-palette-container{width:152px}.tui-colorpicker-palette-container ul{width:152px;margin:0;padding:0}.tui-colorpicker-palette-container li{float:left;margin:0;padding:0 3px 3px 0;list-style:none}.tui-colorpicker-palette-button{display:block;overflow:hidden;outline:none;margin:0;padding:0;width:16px;height:16px;border:1px solid #ccc;cursor:pointer}.tui-colorpicker-palette-button.tui-colorpicker-selected{border:2px solid #000}.tui-colorpicker-palette-button.tui-colorpicker-color-transparent{barckground-repeat:repeat;background-repeat:no-repeat;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAOCAYAAAD0f5bSAAABfGlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGAqSSwoyGFhYGDIzSspCnJ3UoiIjFJgv8PAzcDDIMRgxSCemFxc4BgQ4MOAE3y7xsAIoi/rgsxK8/x506a1fP4WNq+ZclYlOrj1gQF3SmpxMgMDIweQnZxSnJwLZOcA2TrJBUUlQPYMIFu3vKQAxD4BZIsUAR0IZN8BsdMh7A8gdhKYzcQCVhMS5AxkSwDZAkkQtgaInQ5hW4DYyRmJKUC2B8guiBvAgNPDRcHcwFLXkYC7SQa5OaUwO0ChxZOaFxoMcgcQyzB4MLgwKDCYMxgwWDLoMjiWpFaUgBQ65xdUFmWmZ5QoOAJDNlXBOT+3oLQktUhHwTMvWU9HwcjA0ACkDhRnEKM/B4FNZxQ7jxDLX8jAYKnMwMDcgxBLmsbAsH0PA4PEKYSYyjwGBn5rBoZt5woSixLhDmf8xkKIX5xmbARh8zgxMLDe+///sxoDA/skBoa/E////73o//+/i4H2A+PsQA4AJHdp4IxrEg8AAAGbaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6UGl4ZWxYRGltZW5zaW9uPjEzPC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjE0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CghrN1AAAABzSURBVCgVldKxEYAgDAXQD5VOpLuwgi4jlrTMqF00oOd5Aia/CcV/F4oYOgNlrLjvVyCEVJchBjEC25538PeaWTzRMBLxvIL7UZwFwL06qoA6aoAy+gFfJABvJAQPUoCMlICRRd8BzgHzJL4ok9aJ67l4AK9AxVKhHryUAAAAAElFTkSuQmCC")}.tui-colorpicker-palette-hex{font-family:monospace;width:60px}.tui-colorpicker-palette-hex,.tui-colorpicker-palette-preview{display:inline-block;*display:inline;zoom:1;vertical-align:middle}.tui-colorpicker-palette-preview{width:12px;height:12px;border:1px solid #ccc;overflow:hidden}.tui-colorpicker-palette-toggle-slider{display:inline-block;*display:inline;zoom:1;vertical-align:middle;float:right}.tui-colorpicker-slider-container{margin:5px 0 0;height:122px;zoom:1}.tui-colorpicker-slider-container:after{content:"";display:block;clear:both}.tui-colorpicker-slider-left{float:left;width:120px;height:120px}.tui-colorpicker-slider-right{float:right;width:32px;height:120px}.tui-colorpicker-svg{display:block}.tui-colorpicker-slider-handle{position:absolute;overflow:visible;top:0;left:0;width:1px;height:1px;z-index:2;opacity:.9}.tui-colorpicker-svg-slider,.tui-colorpicker-vml-slider{width:120px;height:120px;border:1px solid #ccc;overflow:hidden}.tui-colorpicker-vml-slider{position:relative}.tui-colorpicker-vml-slider-bg{position:absolute;margin:-1px 0 0 -1px;top:0;left:0;width:122px;height:122px}.tui-colorpicker-svg-huebar{float:right;width:18px;height:120px;border:1px solid #ccc;overflow:visible}.tui-colorpicker-vml-huebar{width:32px;position:relative}.tui-colorpicker-vml-huebar-bg{position:absolute;top:0;right:0;width:18px;height:121px} \ No newline at end of file diff --git a/dist/tui-color-picker.min.js b/dist/tui-color-picker.min.js index 226c01d..4911e2e 100644 --- a/dist/tui-color-picker.min.js +++ b/dist/tui-color-picker.min.js @@ -1,9 +1,9 @@ /*! * TOAST UI Color Picker - * @version 2.2.7 - * @author NHN FE Development Team + * @version 2.2.8 + * @author NHN Cloud FE Development Team * @license MIT */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.colorPicker=e():(t.tui=t.tui||{},t.tui.colorPicker=e())}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="dist",n(n.s=33)}([function(t,e,n){"use strict";t.exports=function(t,e){var n,r,o,i,s=Object.prototype.hasOwnProperty;for(o=1,i=arguments.length;o=0&&o-1?e[n][1]+=1:e.push([t,1]))},f.prototype._forgetContext=function(t){var e,n;o(t)&&(e=this._safeContext(),(n=this._indexOfContext(t))>-1&&(e[n][1]-=1,e[n][1]<=0&&e.splice(n,1)))},f.prototype._bindEvent=function(t,e,n){var r=this._safeEvent(t);this._memorizeContext(n),r.push(this._getHandlerItem(e,n))},f.prototype.on=function(t,e,n){var r=this;i(t)?(t=t.split(u),l(t,(function(t){r._bindEvent(t,e,n)}))):s(t)&&(n=e,l(t,(function(t,e){r.on(e,t,n)})))},f.prototype.once=function(t,e,n){var r=this;if(s(t))return n=e,void l(t,(function(t,e){r.once(e,t,n)}));this.on(t,(function o(){e.apply(n,arguments),r.off(t,o,n)}),n)},f.prototype._spliceMatches=function(t,e){var n,r=0;if(c(t))for(n=t.length;r0},f.prototype.getListenerLength=function(t){return this._safeEvent(t).length},t.exports=f},function(t,e,n){"use strict";t.exports=function(t){return"string"==typeof t||t instanceof String}},function(t,e,n){"use strict";var r=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,o={leadingZero:function(t,e){var n="",r=0;if((t+"").length>e)return t+"";for(;r=0&&o-1?e[r][1]+=1:e.push([t,1]))},f.prototype._forgetContext=function(t){var e,r;o(t)&&(e=this._safeContext(),(r=this._indexOfContext(t))>-1&&(e[r][1]-=1,e[r][1]<=0&&e.splice(r,1)))},f.prototype._bindEvent=function(t,e,r){var n=this._safeEvent(t);this._memorizeContext(r),n.push(this._getHandlerItem(e,r))},f.prototype.on=function(t,e,r){var n=this;i(t)?(t=t.split(u),l(t,(function(t){n._bindEvent(t,e,r)}))):s(t)&&(r=e,l(t,(function(t,e){n.on(e,t,r)})))},f.prototype.once=function(t,e,r){var n=this;if(s(t))return r=e,void l(t,(function(t,e){n.once(e,t,r)}));this.on(t,(function o(){e.apply(r,arguments),n.off(t,o,r)}),r)},f.prototype._spliceMatches=function(t,e){var r,n=0;if(a(t))for(r=t.length;n0},f.prototype.getListenerLength=function(t){return this._safeEvent(t).length},t.exports=f},function(t,e,r){"use strict";t.exports=function(t){return"string"==typeof t||t instanceof String}},function(t,e,r){"use strict";var n=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,o={leadingZero:function(t,e){var r="",n=0;if((t+"").length>e)return t+"";for(;n HSV conversion utilities based off of http://www.cs.rit.edu/~ncs/color/t_convert.html -hexToRGB:function(t){return!!o.isValidRGB(t)&&(t=t.substring(1),[parseInt(t.substr(0,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(4,2),16)])},rgbToHEX:function(t,e,n){var r="#"+o.leadingZero(t.toString(16),2)+o.leadingZero(e.toString(16),2)+o.leadingZero(n.toString(16),2);return!!o.isValidRGB(r)&&r},rgbToHSV:function(t,e,n){var r,o,i,s,c,a;if(t/=255,e/=255,n/=255,c=r=Math.max(t,e,n),a=r-(o=Math.min(t,e,n)),s=0===r?0:a/r,r===o)i=0;else{switch(r){case t:i=(e-n)/a+(e1?r(f.call(arguments),(function(t){this.add(t)}),this):(e=this.getItemID(t),(n=this.items)[e]||(this.length+=1),n[e]=t)},p.prototype.remove=function(t){var e,n,r=[];return this.length?arguments.length>1?r=u.map(f.call(arguments),(function(t){return this.remove(t)}),this):(e=this.items,l(t)&&(t=this.getItemID(t)),e[t]?(this.length-=1,n=e[t],delete e[t],n):r):r},p.prototype.clear=function(){this.items={},this.length=0},p.prototype.has=function(t){var e,n;return!!this.length&&(e=a(t),n=!1,e?this.each((function(e){return!0!==t(e)||(n=!0,!1)})):(t=l(t)?this.getItemID(t):t,n=c(this.items[t])),n)},p.prototype.doWhenHas=function(t,e,n){var r=this.items[t];c(r)&&e.call(n||this,r)},p.prototype.find=function(t){var e=new p;return this.hasOwnProperty("getItemID")&&(e.getItemID=this.getItemID),this.each((function(n){!0===t(n)&&e.add(n)})),e},p.prototype.groupBy=function(t,e){var n,o,i={},c=a(t),l=this.getItemID;if(s(t)){if(r(t,(function(t){i[t+""]=new p(l)})),!e)return i;t=e,c=!0}return this.each((function(e){c?o=t(e):(o=e[t],a(o)&&(o=o.apply(e))),(n=i[o])||(n=i[o]=new p(l)),n.add(e)})),i},p.prototype.single=function(){var t;return this.each((function(e){return t=e,!1}),this),t},p.prototype.sort=function(t){var e=[];return this.each((function(t){e.push(t)})),a(t)&&(e=e.sort(t)),e},p.prototype.each=function(t,e){o(this.items,t,e||this)},p.prototype.toArray=function(){return this.length?u.map(this.items,(function(t){return t})):[]},t.exports=p},function(t,e,n){"use strict";var r=n(3),o=n(36);t.exports=function(t){return!r(t)&&!o(t)}},function(t,e,n){"use strict";t.exports=function(t){return t===Object(t)}},function(t,e,n){"use strict";var r,o,i,s,c,a,l,u,f,p,h={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};"undefined"!=typeof window&&window.navigator&&(i=window.navigator,s=i.appName.replace(/\s/g,"_"),c=i.userAgent,a=/MSIE\s([0-9]+[.0-9]*)/,l=/Trident.*rv:11\./,u=/Edge\/(\d+)\./,f={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},(p={Microsoft_Internet_Explorer:function(){var t=c.match(a);t?(h.msie=!0,h.version=parseFloat(t[1])):h.others=!0},Netscape:function(){var t=!1;if(l.exec(c))h.msie=!0,h.version=11,t=!0;else if(u.exec(c))h.edge=!0,h.version=c.match(u)[1],t=!0;else for(r in f)if(f.hasOwnProperty(r)&&(o=c.match(f[r]))&&o.length>1){h[r]=t=!0,h.version=parseFloat(o[1]||0);break}t||(h.others=!0)}})[s]&&p[s]()),t.exports=h},function(t,e,n){"use strict";var r=n(3);t.exports=function(t){return t&&t.className?r(t.className.baseVal)?t.className:t.className.baseVal:""}},function(t,e,n){"use strict";(function(e){var r=n(10),o=n(42),i=n(44),s=n(47),c=n(28),a=n(17),l=n(14),u=n(15),f=n(0);function p(t,e){l(e,"mousedown",this._onMouseDown,this),this.options=f({distance:10},t),this.container=e,this._isMoved=!1,this._distance=0,this._dragStartFired=!1,this._dragStartEventData=null}p.prototype.destroy=function(){a(this.container,"mousedown",this._onMouseDown),this.options=this.container=this._isMoved=this._distance=this._dragStartFired=this._dragStartEventData=null},p.prototype._toggleDragEvent=function(t){var n=this.container;t?(o(n),l(window,"dragstart",u),l(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)):(i(n),a(window,"dragstart",u),a(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp}))},p.prototype._getEventData=function(t){return{target:c(t),originEvent:t}},p.prototype._onMouseDown=function(t){0===s(t)&&(this._distance=0,this._dragStartFired=!1,this._dragStartEventData=this._getEventData(t),this._toggleDragEvent(!0))},p.prototype._onMouseMove=function(t){var e=this.options.distance;u(t),this._isMoved=!0,this._distance-1)}},function(t,e,n){"use strict";var r=n(10),o=n(53),i=n(54),s=n(30),c=n(0),a=n(18),l=n(9),u=n(32),f=n(12),p=n(8),h=n(24),d=n(57),v=[-7,112],g=[-3,115];function y(t,e){(e=l.appendHTMLElement("div",e,t.cssPrefix+"slider-container")).style.display="none",p.call(this,t,e),this.options=c({color:"#f8f8f8",cssPrefix:"tui-colorpicker-"},t),this._dragDataCache={},this.sliderHandleElement=null,this.huebarHandleElement=null,this.baseColorElement=null,this.drag=new h({distance:0},e),this.drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this)}a(y,p),y.prototype._beforeDestroy=function(){this.drag.off(),this.drag=this.options=this._dragDataCache=this.sliderHandleElement=this.huebarHandleElement=this.baseColorElement=null},y.prototype.toggle=function(t){this.container.style.display=t?"block":"none"},y.prototype.isVisible=function(){return"block"===this.container.style.display},y.prototype.render=function(t){var e,n,r=this.container,o=this.options,i=d.layout;f.isValidRGB(t)&&(i=(i=(i=(i=i.replace(/{{slider}}/,d.slider)).replace(/{{huebar}}/,d.huebar)).replace(/{{cssPrefix}}/g,o.cssPrefix)).replace(/{{id}}/g,o.id),this.container.innerHTML=i,this.sliderHandleElement=r.querySelector("."+o.cssPrefix+"slider-handle"),this.huebarHandleElement=r.querySelector("."+o.cssPrefix+"huebar-handle"),this.baseColorElement=r.querySelector("."+o.cssPrefix+"slider-basecolor"),e=f.hexToRGB(t),n=f.rgbToHSV.apply(null,e),this.moveHue(n[0],!0),this.moveSaturationAndValue(n[1],n[2],!0))},y.prototype._moveColorSliderHandle=function(t,e,n){var r,o=this.sliderHandleElement;e=Math.max(v[0],e),e=Math.min(v[1],e),t=Math.max(v[0],t),t=Math.min(v[1],t),u.setTranslateXY(o,t,e),r=e>50?"white":"black",u.setStrokeColor(o,r),n||this.fire("_selectColor",{color:f.rgbToHEX.apply(null,this.getRGB())})},y.prototype.moveSaturationAndValue=function(t,e,n){var r,o,i,s;t=t||0,e=e||0,r=Math.abs(v[0]),i=t*(o=v[1])/100-r,s=o-e*o/100-r,this._moveColorSliderHandle(i,s,n)},y.prototype._moveColorSliderByPosition=function(t,e){var n=v[0];this._moveColorSliderHandle(t+n,e+n)},y.prototype.getSaturationAndValue=function(){var t=Math.abs(v[0]),e=t+v[1],n=u.getTranslateXY(this.sliderHandleElement);return[(n[1]+t)/e*100,100-(n[0]+t)/e*100]},y.prototype._moveHueHandle=function(t,e){var n,r,o=this.huebarHandleElement,i=this.baseColorElement;t=Math.max(g[0],t),t=Math.min(g[1],t),u.setTranslateY(o,t),n=f.hsvToRGB(this.getHue(),100,100),r=f.rgbToHEX.apply(null,n),u.setGradientColorStop(i,r),e||this.fire("_selectColor",{color:f.rgbToHEX.apply(null,this.getRGB())})},y.prototype.moveHue=function(t,e){var n,r;n=((r=Math.abs(g[0]))+g[1])*(t=t||0)/359.99-r,this._moveHueHandle(n,e)},y.prototype._moveHueByPosition=function(t){var e=g[0];this._moveHueHandle(t+e)},y.prototype.getHue=function(){var t,e,n=this.huebarHandleElement,r=u.getTranslateXY(n);return e=(t=Math.abs(g[0]))+g[1],359.99*(r[0]+t)/e},y.prototype.getHSV=function(){var t=this.getSaturationAndValue();return[this.getHue()].concat(t)},y.prototype.getRGB=function(){return f.hsvToRGB.apply(null,this.getHSV())},y.prototype._prepareColorSliderForMouseEvent=function(t){var e=this.options,n=i(t.target,"."+e.cssPrefix+"slider-part");return this._dragDataCache={isColorSlider:s(n,e.cssPrefix+"slider-left"),parentElement:n}},y.prototype._onClick=function(t){var e=this._prepareColorSliderForMouseEvent(t),n=o(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(n[0],n[1]):this._moveHueByPosition(n[1]),this._dragDataCache=null},y.prototype._onDragStart=function(t){this._prepareColorSliderForMouseEvent(t)},y.prototype._onDrag=function(t){var e=this._dragDataCache,n=o(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(n[0],n[1]):this._moveHueByPosition(n[1])},y.prototype._onDragEnd=function(){this._dragDataCache=null},r.mixin(y),t.exports=y},function(t,e,n){"use strict";var r=n(4).isOldBrowser,o=/[\.\-0-9]+/g,i={getTranslateXY:function(t){var e;return r?(e=t.style,[parseFloat(e.top),parseFloat(e.left)]):(e=t.getAttribute("transform"))?(e=e.match(o),[parseFloat(e[1]),parseFloat(e[0])]):[0,0]},setTranslateXY:function(t,e,n){r?(t.style.left=e+"px",t.style.top=n+"px"):t.setAttribute("transform","translate("+e+","+n+")")},setTranslateY:function(t,e){r?t.style.top=e+"px":t.setAttribute("transform","translate(-6,"+e+")")},setStrokeColor:function(t,e){r?t.strokecolor=e:t.setAttribute("stroke",e)},setGradientColorStop:function(t,e){r?t.color=e:t.setAttribute("stop-color",e)}};t.exports=i},function(t,e,n){n(34),t.exports=n(35)},function(t,e,n){},function(t,e,n){"use strict";var r={Collection:n(19),View:n(8),Drag:n(24),create:n(48),Palette:n(29),Slider:n(31),colorutil:n(12),svgvml:n(32)};t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return null===t}},function(t,e,n){"use strict";var r=n(3),o=n(38);t.exports=function(t,e){var n=location.hostname,i="TOAST UI "+t+" for "+n+": Statistics",s=window.localStorage.getItem(i);(r(window.tui)||!1!==window.tui.usageStatistics)&&(s&&!function(t){return(new Date).getTime()-t>6048e5}(s)||(window.localStorage.setItem(i,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||o("https://www.google-analytics.com/collect",{v:1,t:"event",tid:e,cid:n,dp:n,dh:t,el:t,ec:"use"})}),1e3)))}},function(t,e,n){"use strict";var r=n(7);t.exports=function(t,e){var n=document.createElement("img"),o="";return r(e,(function(t,e){o+="&"+e+"="+t})),o=o.substring(1),n.src=t+"?"+o,n.style.display="none",document.body.appendChild(n),document.body.removeChild(n),n}},function(t,e,n){"use strict";var r=n(2),o=n(5),i=n(23),s=n(40);t.exports=function(t){var e,n=Array.prototype.slice.call(arguments,1),c=t.classList,a=[];c?r(n,(function(e){t.classList.add(e)})):((e=i(t))&&(n=[].concat(e.split(/\s+/),n)),r(n,(function(t){o(t,a)<0&&a.push(t)})),s(t,a))}},function(t,e,n){"use strict";var r=n(1),o=n(3);t.exports=function(t,e){e=(e=r(e)?e.join(" "):e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),o(t.className.baseVal)?t.className=e:t.className.baseVal=e}},function(t,e,n){"use strict";t.exports=function(t){return"number"==typeof t||t instanceof Number}},function(t,e,n){"use strict";var r=n(14),o=n(15),i=n(43),s=n(27),c="onselectstart"in document,a=s(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);t.exports=function(t){t||(t=document),c?r(t,"selectstart",o):(t=t===document?document.documentElement:t,i(t,"prevUserSelect",t.style[a]),t.style[a]="none")}},function(t,e,n){"use strict";var r=n(16);t.exports=function(t,e,n){t.dataset?t.dataset[e]=n:t.setAttribute("data-"+r(e),n)}},function(t,e,n){"use strict";var r=n(17),o=n(15),i=n(45),s=n(46),c=n(27),a="onselectstart"in document,l=c(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);t.exports=function(t){t||(t=document),a?r(t,"selectstart",o):((t=t===document?document.documentElement:t).style[l]=i(t,"prevUserSelect")||"auto",s(t,"prevUserSelect"))}},function(t,e,n){"use strict";var r=n(16);t.exports=function(t,e){return t.dataset?t.dataset[e]:t.getAttribute("data-"+r(e))}},function(t,e,n){"use strict";var r=n(16);t.exports=function(t,e){t.dataset?delete t.dataset[e]:t.removeAttribute("data-"+r(e))}},function(t,e,n){"use strict";var r=n(22),o=n(5),i=["0","1","3","5","7"],s=["2","6"],c=["4"];t.exports=function(t){return r.msie&&r.version<=8?function(t){var e=String(t.button);if(o(e,i)>-1)return 0;if(o(e,s)>-1)return 2;if(o(e,c)>-1)return 1;return null}(t):t.button}},function(t,e,n){"use strict";var r=n(10),o=n(0),i=n(4),s=n(12),c=n(49),a=n(29),l=n(31),u=0;function f(t){var e;if(!(this instanceof f))return new f(t);if(!(t=this.options=o({container:null,color:"#f8f8f8",preset:["#181818","#282828","#383838","#585858","#b8b8b8","#d8d8d8","#e8e8e8","#f8f8f8","#ab4642","#dc9656","#f7ca88","#a1b56c","#86c1b9","#7cafc2","#ba8baf","#a16946"],cssPrefix:"tui-colorpicker-",detailTxt:"Detail",id:u+=1,usageStatistics:!0},t)).container)throw new Error("ColorPicker(): need container option.");e=this.layout=new c(t,t.container),this.palette=new a(t,e.container),this.palette.on({_selectColor:this._onSelectColorInPalette,_toggleSlider:this._onToggleSlider},this),this.slider=new l(t,e.container),this.slider.on("_selectColor",this._onSelectColorInSlider,this),e.addChild(this.palette),e.addChild(this.slider),this.render(t.color),t.usageStatistics&&i.sendHostName()}f.prototype._onSelectColorInPalette=function(t){var e=t.color,n=this.options;s.isValidRGB(e)||""===e?(this.fire("selectColor",{color:e,origin:"palette"}),n.color!==e&&(n.color=e,this.render(e))):this.render()},f.prototype._onToggleSlider=function(){this.slider.toggle(!this.slider.isVisible())},f.prototype._onSelectColorInSlider=function(t){var e=t.color,n=this.options;this.fire("selectColor",{color:e,origin:"slider"}),n.color!==e&&(n.color=e,this.palette.render(e))},f.prototype.setColor=function(t){if(!s.isValidRGB(t))throw new Error("ColorPicker#setColor(): need valid hex string color value");this.options.color=t,this.render(t)},f.prototype.getColor=function(){return this.options.color},f.prototype.toggle=function(t){this.layout.container.style.display=t?"block":"none"},f.prototype.render=function(t){this.layout.render(t||this.options.color)},f.prototype.destroy=function(){this.layout.destroy(),this.options.container.innerHTML="",this.layout=this.slider=this.palette=this.options=null},r.mixin(f),t.exports=f},function(t,e,n){"use strict";var r=n(0),o=n(18),i=n(9),s=n(8);function c(t,e){this.options=r({cssPrefix:"tui-colorpicker-"},t),e=i.appendHTMLElement("div",e,this.options.cssPrefix+"container"),s.call(this,t,e),this.render()}o(c,s),c.prototype.render=function(t){this.recursive((function(e){e.render(t)}),!0)},t.exports=c},function(t,e,n){"use strict";t.exports=function(t){function e(){}return e.prototype=t,new e}},function(t,e,n){"use strict";var r=n(52);t.exports=function(t){var e=['
    ',"{{each preset}}",['
  • '].join(""),"{{/each}}","
",'
','','','{{color}}',"
"].join("\n");return r(e,t)}},function(t,e,n){"use strict";var r=n(5),o=n(2),i=n(1),s=n(11),c=n(0),a=/{{\s?|\s?}}/g,l=/^[a-zA-Z0-9_@]+\[[a-zA-Z0-9_@"']+\]$/,u=/\[\s?|\s?\]/,f=/^[a-zA-Z_]+\.[a-zA-Z_]+$/,p=/\./,h=/^["']\w+["']$/,d=/"|'/g,v=/^-?\d+\.?\d*$/,g={if:function(t,e,n){var r=function(t,e){var n=[t],r=[],i=0,s=0;return o(e,(function(t,o){0===t.indexOf("if")?i+=1:"/if"===t?i-=1:i||0!==t.indexOf("elseif")&&"else"!==t||(n.push("else"===t?["true"]:t.split(" ").slice(1)),r.push(e.slice(s,o)),s=o+1)})),r.push(e.slice(s)),{exps:n,sourcesInsideIf:r}}(t,e),i=!1,s="";return o(r.exps,(function(t,e){return(i=_(t,n))&&(s=b(r.sourcesInsideIf[e],n)),!i})),s},each:function(t,e,n){var r=_(t,n),s=i(r)?"@index":"@key",a={},l="";return o(r,(function(t,r){a[s]=r,a["@this"]=t,c(n,a),l+=b(e.slice(),n)})),l},with:function(t,e,n){var o=r("as",t),i=t[o+1],s=_(t.slice(0,o),n),a={};return a[i]=s,b(e,c(n,a))||""}},y=3==="a".split(/a/).length?function(t,e){return t.split(e)}:function(t,e){var n,r,o=[],i=0;for(e.global||(e=new RegExp(e,"g")),n=e.exec(t);null!==n;)r=n.index,o.push(t.slice(i,r)),i=r+n[0].length,n=e.exec(t);return o.push(t.slice(i)),o};function m(t,e){var n,r=e[t];return"true"===t?r=!0:"false"===t?r=!1:h.test(t)?r=t.replace(d,""):l.test(t)?r=m((n=t.split(u))[0],e)[m(n[1],e)]:f.test(t)?r=m((n=t.split(p))[0],e)[n[1]]:v.test(t)&&(r=parseFloat(t)),r}function x(t,e,n){for(var r,o,i,c,a=g[t],l=1,u=2,f=e[u];l&&s(f);)0===f.indexOf(t)?l+=1:0===f.indexOf("/"+t)&&(l-=1,r=u),f=e[u+=2];if(l)throw Error(t+" needs {{/"+t+"}} expression.");return e[0]=a(e[0].split(" ").slice(1),(o=0,i=r,(c=e.splice(o+1,i-o)).pop(),c),n),e}function _(t,e){var n=m(t[0],e);return n instanceof Function?function(t,e,n){var r=[];return o(e,(function(t){r.push(m(t,n))})),t.apply(null,r)}(n,t.slice(1),e):n}function b(t,e){for(var n,r,o,i=1,c=t[i];s(c);)r=(n=c.split(" "))[0],g[r]?(o=x(r,t.splice(i,t.length-i),e),t=t.concat(o)):t[i]=_(n,e),c=t[i+=2];return t.join("")}t.exports=function(t,e){return b(y(t,a),e)}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e){var n,o=r(t),i=o?t[0]:t.clientX,s=o?t[1]:t.clientY;return e?[i-(n=e.getBoundingClientRect()).left-e.clientLeft,s-n.top-e.clientTop]:[i,s]}},function(t,e,n){"use strict";var r=n(55);t.exports=function(t,e){var n=t.parentNode;if(r(t,e))return t;for(;n&&n!==document;){if(r(n,e))return n;n=n.parentNode}return null}},function(t,e,n){"use strict";var r=n(5),o=n(56),i=Element.prototype,s=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(t){var e=this.document||this.ownerDocument;return r(this,o(e.querySelectorAll(t)))>-1};t.exports=function(t,e){return s.call(t,e)}},function(t,e,n){"use strict";var r=n(6);t.exports=function(t){var e;try{e=Array.prototype.slice.call(t)}catch(n){e=[],r(t,(function(t){e.push(t)}))}return e}},function(t,e,n){"use strict";(function(e){var r=n(4).isOldBrowser,o=['
{{slider}}
','
{{huebar}}
'].join("\n"),i=['',"",'','','',"",'','','',"","",'','','',""].join("\n"),s=['
','','',"",'','',"",'',"
"].join("\n"),c=['',"",'','','','','','','','',"","",'','',""].join("\n"),a=['
','','',"",'',"
"].join("\n");r&&e.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),t.exports={layout:o,slider:r?s:i,huebar:r?a:c}}).call(this,n(25))}])})); \ No newline at end of file +hexToRGB:function(t){return!!o.isValidRGB(t)&&(t=t.substring(1),[parseInt(t.substr(0,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(4,2),16)])},rgbToHEX:function(t,e,r){var n="#"+o.leadingZero(t.toString(16),2)+o.leadingZero(e.toString(16),2)+o.leadingZero(r.toString(16),2);return!!o.isValidRGB(n)&&n},rgbToHSV:function(t,e,r){var n,o,i,s,a,c;if(t/=255,e/=255,r/=255,a=n=Math.max(t,e,r),c=n-(o=Math.min(t,e,r)),s=0===n?0:c/n,n===o)i=0;else{switch(n){case t:i=(e-r)/c+(e1?n(f.call(arguments),(function(t){this.add(t)}),this):(e=this.getItemID(t),(r=this.items)[e]||(this.length+=1),r[e]=t)},h.prototype.remove=function(t){var e,r,n=[];return this.length?arguments.length>1?n=u.map(f.call(arguments),(function(t){return this.remove(t)}),this):(e=this.items,l(t)&&(t=this.getItemID(t)),e[t]?(this.length-=1,r=e[t],delete e[t],r):n):n},h.prototype.clear=function(){this.items={},this.length=0},h.prototype.has=function(t){var e,r;return!!this.length&&(e=c(t),r=!1,e?this.each((function(e){return!0!==t(e)||(r=!0,!1)})):(t=l(t)?this.getItemID(t):t,r=a(this.items[t])),r)},h.prototype.doWhenHas=function(t,e,r){var n=this.items[t];a(n)&&e.call(r||this,n)},h.prototype.find=function(t){var e=new h;return this.hasOwnProperty("getItemID")&&(e.getItemID=this.getItemID),this.each((function(r){!0===t(r)&&e.add(r)})),e},h.prototype.groupBy=function(t,e){var r,o,i={},a=c(t),l=this.getItemID;if(s(t)){if(n(t,(function(t){i[t+""]=new h(l)})),!e)return i;t=e,a=!0}return this.each((function(e){a?o=t(e):(o=e[t],c(o)&&(o=o.apply(e))),(r=i[o])||(r=i[o]=new h(l)),r.add(e)})),i},h.prototype.single=function(){var t;return this.each((function(e){return t=e,!1}),this),t},h.prototype.sort=function(t){var e=[];return this.each((function(t){e.push(t)})),c(t)&&(e=e.sort(t)),e},h.prototype.each=function(t,e){o(this.items,t,e||this)},h.prototype.toArray=function(){return this.length?u.map(this.items,(function(t){return t})):[]},t.exports=h},function(t,e,r){"use strict";var n=r(3),o=r(36);t.exports=function(t){return!n(t)&&!o(t)}},function(t,e,r){"use strict";t.exports=function(t){return t===Object(t)}},function(t,e,r){"use strict";var n,o,i,s,a,c,l,u,f,h,p={chrome:!1,firefox:!1,safari:!1,msie:!1,edge:!1,others:!1,version:0};"undefined"!=typeof window&&window.navigator&&(i=window.navigator,s=i.appName.replace(/\s/g,"_"),a=i.userAgent,c=/MSIE\s([0-9]+[.0-9]*)/,l=/Trident.*rv:11\./,u=/Edge\/(\d+)\./,f={firefox:/Firefox\/(\d+)\./,chrome:/Chrome\/(\d+)\./,safari:/Version\/([\d.]+).*Safari\/(\d+)/},(h={Microsoft_Internet_Explorer:function(){var t=a.match(c);t?(p.msie=!0,p.version=parseFloat(t[1])):p.others=!0},Netscape:function(){var t=!1;if(l.exec(a))p.msie=!0,p.version=11,t=!0;else if(u.exec(a))p.edge=!0,p.version=a.match(u)[1],t=!0;else for(n in f)if(f.hasOwnProperty(n)&&(o=a.match(f[n]))&&o.length>1){p[n]=t=!0,p.version=parseFloat(o[1]||0);break}t||(p.others=!0)}})[s]&&h[s]()),t.exports=p},function(t,e,r){"use strict";var n=r(3);t.exports=function(t){return t&&t.className?n(t.className.baseVal)?t.className:t.className.baseVal:""}},function(t,e,r){"use strict";(function(e){var n=r(10),o=r(42),i=r(44),s=r(47),a=r(28),c=r(17),l=r(14),u=r(15),f=r(0);function h(t,e){l(e,"mousedown",this._onMouseDown,this),this.options=f({distance:10},t),this.container=e,this._isMoved=!1,this._distance=0,this._dragStartFired=!1,this._dragStartEventData=null}h.prototype.destroy=function(){c(this.container,"mousedown",this._onMouseDown),this.options=this.container=this._isMoved=this._distance=this._dragStartFired=this._dragStartEventData=null},h.prototype._toggleDragEvent=function(t){var r=this.container;t?(o(r),l(window,"dragstart",u),l(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp},this)):(i(r),c(window,"dragstart",u),c(e.document,{mousemove:this._onMouseMove,mouseup:this._onMouseUp}))},h.prototype._getEventData=function(t){return{target:a(t),originEvent:t}},h.prototype._onMouseDown=function(t){0===s(t)&&(this._distance=0,this._dragStartFired=!1,this._dragStartEventData=this._getEventData(t),this._toggleDragEvent(!0))},h.prototype._onMouseMove=function(t){var e=this.options.distance;u(t),this._isMoved=!0,this._distance-1)}},function(t,e,r){"use strict";var n=r(10),o=r(53),i=r(54),s=r(30),a=r(0),c=r(18),l=r(9),u=r(32),f=r(12),h=r(8),p=r(24),d=r(57);function v(t,e){(e=l.appendHTMLElement("div",e,t.cssPrefix+"slider-container")).style.display="none",h.call(this,t,e),this.options=a({color:"#f8f8f8",cssPrefix:"tui-colorpicker-"},t),this._dragDataCache={},this.sliderHandleElement=null,this.huebarHandleElement=null,this.baseColorElement=null,this.drag=new p({distance:0},e),this.colorSliderPosLimitRange=[-7,112],this.huebarPosLimitRange=[-3,115],this.drag.on({dragStart:this._onDragStart,drag:this._onDrag,dragEnd:this._onDragEnd,click:this._onClick},this)}c(v,h),v.prototype._beforeDestroy=function(){this.drag.off(),this.drag=this.options=this._dragDataCache=this.sliderHandleElement=this.huebarHandleElement=this.baseColorElement=null},v.prototype.toggle=function(t){this.container.style.display=t?"block":"none"},v.prototype.isVisible=function(){return"block"===this.container.style.display},v.prototype.render=function(t){var e,r,n=this.container,o=this.options,i=d.layout;f.isValidRGB(t)&&(i=(i=(i=(i=i.replace(/{{slider}}/,d.slider)).replace(/{{huebar}}/,d.huebar)).replace(/{{cssPrefix}}/g,o.cssPrefix)).replace(/{{id}}/g,o.id),this.container.innerHTML=i,this.sliderSvgElement=n.querySelector("."+o.cssPrefix+"svg-slider"),this.huebarSvgElement=n.querySelector("."+o.cssPrefix+"svg-huebar"),this.sliderHandleElement=n.querySelector("."+o.cssPrefix+"slider-handle"),this.huebarHandleElement=n.querySelector("."+o.cssPrefix+"huebar-handle"),this.baseColorElement=n.querySelector("."+o.cssPrefix+"slider-basecolor"),e=f.hexToRGB(t),r=f.rgbToHSV.apply(null,e),this.moveHue(r[0],!0),this.moveSaturationAndValue(r[1],r[2],!0))},v.prototype._setColorSliderPosMax=function(){var t=this.sliderSvgElement.getClientRects()[0];t&&(this.colorSliderPosLimitRange[1]=t.height-10)},v.prototype._moveColorSliderHandle=function(t,e,r){var n,o=this.sliderHandleElement;e=Math.max(this.colorSliderPosLimitRange[0],e),e=Math.min(this.colorSliderPosLimitRange[1],e),t=Math.max(this.colorSliderPosLimitRange[0],t),t=Math.min(this.colorSliderPosLimitRange[1],t),u.setTranslateXY(o,t,e),n=e>50?"white":"black",u.setStrokeColor(o,n),r||this.fire("_selectColor",{color:f.rgbToHEX.apply(null,this.getRGB())})},v.prototype.moveSaturationAndValue=function(t,e,r){var n,o,i,s;t=t||0,e=e||0,n=Math.abs(this.colorSliderPosLimitRange[0]),i=t*(o=this.colorSliderPosLimitRange[1])/100-n,s=o-e*o/100-n,this._moveColorSliderHandle(i,s,r)},v.prototype._moveColorSliderByPosition=function(t,e){var r=this.colorSliderPosLimitRange[0];this._moveColorSliderHandle(t+r,e+r)},v.prototype.getSaturationAndValue=function(){var t=Math.abs(this.colorSliderPosLimitRange[0]),e=t+this.colorSliderPosLimitRange[1],r=u.getTranslateXY(this.sliderHandleElement);return[(r[1]+t)/e*100,100-(r[0]+t)/e*100]},v.prototype._setHueBarPosMax=function(){var t=this.huebarSvgElement.getClientRects()[0];t&&(this.huebarPosLimitRange[1]=t.height-7)},v.prototype._moveHueHandle=function(t,e){var r,n,o=this.huebarHandleElement,i=this.baseColorElement;t=Math.max(this.huebarPosLimitRange[0],t),t=Math.min(this.huebarPosLimitRange[1],t),u.setTranslateY(o,t),r=f.hsvToRGB(this.getHue(),100,100),n=f.rgbToHEX.apply(null,r),u.setGradientColorStop(i,n),e||this.fire("_selectColor",{color:f.rgbToHEX.apply(null,this.getRGB())})},v.prototype.moveHue=function(t,e){var r,n;r=((n=Math.abs(this.huebarPosLimitRange[0]))+this.huebarPosLimitRange[1])*(t=t||0)/359.99-n,this._moveHueHandle(r,e)},v.prototype._moveHueByPosition=function(t){var e=this.huebarPosLimitRange[0];this._moveHueHandle(t+e)},v.prototype.getHue=function(){var t,e,r=this.huebarHandleElement,n=u.getTranslateXY(r);return e=(t=Math.abs(this.huebarPosLimitRange[0]))+this.huebarPosLimitRange[1],359.99*(n[0]+t)/e},v.prototype.getHSV=function(){var t=this.getSaturationAndValue();return[this.getHue()].concat(t)},v.prototype.getRGB=function(){return f.hsvToRGB.apply(null,this.getHSV())},v.prototype._prepareColorSliderForMouseEvent=function(t){var e=this.options,r=i(t.target,"."+e.cssPrefix+"slider-part");return this._dragDataCache={isColorSlider:s(r,e.cssPrefix+"slider-left"),parentElement:r}},v.prototype._onClick=function(t){var e=this._prepareColorSliderForMouseEvent(t),r=o(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(r[0],r[1]):this._moveHueByPosition(r[1]),this._dragDataCache=null},v.prototype._onDragStart=function(t){this._setColorSliderPosMax(),this._setHueBarPosMax(),this._prepareColorSliderForMouseEvent(t)},v.prototype._onDrag=function(t){var e=this._dragDataCache,r=o(t.originEvent,e.parentElement);e.isColorSlider?this._moveColorSliderByPosition(r[0],r[1]):this._moveHueByPosition(r[1])},v.prototype._onDragEnd=function(){this._dragDataCache=null},n.mixin(v),t.exports=v},function(t,e,r){"use strict";var n=r(4).isOldBrowser,o=/[\.\-0-9]+/g,i={getTranslateXY:function(t){var e;return n?(e=t.style,[parseFloat(e.top),parseFloat(e.left)]):(e=t.getAttribute("transform"))?(e=e.match(o),[parseFloat(e[1]),parseFloat(e[0])]):[0,0]},setTranslateXY:function(t,e,r){n?(t.style.left=e+"px",t.style.top=r+"px"):t.setAttribute("transform","translate("+e+","+r+")")},setTranslateY:function(t,e){n?t.style.top=e+"px":t.setAttribute("transform","translate(-6,"+e+")")},setStrokeColor:function(t,e){n?t.strokecolor=e:t.setAttribute("stroke",e)},setGradientColorStop:function(t,e){n?t.color=e:t.setAttribute("stop-color",e)}};t.exports=i},function(t,e,r){r(34),t.exports=r(35)},function(t,e,r){},function(t,e,r){"use strict";var n={Collection:r(19),View:r(8),Drag:r(24),create:r(48),Palette:r(29),Slider:r(31),colorutil:r(12),svgvml:r(32)};t.exports=n},function(t,e,r){"use strict";t.exports=function(t){return null===t}},function(t,e,r){"use strict";var n=r(3),o=r(38);t.exports=function(t,e){var r=location.hostname,i="TOAST UI "+t+" for "+r+": Statistics",s=window.localStorage.getItem(i);(n(window.tui)||!1!==window.tui.usageStatistics)&&(s&&!function(t){return(new Date).getTime()-t>6048e5}(s)||(window.localStorage.setItem(i,(new Date).getTime()),setTimeout((function(){"interactive"!==document.readyState&&"complete"!==document.readyState||o("https://www.google-analytics.com/collect",{v:1,t:"event",tid:e,cid:r,dp:r,dh:t,el:t,ec:"use"})}),1e3)))}},function(t,e,r){"use strict";var n=r(7);t.exports=function(t,e){var r=document.createElement("img"),o="";return n(e,(function(t,e){o+="&"+e+"="+t})),o=o.substring(1),r.src=t+"?"+o,r.style.display="none",document.body.appendChild(r),document.body.removeChild(r),r}},function(t,e,r){"use strict";var n=r(2),o=r(5),i=r(23),s=r(40);t.exports=function(t){var e,r=Array.prototype.slice.call(arguments,1),a=t.classList,c=[];a?n(r,(function(e){t.classList.add(e)})):((e=i(t))&&(r=[].concat(e.split(/\s+/),r)),n(r,(function(t){o(t,c)<0&&c.push(t)})),s(t,c))}},function(t,e,r){"use strict";var n=r(1),o=r(3);t.exports=function(t,e){e=(e=n(e)?e.join(" "):e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),o(t.className.baseVal)?t.className=e:t.className.baseVal=e}},function(t,e,r){"use strict";t.exports=function(t){return"number"==typeof t||t instanceof Number}},function(t,e,r){"use strict";var n=r(14),o=r(15),i=r(43),s=r(27),a="onselectstart"in document,c=s(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);t.exports=function(t){t||(t=document),a?n(t,"selectstart",o):(t=t===document?document.documentElement:t,i(t,"prevUserSelect",t.style[c]),t.style[c]="none")}},function(t,e,r){"use strict";var n=r(16);t.exports=function(t,e,r){t.dataset?t.dataset[e]=r:t.setAttribute("data-"+n(e),r)}},function(t,e,r){"use strict";var n=r(17),o=r(15),i=r(45),s=r(46),a=r(27),c="onselectstart"in document,l=a(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);t.exports=function(t){t||(t=document),c?n(t,"selectstart",o):((t=t===document?document.documentElement:t).style[l]=i(t,"prevUserSelect")||"auto",s(t,"prevUserSelect"))}},function(t,e,r){"use strict";var n=r(16);t.exports=function(t,e){return t.dataset?t.dataset[e]:t.getAttribute("data-"+n(e))}},function(t,e,r){"use strict";var n=r(16);t.exports=function(t,e){t.dataset?delete t.dataset[e]:t.removeAttribute("data-"+n(e))}},function(t,e,r){"use strict";var n=r(22),o=r(5),i=["0","1","3","5","7"],s=["2","6"],a=["4"];t.exports=function(t){return n.msie&&n.version<=8?function(t){var e=String(t.button);if(o(e,i)>-1)return 0;if(o(e,s)>-1)return 2;if(o(e,a)>-1)return 1;return null}(t):t.button}},function(t,e,r){"use strict";var n=r(10),o=r(0),i=r(4),s=r(12),a=r(49),c=r(29),l=r(31),u=0;function f(t){var e;if(!(this instanceof f))return new f(t);if(!(t=this.options=o({container:null,color:"#f8f8f8",preset:["#181818","#282828","#383838","#585858","#b8b8b8","#d8d8d8","#e8e8e8","#f8f8f8","#ab4642","#dc9656","#f7ca88","#a1b56c","#86c1b9","#7cafc2","#ba8baf","#a16946"],cssPrefix:"tui-colorpicker-",detailTxt:"Detail",id:u+=1,usageStatistics:!0},t)).container)throw new Error("ColorPicker(): need container option.");e=this.layout=new a(t,t.container),this.palette=new c(t,e.container),this.palette.on({_selectColor:this._onSelectColorInPalette,_toggleSlider:this._onToggleSlider},this),this.slider=new l(t,e.container),this.slider.on("_selectColor",this._onSelectColorInSlider,this),e.addChild(this.palette),e.addChild(this.slider),this.render(t.color),t.usageStatistics&&i.sendHostName()}f.prototype._onSelectColorInPalette=function(t){var e=t.color,r=this.options;s.isValidRGB(e)||""===e?(this.fire("selectColor",{color:e,origin:"palette"}),r.color!==e&&(r.color=e,this.render(e))):this.render()},f.prototype._onToggleSlider=function(){this.slider.toggle(!this.slider.isVisible())},f.prototype._onSelectColorInSlider=function(t){var e=t.color,r=this.options;this.fire("selectColor",{color:e,origin:"slider"}),r.color!==e&&(r.color=e,this.palette.render(e))},f.prototype.setColor=function(t){if(!s.isValidRGB(t))throw new Error("ColorPicker#setColor(): need valid hex string color value");this.options.color=t,this.render(t)},f.prototype.getColor=function(){return this.options.color},f.prototype.toggle=function(t){this.layout.container.style.display=t?"block":"none"},f.prototype.render=function(t){this.layout.render(t||this.options.color)},f.prototype.destroy=function(){this.layout.destroy(),this.options.container.innerHTML="",this.layout=this.slider=this.palette=this.options=null},n.mixin(f),t.exports=f},function(t,e,r){"use strict";var n=r(0),o=r(18),i=r(9),s=r(8);function a(t,e){this.options=n({cssPrefix:"tui-colorpicker-"},t),e=i.appendHTMLElement("div",e,this.options.cssPrefix+"container"),s.call(this,t,e),this.render()}o(a,s),a.prototype.render=function(t){this.recursive((function(e){e.render(t)}),!0)},t.exports=a},function(t,e,r){"use strict";t.exports=function(t){function e(){}return e.prototype=t,new e}},function(t,e,r){"use strict";var n=r(52);t.exports=function(t){var e=['
    ',"{{each preset}}",['
  • '].join(""),"{{/each}}","
",'
','','','{{color}}',"
"].join("\n");return n(e,t)}},function(t,e,r){"use strict";var n=r(5),o=r(2),i=r(1),s=r(11),a=r(0),c=/{{\s?|\s?}}/g,l=/^[a-zA-Z0-9_@]+\[[a-zA-Z0-9_@"']+\]$/,u=/\[\s?|\s?\]/,f=/^[a-zA-Z_]+\.[a-zA-Z_]+$/,h=/\./,p=/^["']\w+["']$/,d=/"|'/g,v=/^-?\d+\.?\d*$/,g={if:function(t,e,r){var n=function(t,e){var r=[t],n=[],i=0,s=0;return o(e,(function(t,o){0===t.indexOf("if")?i+=1:"/if"===t?i-=1:i||0!==t.indexOf("elseif")&&"else"!==t||(r.push("else"===t?["true"]:t.split(" ").slice(1)),n.push(e.slice(s,o)),s=o+1)})),n.push(e.slice(s)),{exps:r,sourcesInsideIf:n}}(t,e),i=!1,s="";return o(n.exps,(function(t,e){return(i=_(t,r))&&(s=b(n.sourcesInsideIf[e],r)),!i})),s},each:function(t,e,r){var n=_(t,r),s=i(n)?"@index":"@key",c={},l="";return o(n,(function(t,n){c[s]=n,c["@this"]=t,a(r,c),l+=b(e.slice(),r)})),l},with:function(t,e,r){var o=n("as",t),i=t[o+1],s=_(t.slice(0,o),r),c={};return c[i]=s,b(e,a(r,c))||""}},m=3==="a".split(/a/).length?function(t,e){return t.split(e)}:function(t,e){var r,n,o=[],i=0;for(e.global||(e=new RegExp(e,"g")),r=e.exec(t);null!==r;)n=r.index,o.push(t.slice(i,n)),i=n+r[0].length,r=e.exec(t);return o.push(t.slice(i)),o};function x(t,e){var r,n=e[t];return"true"===t?n=!0:"false"===t?n=!1:p.test(t)?n=t.replace(d,""):l.test(t)?n=x((r=t.split(u))[0],e)[x(r[1],e)]:f.test(t)?n=x((r=t.split(h))[0],e)[r[1]]:v.test(t)&&(n=parseFloat(t)),n}function y(t,e,r){for(var n,o,i,a,c=g[t],l=1,u=2,f=e[u];l&&s(f);)0===f.indexOf(t)?l+=1:0===f.indexOf("/"+t)&&(l-=1,n=u),f=e[u+=2];if(l)throw Error(t+" needs {{/"+t+"}} expression.");return e[0]=c(e[0].split(" ").slice(1),(o=0,i=n,(a=e.splice(o+1,i-o)).pop(),a),r),e}function _(t,e){var r=x(t[0],e);return r instanceof Function?function(t,e,r){var n=[];return o(e,(function(t){n.push(x(t,r))})),t.apply(null,n)}(r,t.slice(1),e):r}function b(t,e){for(var r,n,o,i=1,a=t[i];s(a);)n=(r=a.split(" "))[0],g[n]?(o=y(n,t.splice(i,t.length-i),e),t=t.concat(o)):t[i]=_(r,e),a=t[i+=2];return t.join("")}t.exports=function(t,e){return b(m(t,c),e)}},function(t,e,r){"use strict";var n=r(1);t.exports=function(t,e){var r,o=n(t),i=o?t[0]:t.clientX,s=o?t[1]:t.clientY;return e?[i-(r=e.getBoundingClientRect()).left-e.clientLeft,s-r.top-e.clientTop]:[i,s]}},function(t,e,r){"use strict";var n=r(55);t.exports=function(t,e){var r=t.parentNode;if(n(t,e))return t;for(;r&&r!==document;){if(n(r,e))return r;r=r.parentNode}return null}},function(t,e,r){"use strict";var n=r(5),o=r(56),i=Element.prototype,s=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(t){var e=this.document||this.ownerDocument;return n(this,o(e.querySelectorAll(t)))>-1};t.exports=function(t,e){return s.call(t,e)}},function(t,e,r){"use strict";var n=r(6);t.exports=function(t){var e;try{e=Array.prototype.slice.call(t)}catch(r){e=[],n(t,(function(t){e.push(t)}))}return e}},function(t,e,r){"use strict";(function(e){var n=r(4).isOldBrowser,o=['
{{slider}}
','
{{huebar}}
'].join("\n"),i=['',"",'','','',"",'','','',"","",'','','',""].join("\n"),s=['
','','',"",'','',"",'',"
"].join("\n"),a=['',"",'','','','','','','','',"","",'','',""].join("\n"),c=['
','','',"",'',"
"].join("\n");n&&e.document.namespaces.add("v","urn:schemas-microsoft-com:vml"),t.exports={layout:o,slider:n?s:i,huebar:n?c:a}}).call(this,r(25))}])})); \ No newline at end of file