'use strict'; var chunkB35DANTX_cjs = require('./chunk-B35DANTX.cjs'); var core = require('@angular/core'); function onDestroy(dispose) { let destroyRef = null; try { destroyRef = core.inject(core.DestroyRef); } catch { destroyRef = null; } destroyRef?.onDestroy(dispose); } function useWindowManager(options) { const wm = chunkB35DANTX_cjs.createWindowManager(options); onDestroy(() => wm.destroy()); return wm; } function useWmState(wm) { const state = core.signal(wm.getState()); const stop = wm.subscribe((next) => state.set(next)); onDestroy(stop); return state.asReadonly(); } function useWmWindow(wm, id) { const state = useWmState(wm); return core.computed(() => state().windows[id]); } function createDesktop(wm, options) { const binder = chunkB35DANTX_cjs.createDesktopBinder(wm, options); return { binder, desktop(element) { const unbind = binder.bindDesktop(element); onDestroy(unbind); }, window(id, windowOptions) { return (element) => { const unbind = binder.bindWindow(id, element, windowOptions); onDestroy(unbind); }; } }; } exports.createDesktop = createDesktop; exports.useWindowManager = useWindowManager; exports.useWmState = useWmState; exports.useWmWindow = useWmWindow; //# sourceMappingURL=angular.cjs.map //# sourceMappingURL=angular.cjs.map