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