import { J as JsonApiConfig } from '../JsonApiContext-Bsm_Q2oe.js';
export { C as CacheProfile, a as JsonApiContext, u as useJsonApiConfig, b as useJsonApiConfigOptional } from '../JsonApiContext-Bsm_Q2oe.js';
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as React from 'react';
import React__default from 'react';
import { A as ApiDataInterface, J as JsonApiHydratedDataInterface } from '../ApiDataInterface-DPP8s46n.js';
import { A as ApiRequestDataTypeInterface } from '../ApiRequestDataTypeInterface-CUKFDBx2.js';
import { A as ApiResponseInterface } from '../ApiResponseInterface-CAIAeP5d.js';
import { A as ApiData } from '../ApiData-DPKNfY-9.js';
import { M as ModuleWithPermissions, a as PageUrl, k as RoleInterface, U as UserInterface } from '../notification.interface-CmKmObIU.js';
export { I as I18nConfig, l as I18nRouter, L as LinkComponent, U as UseDateFnsLocaleHook, m as UseLocaleHook, n as UseRouterHook, o as UseTranslationsHook, f as configureClientConfig, e as configureI18n, c as configureJsonApi, g as getApiUrl, a as getAppUrl, h as getI18nLink, d as getStripePublishableKey, b as getTrackablePages, u as useI18nDateFnsLocale, i as useI18nLocale, j as useI18nRouter, k as useI18nTranslations } from '../config-CHwoRDOp.js';
import { ColumnDef } from '@tanstack/react-table';
import { D as DataListRetriever } from '../useDataListRetriever-futhx3OP.js';
export { u as useDataListRetriever } from '../useDataListRetriever-futhx3OP.js';
import { a as D3Node, D as D3Link, C as ContentFields, R as RoleFields, U as UserFields } from '../content.fields-Ck5lkQ5d.js';
export { u as useSocket } from '../useSocket-QuHa0ZmO.js';
import { a as ContentInterface } from '../content.interface-DFQ7mkpL.js';
import { O as OAuthClientInterface, b as OAuthClientCreateRequest, c as OAuthClientCreateResponse, a as OAuthClientInput, f as OAuthConsentInfo, d as OAuthConsentRequest } from '../oauth.interface-vL7za9Bz.js';
import 'lucide-react';
import 'd3';

interface JsonApiProviderProps {
    config: JsonApiConfig;
    children: React__default.ReactNode;
}
declare function JsonApiProvider({ config, children }: JsonApiProviderProps): react_jsx_runtime.JSX.Element;

interface UseJsonApiGetOptions {
    /**
     * Whether to enable the query. If false, the query won't run.
     */
    enabled?: boolean;
    /**
     * Dependencies that trigger a refetch when changed.
     */
    deps?: any[];
}
interface UseJsonApiGetResult<T> {
    /**
     * The fetched data, or null if not yet fetched.
     */
    data: T | null;
    /**
     * Whether the query is currently loading.
     */
    loading: boolean;
    /**
     * Error message if the query failed.
     */
    error: string | null;
    /**
     * The full API response (includes raw data, pagination, etc.)
     */
    response: ApiResponseInterface | null;
    /**
     * Function to manually refetch the data.
     */
    refetch: () => Promise<void>;
    /**
     * Whether there is a next page available.
     */
    hasNextPage: boolean;
    /**
     * Whether there is a previous page available.
     */
    hasPreviousPage: boolean;
    /**
     * Function to fetch the next page.
     */
    fetchNextPage: () => Promise<void>;
    /**
     * Function to fetch the previous page.
     */
    fetchPreviousPage: () => Promise<void>;
}
/**
 * Hook for fetching data from a JSON:API endpoint.
 *
 * @example
 * ```tsx
 * const { data, loading, error, refetch } = useJsonApiGet<Article>({
 *   classKey: Modules.Article,
 *   endpoint: `/articles/${id}`,
 * });
 *
 * if (loading) return <Loading />;
 * if (error) return <Error message={error} />;
 * return <ArticleView article={data} />;
 * ```
 */
declare function useJsonApiGet<T extends ApiDataInterface>(params: {
    classKey: ApiRequestDataTypeInterface;
    endpoint: string;
    companyId?: string;
    options?: UseJsonApiGetOptions;
}): UseJsonApiGetResult<T>;

type MutationMethod = "POST" | "PUT" | "PATCH" | "DELETE";
interface UseJsonApiMutationResult<T> {
    /**
     * The result data from the mutation, or null if not yet executed.
     */
    data: T | null;
    /**
     * Whether the mutation is currently in progress.
     */
    loading: boolean;
    /**
     * Error message if the mutation failed.
     */
    error: string | null;
    /**
     * The full API response.
     */
    response: ApiResponseInterface | null;
    /**
     * Execute the mutation.
     */
    mutate: (params: MutationParams) => Promise<T | null>;
    /**
     * Reset the mutation state.
     */
    reset: () => void;
}
interface MutationParams {
    /**
     * The endpoint to call.
     */
    endpoint: string;
    /**
     * The request body.
     */
    body?: any;
    /**
     * Files to upload.
     */
    files?: {
        [key: string]: File | Blob;
    } | File | Blob;
    /**
     * Company ID for multi-tenant requests.
     */
    companyId?: string;
    /**
     * Override the default JSON:API body creation.
     */
    overridesJsonApiCreation?: boolean;
    /**
     * Response type if different from the request type.
     */
    responseType?: ApiRequestDataTypeInterface;
}
/**
 * Hook for making mutations (POST, PUT, PATCH, DELETE) to a JSON:API endpoint.
 *
 * @example
 * ```tsx
 * const { mutate, loading, error } = useJsonApiMutation<Article>({
 *   method: "POST",
 *   classKey: Modules.Article,
 * });
 *
 * const handleSubmit = async (data: ArticleInput) => {
 *   const result = await mutate({
 *     endpoint: "/articles",
 *     body: data,
 *   });
 *   if (result) {
 *     // Success!
 *   }
 * };
 * ```
 */
declare function useJsonApiMutation<T extends ApiDataInterface>(config: {
    method: MutationMethod;
    classKey: ApiRequestDataTypeInterface;
    onSuccess?: (data: T) => void;
    onError?: (error: string) => void;
}): UseJsonApiMutationResult<T>;

/**
 * Hook to rehydrate server-passed data into typed objects.
 * Use this when passing data from server components to client components.
 *
 * @example
 * ```tsx
 * // In server component
 * const article = await ArticleService.findOne(id);
 * return <ArticleDetails data={article.dehydrate()} />;
 *
 * // In client component
 * function ArticleDetails({ data }: { data: JsonApiHydratedDataInterface }) {
 *   const article = useRehydration<Article>(Modules.Article, data);
 *   return <div>{article.title}</div>;
 * }
 * ```
 */
declare function useRehydration<T extends ApiDataInterface>(classKey: ApiRequestDataTypeInterface, data: JsonApiHydratedDataInterface | null | undefined): T | null;
/**
 * Hook to rehydrate a list of server-passed data into typed objects.
 */
declare function useRehydrationList<T extends ApiDataInterface>(classKey: ApiRequestDataTypeInterface, data: JsonApiHydratedDataInterface[] | null | undefined): T[];

interface DirectFetchParams {
    method: string;
    url: string;
    token?: string;
    body?: any;
    files?: {
        [key: string]: File | Blob;
    } | File | Blob;
    companyId?: string;
    language: string;
    additionalHeaders?: Record<string, string>;
}
/**
 * Client-side direct fetch to bypass server action overhead.
 * Use this for client-side API calls.
 */
declare function directFetch(params: DirectFetchParams): Promise<ApiData>;

/**
 * Get the authentication token from cookies (client-side only)
 */
declare function getClientToken(): Promise<string | undefined>;

/**
 * Configure the JSON:API client for browser contexts.
 * Call this in your client-side initialization or use JsonApiProvider.
 */
declare function configureClientJsonApi(config: {
    apiUrl: string;
    appUrl?: string;
    trackablePages?: ModuleWithPermissions[];
    bootstrapper?: () => void;
    additionalHeaders?: Record<string, string>;
}): void;
declare function getClientApiUrl(): string;
declare function getClientAppUrl(): string;
declare function getClientTrackablePages(): ModuleWithPermissions[];
declare function ClientJsonApiGet(params: {
    classKey: ApiRequestDataTypeInterface;
    endpoint: string;
    companyId?: string;
    language: string;
}): Promise<ApiResponseInterface>;
declare function ClientJsonApiPost(params: {
    classKey: ApiRequestDataTypeInterface;
    endpoint: string;
    companyId?: string;
    body?: any;
    overridesJsonApiCreation?: boolean;
    files?: {
        [key: string]: File | Blob;
    } | File | Blob;
    language: string;
    responseType?: ApiRequestDataTypeInterface;
}): Promise<ApiResponseInterface>;
declare function ClientJsonApiPut(params: {
    classKey: ApiRequestDataTypeInterface;
    endpoint: string;
    companyId?: string;
    body?: any;
    files?: {
        [key: string]: File | Blob;
    } | File | Blob;
    language: string;
    responseType?: ApiRequestDataTypeInterface;
}): Promise<ApiResponseInterface>;
declare function ClientJsonApiPatch(params: {
    classKey: ApiRequestDataTypeInterface;
    endpoint: string;
    companyId?: string;
    body?: any;
    files?: {
        [key: string]: File | Blob;
    } | File | Blob;
    overridesJsonApiCreation?: boolean;
    responseType?: ApiRequestDataTypeInterface;
    language: string;
}): Promise<ApiResponseInterface>;
declare function ClientJsonApiDelete(params: {
    classKey: ApiRequestDataTypeInterface;
    endpoint: string;
    companyId?: string;
    language: string;
    responseType?: ApiRequestDataTypeInterface;
}): Promise<ApiResponseInterface>;

type TableContent<T> = {
    jsonApiData: T;
    [key: string]: any;
};
interface TableStructureGeneratorInterface<T, U> {
    generateTableStructure: (params: {
        t: (key: string) => string;
        generateUrl: (params: {
            page: string | PageUrl | string;
            id?: string;
        }) => string;
        data: T[];
        fields: Array<U>;
        checkedIds?: string[];
        toggleId?: (id: string) => void;
    }) => {
        data: TableContent<T>[];
        columns: ColumnDef<TableContent<T>>[];
    };
}
type UseTableStructureHookParams<T, U> = {
    data: T[];
    fields: Array<U>;
    checkedIds?: string[];
    toggleId?: (id: string) => void;
    dataRetriever?: DataListRetriever<T>;
    context?: Record<string, any>;
};
type UseTableStructureHookReturn<T> = {
    data: TableContent<T>[];
    columns: ColumnDef<TableContent<T>>[];
};
type UseTableStructureHook<T, U> = (params: UseTableStructureHookParams<T, U>) => UseTableStructureHookReturn<T>;

declare class TableGeneratorRegistry {
    private static instance;
    private registry;
    private constructor();
    static getInstance(): TableGeneratorRegistry;
    register<T, U>(type: string, hook: UseTableStructureHook<T, U>): void;
    get<T, U>(type: string, params: UseTableStructureHookParams<T, U>): UseTableStructureHookReturn<T>;
    isRegistered(type: string): boolean;
    getRegisteredTypes(): string[];
    unregister(type: string): boolean;
    clear(): void;
}
declare const tableGeneratorRegistry: TableGeneratorRegistry;

declare function useUrlRewriter(): (params: {
    page: ModuleWithPermissions | string;
    id?: string;
    childPage?: ModuleWithPermissions | string;
    childId?: string;
}) => void;

declare function useDebounce<T extends (...args: any[]) => any>(callback: T, delay: number): T & {
    cancel: () => void;
};

declare function usePageUrlGenerator(): (params: {
    page?: PageUrl | string;
    id?: string;
    childPage?: PageUrl | string;
    childId?: string;
    additionalParameters?: {
        [key: string]: string | string[] | undefined;
    };
    language?: string;
}) => string;

declare function registerTableGenerator<T, U>(type: string | ModuleWithPermissions, hook: UseTableStructureHook<T, U>): void;
declare function useTableGenerator<T, U>(type: ModuleWithPermissions, params: UseTableStructureHookParams<T, U>): UseTableStructureHookReturn<T>;

/**
 * Custom hook for D3 graph visualization with larger circles and more interactive features
 */
declare function useCustomD3Graph(nodes: D3Node[], links: D3Link[], onNodeClick: (nodeId: string) => void, visibleNodeIds?: Set<string>, loadingNodeIds?: Set<string>, containerKey?: string | number): {
    svgRef: React.RefObject<SVGSVGElement | null>;
    zoomIn: () => void;
    zoomOut: () => void;
    zoomToNode: (nodeId: string, childIds?: string[]) => void;
    zoomToFitAll: () => void;
};

declare function useNotificationSync(): void;

declare function usePageTracker(): void;

declare const useContentTableStructure: <U extends string = ContentFields>(params: Parameters<UseTableStructureHook<ContentInterface, U>>[0]) => ReturnType<UseTableStructureHook<ContentInterface, U>>;

declare const useRoleTableStructure: UseTableStructureHook<RoleInterface, RoleFields>;

declare const useUserSearch: () => {
    users: UserInterface[];
    searchQuery: string;
    setSearchQuery: React.Dispatch<React.SetStateAction<string>>;
    isLoading: boolean;
    loadUsers: (search: string) => Promise<void>;
    clearSearch: () => void;
    searchQueryRef: React.RefObject<string>;
};

declare const useUserTableStructure: UseTableStructureHook<UserInterface, UserFields>;

interface UseOAuthClientsReturn {
    /** List of OAuth clients */
    clients: OAuthClientInterface[];
    /** Whether clients are being loaded */
    isLoading: boolean;
    /** Error from last operation */
    error: Error | null;
    /** Refetch clients from API */
    refetch: () => Promise<void>;
    /** Create a new OAuth client */
    createClient: (data: OAuthClientCreateRequest) => Promise<OAuthClientCreateResponse>;
}
/**
 * Hook for managing OAuth clients list
 *
 * @example
 * ```tsx
 * const { clients, isLoading, createClient } = useOAuthClients();
 *
 * const handleCreate = async (data) => {
 *   const { client, clientSecret } = await createClient(data);
 *   // clientSecret is shown only once!
 * };
 * ```
 */
declare function useOAuthClients(): UseOAuthClientsReturn;

interface UseOAuthClientReturn {
    /** The OAuth client (from store or fetched) */
    client: OAuthClientInterface | null;
    /** Whether the client is being loaded */
    isLoading: boolean;
    /** Error from last operation */
    error: Error | null;
    /** Update the client */
    update: (data: Partial<OAuthClientInput>) => Promise<void>;
    /** Delete the client */
    deleteClient: () => Promise<void>;
    /** Regenerate the client secret */
    regenerateSecret: () => Promise<string>;
    /** Refetch client from API */
    refetch: () => Promise<void>;
}
/**
 * Hook for managing a single OAuth client
 *
 * @param clientId - The client ID to manage
 *
 * @example
 * ```tsx
 * const { client, update, deleteClient, regenerateSecret } = useOAuthClient(clientId);
 *
 * const handleRegenerate = async () => {
 *   const newSecret = await regenerateSecret();
 *   // newSecret is shown only once!
 * };
 * ```
 */
declare function useOAuthClient(clientId: string): UseOAuthClientReturn;

interface UseOAuthConsentReturn {
    /** Client and scope info for consent display */
    clientInfo: OAuthConsentInfo | null;
    /** Whether consent info is being loaded */
    isLoading: boolean;
    /** Error from consent flow */
    error: Error | null;
    /** Approve the authorization request */
    approve: () => Promise<void>;
    /** Deny the authorization request */
    deny: () => Promise<void>;
    /** Whether approve/deny is in progress */
    isSubmitting: boolean;
}
/**
 * Hook for managing the OAuth consent flow
 *
 * @param params - OAuth authorization parameters from URL
 *
 * @example
 * ```tsx
 * const { clientInfo, isLoading, approve, deny } = useOAuthConsent({
 *   clientId: searchParams.client_id,
 *   redirectUri: searchParams.redirect_uri,
 *   scope: searchParams.scope,
 *   state: searchParams.state,
 * });
 *
 * // Render consent screen with clientInfo
 * // On button click: approve() or deny()
 * ```
 */
declare function useOAuthConsent(params: OAuthConsentRequest): UseOAuthConsentReturn;

interface TrialSubscriptionStatus {
    status: "loading" | "trial" | "active" | "expired";
    trialEndsAt: Date | null;
    daysRemaining: number;
    isGracePeriod: boolean;
    isBlocked: boolean;
}
declare function useSubscriptionStatus(): TrialSubscriptionStatus;

export { ClientJsonApiDelete, ClientJsonApiGet, ClientJsonApiPatch, ClientJsonApiPost, ClientJsonApiPut, DataListRetriever, type DirectFetchParams, JsonApiConfig, JsonApiProvider, type JsonApiProviderProps, type MutationMethod, type MutationParams, type TableContent, TableGeneratorRegistry, type TableStructureGeneratorInterface, type TrialSubscriptionStatus, type UseJsonApiGetOptions, type UseJsonApiGetResult, type UseJsonApiMutationResult, type UseOAuthClientReturn, type UseOAuthClientsReturn, type UseOAuthConsentReturn, type UseTableStructureHook, type UseTableStructureHookParams, type UseTableStructureHookReturn, configureClientJsonApi, directFetch, getClientApiUrl, getClientAppUrl, getClientToken, getClientTrackablePages, registerTableGenerator, tableGeneratorRegistry, useContentTableStructure, useCustomD3Graph, useDebounce, useJsonApiGet, useJsonApiMutation, useNotificationSync, useOAuthClient, useOAuthClients, useOAuthConsent, usePageTracker, usePageUrlGenerator, useRehydration, useRehydrationList, useRoleTableStructure, useSubscriptionStatus, useTableGenerator, useUrlRewriter, useUserSearch, useUserTableStructure };
