!function(e) { var t = {}; function r(n) { if (t[n]) return t[n].exports; var o = t[n] = { i: n, l: !1, exports: {} }; return e[n].call(o.exports, o, o.exports, r), o.l = !0, o.exports } r.m = e, r.c = t, r.d = function(e, t, n) { r.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n }) } , r.r = function(e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) } , r.t = function(e, t) { if (1 & t && (e = r(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var n = Object.create(null); if (r.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var o in e) r.d(n, o, function(t) { return e[t] } .bind(null, o)); return n } , r.n = function(e) { var t = e && e.__esModule ? function() { return e.default } : function() { return e } ; return r.d(t, "a", t), t } , r.o = function(e, t) { return Object.prototype.hasOwnProperty.call(e, t) } , r.p = "", r(r.s = 1) }([function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e } ; function o(e) { return "string" == typeof e } function i(e) { return null !== e && "object" === (void 0 === e ? "undefined" : n(e)) } function a(e) { return "[object Array]" === Object.prototype.toString.call(e) } t.isNumber = function(e) { return "number" == typeof e } , t.isStr = o, t.isUndefined = function(e) { return void 0 === e } , t.isNull = function(e) { return null === e } , t.isFunction = function(e) { return "function" == typeof e } , t.isShallowObject = i, t.isDeepObject = function(e) { return "[object Object]" === Object.prototype.toString.call(e) } , t.isDeepArray = a, t.ewObjToArray = function(e) { if (e && e.length) return Array.prototype.slice.call(e) } , t.isIB = function(e) { return e.indexOf("inline-block") > -1 } , t.isStat = function(e) { return e.indexOf("static") > -1 } , t.isRel = function(e) { return e.indexOf("relative") > -1 } , t.isAbs = function(e) { return e.indexOf("absolute") > -1 } , t.isDom = function(e) { return "object" === ("undefined" == typeof HTMLElement ? "undefined" : n(HTMLElement)) ? e instanceof HTMLElement : e && "object" === (void 0 === e ? "undefined" : n(e)) && 1 === e.nodeType && "string" == typeof e.nodeName || e instanceof HTMLCollection || e instanceof NodeList } , t.ewAssign = function(e, t) { if (null === e) return; if (Object.assign) return Object.assign(e, t); for (var r = Object(e), n = 1; n < arguments.length; n++) { var o = arguments[n]; if (o) for (var i in o) Object.prototype.hasOwnProperty.call(o, i) && (r[i] = o[i]) } return r } , t.ewError = function(e) { return new Error(e) } , t.deepCloneObjByJSON = function(e) { return JSON.parse(JSON.stringify(e)) } , t.cssObjToStr = function(e) { if (!i(e)) return; var t = ""; for (var r in e) t += s(r) + ":" + e[r] + ";"; return t } , t.keba = s, t.getCss = function(e, t) { var r = e.currentStyle ? function(t) { var n = e.currentStyle[t]; if (n.indexOf("height") > -1 && n.search(/px/i) > -1) { var o = e.getBoundingClientRect; return o.bottom - o.top - parseInt(r("padding-bottom")) - parseInt(r("padding-top")) + "px" } } : function(t) { return window.getComputedStyle(e, null)[t] } ; return r(t) } , t.requestAnimationFrame = function() { window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame || function(e) { return window.setTimeout(e, 1e3 / 60) } } , t.createElement = function(e) { return document.createElement(e) } , t.addClass = function(e, t) { return e.classList.add(t) } , t.removeClass = function(e, t) { return e.classList.remove(t) } , t.clone = function(e) { return e.cloneNode(!0) } , t.addEvent = function(e, t, r) { e.addEventListener ? e.addEventListener(t, r, !1) : e.attachEvent("on" + t, r) } ; t.deepCloneObjByRecursion = function e(t) { if (i(t)) { var r = a(t) ? [] : {}; for (var n in t) r[n] = i(t[n]) ? e(t[n]) : t[n]; return r } } ; function s(e) { if (o(e)) return e.replace(/A-Z/g, function(e) { return "-" + e.toLowerCase() }) } t.getDom = function(e) { var t, r = e.slice(0, 1), n = e.slice(1); return /^[#\.]/.test(r) ? "#" === r ? t = document.getElementById(n) : "." === r && (t = document.getElementsByClassName(n)) : t = document.getElementsByTagName(e), t } , t.eventType = navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i) ? ["touchstart", "touchmove", "touchend"] : ["mousedown", "mousemove", "mouseup"] } , function(e, t, r) { "use strict"; var n, o, i, a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) { return typeof e } : function(e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e } , s = r(0), l = u(r(2)), c = u(r(3)), d = u(r(4)); function u(e) { return e && e.__esModule ? e : { default: e } } i = function() { function e(e, t) { if (!(0, s.isStr)(e)) throw (0, s.ewError)("you should pass a string params,sush as drag,textarea,colorpicker!"); switch (e) { case "drag": return new l.default(t); case "textarea": return new c.default(t); case "colorpicker": return new d.default(t) } return this } return window.ewPlugins || (window.ewPlugins = e), e } , "object" === a(t) && void 0 !== e ? e.exports = i() : void 0 === (o = "function" == typeof (n = i) ? n.call(t, r, t, e) : n) || (e.exports = o) } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , o = []; function i(e, t, r) { var n = null , o = parseInt(e.style[t]) , i = !isNaN(r) && r > 0 && r <= o ? r : 50; e.style.transition = t + " .3s ease-out .1s"; !function r() { o -= i, e.style[t] = o + "px", n && o <= 0 ? (e.style[t] = "", clearTimeout(n)) : n = setTimeout(r, 100) }() } function a(e) { var t, r, i, a, s; if ((0, n.isStr)(e) || (0, n.isDom)(e)) r = (0, n.isStr)(e) ? (0, n.getDom)(e) : e, t = { width: window.innerWidth, height: window.innerHeight, isWindow: !0 }; else { if (!(0, n.isDeepObject)(e) || !e.el) return (0, n.ewError)("you should pass a string param or an object param!"); r = (0, n.isStr)(e.el) ? (0, n.getDom)(e.el) : e.el, i = (0, n.isStr)(e.scopeEl) ? (0, n.getDom)(e.scopeEl) : e.scopeEl, a = (0, n.isStr)(e.designEl) ? (0, n.getDom)(e.designEl) : e.designEl, s = (0, n.isStr)(e.disabledButton) ? (0, n.getDom)(e.disabledButton) : e.disabledButton, (t = { width: e.width || window.innerWidth, height: e.height || window.innerHeight, scopeEl: e.scopeEl || null, isWindow: !!(0, n.isUndefined)(e.isWindow) || e.isWindow, origin: e.origin || !1, designEl: a || null, startCB: (0, n.isFunction)(e.startCB) ? e.startCB : null, moveCB: (0, n.isFunction)(e.moveCB) ? e.moveCB : null, endCB: (0, n.isFunction)(e.endCB) ? e.endCB : null, dragDisabled: e.dragDisabled || !1, disabledButton: s || null, grid: e.grid || [], ani_transition: (0, n.isStr)(e.ani_transition) || (0, n.isDeepObject)(e.ani_transition) ? e.ani_transition : null }).scopeEl && (t.scopeEl = i.length ? i[0] : i, t.width = (0, n.getCss)(t.scopeEl, "width"), t.height = (0, n.getCss)(t.scopeEl, "height")), e.axis && (t.axis = e.axis) } return o.push(t), this.config = o, this.beforeInit(r, t), s && this.clickDisable(s, r, t), this } a.prototype.clickDisable = function(e, t, r) { if (e && e.length > 0) for (var o = 0, i = e.length; o < i; o++) a(this, e[o]); else a(this, e); function a(e, o) { o && (o.onclick = function() { e.config.length > 1 ? e.config.forEach(function(t) { (0, n.ewObjToArray)(t.disabledButton).indexOf(o) > -1 && (t.dragDisabled = !t.dragDisabled, e.beforeInit(t.el, t)) }) : t.length > 0 ? (e.config[0].dragDisabled = !e.config[0].dragDisabled, (0, n.ewObjToArray)(t).forEach(function(t) { e.beforeInit(t, e.config[0]) })) : (r.dragDisabled = !r.dragDisabled, e.beforeInit(r.el, r)) } ) } } , a.prototype.beforeInit = function(e, t) { if (e && e.length > 0) for (var r = 0, o = e.length; r < o; r++) this.init((0, n.ewAssign)(t, { el: e[r] })), this.resize(this, (0, n.ewAssign)(t, { el: e[r] })); else t.el = e, this.init(t), this.resize(this, t) } , a.prototype.resize = function(e, t) { window.onresize = function() { t.scopeEl || (t.width = window.innerWidth, t.height = window.innerHeight), e.init(t) } } , a.prototype.init = function(e) { e.width = parseInt(e.width) <= parseInt((0, n.getCss)(e.el, "width")) ? window.innerWidth : parseInt(e.width), e.height = parseInt(e.height) <= parseInt((0, n.getCss)(e.el, "height")) ? window.innerHeight : parseInt(e.height), this.onMouseDown(e) } , a.prototype.onMouseDown = function(e) { if ((0, n.isDom)(e.designEl)) if (e.designEl.length > 0) { var t = this; (0, n.ewObjToArray)(e.designEl).forEach(function(r) { t.config.length > 1 ? t.config.map(function(e) { e.designEl && (0, n.ewObjToArray)(e.designEl).indexOf(r) > -1 && i(t, e.el, r, e) }) : r.parentElement ? i(t, r.parentElement, r, t.config[0]) : i(t, e.el, r, t.config[0]) }) } else i(this, e.el, e.designEl, e); else i(this, e.el, e.el, e); function r() { this.style.cursor = "move" } function o() { this.style.cursor = "" } function i(e, t, i, a) { a.dragDisabled ? (i.removeEventListener("mouseenter", r), i.removeEventListener("mouseleave", o), i["on" + n.eventType[0]] = null, document["on" + n.eventType[1]] = document["on" + n.eventType[2]] = null) : (i.addEventListener("mouseenter", r), i.addEventListener("mouseleave", o), i["on" + n.eventType[0]] = function(r) { a.startCB && a.startCB(), a.ani_transition && (t.style.cssText += (0, n.isStr)(a.ani_transition) && a.ani_transition.indexOf("transition") > -1 ? a.ani_transition : (0, n.cssObjToStr)(a.ani_transition).indexOf("transition") > -1 ? (0, n.cssObjToStr)(a.ani_transition) : ""); var o = n.eventType[0].indexOf("touch") > -1 ? r.changedTouches[0].clientX - t.offsetLeft : r.clientX - t.offsetLeft , s = n.eventType[0].indexOf("touch") > -1 ? r.changedTouches[0].clientY - t.offsetTop : r.clientY - t.offsetTop; e.onMouseMove(t, a, o, s, n.eventType), e.onMouseUp(t, i, a, n.eventType) } ) } } , a.prototype.onMouseMove = function(e, t, r, o, i) { var a = (0, n.getCss)(e, "position"); document["on" + i[1]] = function(s) { var l, c, d, u, p = i[0].indexOf("touch") > -1 ? s.changedTouches[0].clientX : s.clientX, f = i[0].indexOf("touch") > -1 ? s.changedTouches[0].clientY : s.clientY; if (e.style.margin = 0, (0, n.isAbs)(a) || (e.style.position = "absolute"), t.moveCB && t.moveCB(), (0, n.isDeepArray)(t.grid) && t.grid.length && t.grid.length <= 2) { var h = p - r , g = parseInt(t.grid[0]) , b = f - o , m = parseInt(t.grid[1]); isNaN(g) || (l = g * parseInt(h / g)), isNaN(m) || (c = m * parseInt(b / m)) } else l = p - r, c = f - o; if (d = t.width - e.offsetWidth, u = t.height - e.offsetHeight, t.axis) if (t.axis.toLowerCase().indexOf("x") > -1) this.moveLeft(e, t, l, d); else { if (!(t.axis.toLowerCase().indexOf("y") > -1)) throw (0, n.ewError)("a Invalid value of axis!"); this.moveTop(e, t, c, u) } else this.moveLeft(e, t, l, d), this.moveTop(e, t, c, u) } .bind(this) } , a.prototype.moveLeft = function(e, t, r, n) { var o = r <= 0 && t.isWindow ? 0 : r >= n && t.isWindow ? n : r; e.style.left = o + "px" } , a.prototype.moveTop = function(e, t, r, n) { var o = r <= 0 && t.isWindow ? 0 : r >= n && t.isWindow ? n : r; e.style.top = o + "px" } , a.prototype.restoreX = function(e, t) { i(e, "left", t) } , a.prototype.restoreY = function(e, t) { i(e, "top", t) } , a.prototype.onMouseUp = function(e, t, r, o) { document["on" + o[2]] = function() { if (r.endCB && r.endCB(), document["on" + o[1]] = document["on" + o[2]] = null, t.style.cursor = "", r.origin) { if (r.axis) if (r.axis.toLowerCase().indexOf("x") > -1) this.restoreX(e, r.originSpeed); else { if (!(r.axis.toLowerCase().indexOf("y") > -1)) throw (0, n.ewError)("a Invalid value of axis!"); this.restoreY(e, r.originSpeed) } else this.restoreX(e, r.originSpeed), this.restoreY(e, r.originSpeed); e.style.cssText = 'margin:0;position:"";' } } .bind(this) } , t.default = a } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , o = { width: "auto", height: "auto", border: "1px solid rgb(169, 169, 169)", "min-height": "30px", font: "400 13.3333px Arial;font-family: monospace", "min-width": "157px", "max-width": "157px", padding: "2px", display: "block", background: "#fff" }; function i(e) { if ((0, n.isDeepObject)(e)) if (e.el) { var t = (0, n.isStr)(e.el) ? (0, n.getDom)(e.el) : e.el; this.editextArea(t) } else { if (this.isModeUndefined(e.mode) && !this.isModeAuto(e.mode) && !this.isModeNotAuto(e.mode)) throw (0, n.ewError)("you should pass a string param that called mode and mode is auto or notAuto!"); var r = (0, n.isStr)(e.container) ? (0, n.getDom)(e.container) : (0, n.isDom)(e.container) ? e.container : null; this.addTextArea(r, this.createEleAuto(e.mode)) } else if ((0, n.isUndefined)(e) || (0, n.isNull)(e)) this.addTextArea(null, this.createEleAuto("notAuto")); else if (this.isModeAuto(e) || this.isModeNotAuto(e)) this.addTextArea(null, this.createEleAuto(e)); else { var o = (0, n.isStr)(e) ? (0, n.getDom)(e) : e; this.editextArea(o) } return this } i.prototype.editextArea = function(e) { if (e.length) { var t = !0 , r = !1 , n = void 0; try { for (var o, i = e[Symbol.iterator](); !(t = (o = i.next()).done); t = !0) { var a = o.value; this.setEleAuto(a) } } catch (e) { r = !0, n = e } finally { try { !t && i.return && i.return() } finally { if (r) throw n } } } else this.setEleAuto(e) } , i.prototype.addTextArea = function(e, t) { var r = this; if ((0, n.isDom)(e)) if (e.length) { var o = !0 , i = !1 , a = void 0; try { for (var s, l = function() { var e = s.value , n = t.cloneNode(!0); n.tagName.toLowerCase().indexOf("textarea") > -1 && setTimeout(function() { r.autoTextArea(n) }, 0), e.appendChild(n) }, c = e[Symbol.iterator](); !(o = (s = c.next()).done); o = !0) l() } catch (e) { i = !0, a = e } finally { try { !o && c.return && c.return() } finally { if (i) throw a } } } else e.appendChild(t); else document.body.appendChild(t) } , i.prototype.isModeUndefined = function(e) { return !(0, n.isStr)(e) } , i.prototype.isModeAuto = function(e) { return e.indexOf("auto") > -1 } , i.prototype.isModeNotAuto = function(e) { return e.indexOf("notAuto") > -1 } , i.prototype.setEleAuto = function(e) { e.tagName.toLowerCase().indexOf("textarea") > -1 ? this.autoTextArea(e) : (e.setAttribute("contenteditable", !0), e.style.cssText += (0, n.cssObjToStr)(o)) } , i.prototype.createEleAuto = function(e) { var t = null , r = function(e) { this.autoTextArea(e) } .bind(this); return this.isModeAuto(e) ? (t = document.createElement("textarea"), setTimeout(r(t), 0)) : ((t = document.createElement("div")).style.cssText += (0, n.cssObjToStr)(o), t.classList.add("ew-textarea"), t.setAttribute("contenteditable", !0)), t } , i.prototype.autoTextArea = function(e, t, r) { t = t || 0; var o = document.getBoxObjectFor || "mozInnerScreenX"in window , i = window.opera && window.opera.toString().indexOf("opera"); e.style.cssText += "resize:none;"; var a = parseInt((0, n.getCss)(e, "height")) , s = function() { var s, l = 0, c = e.style; o || i || (l = parseInt((0, n.getCss)(e, "padding-bottom")) + parseInt((0, n.getCss)(e, "padding-top"))), c.height = a + "px", e.scrollHeight > a && (r && e.scrollHeight > r ? (s = r - l, c.overflowY = "auto") : (s = e.scrollHeight - l, c.overflowY = "hidden"), c.height = s + t + "px") }; (0, n.addEvent)(e, "propertychange", s), (0, n.addEvent)(e, "focus", s), (0, n.addEvent)(e, "input", s), s() } , t.default = i } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , o = r(5) , i = s(r(6)) , a = s(r(8)); function s(e) { return e && e.__esModule ? e : { default: e } } function l(e, t, r) { return r ? document.querySelectorAll ? e.querySelectorAll("." + t) : e.getElementsByClassName(t) : document.querySelector ? e.querySelector("." + t) : e.getElementsByClassName(t)[0] } function c(e, t, r) { e.style[t] = r } function d(e) { e.config.openPickerAni.indexOf("height") > -1 ? e.pickerFlag ? a.default.slideDown(e.picker, 400) : a.default.slideUp(e.picker, 400) : e.pickerFlag ? a.default.fadeIn(e.picker, 400) : a.default.fadeOut(e.picker, 400) } function u(e, t, r, n, o) { c(e.pickerCursor, "left", t + "px"), c(e.pickerCursor, "top", r + "px"); var i = parseInt(100 * t / n) , a = parseInt(100 * (o - r) / o); e.hsba.s = i > 100 ? 100 : i < 0 ? 0 : i, e.hsba.b = a > 100 ? 100 : a < 0 ? 0 : a, p(e) } function p(e, t) { // c(e.box, "background", (0, // o.colorHsbaToRgba)(e.hsba)), c(e.arrowRight, "border-top-color", (0, o.colorHsbaToRgba)(e.hsba)), t || e.config.alpha ? e.pickerInput.value = (0, o.colorHsbaToRgba)(e.hsba) : e.pickerInput.value = (0, o.colorRgbaToHex)((0, o.colorHsbaToRgba)(e.hsba)) } function f(e) { if (this.pickerFlag = !1, (0, n.isStr)(e) || (0, n.isDom)(e)) { var t = (0, n.isDom)(e) ? e : (0, n.getDom)(e); if (this.config = { hue: !0, alpha: !1, size: "normal", predefineColor: [], disabled: !1, defaultColor: "", openPickerAni: "height", sure: function() {}, clear: function() {}, }, t.length) for (var r = -1; ++r < t.length; ) this.init(t[r], this.config); else this.init(t, this.config) } else { if (!(0, n.isDeepObject)(e) || !(0, n.isStr)(e.el) && !(0, n.isDom)(e.el)) return (0, n.isDeepObject)(e) ? (0, n.ewError)("you should pass a param which is el and el must be a string or a dom element!") : (0, n.ewError)("you should pass a param that it must be a string or a dom element!"); var o = (0, n.isDom)(e.el) ? e.el : (0, n.getDom)(e.el); if (this.config = { hue: e.hue || !0, alpha: e.alpha || !1, size: e.size || "normal", predefineColor: e.predefineColor || [], disabled: e.disabled || !1, defaultColor: e.defaultColor || "", openPickerAni: e.openPickerAni || "height", sure: (0, n.isFunction)(e.sure) ? e.sure : null, clear: (0, n.isFunction)(e.clear) ? e.clear : null, startMainCallback: (0, n.isFunction)(e.startMainCallback) ? e.startMainCallback : null }, o.length) for (var i = 0; i < o.length; ) this.init(o[i], this.config), i++; else this.init(o, this.config) } this.close = () => { this.pickerFlag = !this.pickerFlag, this.render(this.box.parentNode, this.config), d(this), g(this, this.panelWidth, this.panelHeight) } function createGuid(){ return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}) } let _this = this let uid = createGuid() this.uid = uid _this.box.setAttribute("color-box-id", uid) function clickEvent(event) { if(!document.contains(_this.box)) { document.removeEventListener('click', clickEvent); } // 检查点击事件是否发生在核心元素或其子元素之外 let boxNode function recursion(node) { if(!node.parentNode) { boxNode = node } else { if(node.getAttribute("color-box-id") === uid) { boxNode = node } else { recursion(node.parentNode) } } } recursion(event.target) if(!boxNode) { if(_this.pickerFlag) { _this.close() } } else { if (!boxNode.getAttribute || boxNode.getAttribute("color-box-id") !== uid) { if(_this.pickerFlag) { _this.close() } } } } document.addEventListener('click', clickEvent); return this } function h(e) { var t = (0, n.deepCloneObjByJSON)(e.hsba); t? t.s = t.b = 100 : t = { s: 100, b: 100 } e.alphaBarBg && c(e.alphaBarBg, "background", "linear-gradient(to top," + (0, o.colorHsbaToRgba)(t, 0) + " 0%," + (0, o.colorHsbaToRgba)(t) + " 100%)") } function g(e, t, r) { e.pickerInput.value = e.config.alpha ? (0, o.colorHsbaToRgba)(e.hsba) : (0, o.colorRgbaToHex)((0, o.colorHsbaToRgba)(e.hsba)), e.arrowRight && c(e.arrowRight, "border-top-color", (0, o.colorHsbaToRgba)(e.hsba)); var i = e.hueBar.offsetHeight || 180 , a = parseInt(e.hsba.s * t / 100) , s = parseInt(r - e.hsba.b * r / 100) , l = parseInt(e.hsba.h * i / 360); c(e.pickerCursor, "left", a + "px"), c(e.pickerCursor, "top", s + "px"), c(e.hueThumb, "top", l + "px"); var d = (0, n.deepCloneObjByJSON)(e.hsba); if (d.s = d.b = 100, c(e.pickerPanel, "background", (0, o.colorRgbaToHex)((0, o.colorHsbaToRgba)(d))), e.config.alpha) { var u = i - e.hsba.a * i; c(e.alphaBarThumb, "top", u + "px") } } function b(e, t) { var r = e.hueBar.offsetHeight , i = e.hueBar.getBoundingClientRect() , a = Math.max(0, Math.min(t - i.y, r)); c(e.hueThumb, "top", a + "px"); var s = (0, n.deepCloneObjByJSON)(e.hsba); s.s = 100, s.b = 100, e.hsba.h = s.h = parseInt(360 * a / r), c(e.pickerPanel, "background", (0, o.colorRgbaToHex)((0, o.colorHsbaToRgba)(s))), p(e), h(e) } function m(e, t) { var r = e.hueBar.offsetHeight , n = e.hueBar.getBoundingClientRect() , o = Math.max(0, Math.min(t - n.y, r)); c(e.alphaBarThumb, "top", o + "px"); var i = (r - o <= 0 ? 0 : r - o) / r; e.hsba.a = i >= 1 ? 1 : i.toFixed(2), p(e, !0) } f.prototype.init = function(e, t) { this.render(e, t), document.getElementsByTagName("head")[0].appendChild(i.default) } , f.prototype.render = function(e, t) { var r = void 0 , o = void 0 , i = ""; if ((0, n.isStr)(t.size)) switch (t.size) { case "normal": r = o = "40px"; break; case "medium": r = o = "36px"; break; case "small": r = o = "32px"; break; case "mini": r = o = "28px" } else { if (!(0, n.isDeepObject)(t.size)) return (0, n.ewError)("the value must be a string which is one of the normal,medium,small,mini,or must be an object and need to contain width or height property!"); r = t.size.width && (0, n.isNumber)(t.size.width) ? t.size.width + "px" : (0, n.isStr)(t.size.width) ? parseInt(t.size.width) + "px" : "40px", o = t.size.height && (0, n.isNumber)(t.size.height) ? t.size.height + "px" : (0, n.isStr)(t.size.height) ? parseInt(t.size.height) : "40px" } (0, n.isDeepArray)(t.predefineColor) && t.predefineColor.length && t.predefineColor.map(function(e) { i += '
' }); var a = t.defaultColor ? '