amis-playground
Version:
amis-playground 是一个amis在线代码编辑器可实时预览运行效果
27 lines (26 loc) • 125 kB
JavaScript
import{e9 as Tn,ea as Pn,eb as $n,ec as Mn,ed as kn,ee as Fn,ch as T,R as s,ef as g,a as Bn,I as qt,O as Hn,a5 as Yt,P as Nn,a4 as Le,bg as Dn,f as Ln,p as jn,q as nt,bu as In,bv as Gn,eg as zn}from"./index-7c288cb3.js";var F={},Me={},Un=Tn,Wn=Pn;function Vn(t,e){return t&&Un(t,Wn(e))}var mt=Vn;Object.defineProperty(Me,"__esModule",{value:!0});Me.flattenNames=void 0;var Xn=$n,Kn=qe(Xn),qn=mt,Yn=qe(qn),Zn=Mn,Jn=qe(Zn),Qn=kn,ea=qe(Qn);function qe(t){return t&&t.__esModule?t:{default:t}}var ta=Me.flattenNames=function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[];return(0,ea.default)(e,function(n){Array.isArray(n)?t(n).map(function(a){return r.push(a)}):(0,Jn.default)(n)?(0,Yn.default)(n,function(a,i){a===!0&&r.push(i),r.push(i+"-"+a)}):(0,Kn.default)(n)&&r.push(n)}),r};Me.default=ta;var ke={};Object.defineProperty(ke,"__esModule",{value:!0});ke.mergeClasses=void 0;var ra=mt,na=qr(ra),aa=Fn,ia=qr(aa),oa=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function qr(t){return t&&t.__esModule?t:{default:t}}var la=ke.mergeClasses=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e.default&&(0,ia.default)(e.default)||{};return r.map(function(a){var i=e[a];return i&&(0,na.default)(i,function(o,l){n[l]||(n[l]={}),n[l]=oa({},n[l],i[l])}),a}),n};ke.default=la;var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.autoprefix=void 0;var sa=mt,Zt=ca(sa),ua=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t};function ca(t){return t&&t.__esModule?t:{default:t}}var fa={borderRadius:function(e){return{msBorderRadius:e,MozBorderRadius:e,OBorderRadius:e,WebkitBorderRadius:e,borderRadius:e}},boxShadow:function(e){return{msBoxShadow:e,MozBoxShadow:e,OBoxShadow:e,WebkitBoxShadow:e,boxShadow:e}},userSelect:function(e){return{WebkitTouchCallout:e,KhtmlUserSelect:e,MozUserSelect:e,msUserSelect:e,WebkitUserSelect:e,userSelect:e}},flex:function(e){return{WebkitBoxFlex:e,MozBoxFlex:e,WebkitFlex:e,msFlex:e,flex:e}},flexBasis:function(e){return{WebkitFlexBasis:e,flexBasis:e}},justifyContent:function(e){return{WebkitJustifyContent:e,justifyContent:e}},transition:function(e){return{msTransition:e,MozTransition:e,OTransition:e,WebkitTransition:e,transition:e}},transform:function(e){return{msTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e}},absolute:function(e){var r=e&&e.split(" ");return{position:"absolute",top:r&&r[0],right:r&&r[1],bottom:r&&r[2],left:r&&r[3]}},extend:function(e,r){var n=r[e];return n||{extend:e}}},ha=Fe.autoprefix=function(e){var r={};return(0,Zt.default)(e,function(n,a){var i={};(0,Zt.default)(n,function(o,l){var u=fa[l];u?i=ua({},i,u(o)):i[l]=o}),r[a]=i}),r};Fe.default=ha;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.hover=void 0;var pa=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},da=T,at=ga(da);function ga(t){return t&&t.__esModule?t:{default:t}}function ba(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function va(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var xa=Be.hover=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(n){va(a,n);function a(){var i,o,l,u;ba(this,a);for(var c=arguments.length,f=Array(c),h=0;h<c;h++)f[h]=arguments[h];return u=(o=(l=Jt(this,(i=a.__proto__||Object.getPrototypeOf(a)).call.apply(i,[this].concat(f))),l),l.state={hover:!1},l.handleMouseOver=function(){return l.setState({hover:!0})},l.handleMouseOut=function(){return l.setState({hover:!1})},l.render=function(){return at.default.createElement(r,{onMouseOver:l.handleMouseOver,onMouseOut:l.handleMouseOut},at.default.createElement(e,pa({},l.props,l.state)))},o),Jt(l,u)}return a}(at.default.Component)};Be.default=xa;var He={};Object.defineProperty(He,"__esModule",{value:!0});He.active=void 0;var ma=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ya=T,it=wa(ya);function wa(t){return t&&t.__esModule?t:{default:t}}function Ea(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Ca(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Sa=He.active=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(n){Ca(a,n);function a(){var i,o,l,u;Ea(this,a);for(var c=arguments.length,f=Array(c),h=0;h<c;h++)f[h]=arguments[h];return u=(o=(l=Qt(this,(i=a.__proto__||Object.getPrototypeOf(a)).call.apply(i,[this].concat(f))),l),l.state={active:!1},l.handleMouseDown=function(){return l.setState({active:!0})},l.handleMouseUp=function(){return l.setState({active:!1})},l.render=function(){return it.default.createElement(r,{onMouseDown:l.handleMouseDown,onMouseUp:l.handleMouseUp},it.default.createElement(e,ma({},l.props,l.state)))},o),Qt(l,u)}return a}(it.default.Component)};He.default=Sa;var yt={};Object.defineProperty(yt,"__esModule",{value:!0});var _a=function(e,r){var n={},a=function(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n[o]=l};return e===0&&a("first-child"),e===r-1&&a("last-child"),(e===0||e%2===0)&&a("even"),Math.abs(e%2)===1&&a("odd"),a("nth-child",e),n};yt.default=_a;Object.defineProperty(F,"__esModule",{value:!0});F.ReactCSS=F.loop=F.handleActive=wt=F.handleHover=F.hover=void 0;var Oa=Me,Ra=xe(Oa),Aa=ke,Ta=xe(Aa),Pa=Fe,$a=xe(Pa),Ma=Be,Yr=xe(Ma),ka=He,Fa=xe(ka),Ba=yt,Ha=xe(Ba);function xe(t){return t&&t.__esModule?t:{default:t}}F.hover=Yr.default;var wt=F.handleHover=Yr.default;F.handleActive=Fa.default;F.loop=Ha.default;var Na=F.ReactCSS=function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];var i=(0,Ra.default)(n),o=(0,Ta.default)(e,i);return(0,$a.default)(o)},y=F.default=Na,Da=function(e,r,n,a,i){var o=i.clientWidth,l=i.clientHeight,u=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,c=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,f=u-(i.getBoundingClientRect().left+window.pageXOffset),h=c-(i.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var p=void 0;if(h<0?p=0:h>l?p=1:p=Math.round(h*100/l)/100,r.a!==p)return{h:r.h,s:r.s,l:r.l,a:p,source:"rgb"}}else{var d=void 0;if(f<0?d=0:f>o?d=1:d=Math.round(f*100/o)/100,a!==d)return{h:r.h,s:r.s,l:r.l,a:d,source:"rgb"}}return null},ot={},La=function(e,r,n,a){if(typeof document>"u"&&!a)return null;var i=a?new a:document.createElement("canvas");i.width=n*2,i.height=n*2;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=r,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),i.toDataURL()):null},ja=function(e,r,n,a){var i=e+"-"+r+"-"+n+(a?"-server":"");if(ot[i])return ot[i];var o=La(e,r,n,a);return ot[i]=o,o},er=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},me=function(e){var r=e.white,n=e.grey,a=e.size,i=e.renderers,o=e.borderRadius,l=e.boxShadow,u=e.children,c=y({default:{grid:{borderRadius:o,boxShadow:l,absolute:"0px 0px 0px 0px",background:"url("+ja(r,n,a,i.canvas)+") center left"}}});return T.isValidElement(u)?s.cloneElement(u,er({},u.props,{style:er({},u.props.style,c.grid)})):s.createElement("div",{style:c.grid})};me.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var Ia=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ga=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function za(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function Ua(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Et=function(t){Ua(e,t);function e(){var r,n,a,i;za(this,e);for(var o=arguments.length,l=Array(o),u=0;u<o;u++)l[u]=arguments[u];return i=(n=(a=tr(this,(r=e.__proto__||Object.getPrototypeOf(e)).call.apply(r,[this].concat(l))),a),a.handleChange=function(c){var f=Da(c,a.props.hsl,a.props.direction,a.props.a,a.container);f&&typeof a.props.onChange=="function"&&a.props.onChange(f,c)},a.handleMouseDown=function(c){a.handleChange(c),window.addEventListener("mousemove",a.handleChange),window.addEventListener("mouseup",a.handleMouseUp)},a.handleMouseUp=function(){a.unbindEventListeners()},a.unbindEventListeners=function(){window.removeEventListener("mousemove",a.handleChange),window.removeEventListener("mouseup",a.handleMouseUp)},n),tr(a,i)}return Ga(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var n=this,a=this.props.rgb,i=y({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+a.r+","+a.g+","+a.b+`, 0) 0%,
rgba(`+a.r+","+a.g+","+a.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:a.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+a.r+","+a.g+","+a.b+`, 0) 0%,
rgba(`+a.r+","+a.g+","+a.b+", 1) 100%)"},pointer:{left:0,top:a.a*100+"%"}},overwrite:Ia({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return s.createElement("div",{style:i.alpha},s.createElement("div",{style:i.checkboard},s.createElement(me,{renderers:this.props.renderers})),s.createElement("div",{style:i.gradient}),s.createElement("div",{style:i.container,ref:function(l){return n.container=l},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("div",{style:i.pointer},this.props.pointer?s.createElement(this.props.pointer,this.props):s.createElement("div",{style:i.slider}))))}}]),e}(T.PureComponent||T.Component),Wa=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function Va(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ka(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function qa(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var Ya=1,Zr=38,Za=40,Ja=[Zr,Za],Qa=function(e){return Ja.indexOf(e)>-1},ei=function(e){return Number(String(e).replace(/%/g,""))},ti=1,w=function(t){qa(e,t);function e(r){Xa(this,e);var n=Ka(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(a){n.setUpdatedValue(a.target.value,a)},n.handleKeyDown=function(a){var i=ei(a.target.value);if(!isNaN(i)&&Qa(a.keyCode)){var o=n.getArrowOffset(),l=a.keyCode===Zr?i+o:i-o;n.setUpdatedValue(l,a)}},n.handleDrag=function(a){if(n.props.dragLabel){var i=Math.round(n.props.value+a.movementX);i>=0&&i<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(i),a)}},n.handleMouseDown=function(a){n.props.dragLabel&&(a.preventDefault(),n.handleDrag(a),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(r.value).toUpperCase(),blurValue:String(r.value).toUpperCase()},n.inputId="rc-editable-input-"+ti++,n}return Wa(e,[{key:"componentDidUpdate",value:function(n,a){this.props.value!==this.state.value&&(n.value!==this.props.value||a.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(n){return Va({},this.props.label,n)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||Ya}},{key:"setUpdatedValue",value:function(n,a){var i=this.props.label?this.getValueObjectWithLabel(n):n;this.props.onChange&&this.props.onChange(i,a),this.setState({value:n})}},{key:"render",value:function(){var n=this,a=y({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return s.createElement("div",{style:a.wrap},s.createElement("input",{id:this.inputId,style:a.input,ref:function(o){return n.input=o},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?s.createElement("label",{htmlFor:this.inputId,style:a.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(T.PureComponent||T.Component),ri=function(e,r,n,a){var i=a.clientWidth,o=a.clientHeight,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,u=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(a.getBoundingClientRect().left+window.pageXOffset),f=u-(a.getBoundingClientRect().top+window.pageYOffset);if(r==="vertical"){var h=void 0;if(f<0)h=359;else if(f>o)h=0;else{var p=-(f*100/o)+100;h=360*p/100}if(n.h!==h)return{h,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var d=void 0;if(c<0)d=0;else if(c>i)d=359;else{var v=c*100/i;d=360*v/100}if(n.h!==d)return{h:d,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null},ni=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function ai(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function ii(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var ye=function(t){ii(e,t);function e(){var r,n,a,i;ai(this,e);for(var o=arguments.length,l=Array(o),u=0;u<o;u++)l[u]=arguments[u];return i=(n=(a=rr(this,(r=e.__proto__||Object.getPrototypeOf(e)).call.apply(r,[this].concat(l))),a),a.handleChange=function(c){var f=ri(c,a.props.direction,a.props.hsl,a.container);f&&typeof a.props.onChange=="function"&&a.props.onChange(f,c)},a.handleMouseDown=function(c){a.handleChange(c),window.addEventListener("mousemove",a.handleChange),window.addEventListener("mouseup",a.handleMouseUp)},a.handleMouseUp=function(){a.unbindEventListeners()},n),rr(a,i)}return ni(e,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var n=this,a=this.props.direction,i=a===void 0?"horizontal":a,o=y({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:i==="vertical"});return s.createElement("div",{style:o.hue},s.createElement("div",{className:"hue-"+i,style:o.container,ref:function(u){return n.container=u},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("style",null,`
.hue-horizontal {
background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
background: -webkit-linear-gradient(to right, #f00 0%, #ff0
17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
.hue-vertical {
background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,
#0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,
#0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
}
`),s.createElement("div",{style:o.pointer},this.props.pointer?s.createElement(this.props.pointer,this.props):s.createElement("div",{style:o.slider}))))}}]),e}(T.PureComponent||T.Component);function oi(){this.__data__=[],this.size=0}function Ne(t,e){return t===e||t!==t&&e!==e}function Ye(t,e){for(var r=t.length;r--;)if(Ne(t[r][0],e))return r;return-1}var li=Array.prototype,si=li.splice;function ui(t){var e=this.__data__,r=Ye(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():si.call(e,r,1),--this.size,!0}function ci(t){var e=this.__data__,r=Ye(e,t);return r<0?void 0:e[r][1]}function fi(t){return Ye(this.__data__,t)>-1}function hi(t,e){var r=this.__data__,n=Ye(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function z(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}z.prototype.clear=oi;z.prototype.delete=ui;z.prototype.get=ci;z.prototype.has=fi;z.prototype.set=hi;function pi(){this.__data__=new z,this.size=0}function di(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function gi(t){return this.__data__.get(t)}function bi(t){return this.__data__.has(t)}var vi=typeof global=="object"&&global&&global.Object===Object&&global;const Jr=vi;var xi=typeof self=="object"&&self&&self.Object===Object&&self,mi=Jr||xi||Function("return this")();const D=mi;var yi=D.Symbol;const W=yi;var Qr=Object.prototype,wi=Qr.hasOwnProperty,Ei=Qr.toString,Ce=W?W.toStringTag:void 0;function Ci(t){var e=wi.call(t,Ce),r=t[Ce];try{t[Ce]=void 0;var n=!0}catch{}var a=Ei.call(t);return n&&(e?t[Ce]=r:delete t[Ce]),a}var Si=Object.prototype,_i=Si.toString;function Oi(t){return _i.call(t)}var Ri="[object Null]",Ai="[object Undefined]",nr=W?W.toStringTag:void 0;function Y(t){return t==null?t===void 0?Ai:Ri:nr&&nr in Object(t)?Ci(t):Oi(t)}function B(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ti="[object AsyncFunction]",Pi="[object Function]",$i="[object GeneratorFunction]",Mi="[object Proxy]";function Ct(t){if(!B(t))return!1;var e=Y(t);return e==Pi||e==$i||e==Ti||e==Mi}var ki=D["__core-js_shared__"];const lt=ki;var ar=function(){var t=/[^.]+$/.exec(lt&<.keys&<.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Fi(t){return!!ar&&ar in t}var Bi=Function.prototype,Hi=Bi.toString;function Z(t){if(t!=null){try{return Hi.call(t)}catch{}try{return t+""}catch{}}return""}var Ni=/[\\^$.*+?()[\]{}|]/g,Di=/^\[object .+?Constructor\]$/,Li=Function.prototype,ji=Object.prototype,Ii=Li.toString,Gi=ji.hasOwnProperty,zi=RegExp("^"+Ii.call(Gi).replace(Ni,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ui(t){if(!B(t)||Fi(t))return!1;var e=Ct(t)?zi:Di;return e.test(Z(t))}function Wi(t,e){return t==null?void 0:t[e]}function J(t,e){var r=Wi(t,e);return Ui(r)?r:void 0}var Vi=J(D,"Map");const Pe=Vi;var Xi=J(Object,"create");const $e=Xi;function Ki(){this.__data__=$e?$e(null):{},this.size=0}function qi(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Yi="__lodash_hash_undefined__",Zi=Object.prototype,Ji=Zi.hasOwnProperty;function Qi(t){var e=this.__data__;if($e){var r=e[t];return r===Yi?void 0:r}return Ji.call(e,t)?e[t]:void 0}var eo=Object.prototype,to=eo.hasOwnProperty;function ro(t){var e=this.__data__;return $e?e[t]!==void 0:to.call(e,t)}var no="__lodash_hash_undefined__";function ao(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=$e&&e===void 0?no:e,this}function q(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}q.prototype.clear=Ki;q.prototype.delete=qi;q.prototype.get=Qi;q.prototype.has=ro;q.prototype.set=ao;function io(){this.size=0,this.__data__={hash:new q,map:new(Pe||z),string:new q}}function oo(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ze(t,e){var r=t.__data__;return oo(e)?r[typeof e=="string"?"string":"hash"]:r.map}function lo(t){var e=Ze(this,t).delete(t);return this.size-=e?1:0,e}function so(t){return Ze(this,t).get(t)}function uo(t){return Ze(this,t).has(t)}function co(t,e){var r=Ze(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function U(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}U.prototype.clear=io;U.prototype.delete=lo;U.prototype.get=so;U.prototype.has=uo;U.prototype.set=co;var fo=200;function ho(t,e){var r=this.__data__;if(r instanceof z){var n=r.__data__;if(!Pe||n.length<fo-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new U(n)}return r.set(t,e),this.size=r.size,this}function j(t){var e=this.__data__=new z(t);this.size=e.size}j.prototype.clear=pi;j.prototype.delete=di;j.prototype.get=gi;j.prototype.has=bi;j.prototype.set=ho;var po=function(){try{var t=J(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ze=po;function St(t,e,r){e=="__proto__"&&ze?ze(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function ht(t,e,r){(r!==void 0&&!Ne(t[e],r)||r===void 0&&!(e in t))&&St(t,e,r)}function go(t){return function(e,r,n){for(var a=-1,i=Object(e),o=n(e),l=o.length;l--;){var u=o[t?l:++a];if(r(i[u],u,i)===!1)break}return e}}var bo=go();const en=bo;var tn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ir=tn&&typeof module=="object"&&module&&!module.nodeType&&module,vo=ir&&ir.exports===tn,or=vo?D.Buffer:void 0,lr=or?or.allocUnsafe:void 0;function xo(t,e){if(e)return t.slice();var r=t.length,n=lr?lr(r):new t.constructor(r);return t.copy(n),n}var mo=D.Uint8Array;const Ue=mo;function yo(t){var e=new t.constructor(t.byteLength);return new Ue(e).set(new Ue(t)),e}function wo(t,e){var r=e?yo(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Eo(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var sr=Object.create,Co=function(){function t(){}return function(e){if(!B(e))return{};if(sr)return sr(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();const So=Co;function rn(t,e){return function(r){return t(e(r))}}var _o=rn(Object.getPrototypeOf,Object);const nn=_o;var Oo=Object.prototype;function _t(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Oo;return t===r}function Ro(t){return typeof t.constructor=="function"&&!_t(t)?So(nn(t)):{}}function V(t){return t!=null&&typeof t=="object"}var Ao="[object Arguments]";function ur(t){return V(t)&&Y(t)==Ao}var an=Object.prototype,To=an.hasOwnProperty,Po=an.propertyIsEnumerable,$o=ur(function(){return arguments}())?ur:function(t){return V(t)&&To.call(t,"callee")&&!Po.call(t,"callee")};const We=$o;var Mo=Array.isArray;const k=Mo;var ko=9007199254740991;function Ot(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ko}function we(t){return t!=null&&Ot(t.length)&&!Ct(t)}function Fo(t){return V(t)&&we(t)}function Bo(){return!1}var on=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cr=on&&typeof module=="object"&&module&&!module.nodeType&&module,Ho=cr&&cr.exports===on,fr=Ho?D.Buffer:void 0,No=fr?fr.isBuffer:void 0,Do=No||Bo;const Ve=Do;var Lo="[object Object]",jo=Function.prototype,Io=Object.prototype,ln=jo.toString,Go=Io.hasOwnProperty,zo=ln.call(Object);function Uo(t){if(!V(t)||Y(t)!=Lo)return!1;var e=nn(t);if(e===null)return!0;var r=Go.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&ln.call(r)==zo}var Wo="[object Arguments]",Vo="[object Array]",Xo="[object Boolean]",Ko="[object Date]",qo="[object Error]",Yo="[object Function]",Zo="[object Map]",Jo="[object Number]",Qo="[object Object]",el="[object RegExp]",tl="[object Set]",rl="[object String]",nl="[object WeakMap]",al="[object ArrayBuffer]",il="[object DataView]",ol="[object Float32Array]",ll="[object Float64Array]",sl="[object Int8Array]",ul="[object Int16Array]",cl="[object Int32Array]",fl="[object Uint8Array]",hl="[object Uint8ClampedArray]",pl="[object Uint16Array]",dl="[object Uint32Array]",S={};S[ol]=S[ll]=S[sl]=S[ul]=S[cl]=S[fl]=S[hl]=S[pl]=S[dl]=!0;S[Wo]=S[Vo]=S[al]=S[Xo]=S[il]=S[Ko]=S[qo]=S[Yo]=S[Zo]=S[Jo]=S[Qo]=S[el]=S[tl]=S[rl]=S[nl]=!1;function gl(t){return V(t)&&Ot(t.length)&&!!S[Y(t)]}function bl(t){return function(e){return t(e)}}var sn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Te=sn&&typeof module=="object"&&module&&!module.nodeType&&module,vl=Te&&Te.exports===sn,st=vl&&Jr.process,xl=function(){try{var t=Te&&Te.require&&Te.require("util").types;return t||st&&st.binding&&st.binding("util")}catch{}}();const hr=xl;var pr=hr&&hr.isTypedArray,ml=pr?bl(pr):gl;const Rt=ml;function pt(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var yl=Object.prototype,wl=yl.hasOwnProperty;function El(t,e,r){var n=t[e];(!(wl.call(t,e)&&Ne(n,r))||r===void 0&&!(e in t))&&St(t,e,r)}function Cl(t,e,r,n){var a=!r;r||(r={});for(var i=-1,o=e.length;++i<o;){var l=e[i],u=n?n(r[l],t[l],l,r,t):void 0;u===void 0&&(u=t[l]),a?St(r,l,u):El(r,l,u)}return r}function Sl(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var _l=9007199254740991,Ol=/^(?:0|[1-9]\d*)$/;function At(t,e){var r=typeof t;return e=e??_l,!!e&&(r=="number"||r!="symbol"&&Ol.test(t))&&t>-1&&t%1==0&&t<e}var Rl=Object.prototype,Al=Rl.hasOwnProperty;function un(t,e){var r=k(t),n=!r&&We(t),a=!r&&!n&&Ve(t),i=!r&&!n&&!a&&Rt(t),o=r||n||a||i,l=o?Sl(t.length,String):[],u=l.length;for(var c in t)(e||Al.call(t,c))&&!(o&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||At(c,u)))&&l.push(c);return l}function Tl(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Pl=Object.prototype,$l=Pl.hasOwnProperty;function Ml(t){if(!B(t))return Tl(t);var e=_t(t),r=[];for(var n in t)n=="constructor"&&(e||!$l.call(t,n))||r.push(n);return r}function cn(t){return we(t)?un(t,!0):Ml(t)}function kl(t){return Cl(t,cn(t))}function Fl(t,e,r,n,a,i,o){var l=pt(t,r),u=pt(e,r),c=o.get(u);if(c){ht(t,r,c);return}var f=i?i(l,u,r+"",t,e,o):void 0,h=f===void 0;if(h){var p=k(u),d=!p&&Ve(u),v=!p&&!d&&Rt(u);f=u,p||d||v?k(l)?f=l:Fo(l)?f=Eo(l):d?(h=!1,f=xo(u,!0)):v?(h=!1,f=wo(u,!0)):f=[]:Uo(u)||We(u)?(f=l,We(l)?f=kl(l):(!B(l)||Ct(l))&&(f=Ro(u))):h=!1}h&&(o.set(u,f),a(f,u,n,i,o),o.delete(u)),ht(t,r,f)}function fn(t,e,r,n,a){t!==e&&en(e,function(i,o){if(a||(a=new j),B(i))Fl(t,e,o,r,fn,n,a);else{var l=n?n(pt(t,o),i,o+"",t,e,a):void 0;l===void 0&&(l=i),ht(t,o,l)}},cn)}function Je(t){return t}function Bl(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var dr=Math.max;function Hl(t,e,r){return e=dr(e===void 0?t.length-1:e,0),function(){for(var n=arguments,a=-1,i=dr(n.length-e,0),o=Array(i);++a<i;)o[a]=n[e+a];a=-1;for(var l=Array(e+1);++a<e;)l[a]=n[a];return l[e]=r(o),Bl(t,this,l)}}function Nl(t){return function(){return t}}var Dl=ze?function(t,e){return ze(t,"toString",{configurable:!0,enumerable:!1,value:Nl(e),writable:!0})}:Je;const Ll=Dl;var jl=800,Il=16,Gl=Date.now;function zl(t){var e=0,r=0;return function(){var n=Gl(),a=Il-(n-r);if(r=n,a>0){if(++e>=jl)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Ul=zl(Ll);const Wl=Ul;function Vl(t,e){return Wl(Hl(t,e,Je),t+"")}function Xl(t,e,r){if(!B(r))return!1;var n=typeof e;return(n=="number"?we(r)&&At(e,r.length):n=="string"&&e in r)?Ne(r[e],t):!1}function Kl(t){return Vl(function(e,r){var n=-1,a=r.length,i=a>1?r[a-1]:void 0,o=a>2?r[2]:void 0;for(i=t.length>3&&typeof i=="function"?(a--,i):void 0,o&&Xl(r[0],r[1],o)&&(i=a<3?void 0:i,a=1),e=Object(e);++n<a;){var l=r[n];l&&t(e,l,n,i)}return e})}var ql=Kl(function(t,e,r){fn(t,e,r)});const P=ql;var De=function(e){var r=e.zDepth,n=e.radius,a=e.background,i=e.children,o=e.styles,l=o===void 0?{}:o,u=y(P({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+r+"px "+r*4+"px rgba(0,0,0,.24)",borderRadius:n,background:a}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},l),{"zDepth-1":r===1});return s.createElement("div",{style:u.wrap},s.createElement("div",{style:u.bg}),s.createElement("div",{style:u.content},i))};De.propTypes={background:g.string,zDepth:g.oneOf([0,1,2,3,4,5]),radius:g.number,styles:g.object};De.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}};var Yl=function(){return D.Date.now()};const ut=Yl;var Zl=/\s/;function Jl(t){for(var e=t.length;e--&&Zl.test(t.charAt(e)););return e}var Ql=/^\s+/;function es(t){return t&&t.slice(0,Jl(t)+1).replace(Ql,"")}var ts="[object Symbol]";function Qe(t){return typeof t=="symbol"||V(t)&&Y(t)==ts}var gr=0/0,rs=/^[-+]0x[0-9a-f]+$/i,ns=/^0b[01]+$/i,as=/^0o[0-7]+$/i,is=parseInt;function br(t){if(typeof t=="number")return t;if(Qe(t))return gr;if(B(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=B(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=es(t);var r=ns.test(t);return r||as.test(t)?is(t.slice(2),r?2:8):rs.test(t)?gr:+t}var os="Expected a function",ls=Math.max,ss=Math.min;function hn(t,e,r){var n,a,i,o,l,u,c=0,f=!1,h=!1,p=!0;if(typeof t!="function")throw new TypeError(os);e=br(e)||0,B(r)&&(f=!!r.leading,h="maxWait"in r,i=h?ls(br(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p);function d(O){var C=n,Ee=a;return n=a=void 0,c=O,o=t.apply(Ee,C),o}function v(O){return c=O,l=setTimeout(E,e),f?d(O):o}function b(O){var C=O-u,Ee=O-c,Kt=e-C;return h?ss(Kt,i-Ee):Kt}function m(O){var C=O-u,Ee=O-c;return u===void 0||C>=e||C<0||h&&Ee>=i}function E(){var O=ut();if(m(O))return R(O);l=setTimeout(E,b(O))}function R(O){return l=void 0,p&&n?d(O):(n=a=void 0,o)}function I(){l!==void 0&&clearTimeout(l),c=0,n=u=a=l=void 0}function A(){return l===void 0?o:R(ut())}function L(){var O=ut(),C=m(O);if(n=arguments,a=this,u=O,C){if(l===void 0)return v(u);if(h)return clearTimeout(l),l=setTimeout(E,e),d(u)}return l===void 0&&(l=setTimeout(E,e)),o}return L.cancel=I,L.flush=A,L}var us="Expected a function";function cs(t,e,r){var n=!0,a=!0;if(typeof t!="function")throw new TypeError(us);return B(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),hn(t,e,{leading:n,maxWait:e,trailing:a})}var fs=function(e,r,n){var a=n.getBoundingClientRect(),i=a.width,o=a.height,l=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,u=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=l-(n.getBoundingClientRect().left+window.pageXOffset),f=u-(n.getBoundingClientRect().top+window.pageYOffset);c<0?c=0:c>i&&(c=i),f<0?f=0:f>o&&(f=o);var h=c/i,p=1-f/o;return{h:r.h,s:h,v:p,a:r.a,source:"hsv"}},hs=function(){function t(e,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}();function ps(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ds(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t}function gs(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var et=function(t){gs(e,t);function e(r){ps(this,e);var n=ds(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,r));return n.handleChange=function(a){typeof n.props.onChange=="function"&&n.throttle(n.props.onChange,fs(a,n.props.hsl,n.container),a)},n.handleMouseDown=function(a){n.handleChange(a);var i=n.getContainerRenderWindow();i.addEventListener("mousemove",n.handleChange),i.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=cs(function(a,i,o){a(i,o)},50),n}return hs(e,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var n=this.container,a=window;!a.document.contains(n)&&a.parent!==a;)a=a.parent;return a}},{key:"unbindEventListeners",value:function(){var n=this.getContainerRenderWindow();n.removeEventListener("mousemove",this.handleChange),n.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var n=this,a=this.props.style||{},i=a.color,o=a.white,l=a.black,u=a.pointer,c=a.circle,f=y({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-(this.props.hsv.v*100)+100+"%",left:this.props.hsv.s*100+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:`0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),
0 0 1px 2px rgba(0,0,0,.4)`,borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:i,white:o,black:l,pointer:u,circle:c}},{custom:!!this.props.style});return s.createElement("div",{style:f.color,ref:function(p){return n.container=p},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},s.createElement("style",null,`
.saturation-white {
background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}
.saturation-black {
background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
background: linear-gradient(to top, #000, rgba(0,0,0,0));
}
`),s.createElement("div",{style:f.white,className:"saturation-white"},s.createElement("div",{style:f.black,className:"saturation-black"}),s.createElement("div",{style:f.pointer},this.props.pointer?s.createElement(this.props.pointer,this.props):s.createElement("div",{style:f.circle}))))}}]),e}(T.PureComponent||T.Component);function bs(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var vs=rn(Object.keys,Object);const xs=vs;var ms=Object.prototype,ys=ms.hasOwnProperty;function ws(t){if(!_t(t))return xs(t);var e=[];for(var r in Object(t))ys.call(t,r)&&r!="constructor"&&e.push(r);return e}function Tt(t){return we(t)?un(t):ws(t)}function Es(t,e){return t&&en(t,e,Tt)}function Cs(t,e){return function(r,n){if(r==null)return r;if(!we(r))return t(r,n);for(var a=r.length,i=e?a:-1,o=Object(r);(e?i--:++i<a)&&n(o[i],i,o)!==!1;);return r}}var Ss=Cs(Es);const pn=Ss;function _s(t){return typeof t=="function"?t:Je}function Os(t,e){var r=k(t)?bs:pn;return r(t,_s(e))}function Xe(t){"@babel/helpers - typeof";return Xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xe(t)}var Rs=/^\s+/,As=/\s+$/;function x(t,e){if(t=t||"",e=e||{},t instanceof x)return t;if(!(this instanceof x))return new x(t,e);var r=Ts(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}x.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),r,n,a,i,o,l;return r=e.r/255,n=e.g/255,a=e.b/255,r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),a<=.03928?l=a/12.92:l=Math.pow((a+.055)/1.055,2.4),.2126*i+.7152*o+.0722*l},setAlpha:function(e){return this._a=dn(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=xr(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=xr(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+a+"%)":"hsva("+r+", "+n+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var e=vr(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=vr(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),a=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+a+"%)":"hsla("+r+", "+n+"%, "+a+"%, "+this._roundA+")"},toHex:function(e){return mr(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return ks(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(_(this._r,255)*100)+"%",g:Math.round(_(this._g,255)*100)+"%",b:Math.round(_(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(_(this._r,255)*100)+"%, "+Math.round(_(this._g,255)*100)+"%, "+Math.round(_(this._b,255)*100)+"%)":"rgba("+Math.round(_(this._r,255)*100)+"%, "+Math.round(_(this._g,255)*100)+"%, "+Math.round(_(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Ws[mr(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+yr(this._r,this._g,this._b,this._a),n=r,a=this._gradientType?"GradientType = 1, ":"";if(e){var i=x(e);n="#"+yr(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+r+",endColorstr="+n+")"},toString:function(e){var r=!!e;e=e||this._format;var n=!1,a=this._a<1&&this._a>=0,i=!r&&a&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return i?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return x(this.toString())},_applyModification:function(e,r){var n=e.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Ns,arguments)},brighten:function(){return this._applyModification(Ds,arguments)},darken:function(){return this._applyModification(Ls,arguments)},desaturate:function(){return this._applyModification(Fs,arguments)},saturate:function(){return this._applyModification(Bs,arguments)},greyscale:function(){return this._applyModification(Hs,arguments)},spin:function(){return this._applyModification(js,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(zs,arguments)},complement:function(){return this._applyCombination(Is,arguments)},monochromatic:function(){return this._applyCombination(Us,arguments)},splitcomplement:function(){return this._applyCombination(Gs,arguments)},triad:function(){return this._applyCombination(wr,[3])},tetrad:function(){return this._applyCombination(wr,[4])}};x.fromRatio=function(t,e){if(Xe(t)=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=Oe(t[n]));t=r}return x(t,e)};function Ts(t){var e={r:0,g:0,b:0},r=1,n=null,a=null,i=null,o=!1,l=!1;return typeof t=="string"&&(t=qs(t)),Xe(t)=="object"&&(G(t.r)&&G(t.g)&&G(t.b)?(e=Ps(t.r,t.g,t.b),o=!0,l=String(t.r).substr(-1)==="%"?"prgb":"rgb"):G(t.h)&&G(t.s)&&G(t.v)?(n=Oe(t.s),a=Oe(t.v),e=Ms(t.h,n,a),o=!0,l="hsv"):G(t.h)&&G(t.s)&&G(t.l)&&(n=Oe(t.s),i=Oe(t.l),e=$s(t.h,n,i),o=!0,l="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=dn(r),{ok:o,format:t.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function Ps(t,e,r){return{r:_(t,255)*255,g:_(e,255)*255,b:_(r,255)*255}}function vr(t,e,r){t=_(t,255),e=_(e,255),r=_(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i,o,l=(n+a)/2;if(n==a)i=o=0;else{var u=n-a;switch(o=l>.5?u/(2-n-a):u/(n+a),n){case t:i=(e-r)/u+(e<r?6:0);break;case e:i=(r-t)/u+2;break;case r:i=(t-e)/u+4;break}i/=6}return{h:i,s:o,l}}function $s(t,e,r){var n,a,i;t=_(t,360),e=_(e,100),r=_(r,100);function o(c,f,h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?c+(f-c)*6*h:h<1/2?f:h<2/3?c+(f-c)*(2/3-h)*6:c}if(e===0)n=a=i=r;else{var l=r<.5?r*(1+e):r+e-r*e,u=2*r-l;n=o(u,l,t+1/3),a=o(u,l,t),i=o(u,l,t-1/3)}return{r:n*255,g:a*255,b:i*255}}function xr(t,e,r){t=_(t,255),e=_(e,255),r=_(r,255);var n=Math.max(t,e,r),a=Math.min(t,e,r),i,o,l=n,u=n-a;if(o=n===0?0:u/n,n==a)i=0;else{switch(n){case t:i=(e-r)/u+(e<r?6:0);break;case e:i=(r-t)/u+2;break;case r:i=(t-e)/u+4;break}i/=6}return{h:i,s:o,v:l}}function Ms(t,e,r){t=_(t,360)*6,e=_(e,100),r=_(r,100);var n=Math.floor(t),a=t-n,i=r*(1-e),o=r*(1-a*e),l=r*(1-(1-a)*e),u=n%6,c=[r,o,i,i,l,r][u],f=[l,r,r,o,i,i][u],h=[i,i,l,r,r,o][u];return{r:c*255,g:f*255,b:h*255}}function mr(t,e,r,n){var a=[N(Math.round(t).toString(16)),N(Math.round(e).toString(16)),N(Math.round(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function ks(t,e,r,n,a){var i=[N(Math.round(t).toString(16)),N(Math.round(e).toString(16)),N(Math.round(r).toString(16)),N(gn(n))];return a&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function yr(t,e,r,n){var a=[N(gn(n)),N(Math.round(t).toString(16)),N(Math.round(e).toString(16)),N(Math.round(r).toString(16))];return a.join("")}x.equals=function(t,e){return!t||!e?!1:x(t).toRgbString()==x(e).toRgbString()};x.random=function(){return x.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Fs(t,e){e=e===0?0:e||10;var r=x(t).toHsl();return r.s-=e/100,r.s=tt(r.s),x(r)}function Bs(t,e){e=e===0?0:e||10;var r=x(t).toHsl();return r.s+=e/100,r.s=tt(r.s),x(r)}function Hs(t){return x(t).desaturate(100)}function Ns(t,e){e=e===0?0:e||10;var r=x(t).toHsl();return r.l+=e/100,r.l=tt(r.l),x(r)}function Ds(t,e){e=e===0?0:e||10;var r=x(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),x(r)}function Ls(t,e){e=e===0?0:e||10;var r=x(t).toHsl();return r.l-=e/100,r.l=tt(r.l),x(r)}function js(t,e){var r=x(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,x(r)}function Is(t){var e=x(t).toHsl();return e.h=(e.h+180)%360,x(e)}function wr(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=x(t).toHsl(),n=[x(t)],a=360/e,i=1;i<e;i++)n.push(x({h:(r.h+i*a)%360,s:r.s,l:r.l}));return n}function Gs(t){var e=x(t).toHsl(),r=e.h;return[x(t),x({h:(r+72)%360,s:e.s,l:e.l}),x({h:(r+216)%360,s:e.s,l:e.l})]}function zs(t,e,r){e=e||6,r=r||30;var n=x(t).toHsl(),a=360/r,i=[x(t)];for(n.h=(n.h-(a*e>>1)+720)%360;--e;)n.h=(n.h+a)%360,i.push(x(n));return i}function Us(t,e){e=e||6;for(var r=x(t).toHsv(),n=r.h,a=r.s,i=r.v,o=[],l=1/e;e--;)o.push(x({h:n,s:a,v:i})),i=(i+l)%1;return o}x.mix=function(t,e,r){r=r===0?0:r||50;var n=x(t).toRgb(),a=x(e).toRgb(),i=r/100,o={r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a};return x(o)};x.readability=function(t,e){var r=x(t),n=x(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};x.isReadable=function(t,e,r){var n=x.readability(t,e),a,i;switch(i=!1,a=Ys(r),a.level+a.size){case"AAsmall":case"AAAlarge":i=n>=4.5;break;case"AAlarge":i=n>=3;break;case"AAAsmall":i=n>=7;break}return i};x.mostReadable=function(t,e,r){var n=null,a=0,i,o,l,u;r=r||{},o=r.includeFallbackColors,l=r.level,u=r.size;for(var c=0;c<e.length;c++)i=x.readability(t,e[c]),i>a&&(a=i,n=x(e[c]));return x.isReadable(t,n,{level:l,size:u})||!o?n:(r.includeFallbackColors=!1,x.mostReadable(t,["#fff","#000"],r))};var dt=x.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawng