import{booleanType as e,functionType as t,objectType as n,someType as r,stringType as i,withInstall as a}from"../_util/type.mjs";import o from"../_util/classNames.mjs";import s from"../config-provider/hooks/useConfigInject.mjs";import{useInjectFormItemContext as c}from"../form/FormItemContext.mjs";import l from"../vc-slider/src/Handle.mjs";import u from"../vc-slider/src/Range.mjs";import d from"../vc-slider/src/Slider.mjs";import f from"./SliderTooltip.mjs";import p from"./style/index.mjs";import{computed as m,createVNode as h,defineComponent as g,ref as _}from"vue";var v=e=>typeof e==`number`?e.toString():``,y=()=>({id:String,prefixCls:String,tooltipPrefixCls:String,range:r([Boolean,Object]),reverse:e(),min:Number,max:Number,step:r([Object,Number]),marks:n(),dots:e(),value:r([Array,Number]),defaultValue:r([Array,Number]),included:e(),disabled:e(),vertical:e(),tipFormatter:r([Function,Object],()=>v),tooltipOpen:e(),tooltipVisible:e(),tooltipPlacement:i(),getTooltipPopupContainer:t(),autofocus:e(),handleStyle:r([Array,Object]),trackStyle:r([Array,Object]),onChange:t(),onAfterChange:t(),onFocus:t(),onBlur:t(),"onUpdate:value":t()}),b=a(g({compatConfig:{MODE:3},name:`ASlider`,inheritAttrs:!1,props:y(),slots:Object,setup(e,{attrs:t,slots:n,emit:r,expose:i}){let{prefixCls:a,rootPrefixCls:g,direction:v,getPopupContainer:y,configProvider:b}=s(`slider`,e),[x,S]=p(a),C=c(),w=_(),T=_({}),E=(e,t)=>{T.value[e]=t},D=m(()=>e.tooltipPlacement?e.tooltipPlacement:e.vertical?v.value===`rtl`?`left`:`right`:`top`),O=()=>{w.value?.focus()},k=()=>{w.value?.blur()},A=e=>{r(`update:value`,e),r(`change`,e),C.onFieldChange()},j=e=>{r(`blur`,e)};i({focus:O,blur:k});let M=({tooltipPrefixCls:t,info:{value:n,dragging:r,index:i,...o}})=>{let{tipFormatter:s,tooltipOpen:c=e.tooltipVisible,getTooltipPopupContainer:u}=e,d=s?T.value[i]||r:!1,p=c||c===void 0&&d;return h(f,{prefixCls:t,title:s?s(n):``,open:p,placement:D.value,transitionName:`${g.value}-zoom-down`,key:i,overlayClassName:`${a.value}-tooltip`,getPopupContainer:u||y?.value},{default:()=>[h(l,{...o,value:n,onMouseenter:()=>E(i,!0),onMouseleave:()=>E(i,!1)},null)]})};return()=>{let{tooltipPrefixCls:r,range:i,id:s=C.id.value,...c}=e,l=b.getPrefixCls(`tooltip`,r),f=o(t.class,{[`${a.value}-rtl`]:v.value===`rtl`},S.value);v.value===`rtl`&&!c.vertical&&(c.reverse=!c.reverse);let p;return typeof i==`object`&&(p=i.draggableTrack),x(i?h(u,{...t,...c,step:c.step,draggableTrack:p,class:f,ref:w,handle:e=>M({tooltipPrefixCls:l,prefixCls:a.value,info:e}),prefixCls:a.value,onChange:A,onBlur:j},{mark:n.mark}):h(d,{...t,...c,id:s,step:c.step,class:f,ref:w,handle:e=>M({tooltipPrefixCls:l,prefixCls:a.value,info:e}),prefixCls:a.value,onChange:A,onBlur:j},{mark:n.mark}))}}}));export{b as default,y as sliderProps};