import{i as e,n as t}from"./rolldown-runtime-BKYq3fBv.js";import{Cr as n,Fr as r,Nn as i,Qn as a,Rr as o,Xn as s,Xr as c,Zn as l,ai as u,ar as d,bt as f,hr as p,si as m,sr as h,ui as g,yt as _}from"./vendor-primevue-D50rA9nL.js";import{i as v,r as y,s as b}from"./colorUtil-CaSrhsxR.js";import{n as x,t as S}from"./tailwindUtil-CORTPblY.js";import{i as C,o as w,s as T}from"./widgetPropFilter-Bp2uptBz.js";import{n as E,t as D}from"./layout-HATgRrPk.js";import{n as O,t as k}from"./WidgetLayoutField-DevzxXMh.js";var A,j,M=t((()=>{i(),_(),y(),S(),T(),E(),O(),A={class:`text-xs truncate min-w-[4ch]`,"data-testid":`widget-color-text`},j=h({__name:`WidgetColorPicker`,props:{widget:{},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let i=e,h=t,_=s(()=>{let e=i.widget.options?.format;return v(e)?e:`hex`}),y=c(b(i.modelValue||`#000000`,v(i.widget.options?.format)?i.widget.options.format:`hex`));r(()=>i.modelValue,e=>{y.value=b(e||`#000000`,_.value)});function onPickerUpdate(e){y.value=e,h(`update:modelValue`,b(e,_.value))}let S=[...C],T=s(()=>w(i.widget.options,S));return(e,t)=>(n(),a(k,{widget:e.widget},{default:o(()=>[l(`label`,{class:m(u(x)(u(D),`flex items-center gap-2 w-full px-4 py-2`))},[d(u(f),p({modelValue:y.value,"onUpdate:modelValue":t[0]||=e=>y.value=e},T.value,{class:`h-4 w-8 overflow-hidden !rounded-full border-none`,"aria-label":e.widget.name,pt:{preview:`!w-full !h-full !border-none`},"onUpdate:modelValue":onPickerUpdate}),null,16,[`modelValue`,`aria-label`]),l(`span`,A,g(u(b)(y.value,_.value)),1)],2)]),_:1},8,[`widget`]))}})})),N;t((()=>{M(),M(),N=j}))();export{N as default};
//# sourceMappingURL=WidgetColorPicker-BswC-zhv.js.map