/*!
 * iro.js v5.1.8
 * 2016-2020 James Daniel
 * Licensed under MPL 2.0
 * github.com/jaames/iro.js
 */
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n=n||self).iro=t()}(this,function(){"use strict";function o(n,t){for(var i in t)n[i]=t[i];return n}function ti(n){var t=n.parentNode;t&&t.removeChild(n)}function n(n,t,i){var r,u,e,f,s=arguments;if(t=o({},t),3<arguments.length)for(i=[i],r=3;r<arguments.length;r++)i.push(s[r]);if(null!=i&&(t.children=i),null!=n&&null!=n.defaultProps)for(u in n.defaultProps)void 0===t[u]&&(t[u]=n.defaultProps[u]);return f=t.key,null!=(e=t.ref)&&delete t.ref,null!=f&&delete t.key,ht(n,t,f,e)}function ht(n,t,i,u){var f={type:n,props:t,key:i,ref:u,n:null,i:null,e:0,o:null,l:null,c:null,constructor:void 0};return r.vnode&&r.vnode(f),f}function nt(n){return n.children}function y(n,t){this.props=n;this.context=t}function tt(n,t){if(null==t)return n.i?tt(n.i,n.i.n.indexOf(n)+1):null;for(var i;t<n.n.length;t++)if(null!=(i=n.n[t])&&null!=i.o)return i.o;return"function"==typeof n.type?tt(n):null}function ii(n){var t,i;if(null!=(n=n.i)&&null!=n.c){for(n.o=n.c.base=null,t=0;t<n.n.length;t++)if(null!=(i=n.n[t])&&null!=i.o){n.o=n.c.base=i.o;break}return ii(n)}}function ct(n){(!n.f&&(n.f=!0)&&1===g.push(n)||ot!==r.debounceRendering)&&(ot=r.debounceRendering,(r.debounceRendering||gt)(gi))}function gi(){var f,t,i,e,n,r,u,s;for(g.sort(function(n,t){return t.p.e-n.p.e});f=g.pop();)f.f&&(e=i=void 0,r=(n=(t=f).p).o,u=t.w,s=t.u,t.u=!1,u&&(i=[],e=at(u,n,o({},n),t.m,void 0!==u.ownerSVGElement,null,i,s,null==r?tt(n):r),oi(i,n),e!=r&&ii(n)))}function ri(n,t,i,r,u,f,o,s,h){var c,v,l,a,w,k,p,y=i&&i.n||st,b=y.length;if(s==e&&(s=null!=f?f[0]:b?tt(i,0):null),c=0,t.n=lt(t.n,function(i){if(null!=i){if(i.i=t,i.e=t.e+1,null===(l=y[c])||l&&i.key==l.key&&i.type===l.type)y[c]=void 0;else for(v=0;v<b;v++){if((l=y[v])&&i.key==l.key&&i.type===l.type){y[v]=void 0;break}l=null}if(a=at(n,i,l=l||e,r,u,f,o,null,s,h),(v=i.ref)&&l.ref!=v&&(p=p||[]).push(v,i.c||a,i),null!=a){if(null==k&&(k=a),null!=i.l)a=i.l,i.l=null;else if(f==l||a!=s||null==a.parentNode){n:if(null==s||s.parentNode!==n)n.appendChild(a);else{for(w=s,v=0;(w=w.nextSibling)&&v<b;v+=2)if(w==a)break n;n.insertBefore(a,s)}"option"==t.type&&(n.value="")}s=a.nextSibling;"function"==typeof t.type&&(t.l=a)}}return c++,i}),t.o=k,null!=f&&"function"!=typeof t.type)for(c=f.length;c--;)null!=f[c]&&ti(f[c]);for(c=b;c--;)null!=y[c]&&hi(y[c],y[c]);if(p)for(c=0;c<p.length;c++)si(p[c],p[++c],p[++c])}function lt(n,t,i){if(null==i&&(i=[]),null==n||"boolean"==typeof n)t&&i.push(t(null));else if(Array.isArray(n))for(var r=0;r<n.length;r++)lt(n[r],t,i);else i.push(t?t(function(n){if(null==n||"boolean"==typeof n)return null;if("string"==typeof n||"number"==typeof n)return ht(null,n,null,null);if(null==n.o&&null==n.c)return n;var t=ht(n.type,n.props,n.key,null);return t.o=n.o,t}(n)):n);return i}function ui(n,t,i){"-"===t[0]?n.setProperty(t,i):n[t]="number"==typeof i&&!1===di.test(t)?i+"px":null==i?"":i}function fi(n,t,i,r,u){var f,o,e,s,h;if("key"!==(t=u?"className"===t?"class":t:"class"===t?"className":t)&&"children"!==t)if("style"===t)if(f=n.style,"string"==typeof i)f.cssText=i;else{if("string"==typeof r&&(f.cssText="",r=null),r)for(o in r)i&&o in i||ui(f,o,"");if(i)for(e in i)r&&i[e]===r[e]||ui(f,e,i[e])}else"o"===t[0]&&"n"===t[1]?(s=t!==(t=t.replace(/Capture$/,"")),t=((h=t.toLowerCase())in n?h:t).slice(2),i?(r||n.addEventListener(t,ei,s),(n.t||(n.t={}))[t]=i):n.removeEventListener(t,ei,s)):"list"!==t&&"tagName"!==t&&"form"!==t&&!u&&t in n?n[t]=null==i?"":i:"function"!=typeof i&&"dangerouslySetInnerHTML"!==t&&(t!==(t=t.replace(/^xlink:?/,""))?null==i||!1===i?n.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):n.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),i):null==i||!1===i?n.removeAttribute(t):n.setAttribute(t,i))}function ei(n){return this.t[n.type](r.event?r.event(n):n)}function at(n,t,i,u,f,s,h,c,l,a){var p,v,g,tt,it,rt,ut,w,d,k,b=t.type;if(void 0!==t.constructor)return null;(p=r.e)&&p(t);try{n:if("function"==typeof b){if(w=t.props,d=(p=b.contextType)&&u[p.c],k=p?d?d.props.value:p.i:u,i.c?ut=(v=t.c=i.c).i=v.k:("prototype"in b&&b.prototype.render?t.c=v=new b(w,k):(t.c=v=new y(w,k),v.constructor=b,v.render=nr),d&&d.sub(v),v.props=w,v.state||(v.state={}),v.context=k,v.m=u,g=v.f=!0,v.M=[]),null==v.j&&(v.j=v.state),null!=b.getDerivedStateFromProps&&o(v.j==v.state?v.j=o({},v.j):v.j,b.getDerivedStateFromProps(w,v.j)),g)null==b.getDerivedStateFromProps&&null!=v.componentWillMount&&v.componentWillMount(),null!=v.componentDidMount&&h.push(v);else{if(null==b.getDerivedStateFromProps&&null==c&&null!=v.componentWillReceiveProps&&v.componentWillReceiveProps(w,k),!c&&null!=v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(w,v.j,k)){for(v.props=w,v.state=v.j,v.f=!1,(v.p=t).o=null!=l?l!==i.o?l:i.o:null,t.n=i.n,p=0;p<t.n.length;p++)t.n[p]&&(t.n[p].i=t);break n}null!=v.componentWillUpdate&&v.componentWillUpdate(w,v.j,k)}for(tt=v.props,it=v.state,v.context=k,v.props=w,v.state=v.j,(p=r.O)&&p(t),v.f=!1,v.p=t,v.w=n,p=v.render(v.props,v.state,v.context),t.n=lt(null!=p&&p.type==nt&&null==p.key?p.props.children:p),null!=v.getChildContext&&(u=o(o({},u),v.getChildContext())),g||null==v.getSnapshotBeforeUpdate||(rt=v.getSnapshotBeforeUpdate(tt,it)),ri(n,t,i,u,f,s,h,l,a),v.base=t.o;p=v.M.pop();)v.j&&(v.state=v.j),p.call(v);g||null==tt||null==v.componentDidUpdate||v.componentDidUpdate(tt,it,rt);ut&&(v.k=v.i=null)}else t.o=function(n,t,i,r,u,f,o,s){var l,a,v,c,y=i.props,h=t.props;if(u="svg"===t.type||u,null==n&&null!=f)for(l=0;l<f.length;l++)if(null!=(a=f[l])&&(null===t.type?3===a.nodeType:a.localName===t.type)){n=a;f[l]=null;break}if(null==n){if(null===t.type)return document.createTextNode(h);n=u?document.createElementNS("http://www.w3.org/2000/svg",t.type):document.createElement(t.type);f=null}return null===t.type?y!==h&&(null!=f&&(f[f.indexOf(n)]=null),n.data=h):t!==i&&(null!=f&&(f=st.slice.call(n.childNodes)),v=(y=i.props||e).dangerouslySetInnerHTML,c=h.dangerouslySetInnerHTML,s||(c||v)&&(c&&v&&c.I==v.I||(n.innerHTML=c&&c.I||"")),function(n,t,i,r,u){for(var f in i)f in t||fi(n,f,null,i[f],r);for(f in t)u&&"function"!=typeof t[f]||"value"===f||"checked"===f||i[f]===t[f]||fi(n,f,t[f],i[f],r)}(n,h,y,u,s),t.n=t.props.children,c||ri(n,t,i,r,"foreignObject"!==t.type&&u,f,o,e,s),s||("value"in h&&void 0!==h.value&&h.value!==n.value&&(n.value=null==h.value?"":h.value),"checked"in h&&void 0!==h.checked&&h.checked!==n.checked&&(n.checked=h.checked))),n}(i.o,t,i,u,f,s,h,a);(p=r.diffed)&&p(t)}catch(n){r.o(n,t,i)}return t.o}function oi(n,t){for(var i;i=n.pop();)try{i.componentDidMount()}catch(n){r.o(n,i.p)}r.c&&r.c(t)}function si(n,t,i){try{"function"==typeof n?n(t):n.current=t}catch(n){r.o(n,i)}}function hi(n,t,i){var u,e,f;if(r.unmount&&r.unmount(n),(u=n.ref)&&si(u,null,t),i||"function"==typeof n.type||(i=null!=(e=n.o)),n.o=n.l=null,null!=(u=n.c)){if(u.componentWillUnmount)try{u.componentWillUnmount()}catch(n){r.o(n,t)}u.base=u.w=null}if(u=n.n)for(f=0;f<u.length;f++)u[f]&&hi(u[f],t,i);null!=e&&ti(e)}function nr(n,t,i){return this.constructor(n,i)}function u(n,t){var r=-1<n.indexOf("%"),i=parseFloat(n);return r?t/100*i:i}function f(n){return parseInt(n,16)}function a(n){return n.toString(16).padStart(2,"0")}function vt(n){var t=n.width,i=n.sliderSize,r=n.borderWidth,u=n.handleRadius,f=n.padding,o=n.sliderShape,e="horizontal"===n.layoutDirection;return i=i||2*f+2*u+2*r,"circle"===o?{handleStart:n.padding+n.handleRadius,handleRange:t-2*f-2*u-2*r,width:t,height:t,cx:t/2,cy:t/2,radius:t/2-r/2}:{handleStart:i/2,handleRange:t-i,radius:i/2,x:0,y:0,width:e?i:t,height:e?t:i}}function hr(n,t){var i=vt(n),s=i.width,h=i.height,f=i.handleRange,e=i.handleStart,r="horizontal"===n.layoutDirection,o=r?s/2:h/2,u=e+function(n,t){var i=t.hsva;switch(n.sliderType){case"alpha":return 100*i.a;case"kelvin":var r=n.minTemperature,u=n.maxTemperature-r,f=(t.kelvin-r)/u*100;return Math.max(0,Math.min(f,100));case"hue":return i.h/=3.6;case"saturation":return i.s;case"value":default:return i.v}}(n,t)/100*f;return r&&(u=-1*u+f+2*e),{x:r?o:u,y:r?u:o}}function yt(n){var t=n.width/2;return{width:n.width,radius:t-n.borderWidth,cx:t,cy:t}}function pt(n,t,i){var r=n.wheelAngle,u=n.wheelDirection;return((t=!i&&"clockwise"===u||i&&"anticlockwise"===u?(i?180:360)-(r-t):r+t)%360+360)%360}function ai(n,t,i){var r=yt(n),o=r.cx,s=r.cy,u=n.width/2-n.padding-n.handleRadius-n.borderWidth,f,e;return t=o-t,i=s-i,f=pt(n,Math.atan2(-i,-t)*(180/Math.PI)),e=Math.min(Math.sqrt(t*t+i*i),u),{h:Math.round(f),s:Math.round(100/u*e)}}function wt(n){var t=n.width;return{width:t,height:t,radius:n.padding+n.handleRadius}}function vi(n,t,i){var u=wt(n),f=u.width,e=u.height,r=u.radius,o=(t-r)/(f-2*r)*100,s=(i-r)/(e-2*r)*100;return{s:Math.max(0,Math.min(o,100)),v:Math.max(0,Math.min(100-s,100))}}function s(n){var i=window.navigator.userAgent,r=/^((?!chrome|android).)*safari/i.test(i),u=/iPhone|iPod|iPad/i.test(i),t=window.location;return(r||u)&&0<yi.length?t.protocol+"//"+t.host+t.pathname+t.search+n:n}function pi(n,t,i,r){for(var f,e,u=0;u<r.length;u++)if(f=r[u].x-t,e=r[u].y-i,Math.sqrt(f*f+e*e)<n.handleRadius)return u;return null}function v(t){var r=t.r,i=t.url;return n("svg",{className:"IroHandle IroHandle--"+t.index+" "+(t.isActive?"IroHandle--isActive":""),x:t.x,y:t.y,style:{overflow:"visible"}},i&&n("use",Object.assign({xlinkHref:s(i)},t.props)),!i&&n("circle",{r:r,fill:"none","stroke-width":2,stroke:"#000"}),!i&&n("circle",{r:r-2,fill:t.fill,"stroke-width":2,stroke:"#fff"}))}function ut(t){var r=t.color,u=vt(t),e=u.width,o=u.height,h=u.radius,c=hr(t,r),l=function(n,t){var u=t.hsv,r,f,e,o;switch(n.sliderType){case"alpha":return r=t.rgb,[[0,"rgba("+r.r+","+r.g+","+r.b+",0)"],[100,"rgb("+r.r+","+r.g+","+r.b+")"]];case"kelvin":for(var c=[],l=n.minTemperature,a=n.maxTemperature,y=a-l,s=l,v=0;s<a;s+=y/8,v+=1){var h=i.kelvinToRgb(s),p=h.r,w=h.g,b=h.b;c.push([12.5*v,"rgb("+p+","+w+","+b+")"])}return c;case"hue":return[[0,"#f00"],[16.666,"#ff0"],[33.333,"#0f0"],[50,"#0ff"],[66.666,"#00f"],[83.333,"#f0f"],[100,"#f00"]];case"saturation":return f=i.hsvToHsl({h:u.h,s:0,v:u.v}),e=i.hsvToHsl({h:u.h,s:100,v:u.v}),[[0,"hsl("+f.h+","+f.s+"%,"+f.l+"%)"],[100,"hsl("+e.h+","+e.s+"%,"+e.l+"%)"]];case"value":default:return o=i.hsvToHsl({h:u.h,s:u.s,v:100}),[[0,"#000"],[100,"hsl("+o.h+","+o.s+"%,"+o.l+"%)"]]}}(t,r),f="alpha"===t.sliderType;return n(k,Object.assign({},t,{onInput:function(n,i,u){var f=function(n,t,i){var u,o=vt(n),f=o.handleRange,s=o.handleStart,r,e;u="horizontal"===n.layoutDirection?-1*i+f+s:t-s;u=Math.max(Math.min(u,f),0);r=Math.round(100/f*u);switch(n.sliderType){case"kelvin":return e=n.minTemperature,e+r/100*(n.maxTemperature-e);case"alpha":return r/100;case"hue":return 3.6*r;default:return r}}(t,n,i);t.parent.inputActive=!0;r[t.sliderType]=f;t.onInput(u)}}),function(i,u,a){return n("svg",Object.assign({},u,{className:"IroSlider",width:e,height:o,style:a}),n("defs",null,n("linearGradient",Object.assign({id:"g"+i},function(n){var t="horizontal"===n.layoutDirection;return{x1:"0%",y1:t?"100%":"0%",x2:t?"0%":"100%",y2:"0%"}}(t)),l.map(function(t){return n("stop",{offset:t[0]+"%","stop-color":t[1]})})),f&&n("pattern",{id:"b"+i,width:"8",height:"8",patternUnits:"userSpaceOnUse"},n("rect",{x:"0",y:"0",width:"8",height:"8",fill:"#fff"}),n("rect",{x:"0",y:"0",width:"4",height:"4",fill:"#ccc"}),n("rect",{x:"4",y:"4",width:"4",height:"4",fill:"#ccc"})),f&&n("pattern",{id:"f"+i,width:"100%",height:"100%"},n("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url("+s("#b"+i)+")"})," }",n("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url("+s("#g"+i)+")"}))),n("rect",{className:"IroSliderBg",rx:h,ry:h,x:t.borderWidth/2,y:t.borderWidth/2,width:e-t.borderWidth,height:o-t.borderWidth,"stroke-width":t.borderWidth,stroke:t.borderColor,fill:"url("+s((f?"#f":"#g")+i)+")"}),n(v,{isActive:!0,index:r.index,r:t.handleRadius,url:t.handleSvg,props:t.handleProps,x:c.x,y:c.y}))})}function cr(t){var u=wt(t),e=u.width,o=u.height,h=u.radius,c=t.colors,f=t.parent,i=t.color,l=function(n,t){return[[[0,"#fff"],[100,"hsl("+t.hue+",100%,50%)"]],[[0,"rgba(0,0,0,0)"],[100,"#000"]]]}(0,i),r=c.map(function(n){return function(n,t){var i=wt(n),o=i.width,s=i.height,r=i.radius,u=t.hsv,f=r,h=o-2*r,e=s-2*r;return{x:f+u.s/100*h,y:f+(e-u.v/100*e)}}(t,n)});return n(k,Object.assign({},t,{onInput:function(n,u,e){if(0===e){var o=pi(t,n,u,r);null!==o?f.setActiveColor(o):(f.inputActive=!0,i.hsv=vi(t,n,u),t.onInput(e))}else 1===e&&(f.inputActive=!0,i.hsv=vi(t,n,u));t.onInput(e)}}),function(u,f,a){return n("svg",Object.assign({},f,{className:"IroBox",width:e,height:o,style:a}),n("defs",null,n("linearGradient",{id:"s"+u,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},l[0].map(function(t){return n("stop",{offset:t[0]+"%","stop-color":t[1]})})),n("linearGradient",{id:"l"+u,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},l[1].map(function(t){return n("stop",{offset:t[0]+"%","stop-color":t[1]})})),n("pattern",{id:"f"+u,width:"100%",height:"100%"},n("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url("+s("#s"+u)+")"})," }",n("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url("+s("#l"+u)+")"}))),n("rect",{rx:h,ry:h,x:t.borderWidth/2,y:t.borderWidth/2,width:e-t.borderWidth,height:o-t.borderWidth,"stroke-width":t.borderWidth,stroke:t.borderColor,fill:"url("+s("#f"+u)+")"}),c.filter(function(n){return n!==i}).map(function(i){return n(v,{isActive:!1,index:i.index,fill:i.hslString,r:t.handleRadius,url:t.handleSvg,props:t.handleProps,x:r[i.index].x,y:r[i.index].y})}),n(v,{isActive:!0,index:i.index,fill:i.hslString,r:t.handleRadius,url:t.handleSvg,props:t.handleProps,x:r[i.index].x,y:r[i.index].y}))})}function bi(t){var f=yt(t),c=f.width,r=f.radius,e=f.cx,o=f.cy,l=t.colors,a=t.borderWidth,h=t.parent,i=t.color,y=i.hsv,u=l.map(function(n){return function(n,t){var i=t.hsv,r=yt(n),o=r.cx,s=r.cy,h=n.width/2-n.padding-n.handleRadius-n.borderWidth,u=(180+pt(n,i.h,!0))*(Math.PI/180),f=i.s/100*h,e="clockwise"===n.wheelDirection?-1:1;return{x:o+f*Math.cos(u)*e,y:s+f*Math.sin(u)*e}}(t,n)});return n(k,Object.assign({},t,{onInput:function(n,r,f){if(0===f){var e=pi(t,n,r,u);null!==e?h.setActiveColor(e):(h.inputActive=!0,i.hsv=ai(t,n,r),t.onInput(f))}else 1===f&&(h.inputActive=!0,i.hsv=ai(t,n,r));t.onInput(f)}}),function(f,h,p){return n("svg",Object.assign({},h,{className:"IroWheel",width:c,height:c,style:p}),n("defs",null,n("radialGradient",{id:f},n("stop",{offset:"0%","stop-color":"#fff"}),n("stop",{offset:"100%","stop-color":"#fff","stop-opacity":"0"}))),n("g",{className:"IroWheelHue","stroke-width":r,fill:"none"},wi.map(function(i){return n("path",{key:i,d:function(n,t,i,r,u){var f=u-r<=180?0:1;return r*=Math.PI/180,u*=Math.PI/180,"M "+(n+i*Math.cos(u))+" "+(t+i*Math.sin(u))+" A "+i+" "+i+" 0 "+f+" 0 "+(n+i*Math.cos(r))+" "+(t+i*Math.sin(r))}(e,o,r/2,i,i+1.5),stroke:"hsl("+pt(t,i)+", 100%, 50%)"})})),n("circle",{className:"IroWheelSaturation",cx:e,cy:o,r:r,fill:"url("+s("#"+f)+")"}),t.wheelLightness&&n("circle",{className:"IroWheelLightness",cx:e,cy:o,r:r,fill:"#000",opacity:1-y.v/100}),n("circle",{className:"IroWheelBorder",cx:e,cy:o,r:r,fill:"none",stroke:t.borderColor,"stroke-width":a}),l.filter(function(n){return n!==i}).map(function(i){return n(v,{isActive:!1,index:i.index,fill:i.hslString,r:t.handleRadius,url:t.handleSvg,props:t.handleProps,x:u[i.index].x,y:u[i.index].y})}),n(v,{isActive:!0,index:i.index,fill:i.hslString,r:t.handleRadius,url:t.handleSvg,props:t.handleProps,x:u[i.index].x,y:u[i.index].y}))})}function et(t,i){function f(){var n=t instanceof Element?t:document.querySelector(t);n.appendChild(u.base);u.onMount(n)}var u,o=document.createElement("div");return function(t,i,u){var f,o,s;r.i&&r.i(t,i);o=(f=u===ni)?null:u&&u.n||i.n;t=n(nt,null,[t]);s=[];at(i,f?i.n=t:(u||i).n=t,o||e,e,void 0!==i.ownerSVGElement,u&&!f?[u]:o?null:st.slice.call(i.childNodes),s,!1,u||e,f);oi(s,t)}(n(ft,Object.assign({},{ref:function(n){return u=n}},i)),o),"loading"!==document.readyState?f():document.addEventListener("DOMContentLoaded",f),u}var r,g,gt,ot,ni,e={},st=[],di=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i,i,t,yi,bt,k,wi,kt,ft,dt,d,w,ki;r={};y.prototype.setState=function(n,t){var i=this.j!==this.state&&this.j||(this.j=o({},this.state));("function"!=typeof n||(n=n(i,this.props)))&&o(i,n);null!=n&&this.p&&(this.u=!1,t&&this.M.push(t),ct(this))};y.prototype.forceUpdate=function(n){this.p&&(n&&this.M.push(n),this.u=!0,ct(this))};y.prototype.render=nt;g=[];gt="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout;ot=r.debounceRendering;r.o=function(n,t){for(var i;t=t.i;)if((i=t.c)&&!i.i)try{if(i.constructor&&null!=i.constructor.getDerivedStateFromError)i.setState(i.constructor.getDerivedStateFromError(n));else{if(null==i.componentDidCatch)continue;i.componentDidCatch(n)}return ct(i.k=i)}catch(t){n=t}throw n;};ni=e;var h="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",ci="[\\s|\\(]+("+h+")[,|\\s]+("+h+")[,|\\s]+("+h+")\\s*\\)?",li="[\\s|\\(]+("+h+")[,|\\s]+("+h+")[,|\\s]+("+h+")[,|\\s]+("+h+")\\s*\\)?",tr=new RegExp("rgb"+ci),ir=new RegExp("rgba"+li),rr=new RegExp("hsl"+ci),ur=new RegExp("hsla"+li),it="^(?:#?|0x?)",c="([0-9a-fA-F]{1})",l="([0-9a-fA-F]{2})",fr=new RegExp(it+c+c+c+"$"),er=new RegExp(it+c+c+c+c+"$"),or=new RegExp(it+l+l+l+"$"),sr=new RegExp(it+l+l+l+l+"$"),rt=Math.log,p=Math.round,b=Math.floor;return i=function(n,t){this.$={h:0,s:0,v:0,a:1};n&&this.set(n);this.onChange=t;this.initialValue=Object.assign({},this.$)},t={hsv:{configurable:!0},hsva:{configurable:!0},hue:{configurable:!0},saturation:{configurable:!0},value:{configurable:!0},alpha:{configurable:!0},kelvin:{configurable:!0},rgb:{configurable:!0},rgba:{configurable:!0},hsl:{configurable:!0},hsla:{configurable:!0},rgbString:{configurable:!0},rgbaString:{configurable:!0},hexString:{configurable:!0},hex8String:{configurable:!0},hslString:{configurable:!0},hslaString:{configurable:!0}},i.prototype.set=function(n){if("string"==typeof n)/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(n)?this.hexString=n:/^rgba?/.test(n)?this.rgbString=n:/^hsla?/.test(n)&&(this.hslString=n);else{if("object"!=typeof n)throw new Error("Invalid color value");n instanceof i?this.hsv=n.hsv:"object"==typeof n&&"r"in n&&"g"in n&&"b"in n?this.rgb=n:"object"==typeof n&&"h"in n&&"s"in n&&"v"in n?this.hsv=n:"object"==typeof n&&"h"in n&&"s"in n&&"l"in n&&(this.hsl=n)}},i.prototype.setChannel=function(n,t,i){var r;this[n]=Object.assign({},this[n],((r={})[t]=i,r))},i.prototype.reset=function(){this.hsva=this.initialValue},i.prototype.clone=function(){return new i(this)},i.prototype.unbind=function(){this.onChange=void 0},i.hsvToRgb=function(n){var o=n.h/60,r=n.s/100,t=n.v/100,s=b(o),h=o-s,i=t*(1-r),u=t*(1-h*r),f=t*(1-(1-h)*r),e=s%6;return{r:255*[t,u,i,i,f,t][e],g:255*[f,t,t,u,i,i][e],b:255*[i,i,f,t,t,u][e]}},i.rgbToHsv=function(n){var r=n.r/255,t=n.g/255,i=n.b/255,u=Math.max(r,t,i),o=Math.min(r,t,i),e=u-o,f=0,s=u,h=0===u?0:e/u;switch(u){case o:f=0;break;case r:f=(t-i)/e+(t<i?6:0);break;case t:f=(i-r)/e+2;break;case i:f=(r-t)/e+4}return{h:60*f,s:100*h,v:100*s}},i.hsvToHsl=function(n){var i=n.s/100,r=n.v/100,t=(2-i)*r,u=t<=1?t:2-t,f=u<1e-9?0:i*r/u;return{h:n.h,s:100*f,l:50*t}},i.hslToHsv=function(n){var t=2*n.l,i=n.s*(t<=100?t:200-t)/100,r=t+i<1e-9?0:2*i/(t+i);return{h:n.h,s:100*r,v:(t+i)/2}},i.kelvinToRgb=function(n){var r,t,u,i=n/100;return u=i<66?(r=255,t=-155.25485562709179-.44596950469579133*(t=i-2)+104.49216199393888*rt(t),i<20?0:.82740960640073946*(u=i-10)-254.76935184120902+115.67994401066147*rt(u)):(r=351.97690566805693+.114206453784165*(r=i-55)-40.253663093321272*rt(r),t=325.4494125711974+.079434565366623425*(t=i-50)-28.0852963507957*rt(t),255),{r:b(r),g:b(t),b:b(u)}},i.rgbToKelvin=function(n){for(var f,t,e=n.r,o=n.b,r=1e3,u=4e4;.4<u-r;)t=.5*(u+r),f=i.kelvinToRgb(t),f.b/f.r>=o/e?u=t:r=t;return t},t.hsv.get=function(){var n=this.$;return{h:n.h,s:n.s,v:n.v}},t.hsv.set=function(n){var r=this.$,t,i;if(n=Object.assign({},r,n),this.onChange){t={h:!1,v:!1,s:!1,a:!1};for(i in r)t[i]=n[i]!=r[i];this.$=n;(t.h||t.s||t.v||t.a)&&this.onChange(this,t)}else this.$=n},t.hsva.get=function(){return Object.assign({},this.$)},t.hsva.set=function(n){this.hsv=n},t.hue.get=function(){return this.$.h},t.hue.set=function(n){this.hsv={h:n}},t.saturation.get=function(){return this.$.s},t.saturation.set=function(n){this.hsv={s:n}},t.value.get=function(){return this.$.v},t.value.set=function(n){this.hsv={v:n}},t.alpha.get=function(){return this.$.a},t.alpha.set=function(n){this.hsv=Object.assign({},this.hsv,{a:n})},t.kelvin.get=function(){return i.rgbToKelvin(this.rgb)},t.kelvin.set=function(n){this.rgb=i.kelvinToRgb(n)},t.rgb.get=function(){var n=i.hsvToRgb(this.$),t=n.r,r=n.g,u=n.b;return{r:p(t),g:p(r),b:p(u)}},t.rgb.set=function(n){this.hsv=Object.assign({},i.rgbToHsv(n),{a:void 0===n.a?1:n.a})},t.rgba.get=function(){return Object.assign({},this.rgb,{a:this.alpha})},t.rgba.set=function(n){this.rgb=n},t.hsl.get=function(){var n=i.hsvToHsl(this.$),t=n.h,r=n.s,u=n.l;return{h:p(t),s:p(r),l:p(u)}},t.hsl.set=function(n){this.hsv=Object.assign({},i.hslToHsv(n),{a:void 0===n.a?1:n.a})},t.hsla.get=function(){return Object.assign({},this.hsl,{a:this.alpha})},t.hsla.set=function(n){this.hsl=n},t.rgbString.get=function(){var n=this.rgb;return"rgb("+n.r+", "+n.g+", "+n.b+")"},t.rgbString.set=function(n){var t,i,r,f,e=1;if((t=tr.exec(n))?(i=u(t[1],255),r=u(t[2],255),f=u(t[3],255)):(t=ir.exec(n))&&(i=u(t[1],255),r=u(t[2],255),f=u(t[3],255),e=u(t[4],1)),!t)throw new Error("Invalid rgb string");this.rgb={r:i,g:r,b:f,a:e}},t.rgbaString.get=function(){var n=this.rgba;return"rgba("+n.r+", "+n.g+", "+n.b+", "+n.a+")"},t.rgbaString.set=function(n){this.rgbString=n},t.hexString.get=function(){var n=this.rgb;return"#"+a(n.r)+a(n.g)+a(n.b)},t.hexString.set=function(n){var t,i,r,u,e=255;if((t=fr.exec(n))?(i=17*f(t[1]),r=17*f(t[2]),u=17*f(t[3])):(t=er.exec(n))?(i=17*f(t[1]),r=17*f(t[2]),u=17*f(t[3]),e=17*f(t[4])):(t=or.exec(n))?(i=f(t[1]),r=f(t[2]),u=f(t[3])):(t=sr.exec(n))&&(i=f(t[1]),r=f(t[2]),u=f(t[3]),e=f(t[4])),!t)throw new Error("Invalid hex string");this.rgb={r:i,g:r,b:u,a:e/255}},t.hex8String.get=function(){var n=this.rgba;return"#"+a(n.r)+a(n.g)+a(n.b)+a(b(255*n.a))},t.hex8String.set=function(n){this.hexString=n},t.hslString.get=function(){var n=this.hsl;return"hsl("+n.h+", "+n.s+"%, "+n.l+"%)"},t.hslString.set=function(n){var t,i,r,f,e=1;if((t=rr.exec(n))?(i=u(t[1],360),r=u(t[2],100),f=u(t[3],100)):(t=ur.exec(n))&&(i=u(t[1],360),r=u(t[2],100),f=u(t[3],100),e=u(t[4],1)),!t)throw new Error("Invalid hsl string");this.hsl={h:i,s:r,l:f,a:e}},t.hslaString.get=function(){var n=this.hsla;return"hsl("+n.h+", "+n.s+"%, "+n.l+"%, "+n.a+")"},t.hslaString.set=function(n){this.hslString=n},Object.defineProperties(i.prototype,t),yi=document.getElementsByTagName("base"),bt=["mousemove","touchmove","mouseup","touchend"],k=function(t){function i(n){t.call(this,n);this.uid=(Math.random()+1).toString(36).substring(5)}return t&&(i.__proto__=t),((i.prototype=Object.create(t&&t.prototype)).constructor=i).prototype.render=function(t){var i=this.handleEvent.bind(this),f={onMouseDown:i,onTouchStart:i},r="horizontal"===t.layoutDirection,e=null===t.margin?t.sliderMargin:t.margin,u={overflow:"visible",display:r?"inline-block":"block"};return 0<t.index&&(u[r?"marginLeft":"marginTop"]=e),n(nt,null,t.children(this.uid,f,u))},i.prototype.handleEvent=function(n){var u=this,t=this.props.onInput,f=this.base.getBoundingClientRect();n.preventDefault();var e=n.touches?n.changedTouches[0]:n,i=e.clientX-f.left,r=e.clientY-f.top;switch(n.type){case"mousedown":case"touchstart":bt.forEach(function(n){document.addEventListener(n,u,{passive:!1})});t(i,r,0);break;case"mousemove":case"touchmove":t(i,r,1);break;case"mouseup":case"touchend":t(i,r,2);bt.forEach(function(n){document.removeEventListener(n,u)})}},i}(y),v.defaultProps={fill:"none",x:0,y:0,r:8,url:null,props:{x:0,y:0}},ut.defaultProps=Object.assign({},{sliderShape:"bar",sliderType:"value",minTemperature:2200,maxTemperature:11e3}),wi=Array.apply(null,{length:360}).map(function(n,t){return t}),kt=function(t){function r(n){var i=this;t.call(this,n);this.colors=[];this.inputActive=!1;this.events={};this.activeEvents={};this.deferredEvents={};this.id=n.id;(0<n.colors.length?n.colors:[n.color]).forEach(function(n){return i.addColor(n)});this.setActiveColor(0);this.state=Object.assign({},n,{color:this.color,colors:this.colors,layout:n.layout})}return t&&(r.__proto__=t),((r.prototype=Object.create(t&&t.prototype)).constructor=r).prototype.addColor=function(n,t){void 0===t&&(t=this.colors.length);var r=new i(n,this.onColorChange.bind(this));this.colors.splice(t,0,r);this.colors.forEach(function(n,t){return n.index=t});this.state&&this.setState({colors:this.colors});this.deferredEmit("color:init",r)},r.prototype.removeColor=function(n){var t=this.colors.splice(n,1)[0];t.unbind();this.colors.forEach(function(n,t){return n.index=t});this.state&&this.setState({colors:this.colors});t.index===this.color.index&&this.setActiveColor(0);this.emit("color:remove",t)},r.prototype.setActiveColor=function(n){this.color=this.colors[n];this.state&&this.setState({color:this.color});this.emit("color:setActive",this.color)},r.prototype.setColors=function(n){var t=this;this.colors.forEach(function(n){return n.unbind()});this.colors=[];n.forEach(function(n){return t.addColor(n)});this.setActiveColor(0);this.emit("color:setAll",this.colors)},r.prototype.on=function(n,t){var i=this,r=this.events;(Array.isArray(n)?n:[n]).forEach(function(n){(r[n]||(r[n]=[])).push(t);i.deferredEvents[n]&&(i.deferredEvents[n].forEach(function(n){t.apply(null,n)}),i.deferredEvents[n]=[])})},r.prototype.off=function(n,t){var i=this;(Array.isArray(n)?n:[n]).forEach(function(n){var r=i.events[n];r&&r.splice(r.indexOf(t),1)})},r.prototype.emit=function(n){for(var t,u=this,r=[],i=arguments.length-1;0<i--;)r[i]=arguments[i+1];t=this.activeEvents;!!t.hasOwnProperty(n)&&t[n]||(t[n]=!0,(this.events[n]||[]).forEach(function(n){return n.apply(u,r)}),t[n]=!1)},r.prototype.deferredEmit=function(n){for(var u,r,t=[],i=arguments.length-1;0<i--;)t[i]=arguments[i+1];r=this.deferredEvents;(u=this).emit.apply(u,[n].concat(t));(r[n]||(r[n]=[])).push(t)},r.prototype.setOptions=function(n){this.setState(Object.assign({},this.state,n))},r.prototype.resize=function(n){this.setOptions({width:n})},r.prototype.reset=function(){this.colors.forEach(function(n){return n.reset()});this.setState({colors:this.colors})},r.prototype.onMount=function(n){this.el=n;this.deferredEmit("mount",this)},r.prototype.onColorChange=function(n,t){this.setState({color:this.color});this.inputActive&&(this.inputActive=!1,this.emit("input:change",n,t));this.emit("color:change",n,t)},r.prototype.emitInputEvent=function(n){0===n?this.emit("input:start",this.color):1===n?this.emit("input:move",this.color):2===n&&this.emit("input:end",this.color)},r.prototype.render=function(t,i){var u=this,r=i.layout;return Array.isArray(r)||(r=[{component:bi},{component:ut}],i.transparency&&r.push({component:ut,options:{sliderType:"alpha"}})),n("div",{"class":"IroColorPicker",id:i.id,style:{display:i.display}},r.map(function(t,r){var f=t.component,e=t.options;return n(f,Object.assign({},i,e,{ref:void 0,onInput:u.emitInputEvent.bind(u),parent:u,index:r}))}))},r}(y),kt.defaultProps=Object.assign({},{width:300,height:300,handleRadius:8,handleSvg:null,handleProps:{x:0,y:0},color:"#fff",colors:[],borderColor:"#fff",borderWidth:0,wheelLightness:!0,wheelAngle:0,wheelDirection:"anticlockwise",layoutDirection:"vertical",sliderSize:null,sliderMargin:12,padding:6},{colors:[],display:"block",id:null,layout:"default",margin:null}),ki=(et.prototype=(ft=kt).prototype,Object.assign(et,ft),et.A=ft,et),(d=dt=dt||{}).version="5.1.8",d.Color=i,d.ColorPicker=ki,(w=d.ui||(d.ui={})).h=n,w.ComponentBase=k,w.Handle=v,w.Slider=ut,w.Wheel=bi,w.Box=cr,dt})