import { C as PHBaseState, E as PHDocumentState, F as UpgradeManifest, M as SetNameAction, N as SignalDispatch, O as RedoAction, P as UndoAction, S as PHAuthState, c as DocumentModelGlobalState, d as DocumentModelUtils, g as LoadStateAction, j as SchemaPruneAction, k as Reducer, o as AttachmentInput$1, r as PHDocumentController, t as ActionMap, w as PHDocument, y as NOOPAction } from "../../index-DQ5mRIVf.js";
import { a as ZodString, c as $strip, i as ZodObject, n as ZodEnum, o as ZodType, r as ZodLiteral, s as $ZodTypeInternals, t as ZodAny } from "../../schemas-BLV80XhZ.js";
import { t as DocumentDispatch } from "../../index-B1aYlvX9.js";
import { A as PinMessageInput, C as Incremental, D as MakeOptional, E as MakeMaybe, F as SetChannelIdInput, I as UnpinMessageInput, M as RemoveReactionInput, N as Scalars, O as Maybe, P as SendMessageInput, S as Exact, T as MakeEmpty, _ as AttachmentInput, a as EditMessageAction, b as DeleteMessageInput, c as SendMessageAction, d as SetChannelIdAction, f as ChatDocument, g as Attachment, h as AddReactionInput, i as DeleteMessageAction, j as Reaction, k as Message, l as UnpinMessageAction, m as ChatPHState, n as AddReactionAction, o as PinMessageAction, p as ChatLocalState, r as ChatMessagesAction, s as RemoveReactionAction, t as ChatAction, u as ChatConfigAction, v as AttachmentType, w as InputMaybe, x as EditMessageInput, y as ChatState } from "../../actions-LXU_7Q7B.js";

//#region document-models/chat/v1/gen/document-model.d.ts
declare const documentModel: DocumentModelGlobalState;
declare namespace creators_d_exports {
  export { setChannelId };
}
declare const setChannelId: (input: SetChannelIdInput) => SetChannelIdAction;
declare namespace creators_d_exports$1 {
  export { addReaction, deleteMessage, editMessage, pinMessage, removeReaction, sendMessage, unpinMessage };
}
declare const sendMessage: (input: SendMessageInput, attachments: AttachmentInput$1[]) => SendMessageAction;
declare const editMessage: (input: EditMessageInput) => EditMessageAction;
declare const deleteMessage: (input: DeleteMessageInput) => DeleteMessageAction;
declare const pinMessage: (input: PinMessageInput) => PinMessageAction;
declare const unpinMessage: (input: UnpinMessageInput) => UnpinMessageAction;
declare const addReaction: (input: AddReactionInput) => AddReactionAction;
declare const removeReaction: (input: RemoveReactionInput) => RemoveReactionAction;
//#endregion
//#region document-models/chat/v1/gen/ph-factories.d.ts
declare function defaultGlobalState(): ChatState;
declare function defaultLocalState(): ChatLocalState;
declare function defaultPHState(): ChatPHState;
declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<ChatState>, localState?: Partial<ChatLocalState>): ChatPHState;
/**
 * Creates a ChatDocument with custom global and local state
 * This properly handles the PHBaseState requirements while allowing
 * document-specific state to be set.
 */
declare function createChatDocument(state?: Partial<{
  auth?: Partial<PHAuthState>;
  document?: Partial<PHDocumentState>;
  global?: Partial<ChatState>;
  local?: Partial<ChatLocalState>;
}>): ChatDocument;
//#endregion
//#region document-models/chat/v1/gen/utils.d.ts
declare const initialGlobalState: ChatState;
declare const initialLocalState: ChatLocalState;
//#endregion
//#region document-models/chat/v1/gen/reducer.d.ts
declare const reducer: Reducer<ChatPHState>;
//#endregion
//#region document-models/chat/v1/gen/controller.d.ts
declare const ChatController: new (initialDocument?: PHDocument<ChatPHState> | undefined) => PHDocumentController<ChatPHState> & ActionMap<ChatAction, PHDocumentController<ChatPHState>>;
//#endregion
//#region document-models/chat/v1/gen/schema/zod.d.ts
type Properties<T> = Required<{ [K in keyof T]: ZodType<T[K]> }>;
type definedNonNullAny = {};
declare const isDefinedNonNullAny: (v: any) => v is definedNonNullAny;
declare const definedNonNullAnySchema: ZodAny & ZodType<definedNonNullAny, any, $ZodTypeInternals<definedNonNullAny, any>>;
declare const AttachmentTypeSchema: ZodEnum<{
  FILE: "FILE";
  GIF: "GIF";
  IMAGE: "IMAGE";
  LINK: "LINK";
}>;
declare function AddReactionInputSchema(): ZodObject<Properties<AddReactionInput>>;
declare function AttachmentSchema(): ZodObject<Properties<Attachment>>;
declare function AttachmentInputSchema(): ZodObject<Properties<AttachmentInput>>;
declare function ChatStateSchema(): ZodObject<Properties<ChatState>>;
declare function DeleteMessageInputSchema(): ZodObject<Properties<DeleteMessageInput>>;
declare function EditMessageInputSchema(): ZodObject<Properties<EditMessageInput>>;
declare function MessageSchema(): ZodObject<Properties<Message>>;
declare function PinMessageInputSchema(): ZodObject<Properties<PinMessageInput>>;
declare function ReactionSchema(): ZodObject<Properties<Reaction>>;
declare function RemoveReactionInputSchema(): ZodObject<Properties<RemoveReactionInput>>;
declare function SendMessageInputSchema(): ZodObject<Properties<SendMessageInput>>;
declare function SetChannelIdInputSchema(): ZodObject<Properties<SetChannelIdInput>>;
declare function UnpinMessageInputSchema(): ZodObject<Properties<UnpinMessageInput>>;
//#endregion
//#region document-models/chat/v1/gen/document-type.d.ts
declare const chatDocumentType = "powerchat/chat";
//#endregion
//#region document-models/chat/v1/gen/document-schema.d.ts
/** Schema for validating the header object of a Chat document */
declare const ChatDocumentHeaderSchema: ZodObject<{
  id: ZodString;
  name: ZodString;
  createdAtUtcIso: ZodString;
  lastModifiedAtUtcIso: ZodString;
  documentType: ZodLiteral<"powerchat/chat">;
}, $strip>;
/** Schema for validating the state object of a Chat document */
declare const ChatPHStateSchema: ZodObject<{
  global: ZodObject<Required<{
    channelId: ZodType<Maybe<string>, unknown, $ZodTypeInternals<Maybe<string>, unknown>>;
    messages: ZodType<Message[], unknown, $ZodTypeInternals<Message[], unknown>>;
    pinnedMessageIds: ZodType<string[], unknown, $ZodTypeInternals<string[], unknown>>;
  }>, $strip>;
}, $strip>;
declare const ChatDocumentSchema: ZodObject<{
  header: ZodObject<{
    id: ZodString;
    name: ZodString;
    createdAtUtcIso: ZodString;
    lastModifiedAtUtcIso: ZodString;
    documentType: ZodLiteral<"powerchat/chat">;
  }, $strip>;
  state: ZodObject<{
    global: ZodObject<Required<{
      channelId: ZodType<Maybe<string>, unknown, $ZodTypeInternals<Maybe<string>, unknown>>;
      messages: ZodType<Message[], unknown, $ZodTypeInternals<Message[], unknown>>;
      pinnedMessageIds: ZodType<string[], unknown, $ZodTypeInternals<string[], unknown>>;
    }>, $strip>;
  }, $strip>;
  initialState: ZodObject<{
    global: ZodObject<Required<{
      channelId: ZodType<Maybe<string>, unknown, $ZodTypeInternals<Maybe<string>, unknown>>;
      messages: ZodType<Message[], unknown, $ZodTypeInternals<Message[], unknown>>;
      pinnedMessageIds: ZodType<string[], unknown, $ZodTypeInternals<string[], unknown>>;
    }>, $strip>;
  }, $strip>;
}, $strip>;
/** Simple helper function to check if a state object is a Chat document state object */
declare function isChatState(state: unknown): state is ChatPHState;
/** Simple helper function to assert that a document state object is a Chat document state object */
declare function assertIsChatState(state: unknown): asserts state is ChatPHState;
/** Simple helper function to check if a document is a Chat document */
declare function isChatDocument(document: unknown): document is ChatDocument;
/** Simple helper function to assert that a document is a Chat document */
declare function assertIsChatDocument(document: unknown): asserts document is ChatDocument;
//#endregion
//#region document-models/chat/v1/gen/config/operations.d.ts
interface ChatConfigOperations {
  setChannelIdOperation: (state: ChatState, action: SetChannelIdAction, dispatch?: SignalDispatch) => void;
}
//#endregion
//#region document-models/chat/v1/gen/messages/operations.d.ts
interface ChatMessagesOperations {
  sendMessageOperation: (state: ChatState, action: SendMessageAction, dispatch?: SignalDispatch) => void;
  editMessageOperation: (state: ChatState, action: EditMessageAction, dispatch?: SignalDispatch) => void;
  deleteMessageOperation: (state: ChatState, action: DeleteMessageAction, dispatch?: SignalDispatch) => void;
  pinMessageOperation: (state: ChatState, action: PinMessageAction, dispatch?: SignalDispatch) => void;
  unpinMessageOperation: (state: ChatState, action: UnpinMessageAction, dispatch?: SignalDispatch) => void;
  addReactionOperation: (state: ChatState, action: AddReactionAction, dispatch?: SignalDispatch) => void;
  removeReactionOperation: (state: ChatState, action: RemoveReactionAction, dispatch?: SignalDispatch) => void;
}
//#endregion
//#region document-models/chat/v1/hooks.d.ts
/** Hook to get a Chat document by its id */
declare function useChatDocumentById(documentId: string | null | undefined): [ChatDocument, DocumentDispatch<ChatAction>] | [undefined, undefined];
/** Hook to get the selected Chat document */
declare function useSelectedChatDocument(): [ChatDocument, DocumentDispatch<ChatAction>];
/** Hook to get all Chat documents in the selected drive */
declare function useChatDocumentsInSelectedDrive(): ChatDocument[] | undefined;
/** Hook to get all Chat documents in the selected folder */
declare function useChatDocumentsInSelectedFolder(): ChatDocument[] | undefined;
//#endregion
//#region document-models/chat/v1/actions.d.ts
/** Actions for the Chat document model */
declare const actions: {
  sendMessage: (input: SendMessageInput, attachments: AttachmentInput$1[]) => SendMessageAction;
  editMessage: (input: EditMessageInput) => EditMessageAction;
  deleteMessage: (input: DeleteMessageInput) => DeleteMessageAction;
  pinMessage: (input: PinMessageInput) => PinMessageAction;
  unpinMessage: (input: UnpinMessageInput) => UnpinMessageAction;
  addReaction: (input: AddReactionInput) => AddReactionAction;
  removeReaction: (input: RemoveReactionInput) => RemoveReactionAction;
  setChannelId: (input: SetChannelIdInput) => SetChannelIdAction;
  setName: (name: string | {
    name: string;
  }) => SetNameAction;
  undo: (count?: number, scope?: string) => UndoAction;
  redo: (count?: number, scope?: string) => RedoAction;
  prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
  loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
    name: string;
  }, operations: number) => LoadStateAction;
  noop: (scope?: string) => NOOPAction;
};
//#endregion
//#region document-models/chat/v1/utils.d.ts
/** Utils for the Chat document model */
declare const utils: DocumentModelUtils<ChatPHState>;
//#endregion
//#region document-models/chat/upgrades/versions.d.ts
declare const supportedVersions: readonly [1];
declare const latestVersion: 1;
//#endregion
//#region document-models/chat/upgrades/upgrade-manifest.d.ts
declare const chatUpgradeManifest: UpgradeManifest<typeof supportedVersions>;
//#endregion
export { AddReactionAction, AddReactionInput, AddReactionInputSchema, Attachment, AttachmentInput, AttachmentInputSchema, AttachmentSchema, AttachmentType, AttachmentTypeSchema, ChatAction, ChatConfigAction, ChatConfigOperations, ChatController, ChatDocument, ChatDocumentHeaderSchema, ChatDocumentSchema, ChatState as ChatGlobalState, ChatState, ChatLocalState, ChatMessagesAction, ChatMessagesOperations, ChatPHState, ChatPHStateSchema, ChatStateSchema, DeleteMessageAction, DeleteMessageInput, DeleteMessageInputSchema, EditMessageAction, EditMessageInput, EditMessageInputSchema, Exact, Incremental, InputMaybe, MakeEmpty, MakeMaybe, MakeOptional, Maybe, Message, MessageSchema, PinMessageAction, PinMessageInput, PinMessageInputSchema, Reaction, ReactionSchema, RemoveReactionAction, RemoveReactionInput, RemoveReactionInputSchema, Scalars, SendMessageAction, SendMessageInput, SendMessageInputSchema, SetChannelIdAction, SetChannelIdInput, SetChannelIdInputSchema, UnpinMessageAction, UnpinMessageInput, UnpinMessageInputSchema, actions, addReaction, assertIsChatDocument, assertIsChatState, creators_d_exports as chatConfigActions, chatDocumentType, creators_d_exports$1 as chatMessagesActions, chatUpgradeManifest, createChatDocument, createState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteMessage, documentModel, editMessage, initialGlobalState, initialLocalState, isChatDocument, isChatState, isDefinedNonNullAny, latestVersion, pinMessage, reducer, removeReaction, sendMessage, setChannelId, supportedVersions, unpinMessage, useChatDocumentById, useChatDocumentsInSelectedDrive, useChatDocumentsInSelectedFolder, useSelectedChatDocument, utils };
//# sourceMappingURL=index.d.ts.map