import{jsx as i,jsxs as e}from"react/jsx-runtime";import{forwardRef as t,useRef as o,useMemo as a}from"react";import s from"../../hooks/useMergeRefs.js";import{NOOP as r}from"../../utils/function-utils.js";import{ensureDefaultValue as d,bem as l}from"./SliderHelpers.js";import{SliderProvider as n}from"./SliderContext.js";import c from"./SliderBase/SliderBase.js";import m from"./SliderInfix.js";import{SliderColor as f}from"./SliderConstants.js";import"./Slider.scss.js";import{BASE_SIZES as v}from"../../constants/sizes.js";var u=t((function(t,v){var p=t.ariaLabel,x=t.ariaLabelledby,j=t.className,b=t.color,S=void 0===b?f.NORMAL:b,h=t["data-testid"],g=void 0===h?"l3-slider":h,L=t.disabled,O=void 0!==L&&L,k=t.id,z=t.max,I=void 0===z?100:z,T=t.min,y=void 0===T?0:T,C=t.onChange,F=void 0===C?r:C,V=t.ranged,w=void 0!==V&&V,M=t.step,N=void 0===M?1:M,R=t.showValue,A=void 0!==R&&R,B=t.size,P=void 0===B?u.sizes.SMALL:B,W=t.value,X=t.defaultValue,E=void 0===X?0:X,H=t.valueFormatter,q=void 0===H?function(i){return"".concat(i,"%")}:H,D=t.valueText,G=t.indicateSelection,J=void 0!==G&&G,K=t.prefix,Q=t.postfix,U=t.textfix,Y=t.selectionIndicatorWidth,Z=void 0===Y?"60px":Y,$=t.indicateTextSelection,_=void 0!==$&&$,ii=o(null),ei=s({refs:[v,ii]}),ti=a((function(){return{prefix:K,postfix:Q,textfix:U,indicateSelection:J,indicateTextSelection:_,selectionIndicatorWidth:Z}}),[K,Q,U,J,_,Z]);return i("div",Object.assign({style:{display:"flex"}},{children:i(n,Object.assign({ariaLabel:p,ariaLabelledby:x,color:S,"data-testid":g,disabled:O,infixOptions:ti,max:I,min:y,onChange:F,ranged:w,showValue:A,size:P,step:N,value:W,defaultValue:d(E,y,I,w),valueFormatter:q,valueText:D},{children:e("div",Object.assign({className:l("",{disabled:O,"value-shown":A},j),"data-testid":g,id:k,ref:ei},{children:[i(m,{kind:m.kinds.PREFIX}),i(c,{}),i(m,{kind:m.kinds.POSTFIX})]}))}))}))}));Object.assign(u,{sizes:v,colors:f});var p=u;export{p as default};
