UNPKG

vue-radio-toggle-buttons

Version:
3 lines (2 loc) 46.9 kB
var VueRadioToggleButtons=function(Vue){'use strict';var _Mathpow=Math.pow,_Mathmax=Math.max,_Mathmin=Math.min,_Mathround=Math.round;function createCommonjsModule(fn,module){return module={exports:{}},fn(module,module.exports),module.exports}function buildGraph(){for(var graph={},models=Object.keys(conversions),len=models.length,i=0;i<len;i++)graph[models[i]]={distance:-1,parent:null};return graph}function deriveBFS(fromModel){var graph=buildGraph(),queue=[fromModel];for(graph[fromModel].distance=0;queue.length;)for(var current=queue.pop(),adjacents=Object.keys(conversions[current]),len=adjacents.length,i=0;i<len;i++){var adjacent=adjacents[i],node=graph[adjacent];-1===node.distance&&(node.distance=graph[current].distance+1,node.parent=current,queue.unshift(adjacent))}return graph}function link(from,to){return function(args){return to(from(args))}}function wrapConversion(toModel,graph){for(var path=[graph[toModel].parent,toModel],fn=conversions[graph[toModel].parent][toModel],cur=graph[toModel].parent;graph[cur].parent;)path.unshift(graph[cur].parent),fn=link(conversions[graph[cur].parent][cur],fn),cur=graph[cur].parent;return fn.conversion=path,fn}function wrapRaw(fn){var wrappedFn=function(args){return void 0===args||null===args?args:(1<arguments.length&&(args=Array.prototype.slice.call(arguments)),fn(args))};return"conversion"in fn&&(wrappedFn.conversion=fn.conversion),wrappedFn}function wrapRounded(fn){var wrappedFn=function(args){if(void 0===args||null===args)return args;1<arguments.length&&(args=Array.prototype.slice.call(arguments));var result=fn(args);if("object"==typeof result)for(var len=result.length,i=0;i<len;i++)result[i]=_Mathround(result[i]);return result};return"conversion"in fn&&(wrappedFn.conversion=fn.conversion),wrappedFn}function Color(obj,model){if(!(this instanceof Color))return new Color(obj,model);if(model&&model in skippedModels&&(model=null),model&&!(model in colorConvert))throw new Error("Unknown model: "+model);var i,channels;if(null==obj)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(obj instanceof Color)this.model=obj.model,this.color=obj.color.slice(),this.valpha=obj.valpha;else if("string"==typeof obj){var result=colorString.get(obj);if(null===result)throw new Error("Unable to parse color from string: "+obj);this.model=result.model,channels=colorConvert[this.model].channels,this.color=result.value.slice(0,channels),this.valpha="number"==typeof result.value[channels]?result.value[channels]:1}else if(obj.length){this.model=model||"rgb",channels=colorConvert[this.model].channels;var newArr=_slice.call(obj,0,channels);this.color=zeroArray(newArr,channels),this.valpha="number"==typeof obj[channels]?obj[channels]:1}else if("number"==typeof obj)obj&=16777215,this.model="rgb",this.color=[255&obj>>16,255&obj>>8,255&obj],this.valpha=1;else{this.valpha=1;var keys=Object.keys(obj);"alpha"in obj&&(keys.splice(keys.indexOf("alpha"),1),this.valpha="number"==typeof obj.alpha?obj.alpha:0);var hashedKeys=keys.sort().join("");if(!(hashedKeys in hashedModelKeys))throw new Error("Unable to parse color from object: "+JSON.stringify(obj));this.model=hashedModelKeys[hashedKeys];var labels=colorConvert[this.model].labels,color=[];for(i=0;i<labels.length;i++)color.push(obj[labels[i]]);this.color=zeroArray(color)}if(limiters[this.model])for(channels=colorConvert[this.model].channels,i=0;i<channels;i++){var limit=limiters[this.model][i];limit&&(this.color[i]=limit(this.color[i]))}this.valpha=_Mathmax(0,_Mathmin(1,this.valpha)),Object.freeze&&Object.freeze(this)}function roundTo(num,places){return+num.toFixed(places)}function roundToPlace(places){return function(num){return roundTo(num,places)}}function getset(model,channel,modifier){return model=Array.isArray(model)?model:[model],model.forEach(function(m){(limiters[m]||(limiters[m]=[]))[channel]=modifier}),model=model[0],function(val){var result;return arguments.length?(modifier&&(val=modifier(val)),result=this[model](),result.color[channel]=val,result):(result=this[model]().color[channel],modifier&&(result=modifier(result)),result)}}function maxfn(max){return function(v){return _Mathmax(0,_Mathmin(max,v))}}function assertArray(val){return Array.isArray(val)?val:[val]}function zeroArray(arr,length){for(var i=0;i<length;i++)"number"!=typeof arr[i]&&(arr[i]=0);return arr}function isColor(color$1){if("string"!=typeof color$1||0===color$1.length)return!1;try{return color(color$1),!0}catch(_){return!1}}function __extends(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}function __decorate(decorators,target,key,desc){var d,c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;0<=i;i--)(d=decorators[i])&&(r=(3>c?d(r):3<c?d(target,key,r):d(target,key))||r);return 3<c&&r&&Object.defineProperty(target,key,r),r}function copyReflectionMetadata(to,from){forwardMetadata(to,from),Object.getOwnPropertyNames(from.prototype).forEach(function(key){forwardMetadata(to.prototype,from.prototype,key)}),Object.getOwnPropertyNames(from).forEach(function(key){forwardMetadata(to,from,key)})}function forwardMetadata(to,from,propertyKey){var metaKeys=propertyKey?Reflect.getOwnMetadataKeys(from,propertyKey):Reflect.getOwnMetadataKeys(from);metaKeys.forEach(function(metaKey){var metadata=propertyKey?Reflect.getOwnMetadata(metaKey,from,propertyKey):Reflect.getOwnMetadata(metaKey,from);propertyKey?Reflect.defineMetadata(metaKey,metadata,to,propertyKey):Reflect.defineMetadata(metaKey,metadata,to)})}function createDecorator(factory){return function(target,key,index){var Ctor="function"==typeof target?target:target.constructor;Ctor.__decorators__||(Ctor.__decorators__=[]),"number"!=typeof index&&(index=void 0),Ctor.__decorators__.push(function(options){return factory(options,key,index)})}}function isPrimitive(value){var type=typeof value;return null==value||"object"!==type&&"function"!==type}function collectDataFromConstructor(vm,Component){var originalInit=Component.prototype._init;Component.prototype._init=function(){var _this=this,keys=Object.getOwnPropertyNames(vm);if(vm.$options.props)for(var key in vm.$options.props)vm.hasOwnProperty(key)||keys.push(key);keys.forEach(function(key){"_"!==key.charAt(0)&&Object.defineProperty(_this,key,{get:function(){return vm[key]},set:function(value){vm[key]=value},configurable:!0})})};var data=new Component;Component.prototype._init=originalInit;var plainData={};return Object.keys(data).forEach(function(key){void 0!==data[key]&&(plainData[key]=data[key])}),plainData}function componentFactory(Component,options){void 0===options&&(options={}),options.name=options.name||Component._componentTag||Component.name;var proto=Component.prototype;Object.getOwnPropertyNames(proto).forEach(function(key){if("constructor"!==key){if(-1<$internalHooks.indexOf(key))return void(options[key]=proto[key]);var descriptor=Object.getOwnPropertyDescriptor(proto,key);void 0===descriptor.value?(descriptor.get||descriptor.set)&&((options.computed||(options.computed={}))[key]={get:descriptor.get,set:descriptor.set}):"function"==typeof descriptor.value?(options.methods||(options.methods={}))[key]=descriptor.value:(options.mixins||(options.mixins=[])).push({data:function(){var _a;return _a={},_a[key]=descriptor.value,_a}})}}),(options.mixins||(options.mixins=[])).push({data:function(){return collectDataFromConstructor(this,Component)}});var decorators=Component.__decorators__;decorators&&(decorators.forEach(function(fn){return fn(options)}),delete Component.__decorators__);var superProto=Object.getPrototypeOf(Component.prototype),Super=superProto instanceof Vue?superProto.constructor:Vue,Extended=Super.extend(options);return forwardStaticMembers(Extended,Component,Super),reflectionIsSupported&&copyReflectionMetadata(Extended,Component),Extended}function forwardStaticMembers(Extended,Original,Super){Object.getOwnPropertyNames(Original).forEach(function(key){if(!shouldIgnore[key]){var extendedDescriptor=Object.getOwnPropertyDescriptor(Extended,key);if(!extendedDescriptor||extendedDescriptor.configurable){var descriptor=Object.getOwnPropertyDescriptor(Original,key);if(!hasProto){if("cid"===key)return;var superDescriptor=Object.getOwnPropertyDescriptor(Super,key);if(!isPrimitive(descriptor.value)&&superDescriptor&&superDescriptor.value===descriptor.value)return}Object.defineProperty(Extended,key,descriptor)}}})}function Component(options){return"function"==typeof options?componentFactory(options):function(Component){return componentFactory(Component,options)}}function applyMetadata(options,target,key){reflectMetadataIsSupported&&!Array.isArray(options)&&"function"!=typeof options&&"undefined"==typeof options.type&&(options.type=Reflect.getMetadata("design:type",target,key))}function Model(event,options){return void 0===options&&(options={}),function(target,key){applyMetadata(options,target,key),createDecorator(function(componentOptions,k){(componentOptions.props||(componentOptions.props={}))[k]=options,componentOptions.model={prop:k,event:event||k}})(target,key)}}function Prop(options){return void 0===options&&(options={}),function(target,key){applyMetadata(options,target,key),createDecorator(function(componentOptions,k){(componentOptions.props||(componentOptions.props={}))[k]=options})(target,key)}}function Watch(path,options){void 0===options&&(options={});var _a=options.deep,_b=options.immediate;return createDecorator(function(componentOptions,handler){"object"!=typeof componentOptions.watch&&(componentOptions.watch=Object.create(null));var watch=componentOptions.watch;"object"!=typeof watch[path]||Array.isArray(watch[path])?"undefined"==typeof watch[path]&&(watch[path]=[]):watch[path]=[watch[path]],watch[path].push({handler:handler,deep:void 0!==_a&&_a,immediate:void 0!==_b&&_b})})}function normalizeComponent(template,style,script,scopeId,isFunctionalTemplate,moduleIdentifier,shadowMode,createInjector,createInjectorSSR,createInjectorShadow){"boolean"!=typeof shadowMode&&(createInjectorSSR=createInjector,createInjector=shadowMode,shadowMode=!1);const options="function"==typeof script?script.options:script;template&&template.render&&(options.render=template.render,options.staticRenderFns=template.staticRenderFns,options._compiled=!0,isFunctionalTemplate&&(options.functional=!0)),scopeId&&(options._scopeId=scopeId);let hook;if(moduleIdentifier?(hook=function(context){context=context||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,context||"undefined"==typeof __VUE_SSR_CONTEXT__||(context=__VUE_SSR_CONTEXT__),style&&style.call(this,createInjectorSSR(context)),context&&context._registeredComponents&&context._registeredComponents.add(moduleIdentifier)},options._ssrRegister=hook):style&&(hook=shadowMode?function(context){style.call(this,createInjectorShadow(context,this.$root.$options.shadowRoot))}:function(context){style.call(this,createInjector(context))}),hook)if(options.functional){const originalRender=options.render;options.render=function(h,context){return hook.call(context),originalRender(h,context)}}else{const existing=options.beforeCreate;options.beforeCreate=existing?[].concat(existing,hook):[hook]}return script}Vue=Vue&&Vue.hasOwnProperty("default")?Vue["default"]:Vue;var TEXT_COLOR="#333",SELECTED_TEXT_COLOR="#eee",colorName={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},isArrayish=function(obj){return!!(obj&&"string"!=typeof obj)&&(obj instanceof Array||Array.isArray(obj)||0<=obj.length&&(obj.splice instanceof Function||Object.getOwnPropertyDescriptor(obj,obj.length-1)&&"String"!==obj.constructor.name))},simpleSwizzle=createCommonjsModule(function(module){var concat=Array.prototype.concat,slice=Array.prototype.slice,swizzle=module.exports=function(args){for(var arg,results=[],i=0,len=args.length;i<len;i++)arg=args[i],isArrayish(arg)?results=concat.call(results,slice.call(arg)):results.push(arg);return results};swizzle.wrap=function(fn){return function(){return fn(swizzle(arguments))}}}),colorString=createCommonjsModule(function(module){function clamp(num,min,max){return _Mathmin(_Mathmax(min,num),max)}function hexDouble(num){var str=num.toString(16).toUpperCase();return 2>str.length?"0"+str:str}var reverseNames={};for(var name in colorName)colorName.hasOwnProperty(name)&&(reverseNames[colorName[name]]=name);var cs=module.exports={to:{},get:{}};cs.get=function(string){var val,model,prefix=string.substring(0,3).toLowerCase();return"hsl"===prefix?(val=cs.get.hsl(string),model="hsl"):"hwb"===prefix?(val=cs.get.hwb(string),model="hwb"):(val=cs.get.rgb(string),model="rgb"),val?{model:model,value:val}:null},cs.get.rgb=function(string){if(!string)return null;var match,i,hexAlpha,abbr=/^#([a-f0-9]{3,4})$/i,hex=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,rgba=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,per=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,keyword=/(\D+)/,rgb=[0,0,0,1];if(match=string.match(hex)){for(hexAlpha=match[2],match=match[1],i=0;3>i;i++){var i2=2*i;rgb[i]=parseInt(match.slice(i2,i2+2),16)}hexAlpha&&(rgb[3]=_Mathround(100*(parseInt(hexAlpha,16)/255))/100)}else if(match=string.match(abbr)){for(match=match[1],hexAlpha=match[3],i=0;3>i;i++)rgb[i]=parseInt(match[i]+match[i],16);hexAlpha&&(rgb[3]=_Mathround(100*(parseInt(hexAlpha+hexAlpha,16)/255))/100)}else if(match=string.match(rgba)){for(i=0;3>i;i++)rgb[i]=parseInt(match[i+1],0);match[4]&&(rgb[3]=parseFloat(match[4]))}else if(match=string.match(per)){for(i=0;3>i;i++)rgb[i]=_Mathround(2.55*parseFloat(match[i+1]));match[4]&&(rgb[3]=parseFloat(match[4]))}else return(match=string.match(keyword))?"transparent"===match[1]?[0,0,0,0]:(rgb=colorName[match[1]],!rgb)?null:(rgb[3]=1,rgb):null;for(i=0;3>i;i++)rgb[i]=clamp(rgb[i],0,255);return rgb[3]=clamp(rgb[3],0,1),rgb},cs.get.hsl=function(string){if(!string)return null;var hsl=/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,match=string.match(hsl);if(match){var alpha=parseFloat(match[4]),h=(parseFloat(match[1])+360)%360,s=clamp(parseFloat(match[2]),0,100),l=clamp(parseFloat(match[3]),0,100),a=clamp(isNaN(alpha)?1:alpha,0,1);return[h,s,l,a]}return null},cs.get.hwb=function(string){if(!string)return null;var hwb=/^hwb\(\s*([+-]?\d*[\.]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,match=string.match(hwb);if(match){var alpha=parseFloat(match[4]),h=(parseFloat(match[1])%360+360)%360,w=clamp(parseFloat(match[2]),0,100),b=clamp(parseFloat(match[3]),0,100),a=clamp(isNaN(alpha)?1:alpha,0,1);return[h,w,b,a]}return null},cs.to.hex=function(){var rgba=simpleSwizzle(arguments);return"#"+hexDouble(rgba[0])+hexDouble(rgba[1])+hexDouble(rgba[2])+(1>rgba[3]?hexDouble(_Mathround(255*rgba[3])):"")},cs.to.rgb=function(){var rgba=simpleSwizzle(arguments);return 4>rgba.length||1===rgba[3]?"rgb("+_Mathround(rgba[0])+", "+_Mathround(rgba[1])+", "+_Mathround(rgba[2])+")":"rgba("+_Mathround(rgba[0])+", "+_Mathround(rgba[1])+", "+_Mathround(rgba[2])+", "+rgba[3]+")"},cs.to.rgb.percent=function(){var rgba=simpleSwizzle(arguments),r=_Mathround(100*(rgba[0]/255)),g=_Mathround(100*(rgba[1]/255)),b=_Mathround(100*(rgba[2]/255));return 4>rgba.length||1===rgba[3]?"rgb("+r+"%, "+g+"%, "+b+"%)":"rgba("+r+"%, "+g+"%, "+b+"%, "+rgba[3]+")"},cs.to.hsl=function(){var hsla=simpleSwizzle(arguments);return 4>hsla.length||1===hsla[3]?"hsl("+hsla[0]+", "+hsla[1]+"%, "+hsla[2]+"%)":"hsla("+hsla[0]+", "+hsla[1]+"%, "+hsla[2]+"%, "+hsla[3]+")"},cs.to.hwb=function(){var hwba=simpleSwizzle(arguments),a="";return 4<=hwba.length&&1!==hwba[3]&&(a=", "+hwba[3]),"hwb("+hwba[0]+", "+hwba[1]+"%, "+hwba[2]+"%"+a+")"},cs.to.keyword=function(rgb){return reverseNames[rgb.slice(0,3)]}}),colorString_1=colorString.to,colorString_2=colorString.get,colorName$1={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},conversions=createCommonjsModule(function(module){var _MathPI=Math.PI,_Mathfloor=Math.floor;function comparativeDistance(x,y){return _Mathpow(x[0]-y[0],2)+_Mathpow(x[1]-y[1],2)+_Mathpow(x[2]-y[2],2)}var reverseKeywords={};for(var key in colorName$1)colorName$1.hasOwnProperty(key)&&(reverseKeywords[colorName$1[key]]=key);var convert=module.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var model in convert)if(convert.hasOwnProperty(model)){if(!("channels"in convert[model]))throw new Error("missing channels property: "+model);if(!("labels"in convert[model]))throw new Error("missing channel labels property: "+model);if(convert[model].labels.length!==convert[model].channels)throw new Error("channel and label counts mismatch: "+model);var channels=convert[model].channels,labels=convert[model].labels;delete convert[model].channels,delete convert[model].labels,Object.defineProperty(convert[model],"channels",{value:channels}),Object.defineProperty(convert[model],"labels",{value:labels})}convert.rgb.hsl=function(rgb){var h,s,l,r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,min=_Mathmin(r,g,b),max=_Mathmax(r,g,b),delta=max-min;return max===min?h=0:r===max?h=(g-b)/delta:g===max?h=2+(b-r)/delta:b===max&&(h=4+(r-g)/delta),h=_Mathmin(60*h,360),0>h&&(h+=360),l=(min+max)/2,s=max===min?0:.5>=l?delta/(max+min):delta/(2-max-min),[h,100*s,100*l]},convert.rgb.hsv=function(rgb){var rdif,gdif,bdif,h,s,r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,v=_Mathmax(r,g,b),diff=v-_Mathmin(r,g,b),diffc=function(c){return(v-c)/6/diff+1/2};return 0===diff?h=s=0:(s=diff/v,rdif=diffc(r),gdif=diffc(g),bdif=diffc(b),r===v?h=bdif-gdif:g===v?h=1/3+rdif-bdif:b===v&&(h=2/3+gdif-rdif),0>h?h+=1:1<h&&(h-=1)),[360*h,100*s,100*v]},convert.rgb.hwb=function(rgb){var r=rgb[0],g=rgb[1],b=rgb[2],h=convert.rgb.hsl(rgb)[0],w=1/255*_Mathmin(r,_Mathmin(g,b));return b=1-1/255*_Mathmax(r,_Mathmax(g,b)),[h,100*w,100*b]},convert.rgb.cmyk=function(rgb){var c,m,y,k,r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255;return k=_Mathmin(1-r,1-g,1-b),c=(1-r-k)/(1-k)||0,m=(1-g-k)/(1-k)||0,y=(1-b-k)/(1-k)||0,[100*c,100*m,100*y,100*k]},convert.rgb.keyword=function(rgb){var reversed=reverseKeywords[rgb];if(reversed)return reversed;var currentClosestKeyword,currentClosestDistance=1/0;for(var keyword in colorName$1)if(colorName$1.hasOwnProperty(keyword)){var value=colorName$1[keyword],distance=comparativeDistance(rgb,value);distance<currentClosestDistance&&(currentClosestDistance=distance,currentClosestKeyword=keyword)}return currentClosestKeyword},convert.keyword.rgb=function(keyword){return colorName$1[keyword]},convert.rgb.xyz=function(rgb){var r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255;r=.04045<r?_Mathpow((r+.055)/1.055,2.4):r/12.92,g=.04045<g?_Mathpow((g+.055)/1.055,2.4):g/12.92,b=.04045<b?_Mathpow((b+.055)/1.055,2.4):b/12.92;var x=.4124*r+.3576*g+.1805*b,y=.2126*r+.7152*g+.0722*b,z=.0193*r+.1192*g+.9505*b;return[100*x,100*y,100*z]},convert.rgb.lab=function(rgb){var l,a,b,xyz=convert.rgb.xyz(rgb),x=xyz[0],y=xyz[1],z=xyz[2];return x/=95.047,y/=100,z/=108.883,x=.008856<x?_Mathpow(x,1/3):7.787*x+16/116,y=.008856<y?_Mathpow(y,1/3):7.787*y+16/116,z=.008856<z?_Mathpow(z,1/3):7.787*z+16/116,l=116*y-16,a=500*(x-y),b=200*(y-z),[l,a,b]},convert.hsl.rgb=function(hsl){var t1,t2,t3,rgb,val,h=hsl[0]/360,s=hsl[1]/100,l=hsl[2]/100;if(0===s)return val=255*l,[val,val,val];t2=.5>l?l*(1+s):l+s-l*s,t1=2*l-t2,rgb=[0,0,0];for(var i=0;3>i;i++)t3=h+1/3*-(i-1),0>t3&&t3++,1<t3&&t3--,val=1>6*t3?t1+6*(t2-t1)*t3:1>2*t3?t2:2>3*t3?t1+6*((t2-t1)*(2/3-t3)):t1,rgb[i]=255*val;return rgb},convert.hsl.hsv=function(hsl){var sv,v,h=hsl[0],s=hsl[1]/100,l=hsl[2]/100,smin=s,lmin=_Mathmax(l,.01);return l*=2,s*=1>=l?l:2-l,smin*=1>=lmin?lmin:2-lmin,v=(l+s)/2,sv=0===l?2*smin/(lmin+smin):2*s/(l+s),[h,100*sv,100*v]},convert.hsv.rgb=function(hsv){var h=hsv[0]/60,s=hsv[1]/100,v=hsv[2]/100,hi=_Mathfloor(h)%6,f=h-_Mathfloor(h),p=255*v*(1-s),q=255*v*(1-s*f),t=255*v*(1-s*(1-f));return v*=255,0===hi?[v,t,p]:1===hi?[q,v,p]:2===hi?[p,v,t]:3===hi?[p,q,v]:4===hi?[t,p,v]:5===hi?[v,p,q]:void 0},convert.hsv.hsl=function(hsv){var lmin,sl,l,h=hsv[0],s=hsv[1]/100,v=hsv[2]/100,vmin=_Mathmax(v,.01);return l=(2-s)*v,lmin=(2-s)*vmin,sl=s*vmin,sl/=1>=lmin?lmin:2-lmin,sl=sl||0,l/=2,[h,100*sl,100*l]},convert.hwb.rgb=function(hwb){var i,v,f,n,h=hwb[0]/360,wh=hwb[1]/100,bl=hwb[2]/100,ratio=wh+bl;1<ratio&&(wh/=ratio,bl/=ratio),i=_Mathfloor(6*h),v=1-bl,f=6*h-i,0!=(1&i)&&(f=1-f),n=wh+f*(v-wh);var r,g,b;switch(i){default:case 6:case 0:r=v,g=n,b=wh;break;case 1:r=n,g=v,b=wh;break;case 2:r=wh,g=v,b=n;break;case 3:r=wh,g=n,b=v;break;case 4:r=n,g=wh,b=v;break;case 5:r=v,g=wh,b=n;}return[255*r,255*g,255*b]},convert.cmyk.rgb=function(cmyk){var r,g,b,c=cmyk[0]/100,m=cmyk[1]/100,y=cmyk[2]/100,k=cmyk[3]/100;return r=1-_Mathmin(1,c*(1-k)+k),g=1-_Mathmin(1,m*(1-k)+k),b=1-_Mathmin(1,y*(1-k)+k),[255*r,255*g,255*b]},convert.xyz.rgb=function(xyz){var r,g,b,x=xyz[0]/100,y=xyz[1]/100,z=xyz[2]/100;return r=3.2406*x+-1.5372*y+-.4986*z,g=-.9689*x+1.8758*y+.0415*z,b=.0557*x+-.204*y+1.057*z,r=.0031308<r?1.055*_Mathpow(r,1/2.4)-.055:12.92*r,g=.0031308<g?1.055*_Mathpow(g,1/2.4)-.055:12.92*g,b=.0031308<b?1.055*_Mathpow(b,1/2.4)-.055:12.92*b,r=_Mathmin(_Mathmax(0,r),1),g=_Mathmin(_Mathmax(0,g),1),b=_Mathmin(_Mathmax(0,b),1),[255*r,255*g,255*b]},convert.xyz.lab=function(xyz){var l,a,b,x=xyz[0],y=xyz[1],z=xyz[2];return x/=95.047,y/=100,z/=108.883,x=.008856<x?_Mathpow(x,1/3):7.787*x+16/116,y=.008856<y?_Mathpow(y,1/3):7.787*y+16/116,z=.008856<z?_Mathpow(z,1/3):7.787*z+16/116,l=116*y-16,a=500*(x-y),b=200*(y-z),[l,a,b]},convert.lab.xyz=function(lab){var x,y,z,l=lab[0],a=lab[1],b=lab[2];y=(l+16)/116,x=a/500+y,z=y-b/200;var y2=_Mathpow(y,3),x2=_Mathpow(x,3),z2=_Mathpow(z,3);return y=.008856<y2?y2:(y-16/116)/7.787,x=.008856<x2?x2:(x-16/116)/7.787,z=.008856<z2?z2:(z-16/116)/7.787,x*=95.047,y*=100,z*=108.883,[x,y,z]},convert.lab.lch=function(lab){var hr,h,c,_Mathsqrt=Math.sqrt,_Mathatan=Math.atan2,l=lab[0],a=lab[1],b=lab[2];return hr=_Mathatan(b,a),h=360*hr/2/_MathPI,0>h&&(h+=360),c=_Mathsqrt(a*a+b*b),[l,c,h]},convert.lch.lab=function(lch){var a,b,hr,_Mathsin=Math.sin,_Mathcos=Math.cos,l=lch[0],c=lch[1],h=lch[2];return hr=2*(h/360)*_MathPI,a=c*_Mathcos(hr),b=c*_Mathsin(hr),[l,a,b]},convert.rgb.ansi16=function(args){var r=args[0],g=args[1],b=args[2],value=1 in arguments?arguments[1]:convert.rgb.hsv(args)[2];if(value=_Mathround(value/50),0===value)return 30;var ansi=30+(_Mathround(b/255)<<2|_Mathround(g/255)<<1|_Mathround(r/255));return 2===value&&(ansi+=60),ansi},convert.hsv.ansi16=function(args){return convert.rgb.ansi16(convert.hsv.rgb(args),args[2])},convert.rgb.ansi256=function(args){var r=args[0],g=args[1],b=args[2];if(r===g&&g===b)return 8>r?16:248<r?231:_Mathround(24*((r-8)/247))+232;var ansi=16+36*_Mathround(5*(r/255))+6*_Mathround(5*(g/255))+_Mathround(5*(b/255));return ansi},convert.ansi16.rgb=function(args){var color=args%10;if(0==color||7===color)return 50<args&&(color+=3.5),color=255*(color/10.5),[color,color,color];var mult=.5*(~~(50<args)+1),r=255*((1&color)*mult),g=255*((1&color>>1)*mult),b=255*((1&color>>2)*mult);return[r,g,b]},convert.ansi256.rgb=function(args){if(232<=args){var c=10*(args-232)+8;return[c,c,c]}args-=16;var rem,r=255*(_Mathfloor(args/36)/5),g=255*(_Mathfloor((rem=args%36)/6)/5),b=255*(rem%6/5);return[r,g,b]},convert.rgb.hex=function(args){var integer=((255&_Mathround(args[0]))<<16)+((255&_Mathround(args[1]))<<8)+(255&_Mathround(args[2])),string=integer.toString(16).toUpperCase();return"000000".substring(string.length)+string},convert.hex.rgb=function(args){var match=args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!match)return[0,0,0];var colorString=match[0];3===match[0].length&&(colorString=colorString.split("").map(function(char){return char+char}).join(""));var integer=parseInt(colorString,16);return[255&integer>>16,255&integer>>8,255&integer]},convert.rgb.hcg=function(rgb){var grayscale,hue,r=rgb[0]/255,g=rgb[1]/255,b=rgb[2]/255,max=_Mathmax(_Mathmax(r,g),b),min=_Mathmin(_Mathmin(r,g),b),chroma=max-min;return grayscale=1>chroma?min/(1-chroma):0,hue=0>=chroma?0:max===r?(g-b)/chroma%6:max===g?2+(b-r)/chroma:4+(r-g)/chroma+4,hue/=6,hue%=1,[360*hue,100*chroma,100*grayscale]},convert.hsl.hcg=function(hsl){var s=hsl[1]/100,l=hsl[2]/100,c=1,f=0;return c=.5>l?2*s*l:2*s*(1-l),1>c&&(f=(l-.5*c)/(1-c)),[hsl[0],100*c,100*f]},convert.hsv.hcg=function(hsv){var s=hsv[1]/100,v=hsv[2]/100,c=s*v,f=0;return 1>c&&(f=(v-c)/(1-c)),[hsv[0],100*c,100*f]},convert.hcg.rgb=function(hcg){var h=hcg[0]/360,c=hcg[1]/100,g=hcg[2]/100;if(0===c)return[255*g,255*g,255*g];var pure=[0,0,0],hi=6*(h%1),v=hi%1,w=1-v,mg=0;switch(_Mathfloor(hi)){case 0:pure[0]=1,pure[1]=v,pure[2]=0;break;case 1:pure[0]=w,pure[1]=1,pure[2]=0;break;case 2:pure[0]=0,pure[1]=1,pure[2]=v;break;case 3:pure[0]=0,pure[1]=w,pure[2]=1;break;case 4:pure[0]=v,pure[1]=0,pure[2]=1;break;default:pure[0]=1,pure[1]=0,pure[2]=w;}return mg=(1-c)*g,[255*(c*pure[0]+mg),255*(c*pure[1]+mg),255*(c*pure[2]+mg)]},convert.hcg.hsv=function(hcg){var c=hcg[1]/100,g=hcg[2]/100,v=c+g*(1-c),f=0;return 0<v&&(f=c/v),[hcg[0],100*f,100*v]},convert.hcg.hsl=function(hcg){var c=hcg[1]/100,g=hcg[2]/100,l=g*(1-c)+.5*c,s=0;return 0<l&&.5>l?s=c/(2*l):.5<=l&&1>l&&(s=c/(2*(1-l))),[hcg[0],100*s,100*l]},convert.hcg.hwb=function(hcg){var c=hcg[1]/100,g=hcg[2]/100,v=c+g*(1-c);return[hcg[0],100*(v-c),100*(1-v)]},convert.hwb.hcg=function(hwb){var w=hwb[1]/100,b=hwb[2]/100,v=1-b,c=v-w,g=0;return 1>c&&(g=(v-c)/(1-c)),[hwb[0],100*c,100*g]},convert.apple.rgb=function(apple){return[255*(apple[0]/65535),255*(apple[1]/65535),255*(apple[2]/65535)]},convert.rgb.apple=function(rgb){return[65535*(rgb[0]/255),65535*(rgb[1]/255),65535*(rgb[2]/255)]},convert.gray.rgb=function(args){return[255*(args[0]/100),255*(args[0]/100),255*(args[0]/100)]},convert.gray.hsl=convert.gray.hsv=function(args){return[0,0,args[0]]},convert.gray.hwb=function(gray){return[0,100,gray[0]]},convert.gray.cmyk=function(gray){return[0,0,0,gray[0]]},convert.gray.lab=function(gray){return[gray[0],0,0]},convert.gray.hex=function(gray){var val=255&_Mathround(255*(gray[0]/100)),string=((val<<16)+(val<<8)+val).toString(16).toUpperCase();return"000000".substring(string.length)+string},convert.rgb.gray=function(rgb){var val=(rgb[0]+rgb[1]+rgb[2])/3;return[100*(val/255)]}}),conversions_1=conversions.rgb,conversions_2=conversions.hsl,conversions_3=conversions.hsv,conversions_4=conversions.hwb,conversions_5=conversions.cmyk,conversions_6=conversions.xyz,conversions_7=conversions.lab,conversions_8=conversions.lch,conversions_9=conversions.hex,conversions_10=conversions.keyword,conversions_11=conversions.ansi16,conversions_12=conversions.ansi256,conversions_13=conversions.hcg,conversions_14=conversions.apple,conversions_15=conversions.gray,route=function(fromModel){for(var graph=deriveBFS(fromModel),conversion={},models=Object.keys(graph),len=models.length,i=0;i<len;i++){var toModel=models[i],node=graph[toModel];null!==node.parent&&(conversion[toModel]=wrapConversion(toModel,graph))}return conversion},convert={},models=Object.keys(conversions);models.forEach(function(fromModel){convert[fromModel]={},Object.defineProperty(convert[fromModel],"channels",{value:conversions[fromModel].channels}),Object.defineProperty(convert[fromModel],"labels",{value:conversions[fromModel].labels});var routes=route(fromModel),routeModels=Object.keys(routes);routeModels.forEach(function(toModel){var fn=routes[toModel];convert[fromModel][toModel]=wrapRounded(fn),convert[fromModel][toModel].raw=wrapRaw(fn)})});var colorConvert=convert,_slice=[].slice,skippedModels=["keyword","gray","hex"],hashedModelKeys={};Object.keys(colorConvert).forEach(function(model){hashedModelKeys[_slice.call(colorConvert[model].labels).sort().join("")]=model});var limiters={};Color.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(places){var self=this.model in colorString.to?this:this.rgb();self=self.round("number"==typeof places?places:1);var args=1===self.valpha?self.color:self.color.concat(this.valpha);return colorString.to[self.model](args)},percentString:function(places){var self=this.rgb().round("number"==typeof places?places:1),args=1===self.valpha?self.color:self.color.concat(this.valpha);return colorString.to.rgb.percent(args)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var result={},channels=colorConvert[this.model].channels,labels=colorConvert[this.model].labels,i=0;i<channels;i++)result[labels[i]]=this.color[i];return 1!==this.valpha&&(result.alpha=this.valpha),result},unitArray:function(){var rgb=this.rgb().color;return rgb[0]/=255,rgb[1]/=255,rgb[2]/=255,1!==this.valpha&&rgb.push(this.valpha),rgb},unitObject:function(){var rgb=this.rgb().object();return rgb.r/=255,rgb.g/=255,rgb.b/=255,1!==this.valpha&&(rgb.alpha=this.valpha),rgb},round:function(places){return places=_Mathmax(places||0,0),new Color(this.color.map(roundToPlace(places)).concat(this.valpha),this.model)},alpha:function(val){return arguments.length?new Color(this.color.concat(_Mathmax(0,_Mathmin(1,val))),this.model):this.valpha},red:getset("rgb",0,maxfn(255)),green:getset("rgb",1,maxfn(255)),blue:getset("rgb",2,maxfn(255)),hue:getset(["hsl","hsv","hsl","hwb","hcg"],0,function(val){return(val%360+360)%360}),saturationl:getset("hsl",1,maxfn(100)),lightness:getset("hsl",2,maxfn(100)),saturationv:getset("hsv",1,maxfn(100)),value:getset("hsv",2,maxfn(100)),chroma:getset("hcg",1,maxfn(100)),gray:getset("hcg",2,maxfn(100)),white:getset("hwb",1,maxfn(100)),wblack:getset("hwb",2,maxfn(100)),cyan:getset("cmyk",0,maxfn(100)),magenta:getset("cmyk",1,maxfn(100)),yellow:getset("cmyk",2,maxfn(100)),black:getset("cmyk",3,maxfn(100)),x:getset("xyz",0,maxfn(100)),y:getset("xyz",1,maxfn(100)),z:getset("xyz",2,maxfn(100)),l:getset("lab",0,maxfn(100)),a:getset("lab",1),b:getset("lab",2),keyword:function(val){return arguments.length?new Color(val):colorConvert[this.model].keyword(this.color)},hex:function(val){return arguments.length?new Color(val):colorString.to.hex(this.rgb().round().color)},rgbNumber:function(){var rgb=this.rgb().color;return(255&rgb[0])<<16|(255&rgb[1])<<8|255&rgb[2]},luminosity:function(){for(var chan,rgb=this.rgb().color,lum=[],i=0;i<rgb.length;i++)chan=rgb[i]/255,lum[i]=.03928>=chan?chan/12.92:_Mathpow((chan+.055)/1.055,2.4);return .2126*lum[0]+.7152*lum[1]+.0722*lum[2]},contrast:function(color2){var lum1=this.luminosity(),lum2=color2.luminosity();return lum1>lum2?(lum1+.05)/(lum2+.05):(lum2+.05)/(lum1+.05)},level:function(color2){var contrastRatio=this.contrast(color2);return 7.1<=contrastRatio?"AAA":4.5<=contrastRatio?"AA":""},isDark:function(){var rgb=this.rgb().color,yiq=(299*rgb[0]+587*rgb[1]+114*rgb[2])/1e3;return 128>yiq},isLight:function(){return!this.isDark()},negate:function(){for(var rgb=this.rgb(),i=0;3>i;i++)rgb.color[i]=255-rgb.color[i];return rgb},lighten:function(ratio){var hsl=this.hsl();return hsl.color[2]+=hsl.color[2]*ratio,hsl},darken:function(ratio){var hsl=this.hsl();return hsl.color[2]-=hsl.color[2]*ratio,hsl},saturate:function(ratio){var hsl=this.hsl();return hsl.color[1]+=hsl.color[1]*ratio,hsl},desaturate:function(ratio){var hsl=this.hsl();return hsl.color[1]-=hsl.color[1]*ratio,hsl},whiten:function(ratio){var hwb=this.hwb();return hwb.color[1]+=hwb.color[1]*ratio,hwb},blacken:function(ratio){var hwb=this.hwb();return hwb.color[2]+=hwb.color[2]*ratio,hwb},grayscale:function(){var rgb=this.rgb().color,val=.3*rgb[0]+.59*rgb[1]+.11*rgb[2];return Color.rgb(val,val,val)},fade:function(ratio){return this.alpha(this.valpha-this.valpha*ratio)},opaquer:function(ratio){return this.alpha(this.valpha+this.valpha*ratio)},rotate:function(degrees){var hsl=this.hsl(),hue=hsl.color[0];return hue=(hue+degrees)%360,hue=0>hue?360+hue:hue,hsl.color[0]=hue,hsl},mix:function(mixinColor,weight){if(!mixinColor||!mixinColor.rgb)throw new Error("Argument to \"mix\" was not a Color instance, but rather an instance of "+typeof mixinColor);var color1=mixinColor.rgb(),color2=this.rgb(),p=void 0===weight?.5:weight,w=2*p-1,a=color1.alpha()-color2.alpha(),w1=((-1==w*a?w:(w+a)/(1+w*a))+1)/2,w2=1-w1;return Color.rgb(w1*color1.red()+w2*color2.red(),w1*color1.green()+w2*color2.green(),w1*color1.blue()+w2*color2.blue(),color1.alpha()*p+color2.alpha()*(1-p))}},Object.keys(colorConvert).forEach(function(model){if(-1===skippedModels.indexOf(model)){var channels=colorConvert[model].channels;Color.prototype[model]=function(){if(this.model===model)return new Color(this);if(arguments.length)return new Color(arguments,model);var newAlpha="number"==typeof arguments[channels]?channels:this.valpha;return new Color(assertArray(colorConvert[this.model][model].raw(this.color)).concat(newAlpha),model)},Color[model]=function(color){return"number"==typeof color&&(color=zeroArray(_slice.call(arguments),channels)),new Color(color,model)}}});var color=Color,options={color:"#333",textColor:TEXT_COLOR,selectedTextColor:SELECTED_TEXT_COLOR},extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},extendStatics(d,b)},reflectionIsSupported="undefined"!=typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys,hasProto={__proto__:[]}instanceof Array,$internalHooks=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"],shouldIgnore={prototype:!0,arguments:!0,callee:!0,caller:!0};Component.registerHooks=function(keys){$internalHooks.push.apply($internalHooks,keys)};var reflectMetadataIsSupported="undefined"!=typeof Reflect&&"undefined"!=typeof Reflect.getMetadata,RadioToggle=function(_super){function RadioToggle(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.currentValue=_this.mValue,_this.isHovered=!1,_this}return __extends(RadioToggle,_super),RadioToggle.prototype.onClick=function(e){this.disabled&&e.preventDefault()},RadioToggle.prototype.onMouseOver=function(){this.isHovered=!0},RadioToggle.prototype.onMouseOut=function(){this.isHovered=!1},Object.defineProperty(RadioToggle.prototype,"computedValue",{get:function(){return this.currentValue},set:function(newValue){this.currentValue=newValue,this.$emit("input",newValue)},enumerable:!0,configurable:!0}),Object.defineProperty(RadioToggle.prototype,"isSelected",{get:function(){return this.currentValue===this.value},enumerable:!0,configurable:!0}),Object.defineProperty(RadioToggle.prototype,"classes",{get:function(){return{"is-selected":this.isSelected,"is-hovered":this.isHovered}},enumerable:!0,configurable:!0}),Object.defineProperty(RadioToggle.prototype,"style",{get:function(){var _a=this,color$1=_a.color,textColor=_a.textColor,selectedTextColor=_a.selectedTextColor,disabled=_a.disabled,isHovered=_a.isHovered,isSelected=_a.isSelected,mainColor=color(color$1),hoverColor=mainColor.isDark()?mainColor.lighten(.5).string():mainColor.darken(.3).string(),styles={color:textColor};if(!disabled&&isHovered&&(styles.color=color$1,styles.borderColor=color$1),!disabled&&isSelected&&(styles.color=selectedTextColor,isHovered?(styles.backgroundColor=hoverColor,styles.borderColor=hoverColor):(styles.backgroundColor=color$1,styles.borderColor=color$1)),disabled){styles.color="#bababa",styles.cursor="no-drop"}return styles},enumerable:!0,configurable:!0}),RadioToggle.prototype.onMValueChange=function(newValuue){this.currentValue=newValuue},__decorate([Model()],RadioToggle.prototype,"mValue",void 0),__decorate([Prop(String)],RadioToggle.prototype,"value",void 0),__decorate([Prop({type:String,default:"#333"})],RadioToggle.prototype,"color",void 0),__decorate([Prop({type:String,default:TEXT_COLOR})],RadioToggle.prototype,"textColor",void 0),__decorate([Prop({type:String,default:SELECTED_TEXT_COLOR})],RadioToggle.prototype,"selectedTextColor",void 0),__decorate([Prop({type:Boolean,default:!1})],RadioToggle.prototype,"disabled",void 0),__decorate([Watch("mValue")],RadioToggle.prototype,"onMValueChange",null),RadioToggle=__decorate([Component({name:"RadioToggle"})],RadioToggle),RadioToggle}(Vue);const __vue_component__=normalizeComponent({render:function(){var _vm=this,_h=_vm.$createElement,_c=_vm._self._c||_h;return _c("label",{staticClass:"radio-toggle-button",class:_vm.classes,style:_vm.style,on:{click:_vm.onClick,mouseover:_vm.onMouseOver,mouseout:_vm.onMouseOut}},[_c("input",{directives:[{name:"model",rawName:"v-model",value:_vm.computedValue,expression:"computedValue"}],attrs:{type:"radio"},domProps:{value:_vm.value,checked:_vm._q(_vm.computedValue,_vm.value)},on:{change:function(){_vm.computedValue=_vm.value}}}),_vm._t("default")],2)},staticRenderFns:[]},void 0,RadioToggle,void 0,!1,void 0,!1,void 0,void 0,void 0);var RadioToggleButtons=function(_super){function RadioToggleButtons(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(RadioToggleButtons,_super),Object.defineProperty(RadioToggleButtons.prototype,"actualColor",{get:function(){return this.color?this.color:options.color},enumerable:!0,configurable:!0}),Object.defineProperty(RadioToggleButtons.prototype,"actualTextColor",{get:function(){return this.textColor?this.textColor:options.textColor},enumerable:!0,configurable:!0}),Object.defineProperty(RadioToggleButtons.prototype,"actualSelectedTextColor",{get:function(){return this.selectedTextColor?this.selectedTextColor:options.selectedTextColor},enumerable:!0,configurable:!0}),RadioToggleButtons.prototype.onInput=function(newValue){this.$emit("change",newValue)},__decorate([Model("change")],RadioToggleButtons.prototype,"mValue",void 0),__decorate([Prop({type:Array,required:!0})],RadioToggleButtons.prototype,"values",void 0),__decorate([Prop({type:String,validator:isColor})],RadioToggleButtons.prototype,"color",void 0),__decorate([Prop({type:String,validator:isColor})],RadioToggleButtons.prototype,"textColor",void 0),__decorate([Prop({type:String,validator:isColor})],RadioToggleButtons.prototype,"selectedTextColor",void 0),RadioToggleButtons=__decorate([Component({name:"RadioToggleButtons",components:{RadioToggle:__vue_component__}})],RadioToggleButtons),RadioToggleButtons}(Vue);const __vue_component__$1=normalizeComponent({render:function(){var _vm=this,_h=_vm.$createElement,_c=_vm._self._c||_h;return _c("span",_vm._l(_vm.values,function(value){return _c("RadioToggle",{key:value.value,attrs:{mValue:_vm.mValue,value:value.value,color:_vm.actualColor,textColor:_vm.actualTextColor,selectedTextColor:_vm.actualSelectedTextColor,disabled:value.disabled},on:{input:_vm.onInput}},[_vm._v(_vm._s(value.label))])}),1)},staticRenderFns:[]},void 0,RadioToggleButtons,void 0,!1,void 0,!1,void 0,void 0,void 0);var VueRadioToggleButtons={install:function(Vue,options$1){var _a,_b,_c,_d;options.color=isColor(null===(_a=options$1)||void 0===_a?void 0:_a.color)?options$1.color:"#333",options.textColor=isColor(null===(_b=options$1)||void 0===_b?void 0:_b.textColor)?options$1.textColor:TEXT_COLOR,options.selectedTextColor=isColor(null===(_c=options$1)||void 0===_c?void 0:_c.selectedTextColor)?null===(_d=options$1)||void 0===_d?void 0:_d.selectedTextColor:SELECTED_TEXT_COLOR,Vue.component("RadioToggleButtons",__vue_component__$1)}};return"undefined"!=typeof window&&window.Vue&&VueRadioToggleButtons.install(window.Vue),VueRadioToggleButtons.components={RadioToggleButtons:__vue_component__$1},VueRadioToggleButtons}(Vue); //# sourceMappingURL=vue-radio-toggle-buttons.web.min.js.map