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