@havue/components 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(A,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(A=typeof globalThis<"u"?globalThis:A||self,a(A.components={},A.Vue))})(this,function(A,a){"use strict";var Go=Object.defineProperty;var qo=(A,a,K)=>a in A?Go(A,a,{enumerable:!0,configurable:!0,writable:!0,value:K}):A[a]=K;var q=(A,a,K)=>qo(A,typeof a!="symbol"?a+"":a,K);const K=(e,n)=>(e.install=t=>{for(const o of[e,...Object.values({})])t.component(o.name,o)},e);var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ye={exports:{}},We={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]},Ge={exports:{}},yt=function(n){return!n||typeof n=="string"?!1:n instanceof Array||Array.isArray(n)||n.length>=0&&(n.splice instanceof Function||Object.getOwnPropertyDescriptor(n,n.length-1)&&n.constructor.name!=="String")},Ct=yt,_t=Array.prototype.concat,kt=Array.prototype.slice,qe=Ge.exports=function(n){for(var t=[],o=0,r=n.length;o<r;o++){var l=n[o];Ct(l)?t=_t.call(t,kt.call(l)):t.push(l)}return t};qe.wrap=function(e){return function(){return e(qe(arguments))}};var xt=Ge.exports,fe=We,me=xt,Ke=Object.hasOwnProperty,Je=Object.create(null);for(var Be in fe)Ke.call(fe,Be)&&(Je[fe[Be]]=Be);var Y=Ye.exports={to:{},get:{}};Y.get=function(e){var n=e.substring(0,3).toLowerCase(),t,o;switch(n){case"hsl":t=Y.get.hsl(e),o="hsl";break;case"hwb":t=Y.get.hwb(e),o="hwb";break;default:t=Y.get.rgb(e),o="rgb";break}return t?{model:o,value:t}:null},Y.get.rgb=function(e){if(!e)return null;var n=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,o=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,r=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,l=/^(\w+)$/,s=[0,0,0,1],i,u,p;if(i=e.match(t)){for(p=i[2],i=i[1],u=0;u<3;u++){var h=u*2;s[u]=parseInt(i.slice(h,h+2),16)}p&&(s[3]=parseInt(p,16)/255)}else if(i=e.match(n)){for(i=i[1],p=i[3],u=0;u<3;u++)s[u]=parseInt(i[u]+i[u],16);p&&(s[3]=parseInt(p+p,16)/255)}else if(i=e.match(o)){for(u=0;u<3;u++)s[u]=parseInt(i[u+1],0);i[4]&&(i[5]?s[3]=parseFloat(i[4])*.01:s[3]=parseFloat(i[4]))}else if(i=e.match(r)){for(u=0;u<3;u++)s[u]=Math.round(parseFloat(i[u+1])*2.55);i[4]&&(i[5]?s[3]=parseFloat(i[4])*.01:s[3]=parseFloat(i[4]))}else return(i=e.match(l))?i[1]==="transparent"?[0,0,0,0]:Ke.call(fe,i[1])?(s=fe[i[1]],s[3]=1,s):null:null;for(u=0;u<3;u++)s[u]=re(s[u],0,255);return s[3]=re(s[3],0,1),s},Y.get.hsl=function(e){if(!e)return null;var n=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(n);if(t){var o=parseFloat(t[4]),r=(parseFloat(t[1])%360+360)%360,l=re(parseFloat(t[2]),0,100),s=re(parseFloat(t[3]),0,100),i=re(isNaN(o)?1:o,0,1);return[r,l,s,i]}return null},Y.get.hwb=function(e){if(!e)return null;var n=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(n);if(t){var o=parseFloat(t[4]),r=(parseFloat(t[1])%360+360)%360,l=re(parseFloat(t[2]),0,100),s=re(parseFloat(t[3]),0,100),i=re(isNaN(o)?1:o,0,1);return[r,l,s,i]}return null},Y.to.hex=function(){var e=me(arguments);return"#"+xe(e[0])+xe(e[1])+xe(e[2])+(e[3]<1?xe(Math.round(e[3]*255)):"")},Y.to.rgb=function(){var e=me(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Y.to.rgb.percent=function(){var e=me(arguments),n=Math.round(e[0]/255*100),t=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+n+"%, "+t+"%, "+o+"%)":"rgba("+n+"%, "+t+"%, "+o+"%, "+e[3]+")"},Y.to.hsl=function(){var e=me(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Y.to.hwb=function(){var e=me(arguments),n="";return e.length>=4&&e[3]!==1&&(n=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+n+")"},Y.to.keyword=function(e){return Je[e.slice(0,3)]};function re(e,n,t){return Math.min(Math.max(n,e),t)}function xe(e){var n=Math.round(e).toString(16).toUpperCase();return n.length<2?"0"+n:n}var wt=Ye.exports;const pe=We,Ze={};for(const e of Object.keys(pe))Ze[pe[e]]=e;const b={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"]}};var Qe=b;for(const e of Object.keys(b)){if(!("channels"in b[e]))throw new Error("missing channels property: "+e);if(!("labels"in b[e]))throw new Error("missing channel labels property: "+e);if(b[e].labels.length!==b[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:n,labels:t}=b[e];delete b[e].channels,delete b[e].labels,Object.defineProperty(b[e],"channels",{value:n}),Object.defineProperty(b[e],"labels",{value:t})}b.rgb.hsl=function(e){const n=e[0]/255,t=e[1]/255,o=e[2]/255,r=Math.min(n,t,o),l=Math.max(n,t,o),s=l-r;let i,u;l===r?i=0:n===l?i=(t-o)/s:t===l?i=2+(o-n)/s:o===l&&(i=4+(n-t)/s),i=Math.min(i*60,360),i<0&&(i+=360);const p=(r+l)/2;return l===r?u=0:p<=.5?u=s/(l+r):u=s/(2-l-r),[i,u*100,p*100]},b.rgb.hsv=function(e){let n,t,o,r,l;const s=e[0]/255,i=e[1]/255,u=e[2]/255,p=Math.max(s,i,u),h=p-Math.min(s,i,u),d=function(c){return(p-c)/6/h+1/2};return h===0?(r=0,l=0):(l=h/p,n=d(s),t=d(i),o=d(u),s===p?r=o-t:i===p?r=1/3+n-o:u===p&&(r=2/3+t-n),r<0?r+=1:r>1&&(r-=1)),[r*360,l*100,p*100]},b.rgb.hwb=function(e){const n=e[0],t=e[1];let o=e[2];const r=b.rgb.hsl(e)[0],l=1/255*Math.min(n,Math.min(t,o));return o=1-1/255*Math.max(n,Math.max(t,o)),[r,l*100,o*100]},b.rgb.cmyk=function(e){const n=e[0]/255,t=e[1]/255,o=e[2]/255,r=Math.min(1-n,1-t,1-o),l=(1-n-r)/(1-r)||0,s=(1-t-r)/(1-r)||0,i=(1-o-r)/(1-r)||0;return[l*100,s*100,i*100,r*100]};function Et(e,n){return(e[0]-n[0])**2+(e[1]-n[1])**2+(e[2]-n[2])**2}b.rgb.keyword=function(e){const n=Ze[e];if(n)return n;let t=1/0,o;for(const r of Object.keys(pe)){const l=pe[r],s=Et(e,l);s<t&&(t=s,o=r)}return o},b.keyword.rgb=function(e){return pe[e]},b.rgb.xyz=function(e){let n=e[0]/255,t=e[1]/255,o=e[2]/255;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92;const r=n*.4124+t*.3576+o*.1805,l=n*.2126+t*.7152+o*.0722,s=n*.0193+t*.1192+o*.9505;return[r*100,l*100,s*100]},b.rgb.lab=function(e){const n=b.rgb.xyz(e);let t=n[0],o=n[1],r=n[2];t/=95.047,o/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const l=116*o-16,s=500*(t-o),i=200*(o-r);return[l,s,i]},b.hsl.rgb=function(e){const n=e[0]/360,t=e[1]/100,o=e[2]/100;let r,l,s;if(t===0)return s=o*255,[s,s,s];o<.5?r=o*(1+t):r=o+t-o*t;const i=2*o-r,u=[0,0,0];for(let p=0;p<3;p++)l=n+1/3*-(p-1),l<0&&l++,l>1&&l--,6*l<1?s=i+(r-i)*6*l:2*l<1?s=r:3*l<2?s=i+(r-i)*(2/3-l)*6:s=i,u[p]=s*255;return u},b.hsl.hsv=function(e){const n=e[0];let t=e[1]/100,o=e[2]/100,r=t;const l=Math.max(o,.01);o*=2,t*=o<=1?o:2-o,r*=l<=1?l:2-l;const s=(o+t)/2,i=o===0?2*r/(l+r):2*t/(o+t);return[n,i*100,s*100]},b.hsv.rgb=function(e){const n=e[0]/60,t=e[1]/100;let o=e[2]/100;const r=Math.floor(n)%6,l=n-Math.floor(n),s=255*o*(1-t),i=255*o*(1-t*l),u=255*o*(1-t*(1-l));switch(o*=255,r){case 0:return[o,u,s];case 1:return[i,o,s];case 2:return[s,o,u];case 3:return[s,i,o];case 4:return[u,s,o];case 5:return[o,s,i]}},b.hsv.hsl=function(e){const n=e[0],t=e[1]/100,o=e[2]/100,r=Math.max(o,.01);let l,s;s=(2-t)*o;const i=(2-t)*r;return l=t*r,l/=i<=1?i:2-i,l=l||0,s/=2,[n,l*100,s*100]},b.hwb.rgb=function(e){const n=e[0]/360;let t=e[1]/100,o=e[2]/100;const r=t+o;let l;r>1&&(t/=r,o/=r);const s=Math.floor(6*n),i=1-o;l=6*n-s,s&1&&(l=1-l);const u=t+l*(i-t);let p,h,d;switch(s){default:case 6:case 0:p=i,h=u,d=t;break;case 1:p=u,h=i,d=t;break;case 2:p=t,h=i,d=u;break;case 3:p=t,h=u,d=i;break;case 4:p=u,h=t,d=i;break;case 5:p=i,h=t,d=u;break}return[p*255,h*255,d*255]},b.cmyk.rgb=function(e){const n=e[0]/100,t=e[1]/100,o=e[2]/100,r=e[3]/100,l=1-Math.min(1,n*(1-r)+r),s=1-Math.min(1,t*(1-r)+r),i=1-Math.min(1,o*(1-r)+r);return[l*255,s*255,i*255]},b.xyz.rgb=function(e){const n=e[0]/100,t=e[1]/100,o=e[2]/100;let r,l,s;return r=n*3.2406+t*-1.5372+o*-.4986,l=n*-.9689+t*1.8758+o*.0415,s=n*.0557+t*-.204+o*1.057,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,r=Math.min(Math.max(0,r),1),l=Math.min(Math.max(0,l),1),s=Math.min(Math.max(0,s),1),[r*255,l*255,s*255]},b.xyz.lab=function(e){let n=e[0],t=e[1],o=e[2];n/=95.047,t/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const r=116*t-16,l=500*(n-t),s=200*(t-o);return[r,l,s]},b.lab.xyz=function(e){const n=e[0],t=e[1],o=e[2];let r,l,s;l=(n+16)/116,r=t/500+l,s=l-o/200;const i=l**3,u=r**3,p=s**3;return l=i>.008856?i:(l-16/116)/7.787,r=u>.008856?u:(r-16/116)/7.787,s=p>.008856?p:(s-16/116)/7.787,r*=95.047,l*=100,s*=108.883,[r,l,s]},b.lab.lch=function(e){const n=e[0],t=e[1],o=e[2];let r;r=Math.atan2(o,t)*360/2/Math.PI,r<0&&(r+=360);const s=Math.sqrt(t*t+o*o);return[n,s,r]},b.lch.lab=function(e){const n=e[0],t=e[1],r=e[2]/360*2*Math.PI,l=t*Math.cos(r),s=t*Math.sin(r);return[n,l,s]},b.rgb.ansi16=function(e,n=null){const[t,o,r]=e;let l=n===null?b.rgb.hsv(e)[2]:n;if(l=Math.round(l/50),l===0)return 30;let s=30+(Math.round(r/255)<<2|Math.round(o/255)<<1|Math.round(t/255));return l===2&&(s+=60),s},b.hsv.ansi16=function(e){return b.rgb.ansi16(b.hsv.rgb(e),e[2])},b.rgb.ansi256=function(e){const n=e[0],t=e[1],o=e[2];return n===t&&t===o?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(t/255*5)+Math.round(o/255*5)},b.ansi16.rgb=function(e){let n=e%10;if(n===0||n===7)return e>50&&(n+=3.5),n=n/10.5*255,[n,n,n];const t=(~~(e>50)+1)*.5,o=(n&1)*t*255,r=(n>>1&1)*t*255,l=(n>>2&1)*t*255;return[o,r,l]},b.ansi256.rgb=function(e){if(e>=232){const l=(e-232)*10+8;return[l,l,l]}e-=16;let n;const t=Math.floor(e/36)/5*255,o=Math.floor((n=e%36)/6)/5*255,r=n%6/5*255;return[t,o,r]},b.rgb.hex=function(e){const t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t},b.hex.rgb=function(e){const n=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];let t=n[0];n[0].length===3&&(t=t.split("").map(i=>i+i).join(""));const o=parseInt(t,16),r=o>>16&255,l=o>>8&255,s=o&255;return[r,l,s]},b.rgb.hcg=function(e){const n=e[0]/255,t=e[1]/255,o=e[2]/255,r=Math.max(Math.max(n,t),o),l=Math.min(Math.min(n,t),o),s=r-l;let i,u;return s<1?i=l/(1-s):i=0,s<=0?u=0:r===n?u=(t-o)/s%6:r===t?u=2+(o-n)/s:u=4+(n-t)/s,u/=6,u%=1,[u*360,s*100,i*100]},b.hsl.hcg=function(e){const n=e[1]/100,t=e[2]/100,o=t<.5?2*n*t:2*n*(1-t);let r=0;return o<1&&(r=(t-.5*o)/(1-o)),[e[0],o*100,r*100]},b.hsv.hcg=function(e){const n=e[1]/100,t=e[2]/100,o=n*t;let r=0;return o<1&&(r=(t-o)/(1-o)),[e[0],o*100,r*100]},b.hcg.rgb=function(e){const n=e[0]/360,t=e[1]/100,o=e[2]/100;if(t===0)return[o*255,o*255,o*255];const r=[0,0,0],l=n%1*6,s=l%1,i=1-s;let u=0;switch(Math.floor(l)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=i,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=i,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=i}return u=(1-t)*o,[(t*r[0]+u)*255,(t*r[1]+u)*255,(t*r[2]+u)*255]},b.hcg.hsv=function(e){const n=e[1]/100,t=e[2]/100,o=n+t*(1-n);let r=0;return o>0&&(r=n/o),[e[0],r*100,o*100]},b.hcg.hsl=function(e){const n=e[1]/100,o=e[2]/100*(1-n)+.5*n;let r=0;return o>0&&o<.5?r=n/(2*o):o>=.5&&o<1&&(r=n/(2*(1-o))),[e[0],r*100,o*100]},b.hcg.hwb=function(e){const n=e[1]/100,t=e[2]/100,o=n+t*(1-n);return[e[0],(o-n)*100,(1-o)*100]},b.hwb.hcg=function(e){const n=e[1]/100,o=1-e[2]/100,r=o-n;let l=0;return r<1&&(l=(o-r)/(1-r)),[e[0],r*100,l*100]},b.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},b.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},b.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},b.gray.hsl=function(e){return[0,0,e[0]]},b.gray.hsv=b.gray.hsl,b.gray.hwb=function(e){return[0,100,e[0]]},b.gray.cmyk=function(e){return[0,0,0,e[0]]},b.gray.lab=function(e){return[e[0],0,0]},b.gray.hex=function(e){const n=Math.round(e[0]/100*255)&255,o=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(o.length)+o},b.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const we=Qe;function St(){const e={},n=Object.keys(we);for(let t=n.length,o=0;o<t;o++)e[n[o]]={distance:-1,parent:null};return e}function Mt(e){const n=St(),t=[e];for(n[e].distance=0;t.length;){const o=t.pop(),r=Object.keys(we[o]);for(let l=r.length,s=0;s<l;s++){const i=r[s],u=n[i];u.distance===-1&&(u.distance=n[o].distance+1,u.parent=o,t.unshift(i))}}return n}function Ft(e,n){return function(t){return n(e(t))}}function Tt(e,n){const t=[n[e].parent,e];let o=we[n[e].parent][e],r=n[e].parent;for(;n[r].parent;)t.unshift(n[r].parent),o=Ft(we[n[r].parent][r],o),r=n[r].parent;return o.conversion=t,o}var Vt=function(e){const n=Mt(e),t={},o=Object.keys(n);for(let r=o.length,l=0;l<r;l++){const s=o[l];n[s].parent!==null&&(t[s]=Tt(s,n))}return t};const Ae=Qe,Dt=Vt,le={},Lt=Object.keys(Ae);function Bt(e){const n=function(...t){const o=t[0];return o==null?o:(o.length>1&&(t=o),e(t))};return"conversion"in e&&(n.conversion=e.conversion),n}function At(e){const n=function(...t){const o=t[0];if(o==null)return o;o.length>1&&(t=o);const r=e(t);if(typeof r=="object")for(let l=r.length,s=0;s<l;s++)r[s]=Math.round(r[s]);return r};return"conversion"in e&&(n.conversion=e.conversion),n}Lt.forEach(e=>{le[e]={},Object.defineProperty(le[e],"channels",{value:Ae[e].channels}),Object.defineProperty(le[e],"labels",{value:Ae[e].labels});const n=Dt(e);Object.keys(n).forEach(o=>{const r=n[o];le[e][o]=At(r),le[e][o].raw=Bt(r)})});var $t=le;const ie=wt,W=$t,et=["keyword","gray","hex"],$e={};for(const e of Object.keys(W))$e[[...W[e].labels].sort().join("")]=e;const Ee={};function P(e,n){if(!(this instanceof P))return new P(e,n);if(n&&n in et&&(n=null),n&&!(n in W))throw new Error("Unknown model: "+n);let t,o;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof P)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){const r=ie.get(e);if(r===null)throw new Error("Unable to parse color from string: "+e);this.model=r.model,o=W[this.model].channels,this.color=r.value.slice(0,o),this.valpha=typeof r.value[o]=="number"?r.value[o]:1}else if(e.length>0){this.model=n||"rgb",o=W[this.model].channels;const r=Array.prototype.slice.call(e,0,o);this.color=Oe(r,o),this.valpha=typeof e[o]=="number"?e[o]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const r=Object.keys(e);"alpha"in e&&(r.splice(r.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const l=r.sort().join("");if(!(l in $e))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=$e[l];const{labels:s}=W[this.model],i=[];for(t=0;t<s.length;t++)i.push(e[s[t]]);this.color=Oe(i)}if(Ee[this.model])for(o=W[this.model].channels,t=0;t<o;t++){const r=Ee[this.model][t];r&&(this.color[t]=r(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}P.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let n=this.model in ie.to?this:this.rgb();n=n.round(typeof e=="number"?e:1);const t=n.valpha===1?n.color:[...n.color,this.valpha];return ie.to[n.model](t)},percentString(e){const n=this.rgb().round(typeof e=="number"?e:1),t=n.valpha===1?n.color:[...n.color,this.valpha];return ie.to.rgb.percent(t)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:n}=W[this.model],{labels:t}=W[this.model];for(let o=0;o<n;o++)e[t[o]]=this.color[o];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new P([...this.color.map(Rt(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new P([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:B("rgb",0,$(255)),green:B("rgb",1,$(255)),blue:B("rgb",2,$(255)),hue:B(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:B("hsl",1,$(100)),lightness:B("hsl",2,$(100)),saturationv:B("hsv",1,$(100)),value:B("hsv",2,$(100)),chroma:B("hcg",1,$(100)),gray:B("hcg",2,$(100)),white:B("hwb",1,$(100)),wblack:B("hwb",2,$(100)),cyan:B("cmyk",0,$(100)),magenta:B("cmyk",1,$(100)),yellow:B("cmyk",2,$(100)),black:B("cmyk",3,$(100)),x:B("xyz",0,$(95.047)),y:B("xyz",1,$(100)),z:B("xyz",2,$(108.833)),l:B("lab",0,$(100)),a:B("lab",1),b:B("lab",2),keyword(e){return e!==void 0?new P(e):W[this.model].keyword(this.color)},hex(e){return e!==void 0?new P(e):ie.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new P(e);const n=this.rgb().round().color;let t=Math.round(this.valpha*255).toString(16).toUpperCase();return t.length===1&&(t="0"+t),ie.to.hex(n)+t},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,n=[];for(const[t,o]of e.entries()){const r=o/255;n[t]=r<=.04045?r/12.92:((r+.055)/1.055)**2.4}return .2126*n[0]+.7152*n[1]+.0722*n[2]},contrast(e){const n=this.luminosity(),t=e.luminosity();return n>t?(n+.05)/(t+.05):(t+.05)/(n+.05)},level(e){const n=this.contrast(e);return n>=7?"AAA":n>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let n=0;n<3;n++)e.color[n]=255-e.color[n];return e},lighten(e){const n=this.hsl();return n.color[2]+=n.color[2]*e,n},darken(e){const n=this.hsl();return n.color[2]-=n.color[2]*e,n},saturate(e){const n=this.hsl();return n.color[1]+=n.color[1]*e,n},desaturate(e){const n=this.hsl();return n.color[1]-=n.color[1]*e,n},whiten(e){const n=this.hwb();return n.color[1]+=n.color[1]*e,n},blacken(e){const n=this.hwb();return n.color[2]+=n.color[2]*e,n},grayscale(){const e=this.rgb().color,n=e[0]*.3+e[1]*.59+e[2]*.11;return P.rgb(n,n,n)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const n=this.hsl();let t=n.color[0];return t=(t+e)%360,t=t<0?360+t:t,n.color[0]=t,n},mix(e,n){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const t=e.rgb(),o=this.rgb(),r=n===void 0?.5:n,l=2*r-1,s=t.alpha()-o.alpha(),i=((l*s===-1?l:(l+s)/(1+l*s))+1)/2,u=1-i;return P.rgb(i*t.red()+u*o.red(),i*t.green()+u*o.green(),i*t.blue()+u*o.blue(),t.alpha()*r+o.alpha()*(1-r))}};for(const e of Object.keys(W)){if(et.includes(e))continue;const{channels:n}=W[e];P.prototype[e]=function(...t){return this.model===e?new P(this):t.length>0?new P(t,e):new P([...Pt(W[this.model][e].raw(this.color)),this.valpha],e)},P[e]=function(...t){let o=t[0];return typeof o=="number"&&(o=Oe(t,n)),new P(o,e)}}function Ot(e,n){return Number(e.toFixed(n))}function Rt(e){return function(n){return Ot(n,e)}}function B(e,n,t){e=Array.isArray(e)?e:[e];for(const o of e)(Ee[o]||(Ee[o]=[]))[n]=t;return e=e[0],function(o){let r;return o!==void 0?(t&&(o=t(o)),r=this[e](),r.color[n]=o,r):(r=this[e]().color[n],t&&(r=t(r)),r)}}function $(e){return function(n){return Math.max(0,Math.min(e,n))}}function Pt(e){return Array.isArray(e)?e:[e]}function Oe(e,n){for(let t=0;t<n;t++)typeof e[t]!="number"&&(e[t]=0);return e}var Nt=P;const D=Xe(Nt);function tt(e){return D(e)}function nt(e){return e.hex()}function Ht(e){const{h:n,s:t,v:o}=e.hsv().object();return{color:D.hsv(n,t,100),value:o}}function It(e,n){const{h:t,s:o}=e.hsv().object();return D.hsv(t,o,n)}function ot(e,n){const t=It(e,n);return nt(t)}function jt(){const e=a.ref(),n=255*6+1,t=256;function o(){if(!e.value)return;const h=e.value;h.width=n,h.height=t;const d=h.getContext("2d");if(!d)return;d.clearRect(0,0,n,t);const c=d.createLinearGradient(0,0,n,0);c.addColorStop(0,"#FF0000"),c.addColorStop(1/6,"#FFFF00"),c.addColorStop(1/3,"#00FF00"),c.addColorStop(1/2,"#00FFFF"),c.addColorStop(2/3,"#0000FF"),c.addColorStop(5/6,"#FF00FF"),c.addColorStop(1,"#FF0000"),d.fillStyle=c,d.fillRect(0,0,n,t);const f=d.createLinearGradient(0,t,0,0);f.addColorStop(0,"rgb(255 255 255 / 100%)"),f.addColorStop(1,"rgb(255 255 255 / 0%)"),d.fillStyle=f,d.fillRect(0,0,n,t)}function r(h){const d=tt(h);return l(d)}function l(h){const{r:d,g:c,b:f}=h.rgb().object(),m=[{type:"r",value:d},{type:"g",value:c},{type:"b",value:f}];m.sort((x,w)=>w.value-x.value);const v=m[0],C=m[1],g=v.type+C.type;let y=0;const _=m[2].value;return g==="rg"||g==="gr"?(y=255,C.type==="r"?y+=255-s(_,C.value):y-=255-s(_,C.value)):g==="gb"||g==="bg"?(y=255*3,C.type==="g"?y+=255-s(_,C.value):y-=255-s(_,C.value)):(g==="rb"||g==="br")&&(y=255*5,C.type==="b"?y+=255-s(_,C.value):y-=255-s(_,C.value)),{x:y,y:_}}function s(h,d){return h===255?255:(255*d-255*h)/(255-h)}function i(h,d,c,f){if(!e.value)return D();const m=n/c,v=t/f;return h=Math.round(Math.min(h*m,n-1)),d=Math.round(Math.min(d*v,t-1)),u(h,d)}function u(h,d){let c=0,f=0,m=0;const v=255,C=p(h,0,v)||p(h,v*5,v*6),g=p(h,v,v*3),y=p(h,v*3,v*5);C?c=255:h<=v*2?c=Math.max(2*v-h,0):h>=v*4&&(c=Math.max(h-v*4,0)),g?f=255:h<v?f=Math.max(h,0):f=Math.max(v*4-h,0),y?m=255:h<v*3?m=Math.max(h-v*2,0):m=Math.max(v*6-h,0);const _=v-c,x=v-f,w=v-m,k=d/v;return c+=_*k,f+=x*k,m+=w*k,D.rgb(c,f,m)}function p(h,d,c){return h>=d&&h<=c}return a.onMounted(()=>{o()}),{canvasWidth:n,canvasHeight:t,colorAreaCanvas:e,drawColorArea:o,getCoordinateByColor:l,getCoordinateByHex:r,getColorByCoordinate:i}}function zt(e,n=200){let t=null;return function(...o){const r=this;t||(t=window.setTimeout(()=>{e.apply(r,o),t=null},n))}}function Ut(e){const n=a.ref(),t=a.reactive({x:0,y:0}),o=a.computed(()=>a.isRef(e.disabled)?e.disabled.value:e.disabled);function r(f){if(o.value||f.touches.length===0)return;f.preventDefault();const{clientX:m,clientY:v}=f.touches[0];p({x:m,y:v}),document.body.addEventListener("touchmove",l),document.body.addEventListener("touchend",s)}function l(f){if(f.touches.length>1)return;const{clientX:m,clientY:v}=f.touches[0];p({x:m,y:v})}function s(){document.body.removeEventListener("touchmove",l),document.body.removeEventListener("touchend",s)}function i(f){o.value||(document.body.addEventListener("mousemove",u),document.body.addEventListener("mouseup",d),p({x:f.clientX,y:f.clientY}))}function u(f){if(!f.buttons){d();return}p({x:f.clientX,y:f.clientY})}const p=zt(h,20);function h(f){var F;if(o.value)return;const{x:m,y:v}=f,C=(F=n.value)==null?void 0:F.getBoundingClientRect();if(!C)return;const{left:g,top:y,width:_,height:x}=C;let w=0,k=0;m<=g?w=0:m>=g+_?w=_:w=m-g,v<=y?k=0:v>=y+x?k=x:k=v-y,t.x=w,t.y=k}function d(){document.body.removeEventListener("mousemove",u),document.body.removeEventListener("mouseup",d)}function c(f,m,v,C){var k;const g=(k=n.value)==null?void 0:k.getBoundingClientRect();if(!g)return;const{width:y,height:_}=g,x=y/v,w=_/C;t.x=f*x,t.y=m*w}return a.onMounted(()=>{var f,m;(f=n.value)==null||f.addEventListener("touchstart",r),(m=n.value)==null||m.addEventListener("mousedown",i)}),a.onBeforeUnmount(()=>{var f,m;(f=n.value)==null||f.removeEventListener("touchstart",r),document.body.removeEventListener("touchmove",l),document.body.removeEventListener("touchend",s),(m=n.value)==null||m.removeEventListener("mousedown",i),document.body.removeEventListener("mousemove",u),document.body.removeEventListener("mouseup",d)}),{colorAreaRef:n,circlePickerCoordinate:t,setCirclePickerCoordinate:c}}const ee="#FFFFFF",Xt={class:"hv-color-picker__color-form"},Yt={class:"mb-12"},Wt={class:"hv-color-picker__form-group mb-12"},Gt={class:"hv-color-picker__form-group mb-12"},qt=a.defineComponent({__name:"ColorForm",props:{modelValue:{},disabled:{type:Boolean}},emits:["change"],setup(e,{emit:n}){const t=e,o=n,r=a.ref(D(t.modelValue||ee).hex()),l=a.reactive(D(r.value||ee).rgb().object()),s=a.reactive(D(r.value||ee).hsv().object());function i(d){return`#${d.replace(/[^0-9A-F]/gi,"").slice(0,6).toUpperCase()}`}a.watch(()=>t.modelValue,d=>{const c=D(d);r.value=c.hex();const{r:f,g:m,b:v}=c.rgb().object(),{h:C,s:g,v:y}=c.hsv().object();Object.assign(l,{r:f,g:m,b:v}),Object.assign(s,{h:C,s:g,v:y})});function u(){(r.value||"").replace(/[^0-9A-F]/gi,"").length===6?o("change",r.value):r.value=t.modelValue}function p(){const{r:d,g:c,b:f}=l;o("change",D.rgb(d,c,f).hex().toString())}function h(){const{h:d,s:c,v:f}=s;o("change",D.hsv(d,c,f).hex().toString())}return(d,c)=>{const f=a.resolveComponent("el-input"),m=a.resolveComponent("el-input-number");return a.openBlock(),a.createElementBlock("div",Xt,[a.createElementVNode("div",Yt,[a.createVNode(f,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=v=>r.value=v),disabled:t.disabled,formatter:i,onChange:u},null,8,["modelValue","disabled"])]),a.createElementVNode("div",Wt,[c[7]||(c[7]=a.createElementVNode("div",{class:"hv-color-picker__form-label"},"RGB",-1)),a.createVNode(m,{modelValue:l.r,"onUpdate:modelValue":c[1]||(c[1]=v=>l.r=v),disabled:t.disabled,onChange:p,"step-strictly":"",min:0,max:255,step:1,controls:!1},null,8,["modelValue","disabled"]),a.createVNode(m,{modelValue:l.g,"onUpdate:modelValue":c[2]||(c[2]=v=>l.g=v),disabled:t.disabled,onChange:p,"step-strictly":"",min:0,max:255,step:1,controls:!1},null,8,["modelValue","disabled"]),a.createVNode(m,{modelValue:l.b,"onUpdate:modelValue":c[3]||(c[3]=v=>l.b=v),disabled:t.disabled,onChange:p,"step-strictly":"",min:0,max:255,step:1,controls:!1},null,8,["modelValue","disabled"])]),a.createElementVNode("div",Gt,[c[8]||(c[8]=a.createElementVNode("div",{class:"hv-color-picker__form-label"},"HSV",-1)),a.createVNode(m,{modelValue:s.h,"onUpdate:modelValue":c[4]||(c[4]=v=>s.h=v),disabled:t.disabled,onChange:h,min:0,max:360,"step-strictly":"",step:1,controls:!1},null,8,["modelValue","disabled"]),a.createVNode(m,{modelValue:s.s,"onUpdate:modelValue":c[5]||(c[5]=v=>s.s=v),disabled:t.disabled,onChange:h,min:0,max:100,"step-strictly":"",step:1,controls:!1},null,8,["modelValue","disabled"]),a.createVNode(m,{modelValue:s.v,"onUpdate:modelValue":c[6]||(c[6]=v=>s.v=v),disabled:t.disabled,onChange:h,"step-strictly":"",min:0,max:100,controls:!1},null,8,["modelValue","disabled"])])])}}}),Kt={class:"hv-color-picker__preset"},Jt={class:"hv-color-picker__preset-title"},Zt={class:"hv-color-picker__preset-list"},Qt=["onClick"],en=a.defineComponent({__name:"PresetColors",props:{title:{},presetColors:{}},emits:["change"],setup(e,{emit:n}){const t=["#000000","#FFFFFF","#E3822D","#DCE24F","#1DCF69","#6DE5B9","#11A1F2","#AA43FF","#F0689C","#F8D28B","#606368","#E83C34","#EEBE29","#89F0AC","#2FBC9E","#56CCF2","#1C1DFA","#DC88F5","#D4C595","#C52F65"],o=e,r=a.computed(()=>o.presetColors?o.presetColors:t),l=n;function s(i){l("change",i)}return(i,u)=>(a.openBlock(),a.createElementBlock("div",Kt,[a.createElementVNode("div",Jt,a.toDisplayString(o.title||"Preset colors"),1),a.createElementVNode("div",Zt,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.value,p=>(a.openBlock(),a.createElementBlock("div",{class:"hv-color-picker__preset-list-item",onClick:h=>s(p),key:p,style:a.normalizeStyle({backgroundColor:p})},null,12,Qt))),128))])]))}}),tn={class:"hv-color-picker"},nn={class:"hv-color-picker__title"},on={class:"hv-color-picker__area-outer"},rn={class:"hv-color-picker__slider"},an=a.defineComponent({name:"HvColorPicker",__name:"ColorPicker",props:{modelValue:{default:ee},disabled:{type:Boolean},title:{},presetTitle:{},presetColors:{}},emits:["update:model-value"],setup(e,{emit:n}){const t=e,o=n,r=a.computed(()=>t.disabled),{colorAreaCanvas:l,getColorByCoordinate:s,getCoordinateByColor:i,canvasWidth:u,canvasHeight:p}=jt(),{colorAreaRef:h,circlePickerCoordinate:d,setCirclePickerCoordinate:c}=Ut({disabled:r}),f=a.computed({get(){return t.modelValue},set(x){o("update:model-value",x)}}),m=a.ref(D(ee)),v=a.ref(100),C=a.computed(()=>m.value?ot(m.value,v.value):ee);a.watch(f,x=>{ot(m.value,v.value)!==x&&_(x)}),a.watch(()=>d,x=>{var F;const w=(F=h.value)==null?void 0:F.getBoundingClientRect();if(!w)return;const k=s(x.x,x.y,w.width,w.height);m.value=k},{deep:!0});const g=a.computed(()=>f.value?{top:d.y+"px",left:d.x+"px",backgroundColor:m.value.hex()}:{top:"100%",left:"0",backgroundColor:"#ffffff"}),y=a.computed(()=>{const x=nt(m.value);return{"--el-slider-runway-bg-color":`linear-gradient(to right, #000000, ${x})`,"--el-slider-main-bg-color":x}});a.watch(()=>C.value,(x,w)=>{if(x!==w){o("update:model-value",x);return}});function _(x){if(t.disabled)return;const w=tt(x),{color:k,value:F}=Ht(w);m.value=k,v.value=F;const z=i(k);c(z.x,z.y,u,p)}return a.onMounted(()=>{_(f.value)}),(x,w)=>{const k=a.resolveComponent("ElSlider");return a.openBlock(),a.createElementBlock("div",tn,[a.createElementVNode("div",nn,a.toDisplayString(t.title||"Color picker"),1),a.createElementVNode("div",on,[a.createElementVNode("div",{class:a.normalizeClass(["hv-color-picker__area",r.value?"is-disabled":""]),ref_key:"colorAreaRef",ref:h},[a.createElementVNode("canvas",{ref_key:"colorAreaCanvas",ref:l},null,512),a.createElementVNode("div",{class:"hv-color-picker__circle",style:a.normalizeStyle(g.value)},null,4)],2)]),a.createElementVNode("div",rn,[a.createVNode(k,{modelValue:v.value,"onUpdate:modelValue":w[0]||(w[0]=F=>v.value=F),disabled:t.disabled,min:0,max:100,"show-tooltip":!1,style:a.normalizeStyle(y.value)},null,8,["modelValue","disabled","style"]),a.createElementVNode("div",{class:"hv-color-picker__origin-color",style:a.normalizeStyle({backgroundColor:C.value})},null,4)]),a.createVNode(qt,{"model-value":f.value,disabled:t.disabled,onChange:_},null,8,["model-value","disabled"]),a.createVNode(en,{onChange:_,title:t.presetTitle,presetColors:t.presetColors},null,8,["title","presetColors"])])}}});function sn(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Re=sn,ln=typeof ke=="object"&&ke&&ke.Object===Object&&ke,cn=ln,dn=cn,un=typeof self=="object"&&self&&self.Object===Object&&self,hn=dn||un||Function("return this")(),rt=hn,fn=rt,mn=function(){return fn.Date.now()},pn=mn,vn=/\s/;function gn(e){for(var n=e.length;n--&&vn.test(e.charAt(n)););return n}var bn=gn,yn=bn,Cn=/^\s+/;function _n(e){return e&&e.slice(0,yn(e)+1).replace(Cn,"")}var kn=_n,xn=rt,wn=xn.Symbol,at=wn,st=at,lt=Object.prototype,En=lt.hasOwnProperty,Sn=lt.toString,ve=st?st.toStringTag:void 0;function Mn(e){var n=En.call(e,ve),t=e[ve];try{e[ve]=void 0;var o=!0}catch{}var r=Sn.call(e);return o&&(n?e[ve]=t:delete e[ve]),r}var Fn=Mn,Tn=Object.prototype,Vn=Tn.toString;function Dn(e){return Vn.call(e)}var Ln=Dn,it=at,Bn=Fn,An=Ln,$n="[object Null]",On="[object Undefined]",ct=it?it.toStringTag:void 0;function Rn(e){return e==null?e===void 0?On:$n:ct&&ct in Object(e)?Bn(e):An(e)}var Pn=Rn;function Nn(e){return e!=null&&typeof e=="object"}var Hn=Nn,In=Pn,jn=Hn,zn="[object Symbol]";function Un(e){return typeof e=="symbol"||jn(e)&&In(e)==zn}var Xn=Un,Yn=kn,dt=Re,Wn=Xn,ut=NaN,Gn=/^[-+]0x[0-9a-f]+$/i,qn=/^0b[01]+$/i,Kn=/^0o[0-7]+$/i,Jn=parseInt;function Zn(e){if(typeof e=="number")return e;if(Wn(e))return ut;if(dt(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=dt(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Yn(e);var t=qn.test(e);return t||Kn.test(e)?Jn(e.slice(2),t?2:8):Gn.test(e)?ut:+e}var Qn=Zn,eo=Re,Pe=pn,ht=Qn,to="Expected a function",no=Math.max,oo=Math.min;function ro(e,n,t){var o,r,l,s,i,u,p=0,h=!1,d=!1,c=!0;if(typeof e!="function")throw new TypeError(to);n=ht(n)||0,eo(t)&&(h=!!t.leading,d="maxWait"in t,l=d?no(ht(t.maxWait)||0,n):l,c="trailing"in t?!!t.trailing:c);function f(k){var F=o,z=r;return o=r=void 0,p=k,s=e.apply(z,F),s}function m(k){return p=k,i=setTimeout(g,n),h?f(k):s}function v(k){var F=k-u,z=k-p,te=n-F;return d?oo(te,l-z):te}function C(k){var F=k-u,z=k-p;return u===void 0||F>=n||F<0||d&&z>=l}function g(){var k=Pe();if(C(k))return y(k);i=setTimeout(g,v(k))}function y(k){return i=void 0,c&&o?f(k):(o=r=void 0,s)}function _(){i!==void 0&&clearTimeout(i),p=0,o=u=r=i=void 0}function x(){return i===void 0?s:y(Pe())}function w(){var k=Pe(),F=C(k);if(o=arguments,r=this,u=k,F){if(i===void 0)return m(u);if(d)return clearTimeout(i),i=setTimeout(g,n),f(u)}return i===void 0&&(i=setTimeout(g,n)),s}return w.cancel=_,w.flush=x,w}var ao=ro,so=ao,lo=Re,io="Expected a function";function co(e,n,t){var o=!0,r=!0;if(typeof e!="function")throw new TypeError(io);return lo(t)&&(o="leading"in t?!!t.leading:o,r="trailing"in t?!!t.trailing:r),so(e,n,{leading:o,maxWait:n,trailing:r})}var uo=co;const ft=Xe(uo);let Ne={x:void 0,y:void 0};function ho(e){const n=a.ref(),t=a.reactive({x:100,y:100});function o(c){if(e.value||c.touches.length===0)return;c.preventDefault();const{clientX:f,clientY:m}=c.touches[0];u({x:f,y:m}),document.body.addEventListener("touchmove",r),document.body.addEventListener("touchend",l)}function r(c){if(e.value||c.touches.length>1)return;const{clientX:f,clientY:m}=c.touches[0];u({x:f,y:m})}function l(){document.body.removeEventListener("touchmove",r),document.body.removeEventListener("touchend",l)}function s(c){e.value||(document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",h),u({x:c.clientX,y:c.clientY}))}function i(c){if(!e.value){if(!c.buttons){h();return}u({x:c.clientX,y:c.clientY})}}const u=ft(p,20);function p(c){var k;const{x:f,y:m}=c;if(Ne.x==c.x&&Ne.y==c.y)return;Ne=c;const v=(k=n.value)==null?void 0:k.getBoundingClientRect();if(!v)return;const{left:C,top:g,width:y,height:_}=v;let x=0,w=0;f<=C?x=0:f>=C+y?x=y:x=f-C,m<=g?w=0:m>=g+_?w=_:w=m-g,t.x=x/y*100,t.y=(_-w)/_*100}function h(){document.body.removeEventListener("mousemove",i),document.body.removeEventListener("mouseup",h)}function d(c,f){t.x=c,t.y=f}return a.onMounted(()=>{var c,f;(c=n.value)==null||c.addEventListener("touchstart",o),(f=n.value)==null||f.addEventListener("mousedown",s)}),a.onBeforeUnmount(()=>{var c,f;(c=n.value)==null||c.removeEventListener("touchstart",o),document.body.removeEventListener("touchmove",r),document.body.removeEventListener("touchend",l),(f=n.value)==null||f.removeEventListener("mousedown",s),document.body.removeEventListener("mousemove",i),document.body.removeEventListener("mouseup",h)}),{colorAreaRef:n,circlePickerCoordinate:t,setCirclePickerCoordinate:d}}const fo=a.defineComponent({__name:"ColorArea",props:{saturation:{default:100},value:{default:100},color:{},hueColor:{},disabled:{type:Boolean}},emits:["update:saturation","update:value"],setup(e,{emit:n}){const t=n,o=e,r=a.computed({get(){return o.saturation},set(d){t("update:saturation",d)}}),l=a.computed({get(){return o.value},set(d){t("update:value",d)}}),s=a.computed(()=>o.disabled),{colorAreaRef:i,circlePickerCoordinate:u,setCirclePickerCoordinate:p}=ho(s),h=a.reactive({hexColor:"",bgHexColor:""});return a.watch(()=>o.color,d=>{const c=D(d);h.hexColor=c.hex();let{h:f,s:m,v}=c.hsv().object();h.bgHexColor=D({h:f,s:100,v:100}).hex(),D.hsv({h:f,s:u.x,v:u.y}).hex()==c.hex()&&(m=u.x),p(m,v)},{immediate:!0}),a.watch(u,d=>{r.value=d.x,l.value=d.y},{deep:!0}),(d,c)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"colorAreaRef",ref:i,class:"hv-color-picker__color-area-outer"},[a.createElementVNode("div",{class:"hv-color-picker__color-area",style:a.normalizeStyle({backgroundColor:o.hueColor})},[a.createElementVNode("div",{class:"hv-color-picker__circle",style:a.normalizeStyle({backgroundColor:h.hexColor,left:`${a.unref(u).x}%`,bottom:`${a.unref(u).y}%`})},null,4)],4)],512))}}),ge=(e,n)=>{const t=e.__vccOpts||e;for(const[o,r]of n)t[o]=r;return t},mo=ge(fo,[["__scopeId","data-v-d4f5b081"]]),po={class:"hv-color_picker__form mb-12"},vo={class:"hv-color-picker__form-type"},go={class:"hv-color-picker__form-body"},bo=ge(a.defineComponent({name:"HvColorPickerNormal",__name:"ColorForm",props:{modelValue:{},disabled:{type:Boolean},enableAlpha:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:n}){const t=["RGB","HSL","HSV"],o=e,r=n,l=a.ref("RGB"),s=a.ref([255,255,255,100]),i=a.computed(()=>l.value==="RGB");a.watch(()=>o.modelValue,()=>{u()},{immediate:!0});function u(){const h=D(o.modelValue),d=h.alpha()*100;switch(l.value){case"RGB":{const c=h.rgb().array();s.value=[...c.slice(0,3),d];break}case"HSL":{const c=h.hsl().array();s.value=[...c.slice(0,3),d];break}case"HSV":{const c=h.hsv().array();s.value=[...c.slice(0,3),d];break}}}function p(){let h=D(ee);switch(l.value){case"RGB":{h=D.rgb(...s.value.slice(0,3));break}case"HSL":{h=D.hsl(...s.value.slice(0,3));break}case"HSV":{h=D.hsv(...s.value.slice(0,3));break}}r("update:modelValue",h.alpha(o.enableAlpha?s.value[3]/100:1).hexa())}return(h,d)=>{const c=a.resolveComponent("el-option"),f=a.resolveComponent("el-select"),m=a.resolveComponent("el-input-number");return a.openBlock(),a.createElementBlock("div",po,[a.createElementVNode("div",vo,[a.createVNode(f,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=v=>l.value=v),disabled:o.disabled,"popper-class":"hv-color-picker-popper",onChange:u,teleported:!1},{default:a.withCtx(()=>[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(t,v=>a.createVNode(c,{key:v,label:v,value:v},null,8,["label","value"])),64))]),_:1},8,["modelValue","disabled"])]),a.createElementVNode("div",go,[a.createVNode(m,{modelValue:s.value[0],"onUpdate:modelValue":d[1]||(d[1]=v=>s.value[0]=v),onChange:p,"step-strictly":"",disabled:o.disabled,min:0,max:i.value?255:360,step:1,controls:!1},null,8,["modelValue","disabled","max"]),a.createVNode(m,{modelValue:s.value[1],"onUpdate:modelValue":d[2]||(d[2]=v=>s.value[1]=v),onChange:p,"step-strictly":"",disabled:o.disabled,min:0,max:i.value?255:100,step:1,controls:!1},null,8,["modelValue","disabled","max"]),a.createVNode(m,{modelValue:s.value[2],"onUpdate:modelValue":d[3]||(d[3]=v=>s.value[2]=v),onChange:p,"step-strictly":"",disabled:o.disabled,min:0,max:i.value?255:100,step:1,controls:!1},null,8,["modelValue","disabled","max"]),o.enableAlpha?(a.openBlock(),a.createBlock(m,{key:0,modelValue:s.value[3],"onUpdate:modelValue":d[4]||(d[4]=v=>s.value[3]=v),onChange:p,"step-strictly":"",disabled:o.disabled,min:0,max:100,step:1,controls:!1},{suffix:a.withCtx(()=>d[5]||(d[5]=[a.createElementVNode("span",null,"%",-1)])),_:1},8,["modelValue","disabled"])):a.createCommentVNode("",!0)])])}}}),[["__scopeId","data-v-855a2e17"]]),yo={class:"hv-color-picker__preset"},Co={class:"hv-color-picker__preset-title"},_o={class:"hv-color-picker__preset-list"},ko=["onClick"],xo=ge(a.defineComponent({__name:"PresetColors",props:{title:{},presetColors:{}},emits:["change"],setup(e,{emit:n}){const t=["#000000","#FFFFFF","#E3822D","#DCE24F","#1DCF69","#6DE5B9","#11A1F2","#AA43FF","#F0689C","#F8D28B","#606368","#E83C34","#EEBE29","#89F0AC","#2FBC9E","#56CCF2","#1C1DFA","#DC88F5","#D4C595","#C52F65"],o=e,r=a.computed(()=>o.presetColors?o.presetColors:t),l=n;function s(i){l("change",i)}return(i,u)=>(a.openBlock(),a.createElementBlock("div",yo,[a.createElementVNode("div",Co,a.toDisplayString(o.title||"Reset colors"),1),a.createElementVNode("div",_o,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.value,p=>(a.openBlock(),a.createElementBlock("div",{class:"hv-color-picker__preset-list-item",onClick:h=>s(p),key:p,style:a.normalizeStyle({backgroundColor:p})},null,12,ko))),128))])]))}}),[["__scopeId","data-v-c15cc053"]]),wo={class:"hv-color-picker-normal"},Eo={class:"hv-color-picker__color-select-box"},So={class:"hv-color-picker__sliders"},Mo=ge(a.defineComponent({name:"HvColorPickerNormal",__name:"ColorPicker",props:{modelValue:{default:ee},disabled:{type:Boolean},enableAlpha:{type:Boolean,default:!0},presetTitle:{},presetColors:{}},emits:["update:model-value"],setup(e,{emit:n}){const t=n,o=e,r=a.computed({get(){return o.modelValue},set(C){t("update:model-value",C)}}),l=!!window.EyeDropper,s=a.ref(),i=a.ref(0),u=a.ref(0),p=a.ref(100),h=a.ref(100),d=a.computed(()=>D(r.value).alpha(1).hex());a.watch(r,C=>{const g=D(C),{h:y,s:_}=g.hsv().object();p.value=_;const x=[0,360];u.value=o.enableAlpha?Math.round(g.alpha()*100):100,D.hsv({h:i.value,s:p.value,v:h.value,alpha:u.value}).hexa()!==g.hexa()&&(x.includes(y)&&x.includes(i.value)||(i.value=y))},{immediate:!0});const c=a.computed(()=>D({h:i.value,s:100,v:100}).hex());a.watch([i,u,p,h],()=>{f()});const f=ft(function(){const g=D({h:i.value,s:p.value,v:h.value,alpha:u.value/100});r.value=o.enableAlpha?g.hexa():g.hex()},50,{leading:!1,trailing:!0});function m(){if(o.disabled)return;new window.EyeDropper().open().then(g=>{r.value=g.sRGBHex}).catch(g=>{console.error("Eyedropper failed to get color",g)})}function v(C){o.disabled||(r.value=C)}return(C,g)=>{const y=a.resolveComponent("ElSlider");return a.openBlock(),a.createElementBlock("div",wo,[a.createVNode(mo,{ref_key:"colorAreaRef",ref:s,"hue-color":c.value,color:r.value,saturation:p.value,"onUpdate:saturation":g[0]||(g[0]=_=>p.value=_),value:h.value,"onUpdate:value":g[1]||(g[1]=_=>h.value=_),disabled:o.disabled},null,8,["hue-color","color","saturation","value","disabled"]),a.createElementVNode("div",Eo,[l?(a.openBlock(),a.createElementBlock("svg",{key:0,onClick:m,class:a.normalizeClass(["hv-color-picker__dropper",o.disabled?"is-disabled":""]),width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g[5]||(g[5]=[a.createElementVNode("path",{d:"M22.9297 5.8C21.863 4.73333 20.263 4.73333 19.1964 5.8L15.463 9.53332L14.3963 8.59999C13.863 8.06666 13.063 8.06666 12.5296 8.59999C11.9963 9.13332 11.9963 9.93332 12.5296 10.4667L13.463 11.4L5.72967 19.1333C5.19634 19.6666 4.39634 21.6666 5.72967 23C7.06299 24.3333 9.06299 23.5333 9.59632 23L17.3296 15.2666L18.263 16.2C18.7964 16.7333 19.5964 16.7333 20.1297 16.2C20.663 15.6666 20.663 14.8666 20.1297 14.3333L19.1964 13.4L22.9297 9.66666C23.9964 8.46666 23.9964 6.86666 22.9297 5.8ZM8.39632 21.6666H7.06299V20.3333L14.7963 12.6L16.1296 13.9333C15.9963 13.9333 8.39632 21.6666 8.39632 21.6666Z",fill:"currentcolor"},null,-1)]),2)):a.createCommentVNode("",!0),a.createElementVNode("div",So,[a.createVNode(y,{modelValue:i.value,"onUpdate:modelValue":g[2]||(g[2]=_=>i.value=_),min:0,max:360,disabled:o.disabled,"show-tooltip":!1,class:"hv-color-picker__hue-slider",style:a.normalizeStyle({"--el-slider-button-bg-color":c.value})},null,8,["modelValue","disabled","style"]),o.enableAlpha?(a.openBlock(),a.createBlock(y,{key:0,modelValue:u.value,"onUpdate:modelValue":g[3]||(g[3]=_=>u.value=_),min:0,max:100,disabled:o.disabled,"show-tooltip":!1,class:"hv-color-picker__alpha-slider",style:a.normalizeStyle({"--hv-cur-full-alpha-color":d.value})},null,8,["modelValue","disabled","style"])):a.createCommentVNode("",!0)])]),a.createVNode(bo,{"model-value":r.value,"onUpdate:modelValue":g[4]||(g[4]=_=>r.value=_),disabled:o.disabled,"enable-alpha":o.enableAlpha},null,8,["model-value","disabled","enable-alpha"]),a.createVNode(xo,{onChange:v,title:o.presetTitle,presetColors:o.presetColors},null,8,["title","presetColors"])])}}}),[["__scopeId","data-v-fbafd973"]]),mt=K(an),Fo=mt,To=K(Mo);class Vo{constructor(){q(this,"_eventMap");this._eventMap=new Map}on(n,t){const o=this._eventMap.get(n);if(o)o.add(t);else{const r=new Set;r.add(t),this._eventMap.set(n,r)}}off(n,t){const o=this._eventMap.get(n);o&&(t?o.delete(t):o.clear())}emit(n,...t){const o=this._eventMap.get(n);if(o)for(const r of o.values())r(...t)}}class Do extends Vo{constructor(){super();q(this,"isDragStart",!1);q(this,"dragType");q(this,"dragData");q(this,"isSendFirstMovePos",!1);q(this,"touchStartPressTime",300);q(this,"touchStartTime",0);q(this,"touchStartPosition",{x:0,y:0});q(this,"lastMovePoint",{x:0,y:0});q(this,"emitTouchStartTimer");q(this,"destroy",()=>{});this.bindEventListener()}updateDargInfo(t,o){if(t==null)throw new Error("请传入拖动元素 type");this.isDragStart=!0,this.dragType=t,this.dragData=o,this.emitTouchStartTimer&&clearTimeout(this.emitTouchStartTimer),this.emitTouchStartTimer=void 0}onDown(t){this.emit("down",t)}onFirstMove(t,o){this.isDragStart||(this.isSendFirstMovePos=!0,this.emit("first-move",t,o))}onStart(t){this.isDragStart||this.emit("start",t)}onMove(t){!this.isDragStart||!this.dragType||(this.lastMovePoint=t,this.emit("move",{type:this.dragType,data:this.dragData,point:t}))}onEnd(){this.emitTouchStartTimer&&clearTimeout(this.emitTouchStartTimer),this.emitTouchStartTimer=void 0,this.isSendFirstMovePos=!1,!(!this.isDragStart||!this.dragType)&&(this.isDragStart=!1,this.emit("end",{point:this.lastMovePoint,type:this.dragType,data:this.dragData}))}onMouseDown(t){if(t.buttons!==1){this.onEnd();return}const{clientX:o,clientY:r}=t,l={x:o,y:r};this.touchStartTime=Date.now(),this.touchStartPosition=l,this.emitTouchStartTimer&&clearTimeout(this.emitTouchStartTimer),this.onDown(l),this.emitTouchStartTimer=window.setTimeout(()=>{this.onStart(l)},this.touchStartPressTime)}onMouseMove(t){if(t.buttons!==1){this.onEnd();return}const{clientX:o,clientY:r}=t;if(this.isDragStart)t.preventDefault(),t.stopPropagation(),this.onMove({x:o,y:r});else{this.isSendFirstMovePos||this.onFirstMove({x:o,y:r},t);const{x:l,y:s}=this.touchStartPosition;Date.now()-this.touchStartTime<this.touchStartPressTime&&(Math.abs(l-o)>30||Math.abs(s-r)>30)&&(clearTimeout(this.emitTouchStartTimer),this.emitTouchStartTimer=void 0)}}onMouseUp(){this.onEnd()}onTouchStart(t){if(t.touches.length>1)return;const{clientX:o,clientY:r}=t.touches[0],l={x:o,y:r};this.touchStartTime=Date.now(),this.touchStartPosition=l,this.onDown(l),this.emitTouchStartTimer=window.setTimeout(()=>{this.onStart(l)},this.touchStartPressTime)}onTouchMove(t){if(t.touches.length>1)return;const{clientX:o,clientY:r}=t.touches[0];if(this.isDragStart)t.preventDefault(),t.stopPropagation(),this.onMove({x:o,y:r});else{this.isSendFirstMovePos||this.onFirstMove({x:o,y:r},t);const{x:l,y:s}=this.touchStartPosition;Date.now()-this.touchStartTime<this.touchStartPressTime&&(Math.abs(l-o)>30||Math.abs(s-r)>30)&&clearTimeout(this.emitTouchStartTimer)}}onTouchEnd(){this.onEnd()}bindEventListener(){if(document.body){const t=this.onTouchStart.bind(this),o=this.onTouchMove.bind(this),r=this.onTouchEnd.bind(this),l=this.onMouseDown.bind(this),s=this.onMouseMove.bind(this),i=this.onMouseUp.bind(this);document.body.addEventListener("touchstart",t,{passive:!1}),document.body.addEventListener("touchmove",o,{passive:!1}),document.body.addEventListener("touchend",r,{passive:!1}),document.body.addEventListener("mousedown",l),document.body.addEventListener("mousemove",s),document.body.addEventListener("mouseup",i),this.destroy=()=>{document.body.removeEventListener("touchstart",t),document.body.removeEventListener("touchmove",o),document.body.removeEventListener("touchend",r),document.body.removeEventListener("mousedown",l),document.body.removeEventListener("mousemove",s),document.body.removeEventListener("mouseup",i)}}else document.addEventListener("DOMContentLoaded",this.bindEventListener)}removeEventListener(){this.destroy()}destroyed(){this.isDragStart=!1,this.dragType=void 0,this.dragData=void 0,this.removeEventListener()}}const j=new Do,Lo=ge(a.defineComponent({name:"HvDraggable",__name:"Draggable",props:{type:{},immediate:{},disabled:{type:Boolean,default:!1},data:{}},setup(e){const n={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom",ALL:"all"},t=e,o=a.ref(),r=a.ref(!1),l=a.reactive({x:0,y:0}),s=a.ref(!1),i=a.reactive({x:0,y:0}),u=a.computed(()=>Array.isArray(t.immediate)?t.immediate:t.immediate?[t.immediate]:[]),p=a.computed(()=>({transform:`translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`})),h=g=>{const{x:y,y:_}=g,x=document.elementFromPoint(y,_);if(!t.disabled&&o.value&&o.value.contains(x)){if(u.value.includes(n.ALL)){v(g);return}r.value=!0,l.x=y,l.y=_}},d=(g,y)=>{const{x:_,y:x}=g,w=u.value.filter(k=>k!==n.ALL);if(r.value&&!t.disabled&&w.length){const k=_-l.x,F=Math.abs(k),z=x-l.y,te=Math.abs(z),ne=Math.max(F,te),Me=F===ne,be=te===ne;let ae=!1;if(Me&&(ae=w.includes(n.LEFT)&&k<0||w.includes(n.RIGHT)&&k>0),be&&!ae&&(ae=w.includes(n.TOP)&&z<0||w.includes(n.BOTTOM)&&z>0),ae){y.preventDefault(),y.stopPropagation(),v(l),C(g);return}}},c=g=>{const{x:y,y:_}=g,x=document.elementFromPoint(y,_);!t.disabled&&o.value&&o.value.contains(x)&&v(g)},f=g=>{const{point:y}=g;s.value&&C(y)},m=()=>{r.value=!1,s.value=!1,Object.assign(l,{x:0,y:0}),Object.assign(i,{x:0,y:0})};function v(g){s.value=!0,i.x=g.x,i.y=g.y,j.updateDargInfo(t.type,t.data)}function C(g){i.x=g.x,i.y=g.y}return a.onMounted(()=>{j.on("down",h),j.on("first-move",d),j.on("start",c),j.on("move",f),j.on("end",m)}),a.onBeforeUnmount(()=>{j.off("down",h),j.off("first-move",d),j.off("start",c),j.off("move",f),j.off("end",m)}),(g,y)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"dragItemRef",ref:o,class:a.normalizeClass(["hv-draggable",g.disabled?"disabled":""])},[a.renderSlot(g.$slots,"default",{},void 0,!0),s.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:"hv-draggable__clone-item",style:a.normalizeStyle(p.value)},[a.renderSlot(g.$slots,"drag-item",{},()=>[a.renderSlot(g.$slots,"default",{},void 0,!0)],!0)],4)):a.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-2309f70a"]]),Bo=a.defineComponent({name:"HvDroppable",__name:"Droppable",props:{acceptDragType:{},disabled:{type:Boolean}},emits:["enter","move","drop","leave"],setup(e,{emit:n}){const t=n,o=e,r=a.ref(),l=a.ref(!1),s=a.computed(()=>Array.isArray(o.acceptDragType)?o.acceptDragType:[o.acceptDragType]);function i(h){if(!r.value)return{isInArea:!1,position:{x:0,y:0}};const{x:d,y:c}=h,{x:f,y:m,width:v,height:C}=r.value.getBoundingClientRect(),g=d-f,y=c-m;return{isInArea:g>=0&&g<=v&&y>=0&&y<=C,position:{x:g,y}}}const u=h=>{if(o.disabled)return;const{type:d,data:c,point:f}=h;if(r.value&&s.value.includes(d)){const{isInArea:m,position:v}=i(f);m?l.value?t("move",d,v,c):(l.value=!0,t("enter",d,v,c)):l.value&&(l.value=!1,t("leave",d,c))}},p=({type:h,point:d,data:c})=>{if(!o.disabled&&r.value&&s.value.includes(h)&&l.value){const{position:f}=i(d);t("drop",h,f,c)}};return a.onMounted(()=>{j.on("move",u),j.on("end",p)}),a.onBeforeUnmount(()=>{j.off("move",u),j.off("end",p)}),(h,d)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"dropAreaRef",ref:r,class:"hv-droppable"},[a.renderSlot(h.$slots,"default")],512))}}),Ao=K(Lo),$o=K(Bo);function Oo(e,n,t){const o=a.computed(()=>a.isRef(t)?a.toValue(t):t),r=a.computed(()=>o.value.containerRealSize),l=a.computed(()=>{const E=typeof o.value.keepRatio=="boolean"?{enable:o.value.keepRatio,scaleCase:"min"}:o.value.keepRatio;return Object.assign({scaleCase:"min",enable:!1},E||{})}),s=a.computed(()=>{const E=Object.assign({inContainer:!0,minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},o.value.limit||{});return E.minWidth>E.maxWidth&&(E.maxWidth=E.minWidth),E.minHeight>E.maxHeight&&(E.maxHeight=E.minHeight),E}),i=a.computed(()=>o.value.disabled||!1),u=a.computed(()=>a.isRef(e)?a.toValue(e):e),p=a.computed(()=>o.value.container),h=a.computed(()=>a.isRef(n)?a.toValue(n):n);let d={x:0,y:0},c={x:0,y:0},f={x:0,y:0};const m={width:0,height:0},v={elX:0,elY:0,elWidth:0,elHeight:0},C={leftSide:!1,rightSide:!1,topSide:!1,bottomSide:!1,center:!1};let g=!1,y=!1,_=1,x=1;a.watch(()=>u.value&&p.value&&h.value,E=>{E?zo():He()});function w(E){if(i.value||(d=E,f=E,!p.value||!u.value))return;const{x:O,y:R,width:U,height:X}=p.value.getBoundingClientRect();if(Object.assign(m,{width:U,height:X}),r.value){const{width:Q,height:Te}=r.value;_=Q/U,x=Te/X}else _=1,x=1;const{x:T,y:V,width:N,height:H}=u.value.getBoundingClientRect(),{x:S,y:M}=E;Object.assign(v,{elX:T-O,elY:V-R,elWidth:N,elHeight:H});const Fe=document.elementFromPoint(S,M);if(!Fe)return;const se=(Fe.dataset.scaleSide||"").split(",").filter(Q=>!!Q);if(!se.length)return;let ye=se.includes("left"),Ce=se.includes("top"),J=se.includes("right"),Z=se.includes("bottom");const oe=se.includes("center");g=!0,l.value.enable&&!oe&&(S-T<=N/2&&M-V<=H/2&&(ye=!0,Ce=!0),S-T>N/2&&M-V<=H/2&&(J=!0,Ce=!0),S-T<=N/2&&M-V>H/2&&(ye=!0,Z=!0),S-T>N/2&&M-V>H/2&&(J=!0,Z=!0)),Object.assign(C,{leftSide:ye,rightSide:J,topSide:Ce,bottomSide:Z,center:oe})}function k(E){if(i.value||g!==!0){g=!1;return}y=!0,c=f,f=E;const O=E.x-d.x,R=E.y-d.y;let U=0,X=0,T=0,V=0;const{elX:N,elY:H,elWidth:S,elHeight:M}=v,{minWidth:Fe,minHeight:se,maxWidth:ye,maxHeight:Ce}=s.value,J=Fe/_,Z=se/x,oe=ye/_,Q=Ce/x;if(C.center){const Ve=m.width,De=m.height;if(s.value.inContainer){const Ie=N+O<0?-N:N+S+O>Ve?Ve-S-N:O,je=H+R<0?-H:H+M+R>De?De-M-H:R;U=Ie,X=je}else U=O,X=R}else{const{leftSide:Ve,rightSide:De,topSide:Ie,bottomSide:je}=C;if(Ve){let L=s.value.inContainer&&N+O<0?-N:O;S-L<J&&(L=S-J),S-L>oe&&(L=S-oe),U=L,T=-L}if(De){const L=m.width;let I=s.value.inContainer&&N+S+O>L?L-S-N:O;S+I<J&&(I=J-S),S+I>oe&&(I=oe-S),T=I}if(Ie){let L=s.value.inContainer&&H+R<0?-H:R;M-L<Z&&(L=M-Z),M-L>Q&&(L=M-Q),X=L,V=-L}if(je){const L=m.height;let I=s.value.inContainer&&H+M+R>L?L-M-H:R;M+I<Z&&(I=Z-M),M+I>Q&&(I=Q-M),V=I}if(l.value.enable){const L=T/S,I=V/M;if(L<I&&l.value.scaleCase==="min"||L>I&&l.value.scaleCase==="max"){if(V=L*M,M+V<Z){const G=T;V=Z-M,T=V/M*S,U=U*(T/G)}if(M+V>Q){const G=T;V=Q-M,T=V/M*S,U=U*(T/G)}C.topSide&&(X=-V)}else if(I<L&&l.value.scaleCase==="min"||I>L&&l.value.scaleCase==="max"){if(T=I*S,S+T<J){const G=V;T=J-S,V=T/S*M,X=X*(V/G)}if(S+T>oe){const G=V;T=oe-S,V=T/S*M,X=X*(V/G)}C.leftSide&&(U=-T)}const ce=N+U,de=H+X,ze=S+T,Ue=M+V;if(s.value.inContainer&&(ce<0||de<0||ce+ze>m.width||de+Ue>m.height)){let G=ce<0?0:ce,_e=de<0?0:de,ue=ce+ze>m.width?m.width-G:ce+ze-G,he=de+Ue>m.height?m.height-_e:de+Ue-_e;const Uo=G+ue,Xo=_e+he,bt=ue/he,Le=S/M;bt<Le?he=ue/Le:bt>Le&&(ue=he*Le);const{topSide:Yo,leftSide:Wo}=C;Wo&&(G=Uo-ue),Yo&&(_e=Xo-he),U=G-N,X=_e-H,T=ue-S,V=he-M}}}const Te=N+U,pt=H+X,vt=S+T,gt=M+V;o.value.onChange&&o.value.onChange({type:C.center?"move":"scale",deltaX:f.x-c.x,deltaY:f.y-c.y,elX:Te,elY:pt,elWidth:vt,elHeight:gt,realX:Te*_,realY:pt*x,realWidth:vt*_,realHeight:gt*x})}function F(){if(c={x:0,y:0},f={x:0,y:0},i.value||g!==!0||!y){g=!1,y=!1;return}g=!1,y=!1,o.value.onFinish&&o.value.onFinish()}function z(E){if(E.preventDefault(),E.touches.length>1)return;const{clientX:O,clientY:R}=E.touches[0];w({x:O,y:R}),document.body.addEventListener("touchcancel",ne,{capture:!0}),document.body.addEventListener("touchmove",te,{capture:!0}),document.body.addEventListener("touchend",ne,{capture:!0})}function te(E){if(i.value||g!==!0){g=!1;return}if(E.preventDefault(),E.stopPropagation(),E.touches.length>1){F();return}const{clientX:O,clientY:R}=E.touches[0];O===d.x&&R===d.y||k({x:O,y:R})}function ne(){if(document.body.removeEventListener("touchmove",te),document.body.removeEventListener("touchend",ne),document.body.removeEventListener("touchcancel",ne),i.value||g!==!0){g=!1,y=!1;return}F()}function Me(E){if(E.preventDefault(),!(E.buttons&1))return;const{clientX:O,clientY:R}=E;w({x:O,y:R}),document.body.addEventListener("mousemove",be,{capture:!0}),document.body.addEventListener("mouseup",ae,{capture:!0})}function be(E){if(i.value||g!==!0){g=!1;return}if(E.preventDefault(),!(E.buttons&1)){F();return}const{clientX:O,clientY:R}=E;k({x:O,y:R})}function ae(){if(document.body.removeEventListener("mousemove",be),document.body.removeEventListener("mouseup",ae),i.value||g!==!0){g=!1;return}F()}function zo(){He(),h.value.addEventListener("touchstart",z,{capture:!0}),h.value.addEventListener("mousedown",Me)}function He(){h.value.removeEventListener("touchstart",z),document.body.removeEventListener("touchmove",te),document.body.removeEventListener("touchend",ne),document.body.removeEventListener("touchcancel",ne),h.value.removeEventListener("mousedown",Me),document.body.removeEventListener("mousemove",be),document.body.removeEventListener("mouseup",ae)}a.onBeforeUnmount(()=>{g=!1,He()})}const Ro={class:"hv-drag-and-scale__zoom-mark"},Po=K(a.defineComponent({name:"HvDragAndScale",__name:"DragAndScale",props:{container:{},containerRealSize:{},keepRatio:{type:[Boolean,Object]},limit:{},disabled:{type:Boolean}},emits:["change","finish"],setup(e,{emit:n}){const t=n,o=e,r=a.ref(),l=a.ref();function s(p){t("change",p)}function i(){t("finish")}const u=a.computed(()=>({container:o.container,containerRealSize:o.containerRealSize,keepRatio:o.keepRatio,limit:o.limit,disabled:o.disabled,onChange:s,onFinish:i}));return Oo(r,l,u),(p,h)=>(a.openBlock(),a.createElementBlock("div",{class:"hv-drag-and-scale",ref_key:"targetRef",ref:r},[a.renderSlot(p.$slots,"default"),a.createElementVNode("div",Ro,[a.createElementVNode("div",{class:a.normalizeClass(["hv-drag-and-scale__area-box",o.disabled?"disabled":""]),ref_key:"operateRef",ref:l},h[0]||(h[0]=[a.createStaticVNode('<div class="hv-drag-and-scale__area-top hv-drag-and-scale__area-block"><div class="hv-drag-and-scale__area-left" data-scale-side="left,top"></div><div class="hv-drag-and-scale__area-center" data-scale-side="top"></div><div class="hv-drag-and-scale__area-right" data-scale-side="right,top"></div></div><div class="hv-drag-and-scale__area-middle hv-drag-and-scale__area-block"><div class="hv-drag-and-scale__area-left" data-scale-side="left"></div><div class="hv-drag-and-scale__area-center" data-scale-side="center"></div><div class="hv-drag-and-scale__area-right" data-scale-side="right"></div></div><div class="hv-drag-and-scale__area-bottom hv-drag-and-scale__area-block"><div class="hv-drag-and-scale__area-left" data-scale-side="left,bottom"></div><div class="hv-drag-and-scale__area-center" data-scale-side="bottom"></div><div class="hv-drag-and-scale__area-right" data-scale-side="right,bottom"></div></div>',3)]),2)])],512))}}));function Se(e){const n=parseInt(e+"");return isNaN(n)?"":n<0?"0":n>255?"255":n+""}function No(e){const n={begin:null,end:null,result:null};return n.begin=e.selectionStart||0,n.end=e.selectionEnd||0,n.result=e.value.substring(n.begin,n.end),e.focus(),n}const Ho=["value","disabled","onInput","onKeydown","onPaste"],Io={key:0},jo=K(a.defineComponent({name:"HvIpInput",__name:"IpInput",props:{modelValue:{default:"..."},disabled:{type:Boolean,default:!1}},emits:["update:model-value"],setup(e,{emit:n}){const t=n,o=e,r=a.ref([]),l=a.ref([]);a.watch(()=>o.modelValue,h=>{h=h+"";const d=h.split(".");l.value=Array(4).fill("").map((c,f)=>Se(d[f]+""))},{immediate:!0});function s(){const h=l.value.map(d=>Se(d)).join(".");return t("update:model-value",h)}function i(h,d){var m;if(o.disabled)return;const c=h.target.value,f=Se(c);if(l.value[d]=f,h.target.value=f,s(),f==="")return h.preventDefault();String(f).length===3&&d<3&&((m=r.value[d+1])==null||m.focus())}function u(h,d){let c=d;const{end:f}=No(h.target);switch(h.keyCode){case 37:case 8:{f===0&&d>0&&(c=d-1);break}case 39:{f===h.target.value.length&&d<3&&(c=d+1);break}case 110:case 190:{h.preventDefault(),d<3&&(c=d+1);break}}const m=r.value[c];if(m.focus(),c<d){const v=m.value.length;m.selectionStart=m.selectionEnd=v}else c>d&&(m.selectionStart=m.selectionEnd=0)}function p(h,d){if(!h.clipboardData||!h.clipboardData.getData)return;const c=h.clipboardData.getData("text/plain");if(!c)return;const f=c.split(".").map(m=>Se(m));if(f.length===4-d&&f.every(m=>m!==""))return f.forEach((m,v)=>{l.value[d+v]=m+""}),s(),h.preventDefault()}return(h,d)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["hv-ip-input",o.disabled?"is-disabled":""])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,(c,f)=>(a.openBlock(),a.createElementBlock("div",{class:"hv-ip-input-item",key:f},[a.createElementVNode("input",{ref_for:!0,ref_key:"inputRefs",ref:r,type:"text",value:c,disabled:o.disabled,onInput:m=>i(m,f),onKeydown:m=>u(m,f),onPaste:m=>p(m,f)},null,40,Ho),f!==3?(a.openBlock(),a.createElementBlock("i",Io,".")):a.createCommentVNode("",!0)]))),128))],2))}}));A.DEFAULT_COLOR=ee,A.HvColorPicker=mt,A.HvColorPickerNormal=To,A.HvColorPickerRainbow=Fo,A.HvDragAndScale=Po,A.HvDraggable=Ao,A.HvDroppable=$o,A.HvIpInput=jo,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(B,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(B=typeof globalThis<"u"?globalThis:B||self,a(B.components={},B.Vue))})(this,function(B,a){"use strict";var Ko=Object.defineProperty;var Jo=(B,a,K)=>a in B?Ko(B,a,{enumerable:!0,configurable:!0,writable:!0,value:K}):B[a]=K;var q=(B,a,K)=>Jo(B,typeof a!="symbol"?a+"":a,K);const K=(e,n)=>(e.install=t=>{for(const o of[e,...Object.values({})])t.component(o.name,o)},e);var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function We(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ge={exports:{}},qe={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]},Ke={exports:{}},_t=function(n){return!n||typeof n=="string"?!1:n instanceof Array||Array.isArray(n)||n.length>=0&&(n.splice instanceof Function||Object.getOwnPropertyDescriptor(n,n.length-1)&&n.constructor.name!=="String")},kt=_t,xt=Array.prototype.concat,wt=Array.prototype.slice,Je=Ke.exports=function(n){for(var t=[],o=0,r=n.length;o<r;o++){var s=n[o];kt(s)?t=xt.call(t,wt.call(s)):t.push(s)}return t};Je.wrap=function(e){return function(){return e(Je(arguments))}};var Et=Ke.exports,me=qe,pe=Et,Ze=Object.hasOwnProperty,Qe=Object.create(null);for(var Ae in me)Ze.call(me,Ae)&&(Qe[me[Ae]]=Ae);var Y=Ge.exports={to:{},get:{}};Y.get=function(e){var n=e.substring(0,3).toLowerCase(),t,o;switch(n){case"hsl":t=Y.get.hsl(e),o="hsl";break;case"hwb":t=Y.get.hwb(e),o="hwb";break;default:t=Y.get.rgb(e),o="rgb";break}return t?{model:o,value:t}:null},Y.get.rgb=function(e){if(!e)return null;var n=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,o=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,r=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,s=/^(\w+)$/,l=[0,0,0,1],i,h,p;if(i=e.match(t)){for(p=i[2],i=i[1],h=0;h<3;h++){var u=h*2;l[h]=parseInt(i.slice(u,u+2),16)}p&&(l[3]=parseInt(p,16)/255)}else if(i=e.match(n)){for(i=i[1],p=i[3],h=0;h<3;h++)l[h]=parseInt(i[h]+i[h],16);p&&(l[3]=parseInt(p+p,16)/255)}else if(i=e.match(o)){for(h=0;h<3;h++)l[h]=parseInt(i[h+1],0);i[4]&&(i[5]?l[3]=parseFloat(i[4])*.01:l[3]=parseFloat(i[4]))}else if(i=e.match(r)){for(h=0;h<3;h++)l[h]=Math.round(parseFloat(i[h+1])*2.55);i[4]&&(i[5]?l[3]=parseFloat(i[4])*.01:l[3]=parseFloat(i[4]))}else return(i=e.match(s))?i[1]==="transparent"?[0,0,0,0]:Ze.call(me,i[1])?(l=me[i[1]],l[3]=1,l):null:null;for(h=0;h<3;h++)l[h]=re(l[h],0,255);return l[3]=re(l[3],0,1),l},Y.get.hsl=function(e){if(!e)return null;var n=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(n);if(t){var o=parseFloat(t[4]),r=(parseFloat(t[1])%360+360)%360,s=re(parseFloat(t[2]),0,100),l=re(parseFloat(t[3]),0,100),i=re(isNaN(o)?1:o,0,1);return[r,s,l,i]}return null},Y.get.hwb=function(e){if(!e)return null;var n=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(n);if(t){var o=parseFloat(t[4]),r=(parseFloat(t[1])%360+360)%360,s=re(parseFloat(t[2]),0,100),l=re(parseFloat(t[3]),0,100),i=re(isNaN(o)?1:o,0,1);return[r,s,l,i]}return null},Y.to.hex=function(){var e=pe(arguments);return"#"+xe(e[0])+xe(e[1])+xe(e[2])+(e[3]<1?xe(Math.round(e[3]*255)):"")},Y.to.rgb=function(){var e=pe(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Y.to.rgb.percent=function(){var e=pe(arguments),n=Math.round(e[0]/255*100),t=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+n+"%, "+t+"%, "+o+"%)":"rgba("+n+"%, "+t+"%, "+o+"%, "+e[3]+")"},Y.to.hsl=function(){var e=pe(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Y.to.hwb=function(){var e=pe(arguments),n="";return e.length>=4&&e[3]!==1&&(n=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+n+")"},Y.to.keyword=function(e){return Qe[e.slice(0,3)]};function re(e,n,t){return Math.min(Math.max(n,e),t)}function xe(e){var n=Math.round(e).toString(16).toUpperCase();return n.length<2?"0"+n:n}var St=Ge.exports;const ve=qe,et={};for(const e of Object.keys(ve))et[ve[e]]=e;const b={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"]}};var tt=b;for(const e of Object.keys(b)){if(!("channels"in b[e]))throw new Error("missing channels property: "+e);if(!("labels"in b[e]))throw new Error("missing channel labels property: "+e);if(b[e].labels.length!==b[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:n,labels:t}=b[e];delete b[e].channels,delete b[e].labels,Object.defineProperty(b[e],"channels",{value:n}),Object.defineProperty(b[e],"labels",{value:t})}b.rgb.hsl=function(e){const n=e[0]/255,t=e[1]/255,o=e[2]/255,r=Math.min(n,t,o),s=Math.max(n,t,o),l=s-r;let i,h;s===r?i=0:n===s?i=(t-o)/l:t===s?i=2+(o-n)/l:o===s&&(i=4+(n-t)/l),i=Math.min(i*60,360),i<0&&(i+=360);const p=(r+s)/2;return s===r?h=0:p<=.5?h=l/(s+r):h=l/(2-s-r),[i,h*100,p*100]},b.rgb.hsv=function(e){let n,t,o,r,s;const l=e[0]/255,i=e[1]/255,h=e[2]/255,p=Math.max(l,i,h),u=p-Math.min(l,i,h),d=function(c){return(p-c)/6/u+1/2};return u===0?(r=0,s=0):(s=u/p,n=d(l),t=d(i),o=d(h),l===p?r=o-t:i===p?r=1/3+n-o:h===p&&(r=2/3+t-n),r<0?r+=1:r>1&&(r-=1)),[r*360,s*100,p*100]},b.rgb.hwb=function(e){const n=e[0],t=e[1];let o=e[2];const r=b.rgb.hsl(e)[0],s=1/255*Math.min(n,Math.min(t,o));return o=1-1/255*Math.max(n,Math.max(t,o)),[r,s*100,o*100]},b.rgb.cmyk=function(e){const n=e[0]/255,t=e[1]/255,o=e[2]/255,r=Math.min(1-n,1-t,1-o),s=(1-n-r)/(1-r)||0,l=(1-t-r)/(1-r)||0,i=(1-o-r)/(1-r)||0;return[s*100,l*100,i*100,r*100]};function Mt(e,n){return(e[0]-n[0])**2+(e[1]-n[1])**2+(e[2]-n[2])**2}b.rgb.keyword=function(e){const n=et[e];if(n)return n;let t=1/0,o;for(const r of Object.keys(ve)){const s=ve[r],l=Mt(e,s);l<t&&(t=l,o=r)}return o},b.keyword.rgb=function(e){return ve[e]},b.rgb.xyz=function(e){let n=e[0]/255,t=e[1]/255,o=e[2]/255;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92;const r=n*.4124+t*.3576+o*.1805,s=n*.2126+t*.7152+o*.0722,l=n*.0193+t*.1192+o*.9505;return[r*100,s*100,l*100]},b.rgb.lab=function(e){const n=b.rgb.xyz(e);let t=n[0],o=n[1],r=n[2];t/=95.047,o/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const s=116*o-16,l=500*(t-o),i=200*(o-r);return[s,l,i]},b.hsl.rgb=function(e){const n=e[0]/360,t=e[1]/100,o=e[2]/100;let r,s,l;if(t===0)return l=o*255,[l,l,l];o<.5?r=o*(1+t):r=o+t-o*t;const i=2*o-r,h=[0,0,0];for(let p=0;p<3;p++)s=n+1/3*-(p-1),s<0&&s++,s>1&&s--,6*s<1?l=i+(r-i)*6*s:2*s<1?l=r:3*s<2?l=i+(r-i)*(2/3-s)*6:l=i,h[p]=l*255;return h},b.hsl.hsv=function(e){const n=e[0];let t=e[1]/100,o=e[2]/100,r=t;const s=Math.max(o,.01);o*=2,t*=o<=1?o:2-o,r*=s<=1?s:2-s;const l=(o+t)/2,i=o===0?2*r/(s+r):2*t/(o+t);return[n,i*100,l*100]},b.hsv.rgb=function(e){const n=e[0]/60,t=e[1]/100;let o=e[2]/100;const r=Math.floor(n)%6,s=n-Math.floor(n),l=255*o*(1-t),i=255*o*(1-t*s),h=255*o*(1-t*(1-s));switch(o*=255,r){case 0:return[o,h,l];case 1:return[i,o,l];case 2:return[l,o,h];case 3:return[l,i,o];case 4:return[h,l,o];case 5:return[o,l,i]}},b.hsv.hsl=function(e){const n=e[0],t=e[1]/100,o=e[2]/100,r=Math.max(o,.01);let s,l;l=(2-t)*o;const i=(2-t)*r;return s=t*r,s/=i<=1?i:2-i,s=s||0,l/=2,[n,s*100,l*100]},b.hwb.rgb=function(e){const n=e[0]/360;let t=e[1]/100,o=e[2]/100;const r=t+o;let s;r>1&&(t/=r,o/=r);const l=Math.floor(6*n),i=1-o;s=6*n-l,l&1&&(s=1-s);const h=t+s*(i-t);let p,u,d;switch(l){default:case 6:case 0:p=i,u=h,d=t;break;case 1:p=h,u=i,d=t;break;case 2:p=t,u=i,d=h;break;case 3:p=t,u=h,d=i;break;case 4:p=h,u=t,d=i;break;case 5:p=i,u=t,d=h;break}return[p*255,u*255,d*255]},b.cmyk.rgb=function(e){const n=e[0]/100,t=e[1]/100,o=e[2]/100,r=e[3]/100,s=1-Math.min(1,n*(1-r)+r),l=1-Math.min(1,t*(1-r)+r),i=1-Math.min(1,o*(1-r)+r);return[s*255,l*255,i*255]},b.xyz.rgb=function(e){const n=e[0]/100,t=e[1]/100,o=e[2]/100;let r,s,l;return r=n*3.2406+t*-1.5372+o*-.4986,s=n*-.9689+t*1.8758+o*.0415,l=n*.0557+t*-.204+o*1.057,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),l=Math.min(Math.max(0,l),1),[r*255,s*255,l*255]},b.xyz.lab=function(e){let n=e[0],t=e[1],o=e[2];n/=95.047,t/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const r=116*t-16,s=500*(n-t),l=200*(t-o);return[r,s,l]},b.lab.xyz=function(e){const n=e[0],t=e[1],o=e[2];let r,s,l;s=(n+16)/116,r=t/500+s,l=s-o/200;const i=s**3,h=r**3,p=l**3;return s=i>.008856?i:(s-16/116)/7.787,r=h>.008856?h:(r-16/116)/7.787,l=p>.008856?p:(l-16/116)/7.787,r*=95.047,s*=100,l*=108.883,[r,s,l]},b.lab.lch=function(e){const n=e[0],t=e[1],o=e[2];let r;r=Math.atan2(o,t)*360/2/Math.PI,r<0&&(r+=360);const l=Math.sqrt(t*t+o*o);return[n,l,r]},b.lch.lab=function(e){const n=e[0],t=e[1],r=e[2]/360*2*Math.PI,s=t*Math.cos(r),l=t*Math.sin(r);return[n,s,l]},b.rgb.ansi16=function(e,n=null){const[t,o,r]=e;let s=n===null?b.rgb.hsv(e)[2]:n;if(s=Math.round(s/50),s===0)return 30;let l=30+(Math.round(r/255)<<2|Math.round(o/255)<<1|Math.round(t/255));return s===2&&(l+=60),l},b.hsv.ansi16=function(e){return b.rgb.ansi16(b.hsv.rgb(e),e[2])},b.rgb.ansi256=function(e){const n=e[0],t=e[1],o=e[2];return n===t&&t===o?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(t/255*5)+Math.round(o/255*5)},b.ansi16.rgb=function(e){let n=e%10;if(n===0||n===7)return e>50&&(n+=3.5),n=n/10.5*255,[n,n,n];const t=(~~(e>50)+1)*.5,o=(n&1)*t*255,r=(n>>1&1)*t*255,s=(n>>2&1)*t*255;return[o,r,s]},b.ansi256.rgb=function(e){if(e>=232){const s=(e-232)*10+8;return[s,s,s]}e-=16;let n;const t=Math.floor(e/36)/5*255,o=Math.floor((n=e%36)/6)/5*255,r=n%6/5*255;return[t,o,r]},b.rgb.hex=function(e){const t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t},b.hex.rgb=function(e){const n=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];let t=n[0];n[0].length===3&&(t=t.split("").map(i=>i+i).join(""));const o=parseInt(t,16),r=o>>16&255,s=o>>8&255,l=o&255;return[r,s,l]},b.rgb.hcg=function(e){const n=e[0]/255,t=e[1]/255,o=e[2]/255,r=Math.max(Math.max(n,t),o),s=Math.min(Math.min(n,t),o),l=r-s;let i,h;return l<1?i=s/(1-l):i=0,l<=0?h=0:r===n?h=(t-o)/l%6:r===t?h=2+(o-n)/l:h=4+(n-t)/l,h/=6,h%=1,[h*360,l*100,i*100]},b.hsl.hcg=function(e){const n=e[1]/100,t=e[2]/100,o=t<.5?2*n*t:2*n*(1-t);let r=0;return o<1&&(r=(t-.5*o)/(1-o)),[e[0],o*100,r*100]},b.hsv.hcg=function(e){const n=e[1]/100,t=e[2]/100,o=n*t;let r=0;return o<1&&(r=(t-o)/(1-o)),[e[0],o*100,r*100]},b.hcg.rgb=function(e){const n=e[0]/360,t=e[1]/100,o=e[2]/100;if(t===0)return[o*255,o*255,o*255];const r=[0,0,0],s=n%1*6,l=s%1,i=1-l;let h=0;switch(Math.floor(s)){case 0:r[0]=1,r[1]=l,r[2]=0;break;case 1:r[0]=i,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=l;break;case 3:r[0]=0,r[1]=i,r[2]=1;break;case 4:r[0]=l,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=i}return h=(1-t)*o,[(t*r[0]+h)*255,(t*r[1]+h)*255,(t*r[2]+h)*255]},b.hcg.hsv=function(e){const n=e[1]/100,t=e[2]/100,o=n+t*(1-n);let r=0;return o>0&&(r=n/o),[e[0],r*100,o*100]},b.hcg.hsl=function(e){const n=e[1]/100,o=e[2]/100*(1-n)+.5*n;let r=0;return o>0&&o<.5?r=n/(2*o):o>=.5&&o<1&&(r=n/(2*(1-o))),[e[0],r*100,o*100]},b.hcg.hwb=function(e){const n=e[1]/100,t=e[2]/100,o=n+t*(1-n);return[e[0],(o-n)*100,(1-o)*100]},b.hwb.hcg=function(e){const n=e[1]/100,o=1-e[2]/100,r=o-n;let s=0;return r<1&&(s=(o-r)/(1-r)),[e[0],r*100,s*100]},b.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},b.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},b.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},b.gray.hsl=function(e){return[0,0,e[0]]},b.gray.hsv=b.gray.hsl,b.gray.hwb=function(e){return[0,100,e[0]]},b.gray.cmyk=function(e){return[0,0,0,e[0]]},b.gray.lab=function(e){return[e[0],0,0]},b.gray.hex=function(e){const n=Math.round(e[0]/100*255)&255,o=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(o.length)+o},b.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const we=tt;function Ft(){const e={},n=Object.keys(we);for(let t=n.length,o=0;o<t;o++)e[n[o]]={distance:-1,parent:null};return e}function Tt(e){const n=Ft(),t=[e];for(n[e].distance=0;t.length;){const o=t.pop(),r=Object.keys(we[o]);for(let s=r.length,l=0;l<s;l++){const i=r[l],h=n[i];h.distance===-1&&(h.distance=n[o].distance+1,h.parent=o,t.unshift(i))}}return n}function Vt(e,n){return function(t){return n(e(t))}}function Dt(e,n){const t=[n[e].parent,e];let o=we[n[e].parent][e],r=n[e].parent;for(;n[r].parent;)t.unshift(n[r].parent),o=Vt(we[n[r].parent][r],o),r=n[r].parent;return o.conversion=t,o}var Lt=function(e){const n=Tt(e),t={},o=Object.keys(n);for(let r=o.length,s=0;s<r;s++){const l=o[s];n[l].parent!==null&&(t[l]=Dt(l,n))}return t};const Be=tt,At=Lt,se={},Bt=Object.keys(Be);function $t(e){const n=function(...t){const o=t[0];return o==null?o:(o.length>1&&(t=o),e(t))};return"conversion"in e&&(n.conversion=e.conversion),n}function Ot(e){const n=function(...t){const o=t[0];if(o==null)return o;o.length>1&&(t=o);const r=e(t);if(typeof r=="object")for(let s=r.length,l=0;l<s;l++)r[l]=Math.round(r[l]);return r};return"conversion"in e&&(n.conversion=e.conversion),n}Bt.forEach(e=>{se[e]={},Object.defineProperty(se[e],"channels",{value:Be[e].channels}),Object.defineProperty(se[e],"labels",{value:Be[e].labels});const n=At(e);Object.keys(n).forEach(o=>{const r=n[o];se[e][o]=Ot(r),se[e][o].raw=$t(r)})});var Rt=se;const ie=St,W=Rt,nt=["keyword","gray","hex"],$e={};for(const e of Object.keys(W))$e[[...W[e].labels].sort().join("")]=e;const Ee={};function P(e,n){if(!(this instanceof P))return new P(e,n);if(n&&n in nt&&(n=null),n&&!(n in W))throw new Error("Unknown model: "+n);let t,o;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof P)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){const r=ie.get(e);if(r===null)throw new Error("Unable to parse color from string: "+e);this.model=r.model,o=W[this.model].channels,this.color=r.value.slice(0,o),this.valpha=typeof r.value[o]=="number"?r.value[o]:1}else if(e.length>0){this.model=n||"rgb",o=W[this.model].channels;const r=Array.prototype.slice.call(e,0,o);this.color=Oe(r,o),this.valpha=typeof e[o]=="number"?e[o]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const r=Object.keys(e);"alpha"in e&&(r.splice(r.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const s=r.sort().join("");if(!(s in $e))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=$e[s];const{labels:l}=W[this.model],i=[];for(t=0;t<l.length;t++)i.push(e[l[t]]);this.color=Oe(i)}if(Ee[this.model])for(o=W[this.model].channels,t=0;t<o;t++){const r=Ee[this.model][t];r&&(this.color[t]=r(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}P.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let n=this.model in ie.to?this:this.rgb();n=n.round(typeof e=="number"?e:1);const t=n.valpha===1?n.color:[...n.color,this.valpha];return ie.to[n.model](t)},percentString(e){const n=this.rgb().round(typeof e=="number"?e:1),t=n.valpha===1?n.color:[...n.color,this.valpha];return ie.to.rgb.percent(t)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:n}=W[this.model],{labels:t}=W[this.model];for(let o=0;o<n;o++)e[t[o]]=this.color[o];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new P([...this.color.map(Nt(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new P([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:A("rgb",0,$(255)),green:A("rgb",1,$(255)),blue:A("rgb",2,$(255)),hue:A(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:A("hsl",1,$(100)),lightness:A("hsl",2,$(100)),saturationv:A("hsv",1,$(100)),value:A("hsv",2,$(100)),chroma:A("hcg",1,$(100)),gray:A("hcg",2,$(100)),white:A("hwb",1,$(100)),wblack:A("hwb",2,$(100)),cyan:A("cmyk",0,$(100)),magenta:A("cmyk",1,$(100)),yellow:A("cmyk",2,$(100)),black:A("cmyk",3,$(100)),x:A("xyz",0,$(95.047)),y:A("xyz",1,$(100)),z:A("xyz",2,$(108.833)),l:A("lab",0,$(100)),a:A("lab",1),b:A("lab",2),keyword(e){return e!==void 0?new P(e):W[this.model].keyword(this.color)},hex(e){return e!==void 0?new P(e):ie.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new P(e);const n=this.rgb().round().color;let t=Math.round(this.valpha*255).toString(16).toUpperCase();return t.length===1&&(t="0"+t),ie.to.hex(n)+t},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,n=[];for(const[t,o]of e.entries()){const r=o/255;n[t]=r<=.04045?r/12.92:((r+.055)/1.055)**2.4}return .2126*n[0]+.7152*n[1]+.0722*n[2]},contrast(e){const n=this.luminosity(),t=e.luminosity();return n>t?(n+.05)/(t+.05):(t+.05)/(n+.05)},level(e){const n=this.contrast(e);return n>=7?"AAA":n>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let n=0;n<3;n++)e.color[n]=255-e.color[n];return e},lighten(e){const n=this.hsl();return n.color[2]+=n.color[2]*e,n},darken(e){const n=this.hsl();return n.color[2]-=n.color[2]*e,n},saturate(e){const n=this.hsl();return n.color[1]+=n.color[1]*e,n},desaturate(e){const n=this.hsl();return n.color[1]-=n.color[1]*e,n},whiten(e){const n=this.hwb();return n.color[1]+=n.color[1]*e,n},blacken(e){const n=this.hwb();return n.color[2]+=n.color[2]*e,n},grayscale(){const e=this.rgb().color,n=e[0]*.3+e[1]*.59+e[2]*.11;return P.rgb(n,n,n)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const n=this.hsl();let t=n.color[0];return t=(t+e)%360,t=t<0?360+t:t,n.color[0]=t,n},mix(e,n){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const t=e.rgb(),o=this.rgb(),r=n===void 0?.5:n,s=2*r-1,l=t.alpha()-o.alpha(),i=((s*l===-1?s:(s+l)/(1+s*l))+1)/2,h=1-i;return P.rgb(i*t.red()+h*o.red(),i*t.green()+h*o.green(),i*t.blue()+h*o.blue(),t.alpha()*r+o.alpha()*(1-r))}};for(const e of Object.keys(W)){if(nt.includes(e))continue;const{channels:n}=W[e];P.prototype[e]=function(...t){return this.model===e?new P(this):t.length>0?new P(t,e):new P([...It(W[this.model][e].raw(this.color)),this.valpha],e)},P[e]=function(...t){let o=t[0];return typeof o=="number"&&(o=Oe(t,n)),new P(o,e)}}function Pt(e,n){return Number(e.toFixed(n))}function Nt(e){return function(n){return Pt(n,e)}}function A(e,n,t){e=Array.isArray(e)?e:[e];for(const o of e)(Ee[o]||(Ee[o]=[]))[n]=t;return e=e[0],function(o){let r;return o!==void 0?(t&&(o=t(o)),r=this[e](),r.color[n]=o,r):(r=this[e]().color[n],t&&(r=t(r)),r)}}function $(e){return function(n){return Math.max(0,Math.min(e,n))}}function It(e){return Array.isArray(e)?e:[e]}function Oe(e,n){for(let t=0;t<n;t++)typeof e[t]!="number"&&(e[t]=0);return e}var Ht=P;const D=We(Ht);function ot(e){return D(e)}function rt(e){return e.hex()}function jt(e){const{h:n,s:t,v:o}=e.hsv().object();return{color:D.hsv(n,t,100),value:o}}function zt(e,n){const{h:t,s:o}=e.hsv().object();return D.hsv(t,o,n)}function at(e,n){const t=zt(e,n);return rt(t)}function Ut(){const e=a.ref(),n=255*6+1,t=256;function o(){if(!e.value)return;const u=e.value;u.width=n,u.height=t;const d=u.getContext("2d");if(!d)return;d.clearRect(0,0,n,t);const c=d.createLinearGradient(0,0,n,0);c.addColorStop(0,"#FF0000"),c.addColorStop(1/6,"#FFFF00"),c.addColorStop(1/3,"#00FF00"),c.addColorStop(1/2,"#00FFFF"),c.addColorStop(2/3,"#0000FF"),c.addColorStop(5/6,"#FF00FF"),c.addColorStop(1,"#FF0000"),d.fillStyle=c,d.fillRect(0,0,n,t);const f=d.createLinearGradient(0,t,0,0);f.addColorStop(0,"rgb(255 255 255 / 100%)"),f.addColorStop(1,"rgb(255 255 255 / 0%)"),d.fillStyle=f,d.fillRect(0,0,n,t)}function r(u){const d=ot(u);return s(d)}function s(u){const{r:d,g:c,b:f}=u.rgb().object(),m=[{type:"r",value:d},{type:"g",value:c},{type:"b",value:f}];m.sort((k,w)=>w.value-k.value);const v=m[0],C=m[1],g=v.type+C.type;let y=0;const _=m[2].value;return g==="rg"||g==="gr"?(y=255,C.type==="r"?y+=255-l(_,C.value):y-=255-l(_,C.value)):g==="gb"||g==="bg"?(y=255*3,C.type==="g"?y+=255-l(_,C.value):y-=255-l(_,C.value)):(g==="rb"||g==="br")&&(y=255*5,C.type==="b"?y+=255-l(_,C.value):y-=255-l(_,C.value)),{x:y,y:_}}function l(u,d){return u===255?255:(255*d-255*u)/(255-u)}function i(u,d,c,f){if(!e.value)return D();const m=n/c,v=t/f;return u=Math.round(Math.min(u*m,n-1)),d=Math.round(Math.min(d*v,t-1)),h(u,d)}function h(u,d){let c=0,f=0,m=0;const v=255,C=p(u,0,v)||p(u,v*5,v*6),g=p(u,v,v*3),y=p(u,v*3,v*5);C?c=255:u<=v*2?c=Math.max(2*v-u,0):u>=v*4&&(c=Math.max(u-v*4,0)),g?f=255:u<v?f=Math.max(u,0):f=Math.max(v*4-u,0),y?m=255:u<v*3?m=Math.max(u-v*2,0):m=Math.max(v*6-u,0);const _=v-c,k=v-f,w=v-m,x=d/v;return c+=_*x,f+=k*x,m+=w*x,D.rgb(c,f,m)}function p(u,d,c){return u>=d&&u<=c}return a.onMounted(()=>{o()}),{canvasWidth:n,canvasHeight:t,colorAreaCanvas:e,drawColorArea:o,getCoordinateByColor:s,getCoordinateByHex:r,getColorByCoordinate:i}}function Xt(e,n=200){let t=null;return function(...o){const r=this;t||(t=window.setTimeout(()=>{e.apply(r,o),t=null},n))}}function Yt(e){const n=a.ref(),t=a.reactive({x:0,y:0}),o=a.computed(()=>a.isRef(e.disabled)?e.disabled.value:e.disabled);function r(f){if(o.value||f.touches.length===0)return;f.preventDefault();const{clientX:m,clientY:v}=f.touches[0];p({x:m,y:v}),document.body.addEventListener("touchmove",s),document.body.addEventListener("touchend",l)}function s(f){if(f.touches.length>1)return;const{clientX:m,clientY:v}=f.touches[0];p({x:m,y:v})}function l(){document.body.removeEventListener("touchmove",s),document.body.removeEventListener("touchend",l)}function i(f){o.value||(document.body.addEventListener("mousemove",h),document.body.addEventListener("mouseup",d),p({x:f.clientX,y:f.clientY}))}function h(f){if(!f.buttons){d();return}p({x:f.clientX,y:f.clientY})}const p=Xt(u,20);function u(f){var F;if(o.value)return;const{x:m,y:v}=f,C=(F=n.value)==null?void 0:F.getBoundingClientRect();if(!C)return;const{left:g,top:y,width:_,height:k}=C;let w=0,x=0;m<=g?w=0:m>=g+_?w=_:w=m-g,v<=y?x=0:v>=y+k?x=k:x=v-y,t.x=w,t.y=x}function d(){document.body.removeEventListener("mousemove",h),document.body.removeEventListener("mouseup",d)}function c(f,m,v,C){var x;const g=(x=n.value)==null?void 0:x.getBoundingClientRect();if(!g)return;const{width:y,height:_}=g,k=y/v,w=_/C;t.x=f*k,t.y=m*w}return a.onMounted(()=>{var f,m;(f=n.value)==null||f.addEventListener("touchstart",r),(m=n.value)==null||m.addEventListener("mousedown",i)}),a.onBeforeUnmount(()=>{var f,m;(f=n.value)==null||f.removeEventListener("touchstart",r),document.body.removeEventListener("touchmove",s),document.body.removeEventListener("touchend",l),(m=n.value)==null||m.removeEventListener("mousedown",i),document.body.removeEventListener("mousemove",h),document.body.removeEventListener("mouseup",d)}),{colorAreaRef:n,circlePickerCoordinate:t,setCirclePickerCoordinate:c}}const ee="#FFFFFF",Wt={class:"hv-color-picker__color-form"},Gt={class:"mb-12"},qt={class:"hv-color-picker__form-group mb-12"},Kt={class:"hv-color-picker__form-group mb-12"},Jt=a.defineComponent({__name:"ColorForm",props:{modelValue:{},disabled:{type:Boolean}},emits:["change"],setup(e,{emit:n}){const t=e,o=n,r=a.ref(D(t.modelValue||ee).hex()),s=a.reactive(D(r.value||ee).rgb().object()),l=a.reactive(D(r.value||ee).hsv().object());function i(d){return`#${d.replace(/[^0-9A-F]/gi,"").slice(0,6).toUpperCase()}`}a.watch(()=>t.modelValue,d=>{const c=D(d);r.value=c.hex();const{r:f,g:m,b:v}=c.rgb().object(),{h:C,s:g,v:y}=c.hsv().object();Object.assign(s,{r:f,g:m,b:v}),Object.assign(l,{h:C,s:g,v:y})});function h(){(r.value||"").replace(/[^0-9A-F]/gi,"").length===6?o("change",r.value):r.value=t.modelValue}function p(){const{r:d,g:c,b:f}=s;o("change",D.rgb(d,c,f).hex().toString())}function u(){const{h:d,s:c,v:f}=l;o("change",D.hsv(d,c,f).hex().toString())}return(d,c)=>{const f=a.resolveComponent("el-input"),m=a.resolveComponent("el-input-number");return a.openBlock(),a.createElementBlock("div",Wt,[a.createElementVNode("div",Gt,[a.createVNode(f,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=v=>r.value=v),disabled:t.disabled,formatter:i,onChange:h},null,8,["modelValue","disabled"])]),a.createElementVNode("div",qt,[c[7]||(c[7]=a.createElementVNode("div",{class:"hv-color-picker__form-label"},"RGB",-1)),a.createVNode(m,{modelValue:s.r,"onUpdate:modelValue":c[1]||(c[1]=v=>s.r=v),disabled:t.disabled,onChange:p,"step-strictly":"",min:0,max:255,"value-on-clear":0,step:1,controls:!1},null,8,["modelValue","disabled"]),a.createVNode(m,{modelValue:s.g,"onUpdate:modelValue":c[2]||(c[2]=v=>s.g=v),disabled:t.disabled,onChange:p,"step-strictly":"",min:0,max:255,"value-on-clear":0,step:1,controls:!1},null,8,["modelValue","disabled"]),a.createVNode(m,{modelValue:s.b,"onUpdate:modelValue":c[3]||(c[3]=v=>s.b=v),disabled:t.disabled,onChange:p,"step-strictly":"",min:0,max:255,"value-on-clear":0,step:1,controls:!1},null,8,["modelValue","disabled"])]),a.createElementVNode("div",Kt,[c[8]||(c[8]=a.createElementVNode("div",{class:"hv-color-picker__form-label"},"HSV",-1)),a.createVNode(m,{modelValue:l.h,"onUpdate:modelValue":c[4]||(c[4]=v=>l.h=v),disabled:t.disabled,onChange:u,min:0,max:360,"value-on-clear":0,"step-strictly":"",step:1,controls:!1},null,8,["modelValue","disabled"]),a.createVNode(m,{modelValue:l.s,"onUpdate:modelValue":c[5]||(c[5]=v=>l.s=v),disabled:t.disabled,onChange:u,min:0,max:100,"value-on-clear":0,"step-strictly":"",step:1,controls:!1},null,8,["modelValue","disabled"]),a.createVNode(m,{modelValue:l.v,"onUpdate:modelValue":c[6]||(c[6]=v=>l.v=v),disabled:t.disabled,onChange:u,"step-strictly":"",min:0,max:100,"value-on-clear":0,controls:!1},null,8,["modelValue","disabled"])])])}}}),Zt={class:"hv-color-picker__preset"},Qt={class:"hv-color-picker__preset-title"},en={class:"hv-color-picker__preset-list"},tn=["onClick"],nn=a.defineComponent({__name:"PresetColors",props:{title:{},presetColors:{}},emits:["change"],setup(e,{emit:n}){const t=["#000000","#FFFFFF","#E3822D","#DCE24F","#1DCF69","#6DE5B9","#11A1F2","#AA43FF","#F0689C","#F8D28B","#606368","#E83C34","#EEBE29","#89F0AC","#2FBC9E","#56CCF2","#1C1DFA","#DC88F5","#D4C595","#C52F65"],o=e,r=a.computed(()=>o.presetColors?o.presetColors:t),s=n;function l(i){s("change",i)}return(i,h)=>(a.openBlock(),a.createElementBlock("div",Zt,[a.createElementVNode("div",Qt,a.toDisplayString(o.title||"Preset colors"),1),a.createElementVNode("div",en,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.value,p=>(a.openBlock(),a.createElementBlock("div",{class:"hv-color-picker__preset-list-item",onClick:u=>l(p),key:p,style:a.normalizeStyle({backgroundColor:p})},null,12,tn))),128))])]))}}),on={class:"hv-color-picker"},rn={class:"hv-color-picker__title"},an={class:"hv-color-picker__area-outer"},ln={class:"hv-color-picker__slider"},sn=a.defineComponent({name:"HvColorPicker",__name:"ColorPicker",props:{modelValue:{default:ee},disabled:{type:Boolean},title:{},presetTitle:{},presetColors:{}},emits:["update:model-value"],setup(e,{emit:n}){const t=e,o=n,r=a.computed(()=>t.disabled),{colorAreaCanvas:s,getColorByCoordinate:l,getCoordinateByColor:i,canvasWidth:h,canvasHeight:p}=Ut(),{colorAreaRef:u,circlePickerCoordinate:d,setCirclePickerCoordinate:c}=Yt({disabled:r}),f=a.computed({get(){return t.modelValue},set(k){o("update:model-value",k)}}),m=a.ref(D(ee)),v=a.ref(100),C=a.computed(()=>m.value?at(m.value,v.value):ee);a.watch(f,k=>{at(m.value,v.value)!==k&&_(k)}),a.watch(()=>d,k=>{var F;const w=(F=u.value)==null?void 0:F.getBoundingClientRect();if(!w)return;const x=l(k.x,k.y,w.width,w.height);m.value=x},{deep:!0});const g=a.computed(()=>f.value?{top:d.y+"px",left:d.x+"px",backgroundColor:m.value.hex()}:{top:"100%",left:"0",backgroundColor:"#ffffff"}),y=a.computed(()=>{const k=rt(m.value);return{"--el-slider-runway-bg-color":`linear-gradient(to right, #000000, ${k})`,"--el-slider-main-bg-color":k}});a.watch(()=>C.value,(k,w)=>{if(k!==w){o("update:model-value",k);return}});function _(k){if(t.disabled)return;const w=ot(k),{color:x,value:F}=jt(w);m.value=x,v.value=F;const z=i(x);c(z.x,z.y,h,p)}return a.onMounted(()=>{_(f.value)}),(k,w)=>{const x=a.resolveComponent("ElSlider");return a.openBlock(),a.createElementBlock("div",on,[a.createElementVNode("div",rn,a.toDisplayString(t.title||"Color picker"),1),a.createElementVNode("div",an,[a.createElementVNode("div",{class:a.normalizeClass(["hv-color-picker__area",r.value?"is-disabled":""]),ref_key:"colorAreaRef",ref:u},[a.createElementVNode("canvas",{ref_key:"colorAreaCanvas",ref:s},null,512),a.createElementVNode("div",{class:"hv-color-picker__circle",style:a.normalizeStyle(g.value)},null,4)],2)]),a.createElementVNode("div",ln,[a.createVNode(x,{modelValue:v.value,"onUpdate:modelValue":w[0]||(w[0]=F=>v.value=F),disabled:t.disabled,min:0,max:100,"show-tooltip":!1,style:a.normalizeStyle(y.value)},null,8,["modelValue","disabled","style"]),a.createElementVNode("div",{class:"hv-color-picker__origin-color",style:a.normalizeStyle({backgroundColor:C.value})},null,4)]),a.createVNode(Jt,{"model-value":f.value,disabled:t.disabled,onChange:_},null,8,["model-value","disabled"]),a.createVNode(nn,{onChange:_,title:t.presetTitle,presetColors:t.presetColors},null,8,["title","presetColors"])])}}});function cn(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var Re=cn,dn=typeof ke=="object"&&ke&&ke.Object===Object&&ke,un=dn,hn=un,fn=typeof self=="object"&&self&&self.Object===Object&&self,mn=hn||fn||Function("return this")(),lt=mn,pn=lt,vn=function(){return pn.Date.now()},gn=vn,bn=/\s/;function yn(e){for(var n=e.length;n--&&bn.test(e.charAt(n)););return n}var Cn=yn,_n=Cn,kn=/^\s+/;function xn(e){return e&&e.slice(0,_n(e)+1).replace(kn,"")}var wn=xn,En=lt,Sn=En.Symbol,st=Sn,it=st,ct=Object.prototype,Mn=ct.hasOwnProperty,Fn=ct.toString,ge=it?it.toStringTag:void 0;function Tn(e){var n=Mn.call(e,ge),t=e[ge];try{e[ge]=void 0;var o=!0}catch{}var r=Fn.call(e);return o&&(n?e[ge]=t:delete e[ge]),r}var Vn=Tn,Dn=Object.prototype,Ln=Dn.toString;function An(e){return Ln.call(e)}var Bn=An,dt=st,$n=Vn,On=Bn,Rn="[object Null]",Pn="[object Undefined]",ut=dt?dt.toStringTag:void 0;function Nn(e){return e==null?e===void 0?Pn:Rn:ut&&ut in Object(e)?$n(e):On(e)}var In=Nn;function Hn(e){return e!=null&&typeof e=="object"}var jn=Hn,zn=In,Un=jn,Xn="[object Symbol]";function Yn(e){return typeof e=="symbol"||Un(e)&&zn(e)==Xn}var Wn=Yn,Gn=wn,ht=Re,qn=Wn,ft=NaN,Kn=/^[-+]0x[0-9a-f]+$/i,Jn=/^0b[01]+$/i,Zn=/^0o[0-7]+$/i,Qn=parseInt;function eo(e){if(typeof e=="number")return e;if(qn(e))return ft;if(ht(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=ht(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Gn(e);var t=Jn.test(e);return t||Zn.test(e)?Qn(e.slice(2),t?2:8):Kn.test(e)?ft:+e}var to=eo,no=Re,Pe=gn,mt=to,oo="Expected a function",ro=Math.max,ao=Math.min;function lo(e,n,t){var o,r,s,l,i,h,p=0,u=!1,d=!1,c=!0;if(typeof e!="function")throw new TypeError(oo);n=mt(n)||0,no(t)&&(u=!!t.leading,d="maxWait"in t,s=d?ro(mt(t.maxWait)||0,n):s,c="trailing"in t?!!t.trailing:c);function f(x){var F=o,z=r;return o=r=void 0,p=x,l=e.apply(z,F),l}function m(x){return p=x,i=setTimeout(g,n),u?f(x):l}function v(x){var F=x-h,z=x-p,te=n-F;return d?ao(te,s-z):te}function C(x){var F=x-h,z=x-p;return h===void 0||F>=n||F<0||d&&z>=s}function g(){var x=Pe();if(C(x))return y(x);i=setTimeout(g,v(x))}function y(x){return i=void 0,c&&o?f(x):(o=r=void 0,l)}function _(){i!==void 0&&clearTimeout(i),p=0,o=h=r=i=void 0}function k(){return i===void 0?l:y(Pe())}function w(){var x=Pe(),F=C(x);if(o=arguments,r=this,h=x,F){if(i===void 0)return m(h);if(d)return clearTimeout(i),i=setTimeout(g,n),f(h)}return i===void 0&&(i=setTimeout(g,n)),l}return w.cancel=_,w.flush=k,w}var so=lo,io=so,co=Re,uo="Expected a function";function ho(e,n,t){var o=!0,r=!0;if(typeof e!="function")throw new TypeError(uo);return co(t)&&(o="leading"in t?!!t.leading:o,r="trailing"in t?!!t.trailing:r),io(e,n,{leading:o,maxWait:n,trailing:r})}var fo=ho;const pt=We(fo);let Ne={x:void 0,y:void 0};function mo(e){const n=a.ref(),t=a.reactive({x:100,y:100});function o(c){if(e.value||c.touches.length===0)return;c.preventDefault();const{clientX:f,clientY:m}=c.touches[0];h({x:f,y:m}),document.body.addEventListener("touchmove",r),document.body.addEventListener("touchend",s)}function r(c){if(e.value||c.touches.length>1)return;const{clientX:f,clientY:m}=c.touches[0];h({x:f,y:m})}function s(){document.body.removeEventListener("touchmove",r),document.body.removeEventListener("touchend",s)}function l(c){e.value||(document.body.addEventListener("mousemove",i),document.body.addEventListener("mouseup",u),h({x:c.clientX,y:c.clientY}))}function i(c){if(!e.value){if(!c.buttons){u();return}h({x:c.clientX,y:c.clientY})}}const h=pt(p,20);function p(c){var x;const{x:f,y:m}=c;if(Ne.x==c.x&&Ne.y==c.y)return;Ne=c;const v=(x=n.value)==null?void 0:x.getBoundingClientRect();if(!v)return;const{left:C,top:g,width:y,height:_}=v;let k=0,w=0;f<=C?k=0:f>=C+y?k=y:k=f-C,m<=g?w=0:m>=g+_?w=_:w=m-g,t.x=k/y*100,t.y=(_-w)/_*100}function u(){document.body.removeEventListener("mousemove",i),document.body.removeEventListener("mouseup",u)}function d(c,f){t.x=c,t.y=f}return a.onMounted(()=>{var c,f;(c=n.value)==null||c.addEventListener("touchstart",o),(f=n.value)==null||f.addEventListener("mousedown",l)}),a.onBeforeUnmount(()=>{var c,f;(c=n.value)==null||c.removeEventListener("touchstart",o),document.body.removeEventListener("touchmove",r),document.body.removeEventListener("touchend",s),(f=n.value)==null||f.removeEventListener("mousedown",l),document.body.removeEventListener("mousemove",i),document.body.removeEventListener("mouseup",u)}),{colorAreaRef:n,circlePickerCoordinate:t,setCirclePickerCoordinate:d}}const po=a.defineComponent({__name:"ColorArea",props:{saturation:{default:100},value:{default:100},color:{},hueColor:{},disabled:{type:Boolean}},emits:["update:saturation","update:value"],setup(e,{emit:n}){const t=n,o=e,r=a.computed({get(){return o.saturation},set(d){t("update:saturation",d)}}),s=a.computed({get(){return o.value},set(d){t("update:value",d)}}),l=a.computed(()=>o.disabled),{colorAreaRef:i,circlePickerCoordinate:h,setCirclePickerCoordinate:p}=mo(l),u=a.reactive({hexColor:"",bgHexColor:""});return a.watch(()=>o.color,d=>{const c=D(d);u.hexColor=c.hex();let{h:f,s:m,v}=c.hsv().object();u.bgHexColor=D({h:f,s:100,v:100}).hex(),D.hsv({h:f,s:h.x,v:h.y}).hex()==c.hex()&&(m=h.x),p(m,v)},{immediate:!0}),a.watch(h,d=>{r.value=d.x,s.value=d.y},{deep:!0}),(d,c)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"colorAreaRef",ref:i,class:"hv-color-picker__color-area-outer"},[a.createElementVNode("div",{class:"hv-color-picker__color-area",style:a.normalizeStyle({backgroundColor:o.hueColor})},[a.createElementVNode("div",{class:"hv-color-picker__circle",style:a.normalizeStyle({backgroundColor:u.hexColor,left:`${a.unref(h).x}%`,bottom:`${a.unref(h).y}%`})},null,4)],4)],512))}}),be=(e,n)=>{const t=e.__vccOpts||e;for(const[o,r]of n)t[o]=r;return t},vo=be(po,[["__scopeId","data-v-d4f5b081"]]),go={class:"hv-color_picker__form mb-12"},bo={class:"hv-color-picker__form-type"},yo={class:"hv-color-picker__form-body"},Co=be(a.defineComponent({__name:"ColorForm",props:{modelValue:{},disabled:{type:Boolean},enableAlpha:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:n}){const t=["RGB","HSL","HSV"],o=e,r=n,s=a.ref("RGB"),l=a.ref([255,255,255,100]),i=a.computed(()=>s.value==="RGB");a.watch(()=>o.modelValue,()=>{h()},{immediate:!0});function h(){const u=D(o.modelValue),d=u.alpha()*100;switch(s.value){case"RGB":{const c=u.rgb().array();l.value=[...c.slice(0,3),d];break}case"HSL":{const c=u.hsl().array();l.value=[...c.slice(0,3),d];break}case"HSV":{const c=u.hsv().array();l.value=[...c.slice(0,3),d];break}}}function p(){let u=D(ee);switch(s.value){case"RGB":{u=D.rgb(...l.value.slice(0,3));break}case"HSL":{u=D.hsl(...l.value.slice(0,3));break}case"HSV":{u=D.hsv(...l.value.slice(0,3));break}}r("update:modelValue",u.alpha(o.enableAlpha?l.value[3]/100:1).hexa())}return(u,d)=>{const c=a.resolveComponent("el-option"),f=a.resolveComponent("el-select"),m=a.resolveComponent("el-input-number");return a.openBlock(),a.createElementBlock("div",go,[a.createElementVNode("div",bo,[a.createVNode(f,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=v=>s.value=v),disabled:o.disabled,"popper-class":"hv-color-picker-popper",onChange:h,teleported:!1},{default:a.withCtx(()=>[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(t,v=>a.createVNode(c,{key:v,label:v,value:v},null,8,["label","value"])),64))]),_:1},8,["modelValue","disabled"])]),a.createElementVNode("div",yo,[a.createVNode(m,{modelValue:l.value[0],"onUpdate:modelValue":d[1]||(d[1]=v=>l.value[0]=v),onChange:p,"step-strictly":"",disabled:o.disabled,min:0,max:i.value?255:360,"value-on-clear":0,step:1,controls:!1},null,8,["modelValue","disabled","max"]),a.createVNode(m,{modelValue:l.value[1],"onUpdate:modelValue":d[2]||(d[2]=v=>l.value[1]=v),onChange:p,"step-strictly":"",disabled:o.disabled,min:0,max:i.value?255:100,"value-on-clear":0,step:1,controls:!1},null,8,["modelValue","disabled","max"]),a.createVNode(m,{modelValue:l.value[2],"onUpdate:modelValue":d[3]||(d[3]=v=>l.value[2]=v),onChange:p,"step-strictly":"",disabled:o.disabled,min:0,max:i.value?255:100,"value-on-clear":0,step:1,controls:!1},null,8,["modelValue","disabled","max"]),o.enableAlpha?(a.openBlock(),a.createBlock(m,{key:0,modelValue:l.value[3],"onUpdate:modelValue":d[4]||(d[4]=v=>l.value[3]=v),onChange:p,class:"hv-color-picker__form-opacity","step-strictly":"",disabled:o.disabled,min:0,max:100,"value-on-clear":0,step:1,controls:!1},{suffix:a.withCtx(()=>d[5]||(d[5]=[a.createElementVNode("span",null,"%",-1)])),_:1},8,["modelValue","disabled"])):a.createCommentVNode("",!0)])])}}}),[["__scopeId","data-v-0118404d"]]),_o={class:"hv-color-picker__preset"},ko={class:"hv-color-picker__preset-title"},xo={class:"hv-color-picker__preset-list"},wo=["onClick"],Eo=be(a.defineComponent({__name:"PresetColors",props:{title:{},presetColors:{}},emits:["change"],setup(e,{emit:n}){const t=["#000000","#FFFFFF","#E3822D","#DCE24F","#1DCF69","#6DE5B9","#11A1F2","#AA43FF","#F0689C","#F8D28B","#606368","#E83C34","#EEBE29","#89F0AC","#2FBC9E","#56CCF2","#1C1DFA","#DC88F5","#D4C595","#C52F65"],o=e,r=a.computed(()=>o.presetColors?o.presetColors:t),s=n;function l(i){s("change",i)}return(i,h)=>(a.openBlock(),a.createElementBlock("div",_o,[a.createElementVNode("div",ko,a.toDisplayString(o.title||"Reset colors"),1),a.createElementVNode("div",xo,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.value,p=>(a.openBlock(),a.createElementBlock("div",{class:"hv-color-picker__preset-list-item",onClick:u=>l(p),key:p,style:a.normalizeStyle({backgroundColor:p})},null,12,wo))),128))])]))}}),[["__scopeId","data-v-c15cc053"]]),So={class:"hv-color-picker-normal"},Mo={class:"hv-color-picker__color-select-box"},Fo={class:"hv-color-picker__sliders"},To=be(a.defineComponent({name:"HvColorPickerNormal",__name:"ColorPicker",props:{modelValue:{default:ee},disabled:{type:Boolean},enableAlpha:{type:Boolean,default:!0},presetTitle:{},presetColors:{}},emits:["update:model-value"],setup(e,{emit:n}){const t=n,o=e,r=a.computed({get(){return o.modelValue},set(C){t("update:model-value",C)}}),s=!!window.EyeDropper,l=a.ref(),i=a.ref(0),h=a.ref(0),p=a.ref(100),u=a.ref(100),d=a.computed(()=>D(r.value).alpha(1).hex());a.watch(r,C=>{const g=D(C),{h:y,s:_}=g.hsv().object();p.value=_;const k=[0,360];h.value=o.enableAlpha?Math.round(g.alpha()*100):100,D.hsv({h:i.value,s:p.value,v:u.value,alpha:h.value}).hexa()!==g.hexa()&&(k.includes(y)&&k.includes(i.value)||(i.value=y))},{immediate:!0});const c=a.computed(()=>D({h:i.value,s:100,v:100}).hex());a.watch([i,h,p,u],()=>{f()});const f=pt(function(){const g=D({h:i.value,s:p.value,v:u.value,alpha:h.value/100});r.value=o.enableAlpha?g.hexa():g.hex()},50,{leading:!1,trailing:!0});function m(){if(o.disabled)return;new window.EyeDropper().open().then(g=>{r.value=g.sRGBHex}).catch(g=>{console.error("Eyedropper failed to get color",g)})}function v(C){o.disabled||(r.value=C)}return(C,g)=>{const y=a.resolveComponent("ElSlider");return a.openBlock(),a.createElementBlock("div",So,[a.createVNode(vo,{ref_key:"colorAreaRef",ref:l,"hue-color":c.value,color:r.value,saturation:p.value,"onUpdate:saturation":g[0]||(g[0]=_=>p.value=_),value:u.value,"onUpdate:value":g[1]||(g[1]=_=>u.value=_),disabled:o.disabled},null,8,["hue-color","color","saturation","value","disabled"]),a.createElementVNode("div",Mo,[s?(a.openBlock(),a.createElementBlock("svg",{key:0,onClick:m,class:a.normalizeClass(["hv-color-picker__dropper",o.disabled?"is-disabled":""]),width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g[5]||(g[5]=[a.createElementVNode("path",{d:"M22.9297 5.8C21.863 4.73333 20.263 4.73333 19.1964 5.8L15.463 9.53332L14.3963 8.59999C13.863 8.06666 13.063 8.06666 12.5296 8.59999C11.9963 9.13332 11.9963 9.93332 12.5296 10.4667L13.463 11.4L5.72967 19.1333C5.19634 19.6666 4.39634 21.6666 5.72967 23C7.06299 24.3333 9.06299 23.5333 9.59632 23L17.3296 15.2666L18.263 16.2C18.7964 16.7333 19.5964 16.7333 20.1297 16.2C20.663 15.6666 20.663 14.8666 20.1297 14.3333L19.1964 13.4L22.9297 9.66666C23.9964 8.46666 23.9964 6.86666 22.9297 5.8ZM8.39632 21.6666H7.06299V20.3333L14.7963 12.6L16.1296 13.9333C15.9963 13.9333 8.39632 21.6666 8.39632 21.6666Z",fill:"currentcolor"},null,-1)]),2)):a.createCommentVNode("",!0),a.createElementVNode("div",Fo,[a.createVNode(y,{modelValue:i.value,"onUpdate:modelValue":g[2]||(g[2]=_=>i.value=_),min:0,max:360,disabled:o.disabled,"show-tooltip":!1,class:"hv-color-picker__hue-slider",style:a.normalizeStyle({"--el-slider-button-bg-color":c.value})},null,8,["modelValue","disabled","style"]),o.enableAlpha?(a.openBlock(),a.createBlock(y,{key:0,modelValue:h.value,"onUpdate:modelValue":g[3]||(g[3]=_=>h.value=_),min:0,max:100,disabled:o.disabled,"show-tooltip":!1,class:"hv-color-picker__alpha-slider",style:a.normalizeStyle({"--hv-cur-full-alpha-color":d.value})},null,8,["modelValue","disabled","style"])):a.createCommentVNode("",!0)])]),a.createVNode(Co,{"model-value":r.value,"onUpdate:modelValue":g[4]||(g[4]=_=>r.value=_),disabled:o.disabled,"enable-alpha":o.enableAlpha},null,8,["model-value","disabled","enable-alpha"]),a.createVNode(Eo,{onChange:v,title:o.presetTitle,presetColors:o.presetColors},null,8,["title","presetColors"])])}}}),[["__scopeId","data-v-fbafd973"]]),vt=K(sn),Vo=vt,Do=K(To);class Lo{constructor(){q(this,"_eventMap");this._eventMap=new Map}on(n,t){const o=this._eventMap.get(n);if(o)o.add(t);else{const r=new Set;r.add(t),this._eventMap.set(n,r)}}off(n,t){const o=this._eventMap.get(n);o&&(t?o.delete(t):o.clear())}emit(n,...t){const o=this._eventMap.get(n);if(o)for(const r of o.values())r(...t)}}class Ao extends Lo{constructor(){super();q(this,"isDragStart",!1);q(this,"dragType");q(this,"dragData");q(this,"isSendFirstMovePos",!1);q(this,"touchStartPressTime",300);q(this,"touchStartTime",0);q(this,"touchStartPosition",{x:0,y:0});q(this,"lastMovePoint",{x:0,y:0});q(this,"emitTouchStartTimer");q(this,"destroy",()=>{});this.bindEventListener()}updateDargInfo(t,o){if(t==null)throw new Error("Expected to get a drag type, but received ",t);this.isDragStart=!0,this.dragType=t,this.dragData=o,this.emitTouchStartTimer&&clearTimeout(this.emitTouchStartTimer),this.emitTouchStartTimer=void 0}onDown(t){this.emit("down",t)}onFirstMove(t,o){this.isDragStart||(this.isSendFirstMovePos=!0,this.emit("first-move",t,o))}onStart(t){this.isDragStart||this.emit("start",t)}onMove(t){!this.isDragStart||!this.dragType||(this.lastMovePoint=t,this.emit("move",{type:this.dragType,data:this.dragData,point:t}))}onEnd(){this.emitTouchStartTimer&&clearTimeout(this.emitTouchStartTimer),this.emitTouchStartTimer=void 0,this.isSendFirstMovePos=!1,!(!this.isDragStart||!this.dragType)&&(this.isDragStart=!1,this.emit("end",{point:this.lastMovePoint,type:this.dragType,data:this.dragData}))}onMouseDown(t){if(t.buttons!==1){this.onEnd();return}const{clientX:o,clientY:r}=t,s={x:o,y:r};this.touchStartTime=Date.now(),this.touchStartPosition=s,this.emitTouchStartTimer&&clearTimeout(this.emitTouchStartTimer),this.onDown(s),this.emitTouchStartTimer=window.setTimeout(()=>{this.onStart(s)},this.touchStartPressTime)}onMouseMove(t){if(t.buttons!==1){this.onEnd();return}const{clientX:o,clientY:r}=t;if(this.isDragStart)t.preventDefault(),t.stopPropagation(),this.onMove({x:o,y:r});else{this.isSendFirstMovePos||this.onFirstMove({x:o,y:r},t);const{x:s,y:l}=this.touchStartPosition;Date.now()-this.touchStartTime<this.touchStartPressTime&&(Math.abs(s-o)>30||Math.abs(l-r)>30)&&(clearTimeout(this.emitTouchStartTimer),this.emitTouchStartTimer=void 0)}}onMouseUp(){this.onEnd()}onTouchStart(t){if(t.touches.length>1)return;const{clientX:o,clientY:r}=t.touches[0],s={x:o,y:r};this.touchStartTime=Date.now(),this.touchStartPosition=s,this.onDown(s),this.emitTouchStartTimer=window.setTimeout(()=>{this.onStart(s)},this.touchStartPressTime)}onTouchMove(t){if(t.touches.length>1)return;const{clientX:o,clientY:r}=t.touches[0];if(this.isDragStart)t.preventDefault(),t.stopPropagation(),this.onMove({x:o,y:r});else{this.isSendFirstMovePos||this.onFirstMove({x:o,y:r},t);const{x:s,y:l}=this.touchStartPosition;Date.now()-this.touchStartTime<this.touchStartPressTime&&(Math.abs(s-o)>30||Math.abs(l-r)>30)&&clearTimeout(this.emitTouchStartTimer)}}onTouchEnd(){this.onEnd()}bindEventListener(){if(document.body){const t=this.onTouchStart.bind(this),o=this.onTouchMove.bind(this),r=this.onTouchEnd.bind(this),s=this.onMouseDown.bind(this),l=this.onMouseMove.bind(this),i=this.onMouseUp.bind(this);document.body.addEventListener("touchstart",t,{passive:!1}),document.body.addEventListener("touchmove",o,{passive:!1}),document.body.addEventListener("touchend",r,{passive:!1}),document.body.addEventListener("mousedown",s),document.body.addEventListener("mousemove",l),document.body.addEventListener("mouseup",i),this.destroy=()=>{document.body.removeEventListener("touchstart",t),document.body.removeEventListener("touchmove",o),document.body.removeEventListener("touchend",r),document.body.removeEventListener("mousedown",s),document.body.removeEventListener("mousemove",l),document.body.removeEventListener("mouseup",i)}}else document.addEventListener("DOMContentLoaded",this.bindEventListener)}removeEventListener(){this.destroy()}destroyed(){this.isDragStart=!1,this.dragType=void 0,this.dragData=void 0,this.removeEventListener()}}const j=new Ao,Bo=be(a.defineComponent({name:"HvDraggable",__name:"Draggable",props:{type:{},immediate:{},disabled:{type:Boolean,default:!1},data:{}},setup(e){const n={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom",ALL:"all"},t=e,o=a.ref(),r=a.ref(!1),s=a.reactive({x:0,y:0}),l=a.ref(!1),i=a.reactive({x:0,y:0}),h=a.computed(()=>Array.isArray(t.immediate)?t.immediate:t.immediate?[t.immediate]:[]),p=a.computed(()=>({transform:`translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`})),u=g=>{const{x:y,y:_}=g,k=document.elementFromPoint(y,_);!t.disabled&&o.value&&o.value.contains(k)&&(r.value=!0,s.x=y,s.y=_)},d=(g,y)=>{const{x:_,y:k}=g,w=h.value;if(r.value&&!t.disabled&&w.length){const x=_-s.x,F=Math.abs(x),z=k-s.y,te=Math.abs(z),ce=Math.max(F,te),ae=F===ce,Me=te===ce;let ne=!1;if(w.includes(n.ALL)?ne=!0:(ae&&(ne=w.includes(n.LEFT)&&x<0||w.includes(n.RIGHT)&&x>0),Me&&!ne&&(ne=w.includes(n.TOP)&&z<0||w.includes(n.BOTTOM)&&z>0)),ne){y.preventDefault(),y.stopPropagation(),v(s),C(g);return}}},c=g=>{const{x:y,y:_}=g,k=document.elementFromPoint(y,_);!t.disabled&&o.value&&o.value.contains(k)&&v(g)},f=g=>{if(t.disabled){l.value=!1;return}const{point:y}=g;l.value&&C(y)},m=()=>{r.value=!1,l.value=!1,Object.assign(s,{x:0,y:0}),Object.assign(i,{x:0,y:0})};function v(g){l.value=!0,i.x=g.x,i.y=g.y,j.updateDargInfo(t.type,t.data)}function C(g){i.x=g.x,i.y=g.y}return a.onMounted(()=>{j.on("down",u),j.on("first-move",d),j.on("start",c),j.on("move",f),j.on("end",m)}),a.onBeforeUnmount(()=>{j.off("down",u),j.off("first-move",d),j.off("start",c),j.off("move",f),j.off("end",m)}),(g,y)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"dragItemRef",ref:o,class:a.normalizeClass(["hv-draggable",g.disabled?"disabled":""])},[a.renderSlot(g.$slots,"default",{},void 0,!0),l.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:"hv-draggable__clone-item",style:a.normalizeStyle(p.value)},[a.renderSlot(g.$slots,"drag-item",{},()=>[a.renderSlot(g.$slots,"default",{},void 0,!0)],!0)],4)):a.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-695472bf"]]),$o=a.defineComponent({name:"HvDroppable",__name:"Droppable",props:{acceptDragType:{},disabled:{type:Boolean}},emits:["enter","move","drop","leave"],setup(e,{emit:n}){const t=n,o=e,r=a.ref(),s=a.ref(!1),l=a.computed(()=>Array.isArray(o.acceptDragType)?o.acceptDragType:[o.acceptDragType]);function i(u){if(!r.value)return{isInArea:!1,position:{x:0,y:0}};const{x:d,y:c}=u,{x:f,y:m,width:v,height:C}=r.value.getBoundingClientRect(),g=d-f,y=c-m;return{isInArea:g>=0&&g<=v&&y>=0&&y<=C,position:{x:g,y}}}const h=u=>{if(o.disabled){s.value=!1;return}const{type:d,data:c,point:f}=u;if(r.value&&l.value.includes(d)){const{isInArea:m,position:v}=i(f);m?s.value?t("move",d,v,c):(s.value=!0,t("enter",d,v,c)):s.value&&(s.value=!1,t("leave",d,c))}},p=({type:u,point:d,data:c})=>{if(!o.disabled&&r.value&&l.value.includes(u)&&s.value){const{position:f}=i(d);t("drop",u,f,c)}s.value=!1};return a.onMounted(()=>{j.on("move",h),j.on("end",p)}),a.onBeforeUnmount(()=>{j.off("move",h),j.off("end",p)}),(u,d)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"dropAreaRef",ref:r,class:"hv-droppable"},[a.renderSlot(u.$slots,"default")],512))}}),Oo=K(Bo),Ro=K($o);function Po(e,n,t){const o=a.computed(()=>a.isRef(t)?a.toValue(t):t),r=a.computed(()=>o.value.containerRealSize),s=a.computed(()=>{const E=typeof o.value.keepRatio=="boolean"?{enable:o.value.keepRatio,scaleCase:"min"}:o.value.keepRatio;return Object.assign({scaleCase:"min",enable:!1},E||{})}),l=a.computed(()=>{const E=Object.assign({inContainer:!0,minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},o.value.limit||{});return E.minWidth>E.maxWidth&&(E.maxWidth=E.minWidth),E.minHeight>E.maxHeight&&(E.maxHeight=E.minHeight),E}),i=a.computed(()=>o.value.disabled||!1),h=a.computed(()=>a.isRef(e)?a.toValue(e):e),p=a.computed(()=>o.value.container),u=a.computed(()=>a.isRef(n)?a.toValue(n):n);let d={x:0,y:0},c={x:0,y:0},f={x:0,y:0};const m={width:0,height:0},v={elX:0,elY:0,elWidth:0,elHeight:0},C={leftSide:!1,rightSide:!1,topSide:!1,bottomSide:!1,center:!1};let g=!1,y=!1,_=1,k=1;a.watch(()=>h.value&&p.value&&u.value,E=>{E?Xo():je()});function w(E){if(i.value||(d=E,f=E,!p.value||!h.value))return;const{x:O,y:R,width:U,height:X}=p.value.getBoundingClientRect();if(Object.assign(m,{width:U,height:X}),r.value){const{width:Q,height:Te}=r.value;_=Q/U,k=Te/X}else _=1,k=1;const{x:T,y:V,width:N,height:I}=h.value.getBoundingClientRect(),{x:S,y:M}=E;Object.assign(v,{elX:T-O,elY:V-R,elWidth:N,elHeight:I});const Fe=document.elementFromPoint(S,M);if(!Fe)return;const le=(Fe.dataset.scaleSide||"").split(",").filter(Q=>!!Q);if(!le.length)return;let ye=le.includes("left"),Ce=le.includes("top"),J=le.includes("right"),Z=le.includes("bottom");const oe=le.includes("center");g=!0,s.value.enable&&!oe&&(S-T<=N/2&&M-V<=I/2&&(ye=!0,Ce=!0),S-T>N/2&&M-V<=I/2&&(J=!0,Ce=!0),S-T<=N/2&&M-V>I/2&&(ye=!0,Z=!0),S-T>N/2&&M-V>I/2&&(J=!0,Z=!0)),Object.assign(C,{leftSide:ye,rightSide:J,topSide:Ce,bottomSide:Z,center:oe})}function x(E){if(i.value||g!==!0){g=!1;return}y=!0,c=f,f=E;const O=E.x-d.x,R=E.y-d.y;let U=0,X=0,T=0,V=0;const{elX:N,elY:I,elWidth:S,elHeight:M}=v,{minWidth:Fe,minHeight:le,maxWidth:ye,maxHeight:Ce}=l.value,J=Fe/_,Z=le/k,oe=ye/_,Q=Ce/k;if(C.center){const Ve=m.width,De=m.height;if(l.value.inContainer){const ze=N+O<0?-N:N+S+O>Ve?Ve-S-N:O,Ue=I+R<0?-I:I+M+R>De?De-M-I:R;U=ze,X=Ue}else U=O,X=R}else{const{leftSide:Ve,rightSide:De,topSide:ze,bottomSide:Ue}=C;if(Ve){let L=l.value.inContainer&&N+O<0?-N:O;S-L<J&&(L=S-J),S-L>oe&&(L=S-oe),U=L,T=-L}if(De){const L=m.width;let H=l.value.inContainer&&N+S+O>L?L-S-N:O;S+H<J&&(H=J-S),S+H>oe&&(H=oe-S),T=H}if(ze){let L=l.value.inContainer&&I+R<0?-I:R;M-L<Z&&(L=M-Z),M-L>Q&&(L=M-Q),X=L,V=-L}if(Ue){const L=m.height;let H=l.value.inContainer&&I+M+R>L?L-M-I:R;M+H<Z&&(H=Z-M),M+H>Q&&(H=Q-M),V=H}if(s.value.enable){const L=T/S,H=V/M;if(L<H&&s.value.scaleCase==="min"||L>H&&s.value.scaleCase==="max"){if(V=L*M,M+V<Z){const G=T;V=Z-M,T=V/M*S,U=U*(T/G)}if(M+V>Q){const G=T;V=Q-M,T=V/M*S,U=U*(T/G)}C.topSide&&(X=-V)}else if(H<L&&s.value.scaleCase==="min"||H>L&&s.value.scaleCase==="max"){if(T=H*S,S+T<J){const G=V;T=J-S,V=T/S*M,X=X*(V/G)}if(S+T>oe){const G=V;T=oe-S,V=T/S*M,X=X*(V/G)}C.leftSide&&(U=-T)}const de=N+U,ue=I+X,Xe=S+T,Ye=M+V;if(l.value.inContainer&&(de<0||ue<0||de+Xe>m.width||ue+Ye>m.height)){let G=de<0?0:de,_e=ue<0?0:ue,he=de+Xe>m.width?m.width-G:de+Xe-G,fe=ue+Ye>m.height?m.height-_e:ue+Ye-_e;const Yo=G+he,Wo=_e+fe,Ct=he/fe,Le=S/M;Ct<Le?fe=he/Le:Ct>Le&&(he=fe*Le);const{topSide:Go,leftSide:qo}=C;qo&&(G=Yo-he),Go&&(_e=Wo-fe),U=G-N,X=_e-I,T=he-S,V=fe-M}}}const Te=N+U,gt=I+X,bt=S+T,yt=M+V;o.value.onChange&&o.value.onChange({type:C.center?"move":"scale",deltaX:f.x-c.x,deltaY:f.y-c.y,elX:Te,elY:gt,elWidth:bt,elHeight:yt,realX:Te*_,realY:gt*k,realWidth:bt*_,realHeight:yt*k})}function F(){if(c={x:0,y:0},f={x:0,y:0},i.value||g!==!0||!y){g=!1,y=!1;return}g=!1,y=!1,o.value.onFinish&&o.value.onFinish()}function z(E){if(E.preventDefault(),E.touches.length>1)return;const{clientX:O,clientY:R}=E.touches[0];w({x:O,y:R}),document.body.addEventListener("touchcancel",ae),document.body.addEventListener("touchmove",ce),document.body.addEventListener("touchend",ae)}let te=null;function ce(E){te&&cancelAnimationFrame(te),te=requestAnimationFrame(()=>{if(i.value||g!==!0){g=!1;return}if(E.preventDefault(),E.stopPropagation(),E.touches.length>1){F();return}const{clientX:O,clientY:R}=E.touches[0];O===d.x&&R===d.y||x({x:O,y:R})})}function ae(){if(document.body.removeEventListener("touchmove",ce),document.body.removeEventListener("touchend",ae),document.body.removeEventListener("touchcancel",ae),i.value||g!==!0){g=!1,y=!1;return}requestAnimationFrame(()=>F())}function Me(E){if(E.preventDefault(),!(E.buttons&1))return;const{clientX:O,clientY:R}=E;w({x:O,y:R}),document.body.addEventListener("mousemove",Ie),document.body.addEventListener("mouseup",He)}let ne=null;function Ie(E){ne&&cancelAnimationFrame(ne),ne=requestAnimationFrame(()=>{if(i.value||g!==!0){g=!1;return}if(E.preventDefault(),!(E.buttons&1)){F();return}const{clientX:O,clientY:R}=E;x({x:O,y:R})})}function He(){if(document.body.removeEventListener("mousemove",Ie),document.body.removeEventListener("mouseup",He),i.value||g!==!0){g=!1;return}requestAnimationFrame(()=>F())}function Xo(){je(),u.value.addEventListener("touchstart",z),u.value.addEventListener("mousedown",Me)}function je(){u.value.removeEventListener("touchstart",z),document.body.removeEventListener("touchmove",ce),document.body.removeEventListener("touchend",ae),document.body.removeEventListener("touchcancel",ae),u.value.removeEventListener("mousedown",Me),document.body.removeEventListener("mousemove",Ie),document.body.removeEventListener("mouseup",He)}a.onBeforeUnmount(()=>{g=!1,je()})}const No={class:"hv-drag-and-scale__zoom-mark"},Io=K(a.defineComponent({name:"HvDragAndScale",__name:"DragAndScale",props:{container:{},containerRealSize:{},keepRatio:{type:[Boolean,Object]},limit:{},disabled:{type:Boolean}},emits:["change","finish"],setup(e,{emit:n}){const t=n,o=e,r=a.ref(),s=a.ref();function l(p){t("change",p)}function i(){t("finish")}const h=a.computed(()=>({container:o.container,containerRealSize:o.containerRealSize,keepRatio:o.keepRatio,limit:o.limit,disabled:o.disabled,onChange:l,onFinish:i}));return Po(r,s,h),(p,u)=>(a.openBlock(),a.createElementBlock("div",{class:"hv-drag-and-scale",ref_key:"targetRef",ref:r},[a.renderSlot(p.$slots,"default"),a.createElementVNode("div",No,[a.createElementVNode("div",{class:a.normalizeClass(["hv-drag-and-scale__area-box",o.disabled?"disabled":""]),ref_key:"operateRef",ref:s},u[0]||(u[0]=[a.createStaticVNode('<div class="hv-drag-and-scale__area-top hv-drag-and-scale__area-block"><div class="hv-drag-and-scale__area-left" data-scale-side="left,top"></div><div class="hv-drag-and-scale__area-center" data-scale-side="top"></div><div class="hv-drag-and-scale__area-right" data-scale-side="right,top"></div></div><div class="hv-drag-and-scale__area-middle hv-drag-and-scale__area-block"><div class="hv-drag-and-scale__area-left" data-scale-side="left"></div><div class="hv-drag-and-scale__area-center" data-scale-side="center"></div><div class="hv-drag-and-scale__area-right" data-scale-side="right"></div></div><div class="hv-drag-and-scale__area-bottom hv-drag-and-scale__area-block"><div class="hv-drag-and-scale__area-left" data-scale-side="left,bottom"></div><div class="hv-drag-and-scale__area-center" data-scale-side="bottom"></div><div class="hv-drag-and-scale__area-right" data-scale-side="right,bottom"></div></div>',3)]),2)])],512))}}));function Se(e){const n=parseInt(e+"");return isNaN(n)?"":n<0?"0":n>255?"255":n+""}function Ho(e){const n={begin:null,end:null,result:null};return n.begin=e.selectionStart||0,n.end=e.selectionEnd||0,n.result=e.value.substring(n.begin,n.end),e.focus(),n}const jo=["value","disabled","onInput","onKeydown","onPaste"],zo={key:0},Uo=K(a.defineComponent({name:"HvIpInput",__name:"IpInput",props:{modelValue:{default:"..."},disabled:{type:Boolean,default:!1}},emits:["update:model-value"],setup(e,{emit:n}){const t=n,o=e,r=a.ref([]),s=a.ref([]);a.watch(()=>o.modelValue,u=>{u=u+"";const d=u.split(".");s.value=Array(4).fill("").map((c,f)=>Se(d[f]+""))},{immediate:!0});function l(){const u=s.value.map(d=>Se(d)).join(".");return t("update:model-value",u)}function i(u,d){var m;if(o.disabled)return;const c=u.target.value,f=Se(c);if(s.value[d]=f,u.target.value=f,l(),f==="")return u.preventDefault();String(f).length===3&&d<3&&((m=r.value[d+1])==null||m.focus())}function h(u,d){let c=d;const{end:f}=Ho(u.target);switch(u.keyCode){case 37:case 8:{f===0&&d>0&&(c=d-1);break}case 39:{f===u.target.value.length&&d<3&&(c=d+1);break}case 110:case 190:{u.preventDefault(),d<3&&(c=d+1);break}}const m=r.value[c];if(m.focus(),c<d){const v=m.value.length;m.selectionStart=m.selectionEnd=v}else c>d&&(m.selectionStart=m.selectionEnd=0)}function p(u,d){if(!u.clipboardData||!u.clipboardData.getData)return;const c=u.clipboardData.getData("text/plain");if(!c)return;const f=c.split(".").map(m=>Se(m));if(f.length===4-d&&f.every(m=>m!==""))return f.forEach((m,v)=>{s.value[d+v]=m+""}),l(),u.preventDefault()}return(u,d)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["hv-ip-input",o.disabled?"is-disabled":""])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,(c,f)=>(a.openBlock(),a.createElementBlock("div",{class:"hv-ip-input-item",key:f},[a.createElementVNode("input",{ref_for:!0,ref_key:"inputRefs",ref:r,type:"text",value:c,disabled:o.disabled,onInput:m=>i(m,f),onKeydown:m=>h(m,f),onPaste:m=>p(m,f)},null,40,jo),f!==3?(a.openBlock(),a.createElementBlock("i",zo,".")):a.createCommentVNode("",!0)]))),128))],2))}}));B.DEFAULT_COLOR=ee,B.HvColorPicker=vt,B.HvColorPickerNormal=Do,B.HvColorPickerRainbow=Vo,B.HvDragAndScale=Io,B.HvDraggable=Oo,B.HvDroppable=Ro,B.HvIpInput=Uo,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=components.full.min.js.map
|