import { _ as defaultBaseState, f as createBaseState, t as PHDocumentController } from "./dist-DZj99xX4.js";
import { T as useDocumentById, c as useDocumentsInSelectedFolder, g as useSelectedDocument, s as useDocumentsInSelectedDrive } from "./dist-DAY54QOk.js";
import { a as utils, d as isKnowledgeNoteDocument, l as assertIsKnowledgeNoteDocument, t as KnowledgeNote } from "./module-R5x2F9BE.js";
//#region document-models/knowledge-note/v1/gen/controller.ts
/**
* WARNING: DO NOT EDIT
* This file is auto-generated and updated by codegen
*/
const KnowledgeNoteController = PHDocumentController.forDocumentModel(KnowledgeNote);
//#endregion
//#region document-models/knowledge-note/v1/gen/ph-factories.ts
function defaultGlobalState() {
	return {
		title: null,
		description: null,
		noteType: null,
		content: null,
		status: "DRAFT",
		provenance: null,
		links: [],
		topics: [],
		scope: null,
		confidence: null,
		severity: null,
		editor: null,
		models: [],
		hooksUsed: [],
		dispatchTargets: [],
		modelId: null,
		modules: [],
		version: null,
		filePath: null,
		computes: null,
		inputs: [],
		outputs: [],
		consumedBy: [],
		context: null,
		alternatives: [],
		consequences: [],
		decisionStatus: null,
		model: null,
		sourceType: null,
		targetType: null,
		relationType: null,
		cardinality: null,
		errorMessage: null,
		rootCause: null,
		correctPattern: null,
		lifecycleEvents: []
	};
}
function defaultLocalState() {
	return {
		lastViewedAt: null,
		personalTags: []
	};
}
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 KnowledgeNoteDocument with custom global and local state
* This properly handles the PHBaseState requirements while allowing
* document-specific state to be set.
*/
function createKnowledgeNoteDocument(state) {
	return utils.createDocument(state ? createState(createBaseState(state.auth, state.document), state.global, state.local) : void 0);
}
//#endregion
//#region document-models/knowledge-note/v1/hooks.ts
/** Hook to get a KnowledgeNote document by its id */
function useKnowledgeNoteDocumentById(documentId) {
	const [document, dispatch] = useDocumentById(documentId);
	if (!isKnowledgeNoteDocument(document)) return [void 0, void 0];
	return [document, dispatch];
}
/** Hook to get the selected KnowledgeNote document */
function useSelectedKnowledgeNoteDocument() {
	const [document, dispatch] = useSelectedDocument();
	assertIsKnowledgeNoteDocument(document);
	return [document, dispatch];
}
/** Hook to get all KnowledgeNote documents in the selected drive */
function useKnowledgeNoteDocumentsInSelectedDrive() {
	return useDocumentsInSelectedDrive()?.filter(isKnowledgeNoteDocument);
}
/** Hook to get all KnowledgeNote documents in the selected folder */
function useKnowledgeNoteDocumentsInSelectedFolder() {
	return useDocumentsInSelectedFolder()?.filter(isKnowledgeNoteDocument);
}
//#endregion
export { createKnowledgeNoteDocument as a, defaultLocalState as c, useSelectedKnowledgeNoteDocument as i, defaultPHState as l, useKnowledgeNoteDocumentsInSelectedDrive as n, createState as o, useKnowledgeNoteDocumentsInSelectedFolder as r, defaultGlobalState as s, useKnowledgeNoteDocumentById as t, KnowledgeNoteController as u };

//# sourceMappingURL=knowledge-note-B7aPXg1U.js.map