chromium/chrome/browser/resources/side_panel/history_clusters/BUILD.gn

# Copyright 2023 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//ui/webui/resources/tools/build_webui.gni")

assert(!is_android)

build_webui("build") {
  grd_prefix = "side_panel_history_clusters"

  static_files = [ "history_clusters.html" ]

  non_web_component_files = [
    "app.ts",
    "app.html.ts",
  ]
  css_files = [ "app.css" ]

  ts_composite = true
  ts_deps = [
    "../shared:build_ts",
    "//third_party/lit/v3_0:build_ts",
    "//ui/webui/resources/cr_components/color_change_listener:build_ts",
    "//ui/webui/resources/cr_components/history_clusters:build_ts",
    "//ui/webui/resources/cr_components/history_embeddings:build_ts",
    "//ui/webui/resources/cr_elements:build_ts",
    "//ui/webui/resources/js:build_ts",
  ]

  ts_path_mappings =
      [ "chrome://history-clusters-side-panel.top-chrome/shared/*|" +
        rebase_path(
            "$root_gen_dir/chrome/browser/resources/side_panel/shared/tsc/*",
            target_gen_dir) ]

  webui_context_type = "trusted"
  optimize = optimize_webui
  if (optimize) {
    optimize_webui_host = "history-clusters-side-panel.top-chrome"
    optimize_webui_in_files = [ "app.js" ]
    optimize_webui_external_paths =
        [ "chrome://history-clusters-side-panel.top-chrome/shared|" +
          rebase_path(
              "$root_gen_dir/chrome/browser/resources/side_panel/shared/tsc",
              root_build_dir) ]
  }
}