import{a as U,g as G,i as y,cA as m,j as o,h as c,cC as B,cB as v,l as L,cD as M,bD as W,cr as q,cs as J,cE as P,cF as Q,ch as X,aV as Y,cg as Z,cp as _}from"./main-343.js";import{B as D}from"./bf-901-254.js";import{S as V}from"./bf-914-249.js";import{c as tt}from"./bf-711-253.js";import{b as F}from"./bf-603-251.js";import"./bf-90-70.js";import"./bf-649-79.js";import"./bf-594-113.js";import"./bf-810-248.js";import"./bf-870-250.js";import"./bf-453-86.js";import"./bf-190-88.js";import"./bf-519-87.js";function jt({objectPaths:d,id:j}){const{css:l}=U(),{"*":b}=G(),[T,$]=y(X),[k,H]=y(Y),[z,E]=y(Z),[K,A]=b.split("/"),g=e=>_(e,{themeVars:T,styles:k,themeColors:z}),u=e=>m(g(e.object),L(g(e.object),e.path)),i=[];if(Array.isArray(d))d.forEach(e=>{const{paths:s,object:n}=e;Object.keys(e.paths).forEach(r=>{i[r]={object:n,path:s[r]}})});else{const{paths:e,object:s}=d;Object.keys(e).forEach(a=>{i[a]={object:s,path:e[a]}})}const t={"outline-color":"","outline-width":"","outline-offset":"","outline-style":""},f=Object.keys(i);for(let e=0;e<f.length;e+=1){const s=f[e];if(f.length===2&&s==="outline"){const n=u(i[s]),a=n==null?void 0:n.split(/(?!\(.*)\s(?![^(]*?\))/g);t["outline-width"]=m(i[s],a[0])||"",t["outline-style"]=m(i[s],a[1])||"",t["outline-color"]=m(i[s],a[2])||"";break}s!=="outline-offset"&&(t[s]=u(i[s]))}t["outline-offset"]=u(i["outline-offset"]);const p=(e,s)=>{if(e==="outline-width")return s||"0px";if(e==="outline-style")return s||"solid";if(e==="outline-color")return s||"hsla(0, 0%, 0%, 0.5)"},w=(e,s)=>{var N;let n,a=s;if(f.length===2&&Object.keys(i).includes("outline")&&s!=="outline-offset"){a="outline";const I=st(u(i.outline));n=Object.entries(I).map(([S,R])=>S===s?p(s,e):p(S,R)).join(" ")}Object.keys(i).includes("outline-offset")&&s==="outline-offset"&&(n=e);const{object:r,path:O}=i[a];n=((N=u(i[a]))==null?void 0:N.indexOf("!important"))>=0?`${e} !important`:n,M(r,O,n,{setThemeVars:$,setThemeColors:E,setStyles:H}),W(q(K,A,a,n,{[r]:J(r)}))},h=({unit:e,value:s,prop:n,oldVal:a})=>{if(s){const r=v(a),C=`${P(e,s,r)}${e||"px"}`;w(C,n)}};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:l(c.flxcb,c.mb2,{w:200}),children:[o.jsx("span",{className:l(c.fs12,c.fw500),children:"Type"}),o.jsx(tt,{options:et,value:t==null?void 0:t["outline-style"],onChange:e=>w(e,"outline-style"),w:130,h:30,id:`${j}-style`})]}),o.jsxs("div",{className:l(c.flxcb,c.mb2,{w:200}),children:[o.jsx("span",{className:l(c.fs12,c.fs12,c.fw500),children:"Color"}),o.jsx(V,{action:{onChange:e=>w(e,"outline-color")},value:t==null?void 0:t["outline-color"]})]}),o.jsx("div",{className:l(c.mb2,{w:200}),children:o.jsxs("div",{className:l(x.titleContainer),children:[o.jsx("span",{className:l(x.title),children:"Width"}),o.jsx("span",{className:l(c.flxc)}),o.jsx("div",{className:l({p:2}),children:o.jsx(F,{min:"0",inputHandler:({unit:e,value:s})=>h({unit:e,value:s,prop:"outline-width"}),sizeHandler:({unitKey:e,unitValue:s})=>h({value:s,unit:e,prop:"outline-width",oldVal:t==null?void 0:t["outline-width"]}),id:"0",label:o.jsx(D,{size:14}),value:(t==null?void 0:t["outline-width"])&&B(t==null?void 0:t["outline-width"]),unit:(t==null?void 0:t["outline-width"])&&v(t==null?void 0:t["outline-width"]),options:["px","em","rem","%"],width:"128px",dataTestId:"outline-width-control"})})]})}),o.jsx("div",{className:l(c.mb2,{w:200}),children:o.jsxs("div",{className:l(x.titleContainer),children:[o.jsx("span",{className:l(x.title),children:"Offset"}),o.jsx("span",{className:l(c.flxc)}),o.jsx("div",{className:l({p:2}),children:o.jsx(F,{min:"0",inputHandler:({value:e,unit:s})=>h({value:e,unit:s,prop:"outline-offset"}),sizeHandler:({unitKey:e,unitValue:s})=>h({value:s,unit:e,prop:"outline-offset",oldVal:t==null?void 0:t["outline-offset"]}),id:"0",label:o.jsx(D,{size:14}),value:(t==null?void 0:t["outline-offset"])&&B(t==null?void 0:t["outline-offset"]),unit:(t==null?void 0:t["outline-offset"])&&v(t==null?void 0:t["outline-offset"]),options:["px","em","rem","%"],width:"128px",dataTestId:"outline-width-control"})})]})})]})}const x={titleContainer:{flx:"center-between"},title:{fs:12,fw:500}},et=[{label:"Solid",value:"solid"},{label:"Dashed",value:"dashed"},{label:"Dotted",value:"dotted"},{label:"Double",value:"double"},{label:"Groove",value:"groove"},{label:"Ridge",value:"ridge"},{label:"Inset",value:"inset"},{label:"Outset",value:"outset"},{label:"None",value:"none"}],st=d=>{const[j,l,b]=Q(d);return{"outline-width":j,"outline-style":l,"outline-color":b}};export{jt as default};
