[package]
authors = ["Control Center Team"]
autobins = false                                                                       # Disable auto-detection of binary targets
description = "Control Center UI - Leptos CSR App for Cloud Infrastructure Management"
edition.workspace = true
name = "control-center-ui"
version.workspace = true

[lib]
crate-type = ["cdylib"]
name = "control_center_ui"
path = "src/main.rs"

[dependencies]
# ============================================================================
# WORKSPACE DEPENDENCIES
# ============================================================================

# Serialization
chrono = { workspace = true, features = ["wasm-bindgen"] }
serde = { workspace = true }
serde_json = { workspace = true }
uuid = { workspace = true, features = ["js"] }

# Error handling and async
futures = { workspace = true }
thiserror = { workspace = true }

# Logging and debugging
tracing = { workspace = true }

# Security and cryptography
aes-gcm = { workspace = true, features = ["aes", "std"] }
base64 = { workspace = true }
hmac = { workspace = true }
rand = { workspace = true }
regex = { workspace = true }
sha2 = { workspace = true }

# ============================================================================
# WASM-SPECIFIC DEPENDENCIES
# ============================================================================

# Leptos Framework with CSR features
leptos = { workspace = true }
leptos_meta = { workspace = true }
leptos_router = { workspace = true }

# WASM utilities
wasm-bindgen = { workspace = true }

# ============================================================================
# ADDITIONAL WORKSPACE DEPENDENCIES
# ============================================================================

# URL handling
url = { workspace = true }

# Icons and UI utilities
icondata = { workspace = true }
leptos_icons = { workspace = true }

# Authentication and cryptography
image = { workspace = true }
qrcode = { workspace = true }
totp-rs = { workspace = true }

# Serialization utilities
serde-wasm-bindgen = { workspace = true }

# Logging for WASM
console_error_panic_hook = { workspace = true }
tracing-wasm = { workspace = true }

# HTTP client and networking
gloo-net = { workspace = true }
gloo-storage = { workspace = true }
gloo-timers = { workspace = true }
gloo-utils = { workspace = true }

# Chart.js bindings and canvas utilities
plotters = { workspace = true }
plotters-canvas = { workspace = true }

# WASM utilities
js-sys = { workspace = true }
wasm-bindgen-futures = { workspace = true }

# Random number generation (WASM-specific override with js feature)
getrandom = { version = "0.3.4", features = ["wasm_js"] }

# ============================================================================
# PROJECT-SPECIFIC DEPENDENCIES (not in workspace)
# ============================================================================

# Web APIs
web-sys = { version = "0.3", features = [
  "console",
  "Window",
  "Document",
  "Element",
  "HtmlElement",
  "HtmlCanvasElement",
  "CanvasRenderingContext2d",
  "EventTarget",
  "Event",
  "DragEvent",
  "DataTransfer",
  "HtmlInputElement",
  "HtmlSelectElement",
  "HtmlTextAreaElement",
  "HtmlButtonElement",
  "HtmlDivElement",
  "Storage",
  "Location",
  "History",
  "Navigator",
  "ServiceWorkerRegistration",
  "ServiceWorker",
  "NotificationPermission",
  "Notification",
  "Headers",
  "Request",
  "RequestInit",
  "RequestMode",
  "Response",
  "AbortController",
  "AbortSignal",
  "WebSocket",
  "MessageEvent",
  "CloseEvent",
  "ErrorEvent",
  "Blob",
  "Url",
  "FileReader",
  "File",
  "HtmlAnchorElement",
  "MouseEvent",
  "TouchEvent",
  "KeyboardEvent",
  "ResizeObserver",
  "ResizeObserverEntry",
  "IntersectionObserver",
  "IntersectionObserverEntry",
  # Media Query APIs
  "MediaQueryList",
  "MediaQueryListEvent",
  # WebAuthn APIs
  "CredentialsContainer",
  "PublicKeyCredential",
  "PublicKeyCredentialCreationOptions",
  "PublicKeyCredentialRequestOptions",
  "AuthenticatorResponse",
  "AuthenticatorAttestationResponse",
  "AuthenticatorAssertionResponse",
  # Crypto APIs
  "Crypto",
  "SubtleCrypto",
  "CryptoKey",
] }

# HTTP client (project-specific for WASM features)
reqwest = { version = "0.13", features = ["json"] }

# Tokio with time features for WASM (project-specific version)
tokio = { version = "1.49", features = ["time"] }

# Profile configurations moved to workspace root

  # WASM pack settings
  [package.metadata.wasm-pack.profile.release]
  wasm-opt = ['-Oz', '--enable-mutable-globals']

  [package.metadata.wasm-pack.profile.dev]
  wasm-opt = false
