{
  "clusterId": "44_INFRA_UIComponents",
  "featureFocus": "General Application Logic, Shared Helpers, Layouts, and Global UI Elements",
  "documentationReport": "{\n  \"title\": \"General Application Logic, Shared Helpers, Layouts, and Global UI Elements\",\n  \"description\": \"This comprehensive cluster forms the foundational components that provide the core structure, common functionalities, and user interface elements across the Xikolo platform. It integrates client-side logic, a rich set of UI components, robust styling, advanced asset management, custom form inputs, dynamic form handling, application-wide navigation, and essential browser compatibility features. This unified functional domain ensures a consistent, maintainable, and extensible user experience.\",\n  \"sections\": [\n    {\n      \"title\": \"Frontend Asset Management and Build Pipeline\",\n      \"content\": \"Frontend assets are managed through a sophisticated hybrid approach, transitioning from legacy Sprockets to a modern Webpack-driven pipeline. The `app/assets/javascripts/application.js` file serves as a Sprockets manifest, primarily requiring `jquery2` and `bootstrap-sprockets.js`. A custom `xfn/ready.js` provides a DOM ready utility for legacy JavaScript execution. The modern frontend is driven by `app/assets/main.js`, which acts as the main Webpack entry point. It imports polyfills, `Rails UJS` for unobtrusive JavaScript, legacy initializers, and a wide array of global UI components and utility modules. This modular structure, leveraging `data-attributes` for JS hooks and `data-controller` for complex behaviors, aligns with the project's JavaScript styleguide.\\n\\nThe build pipeline utilizes `Yarn` for package management, `Webpack` for bundling, `Babel` for JavaScript transpilation, `Sass` (with `sass-embedded`) and `PostCSS` for advanced CSS processing, and `TypeScript` for enhanced type safety in client-side logic. The `Rails Asset Pipeline` is also integrated for asset serving. Code quality and consistency are enforced through `ESLint` for JavaScript, `Stylelint` for CSS, and `Prettier` for code formatting.\\n\\nStyling is centralized in `app/assets/main.scss`, which imports `stylesheets/theme` and `stylesheets/global`. The `theme.scss` defines core colors and a color schema, while `global.scss` contains overarching styles. This structure is detailed in the branding documentation, emphasizing the use of SCSS variables for customization and adherence to a CSS styleguide that promotes BEM notation, American English spelling, and mobile-first design. Browser compatibility and support warnings are managed by `browser-warning.js` and the `BrowserSupport` utility, ensuring a consistent experience across different client environments.\"\n    },\n    {\n      \"title\": \"Global User Interface Components\",\n      \"content\": \"The `app/components/global/` directory houses a comprehensive suite of reusable UI components, primarily built with the `ViewComponent` framework, with some client-side logic leveraging `React` and `TypeScript`. These components encapsulate specific UI patterns and functionalities, promoting consistency and maintainability across the application. `ApplicationComponent` serves as a base for these components. Examples include:\\n\\n*   **`Global::Accordion`** (ViewComponent) and **`Accordion`** (JS): For collapsible content panels.\\n*   **`Global::ActionsDropdown`**: Provides a versatile dropdown menu for various actions, including destructive ones.\\n*   **`BasicTooltip`**: A fundamental component for displaying contextual information on hover or focus.\\n*   **`Global::Callout`**: Displays styled informational messages (success, error, warning, info) with customizable icons and titles, leveraging `I18n` for localization.\\n*   **`Global::CookieConsentBanner`**: Renders a banner for managing user cookie consent, interacting with the `ConsentCookie` utility and localized text.\\n*   **`Global::CopyToClipboard`**: A button component for copying text to the clipboard, offering visual feedback.\\n*   **`Global::CourseListBanner`**: Displays promotional banners on course listing pages, fetching dynamic content from the `Banner` model and utilizing server-side caching.\\n*   **`Global::CustomHeadSnippets`**: Dynamically injects HTML snippets into the document's `<head>` based on application configuration and user consent status.\\n*   **`Global::DisclosureWidget`**: A native HTML `<details>` element wrapper for progressive disclosure of content.\\n*   **`Global::DownloadButton`**: Standardized button for initiating file downloads.\\n*   **`Global::FaIcon`**: Renders Font Awesome icons, supporting advanced features like stacked icons.\\n*   **`Global::FilterBar`** (including `Controls`, `Filter`, `Search`): A set of components for building interactive data filtering interfaces, including search inputs, dropdowns, and result summaries, with extensive `I18n` support.\\n*   **`Global::FlashBlock`**, **`Global::FlashLayer`**, **`Global::FlashMessage`**: Components for displaying various types of flash messages (e.g., notice, alert, success, error) to the user, including SweetAlert2-style layers for prominent notifications.\\n*   **`Global::HelpdeskButton`**: Provides a consistent entry point to the helpdesk, potentially integrating with chatbot features based on feature toggles.\\n*   **`Global::ItemStatus`**: Displays the status of an item with an icon, title, and text, supporting various visual styles and connection types.\\n*   **`Global::LabeledCopyButton`**: A combination of a label, a value, and a copy-to-clipboard button.\\n*   **`Global::LinkItem`**: A generic component for rendering navigation links.\\n*   **`Global::Meter`**: Renders an HTML `<meter>` element for displaying scalar measurements within a known range.\\n*   **`Global::PageHeader`**: Standardized page header with title, subtitle, and optional `Pill` components.\\n*   **`Global::Pill`**: A small, styled text component for labels or indicators.\\n*   **`Global::Slider`**: A horizontal content slider, likely driven by a Stimulus.js controller, for displaying scrollable content.\\n*   **`Global::SvgIcon`**: Renders inline SVG icons from file paths.\\n*   **`Global::Table`**: A generic table component that handles data display and empty states.\\n*   **`Global::UserAvatar`**: Displays user avatars, fetching images from a dedicated helper and supporting various sizes and styles.\\n\\nThis cluster also includes specialized components for custom form inputs and dynamic form handling, such as `SimpleForm`, `Form::DynamicSortableList`, `SimpleFormTranslateWithVariables`, `SubmitButtonPrimary`, and `SimpleForm::Components::Pattern`, which enhance the user's interaction with forms across the platform.\"\n    },\n    {\n      \"title\": \"Core Application Logic and Controllers\",\n      \"content\": \"`ApplicationController` serves as the base for all web controllers, encapsulating cross-cutting concerns such as authentication (`Login` concern), authorization (`authorize!`, `authorize_any!`), flash message management, locale handling, and caching. It integrates with `Acfs` for inter-service communication and `Xikolo::Common::Auth::Middleware` for authentication. The controller also includes `FeatureTogglesHelper`, allowing feature-flag-driven behavior across the application. A notable technical debt is the continued use of `Acfs`, with a stated goal to migrate to `Restify`.\\n\\nSpecialized controllers handle specific global functionalities:\\n\\n*   **`CookieConsentController`**: Manages the acceptance and decline of cookie consents, persisting choices via `ConsentCookie`.\\n*   **`ErrorsController`**: Provides custom error pages for HTTP 4xx/5xx responses, logging exceptions to Sentry and Mnemosyne for monitoring.\\n*   **`FilesController`**: Responsible for serving static assets like user avatars, logos, and favicons, often redirecting to external image processing services or default images.\\n*   **`PingController`**: A lightweight health check endpoint, inheriting directly from `ActionController::Base` to minimize overhead.\\n*   **`WebManifestController`**: Dynamically generates the `manifest.json` for Progressive Web App (PWA) capabilities, based on global `Xikolo.config` settings.\\n*   **`Home::GoController`**: Manages various redirect scenarios, including safe external redirects (with checksum validation), deep links to courses/pinboards/items, and integration with LimeSurvey for surveys.\\n*   **`Home::HomeController`**: Renders the application's homepage, dynamically loading announcements (if the `announcements` feature is enabled and the `news` API is available) and course/topic/video content via configurable loaders.\\n*   **`Home::PagesController`**: Displays static content pages, retrieving data from the `Page` model and offering administrative views for page creation/editing.\\n*   **`IcalController`**: Generates iCalendar feeds for user-specific events, requiring the `ical_feed` feature and interacting with course data and user tokens.\\n*   **`LearningModeController`**: Handles logic related to specific learning modes, such as quiz recap, contingent on feature flags.\\n*   **`PagesController` (Admin)**: Provides administrative interface for editing static `Page` content, including robust handling of S3 file uploads and translations via `Xikolo::S3::TextWithUploadsProcessor`.\\n*   **`UsersController`**: Manages user-related actions like profile viewing, password changes, and account deletion, interacting with the `account` and `course` microservices.\"\n    },\n    {\n      \"title\": \"Helpers and Utilities\",\n      \"content\": \"Several helper modules provide common functionalities:\\n\\n*   **`ApplicationHelper`**: General-purpose helpers for browser support detection, image cropping, and Sentry meta tags.\\n*   **`BrowserSupport`**: A utility specifically for handling browser compatibility and detection logic.\\n*   **`IcalHelper`**: Assists in generating iCal hashes and URLs for calendar feeds.\\n*   **`MarkdownHelper`**: Provides functionality for rendering Markdown content, including custom link processing (e.g., opening external links in new tabs, adding tracking parameters) and HTML sanitization using `Sanitize` with a predefined configuration. This is crucial for security and content display.\\n*   **`SessionHelper`**: Manages user session lifecycle, including logout procedures that interact with the `account` microservice and preserve SAML session information for Single Log-Out.\\n*   **`UUIDHelper`**: Offers a utility for shortening UUIDs.\\n*   **`ViewMethodsHelper`**: Extends `ActionView::Helpers` and `SanitizeHelper::ClassMethods` for view-related utilities.\\n*   **`RedirectURL`**: A security utility class for safely handling redirects, preventing open redirect vulnerabilities by validating target URLs against the application's origin.\"\n    },\n    {\n      \"title\": \"Models and Operations\",\n      \"content\": \"This cluster includes foundational models and a base operation class:\\n\\n*   **`Page`**: An `ApplicationRecord` model representing static content pages. It uses a custom `Xikolo::S3::Markup` attribute type for its `text` field, indicating integration with S3 for rich text content and supporting multiple translations.\\n*   **`WellKnownFile`**: An `ApplicationRecord` model for storing content for `/.well-known/` files, with validation for filename format.\\n*   **`ApplicationOperation`**: A base class for application operations, introducing a `ResultNegotiation` pattern for handling various outcomes (e.g., success, failure) in a structured way.\"\n    },\n    {\n      \"title\": \"Presenters and Navigation\",\n      \"content\": \"Presenters and navigation components are crucial for structuring and displaying application-wide layouts and menus:\\n\\n*   **`Presenter`**: A generic base class for presenters, facilitating attribute initialization.\\n*   **`PrivatePresenter`**: A specialized presenter for handling private or authenticated content presentation.\\n*   **`Breadcrumbs`**: A presenter for managing and iterating through breadcrumb navigation levels.\\n*   **`MenuWithPermissions`**: A base class for defining menu items with associated text, icons, links, and permission checks, used to build dynamic navigation structures. `PlatformDashboardNav` is a concrete implementation for the admin dashboard.\\n*   **`IconNavigationPresenter`**: A presenter specifically designed for building navigation structures that incorporate icons.\\n*   **`Preloading::Preloader`**: A utility for preloading data to optimize performance and user experience.\\n*   **`PaginationRenderer`** and **`AjaxPaginationRenderer`**: Custom `WillPaginate` renderers for generating pagination links, with `AjaxPaginationRenderer` specifically adding `data-remote` attributes for AJAX-driven pagination.\"\n    }\n  ]\n}",
  "componentMapPatch": {
    "components": {
      "ApplicationController": {
        "type": "Controller",
        "description": "The base controller for the application, handling global concerns such as authentication, authorization, session management, flash messages, and locale settings. It integrates feature toggles and ACFS queue clearing. It also defines how `current_user` is determined and handles redirects, including external ones.",
        "interactions": {
          "interaction_0": "Includes `FeatureTogglesHelper` for feature flag checks. [Source: app/controllers/application_controller.rb]",
          "interaction_1": "Includes `Login` module for authentication logic. [Source: app/controllers/application_controller.rb]",
          "interaction_2": "Includes `Locale` module for internationalization. [Source: app/controllers/application_controller.rb]",
          "interaction_3": "Includes `Status` module for specific error classes and handling. [Source: app/controllers/application_controller.rb]",
          "interaction_4": "Interacts with `Acfs.runner` to clear the ACFS queue. [Source: app/controllers/application_controller.rb]",
          "interaction_5": "Uses `Xikolo::Common::Auth::Middleware` for authentication processing. [Source: app/controllers/application_controller.rb]",
          "interaction_6": "Interacts with `Xikolo.api(:account)` to manage user sessions. [Source: app/controllers/application_controller.rb]",
          "interaction_7": "Sets user context for `Sentry` for error tracking. [Source: app/controllers/application_controller.rb]",
          "interaction_8": "Manages `cookies.signed[:stored_location]` for post-login redirects. [Source: app/controllers/application_controller.rb]",
          "interaction_9": "Provides `helper_method :current_user` to make `current_user` available in views. [Source: app/controllers/application_controller.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/application_controller.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 22,
              "code": "# frozen_string_literal: true\n\nclass ApplicationController < ActionController::Base\n  # Make the FeatureTogglesHelper available in views as well as controllers\n  helper FeatureTogglesHelper\n  include FeatureTogglesHelper\n\n  include Login\n\n  protect_from_forgery with: :exception\n  before_action { Acfs.runner.clear } # clear Acfs queue\n  around_action :auth_middleware\n  after_action  :remember_user\n\n  include Locale\n\n  before_action :forget_location, if: proc {|_| current_user.anonymous? }\n\n  add_flash_types :error, :success\n\n  include Status # specific error classes and handling",
              "source": "app/controllers/application_controller.rb"
            },
            {
              "startLine": 24,
              "endLine": 37,
              "code": "  def add_flash_message(type, message)\n    (flash[type] ||= Set.new) << message\n  end\n\n  def redirect_to(options = {}, response_status = {})\n    (%i[error notice alert success] & response_status.keys).each do |type|\n      add_flash_message type, response_status.delete(type)\n    end\n\n    super\n  end\n\n  # Use this method when explicitly redirecting to an external URL that\n  # might have a different hostname. This...",
              "source": "app/controllers/application_controller.rb"
            },
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nclass ApplicationController < ActionController::Base\n  include Vary\n\n  # This is API!\n  skip_before_action :verify_authenticity_token\n\n  rescue_from ActiveRecord::RecordNotFound, with: :error_not_found\n  rescue_from ActionController::ParameterMissing, with: :error_param_missing",
              "source": "app/controllers/application_controller.rb"
            },
            {
              "startLine": 12,
              "endLine": 38,
              "code": "  def api_version\n    1\n  end\n\n  def error_not_found\n    error :not_found\n  end\n\n  def error_param_missing(exception)\n    error :unprocessable_content, json: {errors: {exception.param => 'required'}}\n  end\n\n  def rescue_from_api_error(err)\n    render json: err, status: err.status\n  end\n\n  def error(code, opts = {})\n    render opts.merge(status: code, plain: '{}')\n  end\n\n  def error!(...)\n    raise APIError.new(...)\n  end\n\n  class APIError < StandardError\n    attr_reader :status, :errors, :extra\n\n    def initialize(errors:, status: :unprocessable_content, **extra)\n      @errors = errors\n      @status = status\n      @extra  = extra\n\n      super('API error')\n    end\n\n    def as_json(... ",
              "source": "app/controllers/application_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/application_controller.rb",
              "relevance": 24
            },
            {
              "path": "services/account/app/controllers/application_controller.rb",
              "relevance": 24
            },
            {
              "path": "services/course/app/controllers/application_controller.rb",
              "relevance": 24
            }
          ]
        }
      },
      "CookieConsentController": {
        "type": "Controller",
        "description": "Handles the creation (acceptance or decline) of cookie consent preferences, redirecting back to the previous page after processing.",
        "interactions": {
          "interaction_0": "Interacts with `ConsentCookie` to manage cookie preferences [Source: app/controllers/cookie_consent_controller.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/cookie_consent_controller.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 16,
              "code": "# frozen_string_literal: true\n\nclass CookieConsentController < ApplicationController\n  def create\n    return head :no_content if params[:consent_name].blank?\n\n    consent_cookie = ConsentCookie.new(cookies)\n    if params[:accept].present?\n      consent_cookie.accept(params[:consent_name])\n    else\n      consent_cookie.decline(params[:consent_name])\n    end\n\n    redirect_back fallback_location: root_url\n  end\nend",
              "source": "app/controllers/cookie_consent_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/cookie_consent_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/abstract/ajax_controller.rb",
              "relevance": 5
            },
            {
              "path": "app/controllers/abstract/bridge_api_controller.rb",
              "relevance": 5
            }
          ]
        }
      },
      "ErrorsController": {
        "type": "Controller",
        "description": "A custom error handler for displaying pretty HTTP 4xx/5xx pages. It logs exceptions to Sentry and Mnemosyne and supports HTML and JSON formats.",
        "interactions": {
          "interaction_0": "Logs exceptions to `::Mnemosyne` [Source: app/controllers/errors_controller.rb]",
          "interaction_1": "Captures exceptions with `Sentry` [Source: app/controllers/errors_controller.rb]",
          "interaction_2": "Uses `I18n.t` for localized error messages [Source: app/controllers/errors_controller.rb, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/errors_controller.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 12,
              "code": "# frozen_string_literal: true\n\n# Error handler for custom pretty HTTP 4xx/5xx pages.\n# Called per Rails convention via config.exceptions_app.\nclass ErrorsController < ApplicationController\n  skip_before_action :verify_authenticity_token\n\n  ##\n  # Which error template do we want to show for which status code?\n  #\n  STATUS_TEMPLATES = {\n    404 => :not_found,\n  }.freeze",
              "source": "app/controllers/errors_controller.rb"
            },
            {
              "startLine": 15,
              "endLine": 24,
              "code": "  ##\n  # Log an exception and show its pretty error page.\n  #\n  def show\n    log!\n\n    if STATUS_TEMPLATES.key?(status_code)\n      pretty_error_page STATUS_TEMPLATES[status_code]\n    else\n      fallback\n    end\n  end",
              "source": "app/controllers/errors_controller.rb"
            },
            {
              "startLine": 28,
              "endLine": 36,
              "code": "  ##\n  # Show a pretty error page, but use the status code determined by Rails.\n  #\n  def pretty_error_page(template)\n    respond_to do |format|\n      format.html { render template: \"errors/#{template}\", layout: 'layouts/error', status: status_code }\n      format.json do\n        render json: {\n          title: t(:'errors.#{template}.headline'),\n          detail: t(:'errors.#{template}.message'),\n...",
              "source": "app/controllers/errors_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/errors_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/abstract/ajax_controller.rb",
              "relevance": 5
            },
            {
              "path": "app/controllers/abstract/bridge_api_controller.rb",
              "relevance": 5
            }
          ]
        }
      },
      "FilesController": {
        "type": "Controller",
        "description": "Serves various static files such as user avatars, logos, and favicons. It redirects to external image services or default images, applying image transformations if requested.",
        "interactions": {
          "interaction_0": "Fetches user data from `Xikolo::Account::User` [Source: app/controllers/files_controller.rb]",
          "interaction_1": "Uses `Imagecrop.transform` for image manipulation [Source: app/controllers/files_controller.rb]",
          "interaction_2": "Redirects to `view_context.image_url` for default images [Source: app/controllers/files_controller.rb]",
          "interaction_3": "Serves `logo.png` and `favicon.ico` as described in branding documentation [Source: app/controllers/files_controller.rb, docs/app/development/branding/images.md]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/files_controller.rb",
            "app/helpers/application_helper.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 31,
              "code": "# frozen_string_literal: true\n\nclass FilesController < ApplicationController\n  # The user is not needed to serve a file\n  skip_around_action :auth_middleware\n\n  def avatar\n    user = Xikolo::Account::User.find params[:id]\n    Acfs.run\n    if user.present? && user.avatar_url\n      url = user.avatar_url\n    else\n      url = view_context.image_url(\"defaults/#{requested_user_image_size}.png\")\n    end\n    imagecrop_params = params.permit(:height, :width).to_h.compact\n    if imagecrop_params.any?\n      redirect_external Imagecrop.transform(url, {'gravity' => 'ce'}.merge(imagecrop_params))\n    else\n      redirect_external(url)\n    end\n  end\n\n  def logo\n    expires_in 1.month, public: true\n\n    if params[:email]\n      redirect_external view_context.image_url('logo_mail.png'), status: :found\n    else\n      redirect_external view_context.image_url('logo.png'), status: :found\n    end\n  end\n\n  def favicon\n    expires_in 1.month, public: true\n    redirect_external view_context.image_url('favicon.ic...",
              "source": "app/controllers/files_controller.rb"
            },
            {
              "startLine": 1,
              "endLine": 21,
              "code": "# frozen_string_literal: true\n\nmodule WellKnown\n  class FilesController < ApplicationController\n    def show\n      file = WellKnownFile.find(params[:filename])\n\n      expires_in 1.hour, public: true\n\n      # Skip rendering if we can respond with a 304 Not Modified because ETag or\n      # If-Modified-Since header values match.\n      fresh_when(file) || render(plain: file.content)\n    rescue ActiveRecord::RecordNotFound\n      # If the requested file can not be found, we behave like a non-existing\n      # controller action so that our 404 error handler can kick in.\n      raise AbstractController::ActionNotFound\n    end\n  end\nend\n...",
              "source": "app/controllers/files_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/files_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/well_known/files_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/abstract/ajax_controller.rb",
              "relevance": 5
            }
          ]
        }
      },
      "Home::GoController": {
        "type": "Controller",
        "description": "Handles various redirect functionalities, including safe external redirects, deep links to courses, pinboards, and items, and integration with LimeSurvey for surveys.",
        "interactions": {
          "interaction_0": "Uses `Xikolo::Common::Tracking::ExternalLink` for safe external redirects [Source: app/controllers/home/go_controller.rb]",
          "interaction_1": "Interacts with `Xikolo.api(:course)` and `Xikolo.api(:pinboard)` for deep linking [Source: app/controllers/home/go_controller.rb]",
          "interaction_2": "Integrates with `Xikolo.config.limesurvey_url` for survey redirects [Source: app/controllers/home/go_controller.rb]",
          "interaction_3": "Uses `current_user` to add pseudo ID to survey query params [Source: app/controllers/home/go_controller.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/home/go_controller.rb"
          ]
        }
      },
      "Home::HomeController": {
        "type": "Controller",
        "description": "Renders the application's homepage, dynamically loading announcements, course categories, topics, and videos based on application configuration and feature toggles.",
        "interactions": {
          "interaction_0": "Checks `feature?('announcements')` and `Xikolo.api?(:news)` for news integration [Source: app/controllers/home/home_controller.rb]",
          "interaction_1": "Uses `Rails.application.config.homepage_course_loader`, `homepage_topics_loader`, `homepage_video_loader` for dynamic content loading [Source: app/controllers/home/home_controller.rb, docs/app/development/branding/homepage.md]",
          "interaction_2": "Interacts with `Xikolo.api(:news)` to fetch announcements [Source: app/controllers/home/home_controller.rb]",
          "interaction_3": "Captures exceptions with `Sentry` and `Mnemosyne` for API errors [Source: app/controllers/home/home_controller.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/home/home_controller.rb",
            "app/presenters/announcement_presenter.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.9,
          "codeBlocks": [
            {
              "startLine": 8,
              "endLine": 22,
              "code": "  def index\n    get_params = {\n      published: !current_user.allowed?('news.announcement.show'),\n      language: I18n.locale,\n    }\n    get_params[:user_id] = current_user.id if current_user.logged_in?\n\n    @posts = Xikolo.api(:news).value!.rel(:posts).get(\n      get_params\n    ).value!.map do |post|\n      AnnouncementPresenter.create post\n    end\n\n    set_meta_tags(title: t(:'announcements.title', brand: Xikolo.config.site_name))\n  end",
              "source": "app/controllers/home/announcements_controller.rb"
            },
            {
              "startLine": 9,
              "endLine": 39,
              "code": "  def show\n    @channel = Home::ChannelPresenter.new(channel_resource)\n    set_meta_tags @channel.meta_tags\n\n    courses = Catalog::Course.released\n      .for_channel_list(channel_resource)\n      .for_user(current_user)\n\n    Course::Cluster.ids.each do |cluster|\n      courses = courses.by_classifier(cluster, params[cluster]) if params[cluster].present?\n    end\n\n    if params[:lang].present?\n      courses = courses.where(lang: params[:lang])\n    end\n\n    if params[:q].present?\n      courses = courses.search_by_text(params[:q])\n    end\n\n    @enrollments = enrollments_hash(courses)\n\n    # Self-paced courses are paginated and rendered asynchronously via ajax\n    if request.xhr? && params[:page].present?\n      courses = courses.self_paced.paginate(page: params[:page], per_page: COURSES_PER_PAGE)\n\n      response.s...",
              "source": "app/controllers/home/announcements_controller.rb"
            },
            {
              "startLine": 11,
              "endLine": 37,
              "code": "  def index\n    set_page_title t(:'header.navigation.courses')\n\n    courses = Catalog::Course.released.for_global_list.for_user(current_user)\n\n    if params[:channel].present?\n      channel = Course::Channel.by_identifier(params[:channel]).take\n      courses = courses.where(channel:) if channel\n    end\n\n    Course::Cluster.ids.each do |cluster|\n      courses = courses.by_classifier(cluster, params[cluster]) if params[cluster].present?\n    end\n\n    if params[:lang].present?\n      courses = courses.where(lang: params[:lang])\n    end\n\n    if params[:q].present?\n      courses = courses.search_by_text(params[:q])\n    end\n\n    @enrollments = enrollments_hash\n\n    # Self-paced courses are paginated and rendered asynchronously via ajax\n    if request.xhr? && params[:page].present?\n      courses = courses.self_paced.paginate(page:...",
              "source": "app/controllers/home/announcements_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/home/announcements_controller.rb",
              "relevance": 12
            },
            {
              "path": "app/controllers/home/channels_controller.rb",
              "relevance": 12
            },
            {
              "path": "app/controllers/home/courses_controller.rb",
              "relevance": 12
            }
          ]
        }
      },
      "Home::PagesController": {
        "type": "Controller",
        "description": "Displays static content pages, fetching content from the `Page` model. It provides a special view for administrators to create non-existent pages.",
        "interactions": {
          "interaction_0": "Interacts with the `Page` model to retrieve page content and translations [Source: app/controllers/home/pages_controller.rb, app/models/page.rb]",
          "interaction_1": "Uses `PagePresenter` to format page data for views [Source: app/controllers/home/pages_controller.rb]",
          "interaction_2": "Checks `current_user.allowed?('helpdesk.page.store')` for administrative access [Source: app/controllers/home/pages_controller.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/home/pages_controller.rb",
            "app/models/page.rb",
            "app/presenters/page_presenter.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 41,
              "code": "# frozen_string_literal: true\n\nclass PagesController < Abstract::FrontendController\n  require_permission 'helpdesk.page.store'\n\n  def edit\n    @page = Page.find_or_initialize_by(\n      name: params[:id],\n      locale: params.require(:locale)\n    )\n  end\n\n  def update\n    @page = Page.find_or_initialize_by(\n      name: params[:id],\n      locale: params.require(:locale)\n    )\n\n    processor = process_uploads(@page)\n\n    @page.assign_attributes(page_params.except(:text))\n    @page.text = processor.result\n\n    if processor.valid? && @page.save\n      processor.commit!\n      processor.obsolete_uris.each do |uri|\n        # The page has been saved, so obsolete S3 files can be removed now.\n        # Fault-tolerance: Wait one minute to allow pages for users with slow\n        # connection to finish loading.\n        S3FileDeletionJob.set(wait: 1.minute).perform_later(uri)\n      end\n\n      redirect_to page_path(@page.name)\n    else\n      processor.rollback!\n      processor.errors.each do |_url, cod...",
              "source": "app/controllers/pages_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/pages_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/home/announcements_controller.rb",
              "relevance": 12
            },
            {
              "path": "app/controllers/home/channels_controller.rb",
              "relevance": 12
            }
          ]
        }
      },
      "IcalController": {
        "type": "Controller",
        "description": "Generates iCalendar feeds for user-specific events, such as course start dates and submission deadlines. Requires the `ical_feed` feature to be enabled.",
        "interactions": {
          "interaction_0": "Requires `ical_feed` feature [Source: app/controllers/ical_controller.rb]",
          "interaction_1": "Fetches `next_dates` from `Xikolo.api(:course)` [Source: app/controllers/ical_controller.rb]",
          "interaction_2": "Uses `User.find` from `Xikolo::Account` to retrieve user language [Source: app/controllers/ical_controller.rb]",
          "interaction_3": "Utilizes `IcalHelper` for generating iCal hashes [Source: app/controllers/ical_controller.rb, app/helpers/ical_helper.rb]",
          "interaction_4": "Constructs iCalendar events using `Icalendar` gem [Source: app/controllers/ical_controller.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/ical_controller.rb",
            "app/helpers/ical_helper.rb",
            "app/presenters/course/next_date_presenter.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 16,
              "code": "class IcalController < ApplicationController\n  require 'icalendar'\n  require 'icalendar/tzinfo'\n  require 'digest'\n\n  include Xikolo::Account\n  include IcalHelper\n\n  before_action :set_no_cache_headers\n\n  require_feature 'ical_feed'",
              "source": "app/controllers/ical_controller.rb"
            },
            {
              "startLine": 18,
              "endLine": 35,
              "code": "  def index\n    if %i[u h].all? {|k| params[k].present? }\n      begin\n        uuid = UUID params[:u]\n      rescue TypeError\n        raise Status::NotFound\n      end\n\n      events = Xikolo.api(:course).value!.rel(:next_dates).get({user_id: uuid.to_s}).value!\n\n      User.find(uuid.to_s) do |user|\n        I18n.locale = user.language if user.language.present?\n        if params[:h] == ical_hash(user)\n          cal = Icalendar::Calendar.new\n          tz = TZInfo::Timezone.get 'UTC'\n          cal.add_timezone tz.ical_timezone(Time.zone.now)\n          events.each do |next_date|\n            cal.event do |e|\n              next_date_presenter = Course::NextDatePresenter.new next_date\n              if next_date_presenter.id == 'item_subm...'",
              "source": "app/controllers/ical_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/ical_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/abstract/ajax_controller.rb",
              "relevance": 5
            },
            {
              "path": "app/controllers/abstract/bridge_api_controller.rb",
              "relevance": 5
            }
          ]
        }
      },
      "LearningModeController": {
        "type": "Controller",
        "description": "Manages functionalities related to learning modes, specifically the quiz recap feature. It requires the `quiz_recap` feature to be active.",
        "interactions": {
          "interaction_0": "Requires `quiz_recap` feature [Source: app/controllers/learning_mode_controller.rb]",
          "interaction_1": "Uses `CourseContextHelper` for course-specific context [Source: app/controllers/learning_mode_controller.rb]",
          "interaction_2": "Interacts with `Xikolo::Course::Item` to find quiz items [Source: app/controllers/learning_mode_controller.rb]",
          "interaction_3": "Uses `I18n.t` for flash messages [Source: app/controllers/learning_mode_controller.rb, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/learning_mode_controller.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 37,
              "code": "# frozen_string_literal: true\n\nclass LearningModeController < Abstract::FrontendController\n  include CourseContextHelper\n\n  before_action :ensure_logged_in\n  require_feature 'quiz_recap', only: :index\n  respond_to :json\n\n  inside_course only: :index\n\n  def index\n    # Wait for the navigation and header to load\n    Acfs.run\n\n    render\n  end\n\n  def review\n    if params[:quiz_id] && params[:course_id]\n      Xikolo::Course::Item.find_by content_id: params[:quiz_id] do |item_tmp|\n        @item = Xikolo::Course::Item.find item_tmp.id\n      end\n      Acfs.run\n      redirect_to course_item_path course_id: params[:course_id],\n        id: @item.prev_item_id || @item.id\n    else\n      add_flash_message :error, t(:'flash.error.params_missing_learn_review')\n      redirect_to learn_path\n    end\n  end\n\n  private\n\n  def auth_context\n    if params[:course_id]\n      the_course.context_id\n    else\n      :root\n    end\n  end\nend",
              "source": "app/controllers/learning_mode_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/learning_mode_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/abstract/ajax_controller.rb",
              "relevance": 5
            },
            {
              "path": "app/controllers/abstract/bridge_api_controller.rb",
              "relevance": 5
            }
          ]
        }
      },
      "PagesController": {
        "type": "Controller",
        "description": "Admin controller for editing and updating static `Page` content. It handles file uploads to S3 for rich text content and manages page translations.",
        "interactions": {
          "interaction_0": "Requires `helpdesk.page.store` permission [Source: app/controllers/pages_controller.rb]",
          "interaction_1": "Interacts with the `Page` model for content management [Source: app/controllers/pages_controller.rb, app/models/page.rb]",
          "interaction_2": "Uses `Xikolo::S3::TextWithUploadsProcessor` for S3 file uploads within page content [Source: app/controllers/pages_controller.rb, Foundational Context]",
          "interaction_3": "Queues `S3FileDeletionJob` for obsolete S3 files [Source: app/controllers/pages_controller.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/pages_controller.rb",
            "app/models/page.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 35,
              "code": "# frozen_string_literal: true\n\nclass PagesController < Abstract::FrontendController\n  require_permission 'helpdesk.page.store'\n\n  def edit\n    @page = Page.find_or_initialize_by(\n      name: params[:id],\n      locale: params.require(:locale)\n    )\n  end\n\n  def update\n    @page = Page.find_or_initialize_by(\n      name: params[:id],\n      locale: params.require(:locale)\n    )\n\n    processor = process_uploads(@page)\n\n    @page.assign_attributes(page_params.except(:text))\n    @page.text = processor.result\n\n    if processor.valid? && @page.save\n      processor.commit!\n      processor.obsolete_uris.each do |uri|\n        # The page has been saved, so obsolete S3 files can be removed now.\n        # Fault-tolerance: Wait one minute to allow pages for users with slow\n        # connection to finish loading.\n        S3FileDeletionJob.set(wait: 1.minute).perform_later(uri)\n      end\n\n      redirect_to page_path(@page.name)\n    else\n      processor.rollback!\n      processor.errors.each do |_url, cod...",
              "source": "app/controllers/pages_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/pages_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/abstract/ajax_controller.rb",
              "relevance": 5
            },
            {
              "path": "app/controllers/abstract/bridge_api_controller.rb",
              "relevance": 5
            }
          ]
        }
      },
      "PingController": {
        "type": "Controller",
        "description": "A minimal controller for uptime checks, inheriting directly from `ActionController::Base` to avoid `ApplicationController` overhead. It returns a simple JSON 'Pong' message with timestamps.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/ping_controller.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 13,
              "code": "# frozen_string_literal: true\n\nclass PingController < ActionController::Base # rubocop:disable Rails/ApplicationController\n  ##\n  # We inherit from ActionController::Base as we don't need any\n  # ApplicationController handling. This controller is used for uptime checks.\n\n  def index\n    render json: {\n      message: 'Pong',\n      timenow_in_time_zone____: DateTime.now.in_time_zone.to_i,\n      timenow_without_timezone: DateTime.now.to_i,\n    }\n  end\nend",
              "source": "app/controllers/ping_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/ping_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/abstract/ajax_controller.rb",
              "relevance": 5
            },
            {
              "path": "app/controllers/abstract/bridge_api_controller.rb",
              "relevance": 5
            }
          ]
        }
      },
      "UsersController": {
        "type": "Controller",
        "description": "Manages user profiles, including viewing, password changes, and account deletion. It interacts with the `account` and `course` microservices.",
        "interactions": {
          "interaction_0": "Requires `ensure_logged_in` before actions [Source: app/controllers/users_controller.rb]",
          "interaction_1": "Authorizes `account.user.delete` and `account.user.change_password` permissions [Source: app/controllers/users_controller.rb]",
          "interaction_2": "Interacts with `Xikolo.api(:account)` for user data and password changes [Source: app/controllers/users_controller.rb]",
          "interaction_3": "Interacts with `Xikolo.api(:course)` for teacher information [Source: app/controllers/users_controller.rb]",
          "interaction_4": "Uses `UserProfilePresenter` and `UserPresenter` for data presentation [Source: app/controllers/users_controller.rb]",
          "interaction_5": "Uses `SessionHelper` for logout functionality [Source: app/controllers/users_controller.rb, app/helpers/session_helper.rb]",
          "interaction_6": "Uses `I18n.t` for flash messages [Source: app/controllers/users_controller.rb, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/users_controller.rb",
            "app/helpers/session_helper.rb",
            "app/presenters/user_profile_presenter.rb",
            "app/presenters/user_presenter.rb",
            "app/presenters/course/teacher_list_presenter.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 11,
              "endLine": 16,
              "code": "      def index\n        users = account_api.rel(:users).get({\n          query: params[:q],\n        }).value!\n\n        render json: users.map {|u| {id: u['id'], text: \"#{u['name']} (#{u['email']})\"} }\n      end",
              "source": "app/controllers/admin/ajax/users_controller.rb"
            },
            {
              "startLine": 9,
              "endLine": 11,
              "code": "      def show\n        render json: {id: @user_id}\n      end",
              "source": "app/controllers/admin/ajax/users_controller.rb"
            },
            {
              "startLine": 7,
              "endLine": 10,
              "code": "    before_action only: :update do\n      allow_content_types! %w[application/vnd.openhpi.user+json;v=1.0]\n    end\n    before_action :require_request_body!, only: :update",
              "source": "app/controllers/admin/ajax/users_controller.rb"
            },
            {
              "startLine": 12,
              "endLine": 21,
              "code": "    def update\n      return head(:not_found) unless authorization\n\n      replace_user_email! if params[:email].present?\n      # Update user if attributes should be changed or the avatar is deleted (explicitly).\n      update_user_attributes if user_params.present? || params.key?(:avatar)\n\n      render json: serialize_user, content_type: 'application/vnd.openhpi.user+json;v=1.0'\n    rescue EmailReplacementError => e\n      problem_details(e.type, e.message, status: :unprocessable_entity)\n    end",
              "source": "app/controllers/admin/ajax/users_controller.rb"
            },
            {
              "startLine": 23,
              "endLine": 27,
              "code": "    def destroy\n      return head(:not_found) unless authorization\n\n      account_api.rel(:user).delete({id: authorization['user_id']}).value!\n\n",
              "source": "app/controllers/admin/ajax/users_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/admin/ajax/users_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/bridges/chatbot/users_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/portal_api/users_controller.rb",
              "relevance": 24
            }
          ]
        }
      },
      "WebManifestController": {
        "type": "Controller",
        "description": "Generates the `manifest.json` file for Progressive Web Applications (PWAs). It dynamically configures the manifest based on `WebManifest` settings and `Xikolo.config`.",
        "interactions": {
          "interaction_0": "Checks `WebManifest.configured?` before rendering [Source: app/controllers/web_manifest_controller.rb]",
          "interaction_1": "Uses `Xikolo.config.site_name` for manifest name [Source: app/controllers/web_manifest_controller.rb]",
          "interaction_2": "Retrieves icons, related applications, and background color from `WebManifest` [Source: app/controllers/web_manifest_controller.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/controllers/web_manifest_controller.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 28,
              "code": "class WebManifestController < ApplicationController   before_action do     # If the manifest is not properly configured, don't render one     raise AbstractController::ActionNotFound unless WebManifest.configured?   end    def show     manifest = {       name: Xikolo.config.site_name,       short_name: Xikolo.config.site_name,       start_url: dashboard_path(tracking_campaign: 'web_app_manifest'),       display: 'standalone',       icons: WebManifest.icons,       prefer_related_applications: WebManifest.prefer_native_apps?,       related_applications: WebManifest.linked_apps     }      # A background color to show behind the icon when the app is being launched     manifest[:background_color] = WebManifest.background_color if WebManifest.background_color      render json: manifest   end end",
              "source": "app/controllers/web_manifest_controller.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/controllers/web_manifest_controller.rb",
              "relevance": 24
            },
            {
              "path": "app/controllers/abstract/ajax_controller.rb",
              "relevance": 5
            },
            {
              "path": "app/controllers/abstract/bridge_api_controller.rb",
              "relevance": 5
            }
          ]
        }
      },
      "ApplicationHelper": {
        "type": "Helper",
        "description": "Provides utility methods for views, primarily focused on browser compatibility warnings, image processing, and Sentry integration.",
        "interactions": {
          "interaction_0": "Uses `BrowserSupport` to determine browser compatibility. [Source: app/helpers/application_helper.rb]",
          "interaction_1": "Interacts with `Imagecrop` for image URL transformations. [Source: app/helpers/application_helper.rb]",
          "interaction_2": "Retrieves trace propagation meta tags from `Sentry`. [Source: app/helpers/application_helper.rb]",
          "interaction_3": "Checks `cookies[:_browser_warning]` to hide browser warnings. [Source: app/helpers/application_helper.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/helpers/application_helper.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 20,
              "code": "module ApplicationHelper\n  def browser_support\n    @browser_support ||= BrowserSupport.new(browser)\n  end\n\n  def hide_browser_warning?\n    @in_app || cookies[:_browser_warning] == 'hide' # rubocop:disable Rails/HelperInstanceVariable\n  end\n\n  def imagecrop(image_url, query_params = {})\n    Imagecrop.transform(\n      image_path(image_url),\n      query_params\n    )\n  end\n\n  def sentry_meta_tags\n    Sentry.get_trace_propagation_meta.html_safe # rubocop:disable Rails/OutputSafety\n  end\nend",
              "source": "app/helpers/application_helper.rb"
            },
            {
              "startLine": 4,
              "endLine": 6,
              "code": "module ApplicationHelpers\n  include Rails.application.routes.url_helpers\nend",
              "source": "app/helpers/application_helper.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/helpers/application_helper.rb",
              "relevance": 19
            },
            {
              "path": "services/account/app/helpers/application_helpers.rb",
              "relevance": 19
            },
            {
              "path": "services/pinboard/app/helpers/application_helper.rb",
              "relevance": 19
            }
          ]
        }
      },
      "IcalHelper": {
        "type": "Helper",
        "description": "Provides methods for generating iCal hashes and URLs, used to create secure and unique links for calendar feeds.",
        "interactions": {
          "interaction_0": "Interacts with `Xikolo::Account::Token` to create user tokens [Source: app/helpers/ical_helper.rb]",
          "interaction_1": "Uses `Digest::SHA256` for hash generation [Source: app/helpers/ical_helper.rb]",
          "interaction_2": "Uses `UUID` for user ID formatting [Source: app/helpers/ical_helper.rb]",
          "interaction_3": "Constructs URLs using `Xikolo.base_url` [Source: app/helpers/ical_helper.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/helpers/ical_helper.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 18,
              "code": "module IcalHelper\n  # Build a hash from token and userID., can handle a user id or a user object\n  def ical_hash(user)\n    user_id = user.is_a?(String) ? user : user.id\n    token = Xikolo::Account::Token.create(user_id:)\n    Acfs.run\n    dig = Digest::SHA256.hexdigest [user_id, token.token].join\n    dig[10..20]\n  end\n\n  def ical_url(user, full_path: false)\n    path = \"ical.ical?u=#{UUID(user.id).to_param}&h=#{ical_hash(user)}\"\n    if full_path\n      Xikolo.base_url.join(path).to_s\n    else\n      \"/#{path}\"\n    end\n  end\nend",
              "source": "app/helpers/ical_helper.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/helpers/ical_helper.rb",
              "relevance": 19
            }
          ]
        }
      },
      "MarkdownHelper": {
        "type": "Helper",
        "description": "Provides methods for rendering Markdown content into HTML, including custom link handling (e.g., opening external links in new tabs, adding tracking parameters) and robust HTML sanitization.",
        "interactions": {
          "interaction_0": "Uses `Redcarpet::Markdown` for Markdown rendering [Source: app/helpers/markdown_helper.rb]",
          "interaction_1": "Uses `Sanitize.fragment` with `SANITIZE_CONFIG` for HTML sanitization [Source: app/helpers/markdown_helper.rb]",
          "interaction_2": "Interacts with `Xikolo::Common::Tracking::ExternalLink` for external link tracking [Source: app/helpers/markdown_helper.rb]",
          "interaction_3": "Uses `URI` and `Addressable::URI` for URL parsing and manipulation [Source: app/helpers/markdown_helper.rb]",
          "interaction_4": "Logs errors with `Rails.logger` [Source: app/helpers/markdown_helper.rb]"
        },
        "techDebt": [
          "Use of instance variables (`@internal_link_callback`, `@external_link_callback`) in `BlankTargets` class within a helper, which can lead to statefulness issues if not carefully managed [Source: app/helpers/markdown_helper.rb]"
        ],
        "provenance": {
          "sources": [
            "app/helpers/markdown_helper.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 32,
              "code": "module MarkdownHelper\n  EMPTY = ''\n\n  SANITIZE_CONFIG = Sanitize::Config.freeze_config(\n    elements: %w[\n      a abbr address article aside b bdi bdo blockquote body br caption cite\n      code col colgroup data dd del dfn div dl dt em figcaption figure footer\n      h1 h2 h3 h4 h5 h6 head header hgroup hr html i img ins kbd li main mark\n      nav ol p pre q rp rt ruby s samp section small span strike strong style\n      sub summary sup sup table tbody td tfoot th thead time title tr u ul\n      var wbr\n    ],\n    attributes: {\n      all: %w[class dir hidden id lang style tabindex title translate],\n      'a' => %w[href target rel],\n      'abbr' => %w[title],\n      'blockquote' => %w[cite],\n      'dfn' => %w[title],\n      'q' => %w[cite],\n      'time' => %w[datetime pubdate],\n      'col' => %w[span width],\n      'colgroup' => %w[span width],\n      'data' => %w[value],\n      'del' => %w[cite datetime],\n      'img' => %w[align alt border height src srcset width...",
              "source": "app/helpers/markdown_helper.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/helpers/markdown_helper.rb",
              "relevance": 19
            }
          ]
        }
      },
      "SessionHelper": {
        "type": "Helper",
        "description": "Manages user logout functionality, including interaction with the `account` microservice to delete sessions and preservation of SAML session information for Single Log-Out (SLO).",
        "interactions": {
          "interaction_0": "Interacts with `Xikolo.api(:account)` to delete user sessions [Source: app/helpers/session_helper.rb]",
          "interaction_1": "Captures exceptions with `Sentry` and `Mnemosyne` for API errors during logout [Source: app/helpers/session_helper.rb]",
          "interaction_2": "Manages `session` state, including `saml_uid`, `saml_session_index`, and `saml_provider` for SLO [Source: app/helpers/session_helper.rb]",
          "interaction_3": "Uses `OMNIAUTH_LOGOUT` for SAML provider checks [Source: app/helpers/session_helper.rb]"
        },
        "techDebt": [
          "Logout handling logic is copied to `OmniAuth::Strategies::XikoloSAML`, indicating potential for duplication or a need for a shared module [Source: app/helpers/session_helper.rb]"
        ],
        "provenance": {
          "sources": [
            "app/helpers/session_helper.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 5,
              "endLine": 25,
              "code": "def logout\n    if current_user.session_id\n      begin\n        account_api\n          .rel(:session)\n          .delete({id: current_user.session_id})\n          .value!\n\n      # If the session does not exists it has already been deleted by the\n      # Account service which is perfectly fine. We do not need to anything\n      # then.\n      rescue Restify::NotFound\n      #\n      # On any kind of gateway error or service unavailable we will ignore\n      # the error and continue. We invalidate the session on the client anyway.\n      # There is no need to show the user an exception is the logout \"mostly\"\n      # worked. Leftover sessions need to be recycled by the Account service.\n      #\n      # We attach the error to the mnemosyne trace for recording but is likely\n      # not an exception relevant for developers.\n      rescue Restify...",
              "source": "app/helpers/session_helper.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/helpers/session_helper.rb",
              "relevance": 19
            }
          ]
        }
      },
      "UUIDHelper": {
        "type": "Helper",
        "description": "Provides a utility method for shortening UUIDs.",
        "interactions": {
          "interaction_0": "Uses `UUID4` for UUID conversion and parameterization [Source: app/helpers/uuid_helper.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/helpers/uuid_helper.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 7,
              "code": "module UUIDHelper\n  def short_uuid(id)\n    UUID4(id).to_param\n  end\nend",
              "source": "app/helpers/uuid_helper.rb"
            },
            {
              "startLine": 3,
              "endLine": 7,
              "code": "module UUIDHelper\n  def short_uuid(id)\n    UUID(id).to_s(format: :base62)\n  end\nend",
              "source": "app/helpers/uuid_helper.rb"
            },
            {
              "startLine": 3,
              "endLine": 7,
              "code": "module UUIDHelper\n  def short_uuid(id)\n    UUID(id).to_param\n  end\nend",
              "source": "app/helpers/uuid_helper.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/helpers/uuid_helper.rb",
              "relevance": 19
            },
            {
              "path": "integration/features/support/ext/uuid_helper.rb",
              "relevance": 19
            },
            {
              "path": "spec/support/uuid_helper.rb",
              "relevance": 19
            }
          ]
        }
      },
      "ViewMethodsHelper": {
        "type": "Helper",
        "description": "A helper module that includes `ActionView::Helpers` and extends `SanitizeHelper::ClassMethods`, providing access to URL helpers and sanitization methods in views.",
        "interactions": {
          "interaction_0": "Includes `ActionView::Helpers` [Source: app/helpers/view_methods_helper.rb]",
          "interaction_1": "Extends `SanitizeHelper::ClassMethods` [Source: app/helpers/view_methods_helper.rb]",
          "interaction_2": "Provides `Rails.application.routes.url_helpers` [Source: app/helpers/view_methods_helper.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/helpers/view_methods_helper.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule ViewMethodsHelper\n  include ActionView::Helpers\n\n  def url_helpers\n    Rails.application.routes.url_helpers\n  end\n\n  def self.included(klazz)\n    klazz.extend SanitizeHelper::ClassMethods\n  end\nend",
              "source": "app/helpers/view_methods_helper.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/helpers/view_methods_helper.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Page": {
        "type": "Model",
        "description": "Represents static content pages within the application. It uses a custom `Xikolo::S3::Markup` attribute for its `text` field, allowing rich text content with S3 file uploads, and supports multiple language translations.",
        "interactions": {
          "interaction_0": "Uses `Xikolo::S3::Markup` for the `text` attribute, integrating with S3 for file uploads [Source: app/models/page.rb, Foundational Context]",
          "interaction_1": "Manages `has_many` associations for `translations` and `other_translations` [Source: app/models/page.rb]",
          "interaction_2": "Validates `name`, `title`, `text`, and `locale` [Source: app/models/page.rb]",
          "interaction_3": "Provides `preferred_locales` class method for ordering translations [Source: app/models/page.rb]"
        },
        "techDebt": [
          "`has_many` associations use `inverse_of: false` which might prevent some ActiveRecord optimizations and lead to N+1 queries if not handled carefully [Source: app/models/page.rb]"
        ],
        "provenance": {
          "sources": [
            "app/models/page.rb",
            "app/models/application_record.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 10,
              "code": "  def edit     @page = Page.find_or_initialize_by(       name: params[:id],       locale: params.require(:locale)     )   end",
              "source": "app/components/global/page_header.rb"
            },
            {
              "startLine": 12,
              "endLine": 39,
              "code": "  def update     @page = Page.find_or_initialize_by(       name: params[:id],       locale: params.require(:locale)     )      processor = process_uploads(@page)      @page.assign_attributes(page_params.except(:text))     @page.text = processor.result      if processor.valid? && @page.save       processor.commit!       processor.obsolete_uris.each do |uri|         # The page has been saved, so obsolete S3 files can be removed now.         # Fault-tolerance: Wait one minute to allow pages for users with slow         # connection to finish loading.         S3FileDeletionJob.set(wait: 1.minute).perform_later(uri)       end        redirect_to page_path(@page.name)     else       processor.rollback!       processor.errors.each do |_url, cod...",
              "source": "app/components/global/page_header.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/page_header.rb",
              "relevance": 30
            },
            {
              "path": "app/components/global/page_header_preview.rb",
              "relevance": 30
            },
            {
              "path": "app/controllers/pages_controller.rb",
              "relevance": 30
            }
          ]
        }
      },
      "WellKnownFile": {
        "type": "Model",
        "description": "Stores content for files served under the `/.well-known/` path, typically used for security or service discovery. It enforces a strict filename format.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/models/well_known_file.rb",
            "app/models/application_record.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 5,
              "endLine": 35,
              "code": "class WellKnownFile\n  # See https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html\n  class AppleAppSiteAssociation\n    def as_json\n      {\n        applinks: {\n          apps: [],\n          details: [\n            {\n              appID: \"#{app_id_prefix}.#{bundle_id}\",\n              paths: [\n                '/',\n                auth_path(provider: 'app'),\n                \"#{auth_path(provider: 'app')}*\",\n                dashboard_path,\n                courses_path,\n                \"#{courses_path}/*\",\n                \"#{channels_path}/*\",\n              ],\n            },\n          ],\n        },\n      }\n    end\n\n    include Rails.application.routes.url_helpers\n\n    def configured?\n      config.is_a?(Hash) && app_id_prefix? && bundle_id?\n    end\n\n    private\n\n    def app_id_prefix?\n      !app_id_prefix.nil?\n    end",
              "source": "app/models/well_known_file/apple_app_site_association.rb"
            },
            {
              "startLine": 5,
              "endLine": 32,
              "code": "class WellKnownFile\n  # See https://developers.google.com/digital-asset-links\n  class GoogleAssetLinks\n    def as_json\n      [{\n        relation: %w[\n          delegate_permission/common.handle_all_urls\n          delegate_permission/common.use_as_origin\n        ],\n        target: {\n          namespace: 'android_app',\n          package_name:,\n          sha256_cert_fingerprints:,\n        },\n      }]\n    end\n\n    def configured?\n      config.is_a?(Hash) && package_name? && sha256_cert_fingerprints?\n    end\n\n    private\n\n    def package_name?\n      !package_name.nil?\n    end\n\n    def package_name\n      config['package_name']\n    end",
              "source": "app/models/well_known_file/apple_app_site_association.rb"
            },
            {
              "startLine": 5,
              "endLine": 14,
              "code": "class WellKnownFile < ApplicationRecord\n  self.primary_key = :filename\n\n  # The filename can be anything but must not include a slash, as we do not\n  # support \"nested\" files. File extensions are to be included.\n  FILENAME_FORMAT = %r{\\A[^/]+\\z}\n\n  validates :filename, presence: true, format: {with: FILENAME_FORMAT}, length: 0..64\n  validates :content, presence: true\nend",
              "source": "app/models/well_known_file/apple_app_site_association.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/models/well_known_file/apple_app_site_association.rb",
              "relevance": 19
            },
            {
              "path": "app/models/well_known_file/google_asset_links.rb",
              "relevance": 19
            },
            {
              "path": "app/models/well_known_file.rb",
              "relevance": 19
            }
          ]
        }
      },
      "ApplicationOperation": {
        "type": "Operation",
        "description": "A base class for application operations, providing a `result` method that leverages a `ResultNegotiation` pattern. This allows clients to handle different operation outcomes (e.g., success, failure) in a structured and declarative way.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/operations/application_operation.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 27,
              "code": "# frozen_string_literal: true\n\nclass ApplicationOperation\n  class << self\n    def call(...)\n      new(...).call\n    end\n  end\n\n  ##\n  # Return one of several result variants.\n  #\n  # Operations should use this to decorate the return values of `#call`.\n  #\n  # The result will be wrapped so that clients can use to decide what to do for\n  # each type of result, without checking the type class.\n  #\n  #     OperationClass.call(...).on do |result|\n  #       result.success { redirect_with_flash }\n  #       result.failure { redirect_back_to_form_with_errors }\n  #     end\n  #\n  # The block which will be executed is chosen based on the class name of the\n  # result object returned from `#call`. The result object itself will be\n  # passed to the handler block.\n  #\n  def result(result)\n    ResultNegotiation.new result\n  end\n\n  class ResultNegotiation\n    def initialize(result)\n      @result = result\n\n      @variants = {}\n    end\n\n    def on\n      # Call the provided block to collect all response va...",
              "source": "app/operations/application_operation.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/operations/application_operation.rb",
              "relevance": 19
            },
            {
              "path": "services/account/app/operations/application_operation.rb",
              "relevance": 19
            },
            {
              "path": "services/course/app/operations/application_operation.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Breadcrumbs": {
        "type": "Presenter/Utility",
        "description": "Manages a collection of URL-text pairs to represent a navigation breadcrumb trail. It provides methods to add levels and iterate over them for rendering.",
        "interactions": {
          "interaction_0": "Used by views or layouts to render the breadcrumb navigation."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/presenters/breadcrumbs.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 14,
              "code": "# frozen_string_literal: true\n\nclass Breadcrumbs\n  def initialize\n    @levels = {}\n  end\n\n  def with_level(url, text)\n    @levels[url] = text\n    self\n  end\n\n  def each_level(&)\n    @levels.each(&)\n  end\nend",
              "source": "app/presenters/breadcrumbs.rb"
            },
            {
              "startLine": 1,
              "endLine": 15,
              "code": "# frozen_string_literal: true\n\nclass PinboardBreadcrumbsPresenter\n  def initialize(breadcrumbs, &thread_proc)\n    @breadcrumbs = breadcrumbs\n    @thread_proc = thread_proc\n  end\n\n  def for_list\n    @breadcrumbs\n  end\n\n  def for_thread(thread)\n    @thread_proc.call(@breadcrumbs, thread)\n  end\nend",
              "source": "app/presenters/breadcrumbs.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/presenters/breadcrumbs.rb",
              "relevance": 30
            },
            {
              "path": "app/presenters/pinboard_breadcrumbs_presenter.rb",
              "relevance": 11
            }
          ]
        }
      },
      "MenuWithPermissions": {
        "type": "Presenter",
        "description": "A base class for defining menu items with associated text, icons, links, and permission checks. It supports nested submenus and dynamic link generation based on context and user permissions.",
        "interactions": {
          "interaction_0": "Includes `Rails.application.routes.url_helpers` and `ActionView::Helpers::UrlHelper` for link generation [Source: app/presenters/menu_with_permissions.rb]",
          "interaction_1": "Checks user permissions via `user.allowed?` [Source: app/presenters/menu_with_permissions.rb]",
          "interaction_2": "Uses `I18n.t` for menu item text localization [Source: app/presenters/menu_with_permissions.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/presenters/menu_with_permissions.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 12,
              "code": "    def item(text, icon, opts = {}, &block)\n      items << {text:, icon:}.merge(opts).tap do |item|\n        next unless block\n\n        submenu = Class.new(self)\n        submenu.instance_exec(&block)\n        item[:submenu] = submenu\n      end\n    end",
              "source": "app/presenters/menu_with_permissions.rb"
            },
            {
              "startLine": 15,
              "endLine": 19,
              "code": "    def items_for(user, course = nil)\n      items.map do |item|\n        Item.new(course, item, item[:submenu]&.items_for(user, course))\n      end.select do |item|\n        item.accessible? user\n      end",
              "source": "app/presenters/menu_with_permissions.rb"
            },
            {
              "startLine": 22,
              "endLine": 39,
              "code": "  class Item\n    include Rails.application.routes.url_helpers\n    include ActionView::Helpers::UrlHelper\n\n    def initialize(course, opts = {}, submenu = nil)\n      @course = course\n      @opts = opts\n      @submenu = submenu\n    end\n\n    def text\n      I18n.t @opts.fetch(:text)\n    end\n\n    def id\n      # Generates unique id\n      \"item-#{(object_id)}\"\n    end\n\n    def icon_class\n      @opts.fetch :icon\n    end",
              "source": "app/presenters/menu_with_permissions.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/presenters/menu_with_permissions.rb",
              "relevance": 19
            }
          ]
        }
      },
      "PlatformDashboardNav": {
        "type": "Presenter",
        "description": "A specific implementation of `MenuWithPermissions` for the admin dashboard navigation, defining menu items and their associated permissions for platform administration.",
        "interactions": {
          "interaction_0": "Extends `MenuWithPermissions` [Source: app/presenters/platform_dashboard_nav.rb]",
          "interaction_1": "Defines menu items for 'Dashboard' and 'News' with `user.allowed?('global.dashboard.show')` permission checks [Source: app/presenters/platform_dashboard_nav.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/presenters/platform_dashboard_nav.rb",
            "app/presenters/menu_with_permissions.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nclass PlatformDashboardNav < MenuWithPermissions\n  item 'admin.dashboard.nav.dashboard', 'chart-mixed',\n    if: ->(user, _course) { user.allowed?('global.dashboard.show', context: :root) },\n    route: :admin_dashboard\n\n  item 'admin.dashboard.nav.news', 'satellite-dish',\n    if: ->(user, _course) { user.allowed? 'global.dashboard.show', context: :root },\n    route: :admin_statistics_news\nend",
              "source": "app/presenters/platform_dashboard_nav.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/presenters/platform_dashboard_nav.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Presenter": {
        "type": "Base Class (Presenter)",
        "description": "The foundational base class for all presenters in the application. It provides a generic `initialize` method to assign parameters to instance variables.",
        "interactions": {
          "interaction_0": "Inherited by `PrivatePresenter` and other presenter classes."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/presenters/presenter.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nclass Presenter\n  extend Forwardable\n\n  def initialize(params)\n    params&.each_pair do |attribute, value|\n      send :\"#{attribute}\"#, value\n    end\n  end\nend",
              "source": "app/presenters/presenter.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/presenters/presenter.rb",
              "relevance": 35
            },
            {
              "path": "app/presenters/abuse_report_presenter.rb",
              "relevance": 16
            },
            {
              "path": "app/presenters/account/policy_presenter.rb",
              "relevance": 16
            }
          ]
        }
      },
      "AjaxPaginationRenderer": {
        "type": "Utility",
        "description": "Extends `PaginationRenderer` to add `data-remote: true` to pagination links, enabling AJAX-driven pagination for improved user experience.",
        "interactions": {
          "interaction_0": "Extends `PaginationRenderer` [Source: lib/ajax_pagination_renderer.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "lib/ajax_pagination_renderer.rb",
            "lib/pagination_renderer.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 8,
              "code": "class AjaxPaginationRenderer < PaginationRenderer\n  def link(text, target, attributes = {})\n    attributes['data-remote'] = true\n    super\n  end\nend",
              "source": "lib/ajax_pagination_renderer.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "lib/ajax_pagination_renderer.rb",
              "relevance": 19
            }
          ]
        }
      },
      "PaginationRenderer": {
        "type": "Utility",
        "description": "A custom `WillPaginate::ActionView::LinkRenderer` that provides specific HTML structure and localization for pagination links, commonly used for features like pinboards.",
        "interactions": {
          "interaction_0": "Includes `ActionView::Helpers::OutputSafetyHelper` [Source: lib/pagination_renderer.rb]",
          "interaction_1": "Uses `I18n.t` for localized pagination texts [Source: lib/pagination_renderer.rb, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [
          "Uses a self-made tag building mechanism that is not standard Rails rendering context, leading to `rubocop:disable Rails/ContentTag` [Source: lib/pagination_renderer.rb]"
        ],
        "provenance": {
          "sources": [
            "lib/pagination_renderer.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 5,
              "endLine": 6,
              "code": "class PaginationRenderer < WillPaginate::ActionView::LinkRenderer\n  include ActionView::Helpers::OutputSafetyHelper",
              "source": "lib/pagination_renderer.rb"
            },
            {
              "startLine": 9,
              "endLine": 14,
              "code": "  def page_number(page)\n    if page == current_page\n      tag(:li, tag(:a, page), class: 'active')\n    else\n      tag(:li, link(page, page, rel: rel_value(page)))\n    end\n  end",
              "source": "lib/pagination_renderer.rb"
            },
            {
              "startLine": 16,
              "endLine": 21,
              "code": "  def previous_or_next_page(page, text, classname)\n    if page\n      tag(:li, link(text, page), class: classname)\n    else\n      tag(:li, tag(:a, text), class: \"#{classname} disabled\")\n    end\n  end",
              "source": "lib/pagination_renderer.rb"
            },
            {
              "startLine": 23,
              "endLine": 25,
              "code": "  def html_container(html)\n    tag(:div, tag(:ul, html, container_attributes), class: 'pinboard-paginate')\n  end",
              "source": "lib/pagination_renderer.rb"
            },
            {
              "startLine": 27,
              "endLine": 29,
              "code": "  def gap\n    tag(:li, tag(:a, '…'), class: 'disabled')\n  end",
              "source": "lib/pagination_renderer.rb"
            },
            {
              "startLine": 31,
              "endLine": 33,
              "code": "  def previous_page\n    previous_or_next_page(\n      @collection.current_page > 1 && (@collection.current_page - 1...",
              "source": "lib/pagination_renderer.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "lib/pagination_renderer.rb",
              "relevance": 19
            }
          ]
        }
      },
      "RedirectURL": {
        "type": "Utility",
        "description": "A helper class for safe URL redirects, designed to prevent open redirect vulnerabilities by validating if a given URL is internal or from the same origin.",
        "interactions": {
          "interaction_0": "Uses `Addressable::URI` for URL parsing and normalization [Source: lib/redirect_url.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "lib/redirect_url.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 39,
              "code": "# frozen_string_literal: true\n\nrequire 'addressable/uri'\n\n##\n# A helper class for safe redirects\n#\n# To avoid open redirect vulnerabilities, redirects should usually only be\n# allowed to our own URLs, e.g. absolute URLs with a known host, or relative\n# ones without host.\n#\nclass RedirectURL\n  def initialize(str)\n    @uri = Addressable::URI.parse(str)\n  rescue\n    @uri = nil\n  end\n\n  def internal?(base)\n    return false unless @uri\n\n    relative? || same_origin?(base)\n  end\n\n  def to_s\n    @uri.to_s\n  end\n\n  private\n\n  def relative?\n    @uri.host.blank?\n  end\n\n  def same_origin?(base)\n    begin\n      base_uri = Addressable::URI.parse(base)\n    rescue\n      return false\n    end\n\n    base_uri.normalized_authority == @uri.normalized_authority\n  end\nend",
              "source": "lib/redirect_url.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "lib/redirect_url.rb",
              "relevance": 19
            }
          ]
        }
      },
      "app/assets/javascripts/application.js": {
        "type": "JavaScript Entrypoint",
        "description": "Legacy Sprockets manifest file that includes foundational JavaScript libraries like jQuery and Bootstrap, indicating a transitional phase towards a Webpack-centric frontend.",
        "interactions": {
          "interaction_0": "Requires `xfn/ready` for DOM readiness [Source: app/assets/javascripts/application.js]",
          "interaction_1": "Requires `jquery2` for DOM manipulation [Source: app/assets/javascripts/application.js]",
          "interaction_2": "Requires `bootstrap-sprockets.js` for Bootstrap functionality [Source: app/assets/javascripts/application.js]"
        },
        "techDebt": [
          "Represents a legacy asset pipeline approach, with a move towards Webpack for modern JavaScript management [Source: app/assets/javascripts/application.js]"
        ],
        "provenance": {
          "sources": [
            "app/assets/javascripts/application.js"
          ]
        }
      },
      "app/assets/javascripts/xfn/ready.js": {
        "type": "JavaScript Utility",
        "description": "A small utility function that invokes a given callback when the DOM is fully loaded, ensuring scripts run at the appropriate time.",
        "interactions": {
          "interaction_0": "Interacts with `document.readyState` and `document.addEventListener('DOMContentLoaded')` [Source: app/assets/javascripts/xfn/ready.js]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/javascripts/xfn/ready.js"
          ]
        }
      },
      "app/assets/main.js": {
        "type": "JavaScript Entrypoint",
        "description": "The main Webpack bundle entry point for the application. It includes polyfills, initializes Rails UJS, and imports numerous global UI components and form action modules, forming the core of the modern frontend.",
        "interactions": {
          "interaction_0": "Imports `form-request-submit-polyfill` [Source: app/assets/main.js]",
          "interaction_1": "Initializes `Rails` UJS [Source: app/assets/main.js]",
          "interaction_2": "Imports various form actions (e.g., `autosubmit`, `change-handler`, `hide-on-submit`) [Source: app/assets/main.js]",
          "interaction_3": "Imports numerous global UI components (e.g., `accordion`, `tooltip`, `cookie-consent-banner`, `markdown-editor`, `slider`, `system-alerts`) [Source: app/assets/main.js]",
          "interaction_4": "Imports utility functions (e.g., `upload`, `mdupload`, `get-relative-time`) [Source: app/assets/main.js]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/main.js"
          ]
        }
      },
      "app/assets/main.scss": {
        "type": "CSS Entrypoint",
        "description": "The main entry point for the application's styles, importing the theme-specific and global stylesheets. It follows the branding guidelines for SCSS structure.",
        "interactions": {
          "interaction_0": "Imports `stylesheets/theme` for brand-specific styling [Source: app/assets/main.scss, docs/app/development/branding/stylesheets.md]",
          "interaction_1": "Imports `stylesheets/global` for general application styles [Source: app/assets/main.scss, docs/app/development/branding/stylesheets.md]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/main.scss"
          ]
        }
      },
      "Global::Accordion": {
        "type": "ViewComponent",
        "description": "A UI component that renders an accordion container, allowing multiple collapsible sections. It can display an optional headline.",
        "interactions": {
          "interaction_0": "Renders `Global::AccordionSection` components as its sections [Source: app/components/global/accordion.rb, app/components/global/accordion_section.rb]",
          "interaction_1": "Uses `data-controller='accordion'` for JavaScript interaction [Source: app/components/global/accordion.html.slim]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/accordion.rb",
            "app/components/global/accordion.html.slim",
            "app/components/global/accordion_preview.rb",
            "app/components/global/accordion_preview/default.html.slim",
            "app/components/global/accordion_preview/expanded.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class Accordion < ApplicationComponent\n    def initialize(headline: nil)\n      @headline = headline\n    end\n\n    renders_many :sections, AccordionSection\n  end\nend",
              "source": "app/components/global/accordion.rb"
            },
            {
              "startLine": 1,
              "endLine": 14,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class AccordionSection < ApplicationComponent\n    def initialize(label, id, expanded: false)\n      @label = label\n      @id = id\n      @expanded = expanded\n    end\n\n    private\n\n    def expanded\n      @expanded ? 'true' : 'false'\n    end\n  end\nend",
              "source": "app/components/global/accordion.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/accordion_section.rb",
              "relevance": 37
            }
          ]
        }
      },
      "Global::AccordionSection": {
        "type": "ViewComponent",
        "description": "A UI component representing a single collapsible section within an `Accordion`. It includes a toggle button with an icon and content area.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` for the expand/collapse indicators [Source: app/components/global/accordion_section.html.slim, app/components/global/fa_icon.rb]",
          "interaction_1": "Uses `data-accordion-target='toggle-button'` for JavaScript interaction [Source: app/components/global/accordion_section.html.slim]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/accordion_section.rb",
            "app/components/global/accordion_section.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 16,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class AccordionSection < ApplicationComponent\n    def initialize(label, id, expanded: false)\n      @label = label\n      @id = id\n      @expanded = expanded\n    end\n\n    private\n\n    def expanded\n      @expanded ? 'true' : 'false'\n    end\n  end\nend",
              "source": "app/components/global/accordion_section.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/accordion_section.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::ActionsDropdown": {
        "type": "ViewComponent",
        "description": "A UI component that renders a dropdown menu for various actions. It supports custom button text, alignment, and distinct styling for 'destructive' actions.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` for the dropdown control icon [Source: app/components/global/actions_dropdown.html.slim, app/components/global/fa_icon.rb]",
          "interaction_1": "Uses `data-behaviour='dropdown'` and `data-behaviour='menu-dropdown'` for JavaScript interaction [Source: app/components/global/actions_dropdown.html.slim]",
          "interaction_2": "Uses `I18n.t` for `aria_label` localization [Source: app/components/global/actions_dropdown.rb, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/actions_dropdown.rb",
            "app/components/global/actions_dropdown.html.slim",
            "app/components/global/actions_dropdown_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 25,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class ActionsDropdown < ApplicationComponent\n    def initialize(menu_side: 'left', text: nil, css_classes: '')\n      @menu_side = menu_side\n      @text = text\n      @css_classes = css_classes\n    end\n\n    renders_many :actions\n    renders_many :destructive_actions\n\n    def aria_label\n      I18n.t(:'components.actions_dropdown.aria_label')\n    end\n\n    def button_css_modifiers\n      'actions-dropdown__button--with-text' if @text\n    end\n\n    def menu_css_modifiers\n      \"actions-dropdown__menu--#{@menu_side}\" if %w[right left].include?(@menu_side)\n    end\n  end\nend",
              "source": "app/components/global/actions_dropdown.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/actions_dropdown.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/actions_dropdown_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::BasicTooltip": {
        "type": "ViewComponent",
        "description": "A simple UI component for displaying a basic tooltip with a question mark icon and text content.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/basic_tooltip.rb",
            "app/components/global/basic_tooltip.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class BasicTooltip < ApplicationComponent\n    def initialize(text)\n      @texts = Array.wrap(text)\n    end\n  end\nend",
              "source": "app/components/global/basic_tooltip.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/basic_tooltip.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::Callout": {
        "type": "ViewComponent",
        "description": "A UI component for displaying styled messages (e.g., info, warning, error, success) with an icon, optional title, and content slot. It dynamically selects a default icon based on the message type.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` for the message indicator [Source: app/components/global/callout.html.slim, app/components/global/fa_icon.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/callout.rb",
            "app/components/global/callout.html.slim",
            "app/components/global/callout_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 9,
              "code": "    def initialize(text, type: nil, title: nil, icon: nil)\n      @text = text\n      @title = title\n      @type = type\n      @icon = icon\n    end",
              "source": "app/components/global/callout.rb"
            },
            {
              "startLine": 13,
              "endLine": 15,
              "code": "    def render?\n      @text.present?\n    end",
              "source": "app/components/global/callout.rb"
            },
            {
              "startLine": 17,
              "endLine": 20,
              "code": "    def css_modifiers\n      css_modifiers = @title ? 'callout--with-title' : nil\n      @type ? \"callout--#{@type} #{css_modifiers} \" : css_modifiers\n    end",
              "source": "app/components/global/callout.rb"
            },
            {
              "startLine": 22,
              "endLine": 24,
              "code": "    def icon\n      @icon || Global::FaIcon.new(default_icon_name, style: :solid)\n    end",
              "source": "app/components/global/callout.rb"
            },
            {
              "startLine": 26,
              "endLine": 31,
              "code": "    def default_icon_name\n      {\n        success: 'circle-check',\n        error: 'circle-exclamation',\n        warning: 'triangle-exclamation',\n      }[@type] || 'circle-info'\n    end",
              "source": "app/components/global/callout.rb"
            },
            {
              "startLine": 1,
              "endLine": 11,
              "code": ".callout class=css_modifiers\n  .callout__indicator\n    = render icon\n    - if @title\n      .callout__title\n        = @title\n\n  .callout__content\n    p == @text\n    - if content\n      .callout__slot\n        = content",
              "source": "app/components/global/callout.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/callout.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/callout_preview.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/callout.html.slim",
              "relevance": 14
            }
          ]
        }
      },
      "Global::CookieConsentBanner": {
        "type": "ViewComponent",
        "description": "A UI component that renders a fixed banner at the bottom of the page for managing user cookie consent. It interacts with `ConsentCookie` to determine and persist consent choices.",
        "interactions": {
          "interaction_0": "Interacts with `ConsentCookie` to get current consent status [Source: app/components/global/cookie_consent_banner.rb]",
          "interaction_1": "Uses `Translations` to render consent text [Source: app/components/global/cookie_consent_banner.rb]",
          "interaction_2": "Submits a form to `cookie_consent_path` [Source: app/components/global/cookie_consent_banner.html.slim]",
          "interaction_3": "Renders `Global::FaIcon` for the close button [Source: app/components/global/cookie_consent_banner.html.slim, app/components/global/fa_icon.rb]",
          "interaction_4": "Uses `I18n.t` for button labels [Source: app/components/global/cookie_consent_banner.html.slim, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [
          "Direct use of `html_safe` for `text` and `to_json` for `swal_options` [Source: app/components/global/cookie_consent_banner.html.slim, app/components/global/flash_layer.html.slim]"
        ],
        "provenance": {
          "sources": [
            "app/components/global/cookie_consent_banner.rb",
            "app/components/global/cookie_consent_banner.html.slim",
            "app/controllers/cookie_consent_controller.rb",
            "config/locales/en.yml",
            "config/locales/de.yml"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 18,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class CookieConsentBanner < ApplicationComponent\n    private\n\n    def render?\n      consent.present?\n    end\n\n    def consent\n      @consent ||= ConsentCookie.new(helpers.cookies).current\n    end\n\n    def text\n      Translations.new(consent[:texts]).to_s\n    end\n  end\nend",
              "source": "app/components/global/cookie_consent_banner.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/cookie_consent_banner.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::CopyToClipboard": {
        "type": "ViewComponent",
        "description": "A UI component that renders a button to copy specified text to the clipboard. It supports different visual types (icon or button) and optional labels/tooltips.",
        "interactions": {
          "interaction_0": "Uses `data-behavior='copy-to-clipboard'` for JavaScript interaction [Source: app/components/global/copy_to_clipboard.html.slim]",
          "interaction_1": "Renders `Global::FaIcon` for the copy icon [Source: app/components/global/copy_to_clipboard.html.slim, app/components/global/fa_icon.rb]",
          "interaction_2": "Uses `I18n.t` for `aria-label` localization [Source: app/components/global/copy_to_clipboard.html.slim, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/copy_to_clipboard.rb",
            "app/components/global/copy_to_clipboard.html.slim",
            "app/components/global/copy_to_clipboard_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 25,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class CopyToClipboard < ApplicationComponent\n    def initialize(text, label: nil, tooltip: nil, type: :icon)\n      @text = text\n      @label = label\n      @tooltip = tooltip\n      @type = type\n    end\n\n    def css_classes\n      if type == :button\n        'clipboard btn btn-default btn-outline btn-xs'\n      else\n        'clipboard clipboard--icon'\n      end\n    end\n\n    private\n\n    def type\n      @type if %i[icon button].include?(@type)\n    end\n  end\nend",
              "source": "app/components/global/copy_to_clipboard.rb"
            },
            {
              "startLine": 1,
              "endLine": 16,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class CopyToClipboardPreview < ViewComponent::Preview\n    # @!group\n    def default\n      render Global::CopyToClipboard.new('a9a855db-b335-4ee1', tooltip: 'Copy ID')\n    end\n\n    def button\n      render Global::CopyToClipboard.new('a9a855db-b335-4ee2', label: 'Copy ID', type: :button)\n    end\n\n    # @!endgroup\n  end\nend",
              "source": "app/components/global/copy_to_clipboard.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/copy_to_clipboard.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/copy_to_clipboard_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::CourseListBanner": {
        "type": "ViewComponent",
        "description": "A UI component that displays a promotional banner on course lists. It fetches the current banner from the `Banner` model, caches it, and handles external links with target options.",
        "interactions": {
          "interaction_0": "Fetches `Banner.current` from the database [Source: app/components/global/course_list_banner.rb]",
          "interaction_1": "Uses `Rails.cache.fetch` for server-side caching of banner data [Source: app/components/global/course_list_banner.rb, docs/app/features/course_list_banner.md]",
          "interaction_2": "Uses `image_tag` and `link_to` for rendering [Source: app/components/global/course_list_banner.html.slim]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/course_list_banner.rb",
            "app/components/global/course_list_banner.html.slim",
            "docs/app/features/course_list_banner.md"
          ]
        },
        "codeImplementation": {
          "confidence": 0.98,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 35,
              "code": "class CourseListBanner < ApplicationComponent\n    CACHE_DURATION = 30.minutes.freeze\n\n    def render?\n      banner.present?\n    end\n\n    private\n\n    def banner\n      @banner ||= Rails.cache.fetch(\n        'web/banners/current',\n        expires_in: CACHE_DURATION,\n        race_condition_ttl: 1.minute\n      ) { Banner.current }\n    end\n\n    def link\n      banner.link_url\n    end\n\n    def link_target_options\n      return {} if banner.link_target.blank?\n\n      if banner.link_target == 'blank'\n        {target: '_blank', rel: 'noopener'}\n      else\n        {target: \"_#{banner.link_target}\"}\n      end\n    end\n\n    def image_url\n      banner.image_url\n    end\n\n    def alt_text\n      banner.alt_text\n    end\n  end",
              "source": "app/components/global/course_list_banner.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/course_list_banner.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::CustomHeadSnippets": {
        "type": "ViewComponent",
        "description": "A UI component responsible for rendering custom HTML snippets within the `<head>` section of the document. Snippets are conditionally rendered based on `Xikolo.config.custom_html` and `Requirements` (e.g., cookie consent).",
        "interactions": {
          "interaction_0": "Reads custom HTML snippets from `Xikolo.config.custom_html` [Source: app/components/global/custom_head_snippets.rb]",
          "interaction_1": "Uses `Global::CustomHeadSnippets::Requirements` to evaluate snippet conditions, including `CookieConsent` [Source: app/components/global/custom_head_snippets.rb]",
          "interaction_2": "Interacts with `ConsentCookie` for cookie consent checks [Source: app/components/global/custom_head_snippets.rb]"
        },
        "techDebt": [
          "Direct use of `raw snippet` for rendering HTML, requiring careful sanitization of `Xikolo.config.custom_html` content [Source: app/components/global/custom_head_snippets.html.slim]"
        ],
        "provenance": {
          "sources": [
            "app/components/global/custom_head_snippets.rb",
            "app/components/global/custom_head_snippets.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.98,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 42,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class CustomHeadSnippets < ApplicationComponent\n    def render?\n      active_snippets.any?\n    end\n\n    private\n\n    def snippets\n      active_snippets.pluck('html')\n    end\n\n    def active_snippets\n      @active_snippets ||= Xikolo.config.custom_html.select do |snippet|\n        Requirements[snippet].fulfilled?(helpers)\n      end\n    end\n\n    class Requirements\n      def self.[](snippet)\n        return new([]) unless snippet['requirements']&.any?\n\n        new(\n          snippet['requirements'].map {|req| resolve(req) }\n        )\n      end\n\n      def self.resolve(requirement)\n        type = requirement.fetch('type')\n\n        case type\n          when 'cookie_consent'\n            CookieConsent.new(requirement.fetch('name'))\n          else\n            raise \"Not sure how to handle requirement of type #{type}\"\n        end\n      rescue KeyError => e\n        raise \"Missing required key '#{e.key}' for requirement configuration\"\n      end\n\n      de...",
              "source": "app/components/global/custom_head_snippets.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/custom_head_snippets.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::DisclosureWidget": {
        "type": "ViewComponent",
        "description": "A UI component that implements a progressive disclosure widget using the HTML `<details>` element. It allows showing/hiding content with customizable summary labels, icons, and visual variants.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` for the open/closed state indicators [Source: app/components/global/disclosure_widget.html.slim, app/components/global/fa_icon.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/disclosure_widget.rb",
            "app/components/global/disclosure_widget.html.slim",
            "app/components/global/disclosure_widget_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 10,
              "code": "    def initialize(summary, content_lang: nil, expanded_summary: nil, visible: true, variant: :default, icons: {})\n      @summary = summary\n\n      @content_lang = content_lang\n      @expanded_summary = expanded_summary\n      @visible = visible\n      @variant = variant\n      @icons = icons\n    end",
              "source": "app/components/global/disclosure_widget.rb"
            },
            {
              "startLine": 12,
              "endLine": 14,
              "code": "    def expanded_summary\n      @expanded_summary || @summary\n    end",
              "source": "app/components/global/disclosure_widget.rb"
            },
            {
              "startLine": 16,
              "endLine": 23,
              "code": "    def icons\n      {\n        opened: @icons[:opened] || 'chevron-down',\n        closed: @icons[:closed] || 'chevron-right',\n        opened_classes: @icons[:opened_classes] || 'mr5',\n        closed_classes: @icons[:closed_classes] || 'mr10',\n        style: @icons[:opened_style] || :solid,\n      }\n    end",
              "source": "app/components/global/disclosure_widget.rb"
            },
            {
              "startLine": 25,
              "endLine": 29,
              "code": "    def css_classes\n      if @variant == :light\n        'disclosure-widget--light'\n      end\n    end",
              "source": "app/components/global/disclosure_widget.rb"
            },
            {
              "startLine": 32,
              "endLine": 35,
              "code": "    def render?\n      @visible\n    end",
              "source": "app/components/global/disclosure_widget.rb"
            },
            {
              "startLine": 37,
              "endLine": 39,
              "code": "    def variant\n      @variant if %w[default light].include?(@variant)\n    end",
              "source": "app/components/global/disclosure_widget.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/disclosure_widget.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/disclosure_widget_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::DownloadButton": {
        "type": "ViewComponent",
        "description": "A UI component that renders a button for initiating file downloads. It supports disabled states, custom CSS classes, and can display a download icon.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` if the button type is `:download` [Source: app/components/global/download_button.html.slim, app/components/global/fa_icon.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/download_button.rb",
            "app/components/global/download_button.html.slim",
            "app/components/global/download_button_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 11,
              "code": "module Global\n  class DownloadButton < ApplicationComponent\n    def initialize(url, text, attributes: {}, css_classes: '', type: nil)\n      @url = url\n      @text = text\n      @attributes = attributes\n      @css_classes = css_classes.split\n      @type = type\n    end",
              "source": "app/components/global/download_button.rb"
            },
            {
              "startLine": 13,
              "endLine": 17,
              "code": "    def css_classes\n      return 'btn btn-primary' if @css_classes.empty?\n\n      @css_classes.join(' ')\n    end",
              "source": "app/components/global/download_button.rb"
            },
            {
              "startLine": 19,
              "endLine": 21,
              "code": "    def icon\n      'download' if type == :download\n    end",
              "source": "app/components/global/download_button.rb"
            },
            {
              "startLine": 23,
              "endLine": 29,
              "code": "    private\n\n    # Restrict allowed button types\n    def type\n      if %i[download progress].include? @type\n        @type\n      end\n    end\n  end\nend",
              "source": "app/components/global/download_button.rb"
            },
            {
              "startLine": 3,
              "endLine": 13,
              "code": "module Global\n  class DownloadButtonPreview < ViewComponent::Preview\n    # @!group\n\n    def default\n      render Global::DownloadButton.new(\n        '#',\n        'Download',\n        type: :download\n      )\n    end",
              "source": "app/components/global/download_button.rb"
            },
            {
              "startLine": 15,
              "endLine": 23,
              "code": "    def disabled\n      render Global::DownloadButton.new(\n        '#',\n        'Download',\n        attributes: {disabled: true},\n        type: :download\n      )\n    end",
              "source": "app/components/global/download_button.rb"
            },
            {
              "startLine": 25,
              "endLine": 36,
              "code": "    def progress\n      render Global::DownloadButton.new(\n        '#',\n        'Check my progress',\n        css_classes: 'btn btn-default btn-outline',\n        type: :progress\n      )\n    end\n\n    # @!endgroup\n  end\nend",
              "source": "app/components/global/download_button.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/download_button.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/download_button_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::FaIcon": {
        "type": "ViewComponent",
        "description": "A UI component for rendering Font Awesome icons. It supports different styles (e.g., solid, regular) and a unique feature for stacking two icons, where one icon is masked and another is stacked on top.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/fa_icon.rb",
            "app/components/global/fa_icon.html.slim",
            "app/components/global/fa_icon_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 4,
              "code": "NAME_SEPARATOR = '+'",
              "source": "app/components/global/fa_icon.rb"
            },
            {
              "startLine": 6,
              "endLine": 10,
              "code": "    def initialize(name, style: :regular, title: nil, css_classes: '')\n      @name, @stack_icon = name.split(NAME_SEPARATOR)\n      @style = style\n      @title = title\n      @css_classes = css_classes\n    end",
              "source": "app/components/global/fa_icon.rb"
            },
            {
              "startLine": 14,
              "endLine": 16,
              "code": "    def css_classes\n      \"#{@stack_icon ? 'xi-icon__masked' : 'xi-icon'} fa-#{@style} fa-#{@name} #{@css_classes}\"\n    end",
              "source": "app/components/global/fa_icon.rb"
            },
            {
              "startLine": 18,
              "endLine": 20,
              "code": "    def stack_icon_classes\n      \"xi-icon__stacked fa-#{@style} fa-#{@stack_icon}\"\n    end",
              "source": "app/components/global/fa_icon.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/fa_icon.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/fa_icon_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::FilterBar::Controls": {
        "type": "ViewComponent",
        "description": "A UI component that displays controls for a filter bar, including a reset button and an overview of applied filters. It can also show a results count and an 'adjust' link.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` for filter and reset icons [Source: app/components/global/filter_bar/controls.html.slim, app/components/global/fa_icon.rb]",
          "interaction_1": "Renders `Global::Pill` for displaying the results count [Source: app/components/global/filter_bar/controls.html.slim, app/components/global/pill.rb]",
          "interaction_2": "Uses `I18n.t` for localization of text elements [Source: app/components/global/filter_bar/controls.rb, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/filter_bar/controls.rb",
            "app/components/global/filter_bar/controls.html.slim",
            "app/components/global/filter_bar/controls_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 5,
              "endLine": 10,
              "code": "      def initialize(path, content_id, loading_indicator_id, filters, results_count: nil, show_overview: false)\n        @path = path\n        @content_id = content_id\n        @loading_indicator_id = loading_indicator_id\n        @filters = filters\n        @results_count = results_count",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 14,
              "endLine": 16,
              "code": "      def render?\n        params[:q].present? || @filters.any? {|filter| filter.selected.present? }\n      end",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 18,
              "endLine": 20,
              "code": "      def data_behavior\n        'fixed' if @show_overview\n      end",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 22,
              "endLine": 26,
              "code": "      def results_count\n        return unless @results_count\n\n        I18n.t(:'components.filter_bar.filter.results_count', count: @results_count)\n      end",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 28,
              "endLine": 36,
              "code": "      def applied_filters\n        list = []\n        list << params[:q]\n\n        @filters.each do |filter|\n          next if filter.selected.blank?\n\n          if filter.ke...\n",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 1,
              "endLine": 22,
              "code": ".filter-bar__controls data-behavior=data_behavior\n  .filter-bar__controls-wrapper\n    - if @show_overview\n      .filter-bar__overview\n        p.filter-bar__overview-text\n          span.filter-bar__overview-title\n            = t(:'components.filter_bar.filter.results')\n          = applied_filters\n        = link_to '#adjust-anchor', class: 'filter-bar__adjust' do\n          = render Global::FaIcon.new('filter', css_classes: 'mr5')\n          = t(:'components.filter_bar.filter.adjust')\n\n    .filter-bar__results\n      - if @results_count\n        .filter-bar__results-count\n          = render Global::Pill.new(results_count)\n      = link_to @path, data: {'hide-on-click': @content_id, 'show-on-click': @loading_indicator_id} do\n        = render Global::FaIcon.new('undo', css_classes: 'mr5')\n        = t(:'components.filter_bar.filter.reset')\n",
              "source": "app/components/global/filter_bar/controls.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/filter_bar/controls.rb",
              "relevance": 41
            },
            {
              "path": "app/components/global/filter_bar/controls_preview.rb",
              "relevance": 41
            },
            {
              "path": "app/components/global/filter_bar/controls.html.slim",
              "relevance": 14
            }
          ]
        }
      },
      "Global::FilterBar::Filter": {
        "type": "ViewComponent",
        "description": "A UI component representing a single filter dropdown within a filter bar. It allows selecting options, supports multi-select, and can be conditionally visible or disabled.",
        "interactions": {
          "interaction_0": "Uses `select_tag` and `hidden_field_tag` for form elements [Source: app/components/global/filter_bar/filter.html.slim]",
          "interaction_1": "Uses `I18n.t` for localization of blank options and disabled text [Source: app/components/global/filter_bar/filter.rb, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/filter_bar/filter.rb",
            "app/components/global/filter_bar/filter.html.slim",
            "app/components/global/filter_bar/filter_bar_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 35,
              "code": "    class Filter < ApplicationComponent       attr_reader :key, :options, :selected, :visible        def initialize(key, title, options, selected: nil, visible: true,                      blank_option: nil, multi_select: false)         @key = key         @title = title         @options = options         @selected = selected         @visible = visible         @blank_option = blank_option         @multi_select = multi_select       end        def render?         @visible || disabled?       end        def disabled?         !@visible && @selected       end        def include_blank         @blank_option.presence || t(:'components.filter_bar.filter.all')       end        def disabled_select_text         if @options.is_a?(Hash)           @options.key(@selected) || @selected         else           @selected         end       end     end",
              "source": "app/components/global/filter_bar/filter.rb"
            },
            {
              "startLine": 26,
              "endLine": 29,
              "code": "      def status_filter         Global::FilterBar::Filter.new(:status, t(:'admin.courses.index.filter.status'), course_states,           selected: params[:status])       end",
              "source": "app/components/global/filter_bar/filter.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/filter_bar/filter.rb",
              "relevance": 41
            },
            {
              "path": "app/components/global/filter_bar/filter_bar_preview.rb",
              "relevance": 41
            },
            {
              "path": "app/components/admin/course/filter_bar.rb",
              "relevance": 34
            }
          ]
        }
      },
      "Global::FilterBar::Search": {
        "type": "ViewComponent",
        "description": "A UI component for a search input field within a filter bar. It includes a clear button for resetting the search and a submit button with a magnifying glass icon.",
        "interactions": {
          "interaction_0": "Uses `text_field_tag` for the search input [Source: app/components/global/filter_bar/search.html.slim]",
          "interaction_1": "Renders `Global::FaIcon` for search and clear buttons [Source: app/components/global/filter_bar/search.html.slim, app/components/global/fa_icon.rb]",
          "interaction_2": "Uses `I18n.t` for localization of labels and button texts [Source: app/components/global/filter_bar/search.html.slim, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/filter_bar/search.rb",
            "app/components/global/filter_bar/search.html.slim",
            "app/components/global/filter_bar/filter_bar_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.98,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  module FilterBar\n    class Search < ApplicationComponent\n      def initialize(name, search_param)\n        @name = name\n        @search_param = search_param\n      end\n    end\n  end\nend",
              "source": "app/components/global/filter_bar/search.rb"
            },
            {
              "startLine": 1,
              "endLine": 14,
              "code": "label\n  = t(:'components.filter_bar.search.label')\n  .filter-bar__search class=\"#{'filter-bar__search--active' if @search_param.present?}\"\n    = text_field_tag @name, @search_param, type: 'search'\n    - if @search_param.present?\n      = button_tag t(:'components.filter_bar.search.clear'), type: 'button', class: 'filter-bar__clear-button',\n        data: {id: 'clear-button', 'clear-target': \"##{@name}\"}, 'aria-label': t(:'components.filter_bar.search.label') do\n        = render Global::FaIcon.new('xmark')\n    = button_tag t(:'components.filter_bar.search.label'), type: 'submit', class: 'filter-bar__search-button', 'aria-label': t(:'components.filter_bar.search.label') do\n      = render Global::FaIcon.new('magnifying-glass')",
              "source": "app/components/global/filter_bar/search.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/filter_bar/search.rb",
              "relevance": 41
            },
            {
              "path": "app/components/global/filter_bar/search.html.slim",
              "relevance": 14
            },
            {
              "path": "app/components/global/filter_bar/controls.rb",
              "relevance": 11
            }
          ]
        }
      },
      "Global::FlashBlock": {
        "type": "ViewComponent",
        "description": "A UI component that iterates through flash messages and layers from the Rails flash hash and renders them using `Global::FlashMessage` and `Global::FlashLayer` components.",
        "interactions": {
          "interaction_0": "Renders `Global::FlashMessage` for standard flash messages [Source: app/components/global/flash_block.html.slim, app/components/global/flash_message.rb]",
          "interaction_1": "Renders `Global::FlashLayer` for SweetAlert2-style flash layers [Source: app/components/global/flash_block.html.slim, app/components/global/flash_layer.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/flash_block.rb",
            "app/components/global/flash_block.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 27,
              "code": "module Global   class FlashBlock < ApplicationComponent     def initialize(flash)       @flash = flash     end      private      def messages       %i[error success notice alert]         .select {|type| @flash[type] }         .flat_map do |type|           @flash[type].uniq.map {|message| {type:, text: message} }         end     end      def layers       %i[success_layer info_layer error_layer]         .select {|type| @flash[type] }         .flat_map do |type|         @flash[type].map {|message| {type:, text: message} }       end     end   end end",
              "source": "app/components/global/flash_block.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/flash_block.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::FlashLayer": {
        "type": "ViewComponent",
        "description": "A UI component that renders a JavaScript snippet to display flash messages as SweetAlert2-style pop-up layers on DOM ready. It parses the flash text into a title and body.",
        "interactions": {
          "interaction_0": "Injects JavaScript to call `xuiSwal.fire` (SweetAlert2) [Source: app/components/global/flash_layer.html.slim]",
          "interaction_1": "Uses `ready` function for DOM readiness [Source: app/components/global/flash_layer.html.slim, app/assets/javascripts/xfn/ready.js]"
        },
        "techDebt": [
          "Direct use of `html_safe` for `swal_options.to_json` [Source: app/components/global/flash_layer.html.slim]"
        ],
        "provenance": {
          "sources": [
            "app/components/global/flash_layer.rb",
            "app/components/global/flash_layer.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 14,
              "code": "module Global   class FlashLayer < ApplicationComponent     def initialize(type, text)       @type = type       @text = text     end      private      def swal_options       title, text = @text.split('<br />', 2)       type = @type.to_s.split('_').first       {title:, text:, type:, showCancelButton: false}     end   end end",
              "source": "app/components/global/flash_layer.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/flash_layer.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::FlashMessage": {
        "type": "ViewComponent",
        "description": "A UI component that displays a single flash message with a type-specific icon and a close button. It supports different message types (success, error, alert, notice).",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` for the message icon and close button [Source: app/components/global/flash_message.html.slim, app/components/global/fa_icon.rb]",
          "interaction_1": "Uses `data-hide-on-click` for JavaScript interaction to dismiss the message [Source: app/components/global/flash_message.html.slim]",
          "interaction_2": "Uses `I18n.t` for the close button's `aria-label` [Source: app/components/global/flash_message.html.slim, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/flash_message.rb",
            "app/components/global/flash_message.html.slim",
            "app/components/global/flash_message_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 18,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class FlashMessage < ApplicationComponent\n    def initialize(type, text)\n      @type = type\n      @text = text\n    end\n\n    private\n\n    def icon_name\n      {\n        success: 'circle-check',\n        error: 'circle-exclamation',\n        alert: 'triangle-exclamation',\n        notice: 'circle-info',\n      }[@type] || ''\n    end\n  end\nend",
              "source": "app/components/global/flash_message.rb"
            },
            {
              "startLine": 1,
              "endLine": 31,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class FlashMessagePreview < ViewComponent::Preview\n    # @!group\n\n    def success\n      render Global::FlashMessage.new(:success, 'Success!')\n    end\n\n    def error\n      render Global::FlashMessage.new(:error, 'Error :(')\n    end\n\n    def alert\n      render Global::FlashMessage.new(:alert, 'Alert!')\n    end\n\n    def notice\n      render Global::FlashMessage.new(:notice, 'Notice...')\n    end\n\n    def very_long_text\n      render Global::FlashMessage.new(:notice,\n        'Prow scuttle parrel provost Sail ho shrouds spirits boom mizzenmast yardarm.\n        Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to.')\n    end\n\n    # @!endgroup\n  end\nend",
              "source": "app/components/global/flash_message.rb"
            },
            {
              "startLine": 1,
              "endLine": 8,
              "code": "# frozen_string_literal: true\n\nmodule FlashMessages\n  Then(/there is a notice with \"(.*)\"/) do |text|\n    expect(page).to have_notice text\n  end\nend\n\nGurke.config.include FlashMessages",
              "source": "app/components/global/flash_message.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/flash_message.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/flash_message_preview.rb",
              "relevance": 26
            },
            {
              "path": "integration/features/steps/flash.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Global::HeadlineTooltip": {
        "type": "ViewComponent",
        "description": "A UI component that combines a headline (of a specified level) with a `Global::BasicTooltip` for additional information.",
        "interactions": {
          "interaction_0": "Renders `Global::BasicTooltip` [Source: app/components/global/headline_tooltip.html.slim, app/components/global/basic_tooltip.rb]"
        },
        "techDebt": [
          "Direct use of `== \"<h#{@level} class=\\\"basic-tooltip-headline\\\">#{@headline}</h#{@level}>\"` for rendering the headline, which bypasses standard Rails helpers and could be more robust [Source: app/components/global/headline_tooltip.html.slim]"
        ],
        "provenance": {
          "sources": [
            "app/components/global/headline_tooltip.rb",
            "app/components/global/headline_tooltip.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.98,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class HeadlineTooltip < ApplicationComponent\n    def initialize(headline, tooltip = nil, level:)\n      @headline = headline\n      @tooltip = tooltip\n      @level = level\n    end\n  end\nend",
              "source": "app/components/global/headline_tooltip.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/headline_tooltip.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::HelpdeskButton": {
        "type": "ViewComponent",
        "description": "A UI component that renders a button to open the helpdesk panel. It dynamically selects an icon and a chatbot version based on user features, integrating with `Xikolo::Common::Auth::CurrentUser`.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` for the button icon [Source: app/components/global/helpdesk_button.html.slim, app/components/global/fa_icon.rb]",
          "interaction_1": "Renders `State::Loading` while the helpdesk panel content loads [Source: app/components/global/helpdesk_button.html.slim]",
          "interaction_2": "Uses `I18n.t` for button labels and `aria-label` [Source: app/components/global/helpdesk_button.html.slim, config/locales/en.yml, config/locales/de.yml]",
          "interaction_3": "Checks `user.feature?` to determine chatbot version [Source: app/components/global/helpdesk_button.rb]",
          "interaction_4": "Interacts with `Xikolo::Common::Auth::CurrentUser` [Source: app/components/global/helpdesk_button.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/helpdesk_button.rb",
            "app/components/global/helpdesk_button.html.slim",
            "app/components/global/helpdesk_button_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 30,
              "code": "module Global   class HelpdeskButton < ApplicationComponent     ##     # Specify the available chatbot versions here.     # Format: feature flipper name => version identifier     # Attention: The order of the versions is important.     # The first matching feature / version is displayed to the user.     CHATBOT_VERSION = {       'chatbot.prototype-2' => 'chatbot-v2'     }.freeze      def initialize(user:)       @user = user     end      def icon       Global::FaIcon.new(chatbot.present? ? 'messages' : 'message-question', style: :solid)     end      def data_feature       chatbot.presence || 'default'     end      private      def chatbot       @chatbot ||= CHATBOT_VERSION.keys         .detect { @user.feature? it }         .then { CHATBOT_VERSION[it] }     end   end end",
              "source": "app/components/global/helpdesk_button.rb"
            },
            {
              "startLine": 4,
              "endLine": 27,
              "code": "module Global   class HelpdeskButtonPreview < ViewComponent::Preview     def default       render Global::HelpdeskButton.new(user:)     end      def prototype_two       render Global::HelpdeskButton.new(user: user_with_prototype_two)     end      private      def user       Xikolo::Common::Auth::CurrentUser.from_session({         'user' => {'anonymous' => true}       })     end      def user_with_prototype_two       Xikolo::Common::Auth::CurrentUser.from_session({         'user' => {'anonymous' => true},         'features' => {'chatbot.prototype-2' => true}       })     end   end end",
              "source": "app/components/global/helpdesk_button.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/helpdesk_button.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/helpdesk_button_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::ItemStatus": {
        "type": "ViewComponent",
        "description": "A UI component that displays an item's status with an icon, title, text, and optional tooltip. It supports various color schemes and connection types for visual grouping.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` for the status icon [Source: app/components/global/item_status.html.slim, app/components/global/fa_icon.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/item_status.rb",
            "app/components/global/item_status.html.slim",
            "app/components/global/item_status_preview.rb",
            "app/components/global/item_status_preview/connected.html.slim",
            "app/components/global/item_status_preview/connected_with_color_scheme_variations.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 5,
              "endLine": 14,
              "code": "    def initialize(item, connected_type: '', color_scheme: '')\n      @text = item[:text]\n      @title = item[:title]\n      @path = item[:path]\n      @tooltip = item[:tooltip]\n      @icon_name = item[:icon_name]\n\n      @color_scheme = color_scheme\n      @connected_type = connected_type\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 16,
              "endLine": 27,
              "code": "    def css_classes\n      css_classes = %w[item-status]\n\n      if connected_type.present?\n        css_classes << 'item-status--connected'\n        css_classes << \"item-status--#{connected_type}\"\n      end\n\n      css_classes << \"item-status--#{color_scheme}\" if color_scheme.present?\n\n      css_classes\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 29,
              "endLine": 31,
              "code": "    def data_attributes\n      {tooltip: @tooltip} if @tooltip.present?\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 33,
              "endLine": 41,
              "code": "    private\n\n    def color_scheme\n      @color_scheme if %w[success error link].include?(@color_scheme)\n    end\n\n    def connected_type\n      @connected_type if %w[default filled dashed disabled].include?(@connected_type)\n    en...",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 8,
              "endLine": 16,
              "code": "    def default\n      render Global::ItemStatus.new({\n        text: 'This indicates a status of some sort',\n        path: '#',\n        title: 'Some status',\n        icon_name: 'block-question',\n        tooltip: 'There can be a tooltip on hover.',\n      })\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 18,
              "endLine": 25,
              "code": "    def success\n      render Global::ItemStatus.new({\n        text: 'This indicates a success of some sort',\n        icon_name: 'circle-check',\n        path: '#',\n        title: 'Success',\n      },\n        color_scheme: 'success')",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 28,
              "endLine": 35,
              "code": "    def error\n      render Global::ItemStatus.new({\n        text: 'This indicates an error or lack of something',\n        icon_name: 'circle-xmark',\n        path: '#',\n        title: 'Error',\n      },\n        color_scheme: 'error')",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 38,
              "endLine": 41,
              "code": "    def link\n      render Global::ItemStatus.new({\n        text: 'This colors the icon in link color',\n       ...",
              "source": "app/components/global/item_status.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/item_status.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/item_status_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::LabeledCopyButton": {
        "type": "ViewComponent",
        "description": "A UI component that displays a label and a value, alongside a button to copy the value to the clipboard.",
        "interactions": {
          "interaction_0": "Uses `data-behavior='copy-to-clipboard'` for JavaScript interaction [Source: app/components/global/labeled_copy_button.html.slim]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/labeled_copy_button.rb",
            "app/components/global/labeled_copy_button.html.slim",
            "app/components/global/labeled_copy_button_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class LabeledCopyButton < ApplicationComponent\n    def initialize(label:, value:, button:)\n      @label = label\n      @value = value\n      @button = button\n    end\n  end\nend",
              "source": "app/components/global/labeled_copy_button.rb"
            },
            {
              "startLine": 1,
              "endLine": 8,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class LabeledCopyButtonPreview < ViewComponent::Preview\n    def default\n      render Global::LabeledCopyButton.new(label: 'Label', value: 'Value', button: 'Copy me!')\n    end\n  end\nend",
              "source": "app/components/global/labeled_copy_button.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/labeled_copy_button.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/labeled_copy_button_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::LinkItem": {
        "type": "ViewComponent",
        "description": "A UI component that renders a list item containing a link. It supports active states, custom titles, target attributes (e.g., `_blank`), and optional icons.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` if an icon class is provided [Source: app/components/global/link_item.html.slim, app/components/global/fa_icon.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/link_item.rb",
            "app/components/global/link_item.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.98,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 29,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class LinkItem < ApplicationComponent\n    def initialize(text:, href:, active: false, title: nil, target: nil, icon_class: nil)\n      @text = text\n      @href = href\n      @active = active\n      @title = title\n      @target = target\n      @icon_class = icon_class\n    end\n\n    private\n\n    def css_classes\n      @active ? 'active' : ''\n    end\n\n    def title\n      @title.presence || @text\n    end\n\n    def target\n      @target.presence\n    end\n\n    def rel\n      target == '_blank' ? 'noopener' : ''\n    end\n\n    def icon?\n      @icon_class.present?\n    end\n\n    def icon\n      Global::FaIcon.new(@icon_class)\n    end\n  end\nend",
              "source": "app/components/global/link_item.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/link_item.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::Meter": {
        "type": "ViewComponent",
        "description": "A UI component that renders an HTML `<meter>` element to display a scalar measurement within a known range. It supports optional labels and different visual styles.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/meter.rb",
            "app/components/global/meter.html.slim",
            "app/components/global/meter_preview.rb",
            "app/components/global/meter_preview/custom_width.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 10,
              "code": "    def initialize(value:, label: nil, type: nil, background_color: nil)\n      @value = value\n      @label = label\n      @type = type\n      @background_color = background_color\n      @component_id = SecureRandom.uuid\n    end",
              "source": "app/components/global/meter.rb"
            },
            {
              "startLine": 12,
              "endLine": 12,
              "code": "    attr_reader :value, :label, :component_id",
              "source": "app/components/global/meter.rb"
            },
            {
              "startLine": 14,
              "endLine": 19,
              "code": "    def css_classes\n      [].tap do |modifiers|\n        modifiers << 'meter--info' if @type == :info\n        modifiers << 'meter--white' if @background_color == :white\n      end\n    end",
              "source": "app/components/global/meter.rb"
            },
            {
              "startLine": 1,
              "endLine": 5,
              "code": ".meter id=component_id class=css_classes\n  meter value=value max=100\n  - if label\n    label.meter__label for=component_id\n      = label",
              "source": "app/components/global/meter.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/meter.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/meter_preview.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/meter.html.slim",
              "relevance": 14
            }
          ]
        }
      },
      "Global::PageHeader": {
        "type": "ViewComponent",
        "description": "A UI component that renders a standardized page header with a title, optional subtitle, and an optional `Pill` component. It supports a 'slim' variant for a more compact appearance.",
        "interactions": {
          "interaction_0": "Renders `Global::Pill` if a pill is provided [Source: app/components/global/page_header.rb, app/components/global/pill.rb]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/page_header.rb",
            "app/components/global/page_header.html.slim",
            "app/components/global/page_header_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 18,
              "code": "module Global\n  class PageHeader < ApplicationComponent\n    def initialize(title, lang: nil, type: nil, subtitle: nil)\n      @title = title\n      @lang = lang\n      @type = type\n      @subtitle = subtitle\n    end\n\n    renders_one :pill, Pill\n\n    private\n\n    def css_modifier\n      'pages-header--slim' if @type == :slim\n    end\n  end\nend",
              "source": "app/components/global/page_header.rb"
            },
            {
              "startLine": 4,
              "endLine": 32,
              "code": "module Global\n  class PageHeaderPreview < ViewComponent::Preview\n    include ActionView::Helpers::UrlHelper\n\n    # @!group\n    def simple\n      render Global::PageHeader.new('Quantencomputing Summer School')\n    end\n\n    def with_subtitle\n      render Global::PageHeader.new('Quantencomputing Summer School', subtitle: 'Offered by openHPI Team')\n    end\n\n    def with_pill\n      render Global::PageHeader.new('Quantencomputing Summer School', subtitle: 'Offered by openHPI Team') do |c|\n        c.with_pill 'Active course', color: :note\n      end\n    end\n\n    def slim\n      render Global::PageHeader.new('Quantencomputing Summer School', type: :slim, subtitle: 'openHPI Team') do |c|\n        c.with_pill 'Active course', size: :small, color: :note\n      end\n    end\n\n    def with_additional_custom_content\n      render Global::PageHeader.new('Quantencomputing Summer School', subtitle: 'Offered by openHPI Team') do |c|\n        c.with_pill 'Active course', color: :not...\n",
              "source": "app/components/global/page_header.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/page_header.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/page_header_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::Pill": {
        "type": "ViewComponent",
        "description": "A UI component that renders a small, styled text pill. It supports different sizes and color schemes for visual emphasis.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/pill.rb",
            "app/components/global/pill_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 24,
              "code": "module Global\n  class Pill < ApplicationComponent\n    def initialize(text, size: nil, color: nil)\n      @text = text\n      @size = size\n      @color = color\n    end\n\n    def call\n      tag.p class: \"pill #{css_modifiers}\" do\n        @text\n      end\n    end\n\n    def css_modifiers\n      [].tap do |modifiers|\n        modifiers << 'pill--small' if @size == :small\n        modifiers << \"pill--#{@color}\" if %i[note success information error].include?(@color)\n      end.join(' ')\n    end\n  end\nend",
              "source": "app/components/global/pill.rb"
            },
            {
              "startLine": 3,
              "endLine": 30,
              "code": "module Global\n  class PillPreview < ViewComponent::Preview\n    # @!group\n    # @param text\n    def default(text: 'Databases')\n      render Global::Pill.new(text)\n    end\n\n    def small\n      render Global::Pill.new('Databases', size: :small)\n    end\n\n    def note_color\n      render Global::Pill.new('Databases', color: :note)\n    end\n\n    def success_color\n      render Global::Pill.new('Databases', color: :success)\n    end\n\n    def information_color\n      render Global::Pill.new('Databases', color: :information)\n    end\n\n    def error_color\n      render Global::Pill.new('Databases', color: :error)\n    end\n\n    def small_with_color\n      render Global::Pill.new('Databases', size: :small, color: :information)\n    end\n    # @!endgroup\n  end\nend",
              "source": "app/components/global/pill.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/pill.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/pill_preview.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::Slider": {
        "type": "ViewComponent",
        "description": "A UI component that renders a horizontal content slider with scroll buttons. It uses a Stimulus.js controller for interactive scrolling and supports different visual variants.",
        "interactions": {
          "interaction_0": "Renders `Global::FaIcon` for scroll buttons [Source: app/components/global/slider.html.slim, app/components/global/fa_icon.rb]",
          "interaction_1": "Uses `data-controller='slider'` and `data-slider-target` for JavaScript interaction [Source: app/components/global/slider.html.slim]",
          "interaction_2": "Uses `I18n.t` for scroll button `aria-label` [Source: app/components/global/slider.html.slim, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/slider.rb",
            "app/components/global/slider.html.slim",
            "app/components/global/slider_preview.rb",
            "app/components/global/slider_preview/with_courses.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class Slider < ApplicationComponent\n    renders_many :items\n\n    def initialize(variant: :light)\n      @variant = variant\n    end\n\n    def css_modifiers\n      \"slider--#{@variant}\"\n    end\n  end\nend",
              "source": "app/components/global/slider.rb"
            },
            {
              "startLine": 1,
              "endLine": 32,
              "code": "/**\n * JS controller for Global::Slider\n *\n * The buttons will trigger either a scroll left or right of the content\n *\n * The observer hides the these button depending on\n * if the first and last element are fully visible (no further scrolling possible)\n * In an intermediate position, both buttons are displayed.\n *\n */\nimport ready from 'util/ready';\n\nready(() => {\n  const sliderComponents = document.querySelectorAll(\n    \"[data-controller~='slider']\",\n  );\n\n  if (!sliderComponents) return;\n\n  sliderComponents.forEach((slider) => {\n    const buttonLeft = slider.querySelector(\n      \"[data-slider-target='scroll-button-left']\",\n    );\n    const buttonRight = slider.querySelector(\n      \"[data-slider-target='scroll-button-right']\",\n    );\n    let content = slider.querySelector(\"[data-slider-target='content']\");\n\n    // Ensure to scroll to a point where scroll-snap-align behaves the same across browsers\n    const getScrollDistance = () => {\n      if (!content.clientWidth) {\n        //  It ...",
              "source": "app/components/global/slider.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/slider.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/slider_preview.rb",
              "relevance": 37
            },
            {
              "path": "app/assets/components/global/slider.js",
              "relevance": 14
            }
          ]
        }
      },
      "Global::SvgIcon": {
        "type": "ViewComponent",
        "description": "A UI component used to display an SVG file inline within the HTML. It wraps the SVG content in a `<span>` tag with a specified class.",
        "interactions": {
          "interaction_0": "Reads SVG content from a file path [Source: app/components/global/svg_icon.rb]"
        },
        "techDebt": [
          "Direct use of `raw svg` for rendering SVG content, which requires careful handling of the SVG source to prevent XSS vulnerabilities [Source: app/components/global/svg_icon.html.slim]"
        ],
        "provenance": {
          "sources": [
            "app/components/global/svg_icon.rb",
            "app/components/global/svg_icon.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 18,
              "code": "module Global   # This component is used to display an svg file inline.   # The file path should be provided as a string, or as ruby Pathname object.   # The wrapping_class will be added to the wrapping <span> tag's class attribute.   class SvgIcon < ApplicationComponent     def initialize(path, wrapping_class:)       @path = path       @wrapping_class = wrapping_class     end      private      def svg       File.read(@path)     end   end end",
              "source": "app/components/global/svg_icon.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/svg_icon.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Global::Table": {
        "type": "ViewComponent",
        "description": "A UI component for rendering a data table. It accepts data as an array of hashes, optional headers, and a title. It displays a 'no data' message if the data is empty.",
        "interactions": {
          "interaction_0": "Renders `State::Empty` if no data is provided [Source: app/components/global/table.html.slim]",
          "interaction_1": "Uses `I18n.t` for the 'no data' message [Source: app/components/global/table.html.slim, config/locales/en.yml, config/locales/de.yml]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/table.rb",
            "app/components/global/table.html.slim",
            "app/components/global/table_preview.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 12,
              "code": "module Global\n  class Table < ApplicationComponent\n    # @param data [Array<Hash>] table rows as hashes\n    # @param headers [Array<String>] table headers\n    # @param title [String, nil] optional table title\n    def initialize(data:, headers: [], title: nil)\n      @data = data\n      @headers = headers\n      @title = title\n    end\n\n    attr_reader :data, :headers, :title\n  end\nend",
              "source": "app/components/global/table.rb"
            },
            {
              "startLine": 4,
              "endLine": 13,
              "code": "  class TablePreview < ViewComponent::Preview\n    def default\n      data = [\n        {'age_group' => '18–24', 'global_count' => '1,234', 'global_share' => '12%'},\n        {'age_group' => '25–34', 'global_count' => '2,345', 'global_share' => '23%'},\n        {'age_group' => '35–44', 'global_count' => '1,890', 'global_share' => '19%'},\n        {'age_group' => '45–54', 'global_count' => '1,234', 'global_share' => '12%'},\n      ]\n      headers = ['Age Group', 'Global Count', 'Global Share']\n\n      render Global::Table.new(data: data, headers: headers, title: 'Age Distribution')\n    end",
              "source": "app/components/global/table.rb"
            },
            {
              "startLine": 15,
              "endLine": 17,
              "code": "    def empty_data\n      render Global::Table.new(data: [], headers: [], title: 'Empty Data Example')\n    end",
              "source": "app/components/global/table.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/table.rb",
              "relevance": 37
            },
            {
              "path": "app/components/global/table_preview.rb",
              "relevance": 37
            },
            {
              "path": "app/components/navigation/table_of_contents.rb",
              "relevance": 30
            }
          ]
        }
      },
      "Global::UserAvatar": {
        "type": "ViewComponent",
        "description": "A UI component that renders a user's avatar image. It fetches the avatar path using a helper and supports various predefined sizes and types (e.g., rounded).",
        "interactions": {
          "interaction_0": "Uses `avatar_path` helper to construct the image URL [Source: app/components/global/user_avatar.rb]"
        },
        "techDebt": [
          "Relies on `SIZE_MAPPING` and corresponding SCSS classes, requiring manual synchronization between Ruby and SCSS for size changes [Source: app/components/global/user_avatar.rb]"
        ],
        "provenance": {
          "sources": [
            "app/components/global/user_avatar.rb",
            "app/components/global/user_avatar.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.98,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 41,
              "code": "module Global   class UserAvatar < ApplicationComponent     def initialize(user_id, size:, type: nil)       raise ArgumentError.new('Unknown size') unless SIZE_MAPPING.key? size        @user_id = user_id       @size = size       @type = type     end      # Mapping of modifier to px     # When changing these values, please also adapt     # the respective _profile.scss classes.     SIZE_MAPPING = {       tiny: 20,       small: 30,       medium: 40,       large: 60,       'x-large': 100     }.stringify_keys.freeze      private      def css_classes       classes = %w[user-avatar]       classes << type_class.presence       classes << size_class.presence       classes.compact.join(' ')     end      def type_class       # Predefined CSS classes for types: rounded       @type ? \"user-avatar--#{@type}\" : ''     end      def size_class       @size ? \"user-avatar--#{@size}\" : ''     end      def user_avatar_path       avatar_path(@user_id, width: size, height: size...",
              "source": "app/components/global/user_avatar.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/user_avatar.rb",
              "relevance": 26
            },
            {
              "path": "app/components/global/accordion.rb",
              "relevance": 7
            },
            {
              "path": "app/components/global/accordion_preview.rb",
              "relevance": 7
            }
          ]
        }
      },
      "Webpack": {
        "type": "Build Tool",
        "description": "The primary bundler for frontend assets (JavaScript, TypeScript, Sass). It processes entry points, resolves dependencies, and outputs optimized bundles. Configured via `config/assets/webpack.config.mjs`.",
        "interactions": {
          "interaction_0": "Processes JavaScript/TypeScript files from `app/assets/`.",
          "interaction_1": "Processes Sass files from `app/assets/` and `brand/*/assets`.",
          "interaction_2": "Utilizes Babel for JavaScript transpilation.",
          "interaction_3": "Uses `sass-embedded` and `sass-loader` for Sass compilation.",
          "interaction_4": "Generates output bundles for deployment."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json",
            "config/assets/webpack.config.mjs"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "Yarn": {
        "type": "Package Manager",
        "description": "Manages frontend (Node.js) dependencies, used for adding, installing, and updating packages.",
        "interactions": {
          "interaction_0": "Installs dependencies listed in `package.json`.",
          "interaction_1": "Used for running build, start, format, and lint scripts.",
          "interaction_2": "Manages `node_modules`."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json",
            "docs/app/development/frontend/webpack_bundles.md",
            ".yarnrc.yml"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "ViewComponent": {
        "type": "Server-Side UI Component Framework",
        "description": "A Ruby on Rails library for building reusable, testable, and encapsulated UI components on the server-side, combining presentation logic and HTML templates.",
        "interactions": {
          "interaction_0": "Components are rendered within Rails views (e.g., `.html.slim` templates) using the `render` helper.",
          "interaction_1": "Integrates with `lookbook` for cataloging, documenting, and previewing component variants.",
          "interaction_2": "Components are unit-tested using `RSpec` with specific test helpers provided by the library."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "Gemfile",
            "docs/app/development/frontend/components/index.md"
          ]
        }
      },
      "React": {
        "type": "Frontend Library",
        "description": "A JavaScript library for building user interfaces, used for component-based frontend development.",
        "interactions": {
          "interaction_0": "Components are bundled by Webpack and transpiled by Babel."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 18,
              "code": "# frozen_string_literal: true\n\nmodule Home\n  module Course\n    class ReactivationButton < ApplicationComponent\n      def initialize(course, user:, enrollment: nil, style: 'button')\n        @course = course\n        @user = user\n        @enrollment = enrollment\n        @style = style\n      end\n\n      private\n\n      def css_classes\n        if @style == 'button'\n          'course-card__action-btn course-card__action-btn--secondary'\n        end\n      end\n    end\n  end\nend",
              "source": "app/components/home/course/reactivation_button.rb"
            },
            {
              "startLine": 1,
              "endLine": 37,
              "code": "# frozen_string_literal: true\n\nmodule Voucher\n  module ProductTypes\n    class Reactivation\n      class << self\n        def enabled?\n          ::CourseReactivation.enabled?\n        end\n\n        # Check platform and course settings: Is reactivation enabled?\n        # @param course [Course::Course]\n        def enabled_in?(course)\n          return false unless enabled?\n          return false unless course.offers_reactivation?\n          # Is it too early for reactivation?\n          return false if course.start_date&.future? ||\n                          course.end_date&.future? ||\n                          course.status == 'preparation'\n\n          true\n        end\n\n        def type\n          'course_reactivation'\n        end\n\n        def text\n          I18n.t(:'course.redeem_voucher.course_reactivation.text',\n            weeks: ::CourseReactivation.config('period'),\n            link: ::CourseReactivation.store_url)\n        end\n\n        def info_text\n          I18n.t(:'course.redeem_voucher.c...\n",
              "source": "app/components/home/course/reactivation_button.rb"
            },
            {
              "startLine": 1,
              "endLine": 32,
              "code": "# frozen_string_literal: true\n\nmodule Steps\n  module Reactivation\n    Given 'the archived course allows reactivation' do\n      context.with :archived_course do |course|\n        Server[:course].api.rel(:course).patch(\n          {on_demand: true},\n          params: {id: course['id']}\n        ).value!\n      end\n    end\n\n    Given 'I have a valid voucher for course reactivation' do\n      vouchers = Restify.new(\n        Addressable::URI.parse(Server[:web].url).join('bridges/shop/vouchers')\n      ).post(\n        {product: 'course_reactivation', qty: 1, country: 'DE'},\n        headers: {'Authorization' => 'Bearer secret_token'}\n      ).value!\n\n      context.assign :voucher, vouchers.first\n    end\n\n    When 'I reactivate the course with my voucher' do\n      send :'When I enroll in the course'\n      send :'When I use the button to reactivate the course'\n      send :'When I enter my voucher code'\n      send :'When I click on the \"Redeem\" button'\n    end\n\n    Then 'I see a button to reactivate th...\n",
              "source": "app/components/home/course/reactivation_button.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/home/course/reactivation_button.rb",
              "relevance": 30
            },
            {
              "path": "app/models/voucher/product_types/reactivation.rb",
              "relevance": 30
            },
            {
              "path": "integration/features/steps/course/reactivation.rb",
              "relevance": 30
            }
          ]
        }
      },
      "TypeScript": {
        "type": "Language/Type Checker",
        "description": "A superset of JavaScript that adds static typing, used for improved code quality, maintainability, and developer experience. Strongly recommended for new scripts.",
        "interactions": {
          "interaction_0": "Transpiled by Babel.",
          "interaction_1": "Configuration defined in `tsconfig.json`.",
          "interaction_2": "Uses `typescript-eslint` for linting.",
          "interaction_3": "Provides global type declarations via `app/assets/global.d.ts`."
        },
        "techDebt": [
          "Legacy JavaScript in `app/assets/javascripts` is excluded from TypeScript compilation, indicating a split codebase. [Source: tsconfig.json]"
        ],
        "provenance": {
          "sources": [
            "package.json",
            "tsconfig.json",
            "app/assets/global.d.ts",
            "docs/app/development/frontend/js_styleguide.md"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "Sass": {
        "type": "CSS Preprocessor",
        "description": "Extends CSS with features like variables, nesting, mixins, and functions, making stylesheets more organized and maintainable.",
        "interactions": {
          "interaction_0": "Sass files are compiled by `sass-embedded` via `sass-loader` within the Webpack pipeline.",
          "interaction_1": "Compiled CSS is then processed by `PostCSS`.",
          "interaction_2": "Linted by `Stylelint` to enforce styling conventions."
        },
        "techDebt": [
          "The `ruby-sass` compiler (using libsass) does not support CSS Color Level 4 syntax, requiring specific `Stylelint` rules for alpha value notation and color function notation. [Source: .stylelintrc.js]"
        ],
        "provenance": {
          "sources": [
            "package.json",
            "Gemfile",
            ".stylelintrc.js"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "PostCSS": {
        "type": "CSS Post-processor",
        "description": "Transforms CSS with JavaScript plugins, used for tasks like adding vendor prefixes (`postcss-preset-env`) and minification (`cssnano`).",
        "interactions": {
          "interaction_0": "Integrated into Webpack via `postcss-loader`.",
          "interaction_1": "Processes output from Sass."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "ESLint": {
        "type": "Linter",
        "description": "Enforces JavaScript and TypeScript code quality and style. Configured to ignore legacy JavaScript paths.",
        "interactions": {
          "interaction_0": "Analyzes `**/*.{js,mjs,cjs,ts}` files.",
          "interaction_1": "Integrated into the pre-commit hook via `lint-staged`."
        },
        "techDebt": [
          "Ignores `app/assets/javascripts` and `vendor/assets/javascripts` due to legacy code."
        ],
        "provenance": {
          "sources": [
            "package.json",
            "eslint.config.mjs",
            ".husky/pre-commit"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "Stylelint": {
        "type": "Linter",
        "description": "Enforces CSS and Sass code quality and style, adhering to specific configurations like BEM and idiomatic order. Includes custom rules for Sass compatibility.",
        "interactions": {
          "interaction_0": "Analyzes `app/assets/**/*.{css,scss}` and `brand/*/assets/**/*.{css,scss}`.",
          "interaction_1": "Integrated into the pre-commit hook via `lint-staged`."
        },
        "techDebt": [
          "Custom rules for `alpha-value-notation` and `color-function-notation` are necessary due to limitations of the `ruby-sass` compiler (libsass), indicating a potential need to update the Sass compiler or migrate to Dart Sass fully."
        ],
        "provenance": {
          "sources": [
            "package.json",
            ".stylelintrc.js",
            ".husky/pre-commit",
            "docs/app/development/frontend/CSS/css_styleguide.md"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 20,
              "code": "module.exports = {\n  defaultSeverity: 'warning',\n  extends: [\n    'stylelint-config-recommended-scss',\n    'stylelint-config-idiomatic-order',\n    'stylelint-config-two-dash-bem',\n  ],\n  rules: {\n    // The ruby-sass compiler (using libsass) doesn't support CSS Color\n    // Level 4, and therefore does not parse the `rbg(0 0 0 / 5%)`\n    // space-separated syntax. Therefore we require numbers for alpha\n    // value, and the comma-separated legacy syntax for the rgb\n    // function. It also does not support the newer non-global\n    // functions.\n    'alpha-value-notation': 'number',\n    'color-function-notation': 'legacy',\n    'scss/no-global-function-names': null,\n    'scss/comment-no-empty': null,\n  },\n};",
              "source": ".stylelintrc.js"
            }
          ],
          "sourceFiles": [
            {
              "path": ".stylelintrc.js",
              "relevance": 11
            }
          ]
        }
      },
      "Prettier": {
        "type": "Code Formatter",
        "description": "Automatically formats code (JavaScript, TypeScript, CSS, Sass, Markdown, Ruby, Slim) to maintain consistent style across the codebase.",
        "interactions": {
          "interaction_0": "Formats various file types on commit via `lint-staged`.",
          "interaction_1": "Ignores specific auto-generated or vendored directories and files."
        },
        "techDebt": [
          "Ignores `*.md` files because 'Prettier isn't able to understand all advanced markdown extensions', which might lead to inconsistent Markdown formatting for advanced features."
        ],
        "provenance": {
          "sources": [
            "package.json",
            ".prettierignore",
            ".husky/pre-commit",
            ".prettierrc.yml"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "I18n-js": {
        "type": "Internationalization Library",
        "description": "A JavaScript library that provides client-side internationalization capabilities, likely synchronizing with Rails' I18n system for translations.",
        "interactions": {
          "interaction_0": "Used in client-side JavaScript code for displaying localized text.",
          "interaction_1": "The `I18n` global variable is exposed and marked as `readonly` in ESLint configuration."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json",
            "eslint.config.mjs"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "XikoloVideoPlayer": {
        "type": "External UI Component / Library",
        "description": "A custom video player component developed externally by OpenHPI, integrated into the application as an npm package.",
        "interactions": {
          "interaction_0": "Used within the application to embed and manage video playback.",
          "interaction_1": "Managed as a Node.js dependency via `Yarn`.",
          "interaction_2": "Follows semantic versioning and has a dedicated release process on GitHub and npmjs.org."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json",
            "docs/app/development/frontend/video-player.md"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "SimpleForm": {
        "type": "Framework Configuration",
        "description": "The primary Ruby gem for building forms, extensively customized to provide a consistent look and feel, and to integrate custom input types and behaviors across the application. It defines default CSS classes, error handling, and form wrappers.",
        "interactions": {
          "interaction_0": "Interacts with ApplicationComponent (implicitly, as custom inputs are rendered within views).",
          "interaction_1": "Uses I18n for internationalization of labels, hints, and errors.",
          "interaction_2": "Integrates with custom input classes (e.g., ToggleSwitchInput, MarkdownInput, DatepickerInput, UploadInput).",
          "interaction_3": "Leverages ActionView for helper modules."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "config/initializers/simple_form.rb",
            "config/locales/simple_form.en.yml",
            "config/locales/simple_form.de.yml"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 6,
              "endLine": 6,
              "code": "Rails.root.glob('app/inputs/*.rb').each {|f| require f }",
              "source": "config/initializers/simple_form.rb"
            },
            {
              "startLine": 8,
              "endLine": 27,
              "code": "inputs = %w[\n  CollectionSelectInput\n  DateTimeInput\n  FileInput\n  GroupedCollectionSelectInput\n  NumericInput\n  PasswordInput\n  RangeInput\n  StringInput\n  TextInput\n]\n\ninputs.each do |input_type|\n  superclass = \"SimpleForm::Inputs::#{input_type}\".constantize\n\n  new_class = Class.new(superclass) do\n    def input_html_classes\n      super.push('form-control')\n    end\n  end\n\n  Object.const_set(input_type, new_class)\nend",
              "source": "config/initializers/simple_form.rb"
            },
            {
              "startLine": 29,
              "endLine": 39,
              "code": "module SubmitButtonPrimary\n  def submit_button(*args, &)\n    options = args.extract_options!.dup\n    options[:class] = ['btn', 'btn-primary', options[:class]].compact\n    args << options\n\n    submit(*args, &)\n  end\n\n  SimpleForm::FormBuilder.include SubmitButtonPrimary\nend",
              "source": "config/initializers/simple_form.rb"
            },
            {
              "startLine": 41,
              "endLine": 42,
              "code": "module SimpleForm::Components::Pattern\n  def pattern(_wrapper_options = nil)",
              "source": "config/initializers/simple_form.rb"
            },
            {
              "startLine": 29,
              "endLine": 31,
              "code": "const init = (el) => {\n  const s3 = JSON.parse(el.dataset.s3);\n  const url = new URL(el.dataset.imageupload);",
              "source": "config/initializers/simple_form.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "config/initializers/simple_form.rb",
              "relevance": 19
            },
            {
              "path": "app/assets/util/forms/advanced-settings.ts",
              "relevance": 5
            },
            {
              "path": "app/assets/util/forms/image-upload.js",
              "relevance": 5
            }
          ]
        }
      },
      "Form::DynamicSortableList": {
        "type": "ViewComponent",
        "description": "A reusable UI component for rendering and managing a list of items that can be sorted, added (via input or auto-completing select), and deleted. It provides a dynamic interface for ordering and modifying collections.",
        "interactions": {
          "interaction_0": "Renders Global::FaIcon for UI elements.",
          "interaction_1": "Emits JavaScript events (via data-behavior attributes) for client-side sorting, adding, and deleting.",
          "interaction_2": "Can interact with a backend API for auto-completion if select_config is provided.",
          "interaction_3": "Receives list_items, name, input_id, and select_config as initialization parameters."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/form/dynamic_sortable_list.rb",
            "app/components/form/dynamic_sortable_list.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 25,
              "code": "# frozen_string_literal: true\n\nmodule Form\n  class DynamicSortableList < ApplicationComponent\n    def initialize(list_items, name: '', input_id: '', select_config: {})\n      @list_items = list_items\n      @name = name\n      @input_id = input_id\n      @select_config = select_config\n    end\n\n    def add_items?\n      @input_id.present? || @select_config.present?\n    end\n\n    def select_url\n      @select_config[:url]\n    end\n\n    def select_placeholder\n      @select_config[:placeholder]\n    end\n\n    def select_preload\n      'true' if @select_config[:preload]\n    end\n  end\nend",
              "source": "app/components/form/dynamic_sortable_list.rb"
            },
            {
              "startLine": 1,
              "endLine": 20,
              "code": "# frozen_string_literal: true\n\nmodule Form\n  class DynamicSortableListPreview < ViewComponent::Preview\n    def simple\n      render Form::DynamicSortableList.new(['Item 1', 'Item 2', 'Item 3'])\n    end\n\n    # @label Dynamic with text input\n    def input\n      render Form::DynamicSortableList.new(['Teacher 1', 'Teacher 2'], input_id: 'teachers')\n    end\n\n    # @label Dynamic with dropdown menu\n    def select\n      render Form::DynamicSortableList.new(['Course 1', 'Course 2'],\n        select_config: {url: 'http://localhost:3000/admin/find_courses', placeholder: 'Add Courses'})\n    end\n  end\nend",
              "source": "app/components/form/dynamic_sortable_list.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/form/dynamic_sortable_list.rb",
              "relevance": 26
            },
            {
              "path": "app/components/form/dynamic_sortable_list_preview.rb",
              "relevance": 26
            },
            {
              "path": "app/assets/util/forms/advanced-settings.ts",
              "relevance": 8
            }
          ]
        }
      },
      "SimpleFormTranslateWithVariables": {
        "type": "Module",
        "description": "Extends SimpleForm::Inputs::Base to enable interpolation of variables into translated strings for form elements, enhancing the flexibility of i18n messages.",
        "interactions": {
          "interaction_0": "Prepends to SimpleForm::Inputs::Base.",
          "interaction_1": "Uses I18n for translation and interpolation."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "config/initializers/simple_form.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.75,
          "codeBlocks": [
            {
              "startLine": 6,
              "endLine": 6,
              "code": "Rails.root.glob('app/inputs/*.rb').each {|f| require f }",
              "source": "config/initializers/simple_form.rb"
            },
            {
              "startLine": 8,
              "endLine": 27,
              "code": "inputs = %w[\n  CollectionSelectInput\n  DateTimeInput\n  FileInput\n  GroupedCollectionSelectInput\n  NumericInput\n  PasswordInput\n  RangeInput\n  StringInput\n  TextInput\n]\n\ninputs.each do |input_type|\n  superclass = \"SimpleForm::Inputs::#{input_type}\".constantize\n\n  new_class = Class.new(superclass) do\n    def input_html_classes\n      super.push('form-control')\n    end\n  end\n\n  Object.const_set(input_type, new_class)\nend",
              "source": "config/initializers/simple_form.rb"
            },
            {
              "startLine": 29,
              "endLine": 40,
              "code": "module SubmitButtonPrimary\n  def submit_button(*args, &)\n    options = args.extract_options!.dup\n    options[:class] = ['btn', 'btn-primary', options[:class]].compact\n    args << options\n\n    submit(*args, &)\n  end\n\n  SimpleForm::FormBuilder.include SubmitButtonPrimary\nend",
              "source": "config/initializers/simple_form.rb"
            },
            {
              "startLine": 42,
              "endLine": 43,
              "code": "module SimpleForm::Components::Pattern\n  def pattern(_wrapper_options = nil)",
              "source": "config/initializers/simple_form.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "config/initializers/simple_form.rb",
              "relevance": 19
            },
            {
              "path": "app/assets/util/forms/advanced-settings.ts",
              "relevance": 5
            },
            {
              "path": "app/assets/util/forms/image-upload.js",
              "relevance": 5
            }
          ]
        }
      },
      "SubmitButtonPrimary": {
        "type": "Module",
        "description": "Extends SimpleForm::FormBuilder to provide a custom submit_button helper that automatically applies primary button styling.",
        "interactions": {
          "interaction_0": "Includes into SimpleForm::FormBuilder."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "config/initializers/simple_form.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 1,
          "codeBlocks": [
            {
              "startLine": 31,
              "endLine": 41,
              "code": "module SubmitButtonPrimary\n  def submit_button(*args, &)\n    options = args.extract_options!.dup\n    options[:class] = ['btn', 'btn-primary', options[:class]].compact\n    args << options\n\n    submit(*args, &)\n  end\n\n  SimpleForm::FormBuilder.include SubmitButtonPrimary\nend",
              "source": "config/initializers/simple_form.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "config/initializers/simple_form.rb",
              "relevance": 19
            }
          ]
        }
      },
      "SimpleForm::Components::Pattern": {
        "type": "Module",
        "description": "A SimpleForm component that modifies the pattern attribute of input fields, specifically removing \\A and \\z regex anchors for broader browser compatibility.",
        "interactions": {
          "interaction_0": "Integrated into SimpleForm's wrapper configuration."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "config/initializers/simple_form.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.9,
          "codeBlocks": [
            {
              "startLine": 9,
              "endLine": 32,
              "code": "ready(() => {\n  const advancedSettingsButtons: NodeListOf<HTMLButtonElement> =\n    document.querySelectorAll('[data-behavior=toggle-visibility]');\n\n  advancedSettingsButtons.forEach((button) => {\n    const target = document.getElementById(\n      button.dataset.toggleVisibility!,\n    ) as HTMLElement;\n    const onText = button.getAttribute('data-toggle-text-on');\n    const offText = button.getAttribute('data-toggle-text-off');\n\n    target.hidden = true;\n\n    button.addEventListener('click', () => {\n      const btn = button as HTMLButtonElement;\n\n      if (target.hidden) {\n        target.hidden = false;\n        btn.textContent = offText;\n      } else {\n        target.hidden = true;\n        btn.textContent = onText;\n      }\n    });\n  });\n});",
              "source": "app/assets/util/forms/advanced-settings.ts"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/assets/util/forms/advanced-settings.ts",
              "relevance": 5
            },
            {
              "path": "app/assets/util/forms/image-upload.js",
              "relevance": 5
            },
            {
              "path": "app/assets/util/forms/mdupload.js",
              "relevance": 5
            }
          ]
        }
      },
      "SimpleFormDynamicDefaultFormClass": {
        "type": "Module",
        "description": "Extends ActionView to dynamically apply form-horizontal CSS class to simple_form_for calls based on the configured SimpleForm wrapper, ensuring consistent layout for horizontal forms.",
        "interactions": {
          "interaction_0": "Included into ActionView.",
          "interaction_1": "Inspects SimpleForm's default wrapper configuration."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "config/initializers/simple_form.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 12,
              "endLine": 25,
              "code": "inputs.each do |input_type|\n  superclass = \"SimpleForm::Inputs::#{input_type}\".constantize\n\n  new_class = Class.new(superclass) do\n    def input_html_classes\n      super.push('form-control')\n    end\n  end\n\n  Object.const_set(input_type, new_class)\nend",
              "source": "config/initializers/simple_form.rb"
            },
            {
              "startLine": 27,
              "endLine": 37,
              "code": "module SubmitButtonPrimary\n  def submit_button(*args, &)\n    options = args.extract_options!.dup\n    options[:class] = ['btn', 'btn-primary', options[:class]].compact\n    args << options\n\n    submit(*args, &)\n  end\n\n  SimpleForm::FormBuilder.include SubmitButtonPrimary\nend",
              "source": "config/initializers/simple_form.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "config/initializers/simple_form.rb",
              "relevance": 19
            },
            {
              "path": "app/assets/util/forms/advanced-settings.ts",
              "relevance": 5
            },
            {
              "path": "app/assets/util/forms/image-upload.js",
              "relevance": 5
            }
          ]
        }
      },
      "AdvancedOptionsHelpers": {
        "type": "Module",
        "description": "Provides a helper method advanced_settings to create collapsible sections within forms for less frequently used options, improving UI clarity. It includes a toggle button with dynamic text.",
        "interactions": {
          "interaction_0": "Included into ActionView.",
          "interaction_1": "Uses SecureRandom.uuid for unique element IDs.",
          "interaction_2": "Uses I18n for button text.",
          "interaction_3": "Relies on frontend JavaScript (via data-behavior='toggle-visibility') for functionality."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "config/initializers/simple_form.rb"
          ]
        }
      },
      "FrontendFormHandler": {
        "type": "JavaScript Module",
        "description": "A client-side JavaScript module (specifically form.ts as documented) responsible for managing dynamic form inputs and content visibility based on user selections (e.g., content_type, exercise_type, open_mode). It dynamically loads and appends form templates.",
        "interactions": {
          "interaction_0": "Reads content_type and other input values from the DOM.",
          "interaction_1": "Modifies DOM elements to show/hide form sections.",
          "interaction_2": "Selects and appends templates from app/views/items/_form_wrapper.html.slim.",
          "interaction_3": "Attaches event listeners to form inputs."
        },
        "techDebt": [
          "The actual form.ts file was not provided, so its internal implementation details and potential tech debt cannot be fully assessed."
        ],
        "provenance": {
          "sources": [
            "docs/app/development/implementation/course_items_form.md"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 9,
              "endLine": 32,
              "code": "ready(() => {\n  const advancedSettingsButtons: NodeListOf<HTMLButtonElement> =\n    document.querySelectorAll('[data-behavior=toggle-visibility]');\n\n  advancedSettingsButtons.forEach((button) => {\n    const target = document.getElementById(\n      button.dataset.toggleVisibility!,\n    ) as HTMLElement;\n    const onText = button.getAttribute('data-toggle-text-on');\n    const offText = button.getAttribute('data-toggle-text-off');\n\n    target.hidden = true;\n\n    button.addEventListener('click', () => {\n      const btn = button as HTMLButtonElement;\n\n      if (target.hidden) {\n        target.hidden = false;\n        btn.textContent = offText;\n      } else {\n        target.hidden = true;\n        btn.textContent = onText;\n      }\n    });\n  });\n});",
              "source": "app/assets/util/forms/advanced-settings.ts"
            },
            {
              "startLine": 9,
              "endLine": 31,
              "code": "Dropzone.autoDiscover = false;\n\nconst showPreviousImage = (dropzone) => {\n  // Show existing image in preview-zone\n  const fileUrl = document.getElementsByName('file_url')[0];\n  if (fileUrl && fileUrl.value !== '') {\n    const mockFile = {\n      name: fileUrl.value.split('/')[fileUrl.value.split('/').length - 1],\n    };\n    dropzone.emit('addedfile', mockFile);\n    dropzone.files.push(mockFile);\n    const currentImage = mockFile.previewElement.querySelector(\n      '[data-dz-thumbnail]',\n    );\n    currentImage.alt = mockFile.name;\n    currentImage.src = fileUrl.value;\n    dropzone.emit('success', mockFile);\n  }\n};\n\nconst init = (el) => {\n  const s3 = JSON.parse(el.dataset.s3);\n  const url = new URL(el.dataset.imageupload);\n  const { uploadId } = ...",
              "source": "app/assets/util/forms/advanced-settings.ts"
            },
            {
              "startLine": 9,
              "endLine": 46,
              "code": "Dropzone.autoDiscover = false;\n\nconst initMdUpload = (el) => {\n  const elZone = el.querySelector('.xui-mdupload-zone');\n\n  if (!elZone || elZone.dropzone != null) {\n    return;\n  }\n\n  const s3 = JSON.parse(el.dataset.s3);\n  const url = el.dataset.mdupload;\n\n  // (pre)process passed arguments:\n  const s3Key = s3.key;\n  const acceptedFiles = s3.content_type;\n  const textArea = document.querySelector(el.dataset.textareaId);\n  const { uploadId } = el.dataset;\n\n  delete s3.key;\n  delete s3.content_type;\n\n  const dropzone = new Dropzone(elZone, {\n    url,\n    acceptedFiles,\n    timeout: null,\n    thumbnailWidth: 50,\n    thumbnailHeight: 50,\n  });\n\n  dropzone.on('sending', (file, _, fd) => {\n    Object.keys(s3).forEach((k) => {\n      const v = s3[k];\n      fd.append(k, v);\n    });\n  ...",
              "source": "app/assets/util/forms/advanced-settings.ts"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/assets/util/forms/advanced-settings.ts",
              "relevance": 5
            },
            {
              "path": "app/assets/util/forms/image-upload.js",
              "relevance": 5
            },
            {
              "path": "app/assets/util/forms/mdupload.js",
              "relevance": 5
            }
          ]
        }
      },
      "PrivatePresenter": {
        "type": "Base Class (Presenter)",
        "description": "Extends `Presenter` and introduces a `Preloading` module for efficient batch loading of associated resources for collections of presenters. It initializes a `Preloader` instance and includes `RestifyForwardable` for potential external service interactions.",
        "interactions": {
          "interaction_0": "Inherits from `Presenter`.",
          "interaction_1": "Extends child classes with `Preloading` module.",
          "interaction_2": "Uses `Preloading::Preloader` internally for data loading.",
          "interaction_3": "Inherited by `IconNavigationPresenter` and `CoursePresenter` (via `CourseInfoPresenter`)."
        },
        "techDebt": [
          "The explicit `cls.extend(Preloading)` in `inherited` hook for `build_collection` might indicate a slightly less direct or more verbose pattern for extending class methods compared to direct module inclusion or class-level method definitions."
        ],
        "provenance": {
          "sources": [
            "app/presenters/private_presenter.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.98,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 14,
              "code": "class PrivatePresenter   extend Forwardable   extend RestifyForwardable    attr_accessor :preloader    def initialize(params)     self.preloader = Preloading::Preloader.new(false)      params&.each_pair do |attribute, value|       instance_variable_set :\"@#{attribute}\", value     end   end",
              "source": "app/presenters/private_presenter.rb"
            },
            {
              "startLine": 16,
              "endLine": 23,
              "code": "  def self.inherited(cls)     super      # Load the Preloading module into each child class so that the     # `#build_collection` class method is available.     cls.extend(Preloading)   end",
              "source": "app/presenters/private_presenter.rb"
            },
            {
              "startLine": 25,
              "endLine": 36,
              "code": "  module Preloading     # Build a collection of presenters based on a collection of same     # resources, for example, courses. The collection is linked to each     # presenters preloader, to enable preloading associated resources     # for each element.     #     # Each element from the collection will be passed to `#build` along     # with all extra arguments. If a block is given, it will be called     # instead of `#build` and must return a presenter object.     #     def build_...",
              "source": "app/presenters/private_presenter.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/presenters/private_presenter.rb",
              "relevance": 24
            },
            {
              "path": "app/presenters/abuse_report_presenter.rb",
              "relevance": 5
            },
            {
              "path": "app/presenters/account/policy_presenter.rb",
              "relevance": 5
            }
          ]
        }
      },
      "Preloading::Preloader": {
        "type": "Utility (Nested Class)",
        "description": "A utility class nested within `PrivatePresenter` responsible for preloading associated resources for a collection of objects, preventing N+1 queries. It uses an internal cache to store preloaded records.",
        "interactions": {
          "interaction_0": "Used by `PrivatePresenter` and its descendants via the `load` method to fetch associated data efficiently."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/presenters/private_presenter.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 8,
              "endLine": 8,
              "code": "attr_accessor :preloader",
              "source": "app/presenters/private_presenter.rb"
            },
            {
              "startLine": 11,
              "endLine": 11,
              "code": "    self.preloader = Preloading::Preloader.new(false)",
              "source": "app/presenters/private_presenter.rb"
            },
            {
              "startLine": 18,
              "endLine": 20,
              "code": "    # Load the Preloading module into each child class so that the\n    # `#build_collection` class method is available.\n    cls.extend(Preloading)",
              "source": "app/presenters/private_presenter.rb"
            },
            {
              "startLine": 22,
              "endLine": 31,
              "code": "  module Preloading\n    # Build a collection of presenters based on a collection of same\n    # resources, for example, courses. The collection is linked to each\n    # presenters preloader, to enable preloading associated resources\n    # for each element.\n    #\n    # Each element from the collection will be passed to `#build` along\n    # with all extra arguments. If a block is given, it will be called\n    # instead of `#build` and must return a presenter object.\n    #\n    def build_...",
              "source": "app/presenters/private_presenter.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/presenters/private_presenter.rb",
              "relevance": 23
            }
          ]
        }
      },
      "IconNavigationPresenter": {
        "type": "Presenter",
        "description": "A specialized presenter for icon-based navigation elements. It exposes an `items` attribute and a `show?` method to determine if there are any items to display, enabling conditional rendering.",
        "interactions": {
          "interaction_0": "Inherits from `PrivatePresenter`.",
          "interaction_1": "Used by views or layouts to render dynamic icon navigation menus."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/presenters/icon_navigation_presenter.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 8,
              "code": "# frozen_string_literal: true\n\nclass IconNavigationPresenter < PrivatePresenter\n  attr_reader :items\n\n  def show?\n    items.any?\n  end\nend",
              "source": "app/presenters/icon_navigation_presenter.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/presenters/icon_navigation_presenter.rb",
              "relevance": 24
            },
            {
              "path": "app/presenters/abuse_report_presenter.rb",
              "relevance": 5
            },
            {
              "path": "app/presenters/account/policy_presenter.rb",
              "relevance": 5
            }
          ]
        }
      },
      "CoursePresenter": {
        "type": "Presenter",
        "description": "Presents `Course` model data for display in various contexts. It includes methods relevant to navigation and layout, such as generating course URLs (`feed_course_url`) and displaying status ribbons (`ribbon`). It handles internationalization for UI elements.",
        "interactions": {
          "interaction_0": "Delegates to the `course` object for core data.",
          "interaction_1": "Uses `ActionView::Helpers::TagHelper` and `ActionView::Context` for HTML generation within the presenter.",
          "interaction_2": "Interacts with `PublicCoursePage` for URL generation.",
          "interaction_3": "Reads configuration from `Xikolo.config` for feature flags (e.g., `recalculation_enabled?`).",
          "interaction_4": "Inherits from `CourseInfoPresenter` (which is likely a `PrivatePresenter` descendant).",
          "interaction_5": "Uses `I18n.t` for translations. [Source: docs/app/development/frontend/html_styleguide.md]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/presenters/course_presenter.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 10,
              "code": "class CoursePresenter < CourseInfoPresenter   include ActionView::Helpers::TagHelper   include ActionView::Context    def_delegators :course, :id, :course_code, :classifiers, :lang, :title, :abstract, :forum_is_locked,     :start_date, :end_date, :display_start_date, :was_available?, :available?, :status, :hidden,     :alternative_teacher_text, :fullstate",
              "source": "app/presenters/course_presenter.rb"
            },
            {
              "startLine": 12,
              "endLine": 12,
              "code": "attr_accessor :course, :enrollments",
              "source": "app/presenters/course_presenter.rb"
            },
            {
              "startLine": 14,
              "endLine": 16,
              "code": "  def self.create(course, user, enrollments = nil)     new(course:, user:, enrollments:)   end",
              "source": "app/presenters/course_presenter.rb"
            },
            {
              "startLine": 18,
              "endLine": 24,
              "code": "  def self.build_collection(*, **)     # This presenter does not use `#build` for mapping attributes, but     # `#create`. Therefore, we must build collections with a different     # method than the default:     super(*, **, &method(:create))   end",
              "source": "app/presenters/course_presenter.rb"
            },
            {
              "startLine": 26,
              "endLine": 32,
              "code": "  def classifier_titles     course.classifiers       .slice('category', 'topic')       .flat_map {|_, v| v }       .sort       .uniq   end",
              "source": "app/presenters/course_presenter.rb"
            },
            {
              "startLine": 34,
              "endLine": 34,
              "code": "  def item_collection     @item_collection ||= ::Course::Course.find(course.id).secti...",
              "source": "app/presenters/course_presenter.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/presenters/course_presenter.rb",
              "relevance": 24
            },
            {
              "path": "app/presenters/abuse_report_presenter.rb",
              "relevance": 5
            },
            {
              "path": "app/presenters/account/policy_presenter.rb",
              "relevance": 5
            }
          ]
        }
      },
      "_piwik.html.slim": {
        "type": "View Partial (Layout Integration)",
        "description": "Integrates Piwik (Matomo) analytics tracking into the application. It dynamically generates JavaScript code based on `Xikolo.config.piwik` settings, enabling or disabling tracking and configuring it.",
        "interactions": {
          "interaction_0": "Reads configuration from `Xikolo.config`.",
          "interaction_1": "Intended to be included in the main application layout for site-wide tracking."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/views/shared/_piwik.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 26,
              "code": "- if Xikolo.config.piwik\n  javascript:\n    try {\n      var _paq = _paq || [];\n      (function () {\n        var protocol = ((\"https:\" == document.location.protocol) ? \"https://\" : \"http://\")\n        var host = \"#{Xikolo.config.piwik['host_uri']}\"\n        var path = \"/piwik/\"\n        var u = protocol + host + path\n        _paq.push(['setSiteId', #{Xikolo.config.piwik['site_id']}]);\n        _paq.push(['setTrackerUrl', u + 'piwik.php']);\n        _paq.push(['setAPIUrl', u]);\n        _paq.push(['trackPageView']);\n        _paq.push(['enableLinkTracking']);\n        var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];\n        g.type = 'text/javascript';\n        g.defer = true;\n        g.async = true;\n        g.src = u + 'js/';\n        s.parentNode.insertBefore(g, s);\n      })();\n    } catch (err) {}\n\n  noscript\n    p\n      img src=\"https://#{Xikolo.config.piwik['host_uri']}/piwik/piwik.php?idsite=#{Xikolo.config.piwik['site_id']}\" style=\"border:0\" alt=\"\"",
              "source": "app/views/shared/_piwik.html.slim"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/views/shared/_piwik.html.slim",
              "relevance": 15
            }
          ]
        }
      },
      "browser-warning.js": {
        "type": "Frontend Component",
        "description": "Client-side JavaScript module responsible for handling the dismissal of browser compatibility warning messages. It sets a persistent cookie to remember the user's preference and hides the warning element from the DOM. [Source: app/assets/components/global/browser-warning.js]",
        "interactions": {
          "interaction_0": "Interacts with the DOM to find and hide the warning alert element (`[data-browser-warning=\"alert\"]`). [Source: app/assets/components/global/browser-warning.js]",
          "interaction_1": "Uses `js-cookie` to set a cookie (`_browser_warning`) with a 365-day expiration. [Source: app/assets/components/global/browser-warning.js]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/browser-warning.js"
          ]
        }
      },
      "BrowserSupport": {
        "type": "Utility",
        "description": "Ruby class that determines the support status of a given browser (unsupported or old) based on predefined version thresholds and specific browser conditions. [Source: lib/browser_support.rb]",
        "interactions": {
          "interaction_0": "Receives a `browser` object (likely from the `browser` gem) upon initialization and queries its properties (e.g., `bot?`, `ie?`, `edge?`, `version`, `platform.mac?`, `webkit?`, `firefox?`) to perform compatibility checks. [Source: lib/browser_support.rb]"
        },
        "techDebt": [
          "The `firefox_on_ipad?` method includes a specific workaround for `browser` gem detection issues on iOS 13 iPads, which might indicate a fragility in browser detection or a dependency on specific gem behavior that could change. [Source: lib/browser_support.rb]",
          "The `VERSIONS_CONSIDERED_MODERN` hash hardcodes browser version thresholds. While functional, this could be externalized to a configuration file or database if these thresholds are expected to change frequently or require dynamic updates without code deployment. [Source: lib/browser_support.rb]"
        ],
        "provenance": {
          "sources": [
            "lib/browser_support.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 6,
              "code": "\bclass\b \bBrowserSupport\b\\\bn\b  \bdef\b \binitialize\b(\bbrowser\b)\\\bn\b    @\bbrowser\b = \bbrowser\b\\\bn\b  \bend\b",
              "source": "lib/browser_support.rb"
            },
            {
              "startLine": 10,
              "endLine": 15,
              "code": "  \bdef\b \bunsupported\b?\\\bn\b    \breturn\b \bfalse\b \bif\b @\bbrowser\b.\bbot\b?\\\bn\b    \breturn\b \btrue\b \bif\b @\bbrowser\b.\bie\b?\\\bn\b\\\bn\b    @\bbrowser\b.\bedge\b? && @\bbrowser\b.\bversion\b.\bto_i\b < \b119\b\\\bn\b  \bend\b",
              "source": "lib/browser_support.rb"
            },
            {
              "startLine": 17,
              "endLine": 24,
              "code": "  \bVERSIONS_CONSIDERED_MODERN\b = {\\\bn\b    \bchrome\b: \b119\b,\\\bn\b    \bedge\b: \b122\b,\\\bn\b    \bfirefox\b: \b115\b,\\\bn\b    \bopera\b: \b107\b,\\\bn\b    \bsafari\b: \b17\b,\\\bn\b  }.\bfreeze\b",
              "source": "lib/browser_support.rb"
            },
            {
              "startLine": 28,
              "endLine": 35,
              "code": "  \bdef\b \bold\b?\\\bn\b    \breturn\b \bfalse\b \bif\b @\bbrowser\b.\bbot\b?\\\bn\b    \breturn\b \btrue\b \bif\b @\bbrowser\b.\bie\b?\\\bn\b    \breturn\b \bfalse\b \bif\b \bfirefox_on_ipad\b? && (@\bbrowser\b.\bversion\b.\bto_i\b > \b68\b)\\\bn\b\\\bn\b    \bVERSIONS_CONSIDERED_MODERN\b.\bany\b? \bdo\b |\bbrowser\b, \bminimum\b|\\\bn\b      @\bbrowser\b.\bsend\b(:\\ \bgrouse\b\\\"#{\bbrowser\b}?\\\") && @\bbrowser\b.\bversion\b.\bto_i\b < \bminimum\b\\\bn\b    \bend\b\\\bn\b  \bend\b",
              "source": "lib/browser_support.rb"
            },
            {
              "startLine": 37,
              "endLine": 42,
              "code": "  \bprivate\b\\\bn\b\\\bn\b  \bdef\b \bfirefox_on_ipad\b?\\\bn\b    # \bFirefox\b \bversion\b \bnumbers\b \bare\b \bdifferent\b \bfor\b \biOS\b \band\b\\\bn\b    # \bthe\b \bbrowser\b \bgem\b \bdoes\b \bnot\b \bdetect\b \biPads\b \bwith\b \biOS\b \b13\b \bas\b \biPad\b \bbut\b \bMac\b.\\\bn\b    # \bThus\b, \bwe\b \bcheck\b \bfor\b \bplatform\b.\bmac\b? \bin\b \bcombination\b \bwi\b...",
              "source": "lib/browser_support.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "lib/browser_support.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Babel": {
        "type": "JavaScript Transpiler",
        "description": "Transpiles modern JavaScript (ES6+) and TypeScript into backward-compatible JavaScript, ensuring broader browser support.",
        "interactions": {
          "interaction_0": "Used by Webpack via `babel-loader`.",
          "interaction_1": "Applies `@babel/preset-env` and `@babel/plugin-transform-runtime`."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "Sass (sass-embedded)": {
        "type": "CSS Preprocessor",
        "description": "Compiles SCSS files into standard CSS, supporting features like variables, nesting, and mixins. The project mandates `.scss` syntax.",
        "interactions": {
          "interaction_0": "Integrated into Webpack via `sass-loader`.",
          "interaction_1": "Output is further processed by PostCSS.",
          "interaction_2": "Adheres to a strict CSS styleguide including BEM notation and mobile-first approach. [Source: docs/app/development/frontend/CSS/css_styleguide.md]"
        },
        "techDebt": [
          "Older CSS files are ignored by Stylelint, indicating a backlog for refactoring to meet current style guidelines. [Source: docs/app/development/frontend/CSS/css_styleguide.md]"
        ],
        "provenance": {
          "sources": [
            "package.json",
            "docs/app/development/frontend/CSS/css_styleguide.md"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "Sprockets": {
        "type": "Asset Pipeline",
        "description": "Rails' native asset pipeline, still used for linking some JavaScript files (e.g., `application.js`, `moment.js`) and images, indicating a hybrid asset management approach.",
        "interactions": {
          "interaction_0": "Coexists with Webpack for asset management."
        },
        "techDebt": [
          "The hybrid approach with Webpack can lead to complexity and potential confusion for developers regarding asset management. "
        ],
        "provenance": {
          "sources": [
            "app/assets/config/manifest.js"
          ]
        },
        "codeImplementation": {
          "confidence": 0.8,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 12,
              "code": "//= require ./bootstrap/transition\n//= require ./bootstrap/alert\n//= require ./bootstrap/button\n//= require ./bootstrap/carousel\n//= require ./bootstrap/collapse\n//= require ./bootstrap/dropdown\n//= require ./bootstrap/modal\n//= require ./bootstrap/tab\n//= require ./bootstrap/affix\n//= require ./bootstrap/scrollspy\n//= require ./bootstrap/tooltip\n//= require ./bootstrap/popover",
              "source": "vendor/assets/javascripts/bootstrap-sprockets.js"
            }
          ],
          "sourceFiles": [
            {
              "path": "vendor/assets/javascripts/bootstrap-sprockets.js",
              "relevance": 11
            }
          ]
        }
      },
      "jQuery": {
        "type": "Frontend Library",
        "description": "A fast, small, and feature-rich JavaScript library. While still a dependency, its use for new Webpack assets is deprecated in favor of vanilla JavaScript.",
        "interactions": {
          "interaction_0": "Can still be used for existing jQuery plugins, but new code should avoid it."
        },
        "techDebt": [
          "Its deprecation for new code while remaining available for plugins can lead to inconsistent code styles and difficulty in enforcing modern practices. [Source: docs/app/development/frontend/js_styleguide.md]"
        ],
        "provenance": {
          "sources": [
            "package.json",
            "docs/app/development/frontend/js_styleguide.md"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "gon": {
        "type": "Data Bridge",
        "description": "A global JavaScript object used to pass Ruby variables from the backend to the frontend.",
        "interactions": {
          "interaction_0": "Receives data from Rails controllers/views.",
          "interaction_1": "Provides `user_id`, `in_app`, `env`, `build_version`, `item_id`, `section_id`, `course_id` to frontend JavaScript."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/global.d.ts"
          ]
        }
      },
      "Husky & lint-staged": {
        "type": "Developer Tooling",
        "description": "Git hooks (`husky`) combined with a file-based linter runner (`lint-staged`) to enforce code quality standards (formatting, linting) before commits.",
        "interactions": {
          "interaction_0": "Runs Prettier for formatting.",
          "interaction_1": "Executes ESLint for JavaScript/TypeScript.",
          "interaction_2": "Executes Stylelint for CSS/SCSS.",
          "interaction_3": "Executes Markdownlint for Markdown files.",
          "interaction_4": "Integrates with Ruby linters like Rubocop and Slim-lint."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "ApplicationComponent": {
        "type": "ViewComponent Base",
        "description": "The base class for all ViewComponents in the application, inheriting from `ViewComponent::Base`. It serves as a foundational element for building reusable UI components.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/application_component.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 4,
              "code": "# frozen_string_literal: true\n\nclass ApplicationComponent < ViewComponent::Base\nend",
              "source": "app/components/application_component.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/application_component.rb",
              "relevance": 19
            }
          ]
        }
      },
      "application.js": {
        "type": "JavaScript Asset (Sprockets)",
        "description": "A legacy Sprockets manifest file that compiles into the `application.js` bundle. It includes jQuery, Bootstrap-Sprockets, and a custom `xfn/ready` script. It's explicitly noted as a temporary measure during the migration to Webpack.",
        "interactions": {
          "interaction_0": "Requires `xfn/ready` for document ready events. [Source: app/assets/javascripts/application.js]",
          "interaction_1": "Requires `jquery2` for DOM manipulation and AJAX. [Source: app/assets/javascripts/application.js]",
          "interaction_2": "Requires `bootstrap-sprockets.js` for Bootstrap 3 JavaScript functionalities. [Source: app/assets/javascripts/application.js]"
        },
        "techDebt": [
          "Part of a deprecated Sprockets-based asset pipeline, being phased out in favor of Webpack. [Source: app/assets/javascripts/application.js]"
        ],
        "provenance": {
          "sources": [
            "app/assets/javascripts/application.js"
          ]
        }
      },
      "main.js": {
        "type": "JavaScript Asset (Webpack)",
        "description": "The main Webpack entry point for modern JavaScript in the application. It includes polyfills, initializes Rails UJS, and imports a wide range of global UI components and form-related actions, adhering to a component-based JavaScript architecture.",
        "interactions": {
          "interaction_0": "Imports `form-request-submit-polyfill` for browser compatibility. [Source: app/assets/main.js]",
          "interaction_1": "Initializes `@rails/ujs` for unobtrusive JavaScript features. [Source: app/assets/main.js]",
          "interaction_2": "Imports various global UI components (e.g., `accordion`, `tooltip`, `cookie-consent-banner`) and form actions (e.g., `autosubmit`, `hide-on-submit`). [Source: app/assets/main.js]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/main.js"
          ]
        }
      },
      "main.scss": {
        "type": "SCSS Entry Point",
        "description": "The primary entry point for all application styles. It orchestrates the loading of the theme-specific styles before the global styles, ensuring proper cascading and customization.",
        "interactions": {
          "interaction_0": "Imports `stylesheets/theme` to load theme-specific variables and styles first. [Source: app/assets/main.scss, docs/app/development/branding/stylesheets.md]",
          "interaction_1": "Imports `stylesheets/global` to load general application styles. [Source: app/assets/main.scss, docs/app/development/branding/stylesheets.md]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/main.scss",
            "docs/app/development/branding/stylesheets.md"
          ]
        }
      },
      "_theme.scss": {
        "type": "SCSS Module",
        "description": "Defines the core visual theme of the Xikolo application. It imports color schemas, common variables, helper mixins, and design patterns, setting the foundational look and feel.",
        "interactions": {
          "interaction_0": "Imports `theme/color_schema` for color definitions. [Source: app/assets/stylesheets/_theme.scss, docs/app/development/branding/stylesheets.md]",
          "interaction_1": "Imports `theme/common/variables` for shared SCSS variables. [Source: app/assets/stylesheets/_theme.scss, docs/app/development/branding/stylesheets.md]",
          "interaction_2": "Imports `theme/common/helpers` for SASS mixins and functions. [Source: app/assets/stylesheets/_theme.scss, docs/app/development/branding/stylesheets.md]",
          "interaction_3": "Imports `theme/design` for common design parts. [Source: app/assets/stylesheets/_theme.scss, docs/app/development/branding/stylesheets.md]"
        },
        "techDebt": [
          "The `_design.scss` file needs to be copied even if no changes are made, which is an inconvenient aspect of the current branding architecture. [Source: docs/app/development/branding/stylesheets.md]"
        ],
        "provenance": {
          "sources": [
            "app/assets/stylesheets/_theme.scss",
            "docs/app/development/branding/stylesheets.md",
            "app/assets/fonts/LICENSE.txt"
          ]
        }
      },
      "_global.scss": {
        "type": "SCSS Module",
        "description": "A global import list for general application styles. It integrates Bootstrap variables, external libraries, legacy controller-specific styles, partials, and modern components, forming the comprehensive stylesheet.",
        "interactions": {
          "interaction_0": "Imports `bs-variables` for Bootstrap 3 variable overrides. [Source: app/assets/stylesheets/_global.scss]",
          "interaction_1": "Imports `libs` for external library styles. [Source: app/assets/stylesheets/_global.scss]",
          "interaction_2": "Imports `controllers/sections` and `controllers/account` (legacy controller-specific styles). [Source: app/assets/stylesheets/_global.scss]",
          "interaction_3": "Imports `partials` for legacy UI component styles. [Source: app/assets/stylesheets/_global.scss]",
          "interaction_4": "Imports `components` for modern UI component styles. [Source: app/assets/stylesheets/_global.scss]",
          "interaction_5": "Imports `util/swal` for SweetAlert styles. [Source: app/assets/stylesheets/_global.scss]"
        },
        "techDebt": [
          "Includes `controllers/sections` and `controllers/account` which are marked as `TODO: we don't want controller specific stuff`, indicating a need for refactoring into a component-based approach. [Source: app/assets/stylesheets/_global.scss]"
        ],
        "provenance": {
          "sources": [
            "app/assets/stylesheets/_global.scss",
            "docs/app/development/frontend/CSS/index.md"
          ]
        }
      },
      "_bs-variables.scss": {
        "type": "SCSS Module",
        "description": "Contains variables extracted from Bootstrap 3.4.1 CSS. This file allows for customization of Bootstrap's default styling parameters (colors, typography, spacing, component dimensions) and is crucial for the phased migration away from Bootstrap.",
        "interactions": {
          "interaction_0": "Defines and overrides Bootstrap 3.4.1 variables, influencing the styling of elements that still rely on Bootstrap. [Source: app/assets/stylesheets/_bs-variables.scss]",
          "interaction_1": "Uses `sass:color` and `sass:math` functions for color adjustments and calculations. [Source: app/assets/stylesheets/_bs-variables.scss]"
        },
        "techDebt": [
          "Represents a dependency on Bootstrap 3.4.1, which is outdated and unmaintained, contributing to technical debt. [Source: app/assets/stylesheets/_bs-variables.scss, docs/app/development/frontend/CSS/index.md]"
        ],
        "provenance": {
          "sources": [
            "app/assets/stylesheets/_bs-variables.scss",
            "docs/app/development/frontend/CSS/index.md"
          ]
        }
      },
      "_components.scss": {
        "type": "SCSS Module",
        "description": "An import list for styles specifically scoped to modern UI components. This module is considered 'clean' and does not depend on Bootstrap, representing the target architecture for new UI development.",
        "interactions": {
          "interaction_0": "Imports styles for various global components (e.g., `accordion`, `tooltip`, `cookie_consent_banner`). [Source: app/assets/stylesheets/_components.scss]",
          "interaction_1": "Imports styles for navigation components (e.g., `navigation_bar`, `navigation_tabs`). [Source: app/assets/stylesheets/_components.scss]"
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/stylesheets/_components.scss",
            "docs/app/development/frontend/CSS/index.md"
          ]
        }
      },
      "_partials.scss": {
        "type": "SCSS Module (Legacy)",
        "description": "An import list for styles related to older, non-component-based UI elements. This module is considered legacy code and still contains a significant amount of Bootstrap-dependent styles, slated for future refactoring.",
        "interactions": {
          "interaction_0": "Imports styles for various legacy UI elements (e.g., `grid`, `typography`, `forms`, `navigation`, `quiz`, `dashboard`). [Source: app/assets/stylesheets/_partials.scss]",
          "interaction_1": "Imports styles for XUI components (`upload`, `mdupload`, `imageupload`). [Source: app/assets/stylesheets/_partials.scss]"
        },
        "techDebt": [
          "Contains a lot of Bootstrap code and is considered legacy, requiring future migration to the component-based architecture. [Source: docs/app/development/frontend/CSS/index.md]"
        ],
        "provenance": {
          "sources": [
            "app/assets/stylesheets/_partials.scss",
            "docs/app/development/frontend/CSS/index.md"
          ]
        }
      },
      "_grid-settings.scss": {
        "type": "SCSS Module",
        "description": "Defines the application's responsive grid system, including column and gutter widths, maximum content width, and various media query breakpoints. It also exports CSS variables for JavaScript access.",
        "interactions": {
          "interaction_0": "Defines `$column`, `$gutter`, `$grid-columns`, `$max-width` for the grid system. [Source: app/assets/stylesheets/_grid-settings.scss]",
          "interaction_1": "Defines various breakpoints (`$xs-to-sm`, `$sm-to-md`, `$md-to-lg`, `$breakpoint-s`, etc.) and corresponding mixins (`@mixin small`, `@mixin medium`, `@mixin large`). [Source: app/assets/stylesheets/_grid-settings.scss]",
          "interaction_2": "Exports breakpoint values as CSS variables (`--breakpoint-s`, `--breakpoint-sm`) for JavaScript access. [Source: app/assets/stylesheets/_grid-settings.scss]"
        },
        "techDebt": [
          "Contains `@deprecated Old breakpoints` mixins (`tiny`, `xs`, `sm`) that should be refactored to align with the mobile-first approach. [Source: app/assets/stylesheets/_grid-settings.scss]"
        ],
        "provenance": {
          "sources": [
            "app/assets/stylesheets/_grid-settings.scss",
            "docs/app/development/frontend/CSS/css_styleguide.md"
          ]
        }
      },
      "application.html.slim": {
        "type": "Layout",
        "description": "The primary and most comprehensive application layout. It includes all core meta tags, asset links (CSS, JavaScript), navigation, flash messages, browser warnings, and dynamic content areas. It also integrates various global UI components and tracking scripts.",
        "interactions": {
          "interaction_0": "Uses `ApplicationHelper#sentry_meta_tags` for Sentry integration. [Source: app/views/layouts/application.html.slim]",
          "interaction_1": "Includes `include_gon` for passing data to JavaScript. [Source: app/views/layouts/application.html.slim]",
          "interaction_2": "Links `bootstrap`, `fontawesome`, and `styles` stylesheets. [Source: app/views/layouts/application.html.slim]",
          "interaction_3": "Includes Webpack bundles (`runtime`, `main`) and Sprockets bundles (`application`, `lanalytics-framework`, locale-specific JS). [Source: app/views/layouts/application.html.slim]",
          "interaction_4": "Renders `Global::CustomHeadSnippets` for custom head content. [Source: app/views/layouts/application.html.slim]",
          "interaction_5": "Renders `Global::FlashBlock` for displaying flash messages. [Source: app/views/layouts/application.html.slim]",
          "interaction_6": "Renders `Navigation::Bar` unless in-app or teacherview. [Source: app/views/layouts/application.html.slim]",
          "interaction_7": "Checks `ApplicationHelper#browser_support` and `ApplicationHelper#hide_browser_warning?` to display browser warnings. [Source: app/views/layouts/application.html.slim]",
          "interaction_8": "Renders `Footer::Main` and `Global::HelpdeskButton` unless in-app or teacherview. [Source: app/views/layouts/application.html.slim]",
          "interaction_9": "Renders `shared/piwik` for analytics. [Source: app/views/layouts/application.html.slim]",
          "interaction_10": "Renders `Global::CookieConsentBanner`. [Source: app/views/layouts/application.html.slim]"
        },
        "techDebt": [
          "Relies on both Sprockets and Webpack for JavaScript asset inclusion, indicating a transitional state. [Source: app/views/layouts/application.html.slim]"
        ],
        "provenance": {
          "sources": [
            "app/views/layouts/application.html.slim",
            "app/helpers/application_helper.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 29,
              "code": "doctype 5\nhtml lang=\"#{I18n.locale}\" data-default-locale=\"#{I18n.default_locale}\" data-brand=\"#{Xikolo.config.brand}\"\n  head prefix=('og: http://ogp.me/ns#' if meta_tags[:og].present?)\n    /\n    / Start with meta tags (includes title tag)\n    /\n\n    meta charset=\"utf-8\"\n\n    - if @in_app\n      meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\"\n    - else\n      meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, viewport-fit=cover\"\n\n    - if Xikolo.config.google_site_verification.present?\n      meta name=\"google-site-verification\" content=\"#{Xikolo.config.google_site_verification}\"\n\n    = csrf_meta_tags\n    = display_meta_tags\n    = sentry_meta_tags\n\n    / Custom meta tags\n    - if content_for? :custom_meta_tags\n      = yield :custom_meta_tags\n\n    /\n    / Deprecated: Include GON for passing information to JavaScript\n    / - Needed for the lanalytics plugin\n    /\n    = include_gon(init: true)\n\n    / Passing lanalytics data to the fron...",
              "source": "app/views/layouts/application.html.slim"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/views/layouts/application.html.slim",
              "relevance": 15
            }
          ]
        }
      },
      "simple.html.slim": {
        "type": "Layout",
        "description": "A simplified application layout used for specific pages that require a less complex UI structure than the main `application.html.slim`. It includes core assets and navigation but wraps content in a `.layout-simple__container`.",
        "interactions": {
          "interaction_0": "Includes `include_gon` for passing data to JavaScript. [Source: app/views/layouts/simple.html.slim]",
          "interaction_1": "Links `bootstrap`, `fontawesome`, and `styles` stylesheets. [Source: app/views/layouts/simple.html.slim]",
          "interaction_2": "Includes Webpack bundles (`runtime`, `main`) and Sprockets bundles (`application`, `lanalytics-framework`, locale-specific JS). [Source: app/views/layouts/simple.html.slim]",
          "interaction_3": "Renders `Global::FlashBlock` for displaying flash messages. [Source: app/views/layouts/simple.html.slim]",
          "interaction_4": "Renders `Navigation::Bar`. [Source: app/views/layouts/simple.html.slim]",
          "interaction_5": "Renders `Footer::Main` and `Global::HelpdeskButton`. [Source: app/views/layouts/simple.html.slim]",
          "interaction_6": "Renders `shared/piwik` for analytics. [Source: app/views/layouts/simple.html.slim]",
          "interaction_7": "Renders `Global::CookieConsentBanner`. [Source: app/views/layouts/simple.html.slim]"
        },
        "techDebt": [
          "Relies on both Sprockets and Webpack for JavaScript asset inclusion, indicating a transitional state. [Source: app/views/layouts/simple.html.slim]"
        ],
        "provenance": {
          "sources": [
            "app/views/layouts/simple.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 27,
              "code": "doctype 5\nhtml lang=\"#{I18n.locale}\" data-default-locale=\"#{I18n.default_locale}\" data-brand=\"#{Xikolo.config.brand}\"\n  head\n    meta charset=\"utf-8\"\n    meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, viewport-fit=cover\"\n\n    = csrf_meta_tags\n    = display_meta_tags\n    = sentry_meta_tags\n\n    /\n    / Deprecated: Include GON for passing information to JavaScript\n    / - Needed for the lanalytics plugin\n    /\n    = include_gon(init: true)\n\n    /\n    / Tools, Applications and Icons\n    /\n\n    link href=image_path('favicon.ico') rel=\"shortcut icon\" type=\"image/x-icon\"\n\n    /\n    / Primary web assets\n    /\n\n    = stylesheet_link_tag 'bootstrap', media: 'all', crossorigin: 'anonymous', integrity: true\n    = stylesheet_link_tag 'fontawesome', media: 'all', crossorigin: 'anonymous', integrity: true\n    = stylesheet_link_tag 'styles', media: 'all', crossorigin: 'anonymous', integrity: true\n\n    = javascript_include_tag 'runtime', crossorigin: 'anonymous', integrity: true,...",
              "source": "app/views/layouts/simple.html.slim"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/views/layouts/simple.html.slim",
              "relevance": 15
            }
          ]
        }
      },
      "plain.html.slim": {
        "type": "Layout",
        "description": "A minimal application layout designed for very basic pages, typically without any default assets or complex UI components. It provides a clean slate for content rendering.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/views/layouts/plain.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 6,
              "code": "doctype 5\nhtml lang=I18n.locale\n  head\n    title = yield :title\n\n  body = yield",
              "source": "app/views/layouts/plain.html.slim"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/views/layouts/plain.html.slim",
              "relevance": 15
            }
          ]
        }
      },
      "Rails Asset Pipeline": {
        "type": "Asset Management System",
        "description": "Manages legacy JavaScript, images, and other static assets. It uses `//= link_tree` directives to include assets and works in conjunction with Webpack for modern assets.",
        "interactions": {
          "interaction_0": "Links image directories (`../images`).",
          "interaction_1": "Includes legacy JavaScript files like `application.js`, `m.e.i.n.e.l.js`, `moment.js`.",
          "interaction_2": "Coexists with Webpack, handling assets not managed by Webpack."
        },
        "techDebt": [
          "Contains legacy JavaScript in `app/assets/javascripts` that is ignored by modern tooling (ESLint, TypeScript)."
        ],
        "provenance": {
          "sources": [
            "app/assets/config/manifest.js",
            "eslint.config.mjs",
            "tsconfig.json",
            "docs/app/development/frontend/webpack_bundles.md"
          ]
        }
      },
      "Husky": {
        "type": "Git Hooks Manager",
        "description": "Manages Git hooks, specifically the `pre-commit` hook, to automate code quality checks before commits are finalized.",
        "interactions": {
          "interaction_0": "Triggers `lint-staged` and `tsc --skipLibCheck --noEmit` on `pre-commit`."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json",
            ".husky/pre-commit"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "lint-staged": {
        "type": "Git Hook Utility",
        "description": "Runs linters and formatters only on files staged for commit, improving performance and ensuring only relevant changes are checked.",
        "interactions": {
          "interaction_0": "Receives staged files from Husky.",
          "interaction_1": "Executes `prettier`, `editorconfig-checker`, `rubocop`, `slim-lint`, `eslint`, `stylelint`, and `markdownlint` on respective file types."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json",
            ".husky/pre-commit"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "TypeScript Compiler (tsc)": {
        "type": "Compiler/Type Checker",
        "description": "Performs static type checking for TypeScript files to catch errors early in the development cycle.",
        "interactions": {
          "interaction_0": "Executed with `--skipLibCheck --noEmit` during the pre-commit hook to ensure type correctness without generating output files."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "tsconfig.json",
            ".husky/pre-commit"
          ]
        }
      },
      "Sass (dartsass-sprockets)": {
        "type": "CSS Preprocessor",
        "description": "Compiles Sass (`.scss`) files into CSS. `dartsass-sprockets` integrates Dart Sass with the Rails asset pipeline.",
        "interactions": {
          "interaction_0": "Processes `.scss` files, including imports from `stylesheets/theme` and `stylesheets/global`.",
          "interaction_1": "Used for both Webpack and potentially Rails Asset Pipeline managed styles."
        },
        "techDebt": [
          "The `.stylelintrc.js` indicates that the `ruby-sass` compiler (libsass) is still in use for some parts, which lacks support for modern CSS Color Level 4 syntax, necessitating custom Stylelint rules. This suggests a mixed or incomplete migration to Dart Sass."
        ],
        "provenance": {
          "sources": [
            "app/assets/main.scss",
            ".stylelintrc.js",
            "docs/app/development/frontend/CSS/css_styleguide.md"
          ]
        }
      },
      "Node.js": {
        "type": "Runtime Environment",
        "description": "The runtime environment for executing JavaScript outside the browser, essential for Webpack, Yarn, and various build scripts.",
        "interactions": {
          "interaction_0": "Executes Webpack build and dev server commands.",
          "interaction_1": "Runs Yarn for dependency management.",
          "interaction_2": "Executes linting and formatting scripts."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json",
            "docs/app/development/local_setup/update_node.md"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "Markdownlint": {
        "type": "Linter",
        "description": "Enforces style and best practices for Markdown files.",
        "interactions": {
          "interaction_0": "Analyzes `**/*.{md,md.erb}` files.",
          "interaction_1": "Integrated into the pre-commit hook via `lint-staged`.",
          "interaction_2": "Configured to disable line length checks and allow specific HTML tags."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "package.json",
            ".husky/pre-commit",
            ".markdownlint.yaml"
          ]
        },
        "codeImplementation": {
          "sourceFiles": [],
          "codeBlocks": [],
          "implementationStrategy": "static_fallback",
          "confidence": 0.3
        }
      },
      "Accordion (JS)": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that provides collapsible content sections. It expands one item on button click and collapses all other elements within the same `data-controller='accordion'` container. It uses `aria-expanded` attributes for accessibility.",
        "interactions": {
          "interaction_0": "User clicks a button (`data-accordion-target='toggle-button'`) to toggle the expanded state of a section.",
          "interaction_1": "Automatically collapses other expanded sections when a new one is opened."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/accordion.js"
          ]
        }
      },
      "Accordion (Ruby ViewComponent)": {
        "type": "ViewComponent",
        "description": "Server-side component for rendering a collapsible accordion UI. It accepts a headline and renders multiple `AccordionSection` sub-components. The `AccordionSection` handles the individual collapsible items.",
        "interactions": {
          "interaction_0": "Renders `AccordionSection` components, which are then controlled by the client-side `Accordion (JS)`."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/accordion.rb",
            "app/components/global/accordion.html.slim",
            "app/components/global/accordion_section.rb",
            "app/components/global/accordion_section.html.slim"
          ]
        }
      },
      "ActionsDropdown": {
        "type": "ViewComponent",
        "description": "Renders a dropdown menu for various actions. It supports custom button text, left/right menu alignment, and visually distinguishes 'destructive' actions. Client-side `dropdown.js` provides the interactive behavior.",
        "interactions": {
          "interaction_0": "Renders a button that, when clicked, triggers the client-side `Dropdown (JS)` to show/hide the menu.",
          "interaction_1": "Accepts `actions` and `destructive_actions` as blocks for menu items."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/actions_dropdown.rb",
            "app/components/global/actions_dropdown.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 21,
              "code": "module Global   class ActionsDropdown < ApplicationComponent     def initialize(menu_side: 'left', text: nil, css_classes: '')       @menu_side = menu_side       @text = text       @css_classes = css_classes     end      renders_many :actions     renders_many :destructive_actions      def aria_label       I18n.t(:'components.actions_dropdown.aria_label')     end      def button_css_modifiers       'actions-dropdown__button--with-text' if @text     end      def menu_css_modifiers       \"actions-dropdown__menu--#{@menu_side}\" if %w[right left].include?(@menu_side)     end   end end",
              "source": "app/components/global/actions_dropdown.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/actions_dropdown.rb",
              "relevance": 19
            },
            {
              "path": "app/components/global/actions_dropdown_preview.rb",
              "relevance": 19
            }
          ]
        }
      },
      "BasicTooltip": {
        "type": "ViewComponent",
        "description": "Renders a simple tooltip, typically associated with a question mark icon. It displays provided text on hover.",
        "interactions": {
          "interaction_0": "Used by `HeadlineTooltip` to display contextual information."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/basic_tooltip.rb",
            "app/components/global/basic_tooltip.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 9,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class BasicTooltip < ApplicationComponent\n    def initialize(text)\n      @texts = Array.wrap(text)\n    end\n  end\nend",
              "source": "app/components/global/basic_tooltip.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/basic_tooltip.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Browser Warning": {
        "type": "UI Component",
        "description": "Client-side JavaScript component to dismiss a browser warning banner. Upon clicking a dismiss button, it sets a `_browser_warning` cookie to 'hide' and adds a 'hidden' class to the alert element.",
        "interactions": {
          "interaction_0": "User clicks a button (`data-browser-warning=\"dismiss\"`) to hide the alert.",
          "interaction_1": "Interacts with `js-cookie` library to set a cookie."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/browser-warning.js"
          ]
        }
      },
      "Callout": {
        "type": "ViewComponent",
        "description": "Renders a styled message box to draw user attention. It supports different types (default, warning, error, success) which dictate border and icon colors. It can include a title and custom icon, and accepts additional content via a slot.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/callout.rb",
            "app/components/global/callout.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 34,
              "code": "class Callout < ApplicationComponent\n    def initialize(text, type: nil, title: nil, icon: nil)\n      @text = text\n      @title = title\n      @type = type\n      @icon = icon\n    end\n\n    private\n\n    def render?\n      @text.present?\n    end\n\n    def css_modifiers\n      css_modifiers = @title ? 'callout--with-title' : nil\n      @type ? \"callout--#{@type} #{css_modifiers} \" : css_modifiers\n    end\n\n    def icon\n      @icon || Global::FaIcon.new(default_icon_name, style: :solid)\n    end\n\n    def default_icon_name\n      {\n        success: 'circle-check',\n        error: 'circle-exclamation',\n        warning: 'triangle-exclamation',\n      }[@type] || 'circle-info'\n    end\n  end",
              "source": "app/components/global/callout.rb"
            },
            {
              "startLine": 1,
              "endLine": 13,
              "code": ".callout class=css_modifiers\n  .callout__indicator\n    = render icon\n    - if @title\n      .callout__title\n        = @title\n\n  .callout__content\n    p == @text\n    - if content\n      .callout__slot\n        = content",
              "source": "app/components/global/callout.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/callout.rb",
              "relevance": 30
            },
            {
              "path": "app/components/global/callout_preview.rb",
              "relevance": 30
            },
            {
              "path": "app/components/global/callout.html.slim",
              "relevance": 11
            }
          ]
        }
      },
      "Clear Button": {
        "type": "UI Component",
        "description": "Client-side JavaScript component for a button that clears the value of a target input field and then submits the closest form. Primarily used in filter bars for text searches.",
        "interactions": {
          "interaction_0": "User clicks a button (`data-id='clear-button'`).",
          "interaction_1": "Resets the value of the input specified by `data-clear-target`.",
          "interaction_2": "Submits the closest form to the target input."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/clear-button.js"
          ]
        }
      },
      "Cookie Consent Banner (JS)": {
        "type": "UI Component",
        "description": "Client-side JavaScript component to manage the visibility of the cookie consent banner. It hides the banner when the close button (`data-behavior='hide'`) is clicked.",
        "interactions": {
          "interaction_0": "User clicks the close button to hide the banner."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/cookie-consent-banner.js"
          ]
        }
      },
      "Cookie Consent Banner (Ruby ViewComponent)": {
        "type": "ViewComponent",
        "description": "Server-side component for rendering the cookie consent banner. It retrieves the current consent details from `ConsentCookie` and displays the relevant text and action buttons. It only renders if a consent is active.",
        "interactions": {
          "interaction_0": "Interacts with `ConsentCookie` to determine if a banner should be shown and what text to display.",
          "interaction_1": "Renders a form for accepting or declining cookies."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/cookie_consent_banner.rb",
            "app/components/global/cookie_consent_banner.html.slim"
          ]
        }
      },
      "Copy to Clipboard (JS)": {
        "type": "UI Component",
        "description": "Client-side TypeScript component that copies text from an element's `data-text` attribute to the user's clipboard. It provides visual feedback (e.g., changing tooltip/label text) upon successful copy.",
        "interactions": {
          "interaction_0": "User clicks an element (`data-behavior='copy-to-clipboard'`).",
          "interaction_1": "Accesses `navigator.clipboard.writeText()` to copy content.",
          "interaction_2": "Updates `data-behavior='clipboard-tooltip'` or `data-behavior='clipboard-label'` with a success message temporarily."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/copy-to-clipboard.ts"
          ]
        }
      },
      "Copy to Clipboard (Ruby ViewComponent)": {
        "type": "ViewComponent",
        "description": "Server-side component for rendering a button or icon that, when clicked, copies specified text to the clipboard. It supports different visual types (icon or button) and optional labels/tooltips.",
        "interactions": {
          "interaction_0": "Renders HTML elements with `data-behavior='copy-to-clipboard'` for client-side interaction."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/copy_to_clipboard.rb",
            "app/components/global/copy_to_clipboard.html.slim"
          ]
        }
      },
      "CourseListBanner": {
        "type": "ViewComponent",
        "description": "Renders a banner for course listing pages. It fetches the current banner data from the `Banner` model (cached for performance) and handles image display and link targeting (e.g., `_blank`).",
        "interactions": {
          "interaction_0": "Fetches banner data from `Banner.current` (cached)."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/course_list_banner.rb",
            "app/components/global/course_list_banner.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 5,
              "code": "    CACHE_DURATION = 30.minutes.freeze",
              "source": "app/components/global/course_list_banner.rb"
            },
            {
              "startLine": 7,
              "endLine": 9,
              "code": "    def render?\n      banner.present?\n    end",
              "source": "app/components/global/course_list_banner.rb"
            },
            {
              "startLine": 13,
              "endLine": 19,
              "code": "    def banner\n      @banner ||= Rails.cache.fetch(\n        'web/banners/current',\n        expires_in: CACHE_DURATION,\n        race_condition_ttl: 1.minute\n      ) { Banner.current }\n    end",
              "source": "app/components/global/course_list_banner.rb"
            },
            {
              "startLine": 21,
              "endLine": 37,
              "code": "    def link\n      banner.link_url\n    end\n\n    def link_target_options\n      return {} if banner.link_target.blank?\n\n      if banner.link_target == 'blank'\n        {target: '_blank', rel: 'noopener'}\n      else\n        {target: \"_#{banner.link_target}\"}\n      end\n    end\n\n    def image_url\n      banner.image_url\n    end\n\n    def alt_text\n      banner.alt_text\n    end",
              "source": "app/components/global/course_list_banner.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/course_list_banner.rb",
              "relevance": 19
            }
          ]
        }
      },
      "CustomHeadSnippets": {
        "type": "ViewComponent",
        "description": "Injects custom HTML snippets into the `<head>` section of the document. Snippets are retrieved from `Xikolo.config.custom_html` and rendered only if their defined `requirements` (e.g., `cookie_consent`) are fulfilled.",
        "interactions": {
          "interaction_0": "Reads configuration from `Xikolo.config.custom_html`.",
          "interaction_1": "Evaluates `Requirements` (e.g., `ConsentCookie`) to determine if a snippet should be rendered."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/custom_head_snippets.rb",
            "app/components/global/custom_head_snippets.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 19,
              "code": "module Global   class CustomHeadSnippets < ApplicationComponent     def render?       active_snippets.any?     end      private      def snippets       active_snippets.pluck('html')     end      def active_snippets       @active_snippets ||= Xikolo.config.custom_html.select do |snippet|         Requirements[snippet].fulfilled?(helpers)       end     end",
              "source": "app/components/global/custom_head_snippets.rb"
            },
            {
              "startLine": 21,
              "endLine": 42,
              "code": "    class Requirements       def self.[](snippet)         return new([]) unless snippet['requirements']&.any?          new(           snippet['requirements'].map {|req| resolve(req) }         )       end        def self.resolve(requirement)         type = requirement.fetch('type')          case type           when 'cookie_consent'             CookieConsent.new(requirement.fetch('name'))           else             raise \"Not sure how to handle requirement of type #{type}\"         end       rescue KeyError => e         raise \"Missing required key '#{e.key}' for requirement configuration\"       end",
              "source": "app/components/global/custom_head_snippets.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/custom_head_snippets.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Custom Select (TomSelect)": {
        "type": "UI Component",
        "description": "Client-side TypeScript component that initializes `TomSelect` instances for enhanced dropdown functionality. It supports various configurations like remote data loading, preloading, creating new options, and prefilling. It integrates with specific settings for classifiers and item statistics.",
        "interactions": {
          "interaction_0": "Initializes `TomSelect` on elements with `data-behavior='custom-select'`.",
          "interaction_1": "Uses `classifiers-select.js` to load classifier data from `/admin/find_classifiers`.",
          "interaction_2": "Uses `item-stats-select.js` to redirect to a URL on item selection.",
          "interaction_3": "Interacts with `settings.js` for common and advanced TomSelect configurations."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/custom-select.ts",
            "app/assets/components/global/custom-select/classifiers-select.js",
            "app/assets/components/global/custom-select/item-stats-select.js",
            "app/assets/components/global/custom-select/settings.js"
          ]
        }
      },
      "DisclosureWidget": {
        "type": "ViewComponent",
        "description": "Renders a collapsible content area using the HTML `<details>` element. It supports customizable summary labels for both collapsed and expanded states, different visual variants (default, light), and custom icons for toggling.",
        "interactions": {
          "interaction_0": "Toggles content visibility based on user interaction with the summary element."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/disclosure_widget.rb",
            "app/components/global/disclosure_widget.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 40,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class DisclosureWidget < ApplicationComponent\n    def initialize(summary, content_lang: nil, expanded_summary: nil, visible: true, variant: :default, icons: {})\n      @summary = summary\n\n      @content_lang = content_lang\n      @expanded_summary = expanded_summary\n      @visible = visible\n      @variant = variant\n      @icons = icons\n    end\n\n    def expanded_summary\n      @expanded_summary || @summary\n    end\n\n    def icons\n      {\n        opened: @icons[:opened] || 'chevron-down',\n        closed: @icons[:closed] || 'chevron-right',\n        opened_classes: @icons[:opened_classes] || 'mr5',\n        closed_classes: @icons[:closed_classes] || 'mr10',\n        style: @icons[:opened_style] || :solid,\n      }\n    end\n\n    def css_classes\n      if @variant == :light\n        'disclosure-widget--light'\n      end\n    end\n\n    private\n\n    def render?\n      @visible\n    end\n\n    def variant\n      @variant if %w[default light].include?(@variant)\n    e...",
              "source": "app/components/global/disclosure_widget.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/disclosure_widget.rb",
              "relevance": 19
            },
            {
              "path": "app/components/global/disclosure_widget_preview.rb",
              "relevance": 19
            }
          ]
        }
      },
      "DownloadButton": {
        "type": "ViewComponent",
        "description": "Renders a button or link for downloading files. It supports optional icons (e.g., 'download'), disabled states, and custom CSS classes. The `type` parameter can be used to influence the default icon.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/download_button.rb",
            "app/components/global/download_button.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 5,
              "endLine": 10,
              "code": "    def initialize(url, text, attributes: {}, css_classes: '', type: nil)\n      @url = url\n      @text = text\n      @attributes = attributes\n      @css_classes = css_classes.split\n      @type = type\n    }",
              "source": "app/components/global/download_button.rb"
            },
            {
              "startLine": 12,
              "endLine": 16,
              "code": "    def css_classes\n      return 'btn btn-primary' if @css_classes.empty?\n\n      @css_classes.join(' ')\n    }",
              "source": "app/components/global/download_button.rb"
            },
            {
              "startLine": 18,
              "endLine": 20,
              "code": "    def icon\n      'download' if type == :download\n    }",
              "source": "app/components/global/download_button.rb"
            },
            {
              "startLine": 25,
              "endLine": 28,
              "code": "    def type\n      if %i[download progress].include? @type\n        @type\n      end\n    }",
              "source": "app/components/global/download_button.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/download_button.rb",
              "relevance": 19
            },
            {
              "path": "app/components/global/download_button_preview.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Dropdown (JS)": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that manages the expansion and collapse of dropdown menus. It ensures that only one dropdown is open at a time (unless nested) and closes dropdowns when the user clicks outside of them.",
        "interactions": {
          "interaction_0": "User clicks an element (`data-behaviour='dropdown'`) to toggle its `aria-expanded` state.",
          "interaction_1": "Closes other dropdowns when a new one is opened, unless it's a nested parent.",
          "interaction_2": "Closes all dropdowns when a click occurs outside any dropdown."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/dropdown.js"
          ]
        }
      },
      "Expand Course Card": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that enables a 'hover-to-expand' behavior for course cards. When a user hovers over a card, a cloned, expanded version appears to display more information. It handles responsiveness and interactions with dialogs.",
        "interactions": {
          "interaction_0": "User hovers over a course card (`data-behavior='expandable'`).",
          "interaction_1": "Clones the card and adds `course-card--expanded` class to display extended information.",
          "interaction_2": "Initializes dialogs for buttons within the cloned card.",
          "interaction_3": "Resets placeholder content on slider scroll or window resize.",
          "interaction_4": "Listens for `load-more:course-cards` event to apply behavior to newly added cards."
        },
        "techDebt": [
          "The cloning of the card and absolute positioning for expansion might lead to complex DOM management and potential performance issues with many cards or frequent interactions."
        ],
        "provenance": {
          "sources": [
            "app/assets/components/global/expand-course-card.js"
          ]
        }
      },
      "FaIcon": {
        "type": "ViewComponent",
        "description": "Renders Font Awesome icons. It supports different icon styles (e.g., regular, solid) and can combine two icons into a stacked format (e.g., 'lightbulb-on+circle-star'), where the second icon appears in the top-right corner.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/fa_icon.rb",
            "app/components/global/fa_icon.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 23,
              "code": "class FaIcon < ApplicationComponent     NAME_SEPARATOR = '+'      def initialize(name, style: :regular, title: nil, css_classes: '')       @name, @stack_icon = name.split(NAME_SEPARATOR)       @style = style       @title = title       @css_classes = css_classes     end      private      def css_classes       \"#{@stack_icon ? 'xi-icon__masked' : 'xi-icon'} fa-#{@style} fa-#{@name} #{@css_classes}\"     end      def stack_icon_classes       \"xi-icon__stacked fa-#{@style} fa-#{@stack_icon}\"     end   end",
              "source": "app/components/global/fa_icon.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/fa_icon.rb",
              "relevance": 19
            },
            {
              "path": "app/components/global/fa_icon_preview.rb",
              "relevance": 19
            }
          ]
        }
      },
      "FilterBar::Controls": {
        "type": "ViewComponent",
        "description": "Renders the control section of a filter bar, including a 'Reset' button and an optional overview of currently applied filters. It can also implement a 'fixed' behavior using the client-side `Fixed Bar` component.",
        "interactions": {
          "interaction_0": "Renders a 'Reset' link that, when clicked, triggers client-side `hide-on-click` and `show-on-click` to manage content visibility.",
          "interaction_1": "Can be configured to use `data-behavior='fixed'` for sticky positioning."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/filter_bar/controls.rb",
            "app/components/global/filter_bar/controls.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 5,
              "endLine": 13,
              "code": "def initialize(path, content_id, loading_indicator_id, filters, results_count: nil, show_overview: false)\n        @path = path\n        @content_id = content_id\n        @loading_indicator_id = loading_indicator_id\n        @filters = filters\n        @results_count = results_count\n        @show_overview = show_overview\n      end",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 17,
              "endLine": 19,
              "code": "def render?\n        params[:q].present? || @filters.any? {|filter| filter.selected.present? }\n      end",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 21,
              "endLine": 23,
              "code": "def data_behavior\n        'fixed' if @show_overview\n      end",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 25,
              "endLine": 29,
              "code": "def results_count\n        return unless @results_count\n\n        I18n.t(:'components.filter_bar.filter.results_count', count: @results_count)\n      end",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 31,
              "endLine": 38,
              "code": "def applied_filters\n        list = []\n        list << params[:q]\n\n        @filters.each do |filter|\n          next if filter.selected.blank?\n\n          if filter.ke...",
              "source": "app/components/global/filter_bar/controls.rb"
            },
            {
              "startLine": 1,
              "endLine": 22,
              "code": ".filter-bar__controls data-behavior=data_behavior\n  .filter-bar__controls-wrapper\n    - if @show_overview\n      .filter-bar__overview\n        p.filter-bar__overview-text\n          span.filter-bar__overview-title\n            = t(:'components.filter_bar.filter.results')\n          = applied_filters\n        = link_to '#adjust-anchor', class: 'filter-bar__adjust' do\n          = render Global::FaIcon.new('filter', css_classes: 'mr5')\n          = t(:'components.filter_bar.filter.adjust')\n\n    .filter-bar__results\n      - if @results_count\n        .filter-bar__results-count\n          = render Global::Pill.new(results_count)\n      = link_to @path, data: {'hide-on-click': @content_id, 'show-on-click': @loading_indicator_id} do\n        = render Global::FaIcon.new('undo', css_classes: 'mr5')\n        = t(:'components.filter_bar.filter.reset')",
              "source": "app/components/global/filter_bar/controls.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/filter_bar/controls.rb",
              "relevance": 34
            },
            {
              "path": "app/components/global/filter_bar/controls_preview.rb",
              "relevance": 34
            },
            {
              "path": "app/components/global/filter_bar/controls.html.slim",
              "relevance": 11
            }
          ]
        }
      },
      "FilterBar::Filter": {
        "type": "ViewComponent",
        "description": "Renders a single filter element within a filter bar, typically a `select` tag. It supports options for blank selection, pre-selected values, and can be configured for multi-select using `custom-select` behavior.",
        "interactions": {
          "interaction_0": "Renders a `select_tag` that, when changed, triggers a form submission (via `data-change='submit'`).",
          "interaction_1": "Can integrate with client-side `Custom Select (TomSelect)` for enhanced multi-select functionality."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/filter_bar/filter.rb",
            "app/components/global/filter_bar/filter.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.9,
          "codeBlocks": [
            {
              "startLine": 14,
              "endLine": 17,
              "code": "      def filters\n        @filters ||= [\n          status_filter,\n        ].compact\n      end",
              "source": "app/components/admin/course/filter_bar.rb"
            },
            {
              "startLine": 19,
              "endLine": 23,
              "code": "      def course_states\n        %w[preparation active archive].map do |state|\n          [I18n.t(:'admin.courses.index.filter.#{state}'), state]\n        end\n      end",
              "source": "app/components/admin/course/filter_bar.rb"
            },
            {
              "startLine": 25,
              "endLine": 27,
              "code": "      def status_filter\n        Global::FilterBar::Filter.new(:status, t(:'admin.courses.index.filter.status'), course_states,\n          selected: params[:status])\n      end",
              "source": "app/components/admin/course/filter_bar.rb"
            },
            {
              "startLine": 10,
              "endLine": 13,
              "code": "      def filters\n        @filters ||= [\n          language_filters,\n          tag_filters,\n        ].compact\n      end",
              "source": "app/components/admin/course/filter_bar.rb"
            },
            {
              "startLine": 15,
              "endLine": 23,
              "code": "      def language_filters\n        languages = @documents.flat_map do |document|\n          document[:localizations].pluck(:language)\n        end.uniq\n\n        Global::FilterBar::Filter.new(:language,\n          I18n.t(:'knowledge_documents.language'),\n          localize_language_options(languages),\n          selected: params[:language])\n      end",
              "source": "app/components/admin/course/filter_bar.rb"
            },
            {
              "startLine": 25,
              "endLine": 30,
              "code": "      def localize_language_options(languages)\n        languages.map do |lang|\n          platform_localization = I18n.t(\"languages.title.#{lang}\")\n          native_localization = I18n.t(\"languages.name.#{lang}\")\n\n          [\"#{platform_localization} (#{native_localization})\",...\n      end",
              "source": "app/components/admin/course/filter_bar.rb"
            },
            {
              "startLine": 13,
              "endLine": 16,
              "code": "      def filters\n        @filters ||= [\n          tags_filter,\n          order_filter,\n        ].compact\n      end",
              "source": "app/components/admin/course/filter_bar.rb"
            },
            {
              "startLine": 18,
              "endLine": 23,
              "code": "      def tags_filter\n        return if @tags.blank?\n\n        Global::FilterBar::Filter.new(:tags, t(:'pinboard.index.filter.tags.label'), tags_options,\n          selected: params[:tags], multi_select: true, blank_option: t(:'pinboard.index.filter.tags.placeholder'))\n      end",
              "source": "app/components/admin/course/filter_bar.rb"
            },
            {
              "startLine": 25,
              "endLine": 33,
              "code": "      def tags_options\n        tags = @tags.map {|tag| [tag.name, tag.id] }\n\n        # Add a fallback tag if they are specified in params\n        # We allow users to select tags that are not in the list\n        # by clicking on question info tags.\n        # See: app/assets/course/pinboard/filter.ts\n        missing_tag_ids = Array(para...\n      end",
              "source": "app/components/admin/course/filter_bar.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/admin/course/filter_bar.rb",
              "relevance": 34
            },
            {
              "path": "app/components/course/documents/filter_bar.rb",
              "relevance": 34
            },
            {
              "path": "app/components/course/pinboard/filter_bar.rb",
              "relevance": 34
            }
          ]
        }
      },
      "FilterBar::Search": {
        "type": "ViewComponent",
        "description": "Renders the search input field within a filter bar. It includes a text input and a search button, along with a 'Clear' button that utilizes the client-side `Clear Button` component.",
        "interactions": {
          "interaction_0": "Renders a `text_field_tag` for search input.",
          "interaction_1": "Includes a button (`data-id='clear-button'`) that interacts with the client-side `Clear Button` to clear the input and submit the form."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/filter_bar/search.rb",
            "app/components/global/filter_bar/search.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  module FilterBar\n    class Search < ApplicationComponent\n      def initialize(name, search_param)\n        @name = name\n        @search_param = search_param\n      end\n    end\n  end\nend",
              "source": "app/components/global/filter_bar/search.rb"
            },
            {
              "startLine": 1,
              "endLine": 13,
              "code": "label\n  = t(:'components.filter_bar.search.label')\n  .filter-bar__search class=\"#{'filter-bar__search--active' if @search_param.present?}\"\n    = text_field_tag @name, @search_param, type: 'search'\n    - if @search_param.present?\n      = button_tag t(:'components.filter_bar.search.clear'), type: 'button', class: 'filter-bar__clear-button',\n        data: {id: 'clear-button', 'clear-target': \"##{@name}\"}, 'aria-label': t(:'components.filter_bar.search.label') do\n        = render Global::FaIcon.new('xmark')\n    = button_tag t(:'components.filter_bar.search.label'), type: 'submit', class: 'filter-bar__search-button', 'aria-label': t(:'components.filter_bar.search.label') do\n      = render Global::FaIcon.new('magnifying-glass')",
              "source": "app/components/global/filter_bar/search.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/filter_bar/search.rb",
              "relevance": 34
            },
            {
              "path": "app/components/global/filter_bar/search.html.slim",
              "relevance": 11
            },
            {
              "path": "db/migrate/20220303090223_add_search_index_to_courses.rb",
              "relevance": 11
            }
          ]
        }
      },
      "Fixed Bar": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that makes an element 'stick' to the top of the viewport when the user scrolls past it. It uses an `IntersectionObserver` to detect when the element enters/exits the viewport.",
        "interactions": {
          "interaction_0": "Observes an element's intersection with the viewport using `IntersectionObserver`.",
          "interaction_1": "Clones the element and appends it to the body with `js-fixed` class when the original element is no longer intersecting at the top threshold."
        },
        "techDebt": [
          "Cloning the element might lead to duplicate IDs if not carefully managed, although `fixedElement.remove()` helps mitigate this. Potential for layout shifts if not styled correctly."
        ],
        "provenance": {
          "sources": [
            "app/assets/components/global/fixed-bar.js"
          ]
        }
      },
      "Flatpickr (JS)": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that initializes `flatpickr` date/time pickers. It provides custom date parsing and formatting using `luxon`, handles timezone offsets, and integrates a custom plugin for 'Clear' and 'Today' buttons.",
        "interactions": {
          "interaction_0": "Initializes `flatpickr` on elements with `data-behaviour~=datepicker`.",
          "interaction_1": "Uses `luxon` for ISO date parsing and formatting.",
          "interaction_2": "Integrates `CustomButtonsPlugin` to add 'Clear' and 'Today' buttons to the picker."
        },
        "techDebt": [
          "Relies on a specific bug fix for `flatpickr`'s 'Z' dateFormat, which might be fragile if `flatpickr` updates its behavior. The use of `luxon` adds another dependency for date manipulation."
        ],
        "provenance": {
          "sources": [
            "app/assets/components/global/flatpickr.js",
            "app/assets/components/global/flatpickr/customButtonsPlugin.js"
          ]
        }
      },
      "FlashBlock": {
        "type": "ViewComponent",
        "description": "Orchestrates the rendering of various flash messages and layers (e.g., `SweetAlert2` dialogs). It iterates through different flash types (`error`, `success`, `notice`, `alert`, `success_layer`, `info_layer`, `error_layer`) and renders the appropriate sub-components.",
        "interactions": {
          "interaction_0": "Renders `FlashMessage` for standard flash messages.",
          "interaction_1": "Renders `FlashLayer` for messages displayed as `SweetAlert2` dialogs."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/flash_block.rb",
            "app/components/global/flash_block.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 23,
              "code": "  class FlashBlock < ApplicationComponent\n    def initialize(flash)\n      @flash = flash\n    end\n\n    private\n\n    def messages\n      %i[error success notice alert]\n        .select {|type| @flash[type] }\n        .flat_map do |type|\n          @flash[type].uniq.map {|message| {type:, text: message} }\n        end\n    end\n\n    def layers\n      %i[success_layer info_layer error_layer]\n        .select {|type| @flash[type] }\n        .flat_map do |type|\n        @flash[type].map {|message| {type:, text: message} }\n      end\n    end\n  end",
              "source": "app/components/global/flash_block.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/flash_block.rb",
              "relevance": 19
            }
          ]
        }
      },
      "FlashLayer": {
        "type": "ViewComponent",
        "description": "Renders a flash message as a `SweetAlert2` dialog. It parses the message text to extract a title and body, then generates JavaScript to trigger the `SweetAlert2` modal on DOM ready.",
        "interactions": {
          "interaction_0": "Generates JavaScript to call `xuiSwal.fire()` on the client-side."
        },
        "techDebt": [
          "Relies on global `xuiSwal` object, which couples it to the SweetAlert2 library and its global availability."
        ],
        "provenance": {
          "sources": [
            "app/components/global/flash_layer.rb",
            "app/components/global/flash_layer.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 14,
              "code": "class FlashLayer < ApplicationComponent\n  def initialize(type, text)\n    @type = type\n    @text = text\n  end\n\n  private\n\n  def swal_options\n    title, text = @text.split('<br />', 2)\n    type = @type.to_s.split('_').first\n    {title:, text:, type:, showCancelButton: false}\n  end\nend",
              "source": "app/components/global/flash_layer.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/flash_layer.rb",
              "relevance": 19
            }
          ]
        }
      },
      "FlashMessage": {
        "type": "ViewComponent",
        "description": "Renders a standard dismissible flash message banner. It displays an icon corresponding to the message type (success, error, alert, notice) and includes a button to hide the message using client-side JavaScript.",
        "interactions": {
          "interaction_0": "Renders a button with `data-hide-on-click` attribute to hide the message via client-side JavaScript."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/flash_message.rb",
            "app/components/global/flash_message.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 19,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class FlashMessage < ApplicationComponent\n    def initialize(type, text)\n      @type = type\n      @text = text\n    end\n\n    private\n\n    def icon_name\n      {\n        success: 'circle-check',\n        error: 'circle-exclamation',\n        alert: 'triangle-exclamation',\n        notice: 'circle-info',\n      }[@type] || ''\n    end\n  end\nend",
              "source": "app/components/global/flash_message.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/flash_message.rb",
              "relevance": 19
            },
            {
              "path": "app/components/global/flash_message_preview.rb",
              "relevance": 19
            },
            {
              "path": "integration/features/steps/flash.rb",
              "relevance": 19
            }
          ]
        }
      },
      "HeadlineTooltip": {
        "type": "ViewComponent",
        "description": "Combines a headline (`h1` to `h6`) with a `BasicTooltip` component. It renders the headline and then embeds the tooltip next to it, providing contextual information on hover.",
        "interactions": {
          "interaction_0": "Renders `Global::BasicTooltip`."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/headline_tooltip.rb",
            "app/components/global/headline_tooltip.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class HeadlineTooltip < ApplicationComponent\n    def initialize(headline, tooltip = nil, level:)\n      @headline = headline\n      @tooltip = tooltip\n      @level = level\n    end\n  end\nend",
              "source": "app/components/global/headline_tooltip.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/headline_tooltip.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Helpdesk Button (JS)": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that adjusts the position of the helpdesk button to prevent it from overlapping with the footer's copyright element. It uses an `IntersectionObserver` to detect when the footer is in view.",
        "interactions": {
          "interaction_0": "Observes the footer copyright element (`data-id=\"footer-copyright\"`) using `IntersectionObserver`.",
          "interaction_1": "Adds/removes `helpdesk-button--bottom-reached` class to the helpdesk button based on intersection state."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/helpdesk-button.js"
          ]
        }
      },
      "Helpdesk Button (Ruby ViewComponent)": {
        "type": "ViewComponent",
        "description": "Renders the helpdesk button and its associated panel. The button's icon dynamically changes based on active chatbot feature flags for the current user. The panel contains a close button and slots for chatbot features or default content.",
        "interactions": {
          "interaction_0": "Checks user feature flags (`@user.feature?`) to determine the appropriate chatbot version and icon.",
          "interaction_1": "Renders a button that, when clicked, likely toggles the visibility of the helpdesk panel (client-side interaction).",
          "interaction_2": "Renders a close button that interacts with client-side JavaScript to hide the panel."
        },
        "techDebt": [
          "The `CHATBOT_VERSION` hash defines a hardcoded order of feature flipper names, which might be less flexible for dynamic feature flag management. The `data_feature` attribute is used to pass the chatbot version, implying client-side logic to load the correct chatbot UI."
        ],
        "provenance": {
          "sources": [
            "app/components/global/helpdesk_button.rb",
            "app/components/global/helpdesk_button.html.slim"
          ]
        }
      },
      "Hide/Show on Click": {
        "type": "UI Component",
        "description": "Client-side JavaScript components (`hide-on-click.js` and `show-on-click.js`) that toggle the `hidden` attribute of a target DOM element when a specified trigger element is clicked. The target is identified by the value of `data-hide-on-click` or `data-show-on-click`.",
        "interactions": {
          "interaction_0": "User clicks an element with `data-hide-on-click` or `data-show-on-click`.",
          "interaction_1": "Sets the `hidden` attribute of the target element to `true` or `false`."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/hide-on-click.js",
            "app/assets/components/global/show-on-click.js"
          ]
        }
      },
      "ItemStatus": {
        "type": "ViewComponent",
        "description": "Displays a status item with an icon, title, text, and an optional tooltip. It supports various color schemes (success, error, link) and 'connected' types (default, filled, dashed, disabled) which visually link items with vertical lines and modify icon appearance.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/item_status.rb",
            "app/components/global/item_status.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 5,
              "endLine": 13,
              "code": "    def initialize(item, connected_type: '', color_scheme: '')\n      @text = item[:text]\n      @title = item[:title]\n      @path = item[:path]\n      @tooltip = item[:tooltip]\n      @icon_name = item[:icon_name]\n\n      @color_scheme = color_scheme\n      @connected_type = connected_type\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 15,
              "endLine": 26,
              "code": "    def css_classes\n      css_classes = %w[item-status]\n\n      if connected_type.present?\n        css_classes << 'item-status--connected'\n        css_classes << \"item-status--#{connected_type}\"\n      end\n\n      css_classes << \"item-status--#{color_scheme}\" if color_scheme.present?\n\n      css_classes\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 28,
              "endLine": 30,
              "code": "    def data_attributes\n      {tooltip: @tooltip} if @tooltip.present?\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 34,
              "endLine": 36,
              "code": "    def color_scheme\n      @color_scheme if %w[success error link].include?(@color_scheme)\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 38,
              "endLine": 40,
              "code": "    def connected_type\n      @connected_type if %w[default filled dashed disabled].include?(@connected_type)\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 6,
              "endLine": 13,
              "code": "    def default\n      render Global::ItemStatus.new({\n        text: 'This indicates a status of some sort',\n        path: '#',\n        title: 'Some status',\n        icon_name: 'block-question',\n        tooltip: 'There can be a tooltip on hover.',\n      })\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 15,
              "endLine": 22,
              "code": "    def success\n      render Global::ItemStatus.new({\n        text: 'This indicates a success of some sort',\n        icon_name: 'circle-check',\n        path: '#',\n        title: 'Success',\n      },\n        color_scheme: 'success')\n    end",
              "source": "app/components/global/item_status.rb"
            },
            {
              "startLine": 24,
              "endLine": 31,
              "code": "    def error\n      render Global::ItemStatus.new({\n        text: 'This indicates an error or lack of something',\n        icon_name: 'circle-xmark',\n        path: '#',\n        title: 'Error',\n      },\n        color_scheme: 'error')\n    end",
              "source": "app/components/global/item_status.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/item_status.rb",
              "relevance": 19
            },
            {
              "path": "app/components/global/item_status_preview.rb",
              "relevance": 19
            }
          ]
        }
      },
      "LabeledCopyButton": {
        "type": "ViewComponent",
        "description": "Renders a button with a label and a value, designed for copying the value to the clipboard. It integrates with the client-side `Copy to Clipboard (JS)` component.",
        "interactions": {
          "interaction_0": "Renders a button with `data-behavior='copy-to-clipboard'` and `data-text` attributes for client-side copy functionality."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/labeled_copy_button.rb",
            "app/components/global/labeled_copy_button.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 10,
              "code": "  class LabeledCopyButton < ApplicationComponent     def initialize(label:, value:, button:)       @label = label       @value = value       @button = button     end   end",
              "source": "app/components/global/labeled_copy_button.rb"
            },
            {
              "startLine": 5,
              "endLine": 7,
              "code": "    def default       render Global::LabeledCopyButton.new(label: 'Label', value: 'Value', button: 'Copy me!')     end",
              "source": "app/components/global/labeled_copy_button.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/labeled_copy_button.rb",
              "relevance": 19
            },
            {
              "path": "app/components/global/labeled_copy_button_preview.rb",
              "relevance": 19
            }
          ]
        }
      },
      "LinkItem": {
        "type": "ViewComponent",
        "description": "Renders a list item containing a link. It supports options for active state, title, target attribute (e.g., `_blank`), and an optional Font Awesome icon.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/link_item.rb",
            "app/components/global/link_item.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 10,
              "code": "    def initialize(text:, href:, active: false, title: nil, target: nil, icon_class: nil)\n      @text = text\n      @href = href\n      @active = active\n      @title = title\n      @target = target\n      @icon_class = icon_class\n    end",
              "source": "app/components/global/link_item.rb"
            },
            {
              "startLine": 14,
              "endLine": 14,
              "code": "    def css_classes\n      @active ? 'active' : ''\n    end",
              "source": "app/components/global/link_item.rb"
            },
            {
              "startLine": 17,
              "endLine": 17,
              "code": "    def title\n      @title.presence || @text\n    end",
              "source": "app/components/global/link_item.rb"
            },
            {
              "startLine": 20,
              "endLine": 20,
              "code": "    def target\n      @target.presence\n    end",
              "source": "app/components/global/link_item.rb"
            },
            {
              "startLine": 23,
              "endLine": 23,
              "code": "    def rel\n      target == '_blank' ? 'noopener' : ''\n    end",
              "source": "app/components/global/link_item.rb"
            },
            {
              "startLine": 26,
              "endLine": 26,
              "code": "    def icon?\n      @icon_class.present?\n    end",
              "source": "app/components/global/link_item.rb"
            },
            {
              "startLine": 29,
              "endLine": 29,
              "code": "    def icon\n      Global::FaIcon.new(@icon_class)\n    end",
              "source": "app/components/global/link_item.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/link_item.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Meter": {
        "type": "ViewComponent",
        "description": "Renders an HTML `<meter>` element to display a scalar measurement within a known range. It supports a value, optional label, and styling variants (e.g., `info` type, `white` background).",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/meter.rb",
            "app/components/global/meter.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 18,
              "code": "  class Meter < ApplicationComponent     def initialize(value:, label: nil, type: nil, background_color: nil)       @value = value       @label = label       @type = type       @background_color = background_color       @component_id = SecureRandom.uuid     end      attr_reader :value, :label, :component_id      def css_classes       [].tap do |modifiers|         modifiers << 'meter--info' if @type == :info         modifiers << 'meter--white' if @background_color == :white       end     end   end",
              "source": "app/components/global/meter.rb"
            },
            {
              "startLine": 1,
              "endLine": 6,
              "code": ".meter id=component_id class=css_classes   meter value=value max=100   - if label     label.meter__label for=component_id       = label",
              "source": "app/components/global/meter.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/meter.rb",
              "relevance": 30
            },
            {
              "path": "app/components/global/meter_preview.rb",
              "relevance": 30
            },
            {
              "path": "app/components/global/meter.html.slim",
              "relevance": 11
            }
          ]
        }
      },
      "PageHeader": {
        "type": "ViewComponent",
        "description": "Renders a page header with a main title, optional subtitle, and a slot for a `Pill` component. It supports a 'slim' variant for a more compact appearance and allows additional custom content.",
        "interactions": {
          "interaction_0": "Can render a `Global::Pill` component within its structure."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/page_header.rb",
            "app/components/global/page_header.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 17,
              "code": "module Global\n  class PageHeader < ApplicationComponent\n    def initialize(title, lang: nil, type: nil, subtitle: nil)\n      @title = title\n      @lang = lang\n      @type = type\n      @subtitle = subtitle\n    end\n\n    renders_one :pill, Pill\n\n    private\n\n    def css_modifier\n      'pages-header--slim' if @type == :slim\n    end\n  end\nend",
              "source": "app/components/global/page_header.rb"
            },
            {
              "startLine": 10,
              "endLine": 12,
              "code": "    def with_subtitle\n      render Global::PageHeader.new('Quantencomputing Summer School', subtitle: 'Offered by openHPI Team')\n    end",
              "source": "app/components/global/page_header.rb"
            },
            {
              "startLine": 14,
              "endLine": 18,
              "code": "    def with_pill\n      render Global::PageHeader.new('Quantencomputing Summer School', subtitle: 'Offered by openHPI Team') do |c|\n        c.with_pill 'Active course', color: :note\n      end\n    end",
              "source": "app/components/global/page_header.rb"
            },
            {
              "startLine": 20,
              "endLine": 24,
              "code": "    def slim\n      render Global::PageHeader.new('Quantencomputing Summer School', type: :slim, subtitle: 'openHPI Team') do |c|\n        c.with_pill 'Active course', size: :small, color: :note\n      end\n    end",
              "source": "app/components/global/page_header.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/page_header.rb",
              "relevance": 19
            },
            {
              "path": "app/components/global/page_header_preview.rb",
              "relevance": 19
            }
          ]
        }
      },
      "Pill": {
        "type": "ViewComponent",
        "description": "Renders a small, styled text label (a 'pill') with various size (default, small) and color options (note, success, information, error). It's used for displaying short, categorized information.",
        "interactions": {},
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/pill.rb"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 4,
              "endLine": 23,
              "code": "  class Pill < ApplicationComponent\n    def initialize(text, size: nil, color: nil)\n      @text = text\n      @size = size\n      @color = color\n    end\n\n    def call\n      tag.p class: \"pill #{css_modifiers}\" do\n        @text\n      end\n    end\n\n    def css_modifiers\n      [].tap do |modifiers|\n        modifiers << 'pill--small' if @size == :small\n        modifiers << \"pill--#{@color}\" if %i[note success information error].include?(@color)\n      end.join(' ')\n    end\n  end",
              "source": "app/components/global/pill.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/pill.rb",
              "relevance": 30
            },
            {
              "path": "app/components/global/pill_preview.rb",
              "relevance": 30
            }
          ]
        }
      },
      "Slider (JS)": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that controls horizontal scrolling for content sliders. It provides 'scroll left' and 'scroll right' buttons and dynamically hides/shows them based on whether the first/last items are fully visible, using `IntersectionObserver`.",
        "interactions": {
          "interaction_0": "User clicks scroll buttons (`data-slider-target='scroll-button-left/right'`) to scroll content.",
          "interaction_1": "Uses `IntersectionObserver` to monitor visibility of `intersector-left/right` elements within the slider content.",
          "interaction_2": "Dynamically hides/shows scroll buttons based on intersection state."
        },
        "techDebt": [
          "The `getScrollDistance` function has a fallback for `content.clientWidth` being null, which might indicate a race condition or rendering issue that could be addressed more robustly. The `rootMargin` for the `IntersectionObserver` is set to '100% 0% 100% 0%', which might be overly broad if the intention is only to observe the x-axis, potentially leading to unexpected behavior in complex layouts."
        ],
        "provenance": {
          "sources": [
            "app/assets/components/global/slider.js"
          ]
        }
      },
      "Slider (Ruby ViewComponent)": {
        "type": "ViewComponent",
        "description": "Renders a horizontal content slider with navigation buttons. It accepts multiple `item` blocks to populate the slider and supports different visual `variant`s (light, dark, custom). The client-side `Slider (JS)` component provides the interactive scrolling behavior.",
        "interactions": {
          "interaction_0": "Renders HTML elements with `data-controller='slider'` and `data-slider-target` attributes for client-side control."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/slider.rb",
            "app/components/global/slider.html.slim"
          ]
        }
      },
      "SvgIcon": {
        "type": "ViewComponent",
        "description": "Renders an SVG file inline within a `<span>` tag. The path to the SVG file is provided, and a `wrapping_class` can be applied to the `<span>` for styling.",
        "interactions": {
          "interaction_0": "Reads SVG content directly from the file system."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/svg_icon.rb",
            "app/components/global/svg_icon.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 3,
              "endLine": 19,
              "code": "module Global\n  # This component is used to display an svg file inline.\n  # The file path should be provided as a string, or as ruby Pathname object.\n  # The wrapping_class will be added to the wrapping <span> tag's class attribute.\n  class SvgIcon < ApplicationComponent\n    def initialize(path, wrapping_class:)\n      @path = path\n      @wrapping_class = wrapping_class\n    end\n\n    private\n\n    def svg\n      File.read(@path)\n    end\n  end\nend",
              "source": "app/components/global/svg_icon.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/svg_icon.rb",
              "relevance": 19
            }
          ]
        }
      },
      "System Alerts": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that manages the display and dismissal of system alerts. It toggles the `aria-expanded` attribute of a toggle button and sets a `seen_alerts` cookie when the close button is clicked, marking all current alerts as seen.",
        "interactions": {
          "interaction_0": "User clicks the alerts container to expand the toggle button (`aria-expanded=true`).",
          "interaction_1": "User clicks the close button (`data-id='system-alerts__close-btn'`) to collapse the toggle button (`aria-expanded=false`).",
          "interaction_2": "Sets a `seen_alerts` cookie using `js-cookie`."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/assets/components/global/system-alerts.js"
          ]
        }
      },
      "Table": {
        "type": "ViewComponent",
        "description": "Renders a responsive HTML table. It takes an array of hashes for `data` (rows), an array of strings for `headers`, and an optional `title`. If no data is provided, it renders an `Empty` state component.",
        "interactions": {
          "interaction_0": "Renders `State::Empty` if `data` is empty."
        },
        "techDebt": [],
        "provenance": {
          "sources": [
            "app/components/global/table.rb",
            "app/components/global/table.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class Table < ApplicationComponent\n    # @param data [Array<Hash>] table rows as hashes\n    # @param headers [Array<String>] table headers\n    # @param title [String, nil] optional table title\n    def initialize(data:, headers: [], title: nil)\n      @data = data\n      @headers = headers\n      @title = title\n    end\n\n    attr_reader :data, :headers, :title\n  end\nend",
              "source": "app/components/global/table.rb"
            },
            {
              "startLine": 1,
              "endLine": 22,
              "code": "# frozen_string_literal: true\n\nmodule Global\n  class TablePreview < ViewComponent::Preview\n    def default\n      data = [\n        {'age_group' => '18–24', 'global_count' => '1,234', 'global_share' => '12%'},\n        {'age_group' => '25–34', 'global_count' => '2,345', 'global_share' => '23%'},\n        {'age_group' => '35–44', 'global_count' => '1,890', 'global_share' => '19%'},\n        {'age_group' => '45–54', 'global_count' => '1,234', 'global_share' => '12%'},\n      ]\n      headers = ['Age Group', 'Global Count', 'Global Share']\n\n      render Global::Table.new(data: data, headers: headers, title: 'Age Distribution')\n    end\n\n    def empty_data\n      render Global::Table.new(data: [], headers: [], title: 'Empty Data Example')\n    end\n  end\nend",
              "source": "app/components/global/table.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/table.rb",
              "relevance": 30
            },
            {
              "path": "app/components/global/table_preview.rb",
              "relevance": 30
            },
            {
              "path": "app/components/navigation/table_of_contents.rb",
              "relevance": 30
            }
          ]
        }
      },
      "Toggle Menu": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that toggles the `aria-expanded` attribute of elements (`data-behaviour='toggle-menu'`) on click. Optionally, it can adjust the `left` or `right` CSS property of the element to follow the width of the menu it controls.",
        "interactions": {
          "interaction_0": "User clicks an element (`data-behaviour='toggle-menu'`) to toggle its `aria-expanded` state.",
          "interaction_1": "Dynamically sets `style.left` or `style.right` property based on `data-follow-menu` and the controlled menu's `offsetWidth`."
        },
        "techDebt": [
          "Direct manipulation of `element.style.setProperty` can lead to specificity issues if not carefully managed with CSS. The `offsetWidth` calculation might not be accurate in all rendering scenarios or with complex CSS transforms."
        ],
        "provenance": {
          "sources": [
            "app/assets/components/global/toggle-menu.js"
          ]
        }
      },
      "Tooltip (JS)": {
        "type": "UI Component",
        "description": "Client-side JavaScript component that dynamically creates and positions tooltips. It parses `data-tooltip` attributes, which can be a simple string or a JSON object for advanced content, and displays the tooltip on `mouseenter`, hiding it on `mouseleave`.",
        "interactions": {
          "interaction_0": "User hovers over an element with `data-tooltip` attribute.",
          "interaction_1": "Dynamically creates and inserts tooltip content into a container (`data-id='tooltip'`).",
          "interaction_2": "Calculates and sets `top`, `left`, and `--tooltip-arrow-position` CSS properties for accurate positioning."
        },
        "techDebt": [
          "Direct DOM manipulation (`innerHTML`, `style` properties) can be less performant than using CSS classes for state changes, especially for frequent interactions. The `calculatePosition` logic is complex and might be prone to edge cases with different screen sizes or element layouts."
        ],
        "provenance": {
          "sources": [
            "app/assets/components/global/tooltip.js"
          ]
        }
      },
      "Transcript": {
        "type": "UI Component",
        "description": "Client-side JavaScript component providing an interactive transcript for video players. It highlights active cues, scrolls automatically to the current position, and allows users to seek in the video by clicking transcript cues. It supports keyboard navigation.",
        "interactions": {
          "interaction_0": "Receives cues data to `fill()` the transcript.",
          "interaction_1": "Updates active cues (`updateActiveCues()`) based on video playback.",
          "interaction_2": "Scrolls the cue list automatically or manually.",
          "interaction_3": "User clicks a cue (`data-start-time`) to emit a `transcript:seeked` event, seeking the video.",
          "interaction_4": "Supports keyboard navigation (ArrowUp, ArrowDown, Enter) within the cue list."
        },
        "techDebt": [
          "The `scrollLogic` function has multiple `scrollingModes` and `userHasScrolled` flags, which could be simplified for better readability and maintainability. The `centerOfCues` calculation might need adjustments for varying cue heights or complex layouts."
        ],
        "provenance": {
          "sources": [
            "app/assets/components/global/transcript.js"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 28,
              "code": "/**\n * An interactive transcript component\n *\n * Provide the DOM element by rendering the Transcript view component with\n * its initial hidden state:\n *    E.g:  Transcript.new(true)\n * Optional configurations are the empty state message and the \"scroll to\n * position\" button text:\n *    E.g:  Transcript.new(true, empty_msg: 'No data available', scroll_button_text: 'Scroll to current position')\n *\n * Initialize the transcript component passing in the video player element\n * and react to its events with the available transcript methods:\n *    E.g: const transcript = new Transcript(videoWithTranscript);\n */\n\nconst scrollingModes = {\n  MANUAL: 'manual',\n  AUTOMATIC: 'automatic',\n  RESTORE_AUTOMATIC: 'restoreAutomatic',\n};\n\nconst formatTime = (seconds) => {\n  const totalSecs = Math.trunc(seconds);\n  const h = Math.floor(totalSecs / 3600);\n  const m = Math.floor(totalSecs / 60) % 60;\n  const s = totalSecs % 60;\n\n  return [h, m, s]\n    .map((value) => (value < 10 ? `0${value}` : value))\n    ...",
              "source": "app/assets/components/global/transcript.js"
            },
            {
              "startLine": 1,
              "endLine": 10,
              "code": "# frozen_string_literal: true\n\nmodule Video\n  class Transcript < ApplicationComponent\n    def initialize(initial_hidden_state, empty_msg: 'No data available', scroll_button_text: '')\n      @initial_hidden_state = initial_hidden_state\n      @empty_msg = empty_msg\n      @scroll_button_text = scroll_button_text\n    end\n  end\nend\n...",
              "source": "app/assets/components/global/transcript.js"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/assets/components/global/transcript.js",
              "relevance": 30
            },
            {
              "path": "app/components/video/transcript.rb",
              "relevance": 30
            },
            {
              "path": "app/models/certificate/transcript_of_records.rb",
              "relevance": 30
            }
          ]
        }
      },
      "UserAvatar": {
        "type": "ViewComponent",
        "description": "Renders a user's avatar image. It takes a `user_id`, `size` (tiny, small, medium, large, x-large), and an optional `type` (e.g., `rounded`) to apply specific styling. The avatar image URL is generated using a helper.",
        "interactions": {
          "interaction_0": "Generates avatar image URL using `avatar_path` helper."
        },
        "techDebt": [
          "The `SIZE_MAPPING` is duplicated in SCSS and Ruby, which can lead to inconsistencies if not updated in both places. A single source of truth for these values would be beneficial."
        ],
        "provenance": {
          "sources": [
            "app/components/global/user_avatar.rb",
            "app/components/global/user_avatar.html.slim"
          ]
        },
        "codeImplementation": {
          "confidence": 0.95,
          "codeBlocks": [
            {
              "startLine": 1,
              "endLine": 10,
              "code": "module Global\n  class UserAvatar < ApplicationComponent\n    def initialize(user_id, size:, type: nil)\n      raise ArgumentError.new('Unknown size') unless SIZE_MAPPING.key? size\n\n      @user_id = user_id\n      @size = size\n      @type = type\n    end",
              "source": "app/components/global/user_avatar.rb"
            },
            {
              "startLine": 12,
              "endLine": 21,
              "code": "    # Mapping of modifier to px\n    # When changing these values, please also adapt\n    # the respective _profile.scss classes.\n    SIZE_MAPPING = {\n      tiny: 20,\n      small: 30,\n      medium: 40,\n      large: 60,\n      'x-large': 100,\n    }.stringify_keys.freeze",
              "source": "app/components/global/user_avatar.rb"
            },
            {
              "startLine": 23,
              "endLine": 38,
              "code": "    private\n\n    def css_classes\n      classes = %w[user-avatar]\n      classes << type_class.presence\n      classes << size_class.presence\n      classes.compact.join(' ')\n    end\n\n    def type_class\n      # Predefined CSS classes for types: rounded\n      @type ? \"user-avatar--#{@type}\" : ''\n    end\n\n    def size_class\n      @size ? \"user-avatar--#{@size}\" : ''\n    end",
              "source": "app/components/global/user_avatar.rb"
            },
            {
              "startLine": 40,
              "endLine": 41,
              "code": "    def user_avatar_path\n      avatar_path(@user_id, width: size, height: size...",
              "source": "app/components/global/user_avatar.rb"
            }
          ],
          "sourceFiles": [
            {
              "path": "app/components/global/user_avatar.rb",
              "relevance": 19
            }
          ]
        }
      }
    },
    "microservices": {},
    "interactions": {
      "interaction_0": "Includes `FeatureTogglesHelper` for feature flag checks [Source: app/controllers/application_controller.rb]",
      "interaction_1": "Includes `Login` concern for authentication [Source: app/controllers/application_controller.rb]",
      "interaction_2": "Interacts with `Acfs.runner` to clear the queue [Source: app/controllers/application_controller.rb]",
      "interaction_3": "Uses `Xikolo::Common::Auth::Middleware` for authentication [Source: app/controllers/application_controller.rb]",
      "interaction_4": "Interacts with `Xikolo.api(:account)` for user session management [Source: app/controllers/application_controller.rb]",
      "interaction_5": "Sets `Sentry.set_user` for error tracking [Source: app/controllers/application_controller.rb]",
      "interaction_6": "Sets `Mnemosyne::Instrumenter` for tracing errors [Source: app/controllers/errors_controller.rb]",
      "interaction_7": "Uses `I18n.locale` for internationalization [Source: app/controllers/application_controller.rb]",
      "interaction_8": "Utilizes `cookies` for storing and forgetting user location [Source: app/controllers/application_controller.rb]",
      "interaction_9": "Interacts with `ConsentCookie` to manage cookie preferences [Source: app/controllers/cookie_consent_controller.rb]",
      "interaction_10": "Logs exceptions to `::Mnemosyne` [Source: app/controllers/errors_controller.rb]",
      "interaction_11": "Captures exceptions with `Sentry` [Source: app/controllers/errors_controller.rb]",
      "interaction_12": "Uses `I18n.t` for localized error messages [Source: app/controllers/errors_controller.rb, config/locales/en.yml, config/locales/de.yml]",
      "interaction_13": "Fetches user data from `Xikolo::Account::User` [Source: app/controllers/files_controller.rb]",
      "interaction_14": "Uses `Imagecrop.transform` for image manipulation [Source: app/controllers/files_controller.rb]",
      "interaction_15": "Redirects to `view_context.image_url` for default images [Source: app/controllers/files_controller.rb]",
      "interaction_16": "Serves `logo.png` and `favicon.ico` as described in branding documentation [Source: app/controllers/files_controller.rb, docs/app/development/branding/images.md]",
      "interaction_17": "Uses `Xikolo::Common::Tracking::ExternalLink` for safe external redirects [Source: app/controllers/home/go_controller.rb]",
      "interaction_18": "Interacts with `Xikolo.api(:course)` and `Xikolo.api(:pinboard)` for deep linking [Source: app/controllers/home/go_controller.rb]",
      "interaction_19": "Integrates with `Xikolo.config.limesurvey_url` for survey redirects [Source: app/controllers/home/go_controller.rb]",
      "interaction_20": "Uses `current_user` to add pseudo ID to survey query params [Source: app/controllers/home/go_controller.rb]",
      "interaction_21": "Checks `feature?('announcements')` and `Xikolo.api?(:news)` for news integration [Source: app/controllers/home/home_controller.rb]",
      "interaction_22": "Uses `Rails.application.config.homepage_course_loader`, `homepage_topics_loader`, `homepage_video_loader` for dynamic content loading [Source: app/controllers/home/home_controller.rb, docs/app/development/branding/homepage.md]",
      "interaction_23": "Interacts with `Xikolo.api(:news)` to fetch announcements [Source: app/controllers/home/home_controller.rb]",
      "interaction_24": "Captures exceptions with `Sentry` and `Mnemosyne` for API errors [Source: app/controllers/home/home_controller.rb]",
      "interaction_25": "Interacts with the `Page` model to retrieve page content and translations [Source: app/controllers/home/pages_controller.rb, app/models/page.rb]",
      "interaction_26": "Uses `PagePresenter` to format page data for views [Source: app/controllers/home/pages_controller.rb]",
      "interaction_27": "Checks `current_user.allowed?('helpdesk.page.store')` for administrative access [Source: app/controllers/home/pages_controller.rb]",
      "interaction_28": "Requires `ical_feed` feature [Source: app/controllers/ical_controller.rb]",
      "interaction_29": "Fetches `next_dates` from `Xikolo.api(:course)` [Source: app/controllers/ical_controller.rb]",
      "interaction_30": "Uses `User.find` from `Xikolo::Account` to retrieve user language [Source: app/controllers/ical_controller.rb]",
      "interaction_31": "Utilizes `IcalHelper` for generating iCal hashes [Source: app/controllers/ical_controller.rb, app/helpers/ical_helper.rb]",
      "interaction_32": "Constructs iCalendar events using `Icalendar` gem [Source: app/controllers/ical_controller.rb]",
      "interaction_33": "Requires `quiz_recap` feature [Source: app/controllers/learning_mode_controller.rb]",
      "interaction_34": "Uses `CourseContextHelper` for course-specific context [Source: app/controllers/learning_mode_controller.rb]",
      "interaction_35": "Interacts with `Xikolo::Course::Item` to find quiz items [Source: app/controllers/learning_mode_controller.rb]",
      "interaction_36": "Uses `I18n.t` for flash messages [Source: app/controllers/learning_mode_controller.rb, config/locales/en.yml, config/locales/de.yml]",
      "interaction_37": "Requires `helpdesk.page.store` permission [Source: app/controllers/pages_controller.rb]",
      "interaction_38": "Interacts with the `Page` model for content management [Source: app/controllers/pages_controller.rb, app/models/page.rb]",
      "interaction_39": "Uses `Xikolo::S3::TextWithUploadsProcessor` for S3 file uploads within page content [Source: app/controllers/pages_controller.rb, Foundational Context]",
      "interaction_40": "Queues `S3FileDeletionJob` for obsolete S3 files [Source: app/controllers/pages_controller.rb]",
      "interaction_41": "Requires `ensure_logged_in` before actions [Source: app/controllers/users_controller.rb]",
      "interaction_42": "Authorizes `account.user.delete` and `account.user.change_password` permissions [Source: app/controllers/users_controller.rb]",
      "interaction_43": "Interacts with `Xikolo.api(:account)` for user data and password changes [Source: app/controllers/users_controller.rb]",
      "interaction_44": "Interacts with `Xikolo.api(:course)` for teacher information [Source: app/controllers/users_controller.rb]",
      "interaction_45": "Uses `UserProfilePresenter` and `UserPresenter` for data presentation [Source: app/controllers/users_controller.rb]",
      "interaction_46": "Uses `SessionHelper` for logout functionality [Source: app/controllers/users_controller.rb, app/helpers/session_helper.rb]",
      "interaction_47": "Uses `I18n.t` for flash messages [Source: app/controllers/users_controller.rb, config/locales/en.yml, config/locales/de.yml]",
      "interaction_48": "Checks `WebManifest.configured?` before rendering [Source: app/controllers/web_manifest_controller.rb]",
      "interaction_49": "Uses `Xikolo.config.site_name` for manifest name [Source: app/controllers/web_manifest_controller.rb]",
      "interaction_50": "Retrieves icons, related applications, and background color from `WebManifest` [Source: app/controllers/web_manifest_controller.rb]",
      "interaction_51": "Uses `BrowserSupport` to detect browser capabilities [Source: app/helpers/application_helper.rb]",
      "interaction_52": "Interacts with `cookies` to manage browser warning visibility [Source: app/helpers/application_helper.rb]",
      "interaction_53": "Uses `Imagecrop.transform` for image manipulation [Source: app/helpers/application_helper.rb]",
      "interaction_54": "Retrieves Sentry trace propagation meta tags from `Sentry` [Source: app/helpers/application_helper.rb]",
      "interaction_55": "Interacts with `Xikolo::Account::Token` to create user tokens [Source: app/helpers/ical_helper.rb]",
      "interaction_56": "Uses `Digest::SHA256` for hash generation [Source: app/helpers/ical_helper.rb]",
      "interaction_57": "Uses `UUID` for user ID formatting [Source: app/helpers/ical_helper.rb]",
      "interaction_58": "Constructs URLs using `Xikolo.base_url` [Source: app/helpers/ical_helper.rb]",
      "interaction_59": "Uses `Redcarpet::Markdown` for Markdown rendering [Source: app/helpers/markdown_helper.rb]",
      "interaction_60": "Uses `Sanitize.fragment` with `SANITIZE_CONFIG` for HTML sanitization [Source: app/helpers/markdown_helper.rb]",
      "interaction_61": "Interacts with `Xikolo::Common::Tracking::ExternalLink` for external link tracking [Source: app/helpers/markdown_helper.rb]",
      "interaction_62": "Uses `URI` and `Addressable::URI` for URL parsing and manipulation [Source: app/helpers/markdown_helper.rb]",
      "interaction_63": "Logs errors with `Rails.logger` [Source: app/helpers/markdown_helper.rb]",
      "interaction_64": "Interacts with `Xikolo.api(:account)` to delete user sessions [Source: app/helpers/session_helper.rb]",
      "interaction_65": "Captures exceptions with `Sentry` and `Mnemosyne` for API errors during logout [Source: app/helpers/session_helper.rb]",
      "interaction_66": "Manages `session` state, including `saml_uid`, `saml_session_index`, and `saml_provider` for SLO [Source: app/helpers/session_helper.rb]",
      "interaction_67": "Uses `OMNIAUTH_LOGOUT` for SAML provider checks [Source: app/helpers/session_helper.rb]",
      "interaction_68": "Uses `UUID4` for UUID conversion and parameterization [Source: app/helpers/uuid_helper.rb]",
      "interaction_69": "Includes `ActionView::Helpers` [Source: app/helpers/view_methods_helper.rb]",
      "interaction_70": "Extends `SanitizeHelper::ClassMethods` [Source: app/helpers/view_methods_helper.rb]",
      "interaction_71": "Provides `Rails.application.routes.url_helpers` [Source: app/helpers/view_methods_helper.rb]",
      "interaction_72": "Uses `Xikolo::S3::Markup` for the `text` attribute, integrating with S3 for file uploads [Source: app/models/page.rb, Foundational Context]",
      "interaction_73": "Manages `has_many` associations for `translations` and `other_translations` [Source: app/models/page.rb]",
      "interaction_74": "Validates `name`, `title`, `text`, and `locale` [Source: app/models/page.rb]",
      "interaction_75": "Provides `preferred_locales` class method for ordering translations [Source: app/models/page.rb]",
      "interaction_76": "Includes `Rails.application.routes.url_helpers` and `ActionView::Helpers::UrlHelper` for link generation [Source: app/presenters/menu_with_permissions.rb]",
      "interaction_77": "Checks user permissions via `user.allowed?` [Source: app/presenters/menu_with_permissions.rb]",
      "interaction_78": "Uses `I18n.t` for menu item text localization [Source: app/presenters/menu_with_permissions.rb]",
      "interaction_79": "Extends `MenuWithPermissions` [Source: app/presenters/platform_dashboard_nav.rb]",
      "interaction_80": "Defines menu items for 'Dashboard' and 'News' with `user.allowed?('global.dashboard.show')` permission checks [Source: app/presenters/platform_dashboard_nav.rb]",
      "interaction_81": "Extends `PaginationRenderer` [Source: lib/ajax_pagination_renderer.rb]",
      "interaction_82": "Includes `ActionView::Helpers::OutputSafetyHelper` [Source: lib/pagination_renderer.rb]",
      "interaction_83": "Uses `I18n.t` for localized pagination texts [Source: lib/pagination_renderer.rb, config/locales/en.yml, config/locales/de.yml]",
      "interaction_84": "Uses `Addressable::URI` for URL parsing and normalization [Source: lib/redirect_url.rb]",
      "interaction_85": "Requires `xfn/ready` for DOM readiness [Source: app/assets/javascripts/application.js]",
      "interaction_86": "Requires `jquery2` for DOM manipulation [Source: app/assets/javascripts/application.js]",
      "interaction_87": "Requires `bootstrap-sprockets.js` for Bootstrap functionality [Source: app/assets/javascripts/application.js]",
      "interaction_88": "Interacts with `document.readyState` and `document.addEventListener('DOMContentLoaded')` [Source: app/assets/javascripts/xfn/ready.js]",
      "interaction_89": "Imports `form-request-submit-polyfill` [Source: app/assets/main.js]",
      "interaction_90": "Initializes `Rails` UJS [Source: app/assets/main.js]",
      "interaction_91": "Imports various form actions (e.g., `autosubmit`, `change-handler`, `hide-on-submit`) [Source: app/assets/main.js]",
      "interaction_92": "Imports numerous global UI components (e.g., `accordion`, `tooltip`, `cookie-consent-banner`, `markdown-editor`, `slider`, `system-alerts`) [Source: app/assets/main.js]",
      "interaction_93": "Imports utility functions (e.g., `upload`, `mdupload`, `get-relative-time`) [Source: app/assets/main.js]",
      "interaction_94": "Imports `stylesheets/theme` for brand-specific styling [Source: app/assets/main.scss, docs/app/development/branding/stylesheets.md]",
      "interaction_95": "Imports `stylesheets/global` for general application styles [Source: app/assets/main.scss, docs/app/development/branding/stylesheets.md]",
      "interaction_96": "Renders `Global::AccordionSection` components as its sections [Source: app/components/global/accordion.rb, app/components/global/accordion_section.rb]",
      "interaction_97": "Uses `data-controller='accordion'` for JavaScript interaction [Source: app/components/global/accordion.html.slim]",
      "interaction_98": "Renders `Global::FaIcon` for the expand/collapse indicators [Source: app/components/global/accordion_section.html.slim, app/components/global/fa_icon.rb]",
      "interaction_99": "Uses `data-accordion-target='toggle-button'` for JavaScript interaction [Source: app/components/global/accordion_section.html.slim]",
      "interaction_100": "Renders `Global::FaIcon` for the dropdown control icon [Source: app/components/global/actions_dropdown.html.slim, app/components/global/fa_icon.rb]",
      "interaction_101": "Uses `data-behaviour='dropdown'` and `data-behaviour='menu-dropdown'` for JavaScript interaction [Source: app/components/global/actions_dropdown.html.slim]",
      "interaction_102": "Uses `I18n.t` for `aria_label` localization [Source: app/components/global/actions_dropdown.rb, config/locales/en.yml, config/locales/de.yml]",
      "interaction_103": "Renders `Global::FaIcon` for the message indicator [Source: app/components/global/callout.html.slim, app/components/global/fa_icon.rb]",
      "interaction_104": "Interacts with `ConsentCookie` to get current consent status [Source: app/components/global/cookie_consent_banner.rb]",
      "interaction_105": "Uses `Translations` to render consent text [Source: app/components/global/cookie_consent_banner.rb]",
      "interaction_106": "Submits a form to `cookie_consent_path` [Source: app/components/global/cookie_consent_banner.html.slim]",
      "interaction_107": "Renders `Global::FaIcon` for the close button [Source: app/components/global/cookie_consent_banner.html.slim, app/components/global/fa_icon.rb]",
      "interaction_108": "Uses `I18n.t` for button labels [Source: app/components/global/cookie_consent_banner.html.slim, config/locales/en.yml, config/locales/de.yml]",
      "interaction_109": "Uses `data-behavior='copy-to-clipboard'` for JavaScript interaction [Source: app/components/global/copy_to_clipboard.html.slim]",
      "interaction_110": "Renders `Global::FaIcon` for the copy icon [Source: app/components/global/copy_to_clipboard.html.slim, app/components/global/fa_icon.rb]",
      "interaction_111": "Uses `I18n.t` for `aria-label` localization [Source: app/components/global/copy_to_clipboard.html.slim, config/locales/en.yml, config/locales/de.yml]",
      "interaction_112": "Fetches `Banner.current` from the database [Source: app/components/global/course_list_banner.rb]",
      "interaction_113": "Uses `Rails.cache.fetch` for server-side caching of banner data [Source: app/components/global/course_list_banner.rb, docs/app/features/course_list_banner.md]",
      "interaction_114": "Uses `image_tag` and `link_to` for rendering [Source: app/components/global/course_list_banner.html.slim]",
      "interaction_115": "Reads custom HTML snippets from `Xikolo.config.custom_html` [Source: app/components/global/custom_head_snippets.rb]",
      "interaction_116": "Uses `Global::CustomHeadSnippets::Requirements` to evaluate snippet conditions, including `CookieConsent` [Source: app/components/global/custom_head_snippets.rb]",
      "interaction_117": "Interacts with `ConsentCookie` for cookie consent checks [Source: app/components/global/custom_head_snippets.rb]",
      "interaction_118": "Renders `Global::FaIcon` for the open/closed state indicators [Source: app/components/global/disclosure_widget.html.slim, app/components/global/fa_icon.rb]",
      "interaction_119": "Renders `Global::FaIcon` if the button type is `:download` [Source: app/components/global/download_button.html.slim, app/components/global/fa_icon.rb]",
      "interaction_120": "Renders `Global::FaIcon` for filter and reset icons [Source: app/components/global/filter_bar/controls.html.slim, app/components/global/fa_icon.rb]",
      "interaction_121": "Renders `Global::Pill` for displaying the results count [Source: app/components/global/filter_bar/controls.html.slim, app/components/global/pill.rb]",
      "interaction_122": "Uses `I18n.t` for localization of text elements [Source: app/components/global/filter_bar/controls.rb, config/locales/en.yml, config/locales/de.yml]",
      "interaction_123": "Uses `select_tag` and `hidden_field_tag` for form elements [Source: app/components/global/filter_bar/filter.html.slim]",
      "interaction_124": "Uses `I18n.t` for localization of blank options and disabled text [Source: app/components/global/filter_bar/filter.rb, config/locales/en.yml, config/locales/de.yml]",
      "interaction_125": "Uses `text_field_tag` for the search input [Source: app/components/global/filter_bar/search.html.slim]",
      "interaction_126": "Renders `Global::FaIcon` for search and clear buttons [Source: app/components/global/filter_bar/search.html.slim, app/components/global/fa_icon.rb]",
      "interaction_127": "Uses `I18n.t` for localization of labels and button texts [Source: app/components/global/filter_bar/search.html.slim, config/locales/en.yml, config/locales/de.yml]",
      "interaction_128": "Renders `Global::FlashMessage` for standard flash messages [Source: app/components/global/flash_block.html.slim, app/components/global/flash_message.rb]",
      "interaction_129": "Renders `Global::FlashLayer` for SweetAlert2-style flash layers [Source: app/components/global/flash_block.html.slim, app/components/global/flash_layer.rb]",
      "interaction_130": "Injects JavaScript to call `xuiSwal.fire` (SweetAlert2) [Source: app/components/global/flash_layer.html.slim]",
      "interaction_131": "Uses `ready` function for DOM readiness [Source: app/components/global/flash_layer.html.slim, app/assets/javascripts/xfn/ready.js]",
      "interaction_132": "Renders `Global::FaIcon` for the message icon and close button [Source: app/components/global/flash_message.html.slim, app/components/global/fa_icon.rb]",
      "interaction_133": "Uses `data-hide-on-click` for JavaScript interaction to dismiss the message [Source: app/components/global/flash_message.html.slim]",
      "interaction_134": "Uses `I18n.t` for the close button's `aria-label` [Source: app/components/global/flash_message.html.slim, config/locales/en.yml, config/locales/de.yml]",
      "interaction_135": "Renders `Global::BasicTooltip` [Source: app/components/global/headline_tooltip.html.slim, app/components/global/basic_tooltip.rb]",
      "interaction_136": "Renders `Global::FaIcon` for the button icon [Source: app/components/global/helpdesk_button.html.slim, app/components/global/fa_icon.rb]",
      "interaction_137": "Renders `State::Loading` while the helpdesk panel content loads [Source: app/components/global/helpdesk_button.html.slim]",
      "interaction_138": "Uses `I18n.t` for button labels and `aria-label` [Source: app/components/global/helpdesk_button.html.slim, config/locales/en.yml, config/locales/de.yml]",
      "interaction_139": "Checks `user.feature?` to determine chatbot version [Source: app/components/global/helpdesk_button.rb]",
      "interaction_140": "Interacts with `Xikolo::Common::Auth::CurrentUser` [Source: app/components/global/helpdesk_button.rb]",
      "interaction_141": "Renders `Global::FaIcon` for the status icon [Source: app/components/global/item_status.html.slim, app/components/global/fa_icon.rb]",
      "interaction_142": "Uses `data-behavior='copy-to-clipboard'` for JavaScript interaction [Source: app/components/global/labeled_copy_button.html.slim]",
      "interaction_143": "Renders `Global::FaIcon` if an icon class is provided [Source: app/components/global/link_item.html.slim, app/components/global/fa_icon.rb]",
      "interaction_144": "Renders `Global::Pill` if a pill is provided [Source: app/components/global/page_header.rb, app/components/global/pill.rb]",
      "interaction_145": "Renders `Global::FaIcon` for scroll buttons [Source: app/components/global/slider.html.slim, app/components/global/fa_icon.rb]",
      "interaction_146": "Uses `data-controller='slider'` and `data-slider-target` for JavaScript interaction [Source: app/components/global/slider.html.slim]",
      "interaction_147": "Uses `I18n.t` for scroll button `aria-label` [Source: app/components/global/slider.html.slim, config/locales/en.yml, config/locales/de.yml]",
      "interaction_148": "Reads SVG content from a file path [Source: app/components/global/svg_icon.rb]",
      "interaction_149": "Renders `State::Empty` if no data is provided [Source: app/components/global/table.html.slim]",
      "interaction_150": "Uses `I18n.t` for the 'no data' message [Source: app/components/global/table.html.slim, config/locales/en.yml, config/locales/de.yml]",
      "interaction_151": "Uses `avatar_path` helper to construct the image URL [Source: app/components/global/user_avatar.rb]",
      "interaction_152": "Processes files from `app/assets` based on module-specific entry points.",
      "interaction_153": "Utilizes `babel-loader` for JavaScript/TypeScript transpilation.",
      "interaction_154": "Uses `sass-loader` for Sass compilation and `postcss-loader` for CSS post-processing.",
      "interaction_155": "Outputs bundled assets to `public/assets` and generates a manifest file for Rails integration.",
      "interaction_156": "Integrated with `Yarn` for script execution (e.g., `yarn build`).",
      "interaction_157": "Installs packages defined in `package.json`.",
      "interaction_158": "Executes various frontend-related scripts defined in `package.json` (e.g., `build`, `start`, `format`, `lint`).",
      "interaction_159": "Components are rendered within Rails views (e.g., `.html.slim` templates) using the `render` helper.",
      "interaction_160": "Integrates with `lookbook` for cataloging, documenting, and previewing component variants.",
      "interaction_161": "Components are unit-tested using `RSpec` with specific test helpers provided by the library.",
      "interaction_162": "Renders dynamic content in the user's browser.",
      "interaction_163": "Code is written in TypeScript and transpiled by Babel via Webpack.",
      "interaction_164": "Likely interacts with Rails-generated HTML and API endpoints for data exchange.",
      "interaction_165": "TypeScript code is transpiled to JavaScript by `Babel` as part of the Webpack build process.",
      "interaction_166": "Linted by `ESLint` to enforce coding standards and type-related rules.",
      "interaction_167": "Compiler options are defined in `tsconfig.json`.",
      "interaction_168": "Sass files are compiled by `sass-embedded` via `sass-loader` within the Webpack pipeline.",
      "interaction_169": "Compiled CSS is then processed by `PostCSS`.",
      "interaction_170": "Linted by `Stylelint` to enforce styling conventions.",
      "interaction_171": "Processes CSS output from `Sass` compilation via `postcss-loader` in the Webpack pipeline.",
      "interaction_172": "Runs as part of the `lint:js` script and `lint-staged` pre-commit hook.",
      "interaction_173": "Configured via `eslint.config.mjs`, extending recommended rules for JavaScript and TypeScript.",
      "interaction_174": "Ignores legacy JavaScript assets in `app/assets/javascripts` and `vendor/assets/javascripts`.",
      "interaction_175": "Runs as part of the `lint:css` script and `lint-staged` pre-commit hook.",
      "interaction_176": "Configured via `.stylelintrc.js`, extending recommended SCSS, idiomatic order, and BEM conventions.",
      "interaction_177": "Includes specific rules to handle `ruby-sass` compiler limitations for CSS Color Level 4.",
      "interaction_178": "Runs as part of `format` and `lint:format` scripts, and `lint-staged` pre-commit hook.",
      "interaction_179": "Configured via `.prettierrc.yml` with specific overrides for SCSS and YAML/YML files.",
      "interaction_180": "Used in client-side JavaScript code for displaying localized text.",
      "interaction_181": "The `I18n` global variable is exposed and marked as `readonly` in ESLint configuration.",
      "interaction_182": "Used within the application to embed and manage video playback.",
      "interaction_183": "Managed as a Node.js dependency via `Yarn`.",
      "interaction_184": "Follows semantic versioning and has a dedicated release process on GitHub and npmjs.org.",
      "interaction_185": "Interacts with ApplicationComponent (implicitly, as custom inputs are rendered within views).",
      "interaction_186": "Uses I18n for internationalization of labels, hints, and errors.",
      "interaction_187": "Integrates with custom input classes (e.g., ToggleSwitchInput, MarkdownInput, DatepickerInput, UploadInput).",
      "interaction_188": "Leverages ActionView for helper modules.",
      "interaction_189": "Renders Global::FaIcon for UI elements.",
      "interaction_190": "Emits JavaScript events (via data-behavior attributes) for client-side sorting, adding, and deleting.",
      "interaction_191": "Can interact with a backend API for auto-completion if select_config is provided.",
      "interaction_192": "Receives list_items, name, input_id, and select_config as initialization parameters.",
      "interaction_193": "Prepends to SimpleForm::Inputs::Base.",
      "interaction_194": "Uses I18n for translation and interpolation.",
      "interaction_195": "Includes into SimpleForm::FormBuilder.",
      "interaction_196": "Integrated into SimpleForm's wrapper configuration.",
      "interaction_197": "Included into ActionView.",
      "interaction_198": "Inspects SimpleForm's default wrapper configuration.",
      "interaction_199": "Included into ActionView.",
      "interaction_200": "Uses SecureRandom.uuid for unique element IDs.",
      "interaction_201": "Uses I18n for button text.",
      "interaction_202": "Relies on frontend JavaScript (via data-behavior='toggle-visibility') for functionality.",
      "interaction_203": "Reads content_type and other input values from the DOM.",
      "interaction_204": "Modifies DOM elements to show/hide form sections.",
      "interaction_205": "Selects and appends templates from app/views/items/_form_wrapper.html.slim.",
      "interaction_206": "Attaches event listeners to form inputs.",
      "interaction_207": "Inherited by `PrivatePresenter` and other presenter classes.",
      "interaction_208": "Inherits from `Presenter`.",
      "interaction_209": "Extends child classes with `Preloading` module.",
      "interaction_210": "Uses `Preloading::Preloader` internally for data loading.",
      "interaction_211": "Inherited by `IconNavigationPresenter` and `CoursePresenter` (via `CourseInfoPresenter`).",
      "interaction_212": "Used by `PrivatePresenter` and its descendants via the `load` method to fetch associated data efficiently.",
      "interaction_213": "Used by views or layouts to render the breadcrumb navigation.",
      "interaction_214": "Inherits from `PrivatePresenter`.",
      "interaction_215": "Used by views or layouts to render dynamic icon navigation menus.",
      "interaction_216": "Delegates to the `course` object for core data.",
      "interaction_217": "Uses `ActionView::Helpers::TagHelper` and `ActionView::Context` for HTML generation within the presenter.",
      "interaction_218": "Interacts with `PublicCoursePage` for URL generation.",
      "interaction_219": "Reads configuration from `Xikolo.config` for feature flags (e.g., `recalculation_enabled?`).",
      "interaction_220": "Inherits from `CourseInfoPresenter` (which is likely a `PrivatePresenter` descendant).",
      "interaction_221": "Uses `I18n.t` for translations. [Source: docs/app/development/frontend/html_styleguide.md]",
      "interaction_222": "Reads configuration from `Xikolo.config`.",
      "interaction_223": "Intended to be included in the main application layout for site-wide tracking.",
      "interaction_224": "Interacts with the DOM to find and hide the warning alert element (`[data-browser-warning=\"alert\"]`). [Source: app/assets/components/global/browser-warning.js]",
      "interaction_225": "Uses `js-cookie` to set a cookie (`_browser_warning`) with a 365-day expiration. [Source: app/assets/components/global/browser-warning.js]",
      "interaction_226": "Receives a `browser` object (likely from the `browser` gem) upon initialization and queries its properties (e.g., `bot?`, `ie?`, `edge?`, `version`, `platform.mac?`, `webkit?`, `firefox?`) to perform compatibility checks. [Source: lib/browser_support.rb]",
      "interaction_227": "Uses Babel for JavaScript/TypeScript transpilation.",
      "interaction_228": "Uses Sass-embedded and Sass-loader for SCSS compilation.",
      "interaction_229": "Uses PostCSS and PostCSS-loader for CSS post-processing.",
      "interaction_230": "Integrates with MiniCssExtractPlugin for extracting CSS into separate files.",
      "interaction_231": "Uses TerserWebpackPlugin for JavaScript minification and CompressionWebpackPlugin for asset compression.",
      "interaction_232": "Generates asset manifests via WebpackAssetsManifest.",
      "interaction_233": "Integrated into Webpack via `babel-loader`.",
      "interaction_234": "Uses `@babel/preset-env` for environment-specific transformations and `@babel/preset-typescript` for TypeScript support.",
      "interaction_235": "Integrated into Webpack via `sass-loader`.",
      "interaction_236": "Output is further processed by PostCSS.",
      "interaction_237": "Adheres to a strict CSS styleguide including BEM notation and mobile-first approach. [Source: docs/app/development/frontend/CSS/css_styleguide.md]",
      "interaction_238": "Integrated into Webpack via `postcss-loader`.",
      "interaction_239": "Processes output from Sass.",
      "interaction_240": "Transpiled by Babel.",
      "interaction_241": "Configuration defined in `tsconfig.json`.",
      "interaction_242": "Uses `typescript-eslint` for linting.",
      "interaction_243": "Provides global type declarations via `app/assets/global.d.ts`.",
      "interaction_244": "Runs as a pre-commit hook via Husky and lint-staged.",
      "interaction_245": "Uses `typescript-eslint` for TypeScript specific rules.",
      "interaction_246": "Runs as a pre-commit hook via Husky and lint-staged.",
      "interaction_247": "Coexists with Webpack for asset management.",
      "interaction_248": "Can still be used for existing jQuery plugins, but new code should avoid it.",
      "interaction_249": "Components are bundled by Webpack and transpiled by Babel.",
      "interaction_250": "Receives data from the Rails backend.",
      "interaction_251": "Accessed by frontend JavaScript/TypeScript code.",
      "interaction_252": "Runs Prettier for formatting.",
      "interaction_253": "Executes ESLint for JavaScript/TypeScript.",
      "interaction_254": "Executes Stylelint for CSS/SCSS.",
      "interaction_255": "Executes Markdownlint for Markdown files.",
      "interaction_256": "Integrates with Ruby linters like Rubocop and Slim-lint.",
      "interaction_257": "Includes `FeatureTogglesHelper` for feature flag checks. [Source: app/controllers/application_controller.rb]",
      "interaction_258": "Includes `Login` module for authentication logic. [Source: app/controllers/application_controller.rb]",
      "interaction_259": "Includes `Locale` module for internationalization. [Source: app/controllers/application_controller.rb]",
      "interaction_260": "Includes `Status` module for specific error classes and handling. [Source: app/controllers/application_controller.rb]",
      "interaction_261": "Interacts with `Acfs.runner` to clear the ACFS queue. [Source: app/controllers/application_controller.rb]",
      "interaction_262": "Uses `Xikolo::Common::Auth::Middleware` for authentication processing. [Source: app/controllers/application_controller.rb]",
      "interaction_263": "Interacts with `Xikolo.api(:account)` to manage user sessions. [Source: app/controllers/application_controller.rb]",
      "interaction_264": "Sets user context for `Sentry` for error tracking. [Source: app/controllers/application_controller.rb]",
      "interaction_265": "Manages `cookies.signed[:stored_location]` for post-login redirects. [Source: app/controllers/application_controller.rb]",
      "interaction_266": "Provides `helper_method :current_user` to make `current_user` available in views. [Source: app/controllers/application_controller.rb]",
      "interaction_267": "Uses `BrowserSupport` to determine browser compatibility. [Source: app/helpers/application_helper.rb]",
      "interaction_268": "Interacts with `Imagecrop` for image URL transformations. [Source: app/helpers/application_helper.rb]",
      "interaction_269": "Retrieves trace propagation meta tags from `Sentry`. [Source: app/helpers/application_helper.rb]",
      "interaction_270": "Checks `cookies[:_browser_warning]` to hide browser warnings. [Source: app/helpers/application_helper.rb]",
      "interaction_271": "Requires `xfn/ready` for document ready events. [Source: app/assets/javascripts/application.js]",
      "interaction_272": "Requires `jquery2` for DOM manipulation and AJAX. [Source: app/assets/javascripts/application.js]",
      "interaction_273": "Requires `bootstrap-sprockets.js` for Bootstrap 3 JavaScript functionalities. [Source: app/assets/javascripts/application.js]",
      "interaction_274": "Imports `form-request-submit-polyfill` for browser compatibility. [Source: app/assets/main.js]",
      "interaction_275": "Initializes `@rails/ujs` for unobtrusive JavaScript features. [Source: app/assets/main.js]",
      "interaction_276": "Imports various global UI components (e.g., `accordion`, `tooltip`, `cookie-consent-banner`) and form actions (e.g., `autosubmit`, `hide-on-submit`). [Source: app/assets/main.js]",
      "interaction_277": "Imports `stylesheets/theme` to load theme-specific variables and styles first. [Source: app/assets/main.scss, docs/app/development/branding/stylesheets.md]",
      "interaction_278": "Imports `stylesheets/global` to load general application styles. [Source: app/assets/main.scss, docs/app/development/branding/stylesheets.md]",
      "interaction_279": "Imports `theme/color_schema` for color definitions. [Source: app/assets/stylesheets/_theme.scss, docs/app/development/branding/stylesheets.md]",
      "interaction_280": "Imports `theme/common/variables` for shared SCSS variables. [Source: app/assets/stylesheets/_theme.scss, docs/app/development/branding/stylesheets.md]",
      "interaction_281": "Imports `theme/common/helpers` for SASS mixins and functions. [Source: app/assets/stylesheets/_theme.scss, docs/app/development/branding/stylesheets.md]",
      "interaction_282": "Imports `theme/design` for common design parts. [Source: app/assets/stylesheets/_theme.scss, docs/app/development/branding/stylesheets.md]",
      "interaction_283": "Imports `bs-variables` for Bootstrap 3 variable overrides. [Source: app/assets/stylesheets/_global.scss]",
      "interaction_284": "Imports `libs` for external library styles. [Source: app/assets/stylesheets/_global.scss]",
      "interaction_285": "Imports `controllers/sections` and `controllers/account` (legacy controller-specific styles). [Source: app/assets/stylesheets/_global.scss]",
      "interaction_286": "Imports `partials` for legacy UI component styles. [Source: app/assets/stylesheets/_global.scss]",
      "interaction_287": "Imports `components` for modern UI component styles. [Source: app/assets/stylesheets/_global.scss]",
      "interaction_288": "Imports `util/swal` for SweetAlert styles. [Source: app/assets/stylesheets/_global.scss]",
      "interaction_289": "Defines and overrides Bootstrap 3.4.1 variables, influencing the styling of elements that still rely on Bootstrap. [Source: app/assets/stylesheets/_bs-variables.scss]",
      "interaction_290": "Uses `sass:color` and `sass:math` functions for color adjustments and calculations. [Source: app/assets/stylesheets/_bs-variables.scss]",
      "interaction_291": "Imports styles for various global components (e.g., `accordion`, `tooltip`, `cookie_consent_banner`). [Source: app/assets/stylesheets/_components.scss]",
      "interaction_292": "Imports styles for navigation components (e.g., `navigation_bar`, `navigation_tabs`). [Source: app/assets/stylesheets/_components.scss]",
      "interaction_293": "Imports styles for various legacy UI elements (e.g., `grid`, `typography`, `forms`, `navigation`, `quiz`, `dashboard`). [Source: app/assets/stylesheets/_partials.scss]",
      "interaction_294": "Imports styles for XUI components (`upload`, `mdupload`, `imageupload`). [Source: app/assets/stylesheets/_partials.scss]",
      "interaction_295": "Defines `$column`, `$gutter`, `$grid-columns`, `$max-width` for the grid system. [Source: app/assets/stylesheets/_grid-settings.scss]",
      "interaction_296": "Defines various breakpoints (`$xs-to-sm`, `$sm-to-md`, `$md-to-lg`, `$breakpoint-s`, etc.) and corresponding mixins (`@mixin small`, `@mixin medium`, `@mixin large`). [Source: app/assets/stylesheets/_grid-settings.scss]",
      "interaction_297": "Exports breakpoint values as CSS variables (`--breakpoint-s`, `--breakpoint-sm`) for JavaScript access. [Source: app/assets/stylesheets/_grid-settings.scss]",
      "interaction_298": "Uses `ApplicationHelper#sentry_meta_tags` for Sentry integration. [Source: app/views/layouts/application.html.slim]",
      "interaction_299": "Includes `include_gon` for passing data to JavaScript. [Source: app/views/layouts/application.html.slim]",
      "interaction_300": "Links `bootstrap`, `fontawesome`, and `styles` stylesheets. [Source: app/views/layouts/application.html.slim]",
      "interaction_301": "Includes Webpack bundles (`runtime`, `main`) and Sprockets bundles (`application`, `lanalytics-framework`, locale-specific JS). [Source: app/views/layouts/application.html.slim]",
      "interaction_302": "Renders `Global::CustomHeadSnippets` for custom head content. [Source: app/views/layouts/application.html.slim]",
      "interaction_303": "Renders `Global::FlashBlock` for displaying flash messages. [Source: app/views/layouts/application.html.slim]",
      "interaction_304": "Renders `Navigation::Bar` unless in-app or teacherview. [Source: app/views/layouts/application.html.slim]",
      "interaction_305": "Checks `ApplicationHelper#browser_support` and `ApplicationHelper#hide_browser_warning?` to display browser warnings. [Source: app/views/layouts/application.html.slim]",
      "interaction_306": "Renders `Footer::Main` and `Global::HelpdeskButton` unless in-app or teacherview. [Source: app/views/layouts/application.html.slim]",
      "interaction_307": "Renders `shared/piwik` for analytics. [Source: app/views/layouts/application.html.slim]",
      "interaction_308": "Renders `Global::CookieConsentBanner`. [Source: app/views/layouts/application.html.slim]",
      "interaction_309": "Includes `include_gon` for passing data to JavaScript. [Source: app/views/layouts/simple.html.slim]",
      "interaction_310": "Links `bootstrap`, `fontawesome`, and `styles` stylesheets. [Source: app/views/layouts/simple.html.slim]",
      "interaction_311": "Includes Webpack bundles (`runtime`, `main`) and Sprockets bundles (`application`, `lanalytics-framework`, locale-specific JS). [Source: app/views/layouts/simple.html.slim]",
      "interaction_312": "Renders `Global::FlashBlock` for displaying flash messages. [Source: app/views/layouts/simple.html.slim]",
      "interaction_313": "Renders `Navigation::Bar`. [Source: app/views/layouts/simple.html.slim]",
      "interaction_314": "Renders `Footer::Main` and `Global::HelpdeskButton`. [Source: app/views/layouts/simple.html.slim]",
      "interaction_315": "Renders `shared/piwik` for analytics. [Source: app/views/layouts/simple.html.slim]",
      "interaction_316": "Renders `Global::CookieConsentBanner`. [Source: app/views/layouts/simple.html.slim]",
      "interaction_317": "Processes JavaScript/TypeScript files from `app/assets/`.",
      "interaction_318": "Processes Sass files from `app/assets/` and `brand/*/assets`.",
      "interaction_319": "Utilizes Babel for JavaScript transpilation.",
      "interaction_320": "Uses `sass-embedded` and `sass-loader` for Sass compilation.",
      "interaction_321": "Generates output bundles for deployment.",
      "interaction_322": "Links image directories (`../images`).",
      "interaction_323": "Includes legacy JavaScript files like `application.js`, `m.e.i.n.e.l.js`, `moment.js`.",
      "interaction_324": "Coexists with Webpack, handling assets not managed by Webpack.",
      "interaction_325": "Analyzes `**/*.{js,mjs,cjs,ts}` files.",
      "interaction_326": "Integrated into the pre-commit hook via `lint-staged`.",
      "interaction_327": "Analyzes `app/assets/**/*.{css,scss}` and `brand/*/assets/**/*.{css,scss}`.",
      "interaction_328": "Integrated into the pre-commit hook via `lint-staged`.",
      "interaction_329": "Formats various file types on commit via `lint-staged`.",
      "interaction_330": "Ignores specific auto-generated or vendored directories and files.",
      "interaction_331": "Triggers `lint-staged` and `tsc --skipLibCheck --noEmit` on `pre-commit`.",
      "interaction_332": "Receives staged files from Husky.",
      "interaction_333": "Executes `prettier`, `editorconfig-checker`, `rubocop`, `slim-lint`, `eslint`, `stylelint`, and `markdownlint` on respective file types.",
      "interaction_334": "Executed with `--skipLibCheck --noEmit` during the pre-commit hook to ensure type correctness without generating output files.",
      "interaction_335": "Receives data from Rails controllers/views.",
      "interaction_336": "Provides `user_id`, `in_app`, `env`, `build_version`, `item_id`, `section_id`, `course_id` to frontend JavaScript.",
      "interaction_337": "Processes `.scss` files, including imports from `stylesheets/theme` and `stylesheets/global`.",
      "interaction_338": "Used for both Webpack and potentially Rails Asset Pipeline managed styles.",
      "interaction_339": "Used by Webpack via `babel-loader`.",
      "interaction_340": "Applies `@babel/preset-env` and `@babel/plugin-transform-runtime`.",
      "interaction_341": "Executes Webpack build and dev server commands.",
      "interaction_342": "Runs Yarn for dependency management.",
      "interaction_343": "Executes linting and formatting scripts.",
      "interaction_344": "Installs dependencies listed in `package.json`.",
      "interaction_345": "Used for running build, start, format, and lint scripts.",
      "interaction_346": "Manages `node_modules`.",
      "interaction_347": "Analyzes `**/*.{md,md.erb}` files.",
      "interaction_348": "Integrated into the pre-commit hook via `lint-staged`.",
      "interaction_349": "Configured to disable line length checks and allow specific HTML tags.",
      "interaction_350": "User clicks a button (`data-accordion-target='toggle-button'`) to toggle the expanded state of a section.",
      "interaction_351": "Automatically collapses other expanded sections when a new one is opened.",
      "interaction_352": "Renders `AccordionSection` components, which are then controlled by the client-side `Accordion (JS)`.",
      "interaction_353": "Renders a button that, when clicked, triggers the client-side `Dropdown (JS)` to show/hide the menu.",
      "interaction_354": "Accepts `actions` and `destructive_actions` as blocks for menu items.",
      "interaction_355": "Used by `HeadlineTooltip` to display contextual information.",
      "interaction_356": "User clicks a button (`data-browser-warning=\"dismiss\"`) to hide the alert.",
      "interaction_357": "Interacts with `js-cookie` library to set a cookie.",
      "interaction_358": "User clicks a button (`data-id='clear-button'`).",
      "interaction_359": "Resets the value of the input specified by `data-clear-target`.",
      "interaction_360": "Submits the closest form to the target input.",
      "interaction_361": "User clicks the close button to hide the banner.",
      "interaction_362": "Interacts with `ConsentCookie` to determine if a banner should be shown and what text to display.",
      "interaction_363": "Renders a form for accepting or declining cookies.",
      "interaction_364": "User clicks an element (`data-behavior='copy-to-clipboard'`).",
      "interaction_365": "Accesses `navigator.clipboard.writeText()` to copy content.",
      "interaction_366": "Updates `data-behavior='clipboard-tooltip'` or `data-behavior='clipboard-label'` with a success message temporarily.",
      "interaction_367": "Renders HTML elements with `data-behavior='copy-to-clipboard'` for client-side interaction.",
      "interaction_368": "Fetches banner data from `Banner.current` (cached).",
      "interaction_369": "Reads configuration from `Xikolo.config.custom_html`.",
      "interaction_370": "Evaluates `Requirements` (e.g., `ConsentCookie`) to determine if a snippet should be rendered.",
      "interaction_371": "Initializes `TomSelect` on elements with `data-behavior='custom-select'`.",
      "interaction_372": "Uses `classifiers-select.js` to load classifier data from `/admin/find_classifiers`.",
      "interaction_373": "Uses `item-stats-select.js` to redirect to a URL on item selection.",
      "interaction_374": "Interacts with `settings.js` for common and advanced TomSelect configurations.",
      "interaction_375": "Toggles content visibility based on user interaction with the summary element.",
      "interaction_376": "User clicks an element (`data-behaviour='dropdown'`) to toggle its `aria-expanded` state.",
      "interaction_377": "Closes other dropdowns when a new one is opened, unless it's a nested parent.",
      "interaction_378": "Closes all dropdowns when a click occurs outside any dropdown.",
      "interaction_379": "User hovers over a course card (`data-behavior='expandable'`).",
      "interaction_380": "Clones the card and adds `course-card--expanded` class to display extended information.",
      "interaction_381": "Initializes dialogs for buttons within the cloned card.",
      "interaction_382": "Resets placeholder content on slider scroll or window resize.",
      "interaction_383": "Listens for `load-more:course-cards` event to apply behavior to newly added cards.",
      "interaction_384": "Renders a 'Reset' link that, when clicked, triggers client-side `hide-on-click` and `show-on-click` to manage content visibility.",
      "interaction_385": "Can be configured to use `data-behavior='fixed'` for sticky positioning.",
      "interaction_386": "Renders a `select_tag` that, when changed, triggers a form submission (via `data-change='submit'`).",
      "interaction_387": "Can integrate with client-side `Custom Select (TomSelect)` for enhanced multi-select functionality.",
      "interaction_388": "Renders a `text_field_tag` for search input.",
      "interaction_389": "Includes a button (`data-id='clear-button'`) that interacts with the client-side `Clear Button` to clear the input and submit the form.",
      "interaction_390": "Observes an element's intersection with the viewport using `IntersectionObserver`.",
      "interaction_391": "Clones the element and appends it to the body with `js-fixed` class when the original element is no longer intersecting at the top threshold.",
      "interaction_392": "Initializes `flatpickr` on elements with `data-behaviour~=datepicker`.",
      "interaction_393": "Uses `luxon` for ISO date parsing and formatting.",
      "interaction_394": "Integrates `CustomButtonsPlugin` to add 'Clear' and 'Today' buttons to the picker.",
      "interaction_395": "Renders `FlashMessage` for standard flash messages.",
      "interaction_396": "Renders `FlashLayer` for messages displayed as `SweetAlert2` dialogs.",
      "interaction_397": "Generates JavaScript to call `xuiSwal.fire()` on the client-side.",
      "interaction_398": "Renders a button with `data-hide-on-click` attribute to hide the message via client-side JavaScript.",
      "interaction_399": "Renders `Global::BasicTooltip`.",
      "interaction_400": "Observes the footer copyright element (`data-id=\"footer-copyright\"`) using `IntersectionObserver`.",
      "interaction_401": "Adds/removes `helpdesk-button--bottom-reached` class to the helpdesk button based on intersection state.",
      "interaction_402": "Checks user feature flags (`@user.feature?`) to determine the appropriate chatbot version and icon.",
      "interaction_403": "Renders a button that, when clicked, likely toggles the visibility of the helpdesk panel (client-side interaction).",
      "interaction_404": "Renders a close button that interacts with client-side JavaScript to hide the panel.",
      "interaction_405": "User clicks an element with `data-hide-on-click` or `data-show-on-click`.",
      "interaction_406": "Sets the `hidden` attribute of the target element to `true` or `false`.",
      "interaction_407": "Renders a button with `data-behavior='copy-to-clipboard'` and `data-text` attributes for client-side copy functionality.",
      "interaction_408": "Can render a `Global::Pill` component within its structure.",
      "interaction_409": "User clicks scroll buttons (`data-slider-target='scroll-button-left/right'`) to scroll content.",
      "interaction_410": "Uses `IntersectionObserver` to monitor visibility of `intersector-left/right` elements within the slider content.",
      "interaction_411": "Dynamically hides/shows scroll buttons based on intersection state.",
      "interaction_412": "Renders HTML elements with `data-controller='slider'` and `data-slider-target` attributes for client-side control.",
      "interaction_413": "Reads SVG content directly from the file system.",
      "interaction_414": "User clicks the alerts container to expand the toggle button (`aria-expanded=true`).",
      "interaction_415": "User clicks the close button (`data-id='system-alerts__close-btn'`) to collapse the toggle button (`aria-expanded=false`).",
      "interaction_416": "Sets a `seen_alerts` cookie using `js-cookie`.",
      "interaction_417": "Renders `State::Empty` if `data` is empty.",
      "interaction_418": "User clicks an element (`data-behaviour='toggle-menu'`) to toggle its `aria-expanded` state.",
      "interaction_419": "Dynamically sets `style.left` or `style.right` property based on `data-follow-menu` and the controlled menu's `offsetWidth`.",
      "interaction_420": "User hovers over an element with `data-tooltip` attribute.",
      "interaction_421": "Dynamically creates and inserts tooltip content into a container (`data-id='tooltip'`).",
      "interaction_422": "Calculates and sets `top`, `left`, and `--tooltip-arrow-position` CSS properties for accurate positioning.",
      "interaction_423": "Receives cues data to `fill()` the transcript.",
      "interaction_424": "Updates active cues (`updateActiveCues()`) based on video playback.",
      "interaction_425": "Scrolls the cue list automatically or manually.",
      "interaction_426": "User clicks a cue (`data-start-time`) to emit a `transcript:seeked` event, seeking the video.",
      "interaction_427": "Supports keyboard navigation (ArrowUp, ArrowDown, Enter) within the cue list.",
      "interaction_428": "Generates avatar image URL using `avatar_path` helper."
    },
    "technicalDebt": [
      "Continued reliance on `Acfs` for inter-service communication, with a stated goal to migrate to `Restify` [Source: docs/app/development/best_practices/project_guidelines.md]",
      "Use of instance variable `@in_app` and `@browser_support` in helper, which can lead to unexpected behavior if not carefully managed [Source: app/helpers/application_helper.rb]",
      "Use of instance variables (`@internal_link_callback`, `@external_link_callback`) in `BlankTargets` class within a helper, which can lead to statefulness issues if not carefully managed [Source: app/helpers/markdown_helper.rb]",
      "Logout handling logic is copied to `OmniAuth::Strategies::XikoloSAML`, indicating potential for duplication or a need for a shared module [Source: app/helpers/session_helper.rb]",
      "`has_many` associations use `inverse_of: false` which might prevent some ActiveRecord optimizations and lead to N+1 queries if not handled carefully [Source: app/models/page.rb]",
      "Uses a self-made tag building mechanism that is not standard Rails rendering context, leading to `rubocop:disable Rails/ContentTag` [Source: lib/pagination_renderer.rb]",
      "Represents a legacy asset pipeline approach, with a move towards Webpack for modern JavaScript management [Source: app/assets/javascripts/application.js]",
      "Direct use of `html_safe` for `text` and `to_json` for `swal_options` [Source: app/components/global/cookie_consent_banner.html.slim, app/components/global/flash_layer.html.slim]",
      "Direct use of `raw snippet` for rendering HTML, requiring careful sanitization of `Xikolo.config.custom_html` content [Source: app/components/global/custom_head_snippets.html.slim]",
      "Direct use of `html_safe` for `swal_options.to_json` [Source: app/components/global/flash_layer.html.slim]",
      "Direct use of `== \"<h#{@level} class=\\\"basic-tooltip-headline\\\">#{@headline}</h#{@level}>\"` for rendering the headline, which bypasses standard Rails helpers and could be more robust [Source: app/components/global/headline_tooltip.html.slim]",
      "Direct use of `raw svg` for rendering SVG content, which requires careful handling of the SVG source to prevent XSS vulnerabilities [Source: app/components/global/svg_icon.html.slim]",
      "Relies on `SIZE_MAPPING` and corresponding SCSS classes, requiring manual synchronization between Ruby and SCSS for size changes [Source: app/components/global/user_avatar.rb]",
      "The `main.js` bundle tends to become inflated with JavaScript belonging to globally scoped components, indicating a need to rethink the bundling strategy for shared components. [Source: docs/app/development/frontend/webpack_bundles.md]",
      "The `ruby-sass` compiler (using libsass) does not support CSS Color Level 4 syntax, requiring specific `Stylelint` rules for alpha value notation and color function notation. [Source: .stylelintrc.js]",
      "The actual form.ts file was not provided, so its internal implementation details and potential tech debt cannot be fully assessed.",
      "The explicit `cls.extend(Preloading)` in `inherited` hook for `build_collection` might indicate a slightly less direct or more verbose pattern for extending class methods compared to direct module inclusion or class-level method definitions.",
      "The `firefox_on_ipad?` method includes a specific workaround for `browser` gem detection issues on iOS 13 iPads, which might indicate a fragility in browser detection or a dependency on specific gem behavior that could change. [Source: lib/browser_support.rb]",
      "The `VERSIONS_CONSIDERED_MODERN` hash hardcodes browser version thresholds. While functional, this could be externalized to a configuration file or database if these thresholds are expected to change frequently or require dynamic updates without code deployment. [Source: lib/browser_support.rb]",
      "Coexists with Sprockets, potentially leading to a complex and fragmented asset pipeline.",
      "The 'main' bundle tends to become inflated, requiring a re-evaluation of modularization strategy. [Source: docs/app/development/frontend/webpack_bundles.md]",
      "Older CSS files are ignored by Stylelint, indicating a backlog for refactoring to meet current style guidelines. [Source: docs/app/development/frontend/CSS/css_styleguide.md]",
      "Legacy JavaScript in `app/assets/javascripts` is excluded from TypeScript compilation, indicating a split codebase. [Source: tsconfig.json]",
      "Explicitly ignores legacy JavaScript assets in `app/assets/javascripts` and `vendor/assets/javascripts`, allowing non-compliant code to persist. [Source: eslint.config.mjs]",
      "Ignores older CSS files, creating a backlog of code that does not conform to the current styleguide. [Source: docs/app/development/frontend/CSS/css_styleguide.md]",
      "The hybrid approach with Webpack can lead to complexity and potential confusion for developers regarding asset management. ",
      "Its deprecation for new code while remaining available for plugins can lead to inconsistent code styles and difficulty in enforcing modern practices. [Source: docs/app/development/frontend/js_styleguide.md]",
      "Part of a deprecated Sprockets-based asset pipeline, being phased out in favor of Webpack. [Source: app/assets/javascripts/application.js]",
      "The `_design.scss` file needs to be copied even if no changes are made, which is an inconvenient aspect of the current branding architecture. [Source: docs/app/development/branding/stylesheets.md]",
      "Includes `controllers/sections` and `controllers/account` which are marked as `TODO: we don't want controller specific stuff`, indicating a need for refactoring into a component-based approach. [Source: app/assets/stylesheets/_global.scss]",
      "Represents a dependency on Bootstrap 3.4.1, which is outdated and unmaintained, contributing to technical debt. [Source: app/assets/stylesheets/_bs-variables.scss, docs/app/development/frontend/CSS/index.md]",
      "Contains a lot of Bootstrap code and is considered legacy, requiring future migration to the component-based architecture. [Source: docs/app/development/frontend/CSS/index.md]",
      "Contains `@deprecated Old breakpoints` mixins (`tiny`, `xs`, `sm`) that should be refactored to align with the mobile-first approach. [Source: app/assets/stylesheets/_grid-settings.scss]",
      "Relies on both Sprockets and Webpack for JavaScript asset inclusion, indicating a transitional state. [Source: app/views/layouts/application.html.slim]",
      "Relies on both Sprockets and Webpack for JavaScript asset inclusion, indicating a transitional state. [Source: app/views/layouts/simple.html.slim]",
      "Contains legacy JavaScript in `app/assets/javascripts` that is ignored by modern tooling (ESLint, TypeScript).",
      "Ignores `app/assets/javascripts` and `vendor/assets/javascripts` due to legacy code.",
      "Custom rules for `alpha-value-notation` and `color-function-notation` are necessary due to limitations of the `ruby-sass` compiler (libsass), indicating a potential need to update the Sass compiler or migrate to Dart Sass fully.",
      "Ignores `*.md` files because 'Prettier isn't able to understand all advanced markdown extensions', which might lead to inconsistent Markdown formatting for advanced features.",
      "The `.stylelintrc.js` indicates that the `ruby-sass` compiler (libsass) is still in use for some parts, which lacks support for modern CSS Color Level 4 syntax, necessitating custom Stylelint rules. This suggests a mixed or incomplete migration to Dart Sass.",
      "The cloning of the card and absolute positioning for expansion might lead to complex DOM management and potential performance issues with many cards or frequent interactions.",
      "Cloning the element might lead to duplicate IDs if not carefully managed, although `fixedElement.remove()` helps mitigate this. Potential for layout shifts if not styled correctly.",
      "Relies on a specific bug fix for `flatpickr`'s 'Z' dateFormat, which might be fragile if `flatpickr` updates its behavior. The use of `luxon` adds another dependency for date manipulation.",
      "Relies on global `xuiSwal` object, which couples it to the SweetAlert2 library and its global availability.",
      "The `CHATBOT_VERSION` hash defines a hardcoded order of feature flipper names, which might be less flexible for dynamic feature flag management. The `data_feature` attribute is used to pass the chatbot version, implying client-side logic to load the correct chatbot UI.",
      "The `getScrollDistance` function has a fallback for `content.clientWidth` being null, which might indicate a race condition or rendering issue that could be addressed more robustly. The `rootMargin` for the `IntersectionObserver` is set to '100% 0% 100% 0%', which might be overly broad if the intention is only to observe the x-axis, potentially leading to unexpected behavior in complex layouts.",
      "Direct manipulation of `element.style.setProperty` can lead to specificity issues if not carefully managed with CSS. The `offsetWidth` calculation might not be accurate in all rendering scenarios or with complex CSS transforms.",
      "Direct DOM manipulation (`innerHTML`, `style` properties) can be less performant than using CSS classes for state changes, especially for frequent interactions. The `calculatePosition` logic is complex and might be prone to edge cases with different screen sizes or element layouts.",
      "The `scrollLogic` function has multiple `scrollingModes` and `userHasScrolled` flags, which could be simplified for better readability and maintainability. The `centerOfCues` calculation might need adjustments for varying cue heights or complex layouts.",
      "The `SIZE_MAPPING` is duplicated in SCSS and Ruby, which can lead to inconsistencies if not updated in both places. A single source of truth for these values would be beneficial."
    ]
  }
}