import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{R as t}from"./vendor-primevue-7po8Zk9v.js";import{$ as n,Bt as r,D as i,E as a,Et as o,F as s,Ft as c,G as l,L as u,Lt as d,O as f,ft as p,ht as m}from"./vendor-vue-core-D3IvUUeM.js";import"./vendor-other-CrvBxfcV.js";import{o as h,r as g}from"./colorUtil-C83P1Arv.js";import{t as _}from"./src-ByuP5s1t.js";import{i as v,o as y}from"./widgetPropFilter-AWF4Ovcm.js";import{t as b}from"./layout-CjPuhCDQ.js";import{t as x}from"./WidgetLayoutField-Dp_aV9P0.js";var S={class:`text-xs truncate min-w-[4ch]`,"data-testid":`widget-color-text`},C=u({__name:`WidgetColorPicker`,props:{widget:{},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:u}){let C=e,w=u,T=a(()=>{let e=C.widget.options?.format;return g(e)?e:`hex`}),E=o(h(C.modelValue||`#000000`,g(C.widget.options?.format)?C.widget.options.format:`hex`));p(()=>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=a(()=>y(C.widget.options,D));return(e,a)=>(n(),f(x,{widget:e.widget},{default:m(()=>[i(`label`,{class:d(c(_)(c(b),`flex items-center gap-2 w-full px-4 py-2`))},[s(c(t),l({modelValue:E.value,"onUpdate:modelValue":a[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`]),i(`span`,S,r(c(h)(E.value,T.value)),1)],2)]),_:1},8,[`widget`]))}});export{C as default};
//# sourceMappingURL=WidgetColorPicker-BIAnrrGy.js.map