// muse-ui v4.0.0-alpha.1
// © 2024 kjxbyz. All Rights Reserved.
"use client";
function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
function _array_without_holes(arr) {
    if (Array.isArray(arr)) return _array_like_to_array(arr);
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _iterable_to_array(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _non_iterable_spread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
function _object_without_properties(source, excluded) {
    if (source == null) return {};
    var target = _object_without_properties_loose(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
        var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
        for(i = 0; i < sourceSymbolKeys.length; i++){
            key = sourceSymbolKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
    }
    return target;
}
function _object_without_properties_loose(source, excluded) {
    if (source == null) return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for(i = 0; i < sourceKeys.length; i++){
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
    }
    return target;
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _to_consumable_array(arr) {
    return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
// registry/default/ui/slider.tsx
import * as React from "react";
// ../../node_modules/.pnpm/@babel+runtime@7.22.3/node_modules/@babel/runtime/helpers/esm/extends.js
function _extends() {
    _extends = Object.assign ? Object.assign.bind() : function _extends(target) {
        for(var i = 1; i < arguments.length; i++){
            var source = arguments[i];
            for(var key in source){
                if (Object.prototype.hasOwnProperty.call(source, key)) {
                    target[key] = source[key];
                }
            }
        }
        return target;
    };
    return _extends.apply(this, arguments);
}
// ../../node_modules/.pnpm/@radix-ui+react-slider@1.1.2_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-slider/dist/index.mjs
import { forwardRef as $g1Vy2$forwardRef, useState as $g1Vy2$useState, useRef as $g1Vy2$useRef, createElement as $g1Vy2$createElement, useMemo as $g1Vy2$useMemo, useEffect as $g1Vy2$useEffect } from "react";
// ../../node_modules/.pnpm/@radix-ui+number@1.0.1/node_modules/@radix-ui/number/dist/index.mjs
function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, param) {
    var _param = _sliced_to_array(param, 2), min = _param[0], max = _param[1];
    return Math.min(max, Math.max(min, value));
}
// ../../node_modules/.pnpm/@radix-ui+primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.mjs
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler) {
    var _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, _ref_checkForDefaultPrevented = _ref.checkForDefaultPrevented, checkForDefaultPrevented = _ref_checkForDefaultPrevented === void 0 ? true : _ref_checkForDefaultPrevented;
    return function handleEvent(event) {
        originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
        if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
    };
}
// ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
import { useCallback as $3vqmr$useCallback } from "react";
function $6ed0406888f73fc4$var$setRef(ref, value) {
    if (typeof ref === "function") ref(value);
    else if (ref !== null && ref !== void 0) ref.current = value;
}
function $6ed0406888f73fc4$export$43e446d32b3d21af() {
    for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){
        refs[_key] = arguments[_key];
    }
    return function(node) {
        return refs.forEach(function(ref) {
            return $6ed0406888f73fc4$var$setRef(ref, node);
        });
    };
}
function $6ed0406888f73fc4$export$c7b2cbe3552a0d05() {
    for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){
        refs[_key] = arguments[_key];
    }
    return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af.apply(void 0, _to_consumable_array(refs)), refs);
}
// ../../node_modules/.pnpm/@radix-ui+react-context@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-context/dist/index.mjs
import { createContext as $3bkAK$createContext, useMemo as $3bkAK$useMemo, createElement as $3bkAK$createElement, useContext as $3bkAK$useContext } from "react";
function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName) {
    var createContextScopeDeps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    var defaultContexts = [];
    function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
        var BaseContext = /* @__PURE__ */ $3bkAK$createContext(defaultContext);
        var index = defaultContexts.length;
        defaultContexts = _to_consumable_array(defaultContexts).concat([
            defaultContext
        ]);
        function Provider(props) {
            var scope = props.scope, children = props.children, context = _object_without_properties(props, [
                "scope",
                "children"
            ]);
            var Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
            var value = $3bkAK$useMemo(function() {
                return context;
            }, Object.values(context));
            return /* @__PURE__ */ $3bkAK$createElement(Context.Provider, {
                value: value
            }, children);
        }
        function useContext(consumerName, scope) {
            var Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
            var context = $3bkAK$useContext(Context);
            if (context) return context;
            if (defaultContext !== void 0) return defaultContext;
            throw new Error("`".concat(consumerName, "` must be used within `").concat(rootComponentName, "`"));
        }
        Provider.displayName = rootComponentName + "Provider";
        return [
            Provider,
            useContext
        ];
    }
    var createScope = function() {
        var scopeContexts = defaultContexts.map(function(defaultContext) {
            return /* @__PURE__ */ $3bkAK$createContext(defaultContext);
        });
        return function useScope(scope) {
            var contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
            return $3bkAK$useMemo(function() {
                return _define_property({}, "__scope".concat(scopeName), _object_spread_props(_object_spread({}, scope), _define_property({}, scopeName, contexts)));
            }, [
                scope,
                contexts
            ]);
        };
    };
    createScope.scopeName = scopeName;
    return [
        $c512c27ab02ef895$export$fd42f52fd3ae1109,
        $c512c27ab02ef895$var$composeContextScopes.apply(void 0, [
            createScope
        ].concat(_to_consumable_array(createContextScopeDeps)))
    ];
}
function $c512c27ab02ef895$var$composeContextScopes() {
    for(var _len = arguments.length, scopes = new Array(_len), _key = 0; _key < _len; _key++){
        scopes[_key] = arguments[_key];
    }
    var baseScope = scopes[0];
    if (scopes.length === 1) return baseScope;
    var createScope1 = function() {
        var scopeHooks = scopes.map(function(createScope) {
            return {
                useScope: createScope(),
                scopeName: createScope.scopeName
            };
        });
        return function useComposedScopes(overrideScopes) {
            var nextScopes1 = scopeHooks.reduce(function(nextScopes, param) {
                var useScope = param.useScope, scopeName = param.scopeName;
                var scopeProps = useScope(overrideScopes);
                var currentScope = scopeProps["__scope".concat(scopeName)];
                return _object_spread({}, nextScopes, currentScope);
            }, {});
            return $3bkAK$useMemo(function() {
                return _define_property({}, "__scope".concat(baseScope.scopeName), nextScopes1);
            }, [
                nextScopes1
            ]);
        };
    };
    createScope1.scopeName = baseScope.scopeName;
    return createScope1;
}
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
import { useCallback as $bnPw9$useCallback, useState as $bnPw9$useState, useRef as $bnPw9$useRef, useEffect as $bnPw9$useEffect } from "react";
// ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
import { useRef as $lwiWj$useRef, useEffect as $lwiWj$useEffect, useMemo as $lwiWj$useMemo } from "react";
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
    var callbackRef = $lwiWj$useRef(callback);
    $lwiWj$useEffect(function() {
        callbackRef.current = callback;
    });
    return $lwiWj$useMemo(function() {
        return function() {
            for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
                args[_key] = arguments[_key];
            }
            var _callbackRef$current;
            var _callbackRef$current1;
            return (_callbackRef$current1 = callbackRef.current) === null || _callbackRef$current1 === void 0 ? void 0 : (_callbackRef$current = _callbackRef$current1).call.apply(_callbackRef$current, [
                callbackRef
            ].concat(_to_consumable_array(args)));
        };
    }, []);
}
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
function $71cd76cc60e0454e$export$6f32135080cb4c3(param) {
    var prop = param.prop, defaultProp = param.defaultProp, _param_onChange = param.onChange, onChange = _param_onChange === void 0 ? function() {} : _param_onChange;
    var _$71cd76cc60e0454e$var$useUncontrolledState = _sliced_to_array($71cd76cc60e0454e$var$useUncontrolledState({
        defaultProp: defaultProp,
        onChange: onChange
    }), 2), uncontrolledProp = _$71cd76cc60e0454e$var$useUncontrolledState[0], setUncontrolledProp = _$71cd76cc60e0454e$var$useUncontrolledState[1];
    var isControlled = prop !== void 0;
    var value1 = isControlled ? prop : uncontrolledProp;
    var handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
    var setValue = $bnPw9$useCallback(function(nextValue) {
        if (isControlled) {
            var setter = nextValue;
            var value = typeof nextValue === "function" ? setter(prop) : nextValue;
            if (value !== prop) handleChange(value);
        } else setUncontrolledProp(nextValue);
    }, [
        isControlled,
        prop,
        setUncontrolledProp,
        handleChange
    ]);
    return [
        value1,
        setValue
    ];
}
function $71cd76cc60e0454e$var$useUncontrolledState(param) {
    var defaultProp = param.defaultProp, onChange = param.onChange;
    var uncontrolledState = $bnPw9$useState(defaultProp);
    var _uncontrolledState = _sliced_to_array(uncontrolledState, 1), value = _uncontrolledState[0];
    var prevValueRef = $bnPw9$useRef(value);
    var handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
    $bnPw9$useEffect(function() {
        if (prevValueRef.current !== value) {
            handleChange(value);
            prevValueRef.current = value;
        }
    }, [
        value,
        prevValueRef,
        handleChange
    ]);
    return uncontrolledState;
}
// ../../node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs
import { createContext as $7Gjcd$createContext, createElement as $7Gjcd$createElement, useContext as $7Gjcd$useContext } from "react";
var $f631663db3294ace$var$DirectionContext = /* @__PURE__ */ $7Gjcd$createContext(void 0);
function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
    var globalDir = $7Gjcd$useContext($f631663db3294ace$var$DirectionContext);
    return localDir || globalDir || "ltr";
}
// ../../node_modules/.pnpm/@radix-ui+react-use-previous@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-previous/dist/index.mjs
import { useRef as $8LvvK$useRef, useMemo as $8LvvK$useMemo } from "react";
function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
    var ref = $8LvvK$useRef({
        value: value,
        previous: value
    });
    return $8LvvK$useMemo(function() {
        if (ref.current.value !== value) {
            ref.current.previous = ref.current.value;
            ref.current.value = value;
        }
        return ref.current.previous;
    }, [
        value
    ]);
}
// ../../node_modules/.pnpm/@radix-ui+react-use-size@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-size/dist/index.mjs
import { useState as $9gyGR$useState } from "react";
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
import { useLayoutEffect as $dxlwH$useLayoutEffect } from "react";
var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $dxlwH$useLayoutEffect : function() {};
// ../../node_modules/.pnpm/@radix-ui+react-use-size@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-size/dist/index.mjs
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
    var _$9gyGR$useState = _sliced_to_array($9gyGR$useState(void 0), 2), size = _$9gyGR$useState[0], setSize = _$9gyGR$useState[1];
    $9f79659886946c16$export$e5c5a5f917a5871c(function() {
        if (element) {
            setSize({
                width: element.offsetWidth,
                height: element.offsetHeight
            });
            var resizeObserver = new ResizeObserver(function(entries) {
                if (!Array.isArray(entries)) return;
                if (!entries.length) return;
                var entry = entries[0];
                var width;
                var height;
                if ("borderBoxSize" in entry) {
                    var borderSizeEntry = entry["borderBoxSize"];
                    var borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
                    width = borderSize["inlineSize"];
                    height = borderSize["blockSize"];
                } else {
                    width = element.offsetWidth;
                    height = element.offsetHeight;
                }
                setSize({
                    width: width,
                    height: height
                });
            });
            resizeObserver.observe(element, {
                box: "border-box"
            });
            return function() {
                return resizeObserver.unobserve(element);
            };
        } else setSize(void 0);
    }, [
        element
    ]);
    return size;
}
// ../../node_modules/.pnpm/@babel+runtime@7.22.6/node_modules/@babel/runtime/helpers/esm/extends.js
function _extends2() {
    _extends2 = Object.assign ? Object.assign.bind() : function _extends2(target) {
        for(var i = 1; i < arguments.length; i++){
            var source = arguments[i];
            for(var key in source){
                if (Object.prototype.hasOwnProperty.call(source, key)) {
                    target[key] = source[key];
                }
            }
        }
        return target;
    };
    return _extends2.apply(this, arguments);
}
// ../../node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs
import { forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement } from "react";
import { flushSync as $4q5Fq$flushSync } from "react-dom";
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs
import { forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment } from "react";
var $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ $9IrjX$forwardRef(function(props, forwardedRef) {
    var children = props.children, slotProps = _object_without_properties(props, [
        "children"
    ]);
    var childrenArray = $9IrjX$Children.toArray(children);
    var slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
    if (slottable) {
        var newElement = slottable.props.children;
        var newChildren = childrenArray.map(function(child) {
            if (child === slottable) {
                if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);
                return /* @__PURE__ */ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;
            } else return child;
        });
        return /* @__PURE__ */ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends2({}, slotProps, {
            ref: forwardedRef
        }), /* @__PURE__ */ $9IrjX$isValidElement(newElement) ? /* @__PURE__ */ $9IrjX$cloneElement(newElement, void 0, newChildren) : null);
    }
    return /* @__PURE__ */ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends2({}, slotProps, {
        ref: forwardedRef
    }), children);
});
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
var $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ $9IrjX$forwardRef(function(props, forwardedRef) {
    var children = props.children, slotProps = _object_without_properties(props, [
        "children"
    ]);
    if (/* @__PURE__ */ $9IrjX$isValidElement(children)) return /* @__PURE__ */ $9IrjX$cloneElement(children, _object_spread_props(_object_spread({}, $5e63c961fc1ce211$var$mergeProps(slotProps, children.props)), {
        ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
    }));
    return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;
});
$5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = function(param) {
    var children = param.children;
    return /* @__PURE__ */ $9IrjX$createElement($9IrjX$Fragment, null, children);
};
function $5e63c961fc1ce211$var$isSlottable(child) {
    return /* @__PURE__ */ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
}
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
    var _loop = function(propName) {
        var slotPropValue = slotProps[propName];
        var childPropValue = childProps[propName];
        var isHandler = /^on[A-Z]/.test(propName);
        if (isHandler) {
            if (slotPropValue && childPropValue) overrideProps[propName] = function() {
                for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
                    args[_key] = arguments[_key];
                }
                childPropValue.apply(void 0, _to_consumable_array(args));
                slotPropValue.apply(void 0, _to_consumable_array(args));
            };
            else if (slotPropValue) overrideProps[propName] = slotPropValue;
        } else if (propName === "style") overrideProps[propName] = _object_spread({}, slotPropValue, childPropValue);
        else if (propName === "className") overrideProps[propName] = [
            slotPropValue,
            childPropValue
        ].filter(Boolean).join(" ");
    };
    var overrideProps = _object_spread({}, childProps);
    for(var propName in childProps)_loop(propName);
    return _object_spread({}, slotProps, overrideProps);
}
// ../../node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs
var $8927f6f2acc4f386$var$NODES = [
    "a",
    "button",
    "div",
    "form",
    "h2",
    "h3",
    "img",
    "input",
    "label",
    "li",
    "nav",
    "ol",
    "p",
    "span",
    "svg",
    "ul"
];
var $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce(function(primitive, node) {
    var Node = /* @__PURE__ */ $4q5Fq$forwardRef(function(props, forwardedRef) {
        var asChild = props.asChild, primitiveProps = _object_without_properties(props, [
            "asChild"
        ]);
        var Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
        $4q5Fq$useEffect(function() {
            window[Symbol.for("radix-ui")] = true;
        }, []);
        return /* @__PURE__ */ $4q5Fq$createElement(Comp, _extends2({}, primitiveProps, {
            ref: forwardedRef
        }));
    });
    Node.displayName = "Primitive.".concat(node);
    return _object_spread_props(_object_spread({}, primitive), _define_property({}, node, Node));
}, {});
// ../../node_modules/.pnpm/@radix-ui+react-collection@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-collection/dist/index.mjs
import $6vYhU$react from "react";
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
    var PROVIDER_NAME = name + "CollectionProvider";
    var _$c512c27ab02ef895$export$50c7b4e9d9f19c1 = _sliced_to_array($c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME), 2), createCollectionContext = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[0], createCollectionScope = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[1];
    var _createCollectionContext = _sliced_to_array(createCollectionContext(PROVIDER_NAME, {
        collectionRef: {
            current: null
        },
        itemMap: /* @__PURE__ */ new Map()
    }), 2), CollectionProviderImpl = _createCollectionContext[0], useCollectionContext = _createCollectionContext[1];
    var CollectionProvider = function(props) {
        var scope = props.scope, children = props.children;
        var ref = $6vYhU$react.useRef(null);
        var itemMap = $6vYhU$react.useRef(/* @__PURE__ */ new Map()).current;
        return /* @__PURE__ */ $6vYhU$react.createElement(CollectionProviderImpl, {
            scope: scope,
            itemMap: itemMap,
            collectionRef: ref
        }, children);
    };
    /* @__PURE__ */ Object.assign(CollectionProvider, {
        displayName: PROVIDER_NAME
    });
    var COLLECTION_SLOT_NAME = name + "CollectionSlot";
    var CollectionSlot = /* @__PURE__ */ $6vYhU$react.forwardRef(function(props, forwardedRef) {
        var scope = props.scope, children = props.children;
        var context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
        var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
        return /* @__PURE__ */ $6vYhU$react.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
            ref: composedRefs
        }, children);
    });
    /* @__PURE__ */ Object.assign(CollectionSlot, {
        displayName: COLLECTION_SLOT_NAME
    });
    var ITEM_SLOT_NAME = name + "CollectionItemSlot";
    var ITEM_DATA_ATTR = "data-radix-collection-item";
    var CollectionItemSlot = /* @__PURE__ */ $6vYhU$react.forwardRef(function(props, forwardedRef) {
        var scope = props.scope, children = props.children, itemData = _object_without_properties(props, [
            "scope",
            "children"
        ]);
        var ref = $6vYhU$react.useRef(null);
        var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
        var context = useCollectionContext(ITEM_SLOT_NAME, scope);
        $6vYhU$react.useEffect(function() {
            context.itemMap.set(ref, _object_spread({
                ref: ref
            }, itemData));
            return function() {
                return void context.itemMap.delete(ref);
            };
        });
        var _obj;
        return /* @__PURE__ */ $6vYhU$react.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, (_obj = {}, _define_property(_obj, ITEM_DATA_ATTR, ""), _define_property(_obj, "ref", composedRefs), _obj), children);
    });
    /* @__PURE__ */ Object.assign(CollectionItemSlot, {
        displayName: ITEM_SLOT_NAME
    });
    function useCollection(scope) {
        var context = useCollectionContext(name + "CollectionConsumer", scope);
        var getItems = $6vYhU$react.useCallback(function() {
            var collectionNode = context.collectionRef.current;
            if (!collectionNode) return [];
            var orderedNodes = Array.from(collectionNode.querySelectorAll("[".concat(ITEM_DATA_ATTR, "]")));
            var items = Array.from(context.itemMap.values());
            var orderedItems = items.sort(function(a, b) {
                return orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current);
            });
            return orderedItems;
        }, [
            context.collectionRef,
            context.itemMap
        ]);
        return getItems;
    }
    return [
        {
            Provider: CollectionProvider,
            Slot: CollectionSlot,
            ItemSlot: CollectionItemSlot
        },
        useCollection,
        createCollectionScope
    ];
}
// ../../node_modules/.pnpm/@radix-ui+react-slider@1.1.2_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-slider/dist/index.mjs
var $faa2e61a3361514f$var$PAGE_KEYS = [
    "PageUp",
    "PageDown"
];
var $faa2e61a3361514f$var$ARROW_KEYS = [
    "ArrowUp",
    "ArrowDown",
    "ArrowLeft",
    "ArrowRight"
];
var $faa2e61a3361514f$var$BACK_KEYS = {
    "from-left": [
        "Home",
        "PageDown",
        "ArrowDown",
        "ArrowLeft"
    ],
    "from-right": [
        "Home",
        "PageDown",
        "ArrowDown",
        "ArrowRight"
    ],
    "from-bottom": [
        "Home",
        "PageDown",
        "ArrowDown",
        "ArrowLeft"
    ],
    "from-top": [
        "Home",
        "PageDown",
        "ArrowUp",
        "ArrowLeft"
    ]
};
var $faa2e61a3361514f$var$SLIDER_NAME = "Slider";
var _$e02a7d9cb1dc128c$export$c74125a8e3af6bb2 = _sliced_to_array($e02a7d9cb1dc128c$export$c74125a8e3af6bb2($faa2e61a3361514f$var$SLIDER_NAME), 3), $faa2e61a3361514f$var$Collection = _$e02a7d9cb1dc128c$export$c74125a8e3af6bb2[0], $faa2e61a3361514f$var$useCollection = _$e02a7d9cb1dc128c$export$c74125a8e3af6bb2[1], $faa2e61a3361514f$var$createCollectionScope = _$e02a7d9cb1dc128c$export$c74125a8e3af6bb2[2];
var _$c512c27ab02ef895$export$50c7b4e9d9f19c1 = _sliced_to_array($c512c27ab02ef895$export$50c7b4e9d9f19c1($faa2e61a3361514f$var$SLIDER_NAME, [
    $faa2e61a3361514f$var$createCollectionScope
]), 2), $faa2e61a3361514f$var$createSliderContext = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[0], $faa2e61a3361514f$export$ef72632d7b901f97 = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[1];
var _$faa2e61a3361514f$var$createSliderContext = _sliced_to_array($faa2e61a3361514f$var$createSliderContext($faa2e61a3361514f$var$SLIDER_NAME), 2), $faa2e61a3361514f$var$SliderProvider = _$faa2e61a3361514f$var$createSliderContext[0], $faa2e61a3361514f$var$useSliderContext = _$faa2e61a3361514f$var$createSliderContext[1];
var $faa2e61a3361514f$export$472062a354075cee = /* @__PURE__ */ $g1Vy2$forwardRef(function(props, forwardedRef) {
    var handleSlideStart = function handleSlideStart(value) {
        var closestIndex = $faa2e61a3361514f$var$getClosestValueIndex(values, value);
        updateValues(value, closestIndex);
    };
    var handleSlideMove = function handleSlideMove(value) {
        updateValues(value, valueIndexToChangeRef.current);
    };
    var handleSlideEnd = function handleSlideEnd() {
        var prevValue = valuesBeforeSlideStartRef.current[valueIndexToChangeRef.current];
        var nextValue = values[valueIndexToChangeRef.current];
        var hasChanged = nextValue !== prevValue;
        if (hasChanged) onValueCommit(values);
    };
    var updateValues = function updateValues(value, atIndex) {
        var commit = (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {
            commit: false
        }).commit;
        var decimalCount = $faa2e61a3361514f$var$getDecimalCount(step);
        var snapToStep = $faa2e61a3361514f$var$roundValue(Math.round((value - min) / step) * step + min, decimalCount);
        var nextValue = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(snapToStep, [
            min,
            max
        ]);
        setValues(function() {
            var prevValues = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
            var nextValues = $faa2e61a3361514f$var$getNextSortedValues(prevValues, nextValue, atIndex);
            if ($faa2e61a3361514f$var$hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {
                valueIndexToChangeRef.current = nextValues.indexOf(nextValue);
                var hasChanged = String(nextValues) !== String(prevValues);
                if (hasChanged && commit) onValueCommit(nextValues);
                return hasChanged ? nextValues : prevValues;
            } else return prevValues;
        });
    };
    var name = props.name, _props_min = props.min, min = _props_min === void 0 ? 0 : _props_min, _props_max = props.max, max = _props_max === void 0 ? 100 : _props_max, _props_step = props.step, step = _props_step === void 0 ? 1 : _props_step, _props_orientation = props.orientation, orientation = _props_orientation === void 0 ? "horizontal" : _props_orientation, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, _props_minStepsBetweenThumbs = props.minStepsBetweenThumbs, minStepsBetweenThumbs = _props_minStepsBetweenThumbs === void 0 ? 0 : _props_minStepsBetweenThumbs, _props_defaultValue = props.defaultValue, defaultValue = _props_defaultValue === void 0 ? [
        min
    ] : _props_defaultValue, value1 = props.value, _props_onValueChange = props.onValueChange, onValueChange = _props_onValueChange === void 0 ? function() {} : _props_onValueChange, _props_onValueCommit = props.onValueCommit, onValueCommit = _props_onValueCommit === void 0 ? function() {} : _props_onValueCommit, _props_inverted = props.inverted, inverted = _props_inverted === void 0 ? false : _props_inverted, sliderProps = _object_without_properties(props, [
        "name",
        "min",
        "max",
        "step",
        "orientation",
        "disabled",
        "minStepsBetweenThumbs",
        "defaultValue",
        "value",
        "onValueChange",
        "onValueCommit",
        "inverted"
    ]);
    var _$g1Vy2$useState = _sliced_to_array($g1Vy2$useState(null), 2), slider = _$g1Vy2$useState[0], setSlider = _$g1Vy2$useState[1];
    var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, function(node) {
        return setSlider(node);
    });
    var thumbRefs = $g1Vy2$useRef(/* @__PURE__ */ new Set());
    var valueIndexToChangeRef = $g1Vy2$useRef(0);
    var isHorizontal = orientation === "horizontal";
    var isFormControl = slider ? Boolean(slider.closest("form")) : true;
    var SliderOrientation = isHorizontal ? $faa2e61a3361514f$var$SliderHorizontal : $faa2e61a3361514f$var$SliderVertical;
    var _$71cd76cc60e0454e$export$6f32135080cb4c3 = _sliced_to_array($71cd76cc60e0454e$export$6f32135080cb4c3({
        prop: value1,
        defaultProp: defaultValue,
        onChange: function(value) {
            var _thumbs$valueIndexToC;
            var thumbs = _to_consumable_array(thumbRefs.current);
            (_thumbs$valueIndexToC = thumbs[valueIndexToChangeRef.current]) === null || _thumbs$valueIndexToC === void 0 || _thumbs$valueIndexToC.focus();
            onValueChange(value);
        }
    }), 2), tmp = _$71cd76cc60e0454e$export$6f32135080cb4c3[0], values = tmp === void 0 ? [] : tmp, setValues = _$71cd76cc60e0454e$export$6f32135080cb4c3[1];
    var valuesBeforeSlideStartRef = $g1Vy2$useRef(values);
    return /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$SliderProvider, {
        scope: props.__scopeSlider,
        disabled: disabled,
        min: min,
        max: max,
        valueIndexToChangeRef: valueIndexToChangeRef,
        thumbs: thumbRefs.current,
        values: values,
        orientation: orientation
    }, /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$Collection.Provider, {
        scope: props.__scopeSlider
    }, /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$Collection.Slot, {
        scope: props.__scopeSlider
    }, /* @__PURE__ */ $g1Vy2$createElement(SliderOrientation, _extends({
        "aria-disabled": disabled,
        "data-disabled": disabled ? "" : void 0
    }, sliderProps, {
        ref: composedRefs,
        onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(sliderProps.onPointerDown, function() {
            if (!disabled) valuesBeforeSlideStartRef.current = values;
        }),
        min: min,
        max: max,
        inverted: inverted,
        onSlideStart: disabled ? void 0 : handleSlideStart,
        onSlideMove: disabled ? void 0 : handleSlideMove,
        onSlideEnd: disabled ? void 0 : handleSlideEnd,
        onHomeKeyDown: function() {
            return !disabled && updateValues(min, 0, {
                commit: true
            });
        },
        onEndKeyDown: function() {
            return !disabled && updateValues(max, values.length - 1, {
                commit: true
            });
        },
        onStepKeyDown: function(param) {
            var event = param.event, stepDirection = param.direction;
            if (!disabled) {
                var isPageKey = $faa2e61a3361514f$var$PAGE_KEYS.includes(event.key);
                var isSkipKey = isPageKey || event.shiftKey && $faa2e61a3361514f$var$ARROW_KEYS.includes(event.key);
                var multiplier = isSkipKey ? 10 : 1;
                var atIndex = valueIndexToChangeRef.current;
                var value = values[atIndex];
                var stepInDirection = step * multiplier * stepDirection;
                updateValues(value + stepInDirection, atIndex, {
                    commit: true
                });
            }
        }
    })))), isFormControl && values.map(function(value, index) {
        return /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$BubbleInput, {
            key: index,
            name: name ? name + (values.length > 1 ? "[]" : "") : void 0,
            value: value
        });
    }));
});
var _$faa2e61a3361514f$var$createSliderContext1 = _sliced_to_array($faa2e61a3361514f$var$createSliderContext($faa2e61a3361514f$var$SLIDER_NAME, {
    startEdge: "left",
    endEdge: "right",
    size: "width",
    direction: 1
}), 2), $faa2e61a3361514f$var$SliderOrientationProvider = _$faa2e61a3361514f$var$createSliderContext1[0], $faa2e61a3361514f$var$useSliderOrientationContext = _$faa2e61a3361514f$var$createSliderContext1[1];
var $faa2e61a3361514f$var$SliderHorizontal = /* @__PURE__ */ $g1Vy2$forwardRef(function(props, forwardedRef) {
    var getValueFromPointer = function getValueFromPointer(pointerPosition) {
        var rect = rectRef.current || slider.getBoundingClientRect();
        var input = [
            0,
            rect.width
        ];
        var output = isSlidingFromLeft ? [
            min,
            max
        ] : [
            max,
            min
        ];
        var value = $faa2e61a3361514f$var$linearScale(input, output);
        rectRef.current = rect;
        return value(pointerPosition - rect.left);
    };
    var min = props.min, max = props.max, dir = props.dir, inverted = props.inverted, onSlideStart = props.onSlideStart, onSlideMove = props.onSlideMove, onSlideEnd = props.onSlideEnd, onStepKeyDown = props.onStepKeyDown, sliderProps = _object_without_properties(props, [
        "min",
        "max",
        "dir",
        "inverted",
        "onSlideStart",
        "onSlideMove",
        "onSlideEnd",
        "onStepKeyDown"
    ]);
    var _$g1Vy2$useState = _sliced_to_array($g1Vy2$useState(null), 2), slider = _$g1Vy2$useState[0], setSlider = _$g1Vy2$useState[1];
    var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, function(node) {
        return setSlider(node);
    });
    var rectRef = $g1Vy2$useRef();
    var direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
    var isDirectionLTR = direction === "ltr";
    var isSlidingFromLeft = isDirectionLTR && !inverted || !isDirectionLTR && inverted;
    return /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$SliderOrientationProvider, {
        scope: props.__scopeSlider,
        startEdge: isSlidingFromLeft ? "left" : "right",
        endEdge: isSlidingFromLeft ? "right" : "left",
        direction: isSlidingFromLeft ? 1 : -1,
        size: "width"
    }, /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$SliderImpl, _extends({
        dir: direction,
        "data-orientation": "horizontal"
    }, sliderProps, {
        ref: composedRefs,
        style: _object_spread_props(_object_spread({}, sliderProps.style), _define_property({}, "--radix-slider-thumb-transform", "translateX(-50%)")),
        onSlideStart: function(event) {
            var value = getValueFromPointer(event.clientX);
            onSlideStart === null || onSlideStart === void 0 || onSlideStart(value);
        },
        onSlideMove: function(event) {
            var value = getValueFromPointer(event.clientX);
            onSlideMove === null || onSlideMove === void 0 || onSlideMove(value);
        },
        onSlideEnd: function() {
            rectRef.current = void 0;
            onSlideEnd === null || onSlideEnd === void 0 || onSlideEnd();
        },
        onStepKeyDown: function(event) {
            var slideDirection = isSlidingFromLeft ? "from-left" : "from-right";
            var isBackKey = $faa2e61a3361514f$var$BACK_KEYS[slideDirection].includes(event.key);
            onStepKeyDown === null || onStepKeyDown === void 0 || onStepKeyDown({
                event: event,
                direction: isBackKey ? -1 : 1
            });
        }
    })));
});
var $faa2e61a3361514f$var$SliderVertical = /* @__PURE__ */ $g1Vy2$forwardRef(function(props, forwardedRef) {
    var getValueFromPointer = function getValueFromPointer(pointerPosition) {
        var rect = rectRef.current || sliderRef.current.getBoundingClientRect();
        var input = [
            0,
            rect.height
        ];
        var output = isSlidingFromBottom ? [
            max,
            min
        ] : [
            min,
            max
        ];
        var value = $faa2e61a3361514f$var$linearScale(input, output);
        rectRef.current = rect;
        return value(pointerPosition - rect.top);
    };
    var min = props.min, max = props.max, inverted = props.inverted, onSlideStart = props.onSlideStart, onSlideMove = props.onSlideMove, onSlideEnd = props.onSlideEnd, onStepKeyDown = props.onStepKeyDown, sliderProps = _object_without_properties(props, [
        "min",
        "max",
        "inverted",
        "onSlideStart",
        "onSlideMove",
        "onSlideEnd",
        "onStepKeyDown"
    ]);
    var sliderRef = $g1Vy2$useRef(null);
    var ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, sliderRef);
    var rectRef = $g1Vy2$useRef();
    var isSlidingFromBottom = !inverted;
    return /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$SliderOrientationProvider, {
        scope: props.__scopeSlider,
        startEdge: isSlidingFromBottom ? "bottom" : "top",
        endEdge: isSlidingFromBottom ? "top" : "bottom",
        size: "height",
        direction: isSlidingFromBottom ? 1 : -1
    }, /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$SliderImpl, _extends({
        "data-orientation": "vertical"
    }, sliderProps, {
        ref: ref,
        style: _object_spread_props(_object_spread({}, sliderProps.style), _define_property({}, "--radix-slider-thumb-transform", "translateY(50%)")),
        onSlideStart: function(event) {
            var value = getValueFromPointer(event.clientY);
            onSlideStart === null || onSlideStart === void 0 || onSlideStart(value);
        },
        onSlideMove: function(event) {
            var value = getValueFromPointer(event.clientY);
            onSlideMove === null || onSlideMove === void 0 || onSlideMove(value);
        },
        onSlideEnd: function() {
            rectRef.current = void 0;
            onSlideEnd === null || onSlideEnd === void 0 || onSlideEnd();
        },
        onStepKeyDown: function(event) {
            var slideDirection = isSlidingFromBottom ? "from-bottom" : "from-top";
            var isBackKey = $faa2e61a3361514f$var$BACK_KEYS[slideDirection].includes(event.key);
            onStepKeyDown === null || onStepKeyDown === void 0 || onStepKeyDown({
                event: event,
                direction: isBackKey ? -1 : 1
            });
        }
    })));
});
var $faa2e61a3361514f$var$SliderImpl = /* @__PURE__ */ $g1Vy2$forwardRef(function(props, forwardedRef) {
    var __scopeSlider = props.__scopeSlider, onSlideStart = props.onSlideStart, onSlideMove = props.onSlideMove, onSlideEnd = props.onSlideEnd, onHomeKeyDown = props.onHomeKeyDown, onEndKeyDown = props.onEndKeyDown, onStepKeyDown = props.onStepKeyDown, sliderProps = _object_without_properties(props, [
        "__scopeSlider",
        "onSlideStart",
        "onSlideMove",
        "onSlideEnd",
        "onHomeKeyDown",
        "onEndKeyDown",
        "onStepKeyDown"
    ]);
    var context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$SLIDER_NAME, __scopeSlider);
    return /* @__PURE__ */ $g1Vy2$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, sliderProps, {
        ref: forwardedRef,
        onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, function(event) {
            if (event.key === "Home") {
                onHomeKeyDown(event);
                event.preventDefault();
            } else if (event.key === "End") {
                onEndKeyDown(event);
                event.preventDefault();
            } else if ($faa2e61a3361514f$var$PAGE_KEYS.concat($faa2e61a3361514f$var$ARROW_KEYS).includes(event.key)) {
                onStepKeyDown(event);
                event.preventDefault();
            }
        }),
        onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, function(event) {
            var target = event.target;
            target.setPointerCapture(event.pointerId);
            event.preventDefault();
            if (context.thumbs.has(target)) target.focus();
            else onSlideStart(event);
        }),
        onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, function(event) {
            var target = event.target;
            if (target.hasPointerCapture(event.pointerId)) onSlideMove(event);
        }),
        onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerUp, function(event) {
            var target = event.target;
            if (target.hasPointerCapture(event.pointerId)) {
                target.releasePointerCapture(event.pointerId);
                onSlideEnd(event);
            }
        })
    }));
});
var $faa2e61a3361514f$var$TRACK_NAME = "SliderTrack";
var $faa2e61a3361514f$export$105594979f116971 = /* @__PURE__ */ $g1Vy2$forwardRef(function(props, forwardedRef) {
    var __scopeSlider = props.__scopeSlider, trackProps = _object_without_properties(props, [
        "__scopeSlider"
    ]);
    var context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$TRACK_NAME, __scopeSlider);
    return /* @__PURE__ */ $g1Vy2$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
        "data-disabled": context.disabled ? "" : void 0,
        "data-orientation": context.orientation
    }, trackProps, {
        ref: forwardedRef
    }));
});
var $faa2e61a3361514f$var$RANGE_NAME = "SliderRange";
var $faa2e61a3361514f$export$a5cf38a7a000fe77 = /* @__PURE__ */ $g1Vy2$forwardRef(function(props, forwardedRef) {
    var _Math, _Math1;
    var __scopeSlider = props.__scopeSlider, rangeProps = _object_without_properties(props, [
        "__scopeSlider"
    ]);
    var context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$RANGE_NAME, __scopeSlider);
    var orientation = $faa2e61a3361514f$var$useSliderOrientationContext($faa2e61a3361514f$var$RANGE_NAME, __scopeSlider);
    var ref = $g1Vy2$useRef(null);
    var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
    var valuesCount = context.values.length;
    var percentages = context.values.map(function(value) {
        return $faa2e61a3361514f$var$convertValueToPercentage(value, context.min, context.max);
    });
    var offsetStart = valuesCount > 1 ? (_Math = Math).min.apply(_Math, _to_consumable_array(percentages)) : 0;
    var offsetEnd = 100 - (_Math1 = Math).max.apply(_Math1, _to_consumable_array(percentages));
    var _obj;
    return /* @__PURE__ */ $g1Vy2$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
        "data-orientation": context.orientation,
        "data-disabled": context.disabled ? "" : void 0
    }, rangeProps, {
        ref: composedRefs,
        style: _object_spread_props(_object_spread({}, props.style), (_obj = {}, _define_property(_obj, orientation.startEdge, offsetStart + "%"), _define_property(_obj, orientation.endEdge, offsetEnd + "%"), _obj))
    }));
});
var $faa2e61a3361514f$var$THUMB_NAME = "SliderThumb";
var $faa2e61a3361514f$export$2c1b491743890dec = /* @__PURE__ */ $g1Vy2$forwardRef(function(props, forwardedRef) {
    var getItems = $faa2e61a3361514f$var$useCollection(props.__scopeSlider);
    var _$g1Vy2$useState = _sliced_to_array($g1Vy2$useState(null), 2), thumb = _$g1Vy2$useState[0], setThumb = _$g1Vy2$useState[1];
    var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, function(node) {
        return setThumb(node);
    });
    var index = $g1Vy2$useMemo(function() {
        return thumb ? getItems().findIndex(function(item) {
            return item.ref.current === thumb;
        }) : -1;
    }, [
        getItems,
        thumb
    ]);
    return /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$SliderThumbImpl, _extends({}, props, {
        ref: composedRefs,
        index: index
    }));
});
var $faa2e61a3361514f$var$SliderThumbImpl = /* @__PURE__ */ $g1Vy2$forwardRef(function(props, forwardedRef) {
    var __scopeSlider = props.__scopeSlider, index = props.index, thumbProps = _object_without_properties(props, [
        "__scopeSlider",
        "index"
    ]);
    var context = $faa2e61a3361514f$var$useSliderContext($faa2e61a3361514f$var$THUMB_NAME, __scopeSlider);
    var orientation = $faa2e61a3361514f$var$useSliderOrientationContext($faa2e61a3361514f$var$THUMB_NAME, __scopeSlider);
    var _$g1Vy2$useState = _sliced_to_array($g1Vy2$useState(null), 2), thumb = _$g1Vy2$useState[0], setThumb = _$g1Vy2$useState[1];
    var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, function(node) {
        return setThumb(node);
    });
    var size = $db6c3485150b8e66$export$1ab7ae714698c4b8(thumb);
    var value = context.values[index];
    var percent = value === void 0 ? 0 : $faa2e61a3361514f$var$convertValueToPercentage(value, context.min, context.max);
    var label = $faa2e61a3361514f$var$getLabel(index, context.values.length);
    var orientationSize = size === null || size === void 0 ? void 0 : size[orientation.size];
    var thumbInBoundsOffset = orientationSize ? $faa2e61a3361514f$var$getThumbInBoundsOffset(orientationSize, percent, orientation.direction) : 0;
    $g1Vy2$useEffect(function() {
        if (thumb) {
            context.thumbs.add(thumb);
            return function() {
                context.thumbs.delete(thumb);
            };
        }
    }, [
        thumb,
        context.thumbs
    ]);
    return /* @__PURE__ */ $g1Vy2$createElement("span", {
        style: _define_property({
            transform: "var(--radix-slider-thumb-transform)",
            position: "absolute"
        }, orientation.startEdge, "calc(".concat(percent, "% + ").concat(thumbInBoundsOffset, "px)"))
    }, /* @__PURE__ */ $g1Vy2$createElement($faa2e61a3361514f$var$Collection.ItemSlot, {
        scope: props.__scopeSlider
    }, /* @__PURE__ */ $g1Vy2$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
        role: "slider",
        "aria-label": props["aria-label"] || label,
        "aria-valuemin": context.min,
        "aria-valuenow": value,
        "aria-valuemax": context.max,
        "aria-orientation": context.orientation,
        "data-orientation": context.orientation,
        "data-disabled": context.disabled ? "" : void 0,
        tabIndex: context.disabled ? void 0 : 0
    }, thumbProps, {
        ref: composedRefs,
        style: value === void 0 ? {
            display: "none"
        } : props.style,
        onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, function() {
            context.valueIndexToChangeRef.current = index;
        })
    }))));
});
var $faa2e61a3361514f$var$BubbleInput = function(props) {
    var value = props.value, inputProps = _object_without_properties(props, [
        "value"
    ]);
    var ref = $g1Vy2$useRef(null);
    var prevValue = $010c2913dbd2fe3d$export$5cae361ad82dce8b(value);
    $g1Vy2$useEffect(function() {
        var input = ref.current;
        var inputProto = window.HTMLInputElement.prototype;
        var descriptor = Object.getOwnPropertyDescriptor(inputProto, "value");
        var setValue = descriptor.set;
        if (prevValue !== value && setValue) {
            var event = new Event("input", {
                bubbles: true
            });
            setValue.call(input, value);
            input.dispatchEvent(event);
        }
    }, [
        prevValue,
        value
    ]);
    return /* @__PURE__ */ $g1Vy2$createElement("input", _extends({
        style: {
            display: "none"
        }
    }, inputProps, {
        ref: ref,
        defaultValue: value
    }));
};
function $faa2e61a3361514f$var$getNextSortedValues() {
    var prevValues = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], nextValue = arguments.length > 1 ? arguments[1] : void 0, atIndex = arguments.length > 2 ? arguments[2] : void 0;
    var nextValues = _to_consumable_array(prevValues);
    nextValues[atIndex] = nextValue;
    return nextValues.sort(function(a, b) {
        return a - b;
    });
}
function $faa2e61a3361514f$var$convertValueToPercentage(value, min, max) {
    var maxSteps = max - min;
    var percentPerStep = 100 / maxSteps;
    var percentage = percentPerStep * (value - min);
    return $ae6933e535247d3d$export$7d15b64cf5a3a4c4(percentage, [
        0,
        100
    ]);
}
function $faa2e61a3361514f$var$getLabel(index, totalValues) {
    if (totalValues > 2) return "Value ".concat(index + 1, " of ").concat(totalValues);
    else if (totalValues === 2) return [
        "Minimum",
        "Maximum"
    ][index];
    else return void 0;
}
function $faa2e61a3361514f$var$getClosestValueIndex(values, nextValue) {
    var _Math;
    if (values.length === 1) return 0;
    var distances = values.map(function(value) {
        return Math.abs(value - nextValue);
    });
    var closestDistance = (_Math = Math).min.apply(_Math, _to_consumable_array(distances));
    return distances.indexOf(closestDistance);
}
function $faa2e61a3361514f$var$getThumbInBoundsOffset(width, left, direction) {
    var halfWidth = width / 2;
    var halfPercent = 50;
    var offset = $faa2e61a3361514f$var$linearScale([
        0,
        halfPercent
    ], [
        0,
        halfWidth
    ]);
    return (halfWidth - offset(left) * direction) * direction;
}
function $faa2e61a3361514f$var$getStepsBetweenValues(values) {
    return values.slice(0, -1).map(function(value, index) {
        return values[index + 1] - value;
    });
}
function $faa2e61a3361514f$var$hasMinStepsBetweenValues(values, minStepsBetweenValues) {
    if (minStepsBetweenValues > 0) {
        var _Math;
        var stepsBetweenValues = $faa2e61a3361514f$var$getStepsBetweenValues(values);
        var actualMinStepsBetweenValues = (_Math = Math).min.apply(_Math, _to_consumable_array(stepsBetweenValues));
        return actualMinStepsBetweenValues >= minStepsBetweenValues;
    }
    return true;
}
function $faa2e61a3361514f$var$linearScale(input, output) {
    return function(value) {
        if (input[0] === input[1] || output[0] === output[1]) return output[0];
        var ratio = (output[1] - output[0]) / (input[1] - input[0]);
        return output[0] + ratio * (value - input[0]);
    };
}
function $faa2e61a3361514f$var$getDecimalCount(value) {
    return (String(value).split(".")[1] || "").length;
}
function $faa2e61a3361514f$var$roundValue(value, decimalCount) {
    var rounder = Math.pow(10, decimalCount);
    return Math.round(value * rounder) / rounder;
}
var $faa2e61a3361514f$export$be92b6f5f03c0fe9 = $faa2e61a3361514f$export$472062a354075cee;
var $faa2e61a3361514f$export$13921ac0cc260818 = $faa2e61a3361514f$export$105594979f116971;
var $faa2e61a3361514f$export$9a58ef0d7ad3278c = $faa2e61a3361514f$export$a5cf38a7a000fe77;
var $faa2e61a3361514f$export$6521433ed15a34db = $faa2e61a3361514f$export$2c1b491743890dec;
// lib/utils.ts
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";
function cn() {
    for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
        inputs[_key] = arguments[_key];
    }
    return twMerge(clsx(inputs));
}
// registry/default/ui/slider.tsx
import { jsx, jsxs } from "react/jsx-runtime";
var Slider = React.forwardRef(function(_param, ref) {
    var className = _param.className, props = _object_without_properties(_param, [
        "className"
    ]);
    return /* @__PURE__ */ jsxs($faa2e61a3361514f$export$be92b6f5f03c0fe9, _object_spread_props(_object_spread({
        ref: ref,
        className: cn("relative flex w-full touch-none select-none items-center", className)
    }, props), {
        children: [
            /* @__PURE__ */ jsx($faa2e61a3361514f$export$13921ac0cc260818, {
                className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",
                children: /* @__PURE__ */ jsx($faa2e61a3361514f$export$9a58ef0d7ad3278c, {
                    className: "absolute h-full bg-primary"
                })
            }),
            /* @__PURE__ */ jsx($faa2e61a3361514f$export$6521433ed15a34db, {
                className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
            })
        ]
    }));
});
Slider.displayName = $faa2e61a3361514f$export$be92b6f5f03c0fe9.displayName;
export { Slider };
//# sourceMappingURL=slider.mjs.map