import{u as j}from"./vendor-vue-runtime-dom-B2rky8vu.js";import{m as w}from"./vendor-vueform-slider-CCH9_7pb.js";import{u as S}from"./useAppearanceTypography-BBl5RU11.js";import{d as B,e as c,f as n,i,x as r,j as P,t as v,F as p,r as f}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{u,t as z}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as d,a as _,b as A}from"./vendor-vue-shared-DrzsEcag.js";import"./useAppearanceStore-IzenP-G4.js";import"./vendor-pinia-BSPefQhS.js";import"./vendor-axios-xsH4HHeE.js";import"./vendor-vue3-toastify-DBGjcIyK.js";const D={class:"slider-min-max"},E={class:"slider-min-max-item first"},L={class:"label"},R={class:"label"},$={class:"custom-ticks"},q={key:0,class:"custom-marks"},G={key:0,class:"label"},Y=B({__name:"Modern",props:{field:{}},setup(x){j(a=>({"1283a175":u(h),"26e46926":u(g),"8bec541c":u(b),f90da15a:u(k)}));const{borderColor:k,textColor:b,accentColor:h,containerColor:g}=S(),C=x,{field:s}=z(C),m=(a,l)=>{const e=Number(a);return Number.isFinite(e)?e:l},t=c(()=>m(s.value.min??s.value.minValue,0)),o=c(()=>{const a=m(s.value.max??s.value.maxValue,t.value+100);return a>t.value?a:t.value+1}),N=c(()=>{const a=m(s.value.defaultValue??s.value.default??s.value.value,t.value);return Math.min(o.value,Math.max(t.value,a))}),y=c(()=>{if(s.value.jump)return 1;const a=m(s.value.step,1);return a>0?a:1}),V=c(()=>{var l;return(((l=s.value.scalePoints)==null?void 0:l.trim())||"").split(",").map(e=>Number(e.trim())).filter(e=>!isNaN(e)&&e>=t.value&&e<=o.value)}),F=a=>{const l=Math.max(1,o.value-t.value);return{left:`${(a-t.value)/l*100}%`}},M=a=>{const l=a.toFixed(2);return parseFloat(l).toString()};return(a,l)=>(i(),n("div",{class:_(["slider-wrapper ccb-modern-range-field",{jump:u(s).jump}])},[r("div",D,[r("div",E,[r("span",L,d(t.value),1)]),r("div",{class:_(["slider-min-max-item",{done:N.value>=o.value}])},[r("span",R,d(o.value),1)],2)]),P(u(w),{"model-value":o.value,min:t.value,max:o.value,step:y.value,disabled:!0,"show-tooltip":"focus",class:"custom-slider",format:M},null,8,["model-value","min","max","step"]),r("div",$,[(i(),n(p,null,f(25,e=>r("div",{key:e,class:"tick"})),64))]),u(s).scalePoints?(i(),n("div",q,[l[0]||(l[0]=r("div",{class:"stick-line"},[r("div",{class:"stick-line-item"})],-1)),(i(!0),n(p,null,f(V.value,e=>(i(),n("div",{key:e,class:"mark",style:A(F(e))},[e!==t.value&&e!==o.value?(i(),n("div",G,d(e),1)):v("",!0)],4))),128))])):v("",!0)],2))}});export{Y as default};
//# sourceMappingURL=Modern-CEhirXbz.js.map
