@windrun-huaiin/third-ui 5.13.6 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fuma/mdx/index.js +429 -2676
- package/dist/fuma/mdx/index.js.map +1 -1
- package/dist/fuma/mdx/index.mjs +429 -2676
- package/dist/fuma/mdx/index.mjs.map +1 -1
- package/dist/fuma/server.js +206 -2465
- package/dist/fuma/server.js.map +1 -1
- package/dist/fuma/server.mjs +203 -2462
- package/dist/fuma/server.mjs.map +1 -1
- package/package.json +1 -1
- package/src/fuma/mdx/mermaid.tsx +14 -13
package/dist/fuma/mdx/index.mjs
CHANGED
|
@@ -2694,2477 +2694,21 @@ for (const [iconName, IconComponent] of Object.entries(BUILTIN_ICON_COMPONENTS))
|
|
|
2694
2694
|
var wrappedBuiltinIconsPart = tempWrappedBuiltinIcons;
|
|
2695
2695
|
var globalLucideIcons = __spreadValues(__spreadValues({}, styledLimitedIconsPart), wrappedBuiltinIconsPart);
|
|
2696
2696
|
|
|
2697
|
-
// ../base-ui/src/ui/alert-dialog.tsx
|
|
2698
|
-
import * as React57 from "react";
|
|
2699
|
-
|
|
2700
|
-
// ../../node_modules/.pnpm/@radix-ui+react-alert-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types_c6ff7006a888f63e36d2502e019661c3/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
|
|
2701
|
-
import * as React55 from "react";
|
|
2702
|
-
|
|
2703
|
-
// ../../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
2704
|
-
import * as React33 from "react";
|
|
2705
|
-
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2706
|
-
function createContext2(rootComponentName, defaultContext) {
|
|
2707
|
-
const Context = React33.createContext(defaultContext);
|
|
2708
|
-
const Provider = (props) => {
|
|
2709
|
-
const _a = props, { children } = _a, context = __objRest(_a, ["children"]);
|
|
2710
|
-
const value = React33.useMemo(() => context, Object.values(context));
|
|
2711
|
-
return /* @__PURE__ */ jsx33(Context.Provider, { value, children });
|
|
2712
|
-
};
|
|
2713
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
2714
|
-
function useContext22(consumerName) {
|
|
2715
|
-
const context = React33.useContext(Context);
|
|
2716
|
-
if (context) return context;
|
|
2717
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
2718
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
2719
|
-
}
|
|
2720
|
-
return [Provider, useContext22];
|
|
2721
|
-
}
|
|
2722
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
2723
|
-
let defaultContexts = [];
|
|
2724
|
-
function createContext32(rootComponentName, defaultContext) {
|
|
2725
|
-
const BaseContext = React33.createContext(defaultContext);
|
|
2726
|
-
const index = defaultContexts.length;
|
|
2727
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
2728
|
-
const Provider = (props) => {
|
|
2729
|
-
var _b;
|
|
2730
|
-
const _a = props, { scope, children } = _a, context = __objRest(_a, ["scope", "children"]);
|
|
2731
|
-
const Context = ((_b = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _b[index]) || BaseContext;
|
|
2732
|
-
const value = React33.useMemo(() => context, Object.values(context));
|
|
2733
|
-
return /* @__PURE__ */ jsx33(Context.Provider, { value, children });
|
|
2734
|
-
};
|
|
2735
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
2736
|
-
function useContext22(consumerName, scope) {
|
|
2737
|
-
var _a;
|
|
2738
|
-
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index]) || BaseContext;
|
|
2739
|
-
const context = React33.useContext(Context);
|
|
2740
|
-
if (context) return context;
|
|
2741
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
2742
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
2743
|
-
}
|
|
2744
|
-
return [Provider, useContext22];
|
|
2745
|
-
}
|
|
2746
|
-
const createScope = () => {
|
|
2747
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
2748
|
-
return React33.createContext(defaultContext);
|
|
2749
|
-
});
|
|
2750
|
-
return function useScope(scope) {
|
|
2751
|
-
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
2752
|
-
return React33.useMemo(
|
|
2753
|
-
() => ({ [`__scope${scopeName}`]: __spreadProps(__spreadValues({}, scope), { [scopeName]: contexts }) }),
|
|
2754
|
-
[scope, contexts]
|
|
2755
|
-
);
|
|
2756
|
-
};
|
|
2757
|
-
};
|
|
2758
|
-
createScope.scopeName = scopeName;
|
|
2759
|
-
return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
2760
|
-
}
|
|
2761
|
-
function composeContextScopes(...scopes) {
|
|
2762
|
-
const baseScope = scopes[0];
|
|
2763
|
-
if (scopes.length === 1) return baseScope;
|
|
2764
|
-
const createScope = () => {
|
|
2765
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
2766
|
-
useScope: createScope2(),
|
|
2767
|
-
scopeName: createScope2.scopeName
|
|
2768
|
-
}));
|
|
2769
|
-
return function useComposedScopes(overrideScopes) {
|
|
2770
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
2771
|
-
const scopeProps = useScope(overrideScopes);
|
|
2772
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
2773
|
-
return __spreadValues(__spreadValues({}, nextScopes2), currentScope);
|
|
2774
|
-
}, {});
|
|
2775
|
-
return React33.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
2776
|
-
};
|
|
2777
|
-
};
|
|
2778
|
-
createScope.scopeName = baseScope.scopeName;
|
|
2779
|
-
return createScope;
|
|
2780
|
-
}
|
|
2781
|
-
|
|
2782
|
-
// ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
2783
|
-
import * as React34 from "react";
|
|
2784
|
-
function setRef(ref, value) {
|
|
2785
|
-
if (typeof ref === "function") {
|
|
2786
|
-
return ref(value);
|
|
2787
|
-
} else if (ref !== null && ref !== void 0) {
|
|
2788
|
-
ref.current = value;
|
|
2789
|
-
}
|
|
2790
|
-
}
|
|
2791
|
-
function composeRefs(...refs) {
|
|
2792
|
-
return (node) => {
|
|
2793
|
-
let hasCleanup = false;
|
|
2794
|
-
const cleanups = refs.map((ref) => {
|
|
2795
|
-
const cleanup = setRef(ref, node);
|
|
2796
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
2797
|
-
hasCleanup = true;
|
|
2798
|
-
}
|
|
2799
|
-
return cleanup;
|
|
2800
|
-
});
|
|
2801
|
-
if (hasCleanup) {
|
|
2802
|
-
return () => {
|
|
2803
|
-
for (let i = 0; i < cleanups.length; i++) {
|
|
2804
|
-
const cleanup = cleanups[i];
|
|
2805
|
-
if (typeof cleanup == "function") {
|
|
2806
|
-
cleanup();
|
|
2807
|
-
} else {
|
|
2808
|
-
setRef(refs[i], null);
|
|
2809
|
-
}
|
|
2810
|
-
}
|
|
2811
|
-
};
|
|
2812
|
-
}
|
|
2813
|
-
};
|
|
2814
|
-
}
|
|
2815
|
-
function useComposedRefs(...refs) {
|
|
2816
|
-
return React34.useCallback(composeRefs(...refs), refs);
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
// ../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types+react_848f83211ce5e4d8275fe0d3e11a9387/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
2820
|
-
import * as React54 from "react";
|
|
2821
|
-
|
|
2822
|
-
// ../../node_modules/.pnpm/@radix-ui+primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.mjs
|
|
2823
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
2824
|
-
return function handleEvent(event) {
|
|
2825
|
-
originalEventHandler == null ? void 0 : originalEventHandler(event);
|
|
2826
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
2827
|
-
return ourEventHandler == null ? void 0 : ourEventHandler(event);
|
|
2828
|
-
}
|
|
2829
|
-
};
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
2833
|
-
import * as React36 from "react";
|
|
2834
|
-
|
|
2835
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
2836
|
-
import * as React35 from "react";
|
|
2837
|
-
var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? React35.useLayoutEffect : () => {
|
|
2838
|
-
};
|
|
2839
|
-
|
|
2840
|
-
// ../../node_modules/.pnpm/@radix-ui+react-id@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
2841
|
-
var useReactId = React36[" useId ".trim().toString()] || (() => void 0);
|
|
2842
|
-
var count = 0;
|
|
2843
|
-
function useId(deterministicId) {
|
|
2844
|
-
const [id, setId] = React36.useState(useReactId());
|
|
2845
|
-
useLayoutEffect2(() => {
|
|
2846
|
-
if (!deterministicId) setId((reactId) => reactId != null ? reactId : String(count++));
|
|
2847
|
-
}, [deterministicId]);
|
|
2848
|
-
return deterministicId || (id ? `radix-${id}` : "");
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
2852
|
-
import * as React37 from "react";
|
|
2853
|
-
import * as React210 from "react";
|
|
2854
|
-
var useInsertionEffect = React37[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
2855
|
-
function useControllableState({
|
|
2856
|
-
prop,
|
|
2857
|
-
defaultProp,
|
|
2858
|
-
onChange = () => {
|
|
2859
|
-
},
|
|
2860
|
-
caller
|
|
2861
|
-
}) {
|
|
2862
|
-
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
2863
|
-
defaultProp,
|
|
2864
|
-
onChange
|
|
2865
|
-
});
|
|
2866
|
-
const isControlled = prop !== void 0;
|
|
2867
|
-
const value = isControlled ? prop : uncontrolledProp;
|
|
2868
|
-
if (true) {
|
|
2869
|
-
const isControlledRef = React37.useRef(prop !== void 0);
|
|
2870
|
-
React37.useEffect(() => {
|
|
2871
|
-
const wasControlled = isControlledRef.current;
|
|
2872
|
-
if (wasControlled !== isControlled) {
|
|
2873
|
-
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
2874
|
-
const to = isControlled ? "controlled" : "uncontrolled";
|
|
2875
|
-
console.warn(
|
|
2876
|
-
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
2877
|
-
);
|
|
2878
|
-
}
|
|
2879
|
-
isControlledRef.current = isControlled;
|
|
2880
|
-
}, [isControlled, caller]);
|
|
2881
|
-
}
|
|
2882
|
-
const setValue = React37.useCallback(
|
|
2883
|
-
(nextValue) => {
|
|
2884
|
-
var _a;
|
|
2885
|
-
if (isControlled) {
|
|
2886
|
-
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
2887
|
-
if (value2 !== prop) {
|
|
2888
|
-
(_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value2);
|
|
2889
|
-
}
|
|
2890
|
-
} else {
|
|
2891
|
-
setUncontrolledProp(nextValue);
|
|
2892
|
-
}
|
|
2893
|
-
},
|
|
2894
|
-
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
2895
|
-
);
|
|
2896
|
-
return [value, setValue];
|
|
2897
|
-
}
|
|
2898
|
-
function useUncontrolledState({
|
|
2899
|
-
defaultProp,
|
|
2900
|
-
onChange
|
|
2901
|
-
}) {
|
|
2902
|
-
const [value, setValue] = React37.useState(defaultProp);
|
|
2903
|
-
const prevValueRef = React37.useRef(value);
|
|
2904
|
-
const onChangeRef = React37.useRef(onChange);
|
|
2905
|
-
useInsertionEffect(() => {
|
|
2906
|
-
onChangeRef.current = onChange;
|
|
2907
|
-
}, [onChange]);
|
|
2908
|
-
React37.useEffect(() => {
|
|
2909
|
-
var _a;
|
|
2910
|
-
if (prevValueRef.current !== value) {
|
|
2911
|
-
(_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value);
|
|
2912
|
-
prevValueRef.current = value;
|
|
2913
|
-
}
|
|
2914
|
-
}, [value, prevValueRef]);
|
|
2915
|
-
return [value, setValue, onChangeRef];
|
|
2916
|
-
}
|
|
2917
|
-
function isFunction(value) {
|
|
2918
|
-
return typeof value === "function";
|
|
2919
|
-
}
|
|
2920
|
-
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
2921
|
-
|
|
2922
|
-
// ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.3_@types+react@19.1.2__@_048ea5800fbfacb7489e4b7d728b493c/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
2923
|
-
import * as React42 from "react";
|
|
2924
|
-
|
|
2925
|
-
// ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.3_@types+react@19.1.2__@types+rea_43250ccbc78c27b15284efcf829a65d5/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
2926
|
-
import * as React39 from "react";
|
|
2927
|
-
import * as ReactDOM from "react-dom";
|
|
2928
|
-
|
|
2929
|
-
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
2930
|
-
import * as React38 from "react";
|
|
2931
|
-
import { Fragment as Fragment2, jsx as jsx34 } from "react/jsx-runtime";
|
|
2932
|
-
// @__NO_SIDE_EFFECTS__
|
|
2933
|
-
function createSlot(ownerName) {
|
|
2934
|
-
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
2935
|
-
const Slot22 = React38.forwardRef((props, forwardedRef) => {
|
|
2936
|
-
const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
|
|
2937
|
-
const childrenArray = React38.Children.toArray(children);
|
|
2938
|
-
const slottable = childrenArray.find(isSlottable);
|
|
2939
|
-
if (slottable) {
|
|
2940
|
-
const newElement = slottable.props.children;
|
|
2941
|
-
const newChildren = childrenArray.map((child) => {
|
|
2942
|
-
if (child === slottable) {
|
|
2943
|
-
if (React38.Children.count(newElement) > 1) return React38.Children.only(null);
|
|
2944
|
-
return React38.isValidElement(newElement) ? newElement.props.children : null;
|
|
2945
|
-
} else {
|
|
2946
|
-
return child;
|
|
2947
|
-
}
|
|
2948
|
-
});
|
|
2949
|
-
return /* @__PURE__ */ jsx34(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: React38.isValidElement(newElement) ? React38.cloneElement(newElement, void 0, newChildren) : null }));
|
|
2950
|
-
}
|
|
2951
|
-
return /* @__PURE__ */ jsx34(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
|
|
2952
|
-
});
|
|
2953
|
-
Slot22.displayName = `${ownerName}.Slot`;
|
|
2954
|
-
return Slot22;
|
|
2955
|
-
}
|
|
2956
|
-
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
2957
|
-
// @__NO_SIDE_EFFECTS__
|
|
2958
|
-
function createSlotClone(ownerName) {
|
|
2959
|
-
const SlotClone = React38.forwardRef((props, forwardedRef) => {
|
|
2960
|
-
const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
|
|
2961
|
-
if (React38.isValidElement(children)) {
|
|
2962
|
-
const childrenRef = getElementRef(children);
|
|
2963
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
2964
|
-
if (children.type !== React38.Fragment) {
|
|
2965
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
2966
|
-
}
|
|
2967
|
-
return React38.cloneElement(children, props2);
|
|
2968
|
-
}
|
|
2969
|
-
return React38.Children.count(children) > 1 ? React38.Children.only(null) : null;
|
|
2970
|
-
});
|
|
2971
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
2972
|
-
return SlotClone;
|
|
2973
|
-
}
|
|
2974
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
2975
|
-
// @__NO_SIDE_EFFECTS__
|
|
2976
|
-
function createSlottable(ownerName) {
|
|
2977
|
-
const Slottable2 = ({ children }) => {
|
|
2978
|
-
return /* @__PURE__ */ jsx34(Fragment2, { children });
|
|
2979
|
-
};
|
|
2980
|
-
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
2981
|
-
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
2982
|
-
return Slottable2;
|
|
2983
|
-
}
|
|
2984
|
-
function isSlottable(child) {
|
|
2985
|
-
return React38.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
2986
|
-
}
|
|
2987
|
-
function mergeProps(slotProps, childProps) {
|
|
2988
|
-
const overrideProps = __spreadValues({}, childProps);
|
|
2989
|
-
for (const propName in childProps) {
|
|
2990
|
-
const slotPropValue = slotProps[propName];
|
|
2991
|
-
const childPropValue = childProps[propName];
|
|
2992
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
2993
|
-
if (isHandler) {
|
|
2994
|
-
if (slotPropValue && childPropValue) {
|
|
2995
|
-
overrideProps[propName] = (...args) => {
|
|
2996
|
-
const result = childPropValue(...args);
|
|
2997
|
-
slotPropValue(...args);
|
|
2998
|
-
return result;
|
|
2999
|
-
};
|
|
3000
|
-
} else if (slotPropValue) {
|
|
3001
|
-
overrideProps[propName] = slotPropValue;
|
|
3002
|
-
}
|
|
3003
|
-
} else if (propName === "style") {
|
|
3004
|
-
overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
|
|
3005
|
-
} else if (propName === "className") {
|
|
3006
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
3007
|
-
}
|
|
3008
|
-
}
|
|
3009
|
-
return __spreadValues(__spreadValues({}, slotProps), overrideProps);
|
|
3010
|
-
}
|
|
3011
|
-
function getElementRef(element) {
|
|
3012
|
-
var _a, _b;
|
|
3013
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
3014
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
3015
|
-
if (mayWarn) {
|
|
3016
|
-
return element.ref;
|
|
3017
|
-
}
|
|
3018
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
3019
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
3020
|
-
if (mayWarn) {
|
|
3021
|
-
return element.props.ref;
|
|
3022
|
-
}
|
|
3023
|
-
return element.props.ref || element.ref;
|
|
3024
|
-
}
|
|
3025
|
-
|
|
3026
|
-
// ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.3_@types+react@19.1.2__@types+rea_43250ccbc78c27b15284efcf829a65d5/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
3027
|
-
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3028
|
-
var NODES = [
|
|
3029
|
-
"a",
|
|
3030
|
-
"button",
|
|
3031
|
-
"div",
|
|
3032
|
-
"form",
|
|
3033
|
-
"h2",
|
|
3034
|
-
"h3",
|
|
3035
|
-
"img",
|
|
3036
|
-
"input",
|
|
3037
|
-
"label",
|
|
3038
|
-
"li",
|
|
3039
|
-
"nav",
|
|
3040
|
-
"ol",
|
|
3041
|
-
"p",
|
|
3042
|
-
"select",
|
|
3043
|
-
"span",
|
|
3044
|
-
"svg",
|
|
3045
|
-
"ul"
|
|
3046
|
-
];
|
|
3047
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
3048
|
-
const Slot3 = createSlot(`Primitive.${node}`);
|
|
3049
|
-
const Node2 = React39.forwardRef((props, forwardedRef) => {
|
|
3050
|
-
const _a = props, { asChild } = _a, primitiveProps = __objRest(_a, ["asChild"]);
|
|
3051
|
-
const Comp = asChild ? Slot3 : node;
|
|
3052
|
-
if (typeof window !== "undefined") {
|
|
3053
|
-
window[Symbol.for("radix-ui")] = true;
|
|
3054
|
-
}
|
|
3055
|
-
return /* @__PURE__ */ jsx35(Comp, __spreadProps(__spreadValues({}, primitiveProps), { ref: forwardedRef }));
|
|
3056
|
-
});
|
|
3057
|
-
Node2.displayName = `Primitive.${node}`;
|
|
3058
|
-
return __spreadProps(__spreadValues({}, primitive), { [node]: Node2 });
|
|
3059
|
-
}, {});
|
|
3060
|
-
function dispatchDiscreteCustomEvent(target, event) {
|
|
3061
|
-
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
3062
|
-
}
|
|
3063
|
-
|
|
3064
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
3065
|
-
import * as React40 from "react";
|
|
3066
|
-
function useCallbackRef(callback) {
|
|
3067
|
-
const callbackRef = React40.useRef(callback);
|
|
3068
|
-
React40.useEffect(() => {
|
|
3069
|
-
callbackRef.current = callback;
|
|
3070
|
-
});
|
|
3071
|
-
return React40.useMemo(() => (...args) => {
|
|
3072
|
-
var _a;
|
|
3073
|
-
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
3074
|
-
}, []);
|
|
3075
|
-
}
|
|
3076
|
-
|
|
3077
|
-
// ../../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.1.1_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
3078
|
-
import * as React41 from "react";
|
|
3079
|
-
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
3080
|
-
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
3081
|
-
React41.useEffect(() => {
|
|
3082
|
-
const handleKeyDown = (event) => {
|
|
3083
|
-
if (event.key === "Escape") {
|
|
3084
|
-
onEscapeKeyDown(event);
|
|
3085
|
-
}
|
|
3086
|
-
};
|
|
3087
|
-
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
3088
|
-
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
3089
|
-
}, [onEscapeKeyDown, ownerDocument]);
|
|
3090
|
-
}
|
|
3091
|
-
|
|
3092
|
-
// ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.1.10_@types+react-dom@19.1.3_@types+react@19.1.2__@_048ea5800fbfacb7489e4b7d728b493c/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
3093
|
-
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3094
|
-
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
3095
|
-
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
3096
|
-
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
3097
|
-
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
3098
|
-
var originalBodyPointerEvents;
|
|
3099
|
-
var DismissableLayerContext = React42.createContext({
|
|
3100
|
-
layers: /* @__PURE__ */ new Set(),
|
|
3101
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
3102
|
-
branches: /* @__PURE__ */ new Set()
|
|
3103
|
-
});
|
|
3104
|
-
var DismissableLayer = React42.forwardRef(
|
|
3105
|
-
(props, forwardedRef) => {
|
|
3106
|
-
var _b;
|
|
3107
|
-
const _a = props, {
|
|
3108
|
-
disableOutsidePointerEvents = false,
|
|
3109
|
-
onEscapeKeyDown,
|
|
3110
|
-
onPointerDownOutside,
|
|
3111
|
-
onFocusOutside,
|
|
3112
|
-
onInteractOutside,
|
|
3113
|
-
onDismiss
|
|
3114
|
-
} = _a, layerProps = __objRest(_a, [
|
|
3115
|
-
"disableOutsidePointerEvents",
|
|
3116
|
-
"onEscapeKeyDown",
|
|
3117
|
-
"onPointerDownOutside",
|
|
3118
|
-
"onFocusOutside",
|
|
3119
|
-
"onInteractOutside",
|
|
3120
|
-
"onDismiss"
|
|
3121
|
-
]);
|
|
3122
|
-
const context = React42.useContext(DismissableLayerContext);
|
|
3123
|
-
const [node, setNode] = React42.useState(null);
|
|
3124
|
-
const ownerDocument = (_b = node == null ? void 0 : node.ownerDocument) != null ? _b : globalThis == null ? void 0 : globalThis.document;
|
|
3125
|
-
const [, force] = React42.useState({});
|
|
3126
|
-
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
3127
|
-
const layers = Array.from(context.layers);
|
|
3128
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
3129
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
3130
|
-
const index = node ? layers.indexOf(node) : -1;
|
|
3131
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
3132
|
-
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
3133
|
-
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
3134
|
-
const target = event.target;
|
|
3135
|
-
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
3136
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
3137
|
-
onPointerDownOutside == null ? void 0 : onPointerDownOutside(event);
|
|
3138
|
-
onInteractOutside == null ? void 0 : onInteractOutside(event);
|
|
3139
|
-
if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
|
|
3140
|
-
}, ownerDocument);
|
|
3141
|
-
const focusOutside = useFocusOutside((event) => {
|
|
3142
|
-
const target = event.target;
|
|
3143
|
-
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
3144
|
-
if (isFocusInBranch) return;
|
|
3145
|
-
onFocusOutside == null ? void 0 : onFocusOutside(event);
|
|
3146
|
-
onInteractOutside == null ? void 0 : onInteractOutside(event);
|
|
3147
|
-
if (!event.defaultPrevented) onDismiss == null ? void 0 : onDismiss();
|
|
3148
|
-
}, ownerDocument);
|
|
3149
|
-
useEscapeKeydown((event) => {
|
|
3150
|
-
const isHighestLayer = index === context.layers.size - 1;
|
|
3151
|
-
if (!isHighestLayer) return;
|
|
3152
|
-
onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(event);
|
|
3153
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
3154
|
-
event.preventDefault();
|
|
3155
|
-
onDismiss();
|
|
3156
|
-
}
|
|
3157
|
-
}, ownerDocument);
|
|
3158
|
-
React42.useEffect(() => {
|
|
3159
|
-
if (!node) return;
|
|
3160
|
-
if (disableOutsidePointerEvents) {
|
|
3161
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
3162
|
-
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
3163
|
-
ownerDocument.body.style.pointerEvents = "none";
|
|
3164
|
-
}
|
|
3165
|
-
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
3166
|
-
}
|
|
3167
|
-
context.layers.add(node);
|
|
3168
|
-
dispatchUpdate();
|
|
3169
|
-
return () => {
|
|
3170
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
|
3171
|
-
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
3172
|
-
}
|
|
3173
|
-
};
|
|
3174
|
-
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
3175
|
-
React42.useEffect(() => {
|
|
3176
|
-
return () => {
|
|
3177
|
-
if (!node) return;
|
|
3178
|
-
context.layers.delete(node);
|
|
3179
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
3180
|
-
dispatchUpdate();
|
|
3181
|
-
};
|
|
3182
|
-
}, [node, context]);
|
|
3183
|
-
React42.useEffect(() => {
|
|
3184
|
-
const handleUpdate = () => force({});
|
|
3185
|
-
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3186
|
-
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3187
|
-
}, []);
|
|
3188
|
-
return /* @__PURE__ */ jsx36(
|
|
3189
|
-
Primitive.div,
|
|
3190
|
-
__spreadProps(__spreadValues({}, layerProps), {
|
|
3191
|
-
ref: composedRefs,
|
|
3192
|
-
style: __spreadValues({
|
|
3193
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0
|
|
3194
|
-
}, props.style),
|
|
3195
|
-
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
3196
|
-
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
3197
|
-
onPointerDownCapture: composeEventHandlers(
|
|
3198
|
-
props.onPointerDownCapture,
|
|
3199
|
-
pointerDownOutside.onPointerDownCapture
|
|
3200
|
-
)
|
|
3201
|
-
})
|
|
3202
|
-
);
|
|
3203
|
-
}
|
|
3204
|
-
);
|
|
3205
|
-
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
3206
|
-
var BRANCH_NAME = "DismissableLayerBranch";
|
|
3207
|
-
var DismissableLayerBranch = React42.forwardRef((props, forwardedRef) => {
|
|
3208
|
-
const context = React42.useContext(DismissableLayerContext);
|
|
3209
|
-
const ref = React42.useRef(null);
|
|
3210
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3211
|
-
React42.useEffect(() => {
|
|
3212
|
-
const node = ref.current;
|
|
3213
|
-
if (node) {
|
|
3214
|
-
context.branches.add(node);
|
|
3215
|
-
return () => {
|
|
3216
|
-
context.branches.delete(node);
|
|
3217
|
-
};
|
|
3218
|
-
}
|
|
3219
|
-
}, [context.branches]);
|
|
3220
|
-
return /* @__PURE__ */ jsx36(Primitive.div, __spreadProps(__spreadValues({}, props), { ref: composedRefs }));
|
|
3221
|
-
});
|
|
3222
|
-
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
3223
|
-
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
3224
|
-
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
3225
|
-
const isPointerInsideReactTreeRef = React42.useRef(false);
|
|
3226
|
-
const handleClickRef = React42.useRef(() => {
|
|
3227
|
-
});
|
|
3228
|
-
React42.useEffect(() => {
|
|
3229
|
-
const handlePointerDown = (event) => {
|
|
3230
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
3231
|
-
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
3232
|
-
handleAndDispatchCustomEvent(
|
|
3233
|
-
POINTER_DOWN_OUTSIDE,
|
|
3234
|
-
handlePointerDownOutside,
|
|
3235
|
-
eventDetail,
|
|
3236
|
-
{ discrete: true }
|
|
3237
|
-
);
|
|
3238
|
-
};
|
|
3239
|
-
var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
|
|
3240
|
-
const eventDetail = { originalEvent: event };
|
|
3241
|
-
if (event.pointerType === "touch") {
|
|
3242
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
3243
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
3244
|
-
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
3245
|
-
} else {
|
|
3246
|
-
handleAndDispatchPointerDownOutsideEvent2();
|
|
3247
|
-
}
|
|
3248
|
-
} else {
|
|
3249
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
3250
|
-
}
|
|
3251
|
-
isPointerInsideReactTreeRef.current = false;
|
|
3252
|
-
};
|
|
3253
|
-
const timerId = window.setTimeout(() => {
|
|
3254
|
-
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
3255
|
-
}, 0);
|
|
3256
|
-
return () => {
|
|
3257
|
-
window.clearTimeout(timerId);
|
|
3258
|
-
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
3259
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
3260
|
-
};
|
|
3261
|
-
}, [ownerDocument, handlePointerDownOutside]);
|
|
3262
|
-
return {
|
|
3263
|
-
// ensures we check React component tree (not just DOM tree)
|
|
3264
|
-
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
3265
|
-
};
|
|
3266
|
-
}
|
|
3267
|
-
function useFocusOutside(onFocusOutside, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
3268
|
-
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
3269
|
-
const isFocusInsideReactTreeRef = React42.useRef(false);
|
|
3270
|
-
React42.useEffect(() => {
|
|
3271
|
-
const handleFocus = (event) => {
|
|
3272
|
-
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
3273
|
-
const eventDetail = { originalEvent: event };
|
|
3274
|
-
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
3275
|
-
discrete: false
|
|
3276
|
-
});
|
|
3277
|
-
}
|
|
3278
|
-
};
|
|
3279
|
-
ownerDocument.addEventListener("focusin", handleFocus);
|
|
3280
|
-
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
3281
|
-
}, [ownerDocument, handleFocusOutside]);
|
|
3282
|
-
return {
|
|
3283
|
-
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
3284
|
-
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
3285
|
-
};
|
|
3286
|
-
}
|
|
3287
|
-
function dispatchUpdate() {
|
|
3288
|
-
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
3289
|
-
document.dispatchEvent(event);
|
|
3290
|
-
}
|
|
3291
|
-
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
3292
|
-
const target = detail.originalEvent.target;
|
|
3293
|
-
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
|
3294
|
-
if (handler) target.addEventListener(name, handler, { once: true });
|
|
3295
|
-
if (discrete) {
|
|
3296
|
-
dispatchDiscreteCustomEvent(target, event);
|
|
3297
|
-
} else {
|
|
3298
|
-
target.dispatchEvent(event);
|
|
3299
|
-
}
|
|
3300
|
-
}
|
|
3301
|
-
|
|
3302
|
-
// ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.1.7_@types+react-dom@19.1.3_@types+react@19.1.2__@types+r_1ff7b04b7c975087a2da2b1568ac976e/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
3303
|
-
import * as React43 from "react";
|
|
3304
|
-
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3305
|
-
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
3306
|
-
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
3307
|
-
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
3308
|
-
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
3309
|
-
var FocusScope = React43.forwardRef((props, forwardedRef) => {
|
|
3310
|
-
const _a = props, {
|
|
3311
|
-
loop = false,
|
|
3312
|
-
trapped = false,
|
|
3313
|
-
onMountAutoFocus: onMountAutoFocusProp,
|
|
3314
|
-
onUnmountAutoFocus: onUnmountAutoFocusProp
|
|
3315
|
-
} = _a, scopeProps = __objRest(_a, [
|
|
3316
|
-
"loop",
|
|
3317
|
-
"trapped",
|
|
3318
|
-
"onMountAutoFocus",
|
|
3319
|
-
"onUnmountAutoFocus"
|
|
3320
|
-
]);
|
|
3321
|
-
const [container, setContainer] = React43.useState(null);
|
|
3322
|
-
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
3323
|
-
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
3324
|
-
const lastFocusedElementRef = React43.useRef(null);
|
|
3325
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
3326
|
-
const focusScope = React43.useRef({
|
|
3327
|
-
paused: false,
|
|
3328
|
-
pause() {
|
|
3329
|
-
this.paused = true;
|
|
3330
|
-
},
|
|
3331
|
-
resume() {
|
|
3332
|
-
this.paused = false;
|
|
3333
|
-
}
|
|
3334
|
-
}).current;
|
|
3335
|
-
React43.useEffect(() => {
|
|
3336
|
-
if (trapped) {
|
|
3337
|
-
let handleFocusIn2 = function(event) {
|
|
3338
|
-
if (focusScope.paused || !container) return;
|
|
3339
|
-
const target = event.target;
|
|
3340
|
-
if (container.contains(target)) {
|
|
3341
|
-
lastFocusedElementRef.current = target;
|
|
3342
|
-
} else {
|
|
3343
|
-
focus(lastFocusedElementRef.current, { select: true });
|
|
3344
|
-
}
|
|
3345
|
-
}, handleFocusOut2 = function(event) {
|
|
3346
|
-
if (focusScope.paused || !container) return;
|
|
3347
|
-
const relatedTarget = event.relatedTarget;
|
|
3348
|
-
if (relatedTarget === null) return;
|
|
3349
|
-
if (!container.contains(relatedTarget)) {
|
|
3350
|
-
focus(lastFocusedElementRef.current, { select: true });
|
|
3351
|
-
}
|
|
3352
|
-
}, handleMutations2 = function(mutations) {
|
|
3353
|
-
const focusedElement = document.activeElement;
|
|
3354
|
-
if (focusedElement !== document.body) return;
|
|
3355
|
-
for (const mutation of mutations) {
|
|
3356
|
-
if (mutation.removedNodes.length > 0) focus(container);
|
|
3357
|
-
}
|
|
3358
|
-
};
|
|
3359
|
-
var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
|
|
3360
|
-
document.addEventListener("focusin", handleFocusIn2);
|
|
3361
|
-
document.addEventListener("focusout", handleFocusOut2);
|
|
3362
|
-
const mutationObserver = new MutationObserver(handleMutations2);
|
|
3363
|
-
if (container) mutationObserver.observe(container, { childList: true, subtree: true });
|
|
3364
|
-
return () => {
|
|
3365
|
-
document.removeEventListener("focusin", handleFocusIn2);
|
|
3366
|
-
document.removeEventListener("focusout", handleFocusOut2);
|
|
3367
|
-
mutationObserver.disconnect();
|
|
3368
|
-
};
|
|
3369
|
-
}
|
|
3370
|
-
}, [trapped, container, focusScope.paused]);
|
|
3371
|
-
React43.useEffect(() => {
|
|
3372
|
-
if (container) {
|
|
3373
|
-
focusScopesStack.add(focusScope);
|
|
3374
|
-
const previouslyFocusedElement = document.activeElement;
|
|
3375
|
-
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
3376
|
-
if (!hasFocusedCandidate) {
|
|
3377
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
3378
|
-
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
3379
|
-
container.dispatchEvent(mountEvent);
|
|
3380
|
-
if (!mountEvent.defaultPrevented) {
|
|
3381
|
-
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
3382
|
-
if (document.activeElement === previouslyFocusedElement) {
|
|
3383
|
-
focus(container);
|
|
3384
|
-
}
|
|
3385
|
-
}
|
|
3386
|
-
}
|
|
3387
|
-
return () => {
|
|
3388
|
-
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
3389
|
-
setTimeout(() => {
|
|
3390
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
3391
|
-
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
3392
|
-
container.dispatchEvent(unmountEvent);
|
|
3393
|
-
if (!unmountEvent.defaultPrevented) {
|
|
3394
|
-
focus(previouslyFocusedElement != null ? previouslyFocusedElement : document.body, { select: true });
|
|
3395
|
-
}
|
|
3396
|
-
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
3397
|
-
focusScopesStack.remove(focusScope);
|
|
3398
|
-
}, 0);
|
|
3399
|
-
};
|
|
3400
|
-
}
|
|
3401
|
-
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
3402
|
-
const handleKeyDown = React43.useCallback(
|
|
3403
|
-
(event) => {
|
|
3404
|
-
if (!loop && !trapped) return;
|
|
3405
|
-
if (focusScope.paused) return;
|
|
3406
|
-
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
3407
|
-
const focusedElement = document.activeElement;
|
|
3408
|
-
if (isTabKey && focusedElement) {
|
|
3409
|
-
const container2 = event.currentTarget;
|
|
3410
|
-
const [first, last] = getTabbableEdges(container2);
|
|
3411
|
-
const hasTabbableElementsInside = first && last;
|
|
3412
|
-
if (!hasTabbableElementsInside) {
|
|
3413
|
-
if (focusedElement === container2) event.preventDefault();
|
|
3414
|
-
} else {
|
|
3415
|
-
if (!event.shiftKey && focusedElement === last) {
|
|
3416
|
-
event.preventDefault();
|
|
3417
|
-
if (loop) focus(first, { select: true });
|
|
3418
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
3419
|
-
event.preventDefault();
|
|
3420
|
-
if (loop) focus(last, { select: true });
|
|
3421
|
-
}
|
|
3422
|
-
}
|
|
3423
|
-
}
|
|
3424
|
-
},
|
|
3425
|
-
[loop, trapped, focusScope.paused]
|
|
3426
|
-
);
|
|
3427
|
-
return /* @__PURE__ */ jsx37(Primitive.div, __spreadProps(__spreadValues({ tabIndex: -1 }, scopeProps), { ref: composedRefs, onKeyDown: handleKeyDown }));
|
|
3428
|
-
});
|
|
3429
|
-
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
3430
|
-
function focusFirst(candidates, { select = false } = {}) {
|
|
3431
|
-
const previouslyFocusedElement = document.activeElement;
|
|
3432
|
-
for (const candidate of candidates) {
|
|
3433
|
-
focus(candidate, { select });
|
|
3434
|
-
if (document.activeElement !== previouslyFocusedElement) return;
|
|
3435
|
-
}
|
|
3436
|
-
}
|
|
3437
|
-
function getTabbableEdges(container) {
|
|
3438
|
-
const candidates = getTabbableCandidates(container);
|
|
3439
|
-
const first = findVisible(candidates, container);
|
|
3440
|
-
const last = findVisible(candidates.reverse(), container);
|
|
3441
|
-
return [first, last];
|
|
3442
|
-
}
|
|
3443
|
-
function getTabbableCandidates(container) {
|
|
3444
|
-
const nodes = [];
|
|
3445
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
3446
|
-
acceptNode: (node) => {
|
|
3447
|
-
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
3448
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
3449
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
3450
|
-
}
|
|
3451
|
-
});
|
|
3452
|
-
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
3453
|
-
return nodes;
|
|
3454
|
-
}
|
|
3455
|
-
function findVisible(elements, container) {
|
|
3456
|
-
for (const element of elements) {
|
|
3457
|
-
if (!isHidden(element, { upTo: container })) return element;
|
|
3458
|
-
}
|
|
3459
|
-
}
|
|
3460
|
-
function isHidden(node, { upTo }) {
|
|
3461
|
-
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
3462
|
-
while (node) {
|
|
3463
|
-
if (upTo !== void 0 && node === upTo) return false;
|
|
3464
|
-
if (getComputedStyle(node).display === "none") return true;
|
|
3465
|
-
node = node.parentElement;
|
|
3466
|
-
}
|
|
3467
|
-
return false;
|
|
3468
|
-
}
|
|
3469
|
-
function isSelectableInput(element) {
|
|
3470
|
-
return element instanceof HTMLInputElement && "select" in element;
|
|
3471
|
-
}
|
|
3472
|
-
function focus(element, { select = false } = {}) {
|
|
3473
|
-
if (element && element.focus) {
|
|
3474
|
-
const previouslyFocusedElement = document.activeElement;
|
|
3475
|
-
element.focus({ preventScroll: true });
|
|
3476
|
-
if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
|
|
3477
|
-
element.select();
|
|
3478
|
-
}
|
|
3479
|
-
}
|
|
3480
|
-
var focusScopesStack = createFocusScopesStack();
|
|
3481
|
-
function createFocusScopesStack() {
|
|
3482
|
-
let stack = [];
|
|
3483
|
-
return {
|
|
3484
|
-
add(focusScope) {
|
|
3485
|
-
const activeFocusScope = stack[0];
|
|
3486
|
-
if (focusScope !== activeFocusScope) {
|
|
3487
|
-
activeFocusScope == null ? void 0 : activeFocusScope.pause();
|
|
3488
|
-
}
|
|
3489
|
-
stack = arrayRemove(stack, focusScope);
|
|
3490
|
-
stack.unshift(focusScope);
|
|
3491
|
-
},
|
|
3492
|
-
remove(focusScope) {
|
|
3493
|
-
var _a;
|
|
3494
|
-
stack = arrayRemove(stack, focusScope);
|
|
3495
|
-
(_a = stack[0]) == null ? void 0 : _a.resume();
|
|
3496
|
-
}
|
|
3497
|
-
};
|
|
3498
|
-
}
|
|
3499
|
-
function arrayRemove(array, item) {
|
|
3500
|
-
const updatedArray = [...array];
|
|
3501
|
-
const index = updatedArray.indexOf(item);
|
|
3502
|
-
if (index !== -1) {
|
|
3503
|
-
updatedArray.splice(index, 1);
|
|
3504
|
-
}
|
|
3505
|
-
return updatedArray;
|
|
3506
|
-
}
|
|
3507
|
-
function removeLinks(items) {
|
|
3508
|
-
return items.filter((item) => item.tagName !== "A");
|
|
3509
|
-
}
|
|
3510
|
-
|
|
3511
|
-
// ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.1.3_@types+react@19.1.2__@types+react@_a0745de0839b0b019298ec068509a840/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
3512
|
-
import * as React44 from "react";
|
|
3513
|
-
import ReactDOM2 from "react-dom";
|
|
3514
|
-
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
3515
|
-
var PORTAL_NAME = "Portal";
|
|
3516
|
-
var Portal = React44.forwardRef((props, forwardedRef) => {
|
|
3517
|
-
var _b;
|
|
3518
|
-
const _a = props, { container: containerProp } = _a, portalProps = __objRest(_a, ["container"]);
|
|
3519
|
-
const [mounted, setMounted] = React44.useState(false);
|
|
3520
|
-
useLayoutEffect2(() => setMounted(true), []);
|
|
3521
|
-
const container = containerProp || mounted && ((_b = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _b.body);
|
|
3522
|
-
return container ? ReactDOM2.createPortal(/* @__PURE__ */ jsx38(Primitive.div, __spreadProps(__spreadValues({}, portalProps), { ref: forwardedRef })), container) : null;
|
|
3523
|
-
});
|
|
3524
|
-
Portal.displayName = PORTAL_NAME;
|
|
3525
|
-
|
|
3526
|
-
// ../../node_modules/.pnpm/@radix-ui+react-presence@1.1.4_@types+react-dom@19.1.3_@types+react@19.1.2__@types+reac_dbbe976722e7c3e02883ea31c3bbbf14/node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
3527
|
-
import * as React211 from "react";
|
|
3528
|
-
import * as React45 from "react";
|
|
3529
|
-
function useStateMachine(initialState, machine) {
|
|
3530
|
-
return React45.useReducer((state, event) => {
|
|
3531
|
-
const nextState = machine[state][event];
|
|
3532
|
-
return nextState != null ? nextState : state;
|
|
3533
|
-
}, initialState);
|
|
3534
|
-
}
|
|
3535
|
-
var Presence = (props) => {
|
|
3536
|
-
const { present, children } = props;
|
|
3537
|
-
const presence = usePresence(present);
|
|
3538
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React211.Children.only(children);
|
|
3539
|
-
const ref = useComposedRefs(presence.ref, getElementRef2(child));
|
|
3540
|
-
const forceMount = typeof children === "function";
|
|
3541
|
-
return forceMount || presence.isPresent ? React211.cloneElement(child, { ref }) : null;
|
|
3542
|
-
};
|
|
3543
|
-
Presence.displayName = "Presence";
|
|
3544
|
-
function usePresence(present) {
|
|
3545
|
-
const [node, setNode] = React211.useState();
|
|
3546
|
-
const stylesRef = React211.useRef(null);
|
|
3547
|
-
const prevPresentRef = React211.useRef(present);
|
|
3548
|
-
const prevAnimationNameRef = React211.useRef("none");
|
|
3549
|
-
const initialState = present ? "mounted" : "unmounted";
|
|
3550
|
-
const [state, send] = useStateMachine(initialState, {
|
|
3551
|
-
mounted: {
|
|
3552
|
-
UNMOUNT: "unmounted",
|
|
3553
|
-
ANIMATION_OUT: "unmountSuspended"
|
|
3554
|
-
},
|
|
3555
|
-
unmountSuspended: {
|
|
3556
|
-
MOUNT: "mounted",
|
|
3557
|
-
ANIMATION_END: "unmounted"
|
|
3558
|
-
},
|
|
3559
|
-
unmounted: {
|
|
3560
|
-
MOUNT: "mounted"
|
|
3561
|
-
}
|
|
3562
|
-
});
|
|
3563
|
-
React211.useEffect(() => {
|
|
3564
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
3565
|
-
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
3566
|
-
}, [state]);
|
|
3567
|
-
useLayoutEffect2(() => {
|
|
3568
|
-
const styles = stylesRef.current;
|
|
3569
|
-
const wasPresent = prevPresentRef.current;
|
|
3570
|
-
const hasPresentChanged = wasPresent !== present;
|
|
3571
|
-
if (hasPresentChanged) {
|
|
3572
|
-
const prevAnimationName = prevAnimationNameRef.current;
|
|
3573
|
-
const currentAnimationName = getAnimationName(styles);
|
|
3574
|
-
if (present) {
|
|
3575
|
-
send("MOUNT");
|
|
3576
|
-
} else if (currentAnimationName === "none" || (styles == null ? void 0 : styles.display) === "none") {
|
|
3577
|
-
send("UNMOUNT");
|
|
3578
|
-
} else {
|
|
3579
|
-
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
3580
|
-
if (wasPresent && isAnimating) {
|
|
3581
|
-
send("ANIMATION_OUT");
|
|
3582
|
-
} else {
|
|
3583
|
-
send("UNMOUNT");
|
|
3584
|
-
}
|
|
3585
|
-
}
|
|
3586
|
-
prevPresentRef.current = present;
|
|
3587
|
-
}
|
|
3588
|
-
}, [present, send]);
|
|
3589
|
-
useLayoutEffect2(() => {
|
|
3590
|
-
var _a;
|
|
3591
|
-
if (node) {
|
|
3592
|
-
let timeoutId;
|
|
3593
|
-
const ownerWindow = (_a = node.ownerDocument.defaultView) != null ? _a : window;
|
|
3594
|
-
const handleAnimationEnd = (event) => {
|
|
3595
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
3596
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
3597
|
-
if (event.target === node && isCurrentAnimation) {
|
|
3598
|
-
send("ANIMATION_END");
|
|
3599
|
-
if (!prevPresentRef.current) {
|
|
3600
|
-
const currentFillMode = node.style.animationFillMode;
|
|
3601
|
-
node.style.animationFillMode = "forwards";
|
|
3602
|
-
timeoutId = ownerWindow.setTimeout(() => {
|
|
3603
|
-
if (node.style.animationFillMode === "forwards") {
|
|
3604
|
-
node.style.animationFillMode = currentFillMode;
|
|
3605
|
-
}
|
|
3606
|
-
});
|
|
3607
|
-
}
|
|
3608
|
-
}
|
|
3609
|
-
};
|
|
3610
|
-
const handleAnimationStart = (event) => {
|
|
3611
|
-
if (event.target === node) {
|
|
3612
|
-
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
3613
|
-
}
|
|
3614
|
-
};
|
|
3615
|
-
node.addEventListener("animationstart", handleAnimationStart);
|
|
3616
|
-
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
3617
|
-
node.addEventListener("animationend", handleAnimationEnd);
|
|
3618
|
-
return () => {
|
|
3619
|
-
ownerWindow.clearTimeout(timeoutId);
|
|
3620
|
-
node.removeEventListener("animationstart", handleAnimationStart);
|
|
3621
|
-
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
3622
|
-
node.removeEventListener("animationend", handleAnimationEnd);
|
|
3623
|
-
};
|
|
3624
|
-
} else {
|
|
3625
|
-
send("ANIMATION_END");
|
|
3626
|
-
}
|
|
3627
|
-
}, [node, send]);
|
|
3628
|
-
return {
|
|
3629
|
-
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
3630
|
-
ref: React211.useCallback((node2) => {
|
|
3631
|
-
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
3632
|
-
setNode(node2);
|
|
3633
|
-
}, [])
|
|
3634
|
-
};
|
|
3635
|
-
}
|
|
3636
|
-
function getAnimationName(styles) {
|
|
3637
|
-
return (styles == null ? void 0 : styles.animationName) || "none";
|
|
3638
|
-
}
|
|
3639
|
-
function getElementRef2(element) {
|
|
3640
|
-
var _a, _b;
|
|
3641
|
-
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
3642
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
3643
|
-
if (mayWarn) {
|
|
3644
|
-
return element.ref;
|
|
3645
|
-
}
|
|
3646
|
-
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
3647
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
3648
|
-
if (mayWarn) {
|
|
3649
|
-
return element.props.ref;
|
|
3650
|
-
}
|
|
3651
|
-
return element.props.ref || element.ref;
|
|
3652
|
-
}
|
|
3653
|
-
|
|
3654
|
-
// ../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
3655
|
-
import * as React46 from "react";
|
|
3656
|
-
var count2 = 0;
|
|
3657
|
-
function useFocusGuards() {
|
|
3658
|
-
React46.useEffect(() => {
|
|
3659
|
-
var _a, _b;
|
|
3660
|
-
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
3661
|
-
document.body.insertAdjacentElement("afterbegin", (_a = edgeGuards[0]) != null ? _a : createFocusGuard());
|
|
3662
|
-
document.body.insertAdjacentElement("beforeend", (_b = edgeGuards[1]) != null ? _b : createFocusGuard());
|
|
3663
|
-
count2++;
|
|
3664
|
-
return () => {
|
|
3665
|
-
if (count2 === 1) {
|
|
3666
|
-
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
3667
|
-
}
|
|
3668
|
-
count2--;
|
|
3669
|
-
};
|
|
3670
|
-
}, []);
|
|
3671
|
-
}
|
|
3672
|
-
function createFocusGuard() {
|
|
3673
|
-
const element = document.createElement("span");
|
|
3674
|
-
element.setAttribute("data-radix-focus-guard", "");
|
|
3675
|
-
element.tabIndex = 0;
|
|
3676
|
-
element.style.outline = "none";
|
|
3677
|
-
element.style.opacity = "0";
|
|
3678
|
-
element.style.position = "fixed";
|
|
3679
|
-
element.style.pointerEvents = "none";
|
|
3680
|
-
return element;
|
|
3681
|
-
}
|
|
3682
|
-
|
|
3683
|
-
// ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
|
|
3684
|
-
var __assign = function() {
|
|
3685
|
-
__assign = Object.assign || function __assign2(t) {
|
|
3686
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
3687
|
-
s = arguments[i];
|
|
3688
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
3689
|
-
}
|
|
3690
|
-
return t;
|
|
3691
|
-
};
|
|
3692
|
-
return __assign.apply(this, arguments);
|
|
3693
|
-
};
|
|
3694
|
-
function __rest(s, e) {
|
|
3695
|
-
var t = {};
|
|
3696
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
3697
|
-
t[p] = s[p];
|
|
3698
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
3699
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3700
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
3701
|
-
t[p[i]] = s[p[i]];
|
|
3702
|
-
}
|
|
3703
|
-
return t;
|
|
3704
|
-
}
|
|
3705
|
-
function __spreadArray(to, from, pack) {
|
|
3706
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3707
|
-
if (ar || !(i in from)) {
|
|
3708
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
3709
|
-
ar[i] = from[i];
|
|
3710
|
-
}
|
|
3711
|
-
}
|
|
3712
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
3713
|
-
}
|
|
3714
|
-
|
|
3715
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
3716
|
-
import * as React53 from "react";
|
|
3717
|
-
|
|
3718
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
3719
|
-
import * as React49 from "react";
|
|
3720
|
-
|
|
3721
|
-
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
3722
|
-
var zeroRightClassName = "right-scroll-bar-position";
|
|
3723
|
-
var fullWidthClassName = "width-before-scroll-bar";
|
|
3724
|
-
var noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
3725
|
-
var removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
3726
|
-
|
|
3727
|
-
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.2_react@19.1.0/node_modules/use-callback-ref/dist/es2015/assignRef.js
|
|
3728
|
-
function assignRef(ref, value) {
|
|
3729
|
-
if (typeof ref === "function") {
|
|
3730
|
-
ref(value);
|
|
3731
|
-
} else if (ref) {
|
|
3732
|
-
ref.current = value;
|
|
3733
|
-
}
|
|
3734
|
-
return ref;
|
|
3735
|
-
}
|
|
3736
|
-
|
|
3737
|
-
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.2_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
3738
|
-
import { useState as useState7 } from "react";
|
|
3739
|
-
function useCallbackRef2(initialValue, callback) {
|
|
3740
|
-
var ref = useState7(function() {
|
|
3741
|
-
return {
|
|
3742
|
-
// value
|
|
3743
|
-
value: initialValue,
|
|
3744
|
-
// last callback
|
|
3745
|
-
callback,
|
|
3746
|
-
// "memoized" public interface
|
|
3747
|
-
facade: {
|
|
3748
|
-
get current() {
|
|
3749
|
-
return ref.value;
|
|
3750
|
-
},
|
|
3751
|
-
set current(value) {
|
|
3752
|
-
var last = ref.value;
|
|
3753
|
-
if (last !== value) {
|
|
3754
|
-
ref.value = value;
|
|
3755
|
-
ref.callback(value, last);
|
|
3756
|
-
}
|
|
3757
|
-
}
|
|
3758
|
-
}
|
|
3759
|
-
};
|
|
3760
|
-
})[0];
|
|
3761
|
-
ref.callback = callback;
|
|
3762
|
-
return ref.facade;
|
|
3763
|
-
}
|
|
3764
|
-
|
|
3765
|
-
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.1.2_react@19.1.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
3766
|
-
import * as React47 from "react";
|
|
3767
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React47.useLayoutEffect : React47.useEffect;
|
|
3768
|
-
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
3769
|
-
function useMergeRefs(refs, defaultValue) {
|
|
3770
|
-
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
3771
|
-
return refs.forEach(function(ref) {
|
|
3772
|
-
return assignRef(ref, newValue);
|
|
3773
|
-
});
|
|
3774
|
-
});
|
|
3775
|
-
useIsomorphicLayoutEffect(function() {
|
|
3776
|
-
var oldValue = currentValues.get(callbackRef);
|
|
3777
|
-
if (oldValue) {
|
|
3778
|
-
var prevRefs_1 = new Set(oldValue);
|
|
3779
|
-
var nextRefs_1 = new Set(refs);
|
|
3780
|
-
var current_1 = callbackRef.current;
|
|
3781
|
-
prevRefs_1.forEach(function(ref) {
|
|
3782
|
-
if (!nextRefs_1.has(ref)) {
|
|
3783
|
-
assignRef(ref, null);
|
|
3784
|
-
}
|
|
3785
|
-
});
|
|
3786
|
-
nextRefs_1.forEach(function(ref) {
|
|
3787
|
-
if (!prevRefs_1.has(ref)) {
|
|
3788
|
-
assignRef(ref, current_1);
|
|
3789
|
-
}
|
|
3790
|
-
});
|
|
3791
|
-
}
|
|
3792
|
-
currentValues.set(callbackRef, refs);
|
|
3793
|
-
}, [refs]);
|
|
3794
|
-
return callbackRef;
|
|
3795
|
-
}
|
|
3796
|
-
|
|
3797
|
-
// ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.2_react@19.1.0/node_modules/use-sidecar/dist/es2015/medium.js
|
|
3798
|
-
function ItoI(a) {
|
|
3799
|
-
return a;
|
|
3800
|
-
}
|
|
3801
|
-
function innerCreateMedium(defaults, middleware) {
|
|
3802
|
-
if (middleware === void 0) {
|
|
3803
|
-
middleware = ItoI;
|
|
3804
|
-
}
|
|
3805
|
-
var buffer = [];
|
|
3806
|
-
var assigned = false;
|
|
3807
|
-
var medium = {
|
|
3808
|
-
read: function() {
|
|
3809
|
-
if (assigned) {
|
|
3810
|
-
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
3811
|
-
}
|
|
3812
|
-
if (buffer.length) {
|
|
3813
|
-
return buffer[buffer.length - 1];
|
|
3814
|
-
}
|
|
3815
|
-
return defaults;
|
|
3816
|
-
},
|
|
3817
|
-
useMedium: function(data) {
|
|
3818
|
-
var item = middleware(data, assigned);
|
|
3819
|
-
buffer.push(item);
|
|
3820
|
-
return function() {
|
|
3821
|
-
buffer = buffer.filter(function(x) {
|
|
3822
|
-
return x !== item;
|
|
3823
|
-
});
|
|
3824
|
-
};
|
|
3825
|
-
},
|
|
3826
|
-
assignSyncMedium: function(cb) {
|
|
3827
|
-
assigned = true;
|
|
3828
|
-
while (buffer.length) {
|
|
3829
|
-
var cbs = buffer;
|
|
3830
|
-
buffer = [];
|
|
3831
|
-
cbs.forEach(cb);
|
|
3832
|
-
}
|
|
3833
|
-
buffer = {
|
|
3834
|
-
push: function(x) {
|
|
3835
|
-
return cb(x);
|
|
3836
|
-
},
|
|
3837
|
-
filter: function() {
|
|
3838
|
-
return buffer;
|
|
3839
|
-
}
|
|
3840
|
-
};
|
|
3841
|
-
},
|
|
3842
|
-
assignMedium: function(cb) {
|
|
3843
|
-
assigned = true;
|
|
3844
|
-
var pendingQueue = [];
|
|
3845
|
-
if (buffer.length) {
|
|
3846
|
-
var cbs = buffer;
|
|
3847
|
-
buffer = [];
|
|
3848
|
-
cbs.forEach(cb);
|
|
3849
|
-
pendingQueue = buffer;
|
|
3850
|
-
}
|
|
3851
|
-
var executeQueue = function() {
|
|
3852
|
-
var cbs2 = pendingQueue;
|
|
3853
|
-
pendingQueue = [];
|
|
3854
|
-
cbs2.forEach(cb);
|
|
3855
|
-
};
|
|
3856
|
-
var cycle = function() {
|
|
3857
|
-
return Promise.resolve().then(executeQueue);
|
|
3858
|
-
};
|
|
3859
|
-
cycle();
|
|
3860
|
-
buffer = {
|
|
3861
|
-
push: function(x) {
|
|
3862
|
-
pendingQueue.push(x);
|
|
3863
|
-
cycle();
|
|
3864
|
-
},
|
|
3865
|
-
filter: function(filter) {
|
|
3866
|
-
pendingQueue = pendingQueue.filter(filter);
|
|
3867
|
-
return buffer;
|
|
3868
|
-
}
|
|
3869
|
-
};
|
|
3870
|
-
}
|
|
3871
|
-
};
|
|
3872
|
-
return medium;
|
|
3873
|
-
}
|
|
3874
|
-
function createSidecarMedium(options) {
|
|
3875
|
-
if (options === void 0) {
|
|
3876
|
-
options = {};
|
|
3877
|
-
}
|
|
3878
|
-
var medium = innerCreateMedium(null);
|
|
3879
|
-
medium.options = __assign({ async: true, ssr: false }, options);
|
|
3880
|
-
return medium;
|
|
3881
|
-
}
|
|
3882
|
-
|
|
3883
|
-
// ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.1.2_react@19.1.0/node_modules/use-sidecar/dist/es2015/exports.js
|
|
3884
|
-
import * as React48 from "react";
|
|
3885
|
-
var SideCar = function(_a) {
|
|
3886
|
-
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
3887
|
-
if (!sideCar) {
|
|
3888
|
-
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
3889
|
-
}
|
|
3890
|
-
var Target = sideCar.read();
|
|
3891
|
-
if (!Target) {
|
|
3892
|
-
throw new Error("Sidecar medium not found");
|
|
3893
|
-
}
|
|
3894
|
-
return React48.createElement(Target, __assign({}, rest));
|
|
3895
|
-
};
|
|
3896
|
-
SideCar.isSideCarExport = true;
|
|
3897
|
-
function exportSidecar(medium, exported) {
|
|
3898
|
-
medium.useMedium(exported);
|
|
3899
|
-
return SideCar;
|
|
3900
|
-
}
|
|
3901
|
-
|
|
3902
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/medium.js
|
|
3903
|
-
var effectCar = createSidecarMedium();
|
|
3904
|
-
|
|
3905
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
3906
|
-
var nothing = function() {
|
|
3907
|
-
return;
|
|
3908
|
-
};
|
|
3909
|
-
var RemoveScroll = React49.forwardRef(function(props, parentRef) {
|
|
3910
|
-
var ref = React49.useRef(null);
|
|
3911
|
-
var _a = React49.useState({
|
|
3912
|
-
onScrollCapture: nothing,
|
|
3913
|
-
onWheelCapture: nothing,
|
|
3914
|
-
onTouchMoveCapture: nothing
|
|
3915
|
-
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
3916
|
-
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
3917
|
-
var SideCar2 = sideCar;
|
|
3918
|
-
var containerRef = useMergeRefs([ref, parentRef]);
|
|
3919
|
-
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
3920
|
-
return React49.createElement(
|
|
3921
|
-
React49.Fragment,
|
|
3922
|
-
null,
|
|
3923
|
-
enabled && React49.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
3924
|
-
forwardProps ? React49.cloneElement(React49.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React49.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
3925
|
-
);
|
|
3926
|
-
});
|
|
3927
|
-
RemoveScroll.defaultProps = {
|
|
3928
|
-
enabled: true,
|
|
3929
|
-
removeScrollBar: true,
|
|
3930
|
-
inert: false
|
|
3931
|
-
};
|
|
3932
|
-
RemoveScroll.classNames = {
|
|
3933
|
-
fullWidth: fullWidthClassName,
|
|
3934
|
-
zeroRight: zeroRightClassName
|
|
3935
|
-
};
|
|
3936
|
-
|
|
3937
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
3938
|
-
import * as React52 from "react";
|
|
3939
|
-
|
|
3940
|
-
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
3941
|
-
import * as React51 from "react";
|
|
3942
|
-
|
|
3943
|
-
// ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
3944
|
-
import * as React50 from "react";
|
|
3945
|
-
|
|
3946
|
-
// ../../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
|
|
3947
|
-
var currentNonce;
|
|
3948
|
-
var getNonce = function() {
|
|
3949
|
-
if (currentNonce) {
|
|
3950
|
-
return currentNonce;
|
|
3951
|
-
}
|
|
3952
|
-
if (typeof __webpack_nonce__ !== "undefined") {
|
|
3953
|
-
return __webpack_nonce__;
|
|
3954
|
-
}
|
|
3955
|
-
return void 0;
|
|
3956
|
-
};
|
|
3957
|
-
|
|
3958
|
-
// ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/singleton.js
|
|
3959
|
-
function makeStyleTag() {
|
|
3960
|
-
if (!document)
|
|
3961
|
-
return null;
|
|
3962
|
-
var tag = document.createElement("style");
|
|
3963
|
-
tag.type = "text/css";
|
|
3964
|
-
var nonce = getNonce();
|
|
3965
|
-
if (nonce) {
|
|
3966
|
-
tag.setAttribute("nonce", nonce);
|
|
3967
|
-
}
|
|
3968
|
-
return tag;
|
|
3969
|
-
}
|
|
3970
|
-
function injectStyles(tag, css) {
|
|
3971
|
-
if (tag.styleSheet) {
|
|
3972
|
-
tag.styleSheet.cssText = css;
|
|
3973
|
-
} else {
|
|
3974
|
-
tag.appendChild(document.createTextNode(css));
|
|
3975
|
-
}
|
|
3976
|
-
}
|
|
3977
|
-
function insertStyleTag(tag) {
|
|
3978
|
-
var head = document.head || document.getElementsByTagName("head")[0];
|
|
3979
|
-
head.appendChild(tag);
|
|
3980
|
-
}
|
|
3981
|
-
var stylesheetSingleton = function() {
|
|
3982
|
-
var counter = 0;
|
|
3983
|
-
var stylesheet = null;
|
|
3984
|
-
return {
|
|
3985
|
-
add: function(style) {
|
|
3986
|
-
if (counter == 0) {
|
|
3987
|
-
if (stylesheet = makeStyleTag()) {
|
|
3988
|
-
injectStyles(stylesheet, style);
|
|
3989
|
-
insertStyleTag(stylesheet);
|
|
3990
|
-
}
|
|
3991
|
-
}
|
|
3992
|
-
counter++;
|
|
3993
|
-
},
|
|
3994
|
-
remove: function() {
|
|
3995
|
-
counter--;
|
|
3996
|
-
if (!counter && stylesheet) {
|
|
3997
|
-
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
3998
|
-
stylesheet = null;
|
|
3999
|
-
}
|
|
4000
|
-
}
|
|
4001
|
-
};
|
|
4002
|
-
};
|
|
4003
|
-
|
|
4004
|
-
// ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
4005
|
-
var styleHookSingleton = function() {
|
|
4006
|
-
var sheet = stylesheetSingleton();
|
|
4007
|
-
return function(styles, isDynamic) {
|
|
4008
|
-
React50.useEffect(function() {
|
|
4009
|
-
sheet.add(styles);
|
|
4010
|
-
return function() {
|
|
4011
|
-
sheet.remove();
|
|
4012
|
-
};
|
|
4013
|
-
}, [styles && isDynamic]);
|
|
4014
|
-
};
|
|
4015
|
-
};
|
|
4016
|
-
|
|
4017
|
-
// ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.1.2_react@19.1.0/node_modules/react-style-singleton/dist/es2015/component.js
|
|
4018
|
-
var styleSingleton = function() {
|
|
4019
|
-
var useStyle = styleHookSingleton();
|
|
4020
|
-
var Sheet = function(_a) {
|
|
4021
|
-
var styles = _a.styles, dynamic = _a.dynamic;
|
|
4022
|
-
useStyle(styles, dynamic);
|
|
4023
|
-
return null;
|
|
4024
|
-
};
|
|
4025
|
-
return Sheet;
|
|
4026
|
-
};
|
|
4027
|
-
|
|
4028
|
-
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js
|
|
4029
|
-
var zeroGap = {
|
|
4030
|
-
left: 0,
|
|
4031
|
-
top: 0,
|
|
4032
|
-
right: 0,
|
|
4033
|
-
gap: 0
|
|
4034
|
-
};
|
|
4035
|
-
var parse = function(x) {
|
|
4036
|
-
return parseInt(x || "", 10) || 0;
|
|
4037
|
-
};
|
|
4038
|
-
var getOffset = function(gapMode) {
|
|
4039
|
-
var cs = window.getComputedStyle(document.body);
|
|
4040
|
-
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
4041
|
-
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
4042
|
-
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
4043
|
-
return [parse(left), parse(top), parse(right)];
|
|
4044
|
-
};
|
|
4045
|
-
var getGapWidth = function(gapMode) {
|
|
4046
|
-
if (gapMode === void 0) {
|
|
4047
|
-
gapMode = "margin";
|
|
4048
|
-
}
|
|
4049
|
-
if (typeof window === "undefined") {
|
|
4050
|
-
return zeroGap;
|
|
4051
|
-
}
|
|
4052
|
-
var offsets = getOffset(gapMode);
|
|
4053
|
-
var documentWidth = document.documentElement.clientWidth;
|
|
4054
|
-
var windowWidth = window.innerWidth;
|
|
4055
|
-
return {
|
|
4056
|
-
left: offsets[0],
|
|
4057
|
-
top: offsets[1],
|
|
4058
|
-
right: offsets[2],
|
|
4059
|
-
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
4060
|
-
};
|
|
4061
|
-
};
|
|
4062
|
-
|
|
4063
|
-
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
4064
|
-
var Style = styleSingleton();
|
|
4065
|
-
var lockAttribute = "data-scroll-locked";
|
|
4066
|
-
var getStyles = function(_a, allowRelative, gapMode, important) {
|
|
4067
|
-
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
4068
|
-
if (gapMode === void 0) {
|
|
4069
|
-
gapMode = "margin";
|
|
4070
|
-
}
|
|
4071
|
-
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
4072
|
-
allowRelative && "position: relative ".concat(important, ";"),
|
|
4073
|
-
gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
4074
|
-
gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
|
|
4075
|
-
].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
4076
|
-
};
|
|
4077
|
-
var getCurrentUseCounter = function() {
|
|
4078
|
-
var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
|
|
4079
|
-
return isFinite(counter) ? counter : 0;
|
|
4080
|
-
};
|
|
4081
|
-
var useLockAttribute = function() {
|
|
4082
|
-
React51.useEffect(function() {
|
|
4083
|
-
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
4084
|
-
return function() {
|
|
4085
|
-
var newCounter = getCurrentUseCounter() - 1;
|
|
4086
|
-
if (newCounter <= 0) {
|
|
4087
|
-
document.body.removeAttribute(lockAttribute);
|
|
4088
|
-
} else {
|
|
4089
|
-
document.body.setAttribute(lockAttribute, newCounter.toString());
|
|
4090
|
-
}
|
|
4091
|
-
};
|
|
4092
|
-
}, []);
|
|
4093
|
-
};
|
|
4094
|
-
var RemoveScrollBar = function(_a) {
|
|
4095
|
-
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
4096
|
-
useLockAttribute();
|
|
4097
|
-
var gap = React51.useMemo(function() {
|
|
4098
|
-
return getGapWidth(gapMode);
|
|
4099
|
-
}, [gapMode]);
|
|
4100
|
-
return React51.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
4101
|
-
};
|
|
4102
|
-
|
|
4103
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
4104
|
-
var passiveSupported = false;
|
|
4105
|
-
if (typeof window !== "undefined") {
|
|
4106
|
-
try {
|
|
4107
|
-
options = Object.defineProperty({}, "passive", {
|
|
4108
|
-
get: function() {
|
|
4109
|
-
passiveSupported = true;
|
|
4110
|
-
return true;
|
|
4111
|
-
}
|
|
4112
|
-
});
|
|
4113
|
-
window.addEventListener("test", options, options);
|
|
4114
|
-
window.removeEventListener("test", options, options);
|
|
4115
|
-
} catch (err) {
|
|
4116
|
-
passiveSupported = false;
|
|
4117
|
-
}
|
|
4118
|
-
}
|
|
4119
|
-
var options;
|
|
4120
|
-
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
4121
|
-
|
|
4122
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
|
|
4123
|
-
var alwaysContainsScroll = function(node) {
|
|
4124
|
-
return node.tagName === "TEXTAREA";
|
|
4125
|
-
};
|
|
4126
|
-
var elementCanBeScrolled = function(node, overflow) {
|
|
4127
|
-
if (!(node instanceof Element)) {
|
|
4128
|
-
return false;
|
|
4129
|
-
}
|
|
4130
|
-
var styles = window.getComputedStyle(node);
|
|
4131
|
-
return (
|
|
4132
|
-
// not-not-scrollable
|
|
4133
|
-
styles[overflow] !== "hidden" && // contains scroll inside self
|
|
4134
|
-
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
|
|
4135
|
-
);
|
|
4136
|
-
};
|
|
4137
|
-
var elementCouldBeVScrolled = function(node) {
|
|
4138
|
-
return elementCanBeScrolled(node, "overflowY");
|
|
4139
|
-
};
|
|
4140
|
-
var elementCouldBeHScrolled = function(node) {
|
|
4141
|
-
return elementCanBeScrolled(node, "overflowX");
|
|
4142
|
-
};
|
|
4143
|
-
var locationCouldBeScrolled = function(axis, node) {
|
|
4144
|
-
var ownerDocument = node.ownerDocument;
|
|
4145
|
-
var current = node;
|
|
4146
|
-
do {
|
|
4147
|
-
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
|
|
4148
|
-
current = current.host;
|
|
4149
|
-
}
|
|
4150
|
-
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
4151
|
-
if (isScrollable) {
|
|
4152
|
-
var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
|
|
4153
|
-
if (scrollHeight > clientHeight) {
|
|
4154
|
-
return true;
|
|
4155
|
-
}
|
|
4156
|
-
}
|
|
4157
|
-
current = current.parentNode;
|
|
4158
|
-
} while (current && current !== ownerDocument.body);
|
|
4159
|
-
return false;
|
|
4160
|
-
};
|
|
4161
|
-
var getVScrollVariables = function(_a) {
|
|
4162
|
-
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
4163
|
-
return [
|
|
4164
|
-
scrollTop,
|
|
4165
|
-
scrollHeight,
|
|
4166
|
-
clientHeight
|
|
4167
|
-
];
|
|
4168
|
-
};
|
|
4169
|
-
var getHScrollVariables = function(_a) {
|
|
4170
|
-
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
4171
|
-
return [
|
|
4172
|
-
scrollLeft,
|
|
4173
|
-
scrollWidth,
|
|
4174
|
-
clientWidth
|
|
4175
|
-
];
|
|
4176
|
-
};
|
|
4177
|
-
var elementCouldBeScrolled = function(axis, node) {
|
|
4178
|
-
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
4179
|
-
};
|
|
4180
|
-
var getScrollVariables = function(axis, node) {
|
|
4181
|
-
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
4182
|
-
};
|
|
4183
|
-
var getDirectionFactor = function(axis, direction) {
|
|
4184
|
-
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
4185
|
-
};
|
|
4186
|
-
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
4187
|
-
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
4188
|
-
var delta = directionFactor * sourceDelta;
|
|
4189
|
-
var target = event.target;
|
|
4190
|
-
var targetInLock = endTarget.contains(target);
|
|
4191
|
-
var shouldCancelScroll = false;
|
|
4192
|
-
var isDeltaPositive = delta > 0;
|
|
4193
|
-
var availableScroll = 0;
|
|
4194
|
-
var availableScrollTop = 0;
|
|
4195
|
-
do {
|
|
4196
|
-
if (!target) {
|
|
4197
|
-
break;
|
|
4198
|
-
}
|
|
4199
|
-
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
4200
|
-
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
4201
|
-
if (position || elementScroll) {
|
|
4202
|
-
if (elementCouldBeScrolled(axis, target)) {
|
|
4203
|
-
availableScroll += elementScroll;
|
|
4204
|
-
availableScrollTop += position;
|
|
4205
|
-
}
|
|
4206
|
-
}
|
|
4207
|
-
var parent_1 = target.parentNode;
|
|
4208
|
-
target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
|
|
4209
|
-
} while (
|
|
4210
|
-
// portaled content
|
|
4211
|
-
!targetInLock && target !== document.body || // self content
|
|
4212
|
-
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
4213
|
-
);
|
|
4214
|
-
if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) {
|
|
4215
|
-
shouldCancelScroll = true;
|
|
4216
|
-
} else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) {
|
|
4217
|
-
shouldCancelScroll = true;
|
|
4218
|
-
}
|
|
4219
|
-
return shouldCancelScroll;
|
|
4220
|
-
};
|
|
4221
|
-
|
|
4222
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
4223
|
-
var getTouchXY = function(event) {
|
|
4224
|
-
return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
4225
|
-
};
|
|
4226
|
-
var getDeltaXY = function(event) {
|
|
4227
|
-
return [event.deltaX, event.deltaY];
|
|
4228
|
-
};
|
|
4229
|
-
var extractRef = function(ref) {
|
|
4230
|
-
return ref && "current" in ref ? ref.current : ref;
|
|
4231
|
-
};
|
|
4232
|
-
var deltaCompare = function(x, y) {
|
|
4233
|
-
return x[0] === y[0] && x[1] === y[1];
|
|
4234
|
-
};
|
|
4235
|
-
var generateStyle = function(id) {
|
|
4236
|
-
return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
|
|
4237
|
-
};
|
|
4238
|
-
var idCounter = 0;
|
|
4239
|
-
var lockStack = [];
|
|
4240
|
-
function RemoveScrollSideCar(props) {
|
|
4241
|
-
var shouldPreventQueue = React52.useRef([]);
|
|
4242
|
-
var touchStartRef = React52.useRef([0, 0]);
|
|
4243
|
-
var activeAxis = React52.useRef();
|
|
4244
|
-
var id = React52.useState(idCounter++)[0];
|
|
4245
|
-
var Style2 = React52.useState(styleSingleton)[0];
|
|
4246
|
-
var lastProps = React52.useRef(props);
|
|
4247
|
-
React52.useEffect(function() {
|
|
4248
|
-
lastProps.current = props;
|
|
4249
|
-
}, [props]);
|
|
4250
|
-
React52.useEffect(function() {
|
|
4251
|
-
if (props.inert) {
|
|
4252
|
-
document.body.classList.add("block-interactivity-".concat(id));
|
|
4253
|
-
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
4254
|
-
allow_1.forEach(function(el) {
|
|
4255
|
-
return el.classList.add("allow-interactivity-".concat(id));
|
|
4256
|
-
});
|
|
4257
|
-
return function() {
|
|
4258
|
-
document.body.classList.remove("block-interactivity-".concat(id));
|
|
4259
|
-
allow_1.forEach(function(el) {
|
|
4260
|
-
return el.classList.remove("allow-interactivity-".concat(id));
|
|
4261
|
-
});
|
|
4262
|
-
};
|
|
4263
|
-
}
|
|
4264
|
-
return;
|
|
4265
|
-
}, [props.inert, props.lockRef.current, props.shards]);
|
|
4266
|
-
var shouldCancelEvent = React52.useCallback(function(event, parent) {
|
|
4267
|
-
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
4268
|
-
return !lastProps.current.allowPinchZoom;
|
|
4269
|
-
}
|
|
4270
|
-
var touch = getTouchXY(event);
|
|
4271
|
-
var touchStart = touchStartRef.current;
|
|
4272
|
-
var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
|
|
4273
|
-
var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
|
|
4274
|
-
var currentAxis;
|
|
4275
|
-
var target = event.target;
|
|
4276
|
-
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
|
|
4277
|
-
if ("touches" in event && moveDirection === "h" && target.type === "range") {
|
|
4278
|
-
return false;
|
|
4279
|
-
}
|
|
4280
|
-
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
4281
|
-
if (!canBeScrolledInMainDirection) {
|
|
4282
|
-
return true;
|
|
4283
|
-
}
|
|
4284
|
-
if (canBeScrolledInMainDirection) {
|
|
4285
|
-
currentAxis = moveDirection;
|
|
4286
|
-
} else {
|
|
4287
|
-
currentAxis = moveDirection === "v" ? "h" : "v";
|
|
4288
|
-
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
4289
|
-
}
|
|
4290
|
-
if (!canBeScrolledInMainDirection) {
|
|
4291
|
-
return false;
|
|
4292
|
-
}
|
|
4293
|
-
if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
|
|
4294
|
-
activeAxis.current = currentAxis;
|
|
4295
|
-
}
|
|
4296
|
-
if (!currentAxis) {
|
|
4297
|
-
return true;
|
|
4298
|
-
}
|
|
4299
|
-
var cancelingAxis = activeAxis.current || currentAxis;
|
|
4300
|
-
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
4301
|
-
}, []);
|
|
4302
|
-
var shouldPrevent = React52.useCallback(function(_event) {
|
|
4303
|
-
var event = _event;
|
|
4304
|
-
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
4305
|
-
return;
|
|
4306
|
-
}
|
|
4307
|
-
var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
|
|
4308
|
-
var sourceEvent = shouldPreventQueue.current.filter(function(e) {
|
|
4309
|
-
return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
|
|
4310
|
-
})[0];
|
|
4311
|
-
if (sourceEvent && sourceEvent.should) {
|
|
4312
|
-
if (event.cancelable) {
|
|
4313
|
-
event.preventDefault();
|
|
4314
|
-
}
|
|
4315
|
-
return;
|
|
4316
|
-
}
|
|
4317
|
-
if (!sourceEvent) {
|
|
4318
|
-
var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
|
|
4319
|
-
return node.contains(event.target);
|
|
4320
|
-
});
|
|
4321
|
-
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
4322
|
-
if (shouldStop) {
|
|
4323
|
-
if (event.cancelable) {
|
|
4324
|
-
event.preventDefault();
|
|
4325
|
-
}
|
|
4326
|
-
}
|
|
4327
|
-
}
|
|
4328
|
-
}, []);
|
|
4329
|
-
var shouldCancel = React52.useCallback(function(name, delta, target, should) {
|
|
4330
|
-
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
4331
|
-
shouldPreventQueue.current.push(event);
|
|
4332
|
-
setTimeout(function() {
|
|
4333
|
-
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
4334
|
-
return e !== event;
|
|
4335
|
-
});
|
|
4336
|
-
}, 1);
|
|
4337
|
-
}, []);
|
|
4338
|
-
var scrollTouchStart = React52.useCallback(function(event) {
|
|
4339
|
-
touchStartRef.current = getTouchXY(event);
|
|
4340
|
-
activeAxis.current = void 0;
|
|
4341
|
-
}, []);
|
|
4342
|
-
var scrollWheel = React52.useCallback(function(event) {
|
|
4343
|
-
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
4344
|
-
}, []);
|
|
4345
|
-
var scrollTouchMove = React52.useCallback(function(event) {
|
|
4346
|
-
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
4347
|
-
}, []);
|
|
4348
|
-
React52.useEffect(function() {
|
|
4349
|
-
lockStack.push(Style2);
|
|
4350
|
-
props.setCallbacks({
|
|
4351
|
-
onScrollCapture: scrollWheel,
|
|
4352
|
-
onWheelCapture: scrollWheel,
|
|
4353
|
-
onTouchMoveCapture: scrollTouchMove
|
|
4354
|
-
});
|
|
4355
|
-
document.addEventListener("wheel", shouldPrevent, nonPassive);
|
|
4356
|
-
document.addEventListener("touchmove", shouldPrevent, nonPassive);
|
|
4357
|
-
document.addEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
4358
|
-
return function() {
|
|
4359
|
-
lockStack = lockStack.filter(function(inst) {
|
|
4360
|
-
return inst !== Style2;
|
|
4361
|
-
});
|
|
4362
|
-
document.removeEventListener("wheel", shouldPrevent, nonPassive);
|
|
4363
|
-
document.removeEventListener("touchmove", shouldPrevent, nonPassive);
|
|
4364
|
-
document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
4365
|
-
};
|
|
4366
|
-
}, []);
|
|
4367
|
-
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
4368
|
-
return React52.createElement(
|
|
4369
|
-
React52.Fragment,
|
|
4370
|
-
null,
|
|
4371
|
-
inert ? React52.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
4372
|
-
removeScrollBar ? React52.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
4373
|
-
);
|
|
4374
|
-
}
|
|
4375
|
-
function getOutermostShadowParent(node) {
|
|
4376
|
-
var shadowParent = null;
|
|
4377
|
-
while (node !== null) {
|
|
4378
|
-
if (node instanceof ShadowRoot) {
|
|
4379
|
-
shadowParent = node.host;
|
|
4380
|
-
node = node.host;
|
|
4381
|
-
}
|
|
4382
|
-
node = node.parentNode;
|
|
4383
|
-
}
|
|
4384
|
-
return shadowParent;
|
|
4385
|
-
}
|
|
4386
|
-
|
|
4387
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js
|
|
4388
|
-
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
4389
|
-
|
|
4390
|
-
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.1.2_react@19.1.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
4391
|
-
var ReactRemoveScroll = React53.forwardRef(function(props, ref) {
|
|
4392
|
-
return React53.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
4393
|
-
});
|
|
4394
|
-
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
4395
|
-
var Combination_default = ReactRemoveScroll;
|
|
4396
|
-
|
|
4397
|
-
// ../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js
|
|
4398
|
-
var getDefaultParent = function(originalTarget) {
|
|
4399
|
-
if (typeof document === "undefined") {
|
|
4400
|
-
return null;
|
|
4401
|
-
}
|
|
4402
|
-
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
4403
|
-
return sampleTarget.ownerDocument.body;
|
|
4404
|
-
};
|
|
4405
|
-
var counterMap = /* @__PURE__ */ new WeakMap();
|
|
4406
|
-
var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
4407
|
-
var markerMap = {};
|
|
4408
|
-
var lockCount = 0;
|
|
4409
|
-
var unwrapHost = function(node) {
|
|
4410
|
-
return node && (node.host || unwrapHost(node.parentNode));
|
|
4411
|
-
};
|
|
4412
|
-
var correctTargets = function(parent, targets) {
|
|
4413
|
-
return targets.map(function(target) {
|
|
4414
|
-
if (parent.contains(target)) {
|
|
4415
|
-
return target;
|
|
4416
|
-
}
|
|
4417
|
-
var correctedTarget = unwrapHost(target);
|
|
4418
|
-
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
4419
|
-
return correctedTarget;
|
|
4420
|
-
}
|
|
4421
|
-
console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
|
|
4422
|
-
return null;
|
|
4423
|
-
}).filter(function(x) {
|
|
4424
|
-
return Boolean(x);
|
|
4425
|
-
});
|
|
4426
|
-
};
|
|
4427
|
-
var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
|
|
4428
|
-
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
4429
|
-
if (!markerMap[markerName]) {
|
|
4430
|
-
markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
4431
|
-
}
|
|
4432
|
-
var markerCounter = markerMap[markerName];
|
|
4433
|
-
var hiddenNodes = [];
|
|
4434
|
-
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
4435
|
-
var elementsToStop = new Set(targets);
|
|
4436
|
-
var keep = function(el) {
|
|
4437
|
-
if (!el || elementsToKeep.has(el)) {
|
|
4438
|
-
return;
|
|
4439
|
-
}
|
|
4440
|
-
elementsToKeep.add(el);
|
|
4441
|
-
keep(el.parentNode);
|
|
4442
|
-
};
|
|
4443
|
-
targets.forEach(keep);
|
|
4444
|
-
var deep = function(parent) {
|
|
4445
|
-
if (!parent || elementsToStop.has(parent)) {
|
|
4446
|
-
return;
|
|
4447
|
-
}
|
|
4448
|
-
Array.prototype.forEach.call(parent.children, function(node) {
|
|
4449
|
-
if (elementsToKeep.has(node)) {
|
|
4450
|
-
deep(node);
|
|
4451
|
-
} else {
|
|
4452
|
-
try {
|
|
4453
|
-
var attr = node.getAttribute(controlAttribute);
|
|
4454
|
-
var alreadyHidden = attr !== null && attr !== "false";
|
|
4455
|
-
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
4456
|
-
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
4457
|
-
counterMap.set(node, counterValue);
|
|
4458
|
-
markerCounter.set(node, markerValue);
|
|
4459
|
-
hiddenNodes.push(node);
|
|
4460
|
-
if (counterValue === 1 && alreadyHidden) {
|
|
4461
|
-
uncontrolledNodes.set(node, true);
|
|
4462
|
-
}
|
|
4463
|
-
if (markerValue === 1) {
|
|
4464
|
-
node.setAttribute(markerName, "true");
|
|
4465
|
-
}
|
|
4466
|
-
if (!alreadyHidden) {
|
|
4467
|
-
node.setAttribute(controlAttribute, "true");
|
|
4468
|
-
}
|
|
4469
|
-
} catch (e) {
|
|
4470
|
-
console.error("aria-hidden: cannot operate on ", node, e);
|
|
4471
|
-
}
|
|
4472
|
-
}
|
|
4473
|
-
});
|
|
4474
|
-
};
|
|
4475
|
-
deep(parentNode);
|
|
4476
|
-
elementsToKeep.clear();
|
|
4477
|
-
lockCount++;
|
|
4478
|
-
return function() {
|
|
4479
|
-
hiddenNodes.forEach(function(node) {
|
|
4480
|
-
var counterValue = counterMap.get(node) - 1;
|
|
4481
|
-
var markerValue = markerCounter.get(node) - 1;
|
|
4482
|
-
counterMap.set(node, counterValue);
|
|
4483
|
-
markerCounter.set(node, markerValue);
|
|
4484
|
-
if (!counterValue) {
|
|
4485
|
-
if (!uncontrolledNodes.has(node)) {
|
|
4486
|
-
node.removeAttribute(controlAttribute);
|
|
4487
|
-
}
|
|
4488
|
-
uncontrolledNodes.delete(node);
|
|
4489
|
-
}
|
|
4490
|
-
if (!markerValue) {
|
|
4491
|
-
node.removeAttribute(markerName);
|
|
4492
|
-
}
|
|
4493
|
-
});
|
|
4494
|
-
lockCount--;
|
|
4495
|
-
if (!lockCount) {
|
|
4496
|
-
counterMap = /* @__PURE__ */ new WeakMap();
|
|
4497
|
-
counterMap = /* @__PURE__ */ new WeakMap();
|
|
4498
|
-
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
4499
|
-
markerMap = {};
|
|
4500
|
-
}
|
|
4501
|
-
};
|
|
4502
|
-
};
|
|
4503
|
-
var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
4504
|
-
if (markerName === void 0) {
|
|
4505
|
-
markerName = "data-aria-hidden";
|
|
4506
|
-
}
|
|
4507
|
-
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
4508
|
-
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
4509
|
-
if (!activeParentNode) {
|
|
4510
|
-
return function() {
|
|
4511
|
-
return null;
|
|
4512
|
-
};
|
|
4513
|
-
}
|
|
4514
|
-
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
|
|
4515
|
-
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
4516
|
-
};
|
|
4517
|
-
|
|
4518
|
-
// ../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types+react_848f83211ce5e4d8275fe0d3e11a9387/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
4519
|
-
import { Fragment as Fragment5, jsx as jsx39, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4520
|
-
var DIALOG_NAME = "Dialog";
|
|
4521
|
-
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
4522
|
-
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
4523
|
-
var Dialog = (props) => {
|
|
4524
|
-
const {
|
|
4525
|
-
__scopeDialog,
|
|
4526
|
-
children,
|
|
4527
|
-
open: openProp,
|
|
4528
|
-
defaultOpen,
|
|
4529
|
-
onOpenChange,
|
|
4530
|
-
modal = true
|
|
4531
|
-
} = props;
|
|
4532
|
-
const triggerRef = React54.useRef(null);
|
|
4533
|
-
const contentRef = React54.useRef(null);
|
|
4534
|
-
const [open, setOpen] = useControllableState({
|
|
4535
|
-
prop: openProp,
|
|
4536
|
-
defaultProp: defaultOpen != null ? defaultOpen : false,
|
|
4537
|
-
onChange: onOpenChange,
|
|
4538
|
-
caller: DIALOG_NAME
|
|
4539
|
-
});
|
|
4540
|
-
return /* @__PURE__ */ jsx39(
|
|
4541
|
-
DialogProvider,
|
|
4542
|
-
{
|
|
4543
|
-
scope: __scopeDialog,
|
|
4544
|
-
triggerRef,
|
|
4545
|
-
contentRef,
|
|
4546
|
-
contentId: useId(),
|
|
4547
|
-
titleId: useId(),
|
|
4548
|
-
descriptionId: useId(),
|
|
4549
|
-
open,
|
|
4550
|
-
onOpenChange: setOpen,
|
|
4551
|
-
onOpenToggle: React54.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
4552
|
-
modal,
|
|
4553
|
-
children
|
|
4554
|
-
}
|
|
4555
|
-
);
|
|
4556
|
-
};
|
|
4557
|
-
Dialog.displayName = DIALOG_NAME;
|
|
4558
|
-
var TRIGGER_NAME = "DialogTrigger";
|
|
4559
|
-
var DialogTrigger = React54.forwardRef(
|
|
4560
|
-
(props, forwardedRef) => {
|
|
4561
|
-
const _a = props, { __scopeDialog } = _a, triggerProps = __objRest(_a, ["__scopeDialog"]);
|
|
4562
|
-
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
|
4563
|
-
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
4564
|
-
return /* @__PURE__ */ jsx39(
|
|
4565
|
-
Primitive.button,
|
|
4566
|
-
__spreadProps(__spreadValues({
|
|
4567
|
-
type: "button",
|
|
4568
|
-
"aria-haspopup": "dialog",
|
|
4569
|
-
"aria-expanded": context.open,
|
|
4570
|
-
"aria-controls": context.contentId,
|
|
4571
|
-
"data-state": getState(context.open)
|
|
4572
|
-
}, triggerProps), {
|
|
4573
|
-
ref: composedTriggerRef,
|
|
4574
|
-
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
4575
|
-
})
|
|
4576
|
-
);
|
|
4577
|
-
}
|
|
4578
|
-
);
|
|
4579
|
-
DialogTrigger.displayName = TRIGGER_NAME;
|
|
4580
|
-
var PORTAL_NAME2 = "DialogPortal";
|
|
4581
|
-
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME2, {
|
|
4582
|
-
forceMount: void 0
|
|
4583
|
-
});
|
|
4584
|
-
var DialogPortal = (props) => {
|
|
4585
|
-
const { __scopeDialog, forceMount, children, container } = props;
|
|
4586
|
-
const context = useDialogContext(PORTAL_NAME2, __scopeDialog);
|
|
4587
|
-
return /* @__PURE__ */ jsx39(PortalProvider, { scope: __scopeDialog, forceMount, children: React54.Children.map(children, (child) => /* @__PURE__ */ jsx39(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx39(Portal, { asChild: true, container, children: child }) })) });
|
|
4588
|
-
};
|
|
4589
|
-
DialogPortal.displayName = PORTAL_NAME2;
|
|
4590
|
-
var OVERLAY_NAME = "DialogOverlay";
|
|
4591
|
-
var DialogOverlay = React54.forwardRef(
|
|
4592
|
-
(props, forwardedRef) => {
|
|
4593
|
-
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
4594
|
-
const _a = props, { forceMount = portalContext.forceMount } = _a, overlayProps = __objRest(_a, ["forceMount"]);
|
|
4595
|
-
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
|
4596
|
-
return context.modal ? /* @__PURE__ */ jsx39(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx39(DialogOverlayImpl, __spreadProps(__spreadValues({}, overlayProps), { ref: forwardedRef })) }) : null;
|
|
4597
|
-
}
|
|
4598
|
-
);
|
|
4599
|
-
DialogOverlay.displayName = OVERLAY_NAME;
|
|
4600
|
-
var Slot2 = createSlot("DialogOverlay.RemoveScroll");
|
|
4601
|
-
var DialogOverlayImpl = React54.forwardRef(
|
|
4602
|
-
(props, forwardedRef) => {
|
|
4603
|
-
const _a = props, { __scopeDialog } = _a, overlayProps = __objRest(_a, ["__scopeDialog"]);
|
|
4604
|
-
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
4605
|
-
return (
|
|
4606
|
-
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
4607
|
-
// ie. when `Overlay` and `Content` are siblings
|
|
4608
|
-
/* @__PURE__ */ jsx39(Combination_default, { as: Slot2, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx39(
|
|
4609
|
-
Primitive.div,
|
|
4610
|
-
__spreadProps(__spreadValues({
|
|
4611
|
-
"data-state": getState(context.open)
|
|
4612
|
-
}, overlayProps), {
|
|
4613
|
-
ref: forwardedRef,
|
|
4614
|
-
style: __spreadValues({ pointerEvents: "auto" }, overlayProps.style)
|
|
4615
|
-
})
|
|
4616
|
-
) })
|
|
4617
|
-
);
|
|
4618
|
-
}
|
|
4619
|
-
);
|
|
4620
|
-
var CONTENT_NAME = "DialogContent";
|
|
4621
|
-
var DialogContent = React54.forwardRef(
|
|
4622
|
-
(props, forwardedRef) => {
|
|
4623
|
-
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
|
4624
|
-
const _a = props, { forceMount = portalContext.forceMount } = _a, contentProps = __objRest(_a, ["forceMount"]);
|
|
4625
|
-
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
4626
|
-
return /* @__PURE__ */ jsx39(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx39(DialogContentModal, __spreadProps(__spreadValues({}, contentProps), { ref: forwardedRef })) : /* @__PURE__ */ jsx39(DialogContentNonModal, __spreadProps(__spreadValues({}, contentProps), { ref: forwardedRef })) });
|
|
4627
|
-
}
|
|
4628
|
-
);
|
|
4629
|
-
DialogContent.displayName = CONTENT_NAME;
|
|
4630
|
-
var DialogContentModal = React54.forwardRef(
|
|
4631
|
-
(props, forwardedRef) => {
|
|
4632
|
-
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
4633
|
-
const contentRef = React54.useRef(null);
|
|
4634
|
-
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
4635
|
-
React54.useEffect(() => {
|
|
4636
|
-
const content = contentRef.current;
|
|
4637
|
-
if (content) return hideOthers(content);
|
|
4638
|
-
}, []);
|
|
4639
|
-
return /* @__PURE__ */ jsx39(
|
|
4640
|
-
DialogContentImpl,
|
|
4641
|
-
__spreadProps(__spreadValues({}, props), {
|
|
4642
|
-
ref: composedRefs,
|
|
4643
|
-
trapFocus: context.open,
|
|
4644
|
-
disableOutsidePointerEvents: true,
|
|
4645
|
-
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
4646
|
-
var _a;
|
|
4647
|
-
event.preventDefault();
|
|
4648
|
-
(_a = context.triggerRef.current) == null ? void 0 : _a.focus();
|
|
4649
|
-
}),
|
|
4650
|
-
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
4651
|
-
const originalEvent = event.detail.originalEvent;
|
|
4652
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
4653
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
4654
|
-
if (isRightClick) event.preventDefault();
|
|
4655
|
-
}),
|
|
4656
|
-
onFocusOutside: composeEventHandlers(
|
|
4657
|
-
props.onFocusOutside,
|
|
4658
|
-
(event) => event.preventDefault()
|
|
4659
|
-
)
|
|
4660
|
-
})
|
|
4661
|
-
);
|
|
4662
|
-
}
|
|
4663
|
-
);
|
|
4664
|
-
var DialogContentNonModal = React54.forwardRef(
|
|
4665
|
-
(props, forwardedRef) => {
|
|
4666
|
-
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
4667
|
-
const hasInteractedOutsideRef = React54.useRef(false);
|
|
4668
|
-
const hasPointerDownOutsideRef = React54.useRef(false);
|
|
4669
|
-
return /* @__PURE__ */ jsx39(
|
|
4670
|
-
DialogContentImpl,
|
|
4671
|
-
__spreadProps(__spreadValues({}, props), {
|
|
4672
|
-
ref: forwardedRef,
|
|
4673
|
-
trapFocus: false,
|
|
4674
|
-
disableOutsidePointerEvents: false,
|
|
4675
|
-
onCloseAutoFocus: (event) => {
|
|
4676
|
-
var _a, _b;
|
|
4677
|
-
(_a = props.onCloseAutoFocus) == null ? void 0 : _a.call(props, event);
|
|
4678
|
-
if (!event.defaultPrevented) {
|
|
4679
|
-
if (!hasInteractedOutsideRef.current) (_b = context.triggerRef.current) == null ? void 0 : _b.focus();
|
|
4680
|
-
event.preventDefault();
|
|
4681
|
-
}
|
|
4682
|
-
hasInteractedOutsideRef.current = false;
|
|
4683
|
-
hasPointerDownOutsideRef.current = false;
|
|
4684
|
-
},
|
|
4685
|
-
onInteractOutside: (event) => {
|
|
4686
|
-
var _a, _b;
|
|
4687
|
-
(_a = props.onInteractOutside) == null ? void 0 : _a.call(props, event);
|
|
4688
|
-
if (!event.defaultPrevented) {
|
|
4689
|
-
hasInteractedOutsideRef.current = true;
|
|
4690
|
-
if (event.detail.originalEvent.type === "pointerdown") {
|
|
4691
|
-
hasPointerDownOutsideRef.current = true;
|
|
4692
|
-
}
|
|
4693
|
-
}
|
|
4694
|
-
const target = event.target;
|
|
4695
|
-
const targetIsTrigger = (_b = context.triggerRef.current) == null ? void 0 : _b.contains(target);
|
|
4696
|
-
if (targetIsTrigger) event.preventDefault();
|
|
4697
|
-
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
4698
|
-
event.preventDefault();
|
|
4699
|
-
}
|
|
4700
|
-
}
|
|
4701
|
-
})
|
|
4702
|
-
);
|
|
4703
|
-
}
|
|
4704
|
-
);
|
|
4705
|
-
var DialogContentImpl = React54.forwardRef(
|
|
4706
|
-
(props, forwardedRef) => {
|
|
4707
|
-
const _a = props, { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus } = _a, contentProps = __objRest(_a, ["__scopeDialog", "trapFocus", "onOpenAutoFocus", "onCloseAutoFocus"]);
|
|
4708
|
-
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
4709
|
-
const contentRef = React54.useRef(null);
|
|
4710
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
4711
|
-
useFocusGuards();
|
|
4712
|
-
return /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
4713
|
-
/* @__PURE__ */ jsx39(
|
|
4714
|
-
FocusScope,
|
|
4715
|
-
{
|
|
4716
|
-
asChild: true,
|
|
4717
|
-
loop: true,
|
|
4718
|
-
trapped: trapFocus,
|
|
4719
|
-
onMountAutoFocus: onOpenAutoFocus,
|
|
4720
|
-
onUnmountAutoFocus: onCloseAutoFocus,
|
|
4721
|
-
children: /* @__PURE__ */ jsx39(
|
|
4722
|
-
DismissableLayer,
|
|
4723
|
-
__spreadProps(__spreadValues({
|
|
4724
|
-
role: "dialog",
|
|
4725
|
-
id: context.contentId,
|
|
4726
|
-
"aria-describedby": context.descriptionId,
|
|
4727
|
-
"aria-labelledby": context.titleId,
|
|
4728
|
-
"data-state": getState(context.open)
|
|
4729
|
-
}, contentProps), {
|
|
4730
|
-
ref: composedRefs,
|
|
4731
|
-
onDismiss: () => context.onOpenChange(false)
|
|
4732
|
-
})
|
|
4733
|
-
)
|
|
4734
|
-
}
|
|
4735
|
-
),
|
|
4736
|
-
/* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
4737
|
-
/* @__PURE__ */ jsx39(TitleWarning, { titleId: context.titleId }),
|
|
4738
|
-
/* @__PURE__ */ jsx39(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
|
4739
|
-
] })
|
|
4740
|
-
] });
|
|
4741
|
-
}
|
|
4742
|
-
);
|
|
4743
|
-
var TITLE_NAME = "DialogTitle";
|
|
4744
|
-
var DialogTitle = React54.forwardRef(
|
|
4745
|
-
(props, forwardedRef) => {
|
|
4746
|
-
const _a = props, { __scopeDialog } = _a, titleProps = __objRest(_a, ["__scopeDialog"]);
|
|
4747
|
-
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
4748
|
-
return /* @__PURE__ */ jsx39(Primitive.h2, __spreadProps(__spreadValues({ id: context.titleId }, titleProps), { ref: forwardedRef }));
|
|
4749
|
-
}
|
|
4750
|
-
);
|
|
4751
|
-
DialogTitle.displayName = TITLE_NAME;
|
|
4752
|
-
var DESCRIPTION_NAME = "DialogDescription";
|
|
4753
|
-
var DialogDescription = React54.forwardRef(
|
|
4754
|
-
(props, forwardedRef) => {
|
|
4755
|
-
const _a = props, { __scopeDialog } = _a, descriptionProps = __objRest(_a, ["__scopeDialog"]);
|
|
4756
|
-
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
4757
|
-
return /* @__PURE__ */ jsx39(Primitive.p, __spreadProps(__spreadValues({ id: context.descriptionId }, descriptionProps), { ref: forwardedRef }));
|
|
4758
|
-
}
|
|
4759
|
-
);
|
|
4760
|
-
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
4761
|
-
var CLOSE_NAME = "DialogClose";
|
|
4762
|
-
var DialogClose = React54.forwardRef(
|
|
4763
|
-
(props, forwardedRef) => {
|
|
4764
|
-
const _a = props, { __scopeDialog } = _a, closeProps = __objRest(_a, ["__scopeDialog"]);
|
|
4765
|
-
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
4766
|
-
return /* @__PURE__ */ jsx39(
|
|
4767
|
-
Primitive.button,
|
|
4768
|
-
__spreadProps(__spreadValues({
|
|
4769
|
-
type: "button"
|
|
4770
|
-
}, closeProps), {
|
|
4771
|
-
ref: forwardedRef,
|
|
4772
|
-
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
4773
|
-
})
|
|
4774
|
-
);
|
|
4775
|
-
}
|
|
4776
|
-
);
|
|
4777
|
-
DialogClose.displayName = CLOSE_NAME;
|
|
4778
|
-
function getState(open) {
|
|
4779
|
-
return open ? "open" : "closed";
|
|
4780
|
-
}
|
|
4781
|
-
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
4782
|
-
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
4783
|
-
contentName: CONTENT_NAME,
|
|
4784
|
-
titleName: TITLE_NAME,
|
|
4785
|
-
docsSlug: "dialog"
|
|
4786
|
-
});
|
|
4787
|
-
var TitleWarning = ({ titleId }) => {
|
|
4788
|
-
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
4789
|
-
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
4790
|
-
|
|
4791
|
-
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4792
|
-
|
|
4793
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
4794
|
-
React54.useEffect(() => {
|
|
4795
|
-
if (titleId) {
|
|
4796
|
-
const hasTitle = document.getElementById(titleId);
|
|
4797
|
-
if (!hasTitle) console.error(MESSAGE);
|
|
4798
|
-
}
|
|
4799
|
-
}, [MESSAGE, titleId]);
|
|
4800
|
-
return null;
|
|
4801
|
-
};
|
|
4802
|
-
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
4803
|
-
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
4804
|
-
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
|
4805
|
-
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
4806
|
-
React54.useEffect(() => {
|
|
4807
|
-
var _a;
|
|
4808
|
-
const describedById = (_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby");
|
|
4809
|
-
if (descriptionId && describedById) {
|
|
4810
|
-
const hasDescription = document.getElementById(descriptionId);
|
|
4811
|
-
if (!hasDescription) console.warn(MESSAGE);
|
|
4812
|
-
}
|
|
4813
|
-
}, [MESSAGE, contentRef, descriptionId]);
|
|
4814
|
-
return null;
|
|
4815
|
-
};
|
|
4816
|
-
var Root = Dialog;
|
|
4817
|
-
var Trigger = DialogTrigger;
|
|
4818
|
-
var Portal2 = DialogPortal;
|
|
4819
|
-
var Overlay = DialogOverlay;
|
|
4820
|
-
var Content = DialogContent;
|
|
4821
|
-
var Title = DialogTitle;
|
|
4822
|
-
var Description = DialogDescription;
|
|
4823
|
-
var Close = DialogClose;
|
|
4824
|
-
|
|
4825
|
-
// ../../node_modules/.pnpm/@radix-ui+react-alert-dialog@1.1.14_@types+react-dom@19.1.3_@types+react@19.1.2__@types_c6ff7006a888f63e36d2502e019661c3/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs
|
|
4826
|
-
import { jsx as jsx40, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4827
|
-
var ROOT_NAME = "AlertDialog";
|
|
4828
|
-
var [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
|
|
4829
|
-
createDialogScope
|
|
4830
|
-
]);
|
|
4831
|
-
var useDialogScope = createDialogScope();
|
|
4832
|
-
var AlertDialog = (props) => {
|
|
4833
|
-
const _a = props, { __scopeAlertDialog } = _a, alertDialogProps = __objRest(_a, ["__scopeAlertDialog"]);
|
|
4834
|
-
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
4835
|
-
return /* @__PURE__ */ jsx40(Root, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), alertDialogProps), { modal: true }));
|
|
4836
|
-
};
|
|
4837
|
-
AlertDialog.displayName = ROOT_NAME;
|
|
4838
|
-
var TRIGGER_NAME2 = "AlertDialogTrigger";
|
|
4839
|
-
var AlertDialogTrigger = React55.forwardRef(
|
|
4840
|
-
(props, forwardedRef) => {
|
|
4841
|
-
const _a = props, { __scopeAlertDialog } = _a, triggerProps = __objRest(_a, ["__scopeAlertDialog"]);
|
|
4842
|
-
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
4843
|
-
return /* @__PURE__ */ jsx40(Trigger, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), triggerProps), { ref: forwardedRef }));
|
|
4844
|
-
}
|
|
4845
|
-
);
|
|
4846
|
-
AlertDialogTrigger.displayName = TRIGGER_NAME2;
|
|
4847
|
-
var PORTAL_NAME3 = "AlertDialogPortal";
|
|
4848
|
-
var AlertDialogPortal = (props) => {
|
|
4849
|
-
const _a = props, { __scopeAlertDialog } = _a, portalProps = __objRest(_a, ["__scopeAlertDialog"]);
|
|
4850
|
-
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
4851
|
-
return /* @__PURE__ */ jsx40(Portal2, __spreadValues(__spreadValues({}, dialogScope), portalProps));
|
|
4852
|
-
};
|
|
4853
|
-
AlertDialogPortal.displayName = PORTAL_NAME3;
|
|
4854
|
-
var OVERLAY_NAME2 = "AlertDialogOverlay";
|
|
4855
|
-
var AlertDialogOverlay = React55.forwardRef(
|
|
4856
|
-
(props, forwardedRef) => {
|
|
4857
|
-
const _a = props, { __scopeAlertDialog } = _a, overlayProps = __objRest(_a, ["__scopeAlertDialog"]);
|
|
4858
|
-
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
4859
|
-
return /* @__PURE__ */ jsx40(Overlay, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), overlayProps), { ref: forwardedRef }));
|
|
4860
|
-
}
|
|
4861
|
-
);
|
|
4862
|
-
AlertDialogOverlay.displayName = OVERLAY_NAME2;
|
|
4863
|
-
var CONTENT_NAME2 = "AlertDialogContent";
|
|
4864
|
-
var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME2);
|
|
4865
|
-
var Slottable = createSlottable("AlertDialogContent");
|
|
4866
|
-
var AlertDialogContent = React55.forwardRef(
|
|
4867
|
-
(props, forwardedRef) => {
|
|
4868
|
-
const _a = props, { __scopeAlertDialog, children } = _a, contentProps = __objRest(_a, ["__scopeAlertDialog", "children"]);
|
|
4869
|
-
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
4870
|
-
const contentRef = React55.useRef(null);
|
|
4871
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
4872
|
-
const cancelRef = React55.useRef(null);
|
|
4873
|
-
return /* @__PURE__ */ jsx40(
|
|
4874
|
-
WarningProvider,
|
|
4875
|
-
{
|
|
4876
|
-
contentName: CONTENT_NAME2,
|
|
4877
|
-
titleName: TITLE_NAME2,
|
|
4878
|
-
docsSlug: "alert-dialog",
|
|
4879
|
-
children: /* @__PURE__ */ jsx40(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsxs11(
|
|
4880
|
-
Content,
|
|
4881
|
-
__spreadProps(__spreadValues(__spreadValues({
|
|
4882
|
-
role: "alertdialog"
|
|
4883
|
-
}, dialogScope), contentProps), {
|
|
4884
|
-
ref: composedRefs,
|
|
4885
|
-
onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
|
|
4886
|
-
var _a2;
|
|
4887
|
-
event.preventDefault();
|
|
4888
|
-
(_a2 = cancelRef.current) == null ? void 0 : _a2.focus({ preventScroll: true });
|
|
4889
|
-
}),
|
|
4890
|
-
onPointerDownOutside: (event) => event.preventDefault(),
|
|
4891
|
-
onInteractOutside: (event) => event.preventDefault(),
|
|
4892
|
-
children: [
|
|
4893
|
-
/* @__PURE__ */ jsx40(Slottable, { children }),
|
|
4894
|
-
/* @__PURE__ */ jsx40(DescriptionWarning2, { contentRef })
|
|
4895
|
-
]
|
|
4896
|
-
})
|
|
4897
|
-
) })
|
|
4898
|
-
}
|
|
4899
|
-
);
|
|
4900
|
-
}
|
|
4901
|
-
);
|
|
4902
|
-
AlertDialogContent.displayName = CONTENT_NAME2;
|
|
4903
|
-
var TITLE_NAME2 = "AlertDialogTitle";
|
|
4904
|
-
var AlertDialogTitle = React55.forwardRef(
|
|
4905
|
-
(props, forwardedRef) => {
|
|
4906
|
-
const _a = props, { __scopeAlertDialog } = _a, titleProps = __objRest(_a, ["__scopeAlertDialog"]);
|
|
4907
|
-
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
4908
|
-
return /* @__PURE__ */ jsx40(Title, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), titleProps), { ref: forwardedRef }));
|
|
4909
|
-
}
|
|
4910
|
-
);
|
|
4911
|
-
AlertDialogTitle.displayName = TITLE_NAME2;
|
|
4912
|
-
var DESCRIPTION_NAME2 = "AlertDialogDescription";
|
|
4913
|
-
var AlertDialogDescription = React55.forwardRef((props, forwardedRef) => {
|
|
4914
|
-
const _a = props, { __scopeAlertDialog } = _a, descriptionProps = __objRest(_a, ["__scopeAlertDialog"]);
|
|
4915
|
-
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
4916
|
-
return /* @__PURE__ */ jsx40(Description, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), descriptionProps), { ref: forwardedRef }));
|
|
4917
|
-
});
|
|
4918
|
-
AlertDialogDescription.displayName = DESCRIPTION_NAME2;
|
|
4919
|
-
var ACTION_NAME = "AlertDialogAction";
|
|
4920
|
-
var AlertDialogAction = React55.forwardRef(
|
|
4921
|
-
(props, forwardedRef) => {
|
|
4922
|
-
const _a = props, { __scopeAlertDialog } = _a, actionProps = __objRest(_a, ["__scopeAlertDialog"]);
|
|
4923
|
-
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
4924
|
-
return /* @__PURE__ */ jsx40(Close, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), actionProps), { ref: forwardedRef }));
|
|
4925
|
-
}
|
|
4926
|
-
);
|
|
4927
|
-
AlertDialogAction.displayName = ACTION_NAME;
|
|
4928
|
-
var CANCEL_NAME = "AlertDialogCancel";
|
|
4929
|
-
var AlertDialogCancel = React55.forwardRef(
|
|
4930
|
-
(props, forwardedRef) => {
|
|
4931
|
-
const _a = props, { __scopeAlertDialog } = _a, cancelProps = __objRest(_a, ["__scopeAlertDialog"]);
|
|
4932
|
-
const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
|
|
4933
|
-
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
4934
|
-
const ref = useComposedRefs(forwardedRef, cancelRef);
|
|
4935
|
-
return /* @__PURE__ */ jsx40(Close, __spreadProps(__spreadValues(__spreadValues({}, dialogScope), cancelProps), { ref }));
|
|
4936
|
-
}
|
|
4937
|
-
);
|
|
4938
|
-
AlertDialogCancel.displayName = CANCEL_NAME;
|
|
4939
|
-
var DescriptionWarning2 = ({ contentRef }) => {
|
|
4940
|
-
const MESSAGE = `\`${CONTENT_NAME2}\` requires a description for the component to be accessible for screen reader users.
|
|
4941
|
-
|
|
4942
|
-
You can add a description to the \`${CONTENT_NAME2}\` by passing a \`${DESCRIPTION_NAME2}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4943
|
-
|
|
4944
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME2}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
4945
|
-
|
|
4946
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
|
|
4947
|
-
React55.useEffect(() => {
|
|
4948
|
-
var _a;
|
|
4949
|
-
const hasDescription = document.getElementById(
|
|
4950
|
-
(_a = contentRef.current) == null ? void 0 : _a.getAttribute("aria-describedby")
|
|
4951
|
-
);
|
|
4952
|
-
if (!hasDescription) console.warn(MESSAGE);
|
|
4953
|
-
}, [MESSAGE, contentRef]);
|
|
4954
|
-
return null;
|
|
4955
|
-
};
|
|
4956
|
-
var Root2 = AlertDialog;
|
|
4957
|
-
var Portal22 = AlertDialogPortal;
|
|
4958
|
-
var Overlay2 = AlertDialogOverlay;
|
|
4959
|
-
var Content2 = AlertDialogContent;
|
|
4960
|
-
var Action = AlertDialogAction;
|
|
4961
|
-
var Cancel = AlertDialogCancel;
|
|
4962
|
-
var Title2 = AlertDialogTitle;
|
|
4963
|
-
var Description2 = AlertDialogDescription;
|
|
4964
|
-
|
|
4965
|
-
// ../lib/src/utils.ts
|
|
4966
|
-
import { clsx } from "clsx";
|
|
4967
|
-
import { twMerge } from "tailwind-merge";
|
|
4968
|
-
function cn(...inputs) {
|
|
4969
|
-
return twMerge(clsx(inputs));
|
|
4970
|
-
}
|
|
4971
|
-
|
|
4972
|
-
// ../base-ui/src/ui/button.tsx
|
|
4973
|
-
import * as React56 from "react";
|
|
4974
|
-
import { cva } from "class-variance-authority";
|
|
4975
|
-
import { jsx as jsx41, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4976
|
-
var buttonVariants = cva(
|
|
4977
|
-
"inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
4978
|
-
{
|
|
4979
|
-
variants: {
|
|
4980
|
-
variant: {
|
|
4981
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
4982
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
4983
|
-
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
4984
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
4985
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
4986
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
4987
|
-
},
|
|
4988
|
-
size: {
|
|
4989
|
-
default: "h-10 px-4 py-2",
|
|
4990
|
-
sm: "h-9 rounded-md px-3",
|
|
4991
|
-
lg: "h-11 rounded-md px-8",
|
|
4992
|
-
icon: "h-10 w-10"
|
|
4993
|
-
}
|
|
4994
|
-
},
|
|
4995
|
-
defaultVariants: {
|
|
4996
|
-
variant: "default",
|
|
4997
|
-
size: "default"
|
|
4998
|
-
}
|
|
4999
|
-
}
|
|
5000
|
-
);
|
|
5001
|
-
var Button = React56.forwardRef(
|
|
5002
|
-
(_a, ref) => {
|
|
5003
|
-
var _b = _a, { className, variant, size, asChild = false, loading = false, children } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild", "loading", "children"]);
|
|
5004
|
-
const Comp = asChild ? Slot : "button";
|
|
5005
|
-
if (asChild) {
|
|
5006
|
-
return /* @__PURE__ */ jsx41(
|
|
5007
|
-
Comp,
|
|
5008
|
-
__spreadProps(__spreadValues({
|
|
5009
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
5010
|
-
ref,
|
|
5011
|
-
disabled: loading || props.disabled
|
|
5012
|
-
}, props), {
|
|
5013
|
-
children
|
|
5014
|
-
})
|
|
5015
|
-
);
|
|
5016
|
-
}
|
|
5017
|
-
return /* @__PURE__ */ jsxs12(
|
|
5018
|
-
Comp,
|
|
5019
|
-
__spreadProps(__spreadValues({
|
|
5020
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
5021
|
-
ref,
|
|
5022
|
-
disabled: loading || props.disabled
|
|
5023
|
-
}, props), {
|
|
5024
|
-
children: [
|
|
5025
|
-
children,
|
|
5026
|
-
loading && /* @__PURE__ */ jsx41(globalLucideIcons.Loader2, { className: "ml-2 h-4 w-4 animate-spin" })
|
|
5027
|
-
]
|
|
5028
|
-
})
|
|
5029
|
-
);
|
|
5030
|
-
}
|
|
5031
|
-
);
|
|
5032
|
-
Button.displayName = "Button";
|
|
5033
|
-
|
|
5034
|
-
// ../base-ui/src/ui/alert-dialog.tsx
|
|
5035
|
-
import { jsx as jsx42, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5036
|
-
var AlertDialog2 = Root2;
|
|
5037
|
-
var AlertDialogPortal2 = Portal22;
|
|
5038
|
-
var AlertDialogOverlay2 = React57.forwardRef((_a, ref) => {
|
|
5039
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5040
|
-
return /* @__PURE__ */ jsx42(
|
|
5041
|
-
Overlay2,
|
|
5042
|
-
__spreadProps(__spreadValues({
|
|
5043
|
-
className: cn(
|
|
5044
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
5045
|
-
className
|
|
5046
|
-
)
|
|
5047
|
-
}, props), {
|
|
5048
|
-
ref
|
|
5049
|
-
})
|
|
5050
|
-
);
|
|
5051
|
-
});
|
|
5052
|
-
AlertDialogOverlay2.displayName = Overlay2.displayName;
|
|
5053
|
-
var AlertDialogContent2 = React57.forwardRef((_a, ref) => {
|
|
5054
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5055
|
-
return /* @__PURE__ */ jsxs13(AlertDialogPortal2, { children: [
|
|
5056
|
-
/* @__PURE__ */ jsx42(AlertDialogOverlay2, {}),
|
|
5057
|
-
/* @__PURE__ */ jsx42(
|
|
5058
|
-
Content2,
|
|
5059
|
-
__spreadValues({
|
|
5060
|
-
ref,
|
|
5061
|
-
className: cn(
|
|
5062
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
5063
|
-
className
|
|
5064
|
-
)
|
|
5065
|
-
}, props)
|
|
5066
|
-
)
|
|
5067
|
-
] });
|
|
5068
|
-
});
|
|
5069
|
-
AlertDialogContent2.displayName = Content2.displayName;
|
|
5070
|
-
var AlertDialogHeader = (_a) => {
|
|
5071
|
-
var _b = _a, {
|
|
5072
|
-
className
|
|
5073
|
-
} = _b, props = __objRest(_b, [
|
|
5074
|
-
"className"
|
|
5075
|
-
]);
|
|
5076
|
-
return /* @__PURE__ */ jsx42(
|
|
5077
|
-
"div",
|
|
5078
|
-
__spreadValues({
|
|
5079
|
-
className: cn(
|
|
5080
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
5081
|
-
className
|
|
5082
|
-
)
|
|
5083
|
-
}, props)
|
|
5084
|
-
);
|
|
5085
|
-
};
|
|
5086
|
-
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
5087
|
-
var AlertDialogFooter = (_a) => {
|
|
5088
|
-
var _b = _a, {
|
|
5089
|
-
className
|
|
5090
|
-
} = _b, props = __objRest(_b, [
|
|
5091
|
-
"className"
|
|
5092
|
-
]);
|
|
5093
|
-
return /* @__PURE__ */ jsx42(
|
|
5094
|
-
"div",
|
|
5095
|
-
__spreadValues({
|
|
5096
|
-
className: cn(
|
|
5097
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
5098
|
-
className
|
|
5099
|
-
)
|
|
5100
|
-
}, props)
|
|
5101
|
-
);
|
|
5102
|
-
};
|
|
5103
|
-
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
5104
|
-
var AlertDialogTitle2 = React57.forwardRef((_a, ref) => {
|
|
5105
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5106
|
-
return /* @__PURE__ */ jsx42(
|
|
5107
|
-
Title2,
|
|
5108
|
-
__spreadValues({
|
|
5109
|
-
ref,
|
|
5110
|
-
className: cn("text-lg font-semibold", className)
|
|
5111
|
-
}, props)
|
|
5112
|
-
);
|
|
5113
|
-
});
|
|
5114
|
-
AlertDialogTitle2.displayName = Title2.displayName;
|
|
5115
|
-
var AlertDialogDescription2 = React57.forwardRef((_a, ref) => {
|
|
5116
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5117
|
-
return /* @__PURE__ */ jsx42(
|
|
5118
|
-
Description2,
|
|
5119
|
-
__spreadValues({
|
|
5120
|
-
ref,
|
|
5121
|
-
className: cn("text-sm text-muted-foreground", className)
|
|
5122
|
-
}, props)
|
|
5123
|
-
);
|
|
5124
|
-
});
|
|
5125
|
-
AlertDialogDescription2.displayName = Description2.displayName;
|
|
5126
|
-
var AlertDialogAction2 = React57.forwardRef((_a, ref) => {
|
|
5127
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5128
|
-
return /* @__PURE__ */ jsx42(
|
|
5129
|
-
Action,
|
|
5130
|
-
__spreadValues({
|
|
5131
|
-
ref,
|
|
5132
|
-
className: cn(buttonVariants(), className)
|
|
5133
|
-
}, props)
|
|
5134
|
-
);
|
|
5135
|
-
});
|
|
5136
|
-
AlertDialogAction2.displayName = Action.displayName;
|
|
5137
|
-
var AlertDialogCancel2 = React57.forwardRef((_a, ref) => {
|
|
5138
|
-
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
5139
|
-
return /* @__PURE__ */ jsx42(
|
|
5140
|
-
Cancel,
|
|
5141
|
-
__spreadValues({
|
|
5142
|
-
ref,
|
|
5143
|
-
className: cn(
|
|
5144
|
-
buttonVariants({ variant: "outline" }),
|
|
5145
|
-
"mt-2 sm:mt-0",
|
|
5146
|
-
className
|
|
5147
|
-
)
|
|
5148
|
-
}, props)
|
|
5149
|
-
);
|
|
5150
|
-
});
|
|
5151
|
-
AlertDialogCancel2.displayName = Cancel.displayName;
|
|
5152
|
-
|
|
5153
2697
|
// src/fuma/mdx/mermaid.tsx
|
|
5154
2698
|
import { useTheme } from "next-themes";
|
|
5155
|
-
import { useCallback
|
|
5156
|
-
import { jsx as
|
|
2699
|
+
import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
2700
|
+
import { jsx as jsx33, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5157
2701
|
function Mermaid({ chart, title, watermarkEnabled, watermarkText, enablePreview = true }) {
|
|
5158
|
-
const id =
|
|
5159
|
-
const [svg, setSvg] =
|
|
2702
|
+
const id = useId();
|
|
2703
|
+
const [svg, setSvg] = useState("");
|
|
5160
2704
|
const { resolvedTheme } = useTheme();
|
|
5161
|
-
const [open, setOpen] =
|
|
5162
|
-
const [scale, setScale] =
|
|
5163
|
-
const [translate, setTranslate] =
|
|
5164
|
-
const isPanningRef =
|
|
5165
|
-
const startPointRef =
|
|
5166
|
-
const startTranslateRef =
|
|
5167
|
-
|
|
2705
|
+
const [open, setOpen] = useState(false);
|
|
2706
|
+
const [scale, setScale] = useState(1);
|
|
2707
|
+
const [translate, setTranslate] = useState({ x: 0, y: 0 });
|
|
2708
|
+
const isPanningRef = useRef(false);
|
|
2709
|
+
const startPointRef = useRef({ x: 0, y: 0 });
|
|
2710
|
+
const startTranslateRef = useRef({ x: 0, y: 0 });
|
|
2711
|
+
useEffect(() => {
|
|
5168
2712
|
let isMounted = true;
|
|
5169
2713
|
void renderChart();
|
|
5170
2714
|
function renderChart() {
|
|
@@ -5199,14 +2743,14 @@ function Mermaid({ chart, title, watermarkEnabled, watermarkText, enablePreview
|
|
|
5199
2743
|
};
|
|
5200
2744
|
}, [chart, id, resolvedTheme, watermarkEnabled, watermarkText]);
|
|
5201
2745
|
const clamp = (v, min, max) => Math.min(Math.max(v, min), max);
|
|
5202
|
-
const resetTransform =
|
|
2746
|
+
const resetTransform = useCallback(() => {
|
|
5203
2747
|
setScale(1);
|
|
5204
2748
|
setTranslate({ x: 0, y: 0 });
|
|
5205
2749
|
}, []);
|
|
5206
|
-
const zoomBy =
|
|
2750
|
+
const zoomBy = useCallback((delta) => {
|
|
5207
2751
|
setScale((prev) => clamp(prev + delta, 0.25, 6));
|
|
5208
2752
|
}, []);
|
|
5209
|
-
const onWheel =
|
|
2753
|
+
const onWheel = useCallback((e) => {
|
|
5210
2754
|
if (e.metaKey || e.ctrlKey) {
|
|
5211
2755
|
e.preventDefault();
|
|
5212
2756
|
const delta = e.deltaY > 0 ? -0.1 : 0.1;
|
|
@@ -5215,125 +2759,139 @@ function Mermaid({ chart, title, watermarkEnabled, watermarkText, enablePreview
|
|
|
5215
2759
|
setTranslate((prev) => ({ x: prev.x, y: prev.y - e.deltaY }));
|
|
5216
2760
|
}
|
|
5217
2761
|
}, []);
|
|
5218
|
-
const onPointerDown =
|
|
2762
|
+
const onPointerDown = useCallback((e) => {
|
|
5219
2763
|
isPanningRef.current = true;
|
|
5220
2764
|
startPointRef.current = { x: e.clientX, y: e.clientY };
|
|
5221
2765
|
startTranslateRef.current = __spreadValues({}, translate);
|
|
5222
2766
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
5223
2767
|
}, [translate]);
|
|
5224
|
-
const onPointerMove =
|
|
2768
|
+
const onPointerMove = useCallback((e) => {
|
|
5225
2769
|
if (!isPanningRef.current) return;
|
|
5226
2770
|
const dx = e.clientX - startPointRef.current.x;
|
|
5227
2771
|
const dy = e.clientY - startPointRef.current.y;
|
|
5228
2772
|
setTranslate({ x: startTranslateRef.current.x + dx, y: startTranslateRef.current.y + dy });
|
|
5229
2773
|
}, []);
|
|
5230
|
-
const onPointerUp =
|
|
2774
|
+
const onPointerUp = useCallback((e) => {
|
|
5231
2775
|
isPanningRef.current = false;
|
|
5232
2776
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
5233
2777
|
}, []);
|
|
5234
|
-
return /* @__PURE__ */
|
|
5235
|
-
/* @__PURE__ */
|
|
2778
|
+
return /* @__PURE__ */ jsxs10("div", { children: [
|
|
2779
|
+
/* @__PURE__ */ jsxs10(
|
|
5236
2780
|
"div",
|
|
5237
2781
|
{
|
|
5238
2782
|
className: enablePreview ? "group relative cursor-zoom-in" : void 0,
|
|
5239
2783
|
onClick: () => enablePreview && svg && setOpen(true),
|
|
5240
2784
|
children: [
|
|
5241
|
-
/* @__PURE__ */
|
|
5242
|
-
enablePreview && svg && /* @__PURE__ */
|
|
2785
|
+
/* @__PURE__ */ jsx33("div", { dangerouslySetInnerHTML: { __html: svg } }),
|
|
2786
|
+
enablePreview && svg && /* @__PURE__ */ jsx33("div", { className: "pointer-events-none absolute right-2 top-2 hidden rounded bg-black/50 px-2 py-0.5 text-[12px] text-white group-hover:block", children: "Preview Chart" })
|
|
5243
2787
|
]
|
|
5244
2788
|
}
|
|
5245
2789
|
),
|
|
5246
|
-
title && /* @__PURE__ */
|
|
2790
|
+
title && /* @__PURE__ */ jsxs10(
|
|
5247
2791
|
"div",
|
|
5248
2792
|
{
|
|
5249
2793
|
className: "mt-2 flex items-center justify-center text-center text-[13px] font-italic text-[#AC62FD]",
|
|
5250
2794
|
children: [
|
|
5251
|
-
/* @__PURE__ */
|
|
5252
|
-
/* @__PURE__ */
|
|
2795
|
+
/* @__PURE__ */ jsx33(globalLucideIcons.Mmd, { className: "mr-1 h-4 w-4" }),
|
|
2796
|
+
/* @__PURE__ */ jsx33("span", { children: title })
|
|
5253
2797
|
]
|
|
5254
2798
|
}
|
|
5255
2799
|
),
|
|
5256
|
-
enablePreview && /* @__PURE__ */
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
/* @__PURE__ */
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
{
|
|
5270
|
-
"
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
] }),
|
|
5309
|
-
/* @__PURE__ */ jsxs14(
|
|
5310
|
-
"div",
|
|
5311
|
-
{
|
|
5312
|
-
className: "relative h-[calc(88vh-40px)] w-full overflow-hidden bg-white dark:bg-neutral-900",
|
|
5313
|
-
onWheel,
|
|
5314
|
-
onPointerDown,
|
|
5315
|
-
onPointerMove,
|
|
5316
|
-
onPointerUp,
|
|
5317
|
-
children: [
|
|
5318
|
-
/* @__PURE__ */ jsx43(
|
|
5319
|
-
"div",
|
|
5320
|
-
{
|
|
5321
|
-
className: "absolute left-1/2 top-1/2",
|
|
5322
|
-
style: { transform: `translate(-50%, -50%) translate(${translate.x}px, ${translate.y}px)` },
|
|
5323
|
-
children: /* @__PURE__ */ jsx43(
|
|
5324
|
-
"div",
|
|
2800
|
+
enablePreview && open && /* @__PURE__ */ jsxs10(
|
|
2801
|
+
"div",
|
|
2802
|
+
{
|
|
2803
|
+
role: "dialog",
|
|
2804
|
+
"aria-modal": "true",
|
|
2805
|
+
"aria-label": typeof title === "string" ? title : "Mermaid Preview",
|
|
2806
|
+
className: "fixed inset-0 z-[9999] flex items-center justify-center",
|
|
2807
|
+
children: [
|
|
2808
|
+
/* @__PURE__ */ jsx33("div", { className: "absolute inset-0 bg-black/60", onClick: () => {
|
|
2809
|
+
setOpen(false);
|
|
2810
|
+
resetTransform();
|
|
2811
|
+
} }),
|
|
2812
|
+
/* @__PURE__ */ jsxs10("div", { className: "relative z-[1] max-w-[95vw] w-[95vw] h-[88vh] p-0 bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-700 rounded-md shadow-2xl overflow-hidden", children: [
|
|
2813
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between px-3 py-2 border-b border-neutral-200 dark:border-neutral-700", children: [
|
|
2814
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2 text-sm text-neutral-600 dark:text-neutral-300", children: [
|
|
2815
|
+
/* @__PURE__ */ jsx33(globalLucideIcons.Mmd, { className: "h-4 w-4" }),
|
|
2816
|
+
/* @__PURE__ */ jsx33("span", { className: "truncate max-w-[50vw]", children: title != null ? title : "Mermaid Preview" })
|
|
2817
|
+
] }),
|
|
2818
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-0.5", children: [
|
|
2819
|
+
/* @__PURE__ */ jsx33(
|
|
2820
|
+
"button",
|
|
2821
|
+
{
|
|
2822
|
+
"aria-label": "Zoom out",
|
|
2823
|
+
className: "flex h-6 w-6 items-center justify-center rounded border border-neutral-300 dark:border-neutral-600 text-[13px]",
|
|
2824
|
+
onClick: () => zoomBy(-0.2),
|
|
2825
|
+
children: "\uFF0D"
|
|
2826
|
+
}
|
|
2827
|
+
),
|
|
2828
|
+
/* @__PURE__ */ jsxs10("span", { className: "mx-0.5 text-[12px] w-12 text-center select-none", children: [
|
|
2829
|
+
Math.round(scale * 100),
|
|
2830
|
+
"%"
|
|
2831
|
+
] }),
|
|
2832
|
+
/* @__PURE__ */ jsx33(
|
|
2833
|
+
"button",
|
|
2834
|
+
{
|
|
2835
|
+
"aria-label": "Zoom in",
|
|
2836
|
+
className: "flex h-6 w-6 items-center justify-center rounded border border-neutral-300 dark:border-neutral-600 text-[13px]",
|
|
2837
|
+
onClick: () => zoomBy(0.2),
|
|
2838
|
+
children: "\uFF0B"
|
|
2839
|
+
}
|
|
2840
|
+
),
|
|
2841
|
+
/* @__PURE__ */ jsx33(
|
|
2842
|
+
"button",
|
|
2843
|
+
{
|
|
2844
|
+
"aria-label": "Reset",
|
|
2845
|
+
className: "ml-1 flex h-6 w-6 items-center justify-center rounded text-purple-500 hover:text-purple-600",
|
|
2846
|
+
onClick: resetTransform,
|
|
2847
|
+
children: /* @__PURE__ */ jsx33(globalLucideIcons.RefreshCcw, { className: "h-3.5 w-3.5" })
|
|
2848
|
+
}
|
|
2849
|
+
),
|
|
2850
|
+
/* @__PURE__ */ jsx33(
|
|
2851
|
+
"button",
|
|
5325
2852
|
{
|
|
5326
|
-
|
|
5327
|
-
|
|
2853
|
+
"aria-label": "Close",
|
|
2854
|
+
className: "ml-1 flex h-6 w-6 items-center justify-center rounded text-purple-500 hover:text-purple-600",
|
|
2855
|
+
onClick: () => {
|
|
2856
|
+
setOpen(false);
|
|
2857
|
+
resetTransform();
|
|
2858
|
+
},
|
|
2859
|
+
children: /* @__PURE__ */ jsx33(globalLucideIcons.X, { className: "h-3.5 w-3.5" })
|
|
5328
2860
|
}
|
|
5329
2861
|
)
|
|
2862
|
+
] })
|
|
2863
|
+
] }),
|
|
2864
|
+
/* @__PURE__ */ jsxs10(
|
|
2865
|
+
"div",
|
|
2866
|
+
{
|
|
2867
|
+
className: "relative h-[calc(88vh-40px)] w-full overflow-hidden bg-white dark:bg-neutral-900",
|
|
2868
|
+
onWheel,
|
|
2869
|
+
onPointerDown,
|
|
2870
|
+
onPointerMove,
|
|
2871
|
+
onPointerUp,
|
|
2872
|
+
children: [
|
|
2873
|
+
/* @__PURE__ */ jsx33(
|
|
2874
|
+
"div",
|
|
2875
|
+
{
|
|
2876
|
+
className: "absolute left-1/2 top-1/2",
|
|
2877
|
+
style: { transform: `translate(-50%, -50%) translate(${translate.x}px, ${translate.y}px)` },
|
|
2878
|
+
children: /* @__PURE__ */ jsx33(
|
|
2879
|
+
"div",
|
|
2880
|
+
{
|
|
2881
|
+
style: { transform: `scale(${scale})`, transformOrigin: "50% 50%" },
|
|
2882
|
+
dangerouslySetInnerHTML: { __html: svg }
|
|
2883
|
+
}
|
|
2884
|
+
)
|
|
2885
|
+
}
|
|
2886
|
+
),
|
|
2887
|
+
/* @__PURE__ */ jsx33("div", { className: "pointer-events-none absolute bottom-2 right-3 rounded bg-black/40 px-2 py-1 text-xs text-white", children: "Drag to pan, hold Cmd/Ctrl + scroll to zoom" })
|
|
2888
|
+
]
|
|
5330
2889
|
}
|
|
5331
|
-
)
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
] }) })
|
|
2890
|
+
)
|
|
2891
|
+
] })
|
|
2892
|
+
]
|
|
2893
|
+
}
|
|
2894
|
+
)
|
|
5337
2895
|
] });
|
|
5338
2896
|
}
|
|
5339
2897
|
function addWatermarkToSvg(svg, watermark) {
|
|
@@ -5356,9 +2914,9 @@ function addWatermarkToSvg(svg, watermark) {
|
|
|
5356
2914
|
|
|
5357
2915
|
// src/fuma/mdx/image-zoom.tsx
|
|
5358
2916
|
import { Image } from "fumadocs-core/framework";
|
|
5359
|
-
import { useState as
|
|
2917
|
+
import { useState as useState2 } from "react";
|
|
5360
2918
|
import Zoom from "react-medium-image-zoom";
|
|
5361
|
-
import { jsx as
|
|
2919
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
5362
2920
|
function getImageSrc(src) {
|
|
5363
2921
|
if (typeof src === "string") return src;
|
|
5364
2922
|
if (typeof src === "object") {
|
|
@@ -5381,14 +2939,14 @@ function ImageZoom(_a) {
|
|
|
5381
2939
|
"fallbackSrc"
|
|
5382
2940
|
]);
|
|
5383
2941
|
var _a2;
|
|
5384
|
-
const [imgSrc, setImgSrc] =
|
|
2942
|
+
const [imgSrc, setImgSrc] = useState2(getImageSrc(props.src));
|
|
5385
2943
|
const handleError = () => {
|
|
5386
2944
|
console.warn("ImageZoom check error:", imgSrc, fallbackSrc);
|
|
5387
2945
|
if (imgSrc !== fallbackSrc) {
|
|
5388
2946
|
setImgSrc(fallbackSrc);
|
|
5389
2947
|
}
|
|
5390
2948
|
};
|
|
5391
|
-
return /* @__PURE__ */
|
|
2949
|
+
return /* @__PURE__ */ jsx34(
|
|
5392
2950
|
Zoom,
|
|
5393
2951
|
__spreadProps(__spreadValues({
|
|
5394
2952
|
zoomMargin: 20,
|
|
@@ -5400,7 +2958,7 @@ function ImageZoom(_a) {
|
|
|
5400
2958
|
}, zoomInProps), {
|
|
5401
2959
|
onError: handleError
|
|
5402
2960
|
}),
|
|
5403
|
-
children: children != null ? children : /* @__PURE__ */
|
|
2961
|
+
children: children != null ? children : /* @__PURE__ */ jsx34(
|
|
5404
2962
|
Image,
|
|
5405
2963
|
__spreadProps(__spreadValues({}, props), {
|
|
5406
2964
|
src: imgSrc,
|
|
@@ -5417,36 +2975,36 @@ function ImageZoom(_a) {
|
|
|
5417
2975
|
}
|
|
5418
2976
|
|
|
5419
2977
|
// src/fuma/mdx/trophy-card.tsx
|
|
5420
|
-
import { jsx as
|
|
2978
|
+
import { jsx as jsx35, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5421
2979
|
function TrophyCard({
|
|
5422
|
-
icon = /* @__PURE__ */
|
|
2980
|
+
icon = /* @__PURE__ */ jsx35(globalLucideIcons.Star, {}),
|
|
5423
2981
|
title,
|
|
5424
2982
|
children
|
|
5425
2983
|
}) {
|
|
5426
|
-
return /* @__PURE__ */
|
|
2984
|
+
return /* @__PURE__ */ jsxs11(
|
|
5427
2985
|
"div",
|
|
5428
2986
|
{
|
|
5429
2987
|
className: "\n border-2 rounded-xl px-4 py-2\n border-purple-200 dark:border-gray-500\n ",
|
|
5430
2988
|
children: [
|
|
5431
|
-
/* @__PURE__ */
|
|
5432
|
-
/* @__PURE__ */
|
|
5433
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center font-bold text-sm", children: [
|
|
2990
|
+
/* @__PURE__ */ jsx35("span", { className: "mr-2", children: icon }),
|
|
2991
|
+
/* @__PURE__ */ jsx35("span", { children: title })
|
|
5434
2992
|
] }),
|
|
5435
|
-
/* @__PURE__ */
|
|
2993
|
+
/* @__PURE__ */ jsx35("div", { className: "text-sm -mt-1 leading-none", children })
|
|
5436
2994
|
]
|
|
5437
2995
|
}
|
|
5438
2996
|
);
|
|
5439
2997
|
}
|
|
5440
2998
|
|
|
5441
2999
|
// src/fuma/mdx/image-grid.tsx
|
|
5442
|
-
import { jsx as
|
|
3000
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5443
3001
|
function ImageGrid({
|
|
5444
3002
|
type = "url",
|
|
5445
3003
|
images,
|
|
5446
3004
|
altPrefix = "",
|
|
5447
3005
|
cdnBaseUrl
|
|
5448
3006
|
}) {
|
|
5449
|
-
return /* @__PURE__ */
|
|
3007
|
+
return /* @__PURE__ */ jsx36(
|
|
5450
3008
|
"div",
|
|
5451
3009
|
{
|
|
5452
3010
|
style: {
|
|
@@ -5456,7 +3014,7 @@ function ImageGrid({
|
|
|
5456
3014
|
justifyItems: "center",
|
|
5457
3015
|
alignItems: "center"
|
|
5458
3016
|
},
|
|
5459
|
-
children: images.map((img, idx) => /* @__PURE__ */
|
|
3017
|
+
children: images.map((img, idx) => /* @__PURE__ */ jsx36(
|
|
5460
3018
|
ImageZoom,
|
|
5461
3019
|
{
|
|
5462
3020
|
src: img.startsWith("http://") || img.startsWith("https://") ? img : type === "url" ? `${cdnBaseUrl == null ? void 0 : cdnBaseUrl.replace(/\/+$/, "")}/${img.replace(/^\/+/, "")}` : img,
|
|
@@ -5468,15 +3026,22 @@ function ImageGrid({
|
|
|
5468
3026
|
);
|
|
5469
3027
|
}
|
|
5470
3028
|
|
|
3029
|
+
// ../lib/src/utils.ts
|
|
3030
|
+
import { clsx } from "clsx";
|
|
3031
|
+
import { twMerge } from "tailwind-merge";
|
|
3032
|
+
function cn(...inputs) {
|
|
3033
|
+
return twMerge(clsx(inputs));
|
|
3034
|
+
}
|
|
3035
|
+
|
|
5471
3036
|
// src/fuma/mdx/zia-card.tsx
|
|
5472
3037
|
import Link2 from "next/link";
|
|
5473
|
-
import { jsx as
|
|
3038
|
+
import { jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5474
3039
|
function ZiaCard(_a) {
|
|
5475
3040
|
var _b = _a, { icon, title, description } = _b, props = __objRest(_b, ["icon", "title", "description"]);
|
|
5476
3041
|
const validHref = typeof props.href === "string" && props.href.trim() !== "";
|
|
5477
3042
|
const validDescription = typeof description === "string" && (description == null ? void 0 : description.trim()) !== "";
|
|
5478
3043
|
if (validHref) {
|
|
5479
|
-
return /* @__PURE__ */
|
|
3044
|
+
return /* @__PURE__ */ jsxs12(
|
|
5480
3045
|
Link2,
|
|
5481
3046
|
__spreadProps(__spreadValues({
|
|
5482
3047
|
href: props.href,
|
|
@@ -5488,15 +3053,15 @@ function ZiaCard(_a) {
|
|
|
5488
3053
|
)
|
|
5489
3054
|
}, props), {
|
|
5490
3055
|
children: [
|
|
5491
|
-
/* @__PURE__ */
|
|
5492
|
-
/* @__PURE__ */
|
|
5493
|
-
validDescription ? /* @__PURE__ */
|
|
5494
|
-
props.children ? /* @__PURE__ */
|
|
3056
|
+
/* @__PURE__ */ jsx37("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : /* @__PURE__ */ jsx37(globalLucideIcons.CircleSmall, {}) }),
|
|
3057
|
+
/* @__PURE__ */ jsx37("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
|
|
3058
|
+
validDescription ? /* @__PURE__ */ jsx37("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ jsx37("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
|
|
3059
|
+
props.children ? /* @__PURE__ */ jsx37("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
|
|
5495
3060
|
]
|
|
5496
3061
|
})
|
|
5497
3062
|
);
|
|
5498
3063
|
}
|
|
5499
|
-
return /* @__PURE__ */
|
|
3064
|
+
return /* @__PURE__ */ jsxs12(
|
|
5500
3065
|
"div",
|
|
5501
3066
|
__spreadProps(__spreadValues({
|
|
5502
3067
|
"data-card": true,
|
|
@@ -5506,19 +3071,207 @@ function ZiaCard(_a) {
|
|
|
5506
3071
|
)
|
|
5507
3072
|
}, props), {
|
|
5508
3073
|
children: [
|
|
5509
|
-
/* @__PURE__ */
|
|
5510
|
-
/* @__PURE__ */
|
|
5511
|
-
validDescription ? /* @__PURE__ */
|
|
5512
|
-
props.children ? /* @__PURE__ */
|
|
3074
|
+
/* @__PURE__ */ jsx37("div", { className: "not-prose mb-2 w-fit rounded-md border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4", children: icon ? icon : /* @__PURE__ */ jsx37(globalLucideIcons.CircleSmall, {}) }),
|
|
3075
|
+
/* @__PURE__ */ jsx37("h3", { className: "not-prose mb-1 text-sm font-medium line-clamp-2 min-h-[2.5rem]", children: title }),
|
|
3076
|
+
validDescription ? /* @__PURE__ */ jsx37("p", { className: "!my-0 text-sm text-fd-muted-foreground", children: description }) : /* @__PURE__ */ jsx37("p", { className: "!my-0 text-sm text-fd-muted-foreground opacity-0 select-none", children: "\xA0" }),
|
|
3077
|
+
props.children ? /* @__PURE__ */ jsx37("div", { className: "text-sm text-fd-muted-foreground prose-no-margin", children: props.children }) : null
|
|
5513
3078
|
]
|
|
5514
3079
|
})
|
|
5515
3080
|
);
|
|
5516
3081
|
}
|
|
5517
3082
|
|
|
3083
|
+
// ../base-ui/src/ui/button.tsx
|
|
3084
|
+
import * as React35 from "react";
|
|
3085
|
+
|
|
3086
|
+
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
3087
|
+
import * as React34 from "react";
|
|
3088
|
+
|
|
3089
|
+
// ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
3090
|
+
import * as React33 from "react";
|
|
3091
|
+
function setRef(ref, value) {
|
|
3092
|
+
if (typeof ref === "function") {
|
|
3093
|
+
return ref(value);
|
|
3094
|
+
} else if (ref !== null && ref !== void 0) {
|
|
3095
|
+
ref.current = value;
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3098
|
+
function composeRefs(...refs) {
|
|
3099
|
+
return (node) => {
|
|
3100
|
+
let hasCleanup = false;
|
|
3101
|
+
const cleanups = refs.map((ref) => {
|
|
3102
|
+
const cleanup = setRef(ref, node);
|
|
3103
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
3104
|
+
hasCleanup = true;
|
|
3105
|
+
}
|
|
3106
|
+
return cleanup;
|
|
3107
|
+
});
|
|
3108
|
+
if (hasCleanup) {
|
|
3109
|
+
return () => {
|
|
3110
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
3111
|
+
const cleanup = cleanups[i];
|
|
3112
|
+
if (typeof cleanup == "function") {
|
|
3113
|
+
cleanup();
|
|
3114
|
+
} else {
|
|
3115
|
+
setRef(refs[i], null);
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
};
|
|
3119
|
+
}
|
|
3120
|
+
};
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.2_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
3124
|
+
import { Fragment as Fragment2, jsx as jsx38 } from "react/jsx-runtime";
|
|
3125
|
+
// @__NO_SIDE_EFFECTS__
|
|
3126
|
+
function createSlot(ownerName) {
|
|
3127
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
3128
|
+
const Slot2 = React34.forwardRef((props, forwardedRef) => {
|
|
3129
|
+
const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
|
|
3130
|
+
const childrenArray = React34.Children.toArray(children);
|
|
3131
|
+
const slottable = childrenArray.find(isSlottable);
|
|
3132
|
+
if (slottable) {
|
|
3133
|
+
const newElement = slottable.props.children;
|
|
3134
|
+
const newChildren = childrenArray.map((child) => {
|
|
3135
|
+
if (child === slottable) {
|
|
3136
|
+
if (React34.Children.count(newElement) > 1) return React34.Children.only(null);
|
|
3137
|
+
return React34.isValidElement(newElement) ? newElement.props.children : null;
|
|
3138
|
+
} else {
|
|
3139
|
+
return child;
|
|
3140
|
+
}
|
|
3141
|
+
});
|
|
3142
|
+
return /* @__PURE__ */ jsx38(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children: React34.isValidElement(newElement) ? React34.cloneElement(newElement, void 0, newChildren) : null }));
|
|
3143
|
+
}
|
|
3144
|
+
return /* @__PURE__ */ jsx38(SlotClone, __spreadProps(__spreadValues({}, slotProps), { ref: forwardedRef, children }));
|
|
3145
|
+
});
|
|
3146
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
3147
|
+
return Slot2;
|
|
3148
|
+
}
|
|
3149
|
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
3150
|
+
// @__NO_SIDE_EFFECTS__
|
|
3151
|
+
function createSlotClone(ownerName) {
|
|
3152
|
+
const SlotClone = React34.forwardRef((props, forwardedRef) => {
|
|
3153
|
+
const _a = props, { children } = _a, slotProps = __objRest(_a, ["children"]);
|
|
3154
|
+
if (React34.isValidElement(children)) {
|
|
3155
|
+
const childrenRef = getElementRef(children);
|
|
3156
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
3157
|
+
if (children.type !== React34.Fragment) {
|
|
3158
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
3159
|
+
}
|
|
3160
|
+
return React34.cloneElement(children, props2);
|
|
3161
|
+
}
|
|
3162
|
+
return React34.Children.count(children) > 1 ? React34.Children.only(null) : null;
|
|
3163
|
+
});
|
|
3164
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
3165
|
+
return SlotClone;
|
|
3166
|
+
}
|
|
3167
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
3168
|
+
function isSlottable(child) {
|
|
3169
|
+
return React34.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
3170
|
+
}
|
|
3171
|
+
function mergeProps(slotProps, childProps) {
|
|
3172
|
+
const overrideProps = __spreadValues({}, childProps);
|
|
3173
|
+
for (const propName in childProps) {
|
|
3174
|
+
const slotPropValue = slotProps[propName];
|
|
3175
|
+
const childPropValue = childProps[propName];
|
|
3176
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
3177
|
+
if (isHandler) {
|
|
3178
|
+
if (slotPropValue && childPropValue) {
|
|
3179
|
+
overrideProps[propName] = (...args) => {
|
|
3180
|
+
const result = childPropValue(...args);
|
|
3181
|
+
slotPropValue(...args);
|
|
3182
|
+
return result;
|
|
3183
|
+
};
|
|
3184
|
+
} else if (slotPropValue) {
|
|
3185
|
+
overrideProps[propName] = slotPropValue;
|
|
3186
|
+
}
|
|
3187
|
+
} else if (propName === "style") {
|
|
3188
|
+
overrideProps[propName] = __spreadValues(__spreadValues({}, slotPropValue), childPropValue);
|
|
3189
|
+
} else if (propName === "className") {
|
|
3190
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
return __spreadValues(__spreadValues({}, slotProps), overrideProps);
|
|
3194
|
+
}
|
|
3195
|
+
function getElementRef(element) {
|
|
3196
|
+
var _a, _b;
|
|
3197
|
+
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
3198
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
3199
|
+
if (mayWarn) {
|
|
3200
|
+
return element.ref;
|
|
3201
|
+
}
|
|
3202
|
+
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
3203
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
3204
|
+
if (mayWarn) {
|
|
3205
|
+
return element.props.ref;
|
|
3206
|
+
}
|
|
3207
|
+
return element.props.ref || element.ref;
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3210
|
+
// ../base-ui/src/ui/button.tsx
|
|
3211
|
+
import { cva } from "class-variance-authority";
|
|
3212
|
+
import { jsx as jsx39, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3213
|
+
var buttonVariants = cva(
|
|
3214
|
+
"inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
3215
|
+
{
|
|
3216
|
+
variants: {
|
|
3217
|
+
variant: {
|
|
3218
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
3219
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
3220
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
3221
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
3222
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
3223
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
3224
|
+
},
|
|
3225
|
+
size: {
|
|
3226
|
+
default: "h-10 px-4 py-2",
|
|
3227
|
+
sm: "h-9 rounded-md px-3",
|
|
3228
|
+
lg: "h-11 rounded-md px-8",
|
|
3229
|
+
icon: "h-10 w-10"
|
|
3230
|
+
}
|
|
3231
|
+
},
|
|
3232
|
+
defaultVariants: {
|
|
3233
|
+
variant: "default",
|
|
3234
|
+
size: "default"
|
|
3235
|
+
}
|
|
3236
|
+
}
|
|
3237
|
+
);
|
|
3238
|
+
var Button = React35.forwardRef(
|
|
3239
|
+
(_a, ref) => {
|
|
3240
|
+
var _b = _a, { className, variant, size, asChild = false, loading = false, children } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild", "loading", "children"]);
|
|
3241
|
+
const Comp = asChild ? Slot : "button";
|
|
3242
|
+
if (asChild) {
|
|
3243
|
+
return /* @__PURE__ */ jsx39(
|
|
3244
|
+
Comp,
|
|
3245
|
+
__spreadProps(__spreadValues({
|
|
3246
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
3247
|
+
ref,
|
|
3248
|
+
disabled: loading || props.disabled
|
|
3249
|
+
}, props), {
|
|
3250
|
+
children
|
|
3251
|
+
})
|
|
3252
|
+
);
|
|
3253
|
+
}
|
|
3254
|
+
return /* @__PURE__ */ jsxs13(
|
|
3255
|
+
Comp,
|
|
3256
|
+
__spreadProps(__spreadValues({
|
|
3257
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
3258
|
+
ref,
|
|
3259
|
+
disabled: loading || props.disabled
|
|
3260
|
+
}, props), {
|
|
3261
|
+
children: [
|
|
3262
|
+
children,
|
|
3263
|
+
loading && /* @__PURE__ */ jsx39(globalLucideIcons.Loader2, { className: "ml-2 h-4 w-4 animate-spin" })
|
|
3264
|
+
]
|
|
3265
|
+
})
|
|
3266
|
+
);
|
|
3267
|
+
}
|
|
3268
|
+
);
|
|
3269
|
+
Button.displayName = "Button";
|
|
3270
|
+
|
|
5518
3271
|
// src/fuma/mdx/gradient-button.tsx
|
|
5519
3272
|
import Link3 from "next/link";
|
|
5520
|
-
import
|
|
5521
|
-
import { Fragment as
|
|
3273
|
+
import React36, { useState as useState3 } from "react";
|
|
3274
|
+
import { Fragment as Fragment3, jsx as jsx40, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
5522
3275
|
function GradientButton({
|
|
5523
3276
|
title,
|
|
5524
3277
|
icon,
|
|
@@ -5531,7 +3284,7 @@ function GradientButton({
|
|
|
5531
3284
|
loadingText,
|
|
5532
3285
|
preventDoubleClick = true
|
|
5533
3286
|
}) {
|
|
5534
|
-
const [isLoading, setIsLoading] =
|
|
3287
|
+
const [isLoading, setIsLoading] = useState3(false);
|
|
5535
3288
|
const actualLoadingText = loadingText || (title == null ? void 0 : title.toString().trim()) || "Loading...";
|
|
5536
3289
|
const getAlignmentClass = () => {
|
|
5537
3290
|
switch (align) {
|
|
@@ -5566,15 +3319,15 @@ function GradientButton({
|
|
|
5566
3319
|
});
|
|
5567
3320
|
const isDisabled = disabled || isLoading;
|
|
5568
3321
|
const displayTitle = isLoading ? actualLoadingText : title;
|
|
5569
|
-
const displayIcon = isLoading ? /* @__PURE__ */
|
|
3322
|
+
const displayIcon = isLoading ? /* @__PURE__ */ jsx40(globalLucideIcons.Loader2, { className: "h-4 w-4 text-white animate-spin" }) : icon ? React36.cloneElement(icon, {
|
|
5570
3323
|
className: "h-4 w-4 text-white"
|
|
5571
|
-
}) : /* @__PURE__ */
|
|
5572
|
-
const buttonContent = onClick ? /* @__PURE__ */
|
|
5573
|
-
/* @__PURE__ */
|
|
5574
|
-
/* @__PURE__ */
|
|
5575
|
-
] }) : /* @__PURE__ */
|
|
5576
|
-
/* @__PURE__ */
|
|
5577
|
-
/* @__PURE__ */
|
|
3324
|
+
}) : /* @__PURE__ */ jsx40(globalLucideIcons.ArrowRight, { className: "h-4 w-4 text-white" });
|
|
3325
|
+
const buttonContent = onClick ? /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
3326
|
+
/* @__PURE__ */ jsx40("span", { children: displayIcon }),
|
|
3327
|
+
/* @__PURE__ */ jsx40("span", { className: "ml-1", children: displayTitle })
|
|
3328
|
+
] }) : /* @__PURE__ */ jsxs14(Fragment3, { children: [
|
|
3329
|
+
/* @__PURE__ */ jsx40("span", { children: displayTitle }),
|
|
3330
|
+
/* @__PURE__ */ jsx40("span", { className: "ml-1", children: displayIcon })
|
|
5578
3331
|
] });
|
|
5579
3332
|
const buttonClassName = `
|
|
5580
3333
|
bg-gradient-to-r
|
|
@@ -5588,9 +3341,9 @@ function GradientButton({
|
|
|
5588
3341
|
${isDisabled ? "opacity-50 cursor-not-allowed" : ""}
|
|
5589
3342
|
${className}
|
|
5590
3343
|
`;
|
|
5591
|
-
return /* @__PURE__ */
|
|
3344
|
+
return /* @__PURE__ */ jsx40("div", { className: `flex flex-col sm:flex-row gap-3 ${getAlignmentClass()}`, children: onClick ? (
|
|
5592
3345
|
// for click
|
|
5593
|
-
/* @__PURE__ */
|
|
3346
|
+
/* @__PURE__ */ jsx40(
|
|
5594
3347
|
Button,
|
|
5595
3348
|
{
|
|
5596
3349
|
size: "lg",
|
|
@@ -5602,14 +3355,14 @@ function GradientButton({
|
|
|
5602
3355
|
)
|
|
5603
3356
|
) : (
|
|
5604
3357
|
// for Link
|
|
5605
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsx40(
|
|
5606
3359
|
Button,
|
|
5607
3360
|
{
|
|
5608
3361
|
asChild: true,
|
|
5609
3362
|
size: "lg",
|
|
5610
3363
|
className: buttonClassName,
|
|
5611
3364
|
disabled: isDisabled,
|
|
5612
|
-
children: /* @__PURE__ */
|
|
3365
|
+
children: /* @__PURE__ */ jsx40(
|
|
5613
3366
|
Link3,
|
|
5614
3367
|
__spreadProps(__spreadValues({
|
|
5615
3368
|
href: href || "#",
|
|
@@ -5625,14 +3378,14 @@ function GradientButton({
|
|
|
5625
3378
|
}
|
|
5626
3379
|
|
|
5627
3380
|
// src/fuma/mdx/toc-base.tsx
|
|
5628
|
-
import { useState as
|
|
3381
|
+
import { useState as useState4 } from "react";
|
|
5629
3382
|
import { useParams } from "next/navigation";
|
|
5630
3383
|
import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
|
|
5631
3384
|
import Link4 from "fumadocs-core/link";
|
|
5632
|
-
import { Fragment as
|
|
3385
|
+
import { Fragment as Fragment4, jsx as jsx41, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5633
3386
|
var cache = /* @__PURE__ */ new Map();
|
|
5634
3387
|
function LLMCopyButton({ llmApiUrl, sourceKey } = {}) {
|
|
5635
|
-
const [isLoading, setLoading] =
|
|
3388
|
+
const [isLoading, setLoading] = useState4(false);
|
|
5636
3389
|
const params = useParams();
|
|
5637
3390
|
const locale = params.locale;
|
|
5638
3391
|
const slug = params.slug;
|
|
@@ -5667,7 +3420,7 @@ function LLMCopyButton({ llmApiUrl, sourceKey } = {}) {
|
|
|
5667
3420
|
setLoading(false);
|
|
5668
3421
|
}
|
|
5669
3422
|
}));
|
|
5670
|
-
return /* @__PURE__ */
|
|
3423
|
+
return /* @__PURE__ */ jsx41(
|
|
5671
3424
|
Button,
|
|
5672
3425
|
{
|
|
5673
3426
|
variant: "ghost",
|
|
@@ -5675,32 +3428,32 @@ function LLMCopyButton({ llmApiUrl, sourceKey } = {}) {
|
|
|
5675
3428
|
loading: isLoading,
|
|
5676
3429
|
className: "justify-start px-0 text-stone-600 hover:text-stone-500 dark:text-stone-400 dark:hover:text-stone-300",
|
|
5677
3430
|
onClick,
|
|
5678
|
-
children: checked ? /* @__PURE__ */
|
|
5679
|
-
/* @__PURE__ */
|
|
3431
|
+
children: checked ? /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
3432
|
+
/* @__PURE__ */ jsx41(globalLucideIcons.Check, {}),
|
|
5680
3433
|
"Copied!"
|
|
5681
|
-
] }) : /* @__PURE__ */
|
|
5682
|
-
/* @__PURE__ */
|
|
3434
|
+
] }) : /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
3435
|
+
/* @__PURE__ */ jsx41(globalLucideIcons.Markdown, {}),
|
|
5683
3436
|
"Copy page as Markdown"
|
|
5684
3437
|
] })
|
|
5685
3438
|
}
|
|
5686
3439
|
);
|
|
5687
3440
|
}
|
|
5688
3441
|
function EditOnGitHub({ url }) {
|
|
5689
|
-
return /* @__PURE__ */
|
|
3442
|
+
return /* @__PURE__ */ jsxs15(
|
|
5690
3443
|
Link4,
|
|
5691
3444
|
{
|
|
5692
3445
|
className: "flex items-center gap-x-2 text-stone-600 hover:text-stone-500 dark:text-stone-400 dark:hover:text-stone-300 text-sm",
|
|
5693
3446
|
href: url,
|
|
5694
3447
|
children: [
|
|
5695
|
-
/* @__PURE__ */
|
|
3448
|
+
/* @__PURE__ */ jsx41(globalLucideIcons.GitHub, {}),
|
|
5696
3449
|
"Edit this page on GitHub"
|
|
5697
3450
|
]
|
|
5698
3451
|
}
|
|
5699
3452
|
);
|
|
5700
3453
|
}
|
|
5701
3454
|
function LastUpdatedDate({ date }) {
|
|
5702
|
-
return /* @__PURE__ */
|
|
5703
|
-
/* @__PURE__ */
|
|
3455
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-x-2 text-stone-600 dark:text-stone-400 text-sm", children: [
|
|
3456
|
+
/* @__PURE__ */ jsx41(globalLucideIcons.LastUpdated, {}),
|
|
5704
3457
|
"Lastest on ",
|
|
5705
3458
|
date ? date : "Ages ago"
|
|
5706
3459
|
] });
|
|
@@ -5711,8 +3464,8 @@ import { useTranslations } from "next-intl";
|
|
|
5711
3464
|
|
|
5712
3465
|
// src/fuma/mdx/banner.tsx
|
|
5713
3466
|
import { cva as cva2 } from "class-variance-authority";
|
|
5714
|
-
import { useEffect as
|
|
5715
|
-
import { Fragment as
|
|
3467
|
+
import { useEffect as useEffect2, useState as useState5 } from "react";
|
|
3468
|
+
import { Fragment as Fragment5, jsx as jsx42, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
5716
3469
|
var buttonVariants2 = cva2(
|
|
5717
3470
|
"inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50",
|
|
5718
3471
|
{
|
|
@@ -5743,15 +3496,15 @@ function Banner(_a) {
|
|
|
5743
3496
|
"changeLayout",
|
|
5744
3497
|
"height"
|
|
5745
3498
|
]);
|
|
5746
|
-
const [open, setOpen] =
|
|
3499
|
+
const [open, setOpen] = useState5(true);
|
|
5747
3500
|
const globalKey = id ? `nd-banner-${id}` : null;
|
|
5748
3501
|
const bannerHeight = `${height}rem`;
|
|
5749
3502
|
const headerStartHeight = `${height + 5.5}rem`;
|
|
5750
|
-
|
|
3503
|
+
useEffect2(() => {
|
|
5751
3504
|
if (globalKey) setOpen(localStorage.getItem(globalKey) !== "true");
|
|
5752
3505
|
}, [globalKey]);
|
|
5753
3506
|
if (!open) return null;
|
|
5754
|
-
return /* @__PURE__ */
|
|
3507
|
+
return /* @__PURE__ */ jsxs16(
|
|
5755
3508
|
"div",
|
|
5756
3509
|
__spreadProps(__spreadValues({
|
|
5757
3510
|
id
|
|
@@ -5776,8 +3529,8 @@ function Banner(_a) {
|
|
|
5776
3529
|
borderRadius: 0
|
|
5777
3530
|
},
|
|
5778
3531
|
children: [
|
|
5779
|
-
globalKey ? /* @__PURE__ */
|
|
5780
|
-
globalKey ? /* @__PURE__ */
|
|
3532
|
+
globalKey ? /* @__PURE__ */ jsx42("style", { children: `.${globalKey} #${id} { display: none; }` }) : null,
|
|
3533
|
+
globalKey ? /* @__PURE__ */ jsx42(
|
|
5781
3534
|
"script",
|
|
5782
3535
|
{
|
|
5783
3536
|
dangerouslySetInnerHTML: {
|
|
@@ -5787,7 +3540,7 @@ function Banner(_a) {
|
|
|
5787
3540
|
) : null,
|
|
5788
3541
|
variant === "rainbow" ? rainbowLayer : null,
|
|
5789
3542
|
props.children,
|
|
5790
|
-
id ? /* @__PURE__ */
|
|
3543
|
+
id ? /* @__PURE__ */ jsx42(
|
|
5791
3544
|
"button",
|
|
5792
3545
|
{
|
|
5793
3546
|
type: "button",
|
|
@@ -5803,7 +3556,7 @@ function Banner(_a) {
|
|
|
5803
3556
|
size: "icon"
|
|
5804
3557
|
})
|
|
5805
3558
|
),
|
|
5806
|
-
children: /* @__PURE__ */
|
|
3559
|
+
children: /* @__PURE__ */ jsx42(globalLucideIcons.X, {})
|
|
5807
3560
|
}
|
|
5808
3561
|
) : null
|
|
5809
3562
|
]
|
|
@@ -5811,8 +3564,8 @@ function Banner(_a) {
|
|
|
5811
3564
|
);
|
|
5812
3565
|
}
|
|
5813
3566
|
var maskImage = "linear-gradient(to bottom,white,transparent), radial-gradient(circle at top center, white, transparent)";
|
|
5814
|
-
var rainbowLayer = /* @__PURE__ */
|
|
5815
|
-
/* @__PURE__ */
|
|
3567
|
+
var rainbowLayer = /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
3568
|
+
/* @__PURE__ */ jsx42(
|
|
5816
3569
|
"div",
|
|
5817
3570
|
{
|
|
5818
3571
|
className: "absolute inset-0 z-[-1]",
|
|
@@ -5831,7 +3584,7 @@ var rainbowLayer = /* @__PURE__ */ jsxs19(Fragment8, { children: [
|
|
|
5831
3584
|
}
|
|
5832
3585
|
}
|
|
5833
3586
|
),
|
|
5834
|
-
/* @__PURE__ */
|
|
3587
|
+
/* @__PURE__ */ jsx42(
|
|
5835
3588
|
"div",
|
|
5836
3589
|
{
|
|
5837
3590
|
className: "absolute inset-0 z-[-1]",
|
|
@@ -5849,19 +3602,19 @@ var rainbowLayer = /* @__PURE__ */ jsxs19(Fragment8, { children: [
|
|
|
5849
3602
|
}
|
|
5850
3603
|
}
|
|
5851
3604
|
),
|
|
5852
|
-
/* @__PURE__ */
|
|
3605
|
+
/* @__PURE__ */ jsx42("style", { children: `@keyframes fd-moving-banner {
|
|
5853
3606
|
from { background-position: 0% 0; }
|
|
5854
3607
|
to { background-position: 100% 0; }
|
|
5855
3608
|
}` })
|
|
5856
3609
|
] });
|
|
5857
3610
|
|
|
5858
3611
|
// src/fuma/mdx/fuma-banner-suit.tsx
|
|
5859
|
-
import { Fragment as
|
|
3612
|
+
import { Fragment as Fragment6, jsx as jsx43 } from "react/jsx-runtime";
|
|
5860
3613
|
function FumaBannerSuit({ showBanner }) {
|
|
5861
3614
|
const t = useTranslations("home");
|
|
5862
3615
|
const heightValue = showBanner ? 3 : 0.5;
|
|
5863
3616
|
const height = `${heightValue}rem`;
|
|
5864
|
-
return /* @__PURE__ */
|
|
3617
|
+
return /* @__PURE__ */ jsx43(Fragment6, { children: showBanner ? /* @__PURE__ */ jsx43(Banner, { variant: "rainbow", changeLayout: true, height: heightValue, children: /* @__PURE__ */ jsx43("p", { className: "text-xl", children: t("banner") }) }) : /* @__PURE__ */ jsx43(
|
|
5865
3618
|
"div",
|
|
5866
3619
|
{
|
|
5867
3620
|
className: "fixed top-0 left-0 w-screen z-[1001] m-0 rounded-none bg-neutral-100 dark:bg-neutral-900",
|
|
@@ -5875,19 +3628,19 @@ function FumaBannerSuit({ showBanner }) {
|
|
|
5875
3628
|
}
|
|
5876
3629
|
|
|
5877
3630
|
// src/fuma/mdx/fuma-github-info.tsx
|
|
5878
|
-
import { useEffect as
|
|
5879
|
-
import { jsx as
|
|
3631
|
+
import { useEffect as useEffect3, useState as useState6 } from "react";
|
|
3632
|
+
import { jsx as jsx44, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
5880
3633
|
function GitHubInfoSkeleton({ owner, repo, className }) {
|
|
5881
|
-
return /* @__PURE__ */
|
|
5882
|
-
/* @__PURE__ */
|
|
5883
|
-
/* @__PURE__ */
|
|
5884
|
-
/* @__PURE__ */
|
|
3634
|
+
return /* @__PURE__ */ jsxs17("div", { className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 lg:flex-row lg:items-center animate-pulse ${className}`, children: [
|
|
3635
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
|
|
3636
|
+
/* @__PURE__ */ jsx44("div", { className: "size-3.5 bg-fd-muted rounded" }),
|
|
3637
|
+
/* @__PURE__ */ jsx44("div", { className: "h-4 bg-fd-muted rounded w-20" })
|
|
5885
3638
|
] }),
|
|
5886
|
-
/* @__PURE__ */
|
|
3639
|
+
/* @__PURE__ */ jsx44("div", { className: "h-3 bg-fd-muted rounded w-8" })
|
|
5887
3640
|
] });
|
|
5888
3641
|
}
|
|
5889
3642
|
function GitHubInfoFallback({ owner, repo, className }) {
|
|
5890
|
-
return /* @__PURE__ */
|
|
3643
|
+
return /* @__PURE__ */ jsxs17(
|
|
5891
3644
|
"a",
|
|
5892
3645
|
{
|
|
5893
3646
|
href: `https://github.com/${owner}/${repo}`,
|
|
@@ -5895,17 +3648,17 @@ function GitHubInfoFallback({ owner, repo, className }) {
|
|
|
5895
3648
|
target: "_blank",
|
|
5896
3649
|
className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`,
|
|
5897
3650
|
children: [
|
|
5898
|
-
/* @__PURE__ */
|
|
5899
|
-
/* @__PURE__ */
|
|
5900
|
-
/* @__PURE__ */
|
|
5901
|
-
/* @__PURE__ */
|
|
3651
|
+
/* @__PURE__ */ jsxs17("p", { className: "flex items-center gap-2 truncate", children: [
|
|
3652
|
+
/* @__PURE__ */ jsxs17("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
|
|
3653
|
+
/* @__PURE__ */ jsx44("title", { children: "GitHub" }),
|
|
3654
|
+
/* @__PURE__ */ jsx44("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
|
|
5902
3655
|
] }),
|
|
5903
3656
|
owner,
|
|
5904
3657
|
"/",
|
|
5905
3658
|
repo
|
|
5906
3659
|
] }),
|
|
5907
|
-
/* @__PURE__ */
|
|
5908
|
-
/* @__PURE__ */
|
|
3660
|
+
/* @__PURE__ */ jsxs17("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
|
|
3661
|
+
/* @__PURE__ */ jsx44(globalLucideIcons.ExternalLink, { className: "size-3" }),
|
|
5909
3662
|
"GitHub"
|
|
5910
3663
|
] })
|
|
5911
3664
|
]
|
|
@@ -5919,7 +3672,7 @@ function GitHubInfoSuccess({
|
|
|
5919
3672
|
className
|
|
5920
3673
|
}) {
|
|
5921
3674
|
const humanizedStars = humanizeNumber(stars);
|
|
5922
|
-
return /* @__PURE__ */
|
|
3675
|
+
return /* @__PURE__ */ jsxs17(
|
|
5923
3676
|
"a",
|
|
5924
3677
|
{
|
|
5925
3678
|
href: `https://github.com/${owner}/${repo}`,
|
|
@@ -5927,17 +3680,17 @@ function GitHubInfoSuccess({
|
|
|
5927
3680
|
target: "_blank",
|
|
5928
3681
|
className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`,
|
|
5929
3682
|
children: [
|
|
5930
|
-
/* @__PURE__ */
|
|
5931
|
-
/* @__PURE__ */
|
|
5932
|
-
/* @__PURE__ */
|
|
5933
|
-
/* @__PURE__ */
|
|
3683
|
+
/* @__PURE__ */ jsxs17("p", { className: "flex items-center gap-2 truncate", children: [
|
|
3684
|
+
/* @__PURE__ */ jsxs17("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
|
|
3685
|
+
/* @__PURE__ */ jsx44("title", { children: "GitHub" }),
|
|
3686
|
+
/* @__PURE__ */ jsx44("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })
|
|
5934
3687
|
] }),
|
|
5935
3688
|
owner,
|
|
5936
3689
|
"/",
|
|
5937
3690
|
repo
|
|
5938
3691
|
] }),
|
|
5939
|
-
/* @__PURE__ */
|
|
5940
|
-
/* @__PURE__ */
|
|
3692
|
+
/* @__PURE__ */ jsxs17("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
|
|
3693
|
+
/* @__PURE__ */ jsx44(globalLucideIcons.Star, { className: "size-3" }),
|
|
5941
3694
|
humanizedStars
|
|
5942
3695
|
] })
|
|
5943
3696
|
]
|
|
@@ -5959,10 +3712,10 @@ function humanizeNumber(num) {
|
|
|
5959
3712
|
return num.toString();
|
|
5960
3713
|
}
|
|
5961
3714
|
function FumaGithubInfo({ owner, repo, token, className }) {
|
|
5962
|
-
const [data, setData] =
|
|
5963
|
-
const [loading, setLoading] =
|
|
5964
|
-
const [error, setError] =
|
|
5965
|
-
|
|
3715
|
+
const [data, setData] = useState6(null);
|
|
3716
|
+
const [loading, setLoading] = useState6(true);
|
|
3717
|
+
const [error, setError] = useState6(null);
|
|
3718
|
+
useEffect3(() => {
|
|
5966
3719
|
const fetchRepoData = () => __async(null, null, function* () {
|
|
5967
3720
|
try {
|
|
5968
3721
|
setLoading(true);
|
|
@@ -6006,12 +3759,12 @@ function FumaGithubInfo({ owner, repo, token, className }) {
|
|
|
6006
3759
|
fetchRepoData();
|
|
6007
3760
|
}, [owner, repo, token]);
|
|
6008
3761
|
if (loading) {
|
|
6009
|
-
return /* @__PURE__ */
|
|
3762
|
+
return /* @__PURE__ */ jsx44(GitHubInfoSkeleton, { owner, repo, className });
|
|
6010
3763
|
}
|
|
6011
3764
|
if (error || !data) {
|
|
6012
|
-
return /* @__PURE__ */
|
|
3765
|
+
return /* @__PURE__ */ jsx44(GitHubInfoFallback, { owner, repo, className });
|
|
6013
3766
|
}
|
|
6014
|
-
return /* @__PURE__ */
|
|
3767
|
+
return /* @__PURE__ */ jsx44(
|
|
6015
3768
|
GitHubInfoSuccess,
|
|
6016
3769
|
{
|
|
6017
3770
|
owner,
|
|
@@ -6024,7 +3777,7 @@ function FumaGithubInfo({ owner, repo, token, className }) {
|
|
|
6024
3777
|
|
|
6025
3778
|
// src/fuma/mdx/site-x.tsx
|
|
6026
3779
|
import { useTranslations as useTranslations2 } from "next-intl";
|
|
6027
|
-
import { jsx as
|
|
3780
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
6028
3781
|
function SiteX(_a) {
|
|
6029
3782
|
var _b = _a, { type, namespace, tKey, className } = _b, props = __objRest(_b, ["type", "namespace", "tKey", "className"]);
|
|
6030
3783
|
let ns = namespace;
|
|
@@ -6038,7 +3791,7 @@ function SiteX(_a) {
|
|
|
6038
3791
|
const t = useTranslations2(ns);
|
|
6039
3792
|
const text = t(key, { defaultValue: type === "site" ? "Site----" : "----@example.com" });
|
|
6040
3793
|
if (type === "site") {
|
|
6041
|
-
return /* @__PURE__ */
|
|
3794
|
+
return /* @__PURE__ */ jsx45(
|
|
6042
3795
|
"strong",
|
|
6043
3796
|
__spreadProps(__spreadValues({}, props), {
|
|
6044
3797
|
className: cn(
|
|
@@ -6050,7 +3803,7 @@ function SiteX(_a) {
|
|
|
6050
3803
|
);
|
|
6051
3804
|
}
|
|
6052
3805
|
if (type === "email") {
|
|
6053
|
-
return /* @__PURE__ */
|
|
3806
|
+
return /* @__PURE__ */ jsx45(
|
|
6054
3807
|
"a",
|
|
6055
3808
|
__spreadProps(__spreadValues({}, props), {
|
|
6056
3809
|
href: `mailto:${text}`,
|
|
@@ -6066,20 +3819,20 @@ function SiteX(_a) {
|
|
|
6066
3819
|
}
|
|
6067
3820
|
|
|
6068
3821
|
// src/fuma/mdx/zia-file.tsx
|
|
6069
|
-
import { useState as
|
|
3822
|
+
import { useState as useState7 } from "react";
|
|
6070
3823
|
import {
|
|
6071
3824
|
Collapsible,
|
|
6072
3825
|
CollapsibleContent,
|
|
6073
3826
|
CollapsibleTrigger
|
|
6074
3827
|
} from "fumadocs-ui/components/ui/collapsible";
|
|
6075
3828
|
import Link5 from "next/link";
|
|
6076
|
-
import { jsx as
|
|
3829
|
+
import { jsx as jsx46, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
6077
3830
|
var itemVariants = "flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4";
|
|
6078
3831
|
var anotionClass = "ms-2 px-2 py-0.5 rounded text-xs font-semibold bg-fd-accent/80 text-fd-accent-foreground dark:bg-white/20 dark:text-white";
|
|
6079
3832
|
function ZiaFile(_a) {
|
|
6080
3833
|
var _b = _a, {
|
|
6081
3834
|
name,
|
|
6082
|
-
icon = /* @__PURE__ */
|
|
3835
|
+
icon = /* @__PURE__ */ jsx46(globalLucideIcons.File, {}),
|
|
6083
3836
|
className,
|
|
6084
3837
|
anotion,
|
|
6085
3838
|
href
|
|
@@ -6093,16 +3846,16 @@ function ZiaFile(_a) {
|
|
|
6093
3846
|
const validHref = typeof href === "string" && href.trim() !== "";
|
|
6094
3847
|
const validAnotion = typeof anotion === "string" && anotion.trim() !== "";
|
|
6095
3848
|
if (validHref) {
|
|
6096
|
-
return /* @__PURE__ */
|
|
3849
|
+
return /* @__PURE__ */ jsxs18(Link5, { href, className: cn(itemVariants, className), children: [
|
|
6097
3850
|
icon,
|
|
6098
|
-
/* @__PURE__ */
|
|
6099
|
-
validAnotion && /* @__PURE__ */
|
|
3851
|
+
/* @__PURE__ */ jsx46("span", { children: name }),
|
|
3852
|
+
validAnotion && /* @__PURE__ */ jsx46("span", { className: anotionClass, children: anotion })
|
|
6100
3853
|
] });
|
|
6101
3854
|
}
|
|
6102
|
-
return /* @__PURE__ */
|
|
3855
|
+
return /* @__PURE__ */ jsxs18("div", __spreadProps(__spreadValues({ className: cn(itemVariants, className) }, rest), { children: [
|
|
6103
3856
|
icon,
|
|
6104
|
-
/* @__PURE__ */
|
|
6105
|
-
validAnotion && /* @__PURE__ */
|
|
3857
|
+
/* @__PURE__ */ jsx46("span", { children: name }),
|
|
3858
|
+
validAnotion && /* @__PURE__ */ jsx46("span", { className: anotionClass, children: anotion })
|
|
6106
3859
|
] }));
|
|
6107
3860
|
}
|
|
6108
3861
|
function ZiaFolder(_a) {
|
|
@@ -6119,26 +3872,26 @@ function ZiaFolder(_a) {
|
|
|
6119
3872
|
"className",
|
|
6120
3873
|
"children"
|
|
6121
3874
|
]);
|
|
6122
|
-
const [open, setOpen] =
|
|
3875
|
+
const [open, setOpen] = useState7(defaultOpen);
|
|
6123
3876
|
const validAnotion = typeof anotion === "string" && anotion.trim() !== "";
|
|
6124
|
-
return /* @__PURE__ */
|
|
6125
|
-
/* @__PURE__ */
|
|
6126
|
-
open ? /* @__PURE__ */
|
|
6127
|
-
/* @__PURE__ */
|
|
6128
|
-
validAnotion && /* @__PURE__ */
|
|
3877
|
+
return /* @__PURE__ */ jsxs18(Collapsible, __spreadProps(__spreadValues({ open, onOpenChange: setOpen }, props), { children: [
|
|
3878
|
+
/* @__PURE__ */ jsxs18(CollapsibleTrigger, { className: cn(itemVariants, className, "w-full"), children: [
|
|
3879
|
+
open ? /* @__PURE__ */ jsx46(globalLucideIcons.FolderOpen, {}) : /* @__PURE__ */ jsx46(globalLucideIcons.Folder, {}),
|
|
3880
|
+
/* @__PURE__ */ jsx46("span", { children: name }),
|
|
3881
|
+
validAnotion && /* @__PURE__ */ jsx46("span", { className: anotionClass, children: anotion })
|
|
6129
3882
|
] }),
|
|
6130
|
-
/* @__PURE__ */
|
|
3883
|
+
/* @__PURE__ */ jsx46(CollapsibleContent, { children: /* @__PURE__ */ jsx46("div", { className: "ms-2 flex flex-col border-l ps-2", children }) })
|
|
6131
3884
|
] }));
|
|
6132
3885
|
}
|
|
6133
3886
|
|
|
6134
3887
|
// src/fuma/mdx/toc-footer-wrapper.tsx
|
|
6135
|
-
import { jsx as
|
|
3888
|
+
import { jsx as jsx47, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6136
3889
|
function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }) {
|
|
6137
3890
|
const showEdit = githubBaseUrl && editPath;
|
|
6138
|
-
return /* @__PURE__ */
|
|
6139
|
-
/* @__PURE__ */
|
|
3891
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
|
|
3892
|
+
/* @__PURE__ */ jsx47(LastUpdatedDate, { date: lastModified }),
|
|
6140
3893
|
copyButtonComponent,
|
|
6141
|
-
showEdit && /* @__PURE__ */
|
|
3894
|
+
showEdit && /* @__PURE__ */ jsx47(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
|
|
6142
3895
|
] });
|
|
6143
3896
|
}
|
|
6144
3897
|
export {
|