myio-js-library 0.1.161 → 0.1.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -34,6 +34,12 @@ declare function fmtPerc$1(value: number): string;
34
34
  */
35
35
  declare function formatNumberReadable(value: unknown, locale?: string, minimumFractionDigits?: number, maximumFractionDigits?: number): string;
36
36
 
37
+ /**
38
+ * Simple water value formatting (same as MAIN controller)
39
+ * @param value - The water volume value in cubic meters
40
+ * @returns Formatted water volume string with m³ unit
41
+ */
42
+ declare function formatWater(value: number): string;
37
43
  /**
38
44
  * Formats water volume in cubic meters (M³) using Brazilian locale formatting
39
45
  * @param value - The water volume value in cubic meters
@@ -75,6 +81,29 @@ declare function formatAllInSameWaterUnit(values: number[]): {
75
81
  unit: string;
76
82
  };
77
83
 
84
+ /**
85
+ * Time and duration formatting utilities
86
+ * Extracted from MAIN controller for reuse across widgets
87
+ */
88
+ /**
89
+ * Converts a timestamp to a relative time string (e.g., "há 5 minutos").
90
+ * @param timestamp - The timestamp in milliseconds.
91
+ * @returns The formatted relative time string.
92
+ */
93
+ declare function formatRelativeTime(timestamp: number): string;
94
+ /**
95
+ * Formats duration in milliseconds to a readable string (e.g., "2d 5h", "3h 20m", "45s")
96
+ * @param ms - Duration in milliseconds
97
+ * @returns Formatted duration string
98
+ */
99
+ declare function formatarDuracao(ms: number): string;
100
+ /**
101
+ * Alias for formatarDuracao using English naming convention
102
+ * @param ms - Duration in milliseconds
103
+ * @returns Formatted duration string
104
+ */
105
+ declare const formatDuration: typeof formatarDuracao;
106
+
78
107
  /**
79
108
  * Formats a date to YYYY-MM-DD format
80
109
  * @param date - The date to format (Date object, timestamp, or date string)
@@ -308,6 +337,19 @@ declare function getValueByDatakeyLegacy(dataList: any[], dataSourceNameTarget:
308
337
  * @returns The value found, or undefined if not found
309
338
  */
310
339
  declare function findValue(data: any, keyOrPath: string, legacyDataKey?: string): any;
340
+ /**
341
+ * Find a value in an array of objects by key/dataType (RFC-0091 compatible)
342
+ * Supports both ThingsBoard format {dataType, value} and generic {key, value}
343
+ * @param values - Array of objects with key/value or dataType/value properties
344
+ * @param key - Key or dataType to search for
345
+ * @param defaultValue - Default value if not found (defaults to null)
346
+ * @returns The found value or defaultValue
347
+ */
348
+ declare function findValueWithDefault<T = any>(values: Array<{
349
+ key?: string;
350
+ dataType?: string;
351
+ value: any;
352
+ }> | any, key: string, defaultValue?: T | null): T | null;
311
353
 
312
354
  /**
313
355
  * Maps device status to connection status
@@ -318,6 +360,12 @@ declare function findValue(data: any, keyOrPath: string, legacyDataKey?: string)
318
360
  * @returns {string} The connection status (connected or offline)
319
361
  */
320
362
  declare function mapDeviceToConnectionStatus(deviceStatus: string): string;
363
+ /**
364
+ * Maps raw connection status string to normalized status
365
+ * @param {string} rawStatus - Raw status from ThingsBoard (e.g., 'ONLINE', 'ok', 'running', 'waiting', 'offline')
366
+ * @returns {'online' | 'waiting' | 'offline'} - Normalized status
367
+ */
368
+ declare function mapConnectionStatus(rawStatus: string): "online" | "waiting" | "offline";
321
369
  /**
322
370
  * Maps device status to a simplified card status
323
371
  * Used for styling and visual representation
@@ -2116,7 +2164,7 @@ declare function clampTemperature(value: number | string, range?: ClampRange): n
2116
2164
  /**
2117
2165
  * Calculates statistics from temperature data
2118
2166
  */
2119
- declare function calculateStats(data: TemperatureTelemetry[], clampRange?: ClampRange): TemperatureStats;
2167
+ declare function calculateStats$1(data: TemperatureTelemetry[], clampRange?: ClampRange): TemperatureStats;
2120
2168
  /**
2121
2169
  * Interpolates temperature data to fill gaps with 30-minute intervals
2122
2170
  * Uses 'repeat-last' strategy: if no reading in interval, repeats last known temperature
@@ -2283,4 +2331,916 @@ interface TemperatureSettingsInstance {
2283
2331
  */
2284
2332
  declare function openTemperatureSettingsModal(params: TemperatureSettingsParams): TemperatureSettingsInstance;
2285
2333
 
2286
- export { CHART_COLORS, type ClampRange, ConnectionStatusType, type CreateDateRangePickerOptions, type CreateInputDateRangePickerInsideDIVParams, DEFAULT_CLAMP_RANGE, type DateRangeControl, type DateRangeInputController, type DateRangeResult, type DemandModalInstance, type DemandModalParams, type DemandModalPdfConfig, type DemandModalStyles, DeviceStatusType, type EnergyModalContext, type EnergyModalError, type EnergyModalI18n, type EnergyModalStyleOverrides, type MyIOAuthConfig, type MyIOAuthInstance, MyIOChartModal, MyIODraggableCard, MyIOSelectionStore, MyIOSelectionStoreClass, MyIOToast, type OpenDashboardPopupEnergyOptions, type OpenDashboardPopupSettingsParams, type OpenDashboardPopupWaterTankOptions, type PersistResult, type RealTimeTelemetryInstance, type RealTimeTelemetryParams, type SettingsError, type SettingsEvent, type StoreRow, type TbScope, type TelemetryFetcher, type TemperatureComparisonModalInstance, type TemperatureComparisonModalParams, type TemperatureDevice, type TemperatureGranularity, type TemperatureModalInstance, type TemperatureModalParams, type TemperatureSettingsInstance, type TemperatureSettingsParams, type TemperatureStats, type TemperatureTelemetry, type ThingsboardCustomerAttrsConfig, type TimedValue, type WaterRow, type WaterTankDataPoint, type WaterTankModalContext, type WaterTankModalError, type WaterTankModalI18n, type WaterTankModalStyleOverrides, type WaterTankTelemetryData, addDetectionContext, addNamespace, aggregateByDay, averageByDay, buildListItemsThingsboardByUniqueDatasource, buildMyioIngestionAuth, buildWaterReportCSV, buildWaterStoresCSV, calcDeltaPercent, calculateDeviceStatus, calculateDeviceStatusWithRanges, calculateStats, clampTemperature, classify, classifyWaterLabel, classifyWaterLabels, clearAllAuthCaches, connectionStatusIcons, createDateRangePicker, createInputDateRangePickerInsideDIV, decodePayload, decodePayloadBase64Xor, detectDeviceType, determineInterval, deviceStatusIcons, exportTemperatureCSV, exportToCSV, exportToCSVAll, extractMyIOCredentials, fetchTemperatureData, fetchThingsboardCustomerAttrsFromStorage, fetchThingsboardCustomerServerScopeAttrs, findValue, fmtPerc$1 as fmtPerc, fmtPerc as fmtPercLegacy, formatAllInSameUnit, formatAllInSameWaterUnit, formatDateForInput, formatDateToYMD, formatDateWithTimezoneOffset, formatEnergy, formatNumberReadable, formatTankHeadFromCm, formatTemperature, formatWaterByGroup, formatWaterVolumeM3, getAuthCacheStats, getAvailableContexts, getConnectionStatusIcon, getDateRangeArray, getDeviceStatusIcon, getDeviceStatusInfo, getSaoPauloISOString, getSaoPauloISOStringFixed, getValueByDatakey, getValueByDatakeyLegacy, getWaterCategories, groupByDay, interpolateTemperature, isDeviceOffline, isValidConnectionStatus, isValidDeviceStatus, isWaterCategory, mapDeviceStatusToCardStatus, mapDeviceToConnectionStatus, normalizeRecipients, numbers, openDashboardPopup, openDashboardPopupAllReport, openDashboardPopupEnergy, openDashboardPopupReport, openDashboardPopupSettings, openDashboardPopupWaterTank, openDemandModal, openGoalsPanel, openRealTimeTelemetryModal, openTemperatureComparisonModal, openTemperatureModal, openTemperatureSettingsModal, parseInputDateToDate, renderCardComponent$2 as renderCardComponent, renderCardComponent$1 as renderCardComponentEnhanced, renderCardComponentHeadOffice, renderCardComponentLegacy, renderCardComponentV2, renderCardComponent as renderCardComponentV5, renderCardComponentV5 as renderCardV5, shouldFlashIcon, strings, timeWindowFromInputYMD, toCSV, toFixedSafe, waterDeviceStatusIcons };
2334
+ /**
2335
+ * MyIO Modal Header Component
2336
+ *
2337
+ * A reusable header component for modals with:
2338
+ * - Title with optional icon (domain-specific)
2339
+ * - Export button with format options (CSV, XLS, PDF)
2340
+ * - Theme toggle (light/dark)
2341
+ * - Maximize/restore button
2342
+ * - Close button
2343
+ *
2344
+ * @example
2345
+ * ```typescript
2346
+ * import { createModalHeader } from 'myio-js-library';
2347
+ *
2348
+ * const header = createModalHeader({
2349
+ * id: 'my-modal',
2350
+ * title: 'My Modal Title',
2351
+ * icon: '📊',
2352
+ * theme: 'light',
2353
+ * isMaximized: false,
2354
+ * exportFormats: ['csv', 'xls', 'pdf'],
2355
+ * onExport: (format) => console.log('Export:', format),
2356
+ * onThemeToggle: (theme) => console.log('Theme:', theme),
2357
+ * onMaximize: (maximized) => console.log('Maximized:', maximized),
2358
+ * onClose: () => console.log('Close clicked'),
2359
+ * });
2360
+ *
2361
+ * container.innerHTML = header.render();
2362
+ * header.attachListeners();
2363
+ * ```
2364
+ */
2365
+ type ModalTheme = 'light' | 'dark';
2366
+ type ExportFormat$1 = 'csv' | 'xls' | 'pdf';
2367
+ interface ModalHeaderConfig {
2368
+ /** Unique ID prefix for the modal elements */
2369
+ id: string;
2370
+ /** Modal title text */
2371
+ title: string;
2372
+ /** Optional icon (emoji or text) to display before title */
2373
+ icon?: string;
2374
+ /** Current theme */
2375
+ theme?: ModalTheme;
2376
+ /** Whether the modal is currently maximized */
2377
+ isMaximized?: boolean;
2378
+ /** Header background color (default: #3e1a7d - MyIO purple) */
2379
+ backgroundColor?: string;
2380
+ /** Header text color (default: white) */
2381
+ textColor?: string;
2382
+ /** Show theme toggle button (default: true) */
2383
+ showThemeToggle?: boolean;
2384
+ /** Show maximize button (default: true) */
2385
+ showMaximize?: boolean;
2386
+ /** Show close button (default: true) */
2387
+ showClose?: boolean;
2388
+ /** Border radius when not maximized (default: '10px 10px 0 0') */
2389
+ borderRadius?: string;
2390
+ /** Available export formats (shows dropdown if multiple) */
2391
+ exportFormats?: ExportFormat$1[];
2392
+ /** Callback when export is clicked with format */
2393
+ onExport?: (format: ExportFormat$1) => void;
2394
+ /** Callback when theme is toggled */
2395
+ onThemeToggle?: (theme: ModalTheme) => void;
2396
+ /** Callback when maximize/restore is clicked */
2397
+ onMaximize?: (isMaximized: boolean) => void;
2398
+ /** Callback when close is clicked */
2399
+ onClose?: () => void;
2400
+ }
2401
+ interface ModalHeaderInstance {
2402
+ /** Renders the header HTML */
2403
+ render: () => string;
2404
+ /** Attaches event listeners (call after adding to DOM) */
2405
+ attachListeners: () => void;
2406
+ /** Updates the header state */
2407
+ update: (updates: Partial<Pick<ModalHeaderConfig, 'theme' | 'isMaximized' | 'title'>>) => void;
2408
+ /** Gets the current state */
2409
+ getState: () => {
2410
+ theme: ModalTheme;
2411
+ isMaximized: boolean;
2412
+ };
2413
+ /** Removes event listeners */
2414
+ destroy: () => void;
2415
+ }
2416
+ /**
2417
+ * Creates a modal header instance
2418
+ */
2419
+ declare function createModalHeader(config: ModalHeaderConfig): ModalHeaderInstance;
2420
+ /**
2421
+ * Returns CSS styles for the modal header component
2422
+ * Can be injected into page or used in CSS-in-JS
2423
+ */
2424
+ declare function getModalHeaderStyles(): string;
2425
+
2426
+ /**
2427
+ * RFC-0098: View Consumption Over 7 Days Component
2428
+ * Type definitions for the reusable consumption chart component
2429
+ */
2430
+ /**
2431
+ * Supported chart domains
2432
+ */
2433
+ type ChartDomain = 'energy' | 'water' | 'gas' | 'temperature' | string;
2434
+ /**
2435
+ * Theme modes
2436
+ */
2437
+ type ThemeMode = 'light' | 'dark';
2438
+ /**
2439
+ * Chart visualization types
2440
+ */
2441
+ type ChartType = 'line' | 'bar';
2442
+ /**
2443
+ * Visualization modes
2444
+ */
2445
+ type VizMode = 'total' | 'separate';
2446
+ /**
2447
+ * Ideal range configuration for shaded area on chart
2448
+ * Used to highlight acceptable/target ranges for any domain
2449
+ */
2450
+ interface IdealRangeConfig {
2451
+ /** Minimum value of the ideal range */
2452
+ min: number;
2453
+ /** Maximum value of the ideal range */
2454
+ max: number;
2455
+ /** Color for the shaded area (with alpha for transparency) */
2456
+ color?: string;
2457
+ /** Border color for the range box */
2458
+ borderColor?: string;
2459
+ /** Optional label to display */
2460
+ label?: string;
2461
+ /** Whether to show the range (default: true when min/max are set) */
2462
+ enabled?: boolean;
2463
+ }
2464
+ /**
2465
+ * Temperature reference line configuration
2466
+ */
2467
+ interface TemperatureReferenceLine {
2468
+ /** Value for the reference line */
2469
+ value: number;
2470
+ /** Label for the reference line */
2471
+ label: string;
2472
+ /** Line color */
2473
+ color: string;
2474
+ /** Line style: 'solid', 'dashed', 'dotted' */
2475
+ lineStyle?: 'solid' | 'dashed' | 'dotted';
2476
+ /** Line width (default: 2) */
2477
+ lineWidth?: number;
2478
+ /** Fill area above or below the line */
2479
+ fillArea?: 'above' | 'below' | 'none';
2480
+ /** Fill color (with alpha) */
2481
+ fillColor?: string;
2482
+ }
2483
+ /**
2484
+ * Temperature-specific configuration
2485
+ */
2486
+ interface TemperatureConfig {
2487
+ /** Minimum temperature reference line */
2488
+ minThreshold?: TemperatureReferenceLine;
2489
+ /** Maximum temperature reference line */
2490
+ maxThreshold?: TemperatureReferenceLine;
2491
+ /** Ideal range (shows shaded area between min and max) */
2492
+ idealRange?: {
2493
+ min: number;
2494
+ max: number;
2495
+ color: string;
2496
+ label?: string;
2497
+ };
2498
+ /** Clamp values outside this range for display */
2499
+ clampRange?: {
2500
+ min: number;
2501
+ max: number;
2502
+ };
2503
+ /** Show temperature unit in Y-axis (default: true) */
2504
+ showUnitInAxis?: boolean;
2505
+ }
2506
+ /**
2507
+ * Color configuration for the chart
2508
+ */
2509
+ interface Consumption7DaysColors {
2510
+ /** Primary line/bar color */
2511
+ primary: string;
2512
+ /** Background fill color (for line charts) */
2513
+ background: string;
2514
+ /** Optional gradient colors [start, end] */
2515
+ gradient?: [string, string];
2516
+ /** Optional border color */
2517
+ borderColor?: string;
2518
+ /** Optional point colors for line charts */
2519
+ pointBackground?: string;
2520
+ pointBorder?: string;
2521
+ /** Colors for per-shopping datasets (separate mode) */
2522
+ shoppingColors?: string[];
2523
+ }
2524
+ /**
2525
+ * Single data point for consumption
2526
+ */
2527
+ interface ConsumptionDataPoint {
2528
+ /** ISO date string or formatted label */
2529
+ date: string;
2530
+ /** Consumption value in base unit */
2531
+ value: number;
2532
+ /** Optional custom label override */
2533
+ label?: string;
2534
+ }
2535
+ /**
2536
+ * Data point with shopping information (for per-shopping mode)
2537
+ */
2538
+ interface ShoppingDataPoint extends ConsumptionDataPoint {
2539
+ /** Shopping identifier */
2540
+ shoppingId: string;
2541
+ /** Shopping display name */
2542
+ shoppingName: string;
2543
+ }
2544
+ /**
2545
+ * Structured data for the 7-day consumption chart
2546
+ */
2547
+ interface Consumption7DaysData {
2548
+ /** Array of date labels for X-axis */
2549
+ labels: string[];
2550
+ /** Array of total consumption values per day */
2551
+ dailyTotals: number[];
2552
+ /** Optional per-shopping data: { shoppingId: [values per day...] } */
2553
+ shoppingData?: Record<string, number[]>;
2554
+ /** Optional shopping name mapping: { shoppingId: displayName } */
2555
+ shoppingNames?: Record<string, string>;
2556
+ /** Timestamp when data was fetched (for cache validation) */
2557
+ fetchTimestamp?: number;
2558
+ /** Customer IDs used to fetch this data (for cache validation) */
2559
+ customerIds?: string[];
2560
+ }
2561
+ /**
2562
+ * Configuration options for creating the consumption chart
2563
+ */
2564
+ interface Consumption7DaysConfig {
2565
+ /** Domain identifier (energy, water, etc.) - used for logging */
2566
+ domain: ChartDomain;
2567
+ /** Canvas element ID to render the chart */
2568
+ containerId: string;
2569
+ /** Base unit for display (kWh, m³, etc.) */
2570
+ unit: string;
2571
+ /**
2572
+ * Data fetching function - must return structured data
2573
+ * @param period - Number of days to fetch
2574
+ * @returns Promise resolving to consumption data
2575
+ */
2576
+ fetchData: (period: number) => Promise<Consumption7DaysData>;
2577
+ /** Large unit for values above threshold (MWh, etc.) - null to disable */
2578
+ unitLarge?: string | null;
2579
+ /** Threshold value to switch to large unit (1000 for kWh->MWh) */
2580
+ thresholdForLargeUnit?: number | null;
2581
+ /** Decimal places for value display */
2582
+ decimalPlaces?: number;
2583
+ /** Color configuration */
2584
+ colors?: Consumption7DaysColors;
2585
+ /** Chart title (optional, usually in container header) */
2586
+ title?: string;
2587
+ /** Show legend below chart */
2588
+ showLegend?: boolean;
2589
+ /** Line tension for smooth curves (0-1, default: 0.4) */
2590
+ lineTension?: number;
2591
+ /** Point radius for line charts (default: 4) */
2592
+ pointRadius?: number;
2593
+ /** Border width for lines/bars (default: 2) */
2594
+ borderWidth?: number;
2595
+ /** Fill area under line chart (default: true) */
2596
+ fill?: boolean;
2597
+ /** Theme mode: 'light' or 'dark' (default: 'light') */
2598
+ theme?: ThemeMode;
2599
+ /** Default period in days (default: 7) */
2600
+ defaultPeriod?: number;
2601
+ /** Default chart type (default: 'line') */
2602
+ defaultChartType?: ChartType;
2603
+ /** Default visualization mode (default: 'total') */
2604
+ defaultVizMode?: VizMode;
2605
+ /** Cache TTL in milliseconds (default: 300000 = 5 min) */
2606
+ cacheTTL?: number;
2607
+ /** Auto-refresh interval in milliseconds (null to disable) */
2608
+ autoRefreshInterval?: number | null;
2609
+ /** Called when data is successfully loaded */
2610
+ onDataLoaded?: (data: Consumption7DaysData) => void;
2611
+ /** Called when an error occurs */
2612
+ onError?: (error: Error) => void;
2613
+ /** Called before rendering (can modify data) */
2614
+ onBeforeRender?: (data: Consumption7DaysData) => Consumption7DaysData;
2615
+ /** Called after chart is rendered */
2616
+ onAfterRender?: (chartInstance: any) => void;
2617
+ /**
2618
+ * Called when settings button is clicked
2619
+ * Use this to open a custom settings modal (e.g., with createDateRangePicker)
2620
+ * If not provided, no settings button functionality is added
2621
+ */
2622
+ onSettingsClick?: () => void;
2623
+ /**
2624
+ * Called when maximize button is clicked
2625
+ * Use this to open fullscreen mode
2626
+ * If not provided, no maximize button functionality is added
2627
+ */
2628
+ onMaximizeClick?: () => void;
2629
+ /**
2630
+ * Called when export CSV button is clicked
2631
+ * If not provided, uses default export behavior
2632
+ */
2633
+ onExportCSV?: (data: Consumption7DaysData) => void;
2634
+ /**
2635
+ * Enable CSV export functionality (default: true)
2636
+ */
2637
+ enableExport?: boolean;
2638
+ /**
2639
+ * ID of the export button element to attach click handler
2640
+ */
2641
+ exportButtonId?: string;
2642
+ /**
2643
+ * Custom filename for CSV export (without extension)
2644
+ * Default: '{domain}-consumption-{date}'
2645
+ */
2646
+ exportFilename?: string;
2647
+ /**
2648
+ * Ideal range configuration for displaying a shaded area on the chart.
2649
+ * Shows acceptable/target range for the metric.
2650
+ *
2651
+ * For temperature: typically comes from customer attributes (minTemperature, maxTemperature)
2652
+ * For energy/water/gas: optional, can be set via settings modal
2653
+ *
2654
+ * @example
2655
+ * ```typescript
2656
+ * // Temperature with customer-defined range
2657
+ * idealRange: {
2658
+ * min: 20, // minTemperature from customer
2659
+ * max: 24, // maxTemperature from customer
2660
+ * color: 'rgba(34, 197, 94, 0.15)',
2661
+ * label: 'Faixa Ideal'
2662
+ * }
2663
+ *
2664
+ * // Energy with target consumption
2665
+ * idealRange: {
2666
+ * min: 0,
2667
+ * max: 500, // kWh target
2668
+ * color: 'rgba(37, 99, 235, 0.1)',
2669
+ * label: 'Meta de Consumo'
2670
+ * }
2671
+ * ```
2672
+ */
2673
+ idealRange?: IdealRangeConfig;
2674
+ /**
2675
+ * Temperature-specific configuration
2676
+ * Only applies when domain is 'temperature'
2677
+ */
2678
+ temperatureConfig?: TemperatureConfig;
2679
+ /**
2680
+ * ThingsBoard widget container for proper DOM querying
2681
+ * When provided, uses $container.querySelector() instead of document.getElementById()
2682
+ */
2683
+ $container?: {
2684
+ [key: number]: HTMLElement;
2685
+ } | null;
2686
+ /**
2687
+ * ID of the settings button element to attach click handler
2688
+ * Used with onSettingsClick callback
2689
+ */
2690
+ settingsButtonId?: string;
2691
+ /**
2692
+ * ID of the maximize button element to attach click handler
2693
+ * Used with onMaximizeClick callback
2694
+ */
2695
+ maximizeButtonId?: string;
2696
+ /**
2697
+ * ID of the chart title element to update dynamically
2698
+ */
2699
+ titleElementId?: string;
2700
+ }
2701
+ /**
2702
+ * Public API returned by createConsumption7DaysChart()
2703
+ */
2704
+ interface Consumption7DaysInstance {
2705
+ /**
2706
+ * Render the chart (fetches data and creates Chart.js instance)
2707
+ */
2708
+ render: () => Promise<void>;
2709
+ /**
2710
+ * Update chart with new or existing data
2711
+ * @param data - Optional new data; uses cached data if not provided
2712
+ */
2713
+ update: (data?: Consumption7DaysData) => Promise<void>;
2714
+ /**
2715
+ * Change chart type (line/bar)
2716
+ * @param type - New chart type
2717
+ */
2718
+ setChartType: (type: ChartType) => void;
2719
+ /**
2720
+ * Change visualization mode (total/separate)
2721
+ * @param mode - New visualization mode
2722
+ */
2723
+ setVizMode: (mode: VizMode) => void;
2724
+ /**
2725
+ * Change the period and re-fetch data
2726
+ * @param days - New period in days
2727
+ */
2728
+ setPeriod: (days: number) => Promise<void>;
2729
+ /**
2730
+ * Refresh data from source
2731
+ * @param forceRefresh - Bypass cache if true
2732
+ */
2733
+ refresh: (forceRefresh?: boolean) => Promise<void>;
2734
+ /**
2735
+ * Destroy the chart instance and clean up resources
2736
+ */
2737
+ destroy: () => void;
2738
+ /**
2739
+ * Get the underlying Chart.js instance
2740
+ */
2741
+ getChartInstance: () => any | null;
2742
+ /**
2743
+ * Get currently cached data
2744
+ */
2745
+ getCachedData: () => Consumption7DaysData | null;
2746
+ /**
2747
+ * Get current configuration state
2748
+ */
2749
+ getState: () => {
2750
+ period: number;
2751
+ chartType: ChartType;
2752
+ vizMode: VizMode;
2753
+ theme: ThemeMode;
2754
+ isRendered: boolean;
2755
+ };
2756
+ /**
2757
+ * Export current data to CSV file
2758
+ * @param filename - Optional custom filename (without extension)
2759
+ */
2760
+ exportCSV: (filename?: string) => void;
2761
+ /**
2762
+ * Set theme mode
2763
+ * @param theme - 'light' or 'dark'
2764
+ */
2765
+ setTheme: (theme: ThemeMode) => void;
2766
+ /**
2767
+ * Set or update the ideal range
2768
+ * Pass null to remove the ideal range
2769
+ * @param range - Ideal range configuration or null to clear
2770
+ */
2771
+ setIdealRange: (range: IdealRangeConfig | null) => void;
2772
+ /**
2773
+ * Get the current ideal range configuration
2774
+ */
2775
+ getIdealRange: () => IdealRangeConfig | null;
2776
+ }
2777
+ /**
2778
+ * Default color schemes for common domains
2779
+ */
2780
+ declare const DEFAULT_COLORS: Record<string, Consumption7DaysColors>;
2781
+ /**
2782
+ * Theme color configurations
2783
+ */
2784
+ interface ThemeColors {
2785
+ /** Chart background color */
2786
+ chartBackground: string;
2787
+ /** Text color */
2788
+ text: string;
2789
+ /** Muted text color */
2790
+ textMuted: string;
2791
+ /** Grid line color */
2792
+ grid: string;
2793
+ /** Border color */
2794
+ border: string;
2795
+ /** Tooltip background */
2796
+ tooltipBackground: string;
2797
+ /** Tooltip text */
2798
+ tooltipText: string;
2799
+ }
2800
+ /**
2801
+ * Default theme colors for light and dark modes
2802
+ */
2803
+ declare const THEME_COLORS: Record<ThemeMode, ThemeColors>;
2804
+ /**
2805
+ * Default configuration values
2806
+ */
2807
+ declare const DEFAULT_CONFIG: {
2808
+ defaultPeriod: number;
2809
+ defaultChartType: ChartType;
2810
+ defaultVizMode: VizMode;
2811
+ defaultTheme: ThemeMode;
2812
+ cacheTTL: number;
2813
+ decimalPlaces: number;
2814
+ lineTension: number;
2815
+ pointRadius: number;
2816
+ borderWidth: number;
2817
+ fill: boolean;
2818
+ showLegend: boolean;
2819
+ enableExport: boolean;
2820
+ };
2821
+
2822
+ /**
2823
+ * RFC-0098: View Consumption Over 7 Days Component
2824
+ * Factory function to create a reusable consumption chart
2825
+ *
2826
+ * @example
2827
+ * ```typescript
2828
+ * import { createConsumption7DaysChart } from 'myio-js-library';
2829
+ *
2830
+ * const chart = createConsumption7DaysChart({
2831
+ * domain: 'energy',
2832
+ * containerId: 'lineChart',
2833
+ * unit: 'kWh',
2834
+ * unitLarge: 'MWh',
2835
+ * thresholdForLargeUnit: 1000,
2836
+ * fetchData: async (period) => fetchEnergyData(period),
2837
+ * });
2838
+ *
2839
+ * await chart.render();
2840
+ * ```
2841
+ */
2842
+
2843
+ /**
2844
+ * Creates a consumption chart instance with the given configuration
2845
+ *
2846
+ * @param config - Chart configuration options
2847
+ * @returns Chart instance with public API
2848
+ */
2849
+ declare function createConsumption7DaysChart(config: Consumption7DaysConfig): Consumption7DaysInstance;
2850
+
2851
+ /**
2852
+ * RFC-0098: Consumption Modal with MyIO Header
2853
+ *
2854
+ * Creates a fullscreen modal for the consumption chart using the standard
2855
+ * MyIO header with theme toggle, maximize, export and close buttons.
2856
+ *
2857
+ * @example
2858
+ * ```typescript
2859
+ * import { createConsumptionModal } from 'myio-js-library';
2860
+ *
2861
+ * const modal = createConsumptionModal({
2862
+ * domain: 'energy',
2863
+ * title: 'Consumo de Energia',
2864
+ * unit: 'kWh',
2865
+ * fetchData: async (period) => fetchEnergyData(period),
2866
+ * onClose: () => console.log('Modal closed'),
2867
+ * });
2868
+ *
2869
+ * await modal.open();
2870
+ * ```
2871
+ */
2872
+
2873
+ interface ConsumptionModalConfig extends Omit<Consumption7DaysConfig, 'containerId'> {
2874
+ /** Modal title */
2875
+ title?: string;
2876
+ /** Initial theme */
2877
+ theme?: ThemeMode;
2878
+ /** Callback when modal closes */
2879
+ onClose?: () => void;
2880
+ /** Container to append modal (default: document.body) */
2881
+ container?: HTMLElement;
2882
+ /** Export formats available (default: ['csv']) */
2883
+ exportFormats?: ExportFormat$1[];
2884
+ /** Custom export handler (receives format, default uses built-in CSV export) */
2885
+ onExport?: (format: ExportFormat$1) => void;
2886
+ }
2887
+ interface ConsumptionModalInstance {
2888
+ /** Opens the modal */
2889
+ open: () => Promise<void>;
2890
+ /** Closes the modal */
2891
+ close: () => void;
2892
+ /** Gets the chart instance */
2893
+ getChart: () => ReturnType<typeof createConsumption7DaysChart> | null;
2894
+ /** Destroys the modal and chart */
2895
+ destroy: () => void;
2896
+ }
2897
+ /**
2898
+ * Creates a consumption modal with the standard MyIO header
2899
+ */
2900
+ declare function createConsumptionModal(config: ConsumptionModalConfig): ConsumptionModalInstance;
2901
+
2902
+ /**
2903
+ * RFC-0098: Consumption Chart Widget
2904
+ *
2905
+ * Creates an inline chart widget that injects all HTML structure into a container.
2906
+ * Unlike createConsumptionModal (which creates a modal overlay), this component
2907
+ * renders directly into a specified container element.
2908
+ *
2909
+ * @example
2910
+ * ```typescript
2911
+ * import { createConsumptionChartWidget } from 'myio-js-library';
2912
+ *
2913
+ * const widget = createConsumptionChartWidget({
2914
+ * domain: 'energy',
2915
+ * containerId: 'energy-chart-container',
2916
+ * title: 'Consumo dos últimos 7 dias',
2917
+ * unit: 'kWh',
2918
+ * fetchData: async (period) => fetchEnergyData(period),
2919
+ * });
2920
+ *
2921
+ * await widget.render();
2922
+ * ```
2923
+ */
2924
+
2925
+ interface ConsumptionWidgetConfig extends Omit<Consumption7DaysConfig, 'containerId'> {
2926
+ /** ID of the container element where the widget will be rendered */
2927
+ containerId: string;
2928
+ /** Widget title (default: "Consumo dos últimos X dias") */
2929
+ title?: string;
2930
+ /** Show settings button (default: true) */
2931
+ showSettingsButton?: boolean;
2932
+ /** Show maximize button (default: true) */
2933
+ showMaximizeButton?: boolean;
2934
+ /** Show viz mode tabs (default: true) */
2935
+ showVizModeTabs?: boolean;
2936
+ /** Show chart type tabs (default: true) */
2937
+ showChartTypeTabs?: boolean;
2938
+ /** Chart height in pixels or CSS value (default: 300) */
2939
+ chartHeight?: number | string;
2940
+ /** Callback when settings button is clicked */
2941
+ onSettingsClick?: () => void;
2942
+ /** Callback when maximize button is clicked */
2943
+ onMaximizeClick?: () => void;
2944
+ /** Custom CSS class for the widget container */
2945
+ className?: string;
2946
+ }
2947
+ interface ConsumptionWidgetInstance {
2948
+ /** Renders the widget into the container */
2949
+ render: () => Promise<void>;
2950
+ /** Refreshes the chart data */
2951
+ refresh: (forceRefresh?: boolean) => Promise<void>;
2952
+ /** Sets the chart type */
2953
+ setChartType: (type: ChartType) => void;
2954
+ /** Sets the visualization mode */
2955
+ setVizMode: (mode: VizMode) => void;
2956
+ /** Sets the theme */
2957
+ setTheme: (theme: ThemeMode) => void;
2958
+ /** Sets the period in days */
2959
+ setPeriod: (days: number) => Promise<void>;
2960
+ /** Sets the ideal range */
2961
+ setIdealRange: (range: IdealRangeConfig | null) => void;
2962
+ /** Gets the internal chart instance */
2963
+ getChart: () => ReturnType<typeof createConsumption7DaysChart> | null;
2964
+ /** Gets the cached data */
2965
+ getCachedData: () => Consumption7DaysData | null;
2966
+ /** Exports data to CSV */
2967
+ exportCSV: (filename?: string) => void;
2968
+ /** Destroys the widget */
2969
+ destroy: () => void;
2970
+ }
2971
+ declare function createConsumptionChartWidget(config: ConsumptionWidgetConfig): ConsumptionWidgetInstance;
2972
+
2973
+ /**
2974
+ * RFC-0101: Export Data Smart Component Types
2975
+ *
2976
+ * Type definitions for the export data component system.
2977
+ */
2978
+ /** Domain types for data classification */
2979
+ type ExportDomain = 'energy' | 'water' | 'temperature';
2980
+ /** Supported export file formats */
2981
+ type ExportFormat = 'pdf' | 'xlsx' | 'csv';
2982
+ /** Export type determining data structure */
2983
+ type ExportType = 'one-device' | 'comparison' | 'one-customer' | 'group-of-customer';
2984
+ /** Custom color palette for exports */
2985
+ interface ExportColorsPallet {
2986
+ /** Primary brand color (default: MyIO purple #3e1a7d) */
2987
+ primary?: string;
2988
+ /** Secondary color for accents */
2989
+ secondary?: string;
2990
+ /** Accent color for highlights */
2991
+ accent?: string;
2992
+ /** Background color */
2993
+ background?: string;
2994
+ /** Text color */
2995
+ text?: string;
2996
+ /** Chart colors array */
2997
+ chartColors?: string[];
2998
+ }
2999
+ /** Configuration options for buildTemplateExport */
3000
+ interface BuildTemplateExportParams {
3001
+ /** Data domain (energy, water, temperature) */
3002
+ domain: ExportDomain;
3003
+ /** Output format (pdf, xlsx, csv) */
3004
+ formatExport: ExportFormat;
3005
+ /** Type of export data structure */
3006
+ typeExport: ExportType;
3007
+ /** Optional custom color palette */
3008
+ colorsPallet?: ExportColorsPallet;
3009
+ /** Locale for number/date formatting (default: 'pt-BR') */
3010
+ locale?: string;
3011
+ /** Include chart in export (PDF only) */
3012
+ includeChart?: boolean;
3013
+ /** Include statistics (min, max, avg) */
3014
+ includeStats?: boolean;
3015
+ /** Custom header text */
3016
+ headerText?: string;
3017
+ /** Custom footer text */
3018
+ footerText?: string;
3019
+ }
3020
+ /** Generated export configuration template */
3021
+ interface ExportConfigTemplate {
3022
+ /** Domain configuration */
3023
+ domain: ExportDomain;
3024
+ /** Format configuration */
3025
+ formatExport: ExportFormat;
3026
+ /** Export type */
3027
+ typeExport: ExportType;
3028
+ /** Resolved color palette */
3029
+ colors: Required<ExportColorsPallet>;
3030
+ /** Locale setting */
3031
+ locale: string;
3032
+ /** Chart inclusion flag */
3033
+ includeChart: boolean;
3034
+ /** Stats inclusion flag */
3035
+ includeStats: boolean;
3036
+ /** Header text */
3037
+ headerText: string;
3038
+ /** Footer text */
3039
+ footerText: string;
3040
+ /** Domain-specific icon */
3041
+ domainIcon: string;
3042
+ /** Domain label (localized) */
3043
+ domainLabel: string;
3044
+ /** Unit for the domain */
3045
+ domainUnit: string;
3046
+ }
3047
+ /** Single data point with timestamp and value */
3048
+ interface ExportDataPoint {
3049
+ /** Timestamp of the measurement */
3050
+ timestamp: Date | string | number;
3051
+ /** Measured value */
3052
+ value: number;
3053
+ /** Optional unit override */
3054
+ unit?: string;
3055
+ }
3056
+ /** Device information for export */
3057
+ interface ExportDeviceInfo {
3058
+ /** Device identifier (e.g., '113CD') */
3059
+ identifier?: string;
3060
+ /** Device label (display name) */
3061
+ label?: string;
3062
+ /** Device name (fallback if no label) */
3063
+ name: string;
3064
+ /** Device icon (optional) */
3065
+ icon?: string;
3066
+ }
3067
+ /** Customer/Shopping information */
3068
+ interface ExportCustomerInfo {
3069
+ /** Customer name */
3070
+ customerName?: string;
3071
+ /** Shopping/location name */
3072
+ shoppingName?: string;
3073
+ /** Customer logo URL (for PDF) */
3074
+ logoUrl?: string;
3075
+ }
3076
+ /** Complete data structure for export */
3077
+ interface ExportData {
3078
+ /** Device information */
3079
+ device: ExportDeviceInfo;
3080
+ /** Customer information */
3081
+ customer?: ExportCustomerInfo;
3082
+ /** Data points array */
3083
+ data: ExportDataPoint[];
3084
+ /** Period start date */
3085
+ periodStart?: Date | string;
3086
+ /** Period end date */
3087
+ periodEnd?: Date | string;
3088
+ }
3089
+ /** Data structure for comparison exports */
3090
+ interface ExportComparisonData {
3091
+ /** Array of devices with their data */
3092
+ devices: Array<ExportData>;
3093
+ /** Customer information */
3094
+ customer?: ExportCustomerInfo;
3095
+ /** Period start date */
3096
+ periodStart?: Date | string;
3097
+ /** Period end date */
3098
+ periodEnd?: Date | string;
3099
+ }
3100
+ /** Data structure for customer exports */
3101
+ interface ExportCustomerData {
3102
+ /** Customer information */
3103
+ customer: ExportCustomerInfo;
3104
+ /** Array of devices with their data */
3105
+ devices: Array<ExportData>;
3106
+ /** Period start date */
3107
+ periodStart?: Date | string;
3108
+ /** Period end date */
3109
+ periodEnd?: Date | string;
3110
+ }
3111
+ /** Data structure for group of customers exports */
3112
+ interface ExportGroupData {
3113
+ /** Group name */
3114
+ groupName: string;
3115
+ /** Array of customers with their data */
3116
+ customers: Array<ExportCustomerData>;
3117
+ /** Period start date */
3118
+ periodStart?: Date | string;
3119
+ /** Period end date */
3120
+ periodEnd?: Date | string;
3121
+ }
3122
+ /** Union type for all export data types */
3123
+ type ExportDataInput = ExportData | ExportComparisonData | ExportCustomerData | ExportGroupData;
3124
+ /** Calculated statistics for a data series */
3125
+ interface ExportStats {
3126
+ /** Minimum value in the period */
3127
+ min: number;
3128
+ /** Maximum value in the period */
3129
+ max: number;
3130
+ /** Average value in the period */
3131
+ average: number;
3132
+ /** Sum of all values */
3133
+ sum: number;
3134
+ /** Number of data points */
3135
+ count: number;
3136
+ }
3137
+ /** Export result with file information */
3138
+ interface ExportResult {
3139
+ /** Whether export was successful */
3140
+ success: boolean;
3141
+ /** Generated filename */
3142
+ filename: string;
3143
+ /** File blob (for download) */
3144
+ blob?: Blob;
3145
+ /** Data URL (for preview) */
3146
+ dataUrl?: string;
3147
+ /** Error message if failed */
3148
+ error?: string;
3149
+ }
3150
+ /** Export instance returned by myioExportData */
3151
+ interface ExportDataInstance {
3152
+ /** Execute the export and get result */
3153
+ export: () => Promise<ExportResult>;
3154
+ /** Download the exported file */
3155
+ download: () => Promise<void>;
3156
+ /** Get preview data URL (PDF only) */
3157
+ preview: () => Promise<string | null>;
3158
+ /** Get calculated statistics */
3159
+ getStats: () => ExportStats;
3160
+ /** Get generated filename */
3161
+ getFilename: () => string;
3162
+ }
3163
+ /** Progress callback for large exports */
3164
+ type ExportProgressCallback = (progress: number, message: string) => void;
3165
+ /** Options for the export function */
3166
+ interface ExportOptions {
3167
+ /** Progress callback */
3168
+ onProgress?: ExportProgressCallback;
3169
+ /** Auto-download after export */
3170
+ autoDownload?: boolean;
3171
+ }
3172
+
3173
+ /**
3174
+ * RFC-0101: Export Data Smart Component
3175
+ *
3176
+ * A two-part smart component system for exporting device data
3177
+ * in multiple formats (PDF, XLS, CSV) across different domains
3178
+ * (temperature, water, energy).
3179
+ *
3180
+ * @example
3181
+ * ```typescript
3182
+ * import { buildTemplateExport, myioExportData } from 'myio-js-library';
3183
+ *
3184
+ * // 1. Create configuration template
3185
+ * const config = buildTemplateExport({
3186
+ * domain: 'energy',
3187
+ * formatExport: 'pdf',
3188
+ * typeExport: 'one-device',
3189
+ * });
3190
+ *
3191
+ * // 2. Export data
3192
+ * const exporter = myioExportData(data, config);
3193
+ * await exporter.download();
3194
+ * ```
3195
+ */
3196
+
3197
+ /**
3198
+ * Generates filename based on export config and data
3199
+ */
3200
+ declare function generateFilename(data: ExportDataInput, config: ExportConfigTemplate): string;
3201
+ /**
3202
+ * Calculates statistics from data points
3203
+ */
3204
+ declare function calculateStats(dataPoints: ExportDataPoint[]): ExportStats;
3205
+ /**
3206
+ * Creates an export configuration template
3207
+ *
3208
+ * @param params - Configuration parameters
3209
+ * @returns Export configuration template
3210
+ *
3211
+ * @example
3212
+ * ```typescript
3213
+ * const config = buildTemplateExport({
3214
+ * domain: 'energy',
3215
+ * formatExport: 'pdf',
3216
+ * typeExport: 'one-device',
3217
+ * colorsPallet: { primary: '#ff0000' },
3218
+ * });
3219
+ * ```
3220
+ */
3221
+ declare function buildTemplateExport(params: BuildTemplateExportParams): ExportConfigTemplate;
3222
+ /**
3223
+ * Creates an export instance with the provided data and configuration
3224
+ *
3225
+ * @param data - Data to export
3226
+ * @param config - Export configuration template
3227
+ * @param options - Optional export options
3228
+ * @returns Export data instance
3229
+ *
3230
+ * @example
3231
+ * ```typescript
3232
+ * const exporter = myioExportData(deviceData, config);
3233
+ * await exporter.download();
3234
+ * ```
3235
+ */
3236
+ declare function myioExportData(data: ExportDataInput, config: ExportConfigTemplate, options?: ExportOptions): ExportDataInstance;
3237
+ /** Default colors for exports */
3238
+ declare const EXPORT_DEFAULT_COLORS: Required<ExportColorsPallet>;
3239
+ /** Domain icons */
3240
+ declare const EXPORT_DOMAIN_ICONS: Record<ExportDomain, string>;
3241
+ /** Domain labels */
3242
+ declare const EXPORT_DOMAIN_LABELS: Record<ExportDomain, string>;
3243
+ /** Domain units */
3244
+ declare const EXPORT_DOMAIN_UNITS: Record<ExportDomain, string>;
3245
+
3246
+ export { type BuildTemplateExportParams, CHART_COLORS, DEFAULT_COLORS as CONSUMPTION_CHART_COLORS, DEFAULT_CONFIG as CONSUMPTION_CHART_DEFAULTS, THEME_COLORS as CONSUMPTION_THEME_COLORS, type ChartDomain, type ClampRange, ConnectionStatusType, type Consumption7DaysColors, type Consumption7DaysConfig, type Consumption7DaysData, type Consumption7DaysInstance, type ChartType as ConsumptionChartType, type ConsumptionDataPoint, type IdealRangeConfig as ConsumptionIdealRangeConfig, type ConsumptionModalConfig, type ConsumptionModalInstance, type TemperatureConfig as ConsumptionTemperatureConfig, type TemperatureReferenceLine as ConsumptionTemperatureReferenceLine, type ThemeColors as ConsumptionThemeColors, type ThemeMode as ConsumptionThemeMode, type VizMode as ConsumptionVizMode, type ConsumptionWidgetConfig, type ConsumptionWidgetInstance, type CreateDateRangePickerOptions, type CreateInputDateRangePickerInsideDIVParams, DEFAULT_CLAMP_RANGE, type DateRangeControl, type DateRangeInputController, type DateRangeResult, type DemandModalInstance, type DemandModalParams, type DemandModalPdfConfig, type DemandModalStyles, DeviceStatusType, EXPORT_DEFAULT_COLORS, EXPORT_DOMAIN_ICONS, EXPORT_DOMAIN_LABELS, EXPORT_DOMAIN_UNITS, type EnergyModalContext, type EnergyModalError, type EnergyModalI18n, type EnergyModalStyleOverrides, type ExportColorsPallet, type ExportComparisonData, type ExportConfigTemplate, type ExportCustomerData, type ExportCustomerInfo, type ExportData, type ExportDataInput, type ExportDataInstance, type ExportDataPoint, type ExportDeviceInfo, type ExportDomain, type ExportFormat, type ExportGroupData, type ExportOptions, type ExportProgressCallback, type ExportResult, type ExportStats, type ExportType, type ExportFormat$1 as ModalExportFormat, type ModalHeaderConfig, type ModalHeaderInstance, type ModalTheme, type MyIOAuthConfig, type MyIOAuthInstance, MyIOChartModal, MyIODraggableCard, MyIOSelectionStore, MyIOSelectionStoreClass, MyIOToast, type OpenDashboardPopupEnergyOptions, type OpenDashboardPopupSettingsParams, type OpenDashboardPopupWaterTankOptions, type PersistResult, type RealTimeTelemetryInstance, type RealTimeTelemetryParams, type SettingsError, type SettingsEvent, type ShoppingDataPoint, type StoreRow, type TbScope, type TelemetryFetcher, type TemperatureComparisonModalInstance, type TemperatureComparisonModalParams, type TemperatureDevice, type TemperatureGranularity, type TemperatureModalInstance, type TemperatureModalParams, type TemperatureSettingsInstance, type TemperatureSettingsParams, type TemperatureStats, type TemperatureTelemetry, type ThingsboardCustomerAttrsConfig, type TimedValue, type WaterRow, type WaterTankDataPoint, type WaterTankModalContext, type WaterTankModalError, type WaterTankModalI18n, type WaterTankModalStyleOverrides, type WaterTankTelemetryData, addDetectionContext, addNamespace, aggregateByDay, averageByDay, buildListItemsThingsboardByUniqueDatasource, buildMyioIngestionAuth, buildTemplateExport, buildWaterReportCSV, buildWaterStoresCSV, calcDeltaPercent, calculateDeviceStatus, calculateDeviceStatusWithRanges, calculateStats as calculateExportStats, calculateStats$1 as calculateStats, clampTemperature, classify, classifyWaterLabel, classifyWaterLabels, clearAllAuthCaches, connectionStatusIcons, createConsumption7DaysChart, createConsumptionChartWidget, createConsumptionModal, createDateRangePicker, createInputDateRangePickerInsideDIV, createModalHeader, decodePayload, decodePayloadBase64Xor, detectDeviceType, determineInterval, deviceStatusIcons, exportTemperatureCSV, exportToCSV, exportToCSVAll, extractMyIOCredentials, fetchTemperatureData, fetchThingsboardCustomerAttrsFromStorage, fetchThingsboardCustomerServerScopeAttrs, findValue, findValueWithDefault, fmtPerc$1 as fmtPerc, fmtPerc as fmtPercLegacy, formatAllInSameUnit, formatAllInSameWaterUnit, formatDateForInput, formatDateToYMD, formatDateWithTimezoneOffset, formatDuration, formatEnergy, formatNumberReadable, formatRelativeTime, formatTankHeadFromCm, formatTemperature, formatWater, formatWaterByGroup, formatWaterVolumeM3, formatarDuracao, generateFilename as generateExportFilename, getAuthCacheStats, getAvailableContexts, getConnectionStatusIcon, getDateRangeArray, getDeviceStatusIcon, getDeviceStatusInfo, getModalHeaderStyles, getSaoPauloISOString, getSaoPauloISOStringFixed, getValueByDatakey, getValueByDatakeyLegacy, getWaterCategories, groupByDay, interpolateTemperature, isDeviceOffline, isValidConnectionStatus, isValidDeviceStatus, isWaterCategory, mapConnectionStatus, mapDeviceStatusToCardStatus, mapDeviceToConnectionStatus, myioExportData, normalizeRecipients, numbers, openDashboardPopup, openDashboardPopupAllReport, openDashboardPopupEnergy, openDashboardPopupReport, openDashboardPopupSettings, openDashboardPopupWaterTank, openDemandModal, openGoalsPanel, openRealTimeTelemetryModal, openTemperatureComparisonModal, openTemperatureModal, openTemperatureSettingsModal, parseInputDateToDate, renderCardComponent$2 as renderCardComponent, renderCardComponent$1 as renderCardComponentEnhanced, renderCardComponentHeadOffice, renderCardComponentLegacy, renderCardComponentV2, renderCardComponent as renderCardComponentV5, renderCardComponentV5 as renderCardV5, shouldFlashIcon, strings, timeWindowFromInputYMD, toCSV, toFixedSafe, waterDeviceStatusIcons };