import{a as R,g as U,i as y,cA as h,j as l,h as c,cC as B,cB as v,l as L,cD as M,bG as W,cu as X,cv as q,cE as J,cF as P,cm as Q,aX as Y,cl as Z,cs as _}from"./main-634.js";import{B as F}from"./bf-962-248.js";import{S as V}from"./bf-723-244.js";import{c as tt}from"./bf-982-242.js";import{a as T}from"./bf-497-246.js";import"./bf-400-72.js";import"./bf-25-81.js";import"./bf-438-114.js";import"./bf-486-243.js";import"./bf-299-245.js";import"./bf-534-247.js";import"./bf-641-107.js";function xt({objectPaths:u,id:j}){const{css:o}=R(),{"*":b}=U(),[$,k]=y(Q),[D,H]=y(Y),[z,E]=y(Z),[K,A]=b.split("/"),g=e=>_(e,{themeVars:$,styles:D,themeColors:z}),r=e=>h(g(e.object),L(g(e.object),e.path)),i=[];if(Array.isArray(u))u.forEach(e=>{const{paths:s,object:n}=e;Object.keys(e.paths).forEach(d=>{i[d]={object:n,path:s[d]}})});else{const{paths:e,object:s}=u;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=r(i[s]),a=n==null?void 0:n.split(/(?!\(.*)\s(?![^(]*?\))/g);t["outline-width"]=h(i[s],a[0])||"",t["outline-style"]=h(i[s],a[1])||"",t["outline-color"]=h(i[s],a[2])||"";break}s!=="outline-offset"&&(t[s]=r(i[s]))}t["outline-offset"]=r(i["outline-offset"]);const O=(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(r(i.outline));n=Object.entries(I).map(([S,G])=>S===s?O(s,e):O(S,G)).join(" ")}Object.keys(i).includes("outline-offset")&&s==="outline-offset"&&(n=e);const{object:d,path:p}=i[a];n=((N=r(i[a]))==null?void 0:N.indexOf("!important"))>=0?`${e} !important`:n,M(d,p,n,{setThemeVars:k,setThemeColors:E,setStyles:H}),W(X(K,A,a,n,{[d]:q(d)}))},m=({unit:e,value:s,prop:n,oldVal:a})=>{if(s){const d=v(a),C=`${J(e,s,d)}${e||"px"}`;w(C,n)}};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:o(c.flxcb,c.mb2,{w:200}),children:[l.jsx("span",{className:o(c.fs12,c.fw500),children:"Type"}),l.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`})]}),l.jsxs("div",{className:o(c.flxcb,c.mb2,{w:200}),children:[l.jsx("span",{className:o(c.fs12,c.fs12,c.fw500),children:"Color"}),l.jsx(V,{action:{onChange:e=>w(e,"outline-color")},value:t==null?void 0:t["outline-color"]})]}),l.jsx("div",{className:o(c.mb2,{w:200}),children:l.jsxs("div",{className:o(x.titleContainer),children:[l.jsx("span",{className:o(x.title),children:"Width"}),l.jsx("span",{className:o(c.flxc)}),l.jsx("div",{className:o({p:2}),children:l.jsx(T,{min:"0",inputHandler:({unit:e,value:s})=>m({unit:e,value:s,prop:"outline-width"}),sizeHandler:({unitKey:e,unitValue:s})=>m({value:s,unit:e,prop:"outline-width",oldVal:t==null?void 0:t["outline-width"]}),id:"0",label:l.jsx(F,{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"})})]})}),l.jsx("div",{className:o(c.mb2,{w:200}),children:l.jsxs("div",{className:o(x.titleContainer),children:[l.jsx("span",{className:o(x.title),children:"Offset"}),l.jsx("span",{className:o(c.flxc)}),l.jsx("div",{className:o({p:2}),children:l.jsx(T,{min:"0",inputHandler:({value:e,unit:s})=>m({value:e,unit:s,prop:"outline-offset"}),sizeHandler:({unitKey:e,unitValue:s})=>m({value:s,unit:e,prop:"outline-offset",oldVal:t==null?void 0:t["outline-offset"]}),id:"0",label:l.jsx(F,{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=u=>{const[j,o,b]=P(u);return{"outline-width":j,"outline-style":o,"outline-color":b}};export{xt as default};
