@havue/components 1.0.0

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.
@@ -0,0 +1,2 @@
1
+ (function(B,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(B=typeof globalThis<"u"?globalThis:B||self,l(B.components={},B.Vue))})(this,function(B,l){"use strict";var an=Object.defineProperty;var ln=(B,l,K)=>l in B?an(B,l,{enumerable:!0,configurable:!0,writable:!0,value:K}):B[l]=K;var U=(B,l,K)=>ln(B,typeof l!="symbol"?l+"":l,K);const K=(e,n)=>(e.install=t=>{for(const o of[e,...Object.values({})])t.component(o.name,o)},e);function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ze={exports:{}},Ie={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]},Ne={exports:{}},rt=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")},st=rt,at=Array.prototype.concat,it=Array.prototype.slice,Xe=Ne.exports=function(n){for(var t=[],o=0,r=n.length;o<r;o++){var s=n[o];st(s)?t=at.call(t,it.call(s)):t.push(s)}return t};Xe.wrap=function(e){return function(){return e(Xe(arguments))}};var lt=Ne.exports,de=Ie,he=lt,Ye=Object.hasOwnProperty,We=Object.create(null);for(var Se in de)Ye.call(de,Se)&&(We[de[Se]]=Se);var N=ze.exports={to:{},get:{}};N.get=function(e){var n=e.substring(0,3).toLowerCase(),t,o;switch(n){case"hsl":t=N.get.hsl(e),o="hsl";break;case"hwb":t=N.get.hwb(e),o="hwb";break;default:t=N.get.rgb(e),o="rgb";break}return t?{model:o,value:t}:null},N.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+)$/,a=[0,0,0,1],i,u,f;if(i=e.match(t)){for(f=i[2],i=i[1],u=0;u<3;u++){var h=u*2;a[u]=parseInt(i.slice(h,h+2),16)}f&&(a[3]=parseInt(f,16)/255)}else if(i=e.match(n)){for(i=i[1],f=i[3],u=0;u<3;u++)a[u]=parseInt(i[u]+i[u],16);f&&(a[3]=parseInt(f+f,16)/255)}else if(i=e.match(o)){for(u=0;u<3;u++)a[u]=parseInt(i[u+1],0);i[4]&&(i[5]?a[3]=parseFloat(i[4])*.01:a[3]=parseFloat(i[4]))}else if(i=e.match(r)){for(u=0;u<3;u++)a[u]=Math.round(parseFloat(i[u+1])*2.55);i[4]&&(i[5]?a[3]=parseFloat(i[4])*.01:a[3]=parseFloat(i[4]))}else return(i=e.match(s))?i[1]==="transparent"?[0,0,0,0]:Ye.call(de,i[1])?(a=de[i[1]],a[3]=1,a):null:null;for(u=0;u<3;u++)a[u]=Z(a[u],0,255);return a[3]=Z(a[3],0,1),a},N.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=Z(parseFloat(t[2]),0,100),a=Z(parseFloat(t[3]),0,100),i=Z(isNaN(o)?1:o,0,1);return[r,s,a,i]}return null},N.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=Z(parseFloat(t[2]),0,100),a=Z(parseFloat(t[3]),0,100),i=Z(isNaN(o)?1:o,0,1);return[r,s,a,i]}return null},N.to.hex=function(){var e=he(arguments);return"#"+be(e[0])+be(e[1])+be(e[2])+(e[3]<1?be(Math.round(e[3]*255)):"")},N.to.rgb=function(){var e=he(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]+")"},N.to.rgb.percent=function(){var e=he(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]+")"},N.to.hsl=function(){var e=he(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},N.to.hwb=function(){var e=he(arguments),n="";return e.length>=4&&e[3]!==1&&(n=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+n+")"},N.to.keyword=function(e){return We[e.slice(0,3)]};function Z(e,n,t){return Math.min(Math.max(n,e),t)}function be(e){var n=Math.round(e).toString(16).toUpperCase();return n.length<2?"0"+n:n}var ct=ze.exports;const fe=Ie,Ue={};for(const e of Object.keys(fe))Ue[fe[e]]=e;const g={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 je=g;for(const e of Object.keys(g)){if(!("channels"in g[e]))throw new Error("missing channels property: "+e);if(!("labels"in g[e]))throw new Error("missing channel labels property: "+e);if(g[e].labels.length!==g[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:n,labels:t}=g[e];delete g[e].channels,delete g[e].labels,Object.defineProperty(g[e],"channels",{value:n}),Object.defineProperty(g[e],"labels",{value:t})}g.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),a=s-r;let i,u;s===r?i=0:n===s?i=(t-o)/a:t===s?i=2+(o-n)/a:o===s&&(i=4+(n-t)/a),i=Math.min(i*60,360),i<0&&(i+=360);const f=(r+s)/2;return s===r?u=0:f<=.5?u=a/(s+r):u=a/(2-s-r),[i,u*100,f*100]},g.rgb.hsv=function(e){let n,t,o,r,s;const a=e[0]/255,i=e[1]/255,u=e[2]/255,f=Math.max(a,i,u),h=f-Math.min(a,i,u),d=function(c){return(f-c)/6/h+1/2};return h===0?(r=0,s=0):(s=h/f,n=d(a),t=d(i),o=d(u),a===f?r=o-t:i===f?r=1/3+n-o:u===f&&(r=2/3+t-n),r<0?r+=1:r>1&&(r-=1)),[r*360,s*100,f*100]},g.rgb.hwb=function(e){const n=e[0],t=e[1];let o=e[2];const r=g.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]},g.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,a=(1-t-r)/(1-r)||0,i=(1-o-r)/(1-r)||0;return[s*100,a*100,i*100,r*100]};function ut(e,n){return(e[0]-n[0])**2+(e[1]-n[1])**2+(e[2]-n[2])**2}g.rgb.keyword=function(e){const n=Ue[e];if(n)return n;let t=1/0,o;for(const r of Object.keys(fe)){const s=fe[r],a=ut(e,s);a<t&&(t=a,o=r)}return o},g.keyword.rgb=function(e){return fe[e]},g.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,a=n*.0193+t*.1192+o*.9505;return[r*100,s*100,a*100]},g.rgb.lab=function(e){const n=g.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,a=500*(t-o),i=200*(o-r);return[s,a,i]},g.hsl.rgb=function(e){const n=e[0]/360,t=e[1]/100,o=e[2]/100;let r,s,a;if(t===0)return a=o*255,[a,a,a];o<.5?r=o*(1+t):r=o+t-o*t;const i=2*o-r,u=[0,0,0];for(let f=0;f<3;f++)s=n+1/3*-(f-1),s<0&&s++,s>1&&s--,6*s<1?a=i+(r-i)*6*s:2*s<1?a=r:3*s<2?a=i+(r-i)*(2/3-s)*6:a=i,u[f]=a*255;return u},g.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 a=(o+t)/2,i=o===0?2*r/(s+r):2*t/(o+t);return[n,i*100,a*100]},g.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),a=255*o*(1-t),i=255*o*(1-t*s),u=255*o*(1-t*(1-s));switch(o*=255,r){case 0:return[o,u,a];case 1:return[i,o,a];case 2:return[a,o,u];case 3:return[a,i,o];case 4:return[u,a,o];case 5:return[o,a,i]}},g.hsv.hsl=function(e){const n=e[0],t=e[1]/100,o=e[2]/100,r=Math.max(o,.01);let s,a;a=(2-t)*o;const i=(2-t)*r;return s=t*r,s/=i<=1?i:2-i,s=s||0,a/=2,[n,s*100,a*100]},g.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 a=Math.floor(6*n),i=1-o;s=6*n-a,a&1&&(s=1-s);const u=t+s*(i-t);let f,h,d;switch(a){default:case 6:case 0:f=i,h=u,d=t;break;case 1:f=u,h=i,d=t;break;case 2:f=t,h=i,d=u;break;case 3:f=t,h=u,d=i;break;case 4:f=u,h=t,d=i;break;case 5:f=i,h=t,d=u;break}return[f*255,h*255,d*255]},g.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),a=1-Math.min(1,t*(1-r)+r),i=1-Math.min(1,o*(1-r)+r);return[s*255,a*255,i*255]},g.xyz.rgb=function(e){const n=e[0]/100,t=e[1]/100,o=e[2]/100;let r,s,a;return r=n*3.2406+t*-1.5372+o*-.4986,s=n*-.9689+t*1.8758+o*.0415,a=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,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,r=Math.min(Math.max(0,r),1),s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),[r*255,s*255,a*255]},g.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),a=200*(t-o);return[r,s,a]},g.lab.xyz=function(e){const n=e[0],t=e[1],o=e[2];let r,s,a;s=(n+16)/116,r=t/500+s,a=s-o/200;const i=s**3,u=r**3,f=a**3;return s=i>.008856?i:(s-16/116)/7.787,r=u>.008856?u:(r-16/116)/7.787,a=f>.008856?f:(a-16/116)/7.787,r*=95.047,s*=100,a*=108.883,[r,s,a]},g.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 a=Math.sqrt(t*t+o*o);return[n,a,r]},g.lch.lab=function(e){const n=e[0],t=e[1],r=e[2]/360*2*Math.PI,s=t*Math.cos(r),a=t*Math.sin(r);return[n,s,a]},g.rgb.ansi16=function(e,n=null){const[t,o,r]=e;let s=n===null?g.rgb.hsv(e)[2]:n;if(s=Math.round(s/50),s===0)return 30;let a=30+(Math.round(r/255)<<2|Math.round(o/255)<<1|Math.round(t/255));return s===2&&(a+=60),a},g.hsv.ansi16=function(e){return g.rgb.ansi16(g.hsv.rgb(e),e[2])},g.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)},g.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]},g.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]},g.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},g.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,a=o&255;return[r,s,a]},g.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),a=r-s;let i,u;return a<1?i=s/(1-a):i=0,a<=0?u=0:r===n?u=(t-o)/a%6:r===t?u=2+(o-n)/a:u=4+(n-t)/a,u/=6,u%=1,[u*360,a*100,i*100]},g.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]},g.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]},g.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,a=s%1,i=1-a;let u=0;switch(Math.floor(s)){case 0:r[0]=1,r[1]=a,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]=a;break;case 3:r[0]=0,r[1]=i,r[2]=1;break;case 4:r[0]=a,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]},g.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]},g.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]},g.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]},g.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]},g.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},g.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},g.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},g.gray.hsl=function(e){return[0,0,e[0]]},g.gray.hsv=g.gray.hsl,g.gray.hwb=function(e){return[0,100,e[0]]},g.gray.cmyk=function(e){return[0,0,0,e[0]]},g.gray.lab=function(e){return[e[0],0,0]},g.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},g.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const ye=je;function dt(){const e={},n=Object.keys(ye);for(let t=n.length,o=0;o<t;o++)e[n[o]]={distance:-1,parent:null};return e}function ht(e){const n=dt(),t=[e];for(n[e].distance=0;t.length;){const o=t.pop(),r=Object.keys(ye[o]);for(let s=r.length,a=0;a<s;a++){const i=r[a],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 mt(e,n){const t=[n[e].parent,e];let o=ye[n[e].parent][e],r=n[e].parent;for(;n[r].parent;)t.unshift(n[r].parent),o=ft(ye[n[r].parent][r],o),r=n[r].parent;return o.conversion=t,o}var pt=function(e){const n=ht(e),t={},o=Object.keys(n);for(let r=o.length,s=0;s<r;s++){const a=o[s];n[a].parent!==null&&(t[a]=mt(a,n))}return t};const Fe=je,gt=pt,oe={},vt=Object.keys(Fe);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 yt(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,a=0;a<s;a++)r[a]=Math.round(r[a]);return r};return"conversion"in e&&(n.conversion=e.conversion),n}vt.forEach(e=>{oe[e]={},Object.defineProperty(oe[e],"channels",{value:Fe[e].channels}),Object.defineProperty(oe[e],"labels",{value:Fe[e].labels});const n=gt(e);Object.keys(n).forEach(o=>{const r=n[o];oe[e][o]=yt(r),oe[e][o].raw=bt(r)})});var xt=oe;const re=ct,X=xt,qe=["keyword","gray","hex"],_e={};for(const e of Object.keys(X))_e[[...X[e].labels].sort().join("")]=e;const xe={};function O(e,n){if(!(this instanceof O))return new O(e,n);if(n&&n in qe&&(n=null),n&&!(n in X))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 O)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){const r=re.get(e);if(r===null)throw new Error("Unable to parse color from string: "+e);this.model=r.model,o=X[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=X[this.model].channels;const r=Array.prototype.slice.call(e,0,o);this.color=De(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:a}=X[this.model],i=[];for(t=0;t<a.length;t++)i.push(e[a[t]]);this.color=De(i)}if(xe[this.model])for(o=X[this.model].channels,t=0;t<o;t++){const r=xe[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)}O.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let n=this.model in re.to?this:this.rgb();n=n.round(typeof e=="number"?e:1);const t=n.valpha===1?n.color:[...n.color,this.valpha];return re.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 re.to.rgb.percent(t)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:n}=X[this.model],{labels:t}=X[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 O([...this.color.map(Ct(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new O([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:D("rgb",0,T(255)),green:D("rgb",1,T(255)),blue:D("rgb",2,T(255)),hue:D(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:D("hsl",1,T(100)),lightness:D("hsl",2,T(100)),saturationv:D("hsv",1,T(100)),value:D("hsv",2,T(100)),chroma:D("hcg",1,T(100)),gray:D("hcg",2,T(100)),white:D("hwb",1,T(100)),wblack:D("hwb",2,T(100)),cyan:D("cmyk",0,T(100)),magenta:D("cmyk",1,T(100)),yellow:D("cmyk",2,T(100)),black:D("cmyk",3,T(100)),x:D("xyz",0,T(95.047)),y:D("xyz",1,T(100)),z:D("xyz",2,T(108.833)),l:D("lab",0,T(100)),a:D("lab",1),b:D("lab",2),keyword(e){return e!==void 0?new O(e):X[this.model].keyword(this.color)},hex(e){return e!==void 0?new O(e):re.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new O(e);const n=this.rgb().round().color;let t=Math.round(this.valpha*255).toString(16).toUpperCase();return t.length===1&&(t="0"+t),re.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 O.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,a=t.alpha()-o.alpha(),i=((s*a===-1?s:(s+a)/(1+s*a))+1)/2,u=1-i;return O.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(X)){if(qe.includes(e))continue;const{channels:n}=X[e];O.prototype[e]=function(...t){return this.model===e?new O(this):t.length>0?new O(t,e):new O([...kt(X[this.model][e].raw(this.color)),this.valpha],e)},O[e]=function(...t){let o=t[0];return typeof o=="number"&&(o=De(t,n)),new O(o,e)}}function wt(e,n){return Number(e.toFixed(n))}function Ct(e){return function(n){return wt(n,e)}}function D(e,n,t){e=Array.isArray(e)?e:[e];for(const o of e)(xe[o]||(xe[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 T(e){return function(n){return Math.max(0,Math.min(e,n))}}function kt(e){return Array.isArray(e)?e:[e]}function De(e,n){for(let t=0;t<n;t++)typeof e[t]!="number"&&(e[t]=0);return e}var Mt=O;const W=ot(Mt);function Ge(e){return W(e)}function Ke(e){return e.hex()}function Et(e){const{h:n,s:t,v:o}=e.hsv().object();return{color:W.hsv(n,t,100),value:o}}function St(e,n){const{h:t,s:o}=e.hsv().object();return W.hsv(t,o,n)}function Je(e,n){const t=St(e,n);return Ke(t)}function Ft(){const e=l.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 m=d.createLinearGradient(0,t,0,0);m.addColorStop(0,"rgb(255 255 255 / 100%)"),m.addColorStop(1,"rgb(255 255 255 / 0%)"),d.fillStyle=m,d.fillRect(0,0,n,t)}function r(h){const d=Ge(h);return s(d)}function s(h){const{r:d,g:c,b:m}=h.rgb().object(),v=[{type:"r",value:d},{type:"g",value:c},{type:"b",value:m}];v.sort((k,L)=>L.value-k.value);const p=v[0],y=v[1],x=p.type+y.type;let C=0,b=v[2].value;return x==="rg"||x==="gr"?(C=255,y.type==="r"?C+=255-a(b,y.value):C-=255-a(b,y.value)):x==="gb"||x==="bg"?(C=255*3,y.type==="g"?C+=255-a(b,y.value):C-=255-a(b,y.value)):(x==="rb"||x==="br")&&(C=255*5,y.type==="b"?C+=255-a(b,y.value):C-=255-a(b,y.value)),{x:C,y:b}}function a(h,d){return h===255?255:(255*d-255*h)/(255-h)}function i(h,d,c,m){if(!e.value)return W();const v=n/c,p=t/m;return h=Math.min(h*v,n-1),d=Math.min(d*p,t-1),u(h,d)}function u(h,d){let c=0,m=0,v=0;const p=255,y=f(h,0,p)||f(h,p*5,p*6),x=f(h,p,p*3),C=f(h,p*3,p*5);y?c=255:h<=p*2?c=Math.max(2*p-h,0):h>=p*4&&(c=Math.max(h-p*4,0)),x?m=255:h<p?m=Math.max(h,0):m=Math.max(p*4-h,0),C?v=255:h<p*3?v=Math.max(h-p*2,0):v=Math.max(p*6-h,0);const b=p-c,k=p-m,L=p-v,$=d/p;return c+=b*$,m+=k*$,v+=L*$,W.rgb(c,m,v)}function f(h,d,c){return h>=d&&h<=c}return l.onMounted(()=>{o()}),{canvasWidth:n,canvasHeight:t,colorAreaCanvas:e,drawColorArea:o,getCoordinateByColor:s,getCoordinateByHex:r,getColorByCoordinate:i}}function _t(e,n=200){let t=null;return function(...o){const r=this;t||(t=window.setTimeout(()=>{e.apply(r,o),t=null},n))}}class Dt{constructor(){U(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)}}const me=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent);function Tt(){const e=l.ref(),n=l.reactive({x:0,y:0});function t(d){if(d.touches.length===0)return;d.preventDefault();const{clientX:c,clientY:m}=d.touches[0];i({x:c,y:m}),document.body.addEventListener("touchmove",o),document.body.addEventListener("touchend",r)}function o(d){if(d.touches.length>1)return;const{clientX:c,clientY:m}=d.touches[0];i({x:c,y:m})}function r(){document.body.removeEventListener("touchmove",o),document.body.removeEventListener("touchend",r)}function s(d){document.body.addEventListener("mousemove",a),document.body.addEventListener("mouseup",f),i({x:d.clientX,y:d.clientY})}function a(d){i({x:d.clientX,y:d.clientY})}const i=_t(u,20);function u(d){var L;const{x:c,y:m}=d,v=(L=e.value)==null?void 0:L.getBoundingClientRect();if(!v)return;const{left:p,top:y,width:x,height:C}=v;let b=0,k=0;c<=p?b=0:c>=p+x?b=x:b=c-p,m<=y?k=0:m>=y+C?k=C:k=m-y,n.x=Math.round(b),n.y=Math.round(k)}function f(){document.body.removeEventListener("mousemove",a),document.body.removeEventListener("mouseup",f)}function h(d,c,m,v){var k;const p=(k=e.value)==null?void 0:k.getBoundingClientRect();if(!p)return;const{width:y,height:x}=p,C=y/m,b=x/v;n.x=d*C,n.y=c*b}return l.onMounted(()=>{var d,c;me?(d=e.value)==null||d.addEventListener("touchstart",t):(c=e.value)==null||c.addEventListener("mousedown",s)}),l.onBeforeUnmount(()=>{var d,c;me?((d=e.value)==null||d.removeEventListener("touchstart",t),document.body.removeEventListener("touchmove",o),document.body.removeEventListener("touchend",r)):((c=e.value)==null||c.removeEventListener("mousedown",s),document.body.removeEventListener("mousemove",a),document.body.removeEventListener("mouseup",f))}),{colorAreaRef:e,circlePickerCoordinate:n,setCirclePickerCoordinate:h}}const Lt={class:"color-form"},At={class:"hex-color mb-12"},Vt={class:"form-group mb-12"},Ot={class:"form-group mb-12"},Te="#ffffff",Pt=l.defineComponent({__name:"ColorForm",props:{modelValue:{}},emits:["change"],setup(e,{emit:n}){const t=e,o=n,r=l.ref(W(t.modelValue||Te).hex()),s=l.reactive(W(r.value||Te).rgb().object()),a=l.reactive(W(r.value||Te).hsv().object());function i(d){return`#${d.replace(/[^0-9A-F]/gi,"").slice(0,6).toUpperCase()}`}l.watch(()=>t.modelValue,d=>{const c=W(d);r.value=c.hex();const{r:m,g:v,b:p}=c.rgb().object(),{h:y,s:x,v:C}=c.hsv().object();Object.assign(s,{r:m,g:v,b:p}),Object.assign(a,{h:y,s:x,v:C})});function u(){(r.value||"").replace(/[^0-9A-F]/gi,"").length===6?o("change",r.value):r.value=t.modelValue}function f(){const{r:d,g:c,b:m}=s;o("change",W.rgb(d,c,m).hex().toString())}function h(){const{h:d,s:c,v:m}=a;o("change",W.hsv(d,c,m).hex().toString())}return(d,c)=>{const m=l.resolveComponent("el-input"),v=l.resolveComponent("el-input-number");return l.openBlock(),l.createElementBlock("div",Lt,[l.createElementVNode("div",At,[l.createVNode(m,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=p=>r.value=p),formatter:i,onChange:u},null,8,["modelValue"])]),l.createElementVNode("div",Vt,[c[7]||(c[7]=l.createElementVNode("div",{class:"label"},"RGB",-1)),l.createVNode(v,{modelValue:s.r,"onUpdate:modelValue":c[1]||(c[1]=p=>s.r=p),onChange:f,"step-strictly":"",min:0,max:255,step:1,controls:!1},null,8,["modelValue"]),l.createVNode(v,{modelValue:s.g,"onUpdate:modelValue":c[2]||(c[2]=p=>s.g=p),onChange:f,"step-strictly":"",min:0,max:255,step:1,controls:!1},null,8,["modelValue"]),l.createVNode(v,{modelValue:s.b,"onUpdate:modelValue":c[3]||(c[3]=p=>s.b=p),onChange:f,"step-strictly":"",min:0,max:255,step:1,controls:!1},null,8,["modelValue"])]),l.createElementVNode("div",Ot,[c[8]||(c[8]=l.createElementVNode("div",{class:"label"},"HSV",-1)),l.createVNode(v,{modelValue:a.h,"onUpdate:modelValue":c[4]||(c[4]=p=>a.h=p),onChange:h,min:0,max:360,"step-strictly":"",step:1,controls:!1},null,8,["modelValue"]),l.createVNode(v,{modelValue:a.s,"onUpdate:modelValue":c[5]||(c[5]=p=>a.s=p),onChange:h,min:0,max:100,"step-strictly":"",step:1,controls:!1},null,8,["modelValue"]),l.createVNode(v,{modelValue:a.v,"onUpdate:modelValue":c[6]||(c[6]=p=>a.v=p),onChange:h,"step-strictly":"",min:0,max:100,controls:!1},null,8,["modelValue"])])])}}}),se=(e,n)=>{const t=e.__vccOpts||e;for(const[o,r]of n)t[o]=r;return t},Rt=se(Pt,[["__scopeId","data-v-30715da5"]]),Ht={class:"preset-colors"},Bt={class:"preset-colors_title"},$t={class:"preset-color_list"},zt=["onClick"],It=se(l.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=l.computed(()=>o.presetColors?o.presetColors:t),s=n;function a(i){s("change",i)}return(i,u)=>(l.openBlock(),l.createElementBlock("div",Ht,[l.createElementVNode("div",Bt,l.toDisplayString(o.title||"系统预设色彩"),1),l.createElementVNode("div",$t,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,f=>(l.openBlock(),l.createElementBlock("div",{class:"preset-color_list-item",onClick:h=>a(f),key:f,style:l.normalizeStyle({backgroundColor:f})},null,12,zt))),128))])]))}}),[["__scopeId","data-v-bf94ca7c"]]),Nt={class:"color-picker"},Xt={class:"title"},Yt={class:"color-area__wrapper"},Wt={class:"slider-color"},Le="#ffffff",Ut=K(se(l.defineComponent({name:"HvColorPicker",__name:"ColorPicker",props:l.mergeModels({title:{},presetTitle:{},presetColors:{}},{modelValue:{type:String,default:Le},modelModifiers:{}}),emits:l.mergeModels(["update:model-value"],["update:modelValue"]),setup(e,{emit:n}){const t=e,o=n,{colorAreaCanvas:r,getColorByCoordinate:s,getCoordinateByColor:a,canvasWidth:i,canvasHeight:u}=Ft(),{colorAreaRef:f,circlePickerCoordinate:h,setCirclePickerCoordinate:d}=Tt(),c=l.useModel(e,"modelValue"),m=l.ref(W(Le)),v=l.ref(100),p=l.computed(()=>m.value?Je(m.value,v.value):Le);l.watch(c,b=>{Je(m.value,v.value)!==b&&C(b)}),l.watch(()=>h,b=>{var $;const k=($=f.value)==null?void 0:$.getBoundingClientRect();if(!k)return;const L=s(b.x,b.y,k.width,k.height);m.value=L},{deep:!0});const y=l.computed(()=>c.value?{top:h.y+"px",left:h.x+"px",backgroundColor:m.value.hex()}:{top:"100%",left:"0",backgroundColor:"#ffffff"}),x=l.computed(()=>{const b=Ke(m.value);return{"--el-slider-runway-bg-color":`linear-gradient(to right, #000000, ${b})`,"--el-slider-main-bg-color":b}});l.watch(()=>p.value,(b,k)=>{if(b!==k){o("update:model-value",b);return}});function C(b){const k=Ge(b),{color:L,value:$}=Et(k);m.value=L,v.value=$;const J=a(L);d(J.x,J.y,i,u)}return l.onMounted(()=>{C(c.value)}),(b,k)=>{const L=l.resolveComponent("ElSlider");return l.openBlock(),l.createElementBlock("div",Nt,[l.createElementVNode("div",Xt,l.toDisplayString(t.title||"颜色编辑器"),1),l.createElementVNode("div",Yt,[l.createElementVNode("div",{class:"color-area",ref_key:"colorAreaRef",ref:f},[l.createElementVNode("canvas",{ref_key:"colorAreaCanvas",ref:r},null,512),l.createElementVNode("div",{class:"cur-color-circle",style:l.normalizeStyle(y.value)},null,4)],512)]),l.createElementVNode("div",Wt,[l.createVNode(L,{modelValue:v.value,"onUpdate:modelValue":k[0]||(k[0]=$=>v.value=$),min:0,max:100,"show-tooltip":!1,style:l.normalizeStyle(x.value)},null,8,["modelValue","style"]),l.createElementVNode("div",{class:"origin-color",style:l.normalizeStyle({backgroundColor:p.value})},null,4)]),l.createVNode(Rt,{"model-value":c.value,onChange:C},null,8,["model-value"]),l.createVNode(It,{onChange:C,title:t.presetTitle,presetColors:t.presetColors},null,8,["title","presetColors"])])}}}),[["__scopeId","data-v-e1675222"]]));class jt extends Dt{constructor(){super();U(this,"isDragStart",!1);U(this,"dragType");U(this,"dragData");U(this,"isSendFirstMovePos",!1);U(this,"touchStartPressTime",300);U(this,"touchStartTime",0);U(this,"touchStartPosition",{x:0,y:0});U(this,"lastMovePoint",{x:0,y:0});U(this,"emitTouchStartTimer");U(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,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:a}=this.touchStartPosition;Date.now()-this.touchStartTime<this.touchStartPressTime&&(Math.abs(s-o)>30||Math.abs(a-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:a}=this.touchStartPosition;Date.now()-this.touchStartTime<this.touchStartPressTime&&(Math.abs(s-o)>30||Math.abs(a-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),a=this.onMouseMove.bind(this),i=this.onMouseUp.bind(this);me?(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",a),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",a),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 ee=new jt,qt=se(l.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=l.ref(),r=l.ref(!1),s=l.reactive({x:0,y:0}),a=l.ref(!1),i=l.reactive({x:0,y:0}),u=l.computed(()=>Array.isArray(t.immediate)?t.immediate:t.immediate?[t.immediate]:[]),f=l.computed(()=>({transform:`translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`}));ee.on("down",c=>{const{x:m,y:v}=c,p=document.elementFromPoint(m,v);if(!t.disabled&&o.value&&o.value.contains(p)){if(u.value.includes(n.ALL)){h(c);return}r.value=!0,s.x=m,s.y=v}}),ee.on("first-move",(c,m)=>{const{x:v,y:p}=c,y=u.value.filter(x=>x!==n.ALL);if(r.value&&!t.disabled&&y.length){const x=v-s.x,C=Math.abs(x),b=p-s.y,k=Math.abs(b),L=Math.max(C,k),$=C===L,J=k===L;let ne=!1;if($&&(ne=y.includes(n.LEFT)&&x<0||y.includes(n.RIGHT)&&x>0),J&&!ne&&(ne=y.includes(n.TOP)&&b<0||y.includes(n.BOTTOM)&&b>0),ne){m.preventDefault(),m.stopPropagation(),h(s),d(c);return}}}),ee.on("start",c=>{const{x:m,y:v}=c,p=document.elementFromPoint(m,v);!t.disabled&&o.value&&o.value.contains(p)&&h(c)}),ee.on("move",c=>{const{point:m}=c;a.value&&d(m)}),ee.on("end",()=>{r.value=!1,a.value=!1,Object.assign(s,{x:0,y:0}),Object.assign(i,{x:0,y:0})});function h(c){a.value=!0,i.x=c.x,i.y=c.y,ee.updateDargInfo(t.type,t.data)}function d(c){i.x=c.x,i.y=c.y}return(c,m)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"dragItemRef",ref:o,class:l.normalizeClass(["draggable-area",c.disabled?"disabled":""])},[l.renderSlot(c.$slots,"default",{},void 0,!0),a.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"draggable-clone-item",style:l.normalizeStyle(f.value)},[l.renderSlot(c.$slots,"drag-item",{},()=>[l.renderSlot(c.$slots,"default",{},void 0,!0)],!0)],4)):l.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-8361cd1f"]]),Gt=se(l.defineComponent({name:"HvDroppable",__name:"Droppable",props:{acceptDragType:{}},emits:["enter","move","drop","leave"],setup(e,{emit:n}){const t=n,o=e,r=l.ref(),s=l.ref(!1),a=l.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:f,y:h}=u,{x:d,y:c,width:m,height:v}=r.value.getBoundingClientRect(),p=f-d,y=h-c;return{isInArea:p>=0&&p<=m&&y>=0&&y<=v,position:{x:p,y}}}return ee.on("move",u=>{const{type:f,data:h,point:d}=u;if(r.value&&a.value.includes(f)){const{isInArea:c,position:m}=i(d);c?s.value?t("move",f,m,h):(s.value=!0,t("enter",f,m,h)):s.value&&(s.value=!1,t("leave",f,h))}}),ee.on("end",({type:u,point:f,data:h})=>{if(r.value&&a.value.includes(u)&&s.value){const{position:d}=i(f);t("drop",u,d,h)}}),(u,f)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"dropAreaRef",ref:r,class:"droppable-area"},[l.renderSlot(u.$slots,"default",{},void 0,!0)],512))}}),[["__scopeId","data-v-a40b9a59"]]),Kt=K(qt),Jt=K(Gt);function Qt(e,n,t){const o=l.computed(()=>l.isRef(t)?l.toValue(t):t),r=l.computed(()=>o.value.containerRealSize),s=l.computed(()=>{const w=typeof o.value.keepRatio=="boolean"?{enable:o.value.keepRatio,scaleCase:"min"}:o.value.keepRatio;return Object.assign({scaleCase:"min",enable:!1},w||{})}),a=l.computed(()=>{const w=Object.assign({inContainer:!0,minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0},o.value.limit||{});return w.minWidth>w.maxWidth&&(w.maxWidth=w.minWidth),w.minHeight>w.maxHeight&&(w.maxHeight=w.minHeight),w}),i=l.computed(()=>o.value.disabled||!1),u=l.computed(()=>l.isRef(e)?l.toValue(e):e),f=l.computed(()=>o.value.container),h=l.computed(()=>l.isRef(n)?l.toValue(n):n);let d={x:0,y:0},c={x:0,y:0},m={x:0,y:0};const v={width:0,height:0},p={elX:0,elY:0,elWidth:0,elHeight:0},y={leftSide:!1,rightSide:!1,topSide:!1,bottomSide:!1,center:!1};let x=!1,C=!1,b=1,k=1;l.watch(()=>u.value&&f.value&&h.value,w=>{w?tn():Pe()});function L(w){if(i.value||(d=w,m=w,!f.value||!u.value))return;const{x:A,y:V,width:z,height:I}=f.value.getBoundingClientRect();if(Object.assign(v,{width:z,height:I}),r.value){const{width:G,height:Ce}=r.value;b=G/z,k=Ce/I}else b=1,k=1;const{x:S,y:F,width:P,height:R}=u.value.getBoundingClientRect(),{x:M,y:E}=w;Object.assign(p,{elX:S-A,elY:F-V,elWidth:P,elHeight:R});const we=document.elementFromPoint(M,E);if(!we)return;const te=(we.dataset.scaleSide||"").split(",").filter(G=>!!G);if(!te.length)return;let pe=te.includes("left"),ge=te.includes("top"),j=te.includes("right"),q=te.includes("bottom");const Q=te.includes("center");x=!0,s.value.enable&&!Q&&(M-S<=P/2&&E-F<=R/2&&(pe=!0,ge=!0),M-S>P/2&&E-F<=R/2&&(j=!0,ge=!0),M-S<=P/2&&E-F>R/2&&(pe=!0,q=!0),M-S>P/2&&E-F>R/2&&(j=!0,q=!0)),Object.assign(y,{leftSide:pe,rightSide:j,topSide:ge,bottomSide:q,center:Q})}function $(w){if(i.value||x!==!0){x=!1;return}C=!0,c=m,m=w;const A=w.x-d.x,V=w.y-d.y;let z=0,I=0,S=0,F=0;const{elX:P,elY:R,elWidth:M,elHeight:E}=p,{minWidth:we,minHeight:te,maxWidth:pe,maxHeight:ge}=a.value,j=we/b,q=te/k,Q=pe/b,G=ge/k;if(y.center){const ke=v.width,Me=v.height;if(a.value.inContainer){const Re=P+A<0?-P:P+M+A>ke?ke-M-P:A,He=R+V<0?-R:R+E+V>Me?Me-E-R:V;z=Re,I=He}else z=A,I=V}else{const{leftSide:ke,rightSide:Me,topSide:Re,bottomSide:He}=y;if(ke){let _=a.value.inContainer&&P+A<0?-P:A;M-_<j&&(_=M-j),M-_>Q&&(_=M-Q),z=_,S=-_}if(Me){const _=v.width;let H=a.value.inContainer&&P+M+A>_?_-M-P:A;M+H<j&&(H=j-M),M+H>Q&&(H=Q-M),S=H}if(Re){let _=a.value.inContainer&&R+V<0?-R:V;E-_<q&&(_=E-q),E-_>G&&(_=E-G),I=_,F=-_}if(He){const _=v.height;let H=a.value.inContainer&&R+E+V>_?_-E-R:V;E+H<q&&(H=q-E),E+H>G&&(H=G-E),F=H}if(s.value.enable){const _=S/M,H=F/E;if(_<H&&s.value.scaleCase==="min"||_>H&&s.value.scaleCase==="max"){if(F=_*E,E+F<q){const Y=S;F=q-E,S=F/E*M,z=z*(S/Y)}if(E+F>G){const Y=S;F=G-E,S=F/E*M,z=z*(S/Y)}y.topSide&&(I=-F)}else if(H<_&&s.value.scaleCase==="min"||H>_&&s.value.scaleCase==="max"){if(S=H*M,M+S<j){const Y=F;S=j-M,F=S/M*E,I=I*(F/Y)}if(M+S>Q){const Y=F;S=Q-M,F=S/M*E,I=I*(F/Y)}y.leftSide&&(z=-S)}const ie=P+z,le=R+I,Be=M+S,$e=E+F;if(a.value.inContainer&&(ie<0||le<0||ie+Be>v.width||le+$e>v.height)){let Y=ie<0?0:ie,ve=le<0?0:le,ce=ie+Be>v.width?v.width-Y:ie+Be-Y,ue=le+$e>v.height?v.height-ve:le+$e-ve;const nn=Y+ce,on=ve+ue,nt=ce/ue,Ee=M/E;nt<Ee?ue=ce/Ee:nt>Ee&&(ce=ue*Ee);const{topSide:rn,leftSide:sn}=y;sn&&(Y=nn-ce),rn&&(ve=on-ue),z=Y-P,I=ve-R,S=ce-M,F=ue-E}}}const Ce=P+z,Ze=R+I,et=M+S,tt=E+F;o.value.onChange&&o.value.onChange({type:y.center?"move":"scale",deltaX:m.x-c.x,deltaY:m.y-c.y,elX:Ce,elY:Ze,elWidth:et,elHeight:tt,realX:Ce*b,realY:Ze*k,realWidth:et*b,realHeight:tt*k})}function J(){if(c={x:0,y:0},m={x:0,y:0},i.value||x!==!0||!C){x=!1,C=!1;return}x=!1,C=!1,o.value.onFinish&&o.value.onFinish()}function ne(w){if(w.preventDefault(),w.touches.length>1)return;const{clientX:A,clientY:V}=w.touches[0];L({x:A,y:V}),document.body.addEventListener("touchcancel",ae,{capture:!0}),document.body.addEventListener("touchmove",Ae,{capture:!0}),document.body.addEventListener("touchend",ae,{capture:!0})}function Ae(w){if(i.value||x!==!0){x=!1;return}if(w.preventDefault(),w.stopPropagation(),w.touches.length>1){J();return}const{clientX:A,clientY:V}=w.touches[0];A===d.x&&V===d.y||$({x:A,y:V})}function ae(){if(document.body.removeEventListener("touchmove",Ae),document.body.removeEventListener("touchend",ae),document.body.removeEventListener("touchcancel",ae),i.value||x!==!0){x=!1,C=!1;return}J()}function Qe(w){if(w.preventDefault(),!(w.buttons&1))return;const{clientX:A,clientY:V}=w;L({x:A,y:V}),document.body.addEventListener("mousemove",Ve,{capture:!0}),document.body.addEventListener("mouseup",Oe,{capture:!0})}function Ve(w){if(i.value||x!==!0){x=!1;return}if(w.preventDefault(),!(w.buttons&1)){J();return}const{clientX:A,clientY:V}=w;$({x:A,y:V})}function Oe(){if(document.body.removeEventListener("mousemove",Ve),document.body.removeEventListener("mouseup",Oe),i.value||x!==!0){x=!1;return}J()}function tn(){Pe(),me?h.value.addEventListener("touchstart",ne,{capture:!0}):h.value.addEventListener("mousedown",Qe)}function Pe(){me?(h.value.removeEventListener("touchstart",ne),document.body.removeEventListener("touchmove",Ae),document.body.removeEventListener("touchend",ae),document.body.removeEventListener("touchcancel",ae)):(h.value.removeEventListener("mousedown",Qe),document.body.removeEventListener("mousemove",Ve),document.body.removeEventListener("mouseup",Oe))}l.onBeforeUnmount(()=>{x=!1,Pe()})}const Zt={class:"zoom-mark-box"},en=K(se(l.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=l.ref(),s=l.ref();function a(f){t("change",f)}function i(){t("finish")}const u=l.computed(()=>({container:o.container,containerRealSize:o.containerRealSize,keepRatio:o.keepRatio,limit:o.limit,disabled:o.disabled,onChange:a,onFinish:i}));return Qt(r,s,u),(f,h)=>(l.openBlock(),l.createElementBlock("div",{class:"drag-and-scale-box",ref_key:"targetRef",ref:r},[l.renderSlot(f.$slots,"default",{},void 0,!0),l.createElementVNode("div",Zt,[l.createElementVNode("div",{class:l.normalizeClass(["zoom-operate-box",o.disabled?"disabled":""]),ref_key:"operateRef",ref:s},h[0]||(h[0]=[l.createStaticVNode('<div class="top-box block" data-v-91217104><div class="left-box" data-scale-side="left,top" data-v-91217104></div><div class="center-box" data-scale-side="top" data-v-91217104></div><div class="right-box" data-scale-side="right,top" data-v-91217104></div></div><div class="middle-box block" data-v-91217104><div class="left-box" data-scale-side="left" data-v-91217104></div><div class="center-box" data-scale-side="center" data-v-91217104></div><div class="right-box" data-scale-side="right" data-v-91217104></div></div><div class="bottom-box block" data-v-91217104><div class="left-box" data-scale-side="left,bottom" data-v-91217104></div><div class="center-box" data-scale-side="bottom" data-v-91217104></div><div class="right-box" data-scale-side="right,bottom" data-v-91217104></div></div>',3)]),2)])],512))}}),[["__scopeId","data-v-91217104"]]));B.HvColorPicker=Ut,B.HvDragAndScale=en,B.HvDraggable=Kt,B.HvDroppable=Jt,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
2
+ //# sourceMappingURL=components.full.min.js.map