import{u as re}from"./useAppearanceStore-IzenP-G4.js";import{A as te}from"./AppearanceHeader-Bmc_R2Bt.js";import{d as ae,e as _,f as d,i as l,j as oe,x as o,F as U,r as X}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as Y}from"./vendor-vue-shared-DrzsEcag.js";import{_ as ne}from"./vendor-vue3-html2pdf-KR020wX8.js";import"./vendor-pinia-BSPefQhS.js";import"./vendor-vue-reactivity-CheHbvBM.js";import"./vendor-axios-xsH4HHeE.js";import"./vendor-vue3-toastify-DBGjcIyK.js";import"./vendor-vue-runtime-dom-B2rky8vu.js";import"./settings.consts-C6F6lZ8o.js";import"./admin-BM775jCq.js";import"./convert-case-to-camel-case.utils-CK5dBN7n.js";/* empty css               */import"./vendor-vueform-slider-CCH9_7pb.js";import"./ThemeToggle-a3yohy6x.js";import"./vendor-html2pdf.js-B-tok4Ns.js";import"./vendor-jspdf-UFhKzYHA.js";import"./vendor-bootstrap-CCU-90um.js";import"./vendor-html2canvas-BfYXEYrK.js";const se={class:"ccb-appearance-content-borders"},ce={class:"ccb-appearance-content-borders__body"},de={class:"ccb-appearance-content-borders__group-label"},le={class:"ccb-appearance-content-borders__row"},ie={class:"ccb-appearance-content-borders__control"},pe=["value","min","max","step","onInput"],ue={class:"ccb-appearance-content-borders__control"},be=["value","min","max","step","onInput"],_e={class:"ccb-appearance-content-borders__control"},me=["value","onChange"],ve=["value"],fe=ae({__name:"Borders",setup(ge){const i=re(),Z=_(()=>i.getEditorDevice),m=_(()=>{const t=i.getEditingPreset;if(!t)return null;const r=t[Z.value],e=t.desktop,a=(r==null?void 0:r.borders)??(e==null?void 0:e.borders);return a&&typeof a=="object"?a:null}),$=_(()=>{var r;const t=((r=m.value)==null?void 0:r.data)||{};return Object.entries(t).map(([e,a])=>({key:e,field:a})).filter(e=>{var a;return((a=e.field)==null?void 0:a.type)==="border"})});function K(t,r,e){i.updateEditingPresetField("borders",t,e,r)}function b(t,r,e){var s,c;K(t,r,e);const a=(c=(s=m.value)==null?void 0:s.data)==null?void 0:c[t],p=a!=null&&a.value&&typeof a.value=="object"?a.value:{},u={border_type:"type",border_width:"width",border_radius:"radius"};i.updateEditingPresetField("borders",t,{...p,[u[r]]:e})}function ee(t){return t?Array.isArray(t)?t.map(r=>typeof r=="object"&&r!==null?{value:String(r.value??r.id??""),label:String(r.label??r.title??r.value??"")}:{value:String(r),label:String(r)}):typeof t=="object"?Object.entries(t).map(([r,e])=>({value:String(r),label:String(e)})):[]:[]}return(t,r)=>(l(),d("div",se,[oe(te,{title:"Borders","section-key":"borders"}),o("div",ce,[(l(!0),d(U,null,X($.value,e=>{var a,p,u,s,c,v,f,g,h,S,k,x,w,y,j,B,N,E,A,I,V,F,C,O,P,z,H,L,M,R,W,q,D,G,J,Q,T;return l(),d("div",{class:"ccb-appearance-content-borders__group",key:e.key},[o("div",de,Y(e.field.label||e.key),1),o("div",le,[o("div",ie,[r[0]||(r[0]=o("span",{class:"ccb-appearance-content-borders__control-label"},"Weight",-1)),o("input",{class:"ccb-appearance-content-borders__control-input",type:"number",value:Number(((u=(p=(a=e.field)==null?void 0:a.data)==null?void 0:p.border_width)==null?void 0:u.value)??0),min:((f=(v=(c=(s=e.field)==null?void 0:s.data)==null?void 0:c.border_width)==null?void 0:v.data)==null?void 0:f.min)??0,max:((k=(S=(h=(g=e.field)==null?void 0:g.data)==null?void 0:h.border_width)==null?void 0:S.data)==null?void 0:k.max)??100,step:((j=(y=(w=(x=e.field)==null?void 0:x.data)==null?void 0:w.border_width)==null?void 0:y.data)==null?void 0:j.step)??1,onInput:n=>b(e.key,"border_width",Number(n.target.value||0))},null,40,pe)]),o("div",ue,[r[1]||(r[1]=o("span",{class:"ccb-appearance-content-borders__control-label"},"Radius",-1)),o("input",{class:"ccb-appearance-content-borders__control-input",type:"number",value:Number(((E=(N=(B=e.field)==null?void 0:B.data)==null?void 0:N.border_radius)==null?void 0:E.value)??0),min:((F=(V=(I=(A=e.field)==null?void 0:A.data)==null?void 0:I.border_radius)==null?void 0:V.data)==null?void 0:F.min)??0,max:((z=(P=(O=(C=e.field)==null?void 0:C.data)==null?void 0:O.border_radius)==null?void 0:P.data)==null?void 0:z.max)??100,step:((R=(M=(L=(H=e.field)==null?void 0:H.data)==null?void 0:L.border_radius)==null?void 0:M.data)==null?void 0:R.step)??1,onInput:n=>b(e.key,"border_radius",Number(n.target.value||0))},null,40,be)]),o("div",_e,[r[2]||(r[2]=o("span",{class:"ccb-appearance-content-borders__control-label"},"Style",-1)),o("select",{class:"ccb-appearance-content-borders__control-input ccb-appearance-content-borders__control-input--select",value:String(((D=(q=(W=e.field)==null?void 0:W.data)==null?void 0:q.border_type)==null?void 0:D.value)??""),onChange:n=>b(e.key,"border_type",n.target.value)},[(l(!0),d(U,null,X(ee((T=(Q=(J=(G=e.field)==null?void 0:G.data)==null?void 0:J.border_type)==null?void 0:Q.data)==null?void 0:T.options),n=>(l(),d("option",{key:String(n.value),value:String(n.value)},Y(n.label),9,ve))),128))],40,me)])])])}),128))])]))}}),Me=ne(fe,[["__scopeId","data-v-d8c20a6c"]]);export{Me as default};
//# sourceMappingURL=Borders-CDYzf1vV.js.map
