import { p as createBaseState, t as PHDocumentController, v as defaultBaseState } from "./dist-RakiOObV.mjs";
import { T as useDocumentById, c as useDocumentsInSelectedFolder, g as useSelectedDocument, s as useDocumentsInSelectedDrive } from "./dist-DFMBprYi.mjs";
import { a as utils, d as isResearchClaimDocument, l as assertIsResearchClaimDocument, t as ResearchClaim } from "./module-kuJQZaES.mjs";
//#region document-models/research-claim/v1/gen/controller.ts
/**
* WARNING: DO NOT EDIT
* This file is auto-generated and updated by codegen
*/
const ResearchClaimController = PHDocumentController.forDocumentModel(ResearchClaim);
//#endregion
//#region document-models/research-claim/v1/gen/ph-factories.ts
function defaultGlobalState() {
	return {
		title: null,
		description: null,
		content: null,
		kind: null,
		methodology: [],
		sources: [],
		topics: [],
		connections: []
	};
}
function defaultLocalState() {
	return {};
}
function defaultPHState() {
	return {
		...defaultBaseState(),
		global: defaultGlobalState(),
		local: defaultLocalState()
	};
}
function createGlobalState(state) {
	return {
		...defaultGlobalState(),
		...state || {}
	};
}
function createLocalState(state) {
	return {
		...defaultLocalState(),
		...state || {}
	};
}
function createState(baseState, globalState, localState) {
	return {
		...createBaseState(baseState?.auth, baseState?.document),
		global: createGlobalState(globalState),
		local: createLocalState(localState)
	};
}
/**
* Creates a ResearchClaimDocument with custom global and local state
* This properly handles the PHBaseState requirements while allowing
* document-specific state to be set.
*/
function createResearchClaimDocument(state) {
	return utils.createDocument(state ? createState(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
}
//#endregion
//#region document-models/research-claim/v1/hooks.ts
/** Hook to get a ResearchClaim document by its id */
function useResearchClaimDocumentById(documentId) {
	const [document, dispatch] = useDocumentById(documentId);
	if (!isResearchClaimDocument(document)) return [void 0, void 0];
	return [document, dispatch];
}
/** Hook to get the selected ResearchClaim document */
function useSelectedResearchClaimDocument() {
	const [document, dispatch] = useSelectedDocument();
	assertIsResearchClaimDocument(document);
	return [document, dispatch];
}
/** Hook to get all ResearchClaim documents in the selected drive */
function useResearchClaimDocumentsInSelectedDrive() {
	return useDocumentsInSelectedDrive()?.filter(isResearchClaimDocument);
}
/** Hook to get all ResearchClaim documents in the selected folder */
function useResearchClaimDocumentsInSelectedFolder() {
	return useDocumentsInSelectedFolder()?.filter(isResearchClaimDocument);
}
//#endregion
export { createResearchClaimDocument as a, defaultLocalState as c, useSelectedResearchClaimDocument as i, defaultPHState as l, useResearchClaimDocumentsInSelectedDrive as n, createState as o, useResearchClaimDocumentsInSelectedFolder as r, defaultGlobalState as s, useResearchClaimDocumentById as t, ResearchClaimController as u };

//# sourceMappingURL=research-claim-XXduct5V.mjs.map