import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{F as t}from"./vendor-primevue-DGevbYGF.js";import{Bt as n,D as r,I as i,K as a,O as o,R as s,Rt as c,Ut as l,_t as u,et as d,k as f,kt as p,pt as m}from"./vendor-vue-core-BdhYaYlO.js";import"./vendor-other-D9HJWI2D.js";import{o as h,r as g}from"./colorUtil-DJbZtU1U.js";import{t as _}from"./src-zUtq9Eft.js";import{i as v,o as y}from"./widgetPropFilter-C6hJUR5m.js";import{t as b}from"./layout-ClVoG198.js";import{t as x}from"./WidgetLayoutField-yd8wJePn.js";var S={class:`text-xs truncate min-w-[4ch]`,"data-testid":`widget-color-text`},C=s({__name:`WidgetColorPicker`,props:{widget:{},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:s}){let C=e,w=s,T=r(()=>{let e=C.widget.options?.format;return g(e)?e:`hex`}),E=p(h(C.modelValue||`#000000`,g(C.widget.options?.format)?C.widget.options.format:`hex`));m(()=>C.modelValue,e=>{E.value=h(e||`#000000`,T.value)});function onPickerUpdate(e){E.value=e,w(`update:modelValue`,h(e,T.value))}let D=[...v],O=r(()=>y(C.widget.options,D));return(e,r)=>(d(),f(x,{widget:e.widget},{default:u(()=>[o(`label`,{class:n(c(_)(c(b),`flex items-center gap-2 w-full px-4 py-2`))},[i(c(t),a({modelValue:E.value,"onUpdate:modelValue":r[0]||=e=>E.value=e},O.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`]),o(`span`,S,l(c(h)(E.value,T.value)),1)],2)]),_:1},8,[`widget`]))}});export{C as default};
//# sourceMappingURL=WidgetColorPicker-CXx9Bqyc.js.map