1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chunks/chunk-BWlrlDSf7AFK-formt.js","assets/chunks/chunk-C9MwVHZDj8F9-rende.js","assets/chunks/chunk-BY8-DUITmgGY-_onpa.js","assets/chunks/chunk-BVARF2Uuihnv-custo.js"])))=>i.map(i=>d[i]); 2import{aN as X,cZ as A,at as o,c8 as ee,d1 as y,cO as i,aC as _,aI as c,aA as m,ay as n,dV as r,F as w,c_ as te,az as b,cz as le,cB as R,aH as I,dr as B,dF as g,cs as P,aM as ae,_ as se}from"./chunk-C9MwVHZDj8F9-rende.js";import{g as oe,k as ne}from"./chunk-CkdOpTIL-2oa-vue-c.js";import{u as re}from"./chunk-BVARF2Uuihnv-custo.js";import{u as ue}from"./chunk-Byez5e8WeupQ-leftb.js";import{u as ie}from"./chunk-D13jImrcgElH-color.js";import{ag as $,_ as ce}from"./chunk-BY8-DUITmgGY-_onpa.js";/* empty css */const de={class:"v-form-color-picker",style:{"font-size":"15px"}},ve={key:0,class:"color-picker-label-row"},pe={class:"palette-wrapper"},me={key:0},fe={class:"color-label"},Ce={class:"custom-list-item"},ye={key:0},_e={class:"custom-list-item"},Oe={class:"custom-sketch-wrap"},be=X({__name:"FormColorPicker",props:{modelValue:{default:void 0},label:{default:"Color"},enableOpacity:{type:Boolean,default:!1},addTransparentOption:{type:Boolean,default:!1},addInheritOption:{type:Boolean,default:!1},showLinkToSiteStylesColors:{type:Boolean,default:!1},hideNoneOption:{type:Boolean,default:!1},addCustomOption:{type:Boolean,default:!1},enableCustomColorOpacity:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{emit:x}){const M=ae(()=>se(()=>import("./chunk-BWlrlDSf7AFK-formt.js"),__vite__mapDeps([0,1,2,3]))),u=E,D=x,{input:l}=re(u,D),{openMenu:H}=ue(),W=ie(),k=A(!1),S=A(!1),d={PRIMARY_COLOR:"var(--primary-color)",SECONDARY_COLOR:"var(--secondary-color)",DARK_COLOR:"var(--dark-color)",LIGHT_COLOR:"var(--light-color)",TRANSPARENT_COLOR:"transparent",INHERIT_COLOR:"inherit"},L=o(()=>[{value:d.PRIMARY_COLOR,label:"Primary"},{value:d.SECONDARY_COLOR,label:"Secondary"},{value:d.DARK_COLOR,label:"Dark"},{value:d.LIGHT_COLOR,label:"Light"},...u.addTransparentOption?[{value:d.TRANSPARENT_COLOR,label:"Transparent"}]:[],...u.addInheritOption?[{value:d.INHERIT_COLOR,label:"Inherit"}]:[],...u.hideNoneOption?[]:[{value:"",label:"None"}]]),s=o({get(){var e;return(e=l.value)!=null&&e.startsWith("rgba(var")?$(l.value,d.PRIMARY_COLOR):l.value&&!u.enableOpacity?$(l.value):l.value},set(e){var v;const t=e!=null&&e.startsWith("var")&&u.enableOpacity?`${e.slice(0,-1)}-parts)`:e;if(u.enableOpacity&&t.includes("var")){if((v=l.value)!=null&&v.startsWith("rgba(var")){const O=l.value.split(",");l.value=`rgba(${t}, ${O[1]}`;return}l.value=`rgba(${t}, 0.8)`;return}l.value=t}}),z=o(()=>ee(s.value)&&s.value.includes("#")),f=o(()=>{const e=s.value;return e?!L.value.some(t=>t.value===e):!1}),V=o({get(){return f.value?s.value:""},set(e){const t=oe(e);t.isValid()&&(s.value=u.enableCustomColorOpacity?t.toRgbString():t.toHexString())}}),F=o(()=>{if(!s.value)return"Select Color";const e=L.value.find(t=>t.value===s.value);return e?e.label:f.value?`Custom (${s.value})`:"None"}),T=o({get(){var e;return(e=l.value)!=null&&e.startsWith("rgba(var")?`${+l.value.split(", ")[1].replace(")","")*100}%`:""},set(e){var t,v;if(u.enableOpacity){const C=+(e||"80%").slice(0,-1)/100;if((t=l.value)!=null&&t.startsWith("rgba(var")){const p=l.value.split(",");l.value=`${p[0]}, ${C})`}else if((v=l.value)!=null&&v.startsWith("var")){const p=l.value.includes("-parts)")?l.value:`${l.value.slice(0,-1)}-parts)`;l.value=`rgba(${p}, ${C})`}}}}),U=o(()=>!l.value),Y=o(()=>!l.value.includes("var")),q=o(()=>u.enableOpacity&&!U.value&&!Y.value),G=o(()=>k.value?"keyboard_arrow_up":"keyboard_arrow_down"),h=e=>e!=null&&e.startsWith("var(")||z.value||e&&e===s.value&&f.value?{backgroundColor:e}:{},K=e=>!s.value&&!e?!0:s.value===e,Z=e=>{s.value=e},j=()=>{H("siteStyles/colors")};return(e,t)=>{const v=y("VLabel"),O=y("InIcon"),C=y("VListItemTitle"),p=y("VListItem"),N=y("InMenu"),J=y("VList");return i(),_("div",de,[e.label?(i(),_("div",ve,[c(v,{text:e.label,class:"color-picker-label v-editor-field-label"},null,8,["text"])])):m("",!0),n("div",pe,[c(N,{modelValue:k.value,"onUpdate:modelValue":t[2]||(t[2]=a=>k.value=a),offset:"-45px"},{activator:r(({props:a})=>[n("div",P({class:"color-activator"},a),[n("div",{class:"color-square",style:R(h(s.value))},[s.value?m("",!0):(i(),_("span",me,"-"))],4),n("div",fe,B(F.value),1),t[4]||(t[4]=n("div",{style:{flex:"1"}},null,-1)),c(O,{class:"arrow-icon",icon:G.value},null,8,["icon"])],16)]),default:r(()=>[c(J,{class:"v-custom-list"},{default:r(()=>[(i(!0),_(w,null,te(L.value,(a,Q)=>
2(i(),b(p,{key:Q,value:a.value,class:le(["v-custom-list-item",{"is-selected":K(a.value)}]),onClick:ke=>Z(a.value)},{default:r(()=>[n("div",Ce,[n("div",{class:"color-square",style:R(h(a.value))},[a.value?m("",!0):(i(),_("span",ye,"-"))],4),c(C,null,{default:r(()=>[I(B(a.label),1)]),_:2},1024)])]),_:2},1032,["value","class","onClick"]))),128)),e.addCustomOption?(i(),b(N,{key:0,modelValue:S.value,"onUpdate:modelValue":t[1]||(t[1]=a=>S.value=a),"close-on-content-click":!1,location:"bottom end",offset:"8px"},{activator:r(({props:a})=>[c(p,P({class:["v-custom-list-item",{"is-selected":f.value}]},a),{default:r(()=>[n("div",_e,[n("div",{class:"color-square",style:R(f.value?{backgroundColor:s.value}:{})},[f.value?m("",!0):(i(),b(O,{key:0,icon:"add"}))],4),c(C,null,{default:r(()=>t[5]||(t[5]=[I("Custom")])),_:1})])]),_:2},1040,["class"])]),default:r(()=>[n("div",Oe,[c(g(ne),{modelValue:V.value,"onUpdate:modelValue":t[0]||(t[0]=a=>V.value=a),"preset-colors":g(W),"disable-alpha":!e.enableCustomColorOpacity},null,8,["modelValue","preset-colors","disable-alpha"])])]),_:1},8,["modelValue"])):m("",!0),e.showLinkToSiteStylesColors?(i(),_(w,{key:1},[t[7]||(t[7]=n("div",{class:"below-options-divider"},null,-1)),c(p,{class:"v-custom-list-item edit-site-styles-item",onClick:j},{default:r(()=>[c(C,null,{default:r(()=>t[6]||(t[6]=[I("Edit Site Styles")])),_:1})]),_:1})],64)):m("",!0)]),_:1})]),_:1},8,["modelValue"]),q.value?(i(),b(g(M),{key:0,modelValue:T.value,"onUpdate:modelValue":t[3]||(t[3]=a=>T.value=a),label:"Opacity","default-unit":"%","allowed-units":["%"],"allow-unit-change":!1,"display-slider":!0,"slider-settings":"opacity",layout:"default"},null,8,["modelValue"])):m("",!0)])])}}}),he=ce(be,[["__scopeId","data-v-a779cc12"]]);export{he as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.