Files
nextcloud-server/dist/index-Bn6GWjGp.chunk.mjs
nextcloud-command 78098c8325 chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-04-01 13:41:02 +00:00

3 lines
37 KiB
JavaScript

import{o as p,f as m,R as E,r as I,g as l,k as v,K as T,ah as xe,t as ae,F as K,c as L,h as x,L as V,b as we,z as re,w as F,u as f,ag as ye,H as ke,I as Ce,j as Me,i as Se,N as _e,O as He,C as ne,l as Ae,D as Le}from"./preload-helper-DoJVKVMq.chunk.mjs";import{j as $e,J as Ee,N as Y,K as Re,L as Fe,l as Ie}from"./mdi-BUoBIgaz.chunk.mjs";import{r as De,w as Ne,_ as Te,c as ze,b as M,N as B}from"./NcIconSvgWrapper-De-2-ukl-CcvQeIAt.chunk.mjs";import{a as ie,b as se,d as le}from"./colors-BfjxNgsx-Dyl_2CuU.chunk.mjs";import{y as Ve}from"./NcModal-kyWZ3UFC-BxKwwKAq.chunk.mjs";import"./index-Bp9-GhMo.chunk.mjs";import"./public-CvthP4YJ.chunk.mjs";import"./translation-DoG5ZELJ-DJHEP2RB.chunk.mjs";const Be="";function D(e,t){t===void 0&&(t={});var a=t.insertAt;if(!(!e||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",a==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}const N=function(e,t){const{componentPrefix:a=Be}=t||{};e.component(`${a}${this.name}`,this)},J={};var z={name:"Checkboard",props:{size:{type:[Number,String],default:8},white:{type:String,default:"#fff"},grey:{type:String,default:"#e6e6e6"}},computed:{bgStyle(){return{"background-image":`url(${Oe(this.white,this.grey,this.size)})`}}}};function Ue(e,t,a){if(typeof document>"u")return null;const r=document.createElement("canvas");r.width=r.height=a*2;const n=r.getContext("2d");return n?(n.fillStyle=e,n.fillRect(0,0,r.width,r.height),n.fillStyle=t,n.fillRect(0,0,a,a),n.translate(a,a),n.fillRect(0,0,a,a),r.toDataURL()):null}function Oe(e,t,a){const r=`${e},${t},${a}`;if(J[r])return J[r];const n=Ue(e,t,a);return J[r]=n,n}function je(e,t,a,r,n,o){return p(),m("div",{class:"vc-checkerboard",style:E(o.bgStyle)},null,4)}var Xe=".vc-checkerboard{background-size:contain;bottom:0;left:0;position:absolute;right:0;top:0}";D(Xe),z.render=je,z.__file="src/components/checkboard/checkboard.vue",z.install=N;var j={name:"Alpha",components:{Checkboard:z},props:{value:Object,onChange:Function},computed:{colors(){return this.value},gradientColor(){const{rgba:e}=this.colors,t=[e.r,e.g,e.b].join(",");return`linear-gradient(to right, rgba(${t}, 0) 0%, rgba(${t}, 1) 100%)`}},methods:{handleChange(e,t){!t&&e.preventDefault();const{container:a}=this.$refs;if(!a)return;const r=a.clientWidth,n=a.getBoundingClientRect().left+window.pageXOffset,o=(e.pageX||(e.touches?e.touches[0].pageX:0))-n;let i;o<0?i=0:o>r?i=1:i=Math.round(o*100/r)/100,this.colors.a!==i&&this.$emit("change",{h:this.colors.hsl.h,s:this.colors.hsl.s,l:this.colors.hsl.l,a:i,source:"rgba"})},handleMouseDown(e){this.handleChange(e,!0),window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp(){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}};const qe={class:"vc-alpha"},We={class:"vc-alpha-checkboard-wrap"},Pe=l("div",{class:"vc-alpha-picker"},null,-1),Ke=[Pe];function Ye(e,t,a,r,n,o){const i=I("Checkboard");return p(),m("div",qe,[l("div",We,[v(i)]),l("div",{class:"vc-alpha-gradient",style:E({background:o.gradientColor})},null,4),l("div",{ref:"container",class:"vc-alpha-container",onMousedown:t[0]||(t[0]=(...s)=>o.handleMouseDown&&o.handleMouseDown(...s)),onTouchmove:t[1]||(t[1]=(...s)=>o.handleChange&&o.handleChange(...s)),onTouchstart:t[2]||(t[2]=(...s)=>o.handleChange&&o.handleChange(...s))},[l("div",{class:"vc-alpha-pointer",style:E({left:`${o.colors.a*100}%`})},Ke,4)],544)])}var Je=".vc-alpha,.vc-alpha-checkboard-wrap{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-checkboard-wrap{overflow:hidden}.vc-alpha-gradient{bottom:0;left:0;position:absolute;right:0;top:0}.vc-alpha-container{cursor:pointer;height:100%;margin:0 3px;position:relative;z-index:2}.vc-alpha-pointer{position:absolute;z-index:2}.vc-alpha-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}";D(Je),j.render=Ye,j.__file="src/components/alpha/alpha.vue",j.install=N;function b(e,t){Ze(e)&&(e="100%");var a=Ge(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),a&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function U(e){return Math.min(1,Math.max(0,e))}function Ze(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Ge(e){return typeof e=="string"&&e.indexOf("%")!==-1}function pe(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function O(e){return e<=1?"".concat(Number(e)*100,"%"):e}function R(e){return e.length===1?"0"+e:String(e)}function Qe(e,t,a){return{r:b(e,255)*255,g:b(t,255)*255,b:b(a,255)*255}}function he(e,t,a){e=b(e,255),t=b(t,255),a=b(a,255);var r=Math.max(e,t,a),n=Math.min(e,t,a),o=0,i=0,s=(r+n)/2;if(r===n)i=0,o=0;else{var d=r-n;switch(i=s>.5?d/(2-r-n):d/(r+n),r){case e:o=(t-a)/d+(t<a?6:0);break;case t:o=(a-e)/d+2;break;case a:o=(e-t)/d+4;break}o/=6}return{h:o,s:i,l:s}}function Z(e,t,a){return a<0&&(a+=1),a>1&&(a-=1),a<1/6?e+(t-e)*(6*a):a<1/2?t:a<2/3?e+(t-e)*(2/3-a)*6:e}function et(e,t,a){var r,n,o;if(e=b(e,360),t=b(t,100),a=b(a,100),t===0)n=a,o=a,r=a;else{var i=a<.5?a*(1+t):a+t-a*t,s=2*a-i;r=Z(s,i,e+1/3),n=Z(s,i,e),o=Z(s,i,e-1/3)}return{r:r*255,g:n*255,b:o*255}}function ce(e,t,a){e=b(e,255),t=b(t,255),a=b(a,255);var r=Math.max(e,t,a),n=Math.min(e,t,a),o=0,i=r,s=r-n,d=r===0?0:s/r;if(r===n)o=0;else{switch(r){case e:o=(t-a)/s+(t<a?6:0);break;case t:o=(a-e)/s+2;break;case a:o=(e-t)/s+4;break}o/=6}return{h:o,s:d,v:i}}function tt(e,t,a){e=b(e,360)*6,t=b(t,100),a=b(a,100);var r=Math.floor(e),n=e-r,o=a*(1-t),i=a*(1-n*t),s=a*(1-(1-n)*t),d=r%6,k=[a,i,o,o,s,a][d],g=[s,a,a,i,o,o][d],u=[o,o,s,a,a,i][d];return{r:k*255,g:g*255,b:u*255}}function de(e,t,a,r){var n=[R(Math.round(e).toString(16)),R(Math.round(t).toString(16)),R(Math.round(a).toString(16))];return r&&n[0].startsWith(n[0].charAt(1))&&n[1].startsWith(n[1].charAt(1))&&n[2].startsWith(n[2].charAt(1))?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function at(e,t,a,r,n){var o=[R(Math.round(e).toString(16)),R(Math.round(t).toString(16)),R(Math.round(a).toString(16)),R(ot(r))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function ot(e){return Math.round(parseFloat(e)*255).toString(16)}function ue(e){return w(e)/255}function w(e){return parseInt(e,16)}function rt(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var oe={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function nt(e){var t={r:0,g:0,b:0},a=1,r=null,n=null,o=null,i=!1,s=!1;return typeof e=="string"&&(e=lt(e)),typeof e=="object"&&(S(e.r)&&S(e.g)&&S(e.b)?(t=Qe(e.r,e.g,e.b),i=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):S(e.h)&&S(e.s)&&S(e.v)?(r=O(e.s),n=O(e.v),t=tt(e.h,r,n),i=!0,s="hsv"):S(e.h)&&S(e.s)&&S(e.l)&&(r=O(e.s),o=O(e.l),t=et(e.h,r,o),i=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(a=e.a)),a=pe(a),{ok:i,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a}}var it="[-\\+]?\\d+%?",st="[-\\+]?\\d*\\.\\d+%?",$="(?:".concat(st,")|(?:").concat(it,")"),G="[\\s|\\(]+(".concat($,")[,|\\s]+(").concat($,")[,|\\s]+(").concat($,")\\s*\\)?"),Q="[\\s|\\(]+(".concat($,")[,|\\s]+(").concat($,")[,|\\s]+(").concat($,")[,|\\s]+(").concat($,")\\s*\\)?"),C={CSS_UNIT:new RegExp($),rgb:new RegExp("rgb"+G),rgba:new RegExp("rgba"+Q),hsl:new RegExp("hsl"+G),hsla:new RegExp("hsla"+Q),hsv:new RegExp("hsv"+G),hsva:new RegExp("hsva"+Q),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function lt(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(oe[e])e=oe[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var a=C.rgb.exec(e);return a?{r:a[1],g:a[2],b:a[3]}:(a=C.rgba.exec(e),a?{r:a[1],g:a[2],b:a[3],a:a[4]}:(a=C.hsl.exec(e),a?{h:a[1],s:a[2],l:a[3]}:(a=C.hsla.exec(e),a?{h:a[1],s:a[2],l:a[3],a:a[4]}:(a=C.hsv.exec(e),a?{h:a[1],s:a[2],v:a[3]}:(a=C.hsva.exec(e),a?{h:a[1],s:a[2],v:a[3],a:a[4]}:(a=C.hex8.exec(e),a?{r:w(a[1]),g:w(a[2]),b:w(a[3]),a:ue(a[4]),format:t?"name":"hex8"}:(a=C.hex6.exec(e),a?{r:w(a[1]),g:w(a[2]),b:w(a[3]),format:t?"name":"hex"}:(a=C.hex4.exec(e),a?{r:w(a[1]+a[1]),g:w(a[2]+a[2]),b:w(a[3]+a[3]),a:ue(a[4]+a[4]),format:t?"name":"hex8"}:(a=C.hex3.exec(e),a?{r:w(a[1]+a[1]),g:w(a[2]+a[2]),b:w(a[3]+a[3]),format:t?"name":"hex"}:!1)))))))))}function S(e){return!!C.CSS_UNIT.exec(String(e))}var ht=(function(){function e(t,a){t===void 0&&(t=""),a===void 0&&(a={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=rt(t)),this.originalInput=t;var n=nt(t);this.originalInput=t,this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=a.format)!==null&&r!==void 0?r:n.format,this.gradientType=a.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=n.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),a,r,n,o=t.r/255,i=t.g/255,s=t.b/255;return o<=.03928?a=o/12.92:a=Math.pow((o+.055)/1.055,2.4),i<=.03928?r=i/12.92:r=Math.pow((i+.055)/1.055,2.4),s<=.03928?n=s/12.92:n=Math.pow((s+.055)/1.055,2.4),.2126*a+.7152*r+.0722*n},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=pe(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=ce(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=ce(this.r,this.g,this.b),a=Math.round(t.h*360),r=Math.round(t.s*100),n=Math.round(t.v*100);return this.a===1?"hsv(".concat(a,", ").concat(r,"%, ").concat(n,"%)"):"hsva(".concat(a,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=he(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=he(this.r,this.g,this.b),a=Math.round(t.h*360),r=Math.round(t.s*100),n=Math.round(t.l*100);return this.a===1?"hsl(".concat(a,", ").concat(r,"%, ").concat(n,"%)"):"hsla(".concat(a,", ").concat(r,"%, ").concat(n,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),de(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),at(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),a=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(a,", ").concat(r,")"):"rgba(".concat(t,", ").concat(a,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(a){return"".concat(Math.round(b(a,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(a){return Math.round(b(a,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+de(this.r,this.g,this.b,!1),a=0,r=Object.entries(oe);a<r.length;a++){var n=r[a],o=n[0],i=n[1];if(t===i)return o}return!1},e.prototype.toString=function(t){var a=!!t;t=t??this.format;var r=!1,n=this.a<1&&this.a>=0,o=!a&&n&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var a=this.toHsl();return a.l+=t/100,a.l=U(a.l),new e(a)},e.prototype.brighten=function(t){t===void 0&&(t=10);var a=this.toRgb();return a.r=Math.max(0,Math.min(255,a.r-Math.round(255*-(t/100)))),a.g=Math.max(0,Math.min(255,a.g-Math.round(255*-(t/100)))),a.b=Math.max(0,Math.min(255,a.b-Math.round(255*-(t/100)))),new e(a)},e.prototype.darken=function(t){t===void 0&&(t=10);var a=this.toHsl();return a.l-=t/100,a.l=U(a.l),new e(a)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var a=this.toHsl();return a.s-=t/100,a.s=U(a.s),new e(a)},e.prototype.saturate=function(t){t===void 0&&(t=10);var a=this.toHsl();return a.s+=t/100,a.s=U(a.s),new e(a)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var a=this.toHsl(),r=(a.h+t)%360;return a.h=r<0?360+r:r,new e(a)},e.prototype.mix=function(t,a){a===void 0&&(a=50);var r=this.toRgb(),n=new e(t).toRgb(),o=a/100,i={r:(n.r-r.r)*o+r.r,g:(n.g-r.g)*o+r.g,b:(n.b-r.b)*o+r.b,a:(n.a-r.a)*o+r.a};return new e(i)},e.prototype.analogous=function(t,a){t===void 0&&(t=6),a===void 0&&(a=30);var r=this.toHsl(),n=360/a,o=[this];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var a=this.toHsv(),r=a.h,n=a.s,o=a.v,i=[],s=1/t;t--;)i.push(new e({h:r,s:n,v:o})),o=(o+s)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),a=t.h;return[this,new e({h:(a+72)%360,s:t.s,l:t.l}),new e({h:(a+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var a=this.toRgb(),r=new e(t).toRgb(),n=a.a+r.a*(1-a.a);return new e({r:(a.r*a.a+r.r*r.a*(1-a.a))/n,g:(a.g*a.a+r.g*r.a*(1-a.a))/n,b:(a.b*a.a+r.b*r.a*(1-a.a))/n,a:n})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var a=this.toHsl(),r=a.h,n=[this],o=360/t,i=1;i<t;i++)n.push(new e({h:(r+i*o)%360,s:a.s,l:a.l}));return n},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e})();function A(...e){return new ht(...e)}function ee(e,t){const a=e&&e.a;let r;e&&e.hsl?r=A(e.hsl):e&&e.hex&&e.hex.length>0?r=A(e.hex):e&&e.hsv?r=A(e.hsv):e&&e.rgba?r=A(e.rgba):e&&e.rgb?r=A(e.rgb):r=A(e),r&&(r._a===void 0||r._a===null)&&r.setAlpha(a||r.getAlpha());const n=r.toHsl(),o=r.toHsv();return n.s===0&&(o.h=n.h=e.h||e.hsl&&e.hsl.h||t||0),o.v<.0164&&(o.h=e.h||e.hsv&&e.hsv.h||0,o.s=e.s||e.hsv&&e.hsv.s||0),n.l<.01&&(n.h=e.h||e.hsl&&e.hsl.h||0,n.s=e.s||e.hsl&&e.hsl.s||0),{hsl:n,hex:r.toHexString().toUpperCase(),hex8:r.toHex8String().toUpperCase(),rgba:r.toRgb(),hsv:o,oldHue:e.h||t||n.h,source:e.source,a:r.getAlpha()}}var ct={model:{prop:"modelValue",event:"update:modelValue"},props:["modelValue"],data(){return{val:ee(this.modelValue)}},computed:{colors:{get(){return this.val},set(e){this.val=e,this.$emit("update:modelValue",e)}}},watch:{modelValue(e){this.val=ee(e)}},methods:{colorChange(e,t){this.oldHue=this.colors.hsl.h,this.colors=ee(e,t||this.oldHue)},isValidHex(e){return A(e).isValid},simpleCheckForValidColor(e){const t=["r","g","b","a","h","s","l","v"];let a=0,r=0;for(let n=0;n<t.length;n++){const o=t[n];e[o]&&(a++,isNaN(e[o])||r++)}if(a===r)return e},paletteUpperCase(e){return e.map(t=>t.toUpperCase())},isTransparent(e){return A(e).getAlpha()===0}}},X={name:"EditableInput",props:{label:String,labelText:String,desc:String,value:[String,Number],max:Number,min:Number,arrowOffset:{type:Number,default:1}},computed:{val:{get(){return this.value},set(e){if(this.max!==void 0&&+e>this.max)this.$refs.input.value=this.max;else return e}},labelId(){return`input__label__${this.label}__${Math.random().toString().slice(2,5)}`},labelSpanText(){return this.labelText||this.label}},methods:{update(e){this.handleChange(e.target.value)},handleChange(e){const t={};t[this.label]=e,t.hex===void 0&&t["#"]===void 0?this.$emit("change",t):e.length>5&&this.$emit("change",t)},handleKeyDown(e){let{val:t}=this;const a=Number(t);if(a){const r=this.arrowOffset||1;e.keyCode===38&&(t=a+r,this.handleChange(t),e.preventDefault()),e.keyCode===40&&(t=a-r,this.handleChange(t),e.preventDefault())}}}};const dt={class:"vc-editable-input"},ut=["aria-labelledby"],pt=["id","for"],ft={class:"vc-input__desc"};function gt(e,t,a,r,n,o){return p(),m("div",dt,[T(l("input",{ref:"input","onUpdate:modelValue":t[0]||(t[0]=i=>o.val=i),"aria-labelledby":o.labelId,class:"vc-input__input",onKeydown:t[1]||(t[1]=(...i)=>o.handleKeyDown&&o.handleKeyDown(...i)),onInput:t[2]||(t[2]=(...i)=>o.update&&o.update(...i))},null,40,ut),[[xe,o.val]]),l("span",{id:o.labelId,for:a.label,class:"vc-input__label"},ae(o.labelSpanText),9,pt),l("span",ft,ae(a.desc),1)])}var vt=".vc-editable-input{position:relative}.vc-input__input{border:0;outline:none;padding:0}.vc-input__label{text-transform:capitalize}";D(vt),X.render=gt,X.__file="src/components/editable-input/editable-input.vue",X.install=N;function te(e,t,a){return t<a?e<t?t:e>a?a:e:e<a?a:e>t?t:e}var q={name:"Saturation",props:{value:Object},computed:{colors(){return this.value},bgColor(){return`hsl(${this.colors.hsv.h}, 100%, 50%)`},pointerTop(){return`${-(this.colors.hsv.v*100)+1+100}%`},pointerLeft(){return`${this.colors.hsv.s*100}%`}},methods:{handleChange(e,t){!t&&e.preventDefault();const{container:a}=this.$refs;if(!a)return;const r=a.clientWidth,n=a.clientHeight,o=a.getBoundingClientRect().left+window.pageXOffset,i=a.getBoundingClientRect().top+window.pageYOffset,s=e.pageX||(e.touches?e.touches[0].pageX:0),d=e.pageY||(e.touches?e.touches[0].pageY:0),k=te(s-o,0,r),g=te(d-i,0,n),u=k/r,_=te(-(g/n)+1,0,1);this.onChange({h:this.colors.hsv.h,s:u,v:_,a:this.colors.hsv.a,source:"hsva"})},onChange(e){this.$emit("change",e)},handleMouseDown(e){window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp(e){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}};const bt=l("div",{class:"vc-saturation--white"},null,-1),mt=l("div",{class:"vc-saturation--black"},null,-1),xt=l("div",{class:"vc-saturation-circle"},null,-1),wt=[xt];function yt(e,t,a,r,n,o){return p(),m("div",{ref:"container",class:"vc-saturation",style:E({background:o.bgColor}),onMousedown:t[0]||(t[0]=(...i)=>o.handleMouseDown&&o.handleMouseDown(...i)),onTouchmove:t[1]||(t[1]=(...i)=>o.handleChange&&o.handleChange(...i)),onTouchstart:t[2]||(t[2]=(...i)=>o.handleChange&&o.handleChange(...i))},[bt,mt,l("div",{class:"vc-saturation-pointer",style:E({top:o.pointerTop,left:o.pointerLeft})},wt,4)],36)}var kt=".vc-saturation,.vc-saturation--black,.vc-saturation--white{bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0}.vc-saturation--white{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.vc-saturation--black{background:linear-gradient(0deg,#000,transparent)}.vc-saturation-pointer{cursor:pointer;position:absolute}.vc-saturation-circle{border-radius:50%;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);cursor:head;height:4px;transform:translate(-2px,-2px);width:4px}";D(kt),q.render=yt,q.__file="src/components/saturation/saturation.vue",q.install=N;var W={name:"Hue",props:{value:Object,direction:{type:String,default:"horizontal"}},data(){return{oldHue:0,pullDirection:""}},computed:{colors(){return this.value},directionClass(){return{"vc-hue--horizontal":this.direction==="horizontal","vc-hue--vertical":this.direction==="vertical"}},pointerTop(){return this.direction==="vertical"?this.colors.hsl.h===0&&this.pullDirection==="right"?0:`${-(this.colors.hsl.h*100/360)+100}%`:0},pointerLeft(){return this.direction==="vertical"?0:this.colors.hsl.h===0&&this.pullDirection==="right"?"100%":`${this.colors.hsl.h*100/360}%`}},watch:{value:{handler(e,t){const{h:a}=e.hsl;a!==0&&a-this.oldHue>0&&(this.pullDirection="right"),a!==0&&a-this.oldHue<0&&(this.pullDirection="left"),this.oldHue=a},deep:!0,immediate:!0}},methods:{handleChange(e,t){!t&&e.preventDefault();const{container:a}=this.$refs;if(!a)return;const r=a.clientWidth,n=a.clientHeight,o=a.getBoundingClientRect().left+window.pageXOffset,i=a.getBoundingClientRect().top+window.pageYOffset,s=e.pageX||(e.touches?e.touches[0].pageX:0),d=e.pageY||(e.touches?e.touches[0].pageY:0),k=s-o,g=d-i;let u,_;this.direction==="vertical"?(g<0?u=360:g>n?u=0:(_=-(g*100/n)+100,u=360*_/100),this.colors.hsl.h!==u&&this.$emit("change",{h:u,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:"hsl"})):(k<0?u=0:k>r?u=360:(_=k*100/r,u=360*_/100),this.colors.hsl.h!==u&&this.$emit("change",{h:u,s:this.colors.hsl.s,l:this.colors.hsl.l,a:this.colors.hsl.a,source:"hsl"}))},handleMouseDown(e){this.handleChange(e,!0),window.addEventListener("mousemove",this.handleChange),window.addEventListener("mouseup",this.handleChange),window.addEventListener("mouseup",this.handleMouseUp)},handleMouseUp(e){this.unbindEventListeners()},unbindEventListeners(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}}};const Ct=["aria-valuenow"],Mt=l("div",{class:"vc-hue-picker"},null,-1),St=[Mt];function _t(e,t,a,r,n,o){return p(),m("div",{class:K(["vc-hue",[o.directionClass]])},[l("div",{ref:"container",class:"vc-hue-container",role:"slider","aria-valuenow":o.colors.hsl.h,"aria-valuemin":"0","aria-valuemax":"360",onMousedown:t[0]||(t[0]=(...i)=>o.handleMouseDown&&o.handleMouseDown(...i)),onTouchmove:t[1]||(t[1]=(...i)=>o.handleChange&&o.handleChange(...i)),onTouchstart:t[2]||(t[2]=(...i)=>o.handleChange&&o.handleChange(...i))},[l("div",{class:"vc-hue-pointer",style:E({top:o.pointerTop,left:o.pointerLeft}),role:"presentation"},St,4)],40,Ct)],2)}var Ht=".vc-hue{border-radius:2px;bottom:0;left:0;position:absolute;right:0;top:0}.vc-hue--horizontal{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue--vertical{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.vc-hue-container{cursor:pointer;height:100%;margin:0 2px;position:relative}.vc-hue-pointer{position:absolute;z-index:2}.vc-hue-picker{background:#fff;border-radius:1px;box-shadow:0 0 2px rgba(0,0,0,.6);cursor:pointer;height:8px;margin-top:1px;transform:translateX(-2px);width:4px}";D(Ht),W.render=_t,W.__file="src/components/hue/hue.vue",W.install=N;var P={name:"Chrome",components:{Saturation:q,Hue:W,Alpha:j,EdIn:X,Checkboard:z},mixins:[ct],props:{disableAlpha:{type:Boolean,default:!1},disableFields:{type:Boolean,default:!1},format:{type:String,default:"hex"}},data(){return{fieldsIndex:"hex",highlight:!1}},computed:{hsl(){const{h:e,s:t,l:a}=this.colors.hsl;return{h:e.toFixed(),s:`${(t*100).toFixed()}%`,l:`${(a*100).toFixed()}%`}},activeColor(){const{rgba:e}=this.colors;return`rgba(${[e.r,e.g,e.b,e.a].join(",")})`},hasAlpha(){return this.colors.a<1}},watch:{format:{handler(e){this.fieldsIndex=e},immediate:!0}},methods:{childChange(e){this.colorChange(e)},inputChange(e){if(e){if(e.hex)this.isValidHex(e.hex)&&this.colorChange({hex:e.hex,source:"hex"});else if(e.r||e.g||e.b||e.a)this.colorChange({r:e.r||this.colors.rgba.r,g:e.g||this.colors.rgba.g,b:e.b||this.colors.rgba.b,a:e.a||this.colors.rgba.a,source:"rgba"});else if(e.h||e.s||e.l){const t=e.s?e.s.replace("%","")/100:this.colors.hsl.s,a=e.l?e.l.replace("%","")/100:this.colors.hsl.l;this.colorChange({h:e.h||this.colors.hsl.h,s:t,l:a,source:"hsl"})}}},toggleViews(){switch(this.fieldsIndex){case"hex":this.fieldsIndex=`rgb${this.disableAlpha?"":"a"}`;break;case"rgb":case"rgba":this.fieldsIndex=`hsl${this.disableAlpha?"":"a"}`;break;default:this.fieldsIndex="hex";break}this.$emit("update:format",this.fieldsIndex)},showHighlight(){this.highlight=!0},hideHighlight(){this.highlight=!1}}};const At={class:"vc-chrome-saturation-wrap"},Lt={class:"vc-chrome-body"},$t={class:"vc-chrome-controls"},Et={class:"vc-chrome-color-wrap"},Rt=["aria-label"],Ft={class:"vc-chrome-sliders"},It={class:"vc-chrome-hue-wrap"},Dt={key:0,class:"vc-chrome-alpha-wrap"},Nt={key:0,class:"vc-chrome-fields-wrap"},Tt={class:"vc-chrome-fields"},zt={class:"vc-chrome-field"},Vt={class:"vc-chrome-fields"},Bt={class:"vc-chrome-field"},Ut={class:"vc-chrome-field"},Ot={class:"vc-chrome-field"},jt={key:0,class:"vc-chrome-field"},Xt={class:"vc-chrome-fields"},qt={class:"vc-chrome-field"},Wt={class:"vc-chrome-field"},Pt={class:"vc-chrome-field"},Kt={key:0,class:"vc-chrome-field"},Yt={class:"vc-chrome-toggle-icon"},Jt=l("path",{fill:"#333",d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"},null,-1),Zt=[Jt],Gt={class:"vc-chrome-toggle-icon-highlight"};function Qt(e,t,a,r,n,o){const i=I("Saturation"),s=I("Checkboard"),d=I("Hue"),k=I("Alpha"),g=I("EdIn");return p(),m("div",{role:"application","aria-label":"Chrome color picker",class:K(["vc-chrome",[a.disableAlpha?"vc-chrome__disable-alpha":""]])},[l("div",At,[v(i,{value:e.colors,onChange:o.childChange},null,8,["value","onChange"])]),l("div",Lt,[l("div",$t,[l("div",Et,[l("div",{"aria-label":`current color is ${e.colors.hex}`,class:"vc-chrome-active-color",style:E({background:o.activeColor})},null,12,Rt),a.disableAlpha?x("v-if",!0):(p(),L(s,{key:0}))]),l("div",Ft,[l("div",It,[v(d,{value:e.colors,onChange:o.childChange},null,8,["value","onChange"])]),a.disableAlpha?x("v-if",!0):(p(),m("div",Dt,[v(k,{value:e.colors,onChange:o.childChange},null,8,["value","onChange"])]))])]),a.disableFields?x("v-if",!0):(p(),m("div",Nt,[T(l("div",Tt,[x(" hex "),l("div",zt,[o.hasAlpha?x("v-if",!0):(p(),L(g,{key:0,label:"hex",value:e.colors.hex,onChange:o.inputChange},null,8,["value","onChange"])),o.hasAlpha?(p(),L(g,{key:1,label:"hex",value:e.colors.hex8,onChange:o.inputChange},null,8,["value","onChange"])):x("v-if",!0)])],512),[[V,n.fieldsIndex==="hex"]]),T(l("div",Vt,[x(" rgba "),l("div",Bt,[v(g,{label:"r",value:e.colors.rgba.r,onChange:o.inputChange},null,8,["value","onChange"])]),l("div",Ut,[v(g,{label:"g",value:e.colors.rgba.g,onChange:o.inputChange},null,8,["value","onChange"])]),l("div",Ot,[v(g,{label:"b",value:e.colors.rgba.b,onChange:o.inputChange},null,8,["value","onChange"])]),a.disableAlpha?x("v-if",!0):(p(),m("div",jt,[v(g,{label:"a",value:e.colors.a,"arrow-offset":.01,max:1,onChange:o.inputChange},null,8,["value","arrow-offset","onChange"])]))],512),[[V,["rgb","rgba"].includes(n.fieldsIndex)]]),T(l("div",Xt,[x(" hsla "),l("div",qt,[v(g,{label:"h",value:o.hsl.h,onChange:o.inputChange},null,8,["value","onChange"])]),l("div",Wt,[v(g,{label:"s",value:o.hsl.s,onChange:o.inputChange},null,8,["value","onChange"])]),l("div",Pt,[v(g,{label:"l",value:o.hsl.l,onChange:o.inputChange},null,8,["value","onChange"])]),a.disableAlpha?x("v-if",!0):(p(),m("div",Kt,[v(g,{label:"a",value:e.colors.a,"arrow-offset":.01,max:1,onChange:o.inputChange},null,8,["value","arrow-offset","onChange"])]))],512),[[V,["hsl","hsla"].includes(n.fieldsIndex)]]),x(" btn "),l("div",{class:"vc-chrome-toggle-btn",role:"button","aria-label":"Change another color definition",onClick:t[3]||(t[3]=(...u)=>o.toggleViews&&o.toggleViews(...u))},[l("div",Yt,[(p(),m("svg",{style:{width:"24px",height:"24px"},viewBox:"0 0 24 24",onMouseover:t[0]||(t[0]=(...u)=>o.showHighlight&&o.showHighlight(...u)),onMouseenter:t[1]||(t[1]=(...u)=>o.showHighlight&&o.showHighlight(...u)),onMouseout:t[2]||(t[2]=(...u)=>o.hideHighlight&&o.hideHighlight(...u))},Zt,32))]),T(l("div",Gt,null,512),[[V,n.highlight]])]),x(" btn ")]))])],2)}var ea=".vc-chrome{background:#fff;background-color:#fff;border-radius:2px;box-shadow:0 0 2px rgba(0,0,0,.3),0 4px 8px rgba(0,0,0,.3);box-sizing:initial;font-family:Menlo;width:225px}.vc-chrome-controls{display:flex}.vc-chrome-color-wrap{position:relative;width:36px}.vc-chrome-active-color{border-radius:15px;height:30px;overflow:hidden;position:relative;width:30px;z-index:1}.vc-chrome-color-wrap .vc-checkerboard{background-size:auto;border-radius:15px;height:30px;width:30px}.vc-chrome-sliders{flex:1}.vc-chrome-fields-wrap{display:flex;padding-top:16px}.vc-chrome-fields{display:flex;flex:1;margin-left:-6px}.vc-chrome-field{padding-left:6px;width:100%}.vc-chrome-toggle-btn{position:relative;text-align:right;width:32px}.vc-chrome-toggle-icon{cursor:pointer;margin-right:-4px;margin-top:12px;position:relative;z-index:2}.vc-chrome-toggle-icon-highlight{background:#eee;border-radius:4px;height:28px;left:12px;position:absolute;top:10px;width:24px}.vc-chrome-hue-wrap{margin-bottom:8px}.vc-chrome-alpha-wrap,.vc-chrome-hue-wrap{height:10px;position:relative}.vc-chrome-alpha-wrap .vc-alpha-gradient,.vc-chrome-hue-wrap .vc-hue{border-radius:2px}.vc-chrome-alpha-wrap .vc-alpha-picker,.vc-chrome-hue-wrap .vc-hue-picker{background-color:#f8f8f8;border-radius:6px;box-shadow:0 1px 4px 0 rgba(0,0,0,.37);height:12px;transform:translate(-6px,-2px);width:12px}.vc-chrome-body{background-color:#fff;padding:16px 16px 12px}.vc-chrome-saturation-wrap{border-radius:2px 2px 0 0;overflow:hidden;padding-bottom:55%;position:relative;width:100%}.vc-chrome-saturation-wrap .vc-saturation-circle{height:12px;width:12px}.vc-chrome-fields .vc-input__input{border:none;border-radius:2px;box-shadow:inset 0 0 0 1px #dadada;color:#333;font-size:11px;height:21px;text-align:center;width:100%}.vc-chrome-fields .vc-input__label{color:#969696;display:block;font-size:11px;line-height:11px;margin-top:12px;text-align:center;text-transform:uppercase}.vc-chrome__disable-alpha .vc-chrome-active-color{height:18px;width:18px}.vc-chrome__disable-alpha .vc-chrome-color-wrap{width:30px}.vc-chrome__disable-alpha .vc-chrome-hue-wrap{margin-bottom:4px;margin-top:4px}";D(ea),P.render=Qt,P.__file="src/components/chrome/chrome.vue",P.install=N,De(Ne);const ta=["aria-label"],aa={key:0,class:"color-picker__simple"},oa=["aria-label","name","checked","onClick"],ra=["title"],na=["aria-label","name","checked"],ia={key:0,class:"color-picker__navigation"},sa=we({__name:"NcColorPicker",props:ne({advancedFields:{type:Boolean},clearable:{type:Boolean},container:{default:"body"},palette:{default:()=>[]},paletteOnly:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{},open:{type:Boolean},openModifiers:{}}),emits:ne(["submit","closed"],["update:modelValue","update:open"]),setup(e,{emit:t}){const a=re(e,"modelValue"),r=re(e,"open"),n=e,o=t,i=/^#([a-f0-9]{3}|[a-f0-9]{6})$/i,s=ze(),d=Ae(!1),k=Le(()=>{let c=n.palette;for(const h of c)if(typeof h=="string"&&!h.match(i)||typeof h=="object"&&!h.color?.match(i)){Ie.error("[NcColorPicker] Invalid palette passed",{color:h}),c=[];break}return c.length===0&&(c=n.clearable?[...le,ie,se]:[...le]),c.map(h=>({color:typeof h=="object"?h.color:h,name:typeof h=="object"&&h.name?h.name:M("A color with a HEX value {hex}",{hex:typeof h=="string"?h:h.color})}))});function g(c){o("submit",a.value),c(),d.value=!1}function u(c){c=typeof c=="string"?c:c.color,n.clearable&&a.value===c?a.value=void 0:a.value=c}function _(c){a.value=c.hex}function fe(c){return ge(c)>.5?ie.color:se.color}function ge(c){const[h,H,y]=ve(c);return(.2126*h+.7152*H+.0722*y)/255}function ve(c){const h=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(c);return h?[parseInt(h[1],16),parseInt(h[2],16),parseInt(h[3],16)]:[0,0,0]}return(c,h)=>(p(),L(f(Ve),{shown:r.value,"onUpdate:shown":h[3]||(h[3]=H=>r.value=H),container:c.container,popupRole:"dialog",onApplyHide:h[4]||(h[4]=H=>o("closed"))},{trigger:F(H=>[Se(c.$slots,"default",_e(He(H)),void 0,!0)]),default:F(H=>[l("div",{role:"dialog",class:K(["color-picker",{"color-picker--advanced-fields":d.value&&c.advancedFields,"color-picker--clearable":c.clearable}]),"aria-modal":"true","aria-label":f(M)("Color picker")},[v(ye,{name:"slide",mode:"out-in"},{default:F(()=>[d.value?(p(),L(f(P),{key:1,class:"color-picker__advanced",disableAlpha:"",disableFields:!c.advancedFields,modelValue:a.value??"#000000","onUpdate:modelValue":_},null,8,["disableFields","modelValue"])):(p(),m("div",aa,[(p(!0),m(ke,null,Ce(k.value,({color:y,name:be},me)=>(p(),m("label",{key:me,class:K(["color-picker__simple-color-circle",{"color-picker__simple-color-circle--active":y===a.value}]),style:E({backgroundColor:y,color:fe(y)})},[y===a.value?(p(),L(f(B),{key:0,path:f($e)},null,8,["path"])):x("",!0),l("input",{type:"radio",class:"hidden-visually","aria-label":be,name:`color-picker-${f(s)}`,checked:y===a.value,onClick:la=>u(y)},null,8,oa)],6))),128)),c.clearable?(p(),m("label",{key:0,class:"color-picker__clear",title:f(M)("No color")},[v(f(B),{size:a.value?28:34,path:f(Ee)},null,8,["size","path"]),l("input",{type:"radio",class:"hidden-visually","aria-label":f(M)("No color"),name:`color-picker-${f(s)}`,checked:!a.value,onClick:h[0]||(h[0]=y=>a.value=void 0)},null,8,na)],8,ra)):x("",!0)]))]),_:1}),c.paletteOnly?x("",!0):(p(),m("div",ia,[d.value?(p(),L(f(Y),{key:0,"aria-label":f(M)("Back"),title:f(M)("Back"),variant:"tertiary",onClick:h[1]||(h[1]=y=>d.value=!1)},{icon:F(()=>[v(f(B),{directional:"",path:f(Re)},null,8,["path"])]),_:1},8,["aria-label","title"])):(p(),L(f(Y),{key:1,"aria-label":f(M)("More options"),title:f(M)("More options"),variant:"tertiary",onClick:h[2]||(h[2]=y=>d.value=!0)},{icon:F(()=>[v(f(B),{path:f(Fe)},null,8,["path"])]),_:1},8,["aria-label","title"])),v(f(Y),{variant:"primary",onClick:y=>g(H.hide)},{default:F(()=>[Me(ae(f(M)("Choose")),1)]),_:2},1032,["onClick"])]))],10,ta)]),_:3},8,["shown","container"]))}}),ba=Te(sa,[["__scopeId","data-v-45e1396f"]]);export{ba as default};
//# sourceMappingURL=index-Bn6GWjGp.chunk.mjs.map