import './ai-popup.js';
import { AIPopup } from './ai-popup.js';
export function toggleAIPopup(inlineEditors, type, targetInlineRanges) {
    const popup = new AIPopup();
    popup.inlineEditors = inlineEditors;
    popup.type = type;
    popup.targetInlineRanges = targetInlineRanges;
    //console.log(111, inlineEditors, targetInlineRanges)
    const docPageEle = document.querySelectorAll('.affine-doc-viewport')[0];
    if (docPageEle) {
        const scrollTop = docPageEle ? docPageEle.scrollTop : 0;
        docPageEle.appendChild(popup);
        setTimeout(() => {
            docPageEle.scrollTo({
                top: scrollTop,
                behavior: 'instant'
            }); // smooth
        }, 0);
    }
    // document.body.appendChild(popup);
    return popup;
}
//# sourceMappingURL=toggle-ai-popup.js.map