import { Optional } from '@ephox/katamari';
import { SugarElement, Traverse } from '@ephox/sugar';
const view = (doc) => {
    var _a;
    // Only walk up to the document this script is defined in.
    // This prevents walking up to the parent window when the editor is in an iframe.
    const element = doc.dom === document ? Optional.none() : Optional.from((_a = doc.dom.defaultView) === null || _a === void 0 ? void 0 : _a.frameElement);
    return element.map(SugarElement.fromDom);
};
const owner = (element) => Traverse.owner(element);
export { view, owner };
//# sourceMappingURL=Navigation.js.map