export { A3D_APP_WORKFLOW_PRESETS, createA3DApp, resolveA3DAppQualityPreset } from "../apps/index.js";
export { Engine } from "../core/index.js";
export { Renderer, createExternalParityEnvironmentPipeline, listExternalParityEnvironmentTargets } from "../rendering/index.js";
export { GLTFLoader, createAssetCompatibilityReport, inspectGLTFAsset, loadRenderableAsset, summarizeExternalParityGLTFCorpus } from "../assets/index.js";
export { loadProductAsset } from "../product-studio/index.js";
export { createAnimationLabWorkflow, createAssetViewerWorkflow, createComparisonWorkflow, createInteractiveSceneWorkflow, createMaterialStudioWorkflow, createProductConfiguratorWorkflow, createSceneShowcaseWorkflow } from "../workflows/index.js";
export { A3DRenderer, A3DScene, A3DAppLifecycle } from "./advanced-runtime/index.js";
export * from "./agent-api/index.js";
export * from "./devtools/AuraDiagnosticsOverlay.js";
export * from "./devtools/AuraAssetPanel.js";
export * from "./devtools/AuraPerformancePanel.js";
export * from "./testing/screenshot.js";
export * from "./testing/routeHealth.js";
import { markAuraLazySystemLoaded, markAuraLazySystemRequested } from "./agent-api/index.js";
import { createAnimationLabWorkflow, createAssetViewerWorkflow, createComparisonWorkflow, createInteractiveSceneWorkflow, createMaterialStudioWorkflow, createProductConfiguratorWorkflow, createSceneShowcaseWorkflow } from "../workflows/index.js";
import { createExternalParityEnvironmentPipeline } from "../rendering/index.js";
import { createAssetCompatibilityReport, inspectGLTFAsset, loadRenderableAsset } from "../assets/index.js";
export const workflows = {
    assetViewer: createAssetViewerWorkflow,
    productConfigurator: createProductConfiguratorWorkflow,
    materialStudio: createMaterialStudioWorkflow,
    sceneShowcase: createSceneShowcaseWorkflow,
    interactiveScene: createInteractiveSceneWorkflow,
    animationLab: createAnimationLabWorkflow,
    comparison: createComparisonWorkflow
};
export function createEnvironment(options) {
    return createExternalParityEnvironmentPipeline(options);
}
export async function loadAsset(urlOrAsset, options = {}) {
    return await loadRenderableAsset(urlOrAsset, options);
}
export async function loadProductAssetLazy(options) {
    markAuraLazySystemRequested("product-gltf-loader", "loadProductAssetLazy");
    const started = Date.now();
    const productStudio = await import("../product-studio/index.js");
    markAuraLazySystemLoaded("product-gltf-loader", Date.now() - started);
    return productStudio.loadProductAsset(options);
}
export async function createPostProcessComposerLazy(options) {
    markAuraLazySystemRequested("postprocess", "createPostProcessComposerLazy");
    const started = Date.now();
    const rendering = await import("../rendering/index.js");
    markAuraLazySystemLoaded("postprocess", Date.now() - started);
    return new rendering.PostProcessComposer(options);
}
export function createMaterialVariantController(variants, initialVariant = variants[0]) {
    if (variants.length === 0)
        throw new Error("createMaterialVariantController requires at least one variant.");
    if (!variants.includes(initialVariant))
        throw new Error(`Unknown initial material variant: ${initialVariant}`);
    let current = initialVariant;
    return {
        get current() {
            return current;
        },
        variants,
        setVariant(variant) {
            if (!variants.includes(variant))
                throw new Error(`Unknown material variant: ${variant}`);
            current = variant;
            return current;
        },
        snapshot() {
            return { current, variants };
        }
    };
}
export function captureScreenshot(target) {
    const canvas = isA3DApp(target) ? findCanvasFromRenderer(target.renderer) : target;
    if (!canvas)
        throw new Error("captureScreenshot requires a canvas-backed A3D app or canvas.");
    if ("toDataURL" in canvas && typeof canvas.toDataURL === "function") {
        return {
            mimeType: "image/png",
            dataUrl: canvas.toDataURL("image/png"),
            width: canvas.width,
            height: canvas.height
        };
    }
    throw new Error("captureScreenshot currently requires an HTMLCanvasElement. OffscreenCanvas capture should use convertToBlob in application code.");
}
export function inspectAsset(asset, resources) {
    return inspectGLTFAsset(asset, resources);
}
export function createCompatibilityReport(manifest) {
    return createAssetCompatibilityReport(manifest);
}
export function createAssetDiagnostics(asset) {
    const gltf = asset.gltf;
    return {
        kind: asset.kind,
        ...(asset.url ? { url: asset.url } : {}),
        warnings: asset.warnings,
        unsupportedFeatures: gltf?.loaderDiagnostics.unsupportedExtensions ?? [],
        textureCount: gltf?.textures.length ?? 0,
        animationCount: gltf?.animations.length ?? 0,
        skinCount: gltf?.skins.length ?? 0,
        morphTargetMeshCount: gltf?.meshes.filter((mesh) => mesh.morphTargets.length > 0).length ?? 0
    };
}
export function createRenderDiagnostics(diagnostics) {
    return {
        drawCalls: diagnostics?.drawCalls ?? 0,
        buffers: diagnostics?.buffers ?? 0,
        shaders: diagnostics?.shaders ?? 0,
        textureCount: diagnostics?.textures,
        warnings: diagnostics ? [] : ["No render diagnostics have been recorded yet."]
    };
}
export function createDiagnosticsPanel(initial = {}) {
    let render = createRenderDiagnostics(initial.render);
    let asset = initial.asset;
    return {
        kind: "a3d-diagnostics-panel",
        update(next) {
            if (next.render)
                render = createRenderDiagnostics(next.render);
            if (next.asset)
                asset = next.asset;
        },
        snapshot() {
            return {
                render,
                ...(asset ? { asset } : {})
            };
        }
    };
}
function isA3DApp(value) {
    return "diagnostics" in value && typeof value.diagnostics === "function";
}
function findCanvasFromRenderer(renderer) {
    return renderer?.canvas;
}
//# sourceMappingURL=index.js.map