<script>
  (function() {
    const adminPath = window.ADMIN_PATH || '<%= typeof adminPath !== "undefined" ? adminPath : "/admin" %>';
    window.NAV_SECTIONS = [
      {
        title: 'Dashboard',
        items: [
          { id: 'overview', label: 'Overview', path: adminPath + '/stats/dashboard-home', icon: 'ti-layout-dashboard' },
        ]
      },
      {
        title: 'User Management',
        items: [
          { id: 'users', label: 'Users', path: adminPath + '/users', icon: 'ti-users' },
          { id: 'orgs', label: 'Organizations', path: adminPath + '/organizations', icon: 'ti-building-community' },
          { id: 'rbac', label: 'RBAC', path: adminPath + '/rbac', icon: 'ti-lock' },
          { id: 'notifications', label: 'Notifications', path: adminPath + '/notifications', icon: 'ti-bell' },
          { id: 'invites', label: 'Waiting List', path: adminPath + '/waiting-list', icon: 'ti-mail-forward' },
        ]
      },
      {
        title: 'Content & Config',
        items: [
          { id: 'i18n', label: 'I18n Entries', path: adminPath + '/i18n', icon: 'ti-language' },
          { id: 'locales', label: 'I18n Locales', path: adminPath + '/i18n/locales', icon: 'ti-world' },
          { id: 'json', label: 'JSON Configs', path: adminPath + '/json-configs', icon: 'ti-braces' },
          { id: 'markdowns', label: 'Markdowns', path: adminPath + '/markdowns', icon: 'ti-file-description' },
          { id: 'seo', label: 'SEO Config', path: adminPath + '/seo-config', icon: 'ti-search' },
          { id: 'assets', label: 'Assets', path: adminPath + '/assets', icon: 'ti-photo' },
          { id: 'file-manager', label: 'File Manager', path: adminPath + '/file-manager', icon: 'ti-folder' },
          { id: 'ui-components', label: 'UI Components', path: adminPath + '/ui-components', icon: 'ti-components' },
          { id: 'superdemos', label: 'SuperDemos', path: adminPath + '/superdemos', icon: 'ti-presentation' },
          { id: 'headless', label: 'Headless CMS', path: adminPath + '/headless', icon: 'ti-table' },
          { id: 'pages', label: 'Pages', path: adminPath + '/pages', icon: 'ti-file-text' },
          { id: 'blog-system', label: 'Blog system', path: adminPath + '/blog', icon: 'ti-news' },
        ]
      },
      {
        title: 'System & DevOps',
        items: [
          { id: 'settings', label: 'Global Settings', path: adminPath + '/global-settings', icon: 'ti-settings' },
          { id: 'plugins-system', label: 'Plugins system', path: adminPath + '/plugins-system', icon: 'ti-puzzle' },
          { id: 'flags', label: 'Feature Flags', path: adminPath + '/feature-flags', icon: 'ti-flag' },
          { id: 'ejs', label: 'Virtual EJS', path: adminPath + '/ejs-virtual', icon: 'ti-code' },
          { id: 'rate-limiter', label: 'Rate Limiter', path: adminPath + '/rate-limiter', icon: 'ti-traffic-cone' },
          { id: 'proxy', label: 'Proxy system', path: adminPath + '/proxy', icon: 'ti-world' },
          { id: 'cache', label: 'Cache Layer', path: adminPath + '/cache', icon: 'ti-database' },
	          { id: 'db-browser', label: 'DB Browser', path: adminPath + '/db-browser', icon: 'ti-database-search' },
          { id: 'data-cleanup', label: 'Data cleanup', path: adminPath + '/data-cleanup', icon: 'ti-broom' },
          { id: 'migration', label: 'Migration', path: adminPath + '/migration', icon: 'ti-database-export' },
          { id: 'webhooks', label: 'Webhooks', path: adminPath + '/webhooks', icon: 'ti-webhook' },
          { id: 'coolify', label: 'Coolify Deploy', path: adminPath + '/coolify-deploy', icon: 'ti-rocket' },
        ]
      },
      {
        title: 'Monitoring & AI',
        items: [
          { id: 'audit', label: 'Audit Logs', path: adminPath + '/audit', icon: 'ti-history' },
          { id: 'errors', label: 'Error Tracking', path: adminPath + '/errors', icon: 'ti-bug' },
          { id: 'experiments', label: 'Experiments', path: adminPath + '/experiments', icon: 'ti-flask-2' },
          { id: 'console-manager', label: 'Console Manager', path: adminPath + '/console-manager', icon: 'ti-terminal-2' },
          { id: 'health-checks', label: 'Health Checks', path: adminPath + '/health-checks', icon: 'ti-heartbeat' },
          { id: 'metrics', label: 'Metrics', path: adminPath + '/metrics', icon: 'ti-chart-bar' },
          { id: 'llm', label: 'LLM/AI', path: adminPath + '/admin-llm', icon: 'ti-brain' },
        ]
      },
      {
        title: 'Billing & Forms',
        items: [
          { id: 'stripe', label: 'Stripe Pricing', path: adminPath + '/stripe-pricing', icon: 'ti-credit-card' },
          { id: 'forms', label: 'Forms & Leads', path: adminPath + '/forms', icon: 'ti-forms' },
        ]
      },
      {
        title: 'Automation',
        items: [
          { id: 'agents', label: 'AI Agents', path: adminPath + '/agents', icon: 'ti-robot' },
          { id: 'telegram', label: 'Telegram Bots', path: adminPath + '/telegram', icon: 'ti-brand-telegram' },
          { id: 'workflows', label: 'Workflows', path: adminPath + '/workflows/all', icon: 'ti-robot' },
          { id: 'scripts', label: 'Scripts', path: adminPath + '/scripts', icon: 'ti-terminal-2' },
          { id: 'crons', label: 'Crons', path: adminPath + '/crons', icon: 'ti-clock' },
          { id: 'terminals', label: 'Terminals', path: adminPath + '/terminals', icon: 'ti-terminal' },
        ]
      }
    ];
  })();
</script>
