import { featureTips } from './feature-tips.js';

// 书签清理插件相关常量（不申请 management 权限）
const CLEANUP_EXTENSION = {
  ID: 'aeehapalakdoclgmfeondmephgiandef',
  STORE_URL: 'https://chromewebstore.google.com/detail/lazycat-bookmark-cleaner/aeehapalakdoclgmfeondmephgiandef'
};

function initBookmarkCleanupSettings() {
  const openCleanupButton = document.getElementById('open-bookmark-cleanup');
  if (!openCleanupButton) return;

  openCleanupButton.addEventListener('click', () => {
    // 无 management 权限时无法探测是否已安装：先尝试打开扩展页
    window.open(`chrome-extension://${CLEANUP_EXTENSION.ID}/index.html`, '_blank');
  });

  // 若设置里有商店链接按钮，一并绑定
  const storeLink = document.getElementById('bookmark-cleanup-store-link');
  if (storeLink) {
    storeLink.addEventListener('click', (event) => {
      event.preventDefault();
      window.open(CLEANUP_EXTENSION.STORE_URL, '_blank');
    });
  }
}

document.addEventListener('DOMContentLoaded', () => {
  initBookmarkCleanupSettings();
});

export {};
