@texturehq/edges 2.6.0 → 2.6.1
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/{colors-BbO4TbGH.d.ts → colors-DDHuxvI2.d.ts} +0 -54
- package/dist/{colors-fisZABpX.d.cts → colors-OWPD19TC.d.cts} +0 -54
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server.cjs +2 -2
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BreadcrumbProps, BreadcrumbsProps, DateValue, CalendarProps as CalendarProps$1, ValidationResult, DisclosureGroupProps, DisclosurePanelProps, ButtonProps, DisclosureProps, DateRangePickerProps as DateRangePickerProps$1, FormProps, TooltipTriggerComponentProps, TooltipProps as TooltipProps$1, ListBoxProps as ListBoxProps$1, ListBoxItemProps, ModalOverlayProps, Key, PopoverProps as PopoverProps$1, ProgressBarProps as ProgressBarProps$1, RangeCalendarProps as RangeCalendarProps$1, TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps, TabsProps as TabsProps$2 } from 'react-aria-components';
|
|
2
2
|
export { BreadcrumbProps, BreadcrumbsProps, DialogTrigger } from 'react-aria-components';
|
|
3
|
-
import { B as BadgeProps, aa as FieldValue, ab as BooleanFormat, ac as FormattedValue, ad as FieldFormat, ae as CurrentFormat, af as DateFormat, ag as DistanceFormat, ah as EnergyUnit, ai as EnergyFormat, aj as CurrencyFormat, ak as NumberFormat, al as PhoneFormat, am as PowerFormat, an as FormatterFunction, ao as ResistanceFormat, ap as TemperatureFormat, aq as TemperatureUnitString, ar as TemperatureUnit, as as TextFormat, at as VoltageFormat, e as BaseDataPoint, O as YFormatType, F as TooltipData, au as DeviceState, av as GridState, aw as ComponentFormatter, ax as LayerSpec, ay as CustomPinsSpec, az as GeoJsonLayerSpec, aA as RasterLayerSpec, aB as VectorLayerSpec, aC as ClusteredVectorLayerSpec } from './colors-
|
|
4
|
-
export { A as ABSENT_GRID_FIELDS, a as ActionItem, aD as ActionMenu, b as ActionMenuProps, aE as AppShell, c as AppShellProps, aF as Avatar, d as AvatarProps, aG as Badge, aH as BaseFormat, aI as ChartContext, C as ChartMargin, aJ as CodeEditor, f as CodeEditorProps, g as CodeLanguage, h as CodeTheme, aK as ColorSpec, aL as ComponentFormatOptions, aM as CurrentUnit, aN as CustomFormat, aO as DEFAULT_MAP_TYPE, aP as DateFormatStyle, aQ as DistanceUnit, aR as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, i as EntityArchetype, aS as EntityCategory, aT as EntityCategoryConfig, j as EntityConfig, k as EntityStateRule, l as EntityType, G as GRID_ELEMENT_TYPE_BY_ENTITY, aU as GRID_STATE_COLORS, m as GRID_STAT_LIST, n as GridElementSourceType, o as GridStatField, p as GridStatFieldFormat, aV as GridStateColor, H as HEADLINE_METRIC_BOUNDS, q as Heading, r as HeadlineMetric, aW as InteractiveMap, aX as InteractiveMapHandle, I as InteractiveMapProps, aY as LayerFeature, aZ as LayerStyle, L as Loader, s as Logo, a_ as MAP_TYPES, M as MapPoint, a$ as MapType, b0 as Meter, t as MeterProps, b1 as MetricFormat, u as MetricSource, b2 as PercentageFormat, b3 as PowerUnit, b4 as RenderType, b5 as ResistanceUnit, S as SegmentOption, b6 as SegmentedControl, v as SegmentedControlProps, w as SerializableFieldFormat, x as SideNav, y as SideNavItem, z as SideNavProps, b7 as StackNav, b8 as StackNavGroup, b9 as StackNavItem, ba as StackNavLinkComponentProps, bb as StackNavProps, bc as StackNavTheme, bd as StaticMap, D as StaticMapProps, T as TextLink, be as TextTransform, bf as TextTruncatePosition, J as TooltipSeries, K as TopNav, N as TopNavProps, bg as VoltageUnit, Y as YFormatSettings, bh as ZoomStops, bi as activeDeviceStates, P as archetypeFor, bj as baselineFromPoint, Q as clearColorCache, R as createCategoryColorMap, U as createXScale, V as createYScale, W as defaultMargin, bk as deviceStateLabels, bl as deviceStateMetricFormats, X as entityHasDetailPage, Z as entityHasStatList, _ as entityShowsNow, bm as formatComponentValue, $ as getContrastingTextColor, a0 as getDefaultChartColor, a1 as getDefaultColors, bn as getDeviceStateDisplayLabel, bn as getDeviceStateLabel, bo as getEntityCategory, a2 as getEntityConfig, a3 as getEntityIcon, a4 as getEntityLabel, a5 as getEntityStatList, bp as getGridStateLabel, a6 as getResolvedColor, a7 as getThemeCategoricalColors, a8 as getYFormatSettings, bq as gridStateLabels, br as isActiveDeviceState, br as isActiveState, a9 as isLightColor, bs as mapValuesToCategoricalColors, bt as useChartContext, bu as useComponentFormatter } from './colors-
|
|
3
|
+
import { B as BadgeProps, aa as FieldValue, ab as BooleanFormat, ac as FormattedValue, ad as FieldFormat, ae as CurrentFormat, af as DateFormat, ag as DistanceFormat, ah as EnergyUnit, ai as EnergyFormat, aj as CurrencyFormat, ak as NumberFormat, al as PhoneFormat, am as PowerFormat, an as FormatterFunction, ao as ResistanceFormat, ap as TemperatureFormat, aq as TemperatureUnitString, ar as TemperatureUnit, as as TextFormat, at as VoltageFormat, e as BaseDataPoint, O as YFormatType, F as TooltipData, au as DeviceState, av as GridState, aw as ComponentFormatter, ax as LayerSpec, ay as CustomPinsSpec, az as GeoJsonLayerSpec, aA as RasterLayerSpec, aB as VectorLayerSpec, aC as ClusteredVectorLayerSpec } from './colors-OWPD19TC.cjs';
|
|
4
|
+
export { A as ABSENT_GRID_FIELDS, a as ActionItem, aD as ActionMenu, b as ActionMenuProps, aE as AppShell, c as AppShellProps, aF as Avatar, d as AvatarProps, aG as Badge, aH as BaseFormat, aI as ChartContext, C as ChartMargin, aJ as CodeEditor, f as CodeEditorProps, g as CodeLanguage, h as CodeTheme, aK as ColorSpec, aL as ComponentFormatOptions, aM as CurrentUnit, aN as CustomFormat, aO as DEFAULT_MAP_TYPE, aP as DateFormatStyle, aQ as DistanceUnit, aR as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, i as EntityArchetype, aS as EntityCategory, aT as EntityCategoryConfig, j as EntityConfig, k as EntityStateRule, l as EntityType, G as GRID_ELEMENT_TYPE_BY_ENTITY, aU as GRID_STATE_COLORS, m as GRID_STAT_LIST, n as GridElementSourceType, o as GridStatField, p as GridStatFieldFormat, aV as GridStateColor, H as HEADLINE_METRIC_BOUNDS, q as Heading, r as HeadlineMetric, aW as InteractiveMap, aX as InteractiveMapHandle, I as InteractiveMapProps, aY as LayerFeature, aZ as LayerStyle, L as Loader, s as Logo, a_ as MAP_TYPES, M as MapPoint, a$ as MapType, b0 as Meter, t as MeterProps, b1 as MetricFormat, u as MetricSource, b2 as PercentageFormat, b3 as PowerUnit, b4 as RenderType, b5 as ResistanceUnit, S as SegmentOption, b6 as SegmentedControl, v as SegmentedControlProps, w as SerializableFieldFormat, x as SideNav, y as SideNavItem, z as SideNavProps, b7 as StackNav, b8 as StackNavGroup, b9 as StackNavItem, ba as StackNavLinkComponentProps, bb as StackNavProps, bc as StackNavTheme, bd as StaticMap, D as StaticMapProps, T as TextLink, be as TextTransform, bf as TextTruncatePosition, J as TooltipSeries, K as TopNav, N as TopNavProps, bg as VoltageUnit, Y as YFormatSettings, bh as ZoomStops, bi as activeDeviceStates, P as archetypeFor, bj as baselineFromPoint, Q as clearColorCache, R as createCategoryColorMap, U as createXScale, V as createYScale, W as defaultMargin, bk as deviceStateLabels, bl as deviceStateMetricFormats, X as entityHasDetailPage, Z as entityHasStatList, _ as entityShowsNow, bm as formatComponentValue, $ as getContrastingTextColor, a0 as getDefaultChartColor, a1 as getDefaultColors, bn as getDeviceStateDisplayLabel, bn as getDeviceStateLabel, bo as getEntityCategory, a2 as getEntityConfig, a3 as getEntityIcon, a4 as getEntityLabel, a5 as getEntityStatList, bp as getGridStateLabel, a6 as getResolvedColor, a7 as getThemeCategoricalColors, a8 as getYFormatSettings, bq as gridStateLabels, br as isActiveDeviceState, br as isActiveState, a9 as isLightColor, bs as mapValuesToCategoricalColors, bt as useChartContext, bu as useComponentFormatter } from './colors-OWPD19TC.cjs';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import * as React$1 from 'react';
|
|
7
7
|
import React__default, { ReactNode, RefObject, HTMLAttributes, ComponentProps, ComponentType, CSSProperties, Component, ErrorInfo } from 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BreadcrumbProps, BreadcrumbsProps, DateValue, CalendarProps as CalendarProps$1, ValidationResult, DisclosureGroupProps, DisclosurePanelProps, ButtonProps, DisclosureProps, DateRangePickerProps as DateRangePickerProps$1, FormProps, TooltipTriggerComponentProps, TooltipProps as TooltipProps$1, ListBoxProps as ListBoxProps$1, ListBoxItemProps, ModalOverlayProps, Key, PopoverProps as PopoverProps$1, ProgressBarProps as ProgressBarProps$1, RangeCalendarProps as RangeCalendarProps$1, TabProps as TabProps$1, TabListProps as TabListProps$1, TabPanelProps, TabsProps as TabsProps$2 } from 'react-aria-components';
|
|
2
2
|
export { BreadcrumbProps, BreadcrumbsProps, DialogTrigger } from 'react-aria-components';
|
|
3
|
-
import { B as BadgeProps, aa as FieldValue, ab as BooleanFormat, ac as FormattedValue, ad as FieldFormat, ae as CurrentFormat, af as DateFormat, ag as DistanceFormat, ah as EnergyUnit, ai as EnergyFormat, aj as CurrencyFormat, ak as NumberFormat, al as PhoneFormat, am as PowerFormat, an as FormatterFunction, ao as ResistanceFormat, ap as TemperatureFormat, aq as TemperatureUnitString, ar as TemperatureUnit, as as TextFormat, at as VoltageFormat, e as BaseDataPoint, O as YFormatType, F as TooltipData, au as DeviceState, av as GridState, aw as ComponentFormatter, ax as LayerSpec, ay as CustomPinsSpec, az as GeoJsonLayerSpec, aA as RasterLayerSpec, aB as VectorLayerSpec, aC as ClusteredVectorLayerSpec } from './colors-
|
|
4
|
-
export { A as ABSENT_GRID_FIELDS, a as ActionItem, aD as ActionMenu, b as ActionMenuProps, aE as AppShell, c as AppShellProps, aF as Avatar, d as AvatarProps, aG as Badge, aH as BaseFormat, aI as ChartContext, C as ChartMargin, aJ as CodeEditor, f as CodeEditorProps, g as CodeLanguage, h as CodeTheme, aK as ColorSpec, aL as ComponentFormatOptions, aM as CurrentUnit, aN as CustomFormat, aO as DEFAULT_MAP_TYPE, aP as DateFormatStyle, aQ as DistanceUnit, aR as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, i as EntityArchetype, aS as EntityCategory, aT as EntityCategoryConfig, j as EntityConfig, k as EntityStateRule, l as EntityType, G as GRID_ELEMENT_TYPE_BY_ENTITY, aU as GRID_STATE_COLORS, m as GRID_STAT_LIST, n as GridElementSourceType, o as GridStatField, p as GridStatFieldFormat, aV as GridStateColor, H as HEADLINE_METRIC_BOUNDS, q as Heading, r as HeadlineMetric, aW as InteractiveMap, aX as InteractiveMapHandle, I as InteractiveMapProps, aY as LayerFeature, aZ as LayerStyle, L as Loader, s as Logo, a_ as MAP_TYPES, M as MapPoint, a$ as MapType, b0 as Meter, t as MeterProps, b1 as MetricFormat, u as MetricSource, b2 as PercentageFormat, b3 as PowerUnit, b4 as RenderType, b5 as ResistanceUnit, S as SegmentOption, b6 as SegmentedControl, v as SegmentedControlProps, w as SerializableFieldFormat, x as SideNav, y as SideNavItem, z as SideNavProps, b7 as StackNav, b8 as StackNavGroup, b9 as StackNavItem, ba as StackNavLinkComponentProps, bb as StackNavProps, bc as StackNavTheme, bd as StaticMap, D as StaticMapProps, T as TextLink, be as TextTransform, bf as TextTruncatePosition, J as TooltipSeries, K as TopNav, N as TopNavProps, bg as VoltageUnit, Y as YFormatSettings, bh as ZoomStops, bi as activeDeviceStates, P as archetypeFor, bj as baselineFromPoint, Q as clearColorCache, R as createCategoryColorMap, U as createXScale, V as createYScale, W as defaultMargin, bk as deviceStateLabels, bl as deviceStateMetricFormats, X as entityHasDetailPage, Z as entityHasStatList, _ as entityShowsNow, bm as formatComponentValue, $ as getContrastingTextColor, a0 as getDefaultChartColor, a1 as getDefaultColors, bn as getDeviceStateDisplayLabel, bn as getDeviceStateLabel, bo as getEntityCategory, a2 as getEntityConfig, a3 as getEntityIcon, a4 as getEntityLabel, a5 as getEntityStatList, bp as getGridStateLabel, a6 as getResolvedColor, a7 as getThemeCategoricalColors, a8 as getYFormatSettings, bq as gridStateLabels, br as isActiveDeviceState, br as isActiveState, a9 as isLightColor, bs as mapValuesToCategoricalColors, bt as useChartContext, bu as useComponentFormatter } from './colors-
|
|
3
|
+
import { B as BadgeProps, aa as FieldValue, ab as BooleanFormat, ac as FormattedValue, ad as FieldFormat, ae as CurrentFormat, af as DateFormat, ag as DistanceFormat, ah as EnergyUnit, ai as EnergyFormat, aj as CurrencyFormat, ak as NumberFormat, al as PhoneFormat, am as PowerFormat, an as FormatterFunction, ao as ResistanceFormat, ap as TemperatureFormat, aq as TemperatureUnitString, ar as TemperatureUnit, as as TextFormat, at as VoltageFormat, e as BaseDataPoint, O as YFormatType, F as TooltipData, au as DeviceState, av as GridState, aw as ComponentFormatter, ax as LayerSpec, ay as CustomPinsSpec, az as GeoJsonLayerSpec, aA as RasterLayerSpec, aB as VectorLayerSpec, aC as ClusteredVectorLayerSpec } from './colors-DDHuxvI2.js';
|
|
4
|
+
export { A as ABSENT_GRID_FIELDS, a as ActionItem, aD as ActionMenu, b as ActionMenuProps, aE as AppShell, c as AppShellProps, aF as Avatar, d as AvatarProps, aG as Badge, aH as BaseFormat, aI as ChartContext, C as ChartMargin, aJ as CodeEditor, f as CodeEditorProps, g as CodeLanguage, h as CodeTheme, aK as ColorSpec, aL as ComponentFormatOptions, aM as CurrentUnit, aN as CustomFormat, aO as DEFAULT_MAP_TYPE, aP as DateFormatStyle, aQ as DistanceUnit, aR as ENTITY_CATEGORY_CONFIG, E as ENTITY_CONFIG, i as EntityArchetype, aS as EntityCategory, aT as EntityCategoryConfig, j as EntityConfig, k as EntityStateRule, l as EntityType, G as GRID_ELEMENT_TYPE_BY_ENTITY, aU as GRID_STATE_COLORS, m as GRID_STAT_LIST, n as GridElementSourceType, o as GridStatField, p as GridStatFieldFormat, aV as GridStateColor, H as HEADLINE_METRIC_BOUNDS, q as Heading, r as HeadlineMetric, aW as InteractiveMap, aX as InteractiveMapHandle, I as InteractiveMapProps, aY as LayerFeature, aZ as LayerStyle, L as Loader, s as Logo, a_ as MAP_TYPES, M as MapPoint, a$ as MapType, b0 as Meter, t as MeterProps, b1 as MetricFormat, u as MetricSource, b2 as PercentageFormat, b3 as PowerUnit, b4 as RenderType, b5 as ResistanceUnit, S as SegmentOption, b6 as SegmentedControl, v as SegmentedControlProps, w as SerializableFieldFormat, x as SideNav, y as SideNavItem, z as SideNavProps, b7 as StackNav, b8 as StackNavGroup, b9 as StackNavItem, ba as StackNavLinkComponentProps, bb as StackNavProps, bc as StackNavTheme, bd as StaticMap, D as StaticMapProps, T as TextLink, be as TextTransform, bf as TextTruncatePosition, J as TooltipSeries, K as TopNav, N as TopNavProps, bg as VoltageUnit, Y as YFormatSettings, bh as ZoomStops, bi as activeDeviceStates, P as archetypeFor, bj as baselineFromPoint, Q as clearColorCache, R as createCategoryColorMap, U as createXScale, V as createYScale, W as defaultMargin, bk as deviceStateLabels, bl as deviceStateMetricFormats, X as entityHasDetailPage, Z as entityHasStatList, _ as entityShowsNow, bm as formatComponentValue, $ as getContrastingTextColor, a0 as getDefaultChartColor, a1 as getDefaultColors, bn as getDeviceStateDisplayLabel, bn as getDeviceStateLabel, bo as getEntityCategory, a2 as getEntityConfig, a3 as getEntityIcon, a4 as getEntityLabel, a5 as getEntityStatList, bp as getGridStateLabel, a6 as getResolvedColor, a7 as getThemeCategoricalColors, a8 as getYFormatSettings, bq as gridStateLabels, br as isActiveDeviceState, br as isActiveState, a9 as isLightColor, bs as mapValuesToCategoricalColors, bt as useChartContext, bu as useComponentFormatter } from './colors-DDHuxvI2.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import * as React$1 from 'react';
|
|
7
7
|
import React__default, { ReactNode, RefObject, HTMLAttributes, ComponentProps, ComponentType, CSSProperties, Component, ErrorInfo } from 'react';
|
package/dist/index.js
CHANGED
|
@@ -44,5 +44,5 @@ import {TooltipTrigger,Tooltip,OverlayArrow,composeRenderProps,DialogTrigger,Men
|
|
|
44
44
|
`;return}else Y.tagName;}for(let Y=0;Y<L.childNodes.length;Y++)O(L.childNodes[Y]);};return O(j),Q},[]),R=useCallback((j,Q)=>{let O=document.createTreeWalker(j,NodeFilter.SHOW_TEXT,{acceptNode:I=>{let F=I.parentElement;return F&&F.closest("[data-chip-id]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),L=O.nextNode(),Y=Math.max(0,Q);for(;L;){let I=L.nodeValue||"";if(I.length>=Y){let F=document.createRange();F.setStart(L,Y),F.collapse(true);let U=window.getSelection();U?.removeAllRanges(),U?.addRange(F);return}Y-=I.length,L=O.nextNode();}let P=window.getSelection(),C=document.createRange();C.selectNodeContents(j),C.collapse(false),P?.removeAllRanges(),P?.addRange(C);},[]);useEffect(()=>{N.current&&!m&&N.current.textContent!==""&&(N.current.textContent="");},[m]),useLayoutEffect(()=>{if(N.current){if(m===""){if(M)try{N.current.focus({preventScroll:!0}),R(N.current,0);}catch{}return}if(E.current!=null)try{R(N.current,E.current);}finally{E.current=null;}}},[m,R,M]);let H=useCallback((j,Q)=>{if(p?.(j),j===""){x?.();return}if(h&&b&&Q!==void 0){let O=j.slice(0,Q),L=typeof h=="string"?new RegExp(`\\${h}([^\\s]*)$`):h,Y=O.match(L);if(Y){let P=Y[1]||"",C=Q-Y[0].length;b({query:P,position:Q,startIndex:C});}else x?.();}},[p,h,b,x]),G=useCallback(j=>{if(!f||!p)return;let Q=g.filter(L=>L.id!==j);f(Q);let O=m.replace(new RegExp(`\\{\\{${j}\\}\\}`,"g"),"");p(O);},[g,f,m,p]),K=useCallback(j=>y?y(j,()=>G(j.id)):jsx(eo,{variant:v,size:A,onRemove:c?void 0:()=>G(j.id),isDisabled:c,className:"py-0.5 px-1.5 gap-1 text-xs leading-none rounded-md",children:j.label},j.id),[y,v,A,G,c]),W=()=>{let j=zt({isInvalid:s,isDisabled:c,isFocused:M,transparent:i,size:o}),Q=`min-h-[100px] py-2 px-3 ${c?"resize-none":l?"resize-y":"resize-none"}`,O=twMerge("focus:outline-none overflow-auto","[&_[data-chip-id]::selection]:bg-action-primary/20","[&:empty]:before:content-[attr(data-placeholder)] [&:empty]:before:text-text-disabled [&:empty]:before:pointer-events-none");return twMerge(j,Q,O,d)},q=()=>m?m.split(/(\{\{[^}]+\}\})/g).map((Q,O)=>{let L=Q.match(/\{\{([^}]+)\}\}/);if(L){let Y=L[1],P=g.find(C=>C.id===Y);if(P)return jsx("span",{className:"inline-block align-baseline cursor-pointer",contentEditable:false,suppressContentEditableWarning:true,"data-chip-id":Y,style:{userSelect:"none",verticalAlign:"baseline",lineHeight:"1"},onClick:C=>{C.preventDefault();let I=window.getSelection(),F=document.createRange();F.selectNode(C.currentTarget),I?.removeAllRanges(),I?.addRange(F);},children:K(P)},`chip-${Y}-${O}`)}return Q.includes(`
|
|
45
45
|
`)?Q.split(`
|
|
46
46
|
`).map((Y,P)=>jsxs(Oe__default.Fragment,{children:[Y,P<Q.split(`
|
|
47
|
-
`).length-1&&jsx("br",{})]},`line-${O}-${P}`)):Q}):null;return jsx("div",{className:"group flex flex-col",children:jsxs("div",{className:"flex flex-col",children:[e&&jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsx(yt,{children:jsx("div",{ref:N,contentEditable:!c,suppressContentEditableWarning:true,onInput:j=>{if(c)return;let Q=j.target,O=Q.querySelector("[data-chip-id]")!==null,L;if(O?(L=D(Q),L=L.replace(/(\{\{[^}]+\}\})\s{2,}/g,"$1 ").replace(/\s{2,}(\{\{[^}]+\}\})/g," $1")):L=Q.textContent||"",L===""){try{let C=document.createRange();C.selectNodeContents(Q),C.collapse(!0);let I=window.getSelection();I?.removeAllRanges(),I?.addRange(C),E.current=0;}catch{}H("",0);return}if(L===m)return;let Y=window.getSelection(),P=0;if(Y&&Y.rangeCount>0)try{let C=Y.getRangeAt(0);if(O){let I=0,F=!1,U=$=>{if(F)return !0;if($===C.startContainer)return I+=C.startOffset,F=!0,!0;if($.nodeType===Node.TEXT_NODE){if(!$.parentElement?.closest("[data-chip-id]")){if($.contains(C.startContainer))return I+=C.startOffset,F=!0,!0;I+=($.textContent||"").length;}}else if($.nodeType===Node.ELEMENT_NODE){let ae=$;if(ae.hasAttribute("data-chip-id")){if(ae.contains(C.startContainer)||ae===C.startContainer){let ie=ae.getAttribute("data-chip-id");return I+=`{{${ie}}}`.length,F=!0,!0}let Z=ae.getAttribute("data-chip-id");return I+=`{{${Z}}}`.length,!1}else if(ae.tagName==="BR")return ae===C.startContainer?(F=!0,!0):(I+=1,!1)}for(let ae=0;ae<$.childNodes.length;ae++)if(U($.childNodes[ae]))return !0;return !1};U(Q),P=I;}else {let I=document.createRange();I.setStart(Q,0),I.setEnd(C.startContainer,C.startOffset),P=I.toString().length;}}catch{P=L.length;}E.current=P,H(L,P);},onKeyDown:j=>{if(c)return;let Q=window.getSelection();if(!(!Q||Q.rangeCount===0))try{let O=Q.getRangeAt(0),L=O.commonAncestorContainer;if(j.key==="ArrowLeft"||j.key==="ArrowRight"){let Y=L.nodeType===Node.TEXT_NODE?L.parentElement?.closest("[data-chip-id]"):L.closest("[data-chip-id]");if(Y){j.preventDefault();try{let P=document.createRange(),C=window.getSelection();j.key==="ArrowLeft"?P.setStartBefore(Y):P.setStartAfter(Y),P.collapse(!0),C?.removeAllRanges(),C?.addRange(P);}catch{}}}if(j.key==="Backspace"){let Y=null;if(Y=(L.nodeType===Node.TEXT_NODE?L.parentElement?.closest("[data-chip-id]"):L.closest("[data-chip-id]"))||null,!Y)if(L.nodeType===Node.TEXT_NODE){let P=L;if(O.startOffset===0&&P.parentElement){let C=P.previousSibling;if(C&&C.nodeType===Node.ELEMENT_NODE){let I=C.closest("[data-chip-id]");I&&(Y=I);}}}else {let P=L;if(O.startOffset>0){let C=P.childNodes[O.startOffset-1];if(C&&C.nodeType===Node.ELEMENT_NODE){let I=C.closest("[data-chip-id]");I&&(Y=I);}}}if(Y){j.preventDefault(),j.stopPropagation();let P=Y.getAttribute("data-chip-id");if(!P)return;let C=`{{${P}}}`,I=m.indexOf(C);if(I!==-1){let F=m.slice(0,I)+m.slice(I+C.length),U=g.filter($=>$.id!==P);E.current=I;try{window.getSelection()?.removeAllRanges();}catch{}f?.(U),p?.(F);}}}}catch{}},onFocus:j=>{c||(w.onFocus&&w.onFocus(j),k(j));},onBlur:j=>{c||(w.onBlur&&w.onBlur(j),T(j));},className:W(),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...w.style},"data-placeholder":w.placeholder,children:q()},m===""?"empty":"content")}),t&&jsx(Te,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsx(be,{size:o,className:"mt-1",children:r}),typeof r=="function"&&u&&jsx(be,{size:o,className:"mt-1",children:r(u)})]})})}function pD({isPlaceholder:e,isDisabled:t,size:r="md"}){return twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[r],e?"text-text-disabled italic":"text-text-primary",t?"text-text-disabled cursor-not-allowed":"cursor-text",!t&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Jy({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,reserveErrorSpace:c=true,validationResult:l,className:d,descriptionPlacement:u="below",...m}){return jsxs(TimeField,{...m,isDisabled:i,isRequired:a,isInvalid:s,className:ke(d,"flex flex-col gap-1"),children:[e&&jsx(ze,{size:o,tooltip:n,description:u==="tooltip"||u==="inline"?t:void 0,descriptionPlacement:u,isRequired:a,children:e}),jsx(yt,{children:jsx(DateInput,{className:twMerge(zo({isInvalid:s,isDisabled:i}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:p=>jsx(DateSegment,{segment:p,className:pD({isPlaceholder:p.isPlaceholder,isDisabled:!p.isEditable||i,size:o})})})}),c?jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsx(be,{size:o,children:r}):typeof r=="function"&&l?jsx(be,{size:o,children:r(l)}):t&&u==="below"?jsx(Te,{size:o,children:t}):null}):jsx(Fragment,{children:typeof r=="string"?jsx(be,{size:o,className:"mt-1",children:r}):typeof r=="function"&&l?jsx(be,{size:o,className:"mt-1",children:r(l)}):t&&u==="below"?jsx(Te,{size:o,className:"mt-1",children:t}):null})]})}function Xy({children:e,className:t=""}){return jsx("div",{className:`flex flex-col ${t}`.trim(),role:"list",children:e})}function jy({children:e,variant:t="default",icon:r,label:o,isLast:n=false,className:a=""}){let s={default:{dot:"bg-border-default border-border-default",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},active:{dot:"bg-text-primary border-text-primary",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary font-medium"},muted:{dot:"bg-border-muted border-border-muted",line:"bg-border-muted",label:"text-text-secondary",content:"text-text-secondary"},success:{dot:"bg-feedback-success-border border-feedback-success-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},error:{dot:"bg-feedback-error-border border-feedback-error-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},warning:{dot:"bg-feedback-warning-border border-feedback-warning-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},info:{dot:"bg-feedback-info-border border-feedback-info-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"}}[t];return jsxs("div",{className:`flex gap-3 ${a}`.trim(),role:"listitem",children:[jsxs("div",{className:"flex flex-col items-center",style:{width:"20px"},children:[jsx("div",{className:`flex items-center justify-center rounded-full border-2 ${s.dot}`,style:{width:"20px",height:"20px",flexShrink:0},children:r&&jsx(B,{name:r,size:12,className:"text-background-body"})}),!n&&jsx("div",{className:`w-0.5 flex-1 ${s.line}`,style:{minHeight:"24px"}})]}),jsxs("div",{className:"flex-1 pb-6",children:[o&&jsx("div",{className:`text-xs mb-1 ${s.label}`,children:o}),jsx("div",{className:`text-sm ${s.content}`,children:e})]})]})}function xD(e){return "primary"}var hD="flex font-medium justify-center items-center gap-2 text-center transition whitespace-nowrap box-border",qy={primary:{selected:"bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-action-primary border-2 border-border-muted hover:bg-text-primary/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"}},yD="opacity-[--control-hover-opacity] cursor-not-allowed pointer-events-none grayscale",vD="opacity-100 cursor-pointer",CD={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},SD={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function wD(e){let{variant:t="primary",size:r="md",isDisabled:o,isSelected:n,borderRadius:a,borderRight:i,borderLeft:s}=e,c=xD(),l=`${hD} ${n?qy[c].selected:qy[c].unselected}`;return l+=` ${Ge[r].text} ${Ge[r].height} ${Ge[r].padding} ${Ge[r].gap}`,l+=` ${o?yD:vD}`,a==="left"&&(l+=" rounded-l-sm"),a==="right"&&(l+=" rounded-r-sm"),i&&(l+=" border-r"),s&&(l+=" border-l"),l+=` ${Je()}`,(l+=" focus-visible:outline-action-primary"),twMerge(l)}function Zy(e){let{className:t,children:r,onPress:o,icon:n,iconPosition:a="left",iconWeight:i,isLoading:s=false,loadingText:c,loadingIndicator:l,size:d="md",badgeNumber:u,badgeVariant:m="primary",badgePosition:p="top-right",...g}=e,f=n?jsx(B,{name:n,size:d,weight:i}):null,h=()=>{let x=jsxs(Fragment,{children:[a==="left"&&f,r,a==="right"&&f]});return s?jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l||jsx(B,{name:"CircleNotch",size:d,className:"animate-spin","aria-hidden":"true"})}),jsx("div",{className:"invisible","aria-hidden":"true",children:x}),c&&jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:c})]}):x},b=jsx(ToggleButton,{onPress:o,...g,className:twMerge(wD(e),t),"aria-busy":s,children:h()});return u&&u>0?jsxs("div",{className:"relative",children:[b,jsx("span",{className:`absolute ${CD[p]} flex h-5 w-5 items-center justify-center rounded-full ${SD[m]} text-xs`,"aria-label":`${u} items`,children:u})]}):b}var kD={open:{className:"text-feedback-success-border",token:"--color-feedback-success-border",label:"Open"},closed:{className:"text-feedback-error-border",token:"--color-feedback-error-border",label:"Closed"}},TD={platform:{label:"Platform",description:"Core product objects that structure the Texture workspace.",icon:"Stack",order:0},grid:{label:"Grid Elements",description:"Physical utility-grid infrastructure imported from a customer's GIS export.",icon:"TreeStructure",order:1},device:{label:"Devices",description:"Behind-the-meter connected energy devices.",icon:"Lightning",order:2}},PD=["energized","customerName","gs_max_continuous_current"],st={TRANSFORMER:[{key:"capacityKva",label:"kVA Rating",format:{type:"power",unit:"kVA",decimals:0}},{key:"primaryRatedVoltage",label:"Primary Voltage",format:{type:"voltage",unit:"V",decimals:0}}],CONSUMER:[{key:"meterNumber",label:"Meter Number",format:{type:"text"}}],SOURCE:[{key:"busVoltage",label:"Bus Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"substationNumber",label:"Substation Number",format:{type:"text"}}],SWITCH:[{key:"switchId",label:"Switch ID",format:{type:"text"}},{key:"ratedCurrent",label:"Rated Current",format:{type:"number",unit:"A",decimals:0}},{key:"normalState",label:"Normal State",format:{type:"text"}}],CAPACITOR:[{key:"unitSizeKvar",label:"Capacity",format:{type:"power",unit:"kVar",decimals:1}},{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}}],OVERCURRENT_DEVICE:[{key:"ratedCurrent",label:"Rated Current",format:{type:"number",unit:"A",decimals:0}},{key:"deviceType",label:"Device Type",format:{type:"text"}}],REGULATOR:[{key:"outputVoltagePhA",label:"Output Voltage Phase A",format:{type:"voltage",unit:"V",decimals:0}},{key:"outputVoltagePhB",label:"Output Voltage Phase B",format:{type:"voltage",unit:"V",decimals:0}},{key:"outputVoltagePhC",label:"Output Voltage Phase C",format:{type:"voltage",unit:"V",decimals:0}},{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kVA",decimals:1}}],OVERHEAD_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:0}},{key:"conductorDescPhA",label:"Conductor Phase A",format:{type:"text"}},{key:"conductorDescPhB",label:"Conductor Phase B",format:{type:"text"}},{key:"conductorDescPhC",label:"Conductor Phase C",format:{type:"text"}}],UNDERGROUND_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:0}},{key:"conductorDescPhA",label:"Conductor Phase A",format:{type:"text"}},{key:"conductorDescPhB",label:"Conductor Phase B",format:{type:"text"}},{key:"conductorDescPhC",label:"Conductor Phase C",format:{type:"text"}}],NODE:[{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}}],GENERATOR:[{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kW",decimals:1}},{key:"outputVoltage",label:"Output Voltage",format:{type:"voltage",unit:"V",decimals:0}}],MOTOR:[{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kW",decimals:1}},{key:"voltage",label:"Voltage",format:{type:"voltage",unit:"V",decimals:0}}]},oa={app:{icon:"AppWindow",category:"platform",archetype:"platform",detailPage:false,label:{singular:"App",plural:"Apps"},description:"Workspace tools and third-party integrations"},site:{icon:"MapPin",category:"platform",archetype:"platform",detailPage:true,label:{singular:"Site",plural:"Sites"},description:"Physical location housing energy systems"},device:{icon:"ShareNetwork",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Device",plural:"Devices"},description:"Connected, controllable energy device"},customer:{icon:"Users",category:"platform",archetype:"platform",detailPage:true,label:{singular:"Customer",plural:"Customers"},description:"End customer or owner of one or more sites"},contact:{icon:"Users",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Contact",plural:"Contacts"},description:"Person associated with a customer or site"},program:{icon:"ClipboardText",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Program",plural:"Programs"},description:"Demand-response or virtual power plant program"},workflow:{icon:"FlowArrow",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Workflow",plural:"Workflows"},description:"Automated rule that runs in response to events"},collection:{icon:"Stack",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Collection",plural:"Collections"},description:"Named group of related entities or records"},board:{icon:"SquaresFour",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Board",plural:"Boards"},description:"Dashboard for monitoring metrics and devices"},report:{icon:"ChartLine",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Report",plural:"Reports"},description:"Saved analytics view or generated report"},event:{icon:"ClockCounterClockwise",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Event",plural:"Events"},description:"Recorded system event or logged activity"},alert:{icon:"Warning",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Alert",plural:"Alerts"},description:"Notification raised when attention is needed"},monitor:{icon:"Pulse",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Monitor",plural:"Monitors"},description:"Rule that watches a metric against a threshold"},command:{icon:"Play",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Command",plural:"Commands"},description:"Control action issued to a connected device"},source:{icon:"TextureSource",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.SOURCE},label:{singular:"Source",plural:"Sources"},description:"Upstream feed where the network originates"},substation:{icon:"TextureSource",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.SOURCE},label:{singular:"Substation",plural:"Substations"},description:"Facility that steps down transmission voltage"},capacitor:{icon:"TextureCapacitor",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.CAPACITOR},label:{singular:"Capacitor",plural:"Capacitors"},description:"Capacitor bank for power-factor and voltage support"},switch:{icon:"TextureSwitchClosed",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.SWITCH},label:{singular:"Switch",plural:"Switches"},description:"Sectionalizing or disconnect switch on the line",states:{open:{icon:"TextureSwitch",color:"open"},closed:{icon:"TextureSwitchClosed",color:"closed"}}},sectionalizer:{icon:"TextureSectionalizerClosed",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.SWITCH},label:{singular:"Sectionalizer",plural:"Sectionalizers"},description:"Counts upstream recloser trips and opens to isolate a faulted section",states:{open:{icon:"TextureSectionalizerOpen",color:"open"},closed:{icon:"TextureSectionalizerClosed",color:"closed"}}},relay:{icon:"Cpu",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.NODE},label:{singular:"Relay",plural:"Relays"},description:"Microprocessor relay that senses faults and trips devices"},transformer:{icon:"TextureTransformer",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.TRANSFORMER},label:{singular:"Transformer",plural:"Transformers"},description:"Transformer that steps voltage up or down"},meter:{icon:"Gauge",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.CONSUMER},label:{singular:"Meter",plural:"Meters"},description:"Revenue meter at the point of consumption",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.meter.fields.power",source:{kind:"state",path:"state.phaseARealPower"},format:{type:"power",unit:"kW",decimals:2},icon:"Pulse"},{id:"consumption",label:"device.meter.fields.consumption",source:{kind:"state",path:"state.latestKwhUsage"},format:{type:"energy",sourceUnit:"kWh",decimals:2},icon:"Lightning"},{id:"voltage",label:"device.meter.fields.voltage",source:{kind:"state",path:"state.phaseAVoltage"},format:{type:"voltage",decimals:1},icon:"Lightning"},{id:"current",label:"device.meter.fields.current",source:{kind:"state",path:"state.phaseACurrent"},format:{type:"current",decimals:2},icon:"Lightning"}]}},consumer:{icon:"Gauge",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.CONSUMER},label:{singular:"Consumer",plural:"Consumers"},description:"Service point or customer premise on the grid"},singlePhaseOverheadLine:{icon:"TextureSinglePhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.OVERHEAD_LINE},label:{singular:"Single-Phase Overhead Line",plural:"Single-Phase Overhead Lines"},description:"Overhead line carrying one phase conductor"},twoPhaseOverheadLine:{icon:"TextureTwoPhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.OVERHEAD_LINE},label:{singular:"Two-Phase Overhead Line",plural:"Two-Phase Overhead Lines"},description:"Overhead line carrying two phase conductors"},threePhaseOverheadLine:{icon:"TextureThreePhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.OVERHEAD_LINE},label:{singular:"Three-Phase Overhead Line",plural:"Three-Phase Overhead Lines"},description:"Overhead line carrying three phase conductors"},singlePhaseUndergroundLine:{icon:"TextureSinglePhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.UNDERGROUND_LINE},label:{singular:"Single-Phase Underground Line",plural:"Single-Phase Underground Lines"},description:"Buried line carrying one phase conductor"},twoPhaseUndergroundLine:{icon:"TextureTwoPhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.UNDERGROUND_LINE},label:{singular:"Two-Phase Underground Line",plural:"Two-Phase Underground Lines"},description:"Buried line carrying two phase conductors"},threePhaseUndergroundLine:{icon:"TextureThreePhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.UNDERGROUND_LINE},label:{singular:"Three-Phase Underground Line",plural:"Three-Phase Underground Lines"},description:"Buried line carrying three phase conductors"},motorSwitch:{icon:"Diamond",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.MOTOR},label:{singular:"Motor Switch",plural:"Motor Switches"},description:"Motor-operated switch or motor load element"},recloser:{icon:"TextureRecloser",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.OVERCURRENT_DEVICE},label:{singular:"Recloser",plural:"Reclosers"},description:"Auto-reclosing device that clears transient faults",states:{open:{color:"open"},closed:{color:"closed"}}},fuse:{icon:"TextureFuse",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.OVERCURRENT_DEVICE},label:{singular:"Fuse",plural:"Fuses"},description:"Fusible element providing overcurrent protection"},breaker:{icon:"TextureBreaker",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.OVERCURRENT_DEVICE},label:{singular:"Breaker",plural:"Breakers"},description:"Circuit breaker that interrupts fault current",states:{open:{color:"open"},closed:{color:"closed"}}},generator:{icon:"Wind",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.GENERATOR},label:{singular:"Generator",plural:"Generators"},description:"Distributed generation unit feeding the grid"},regulator:{icon:"TextureRegulator",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.REGULATOR},label:{singular:"Regulator",plural:"Regulators"},description:"Voltage regulator that holds line voltage in range"},supportStructure:{icon:"TextureSupportStructure",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.NODE},label:{singular:"Support Structure",plural:"Support Structures"},description:"Structure carrying overhead line equipment"},battery:{icon:"BatteryHigh",category:"device",archetype:"device",detailPage:true,label:{singular:"Battery",plural:"Batteries"},description:"Behind-the-meter battery or storage system",fusedMetricId:"soc",fields:{headlineMetrics:[{id:"power",label:"device.battery.fields.power",source:{kind:"state",path:"state.gridPower"},format:{type:"power",decimals:1},icon:"Lightning"},{id:"soc",label:"device.battery.fields.soc",source:{kind:"state",path:"state.chargePercentage"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"backupReserve",label:"device.battery.fields.backupReserve",source:{kind:"state",path:"state.backupReserve"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"loadPower",label:"device.battery.fields.loadPower",source:{kind:"state",path:"state.loadPower"},format:{type:"power",decimals:1},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.battery.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"},secondaryState:{label:"device.battery.fields.gridState",fieldPath:"state.gridStatus",mapping:{importing:"importing",exporting:"exporting",idle:"importing",unknown:"importing"},fallback:"importing"}}},evCharger:{icon:"ChargingStation",category:"device",archetype:"device",detailPage:true,label:{singular:"EV Charger",plural:"EV Chargers"},description:"Electric-vehicle charging station or port",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.evCharger.fields.power",source:{kind:"state",path:"state.chargerWattage"},format:{type:"power",decimals:1},icon:"Lightning"},{id:"isPluggedIn",label:"device.evCharger.fields.isPluggedIn",source:{kind:"state",path:"state.isPluggedIn"},format:{type:"boolean",trueText:"Yes",falseText:"No"},icon:"Plug"},{id:"voltage",label:"device.evCharger.fields.voltage",source:{kind:"state",path:"state.chargerVoltage"},format:{type:"voltage",decimals:1},icon:"Lightning"},{id:"current",label:"device.evCharger.fields.current",source:{kind:"state",path:"state.chargerCurrent"},format:{type:"current",decimals:1},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.evCharger.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"}}},inverter:{icon:"Sun",category:"device",archetype:"device",detailPage:true,label:{singular:"Solar / Inverter",plural:"Solar / Inverters"},description:"Solar PV inverter and its connected array",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.inverter.fields.power",source:{kind:"state",path:"state.power"},format:{type:"power",decimals:0},icon:"Lightning"},{id:"gridPower",label:"device.inverter.fields.gridPower",source:{kind:"state",path:"state.gridPower"},format:{type:"power",decimals:0},icon:"GridFour"},{id:"generatedEnergy",label:"device.inverter.fields.generatedEnergy",source:{kind:"state",path:"state.generatedEnergy"},format:{type:"energy",decimals:1},icon:"Lightning"},{id:"lifetimeEnergyGenerated",label:"device.inverter.fields.lifetimeEnergyGenerated",source:{kind:"state",path:"state.lifetimeEnergyGenerated"},format:{type:"energy",decimals:0},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.inverter.fields.gridStatus",fieldPath:"state.gridStatus",mapping:{exporting:"exporting",importing:"importing",idle:"idle"},fallback:"unknown"}}},thermostat:{icon:"Thermometer",category:"device",archetype:"device",detailPage:true,label:{singular:"Thermostat",plural:"Thermostats"},description:"Smart thermostat or connected HVAC control",fusedMetricId:"ambientTemperature",fields:{headlineMetrics:[{id:"ambientTemperature",label:"device.thermostat.fields.ambientTemperature",source:{kind:"state",path:"state.ambientTemperature"},format:{type:"temperature",decimals:0},icon:"Thermometer"},{id:"heatTarget",label:"device.thermostat.fields.heatTarget",source:{kind:"state",path:"state.heatTarget"},format:{type:"temperature",decimals:0},icon:"Flame"},{id:"coolTarget",label:"device.thermostat.fields.coolTarget",source:{kind:"state",path:"state.coolTarget"},format:{type:"temperature",decimals:0},icon:"Snowflake"},{id:"fanMode",label:"device.thermostat.fields.fanMode",source:{kind:"state",path:"state.fanMode"},format:{type:"text"}}]},stateRules:{primaryState:{label:"device.thermostat.fields.operatingMode",fieldPath:"state.operatingMode",mapping:{heat:"heat",cool:"cool",auto:"auto",off:"off",eco:"eco",unknown:"unknown"},fallback:"unknown"}}},vehicle:{icon:"Car",category:"device",archetype:"device",detailPage:true,label:{singular:"EV",plural:"EVs"},description:"Electric vehicle managed as a flexible load",fusedMetricId:"chargePercentage",fields:{headlineMetrics:[{id:"chargePercentage",label:"device.vehicle.fields.chargePercentage",source:{kind:"state",path:"state.chargePercentage"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"range",label:"device.vehicle.fields.range",source:{kind:"state",path:"state.range"},format:{type:"distance",unit:"mi",decimals:0},icon:"GasPump"},{id:"chargeLimit",label:"device.vehicle.fields.chargeLimit",source:{kind:"state",path:"state.chargeLimit"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"isPluggedIn",label:"device.vehicle.fields.isPluggedIn",source:{kind:"state",path:"state.isPluggedIn"},format:{type:"boolean",trueText:"Yes",falseText:"No"},icon:"Plug"}]},stateRules:{primaryState:{label:"device.vehicle.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"}}},waterHeater:{icon:"Drop",category:"device",archetype:"device",detailPage:true,label:{singular:"Water Heater",plural:"Water Heaters"},description:"Connected or smart electric water heater"}},RD={source:"SOURCE",substation:"SOURCE",capacitor:"CAPACITOR",switch:"SWITCH",sectionalizer:"SWITCH",relay:"NODE",transformer:"TRANSFORMER",meter:"CONSUMER",consumer:"CONSUMER",singlePhaseOverheadLine:"OVERHEAD_LINE",twoPhaseOverheadLine:"OVERHEAD_LINE",threePhaseOverheadLine:"OVERHEAD_LINE",singlePhaseUndergroundLine:"UNDERGROUND_LINE",twoPhaseUndergroundLine:"UNDERGROUND_LINE",threePhaseUndergroundLine:"UNDERGROUND_LINE",motorSwitch:"MOTOR",recloser:"OVERCURRENT_DEVICE",fuse:"OVERCURRENT_DEVICE",breaker:"OVERCURRENT_DEVICE",generator:"GENERATOR",regulator:"REGULATOR",supportStructure:"NODE"};function bc(e){return oa[e]}function MD(e){return oa[e].icon}function ED(e,t=false){return t?oa[e].label.plural:oa[e].label.singular}function DD(e){return oa[e].category}var LD={min:2,max:4};function AD(e){let t=oa[e];if(!t)throw new Error(`archetypeFor: unknown entity type "${String(e)}"`);return t.archetype}function ID(e){return bc(e).detailPage}function FD(e){return (bc(e).fields?.headlineMetrics.length??0)>0}function _y(e){return bc(e).properties?.statList??[]}function BD(e){return _y(e).length>0}function VD({formId:e="dialog-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:i="secondary",children:s,title:c,...l}){return jsx(kr,{title:c,primaryAction:{label:r,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:i}:void 0,...l,children:jsx(Ia,{id:e,onSubmit:t,children:s})})}function zD({formId:e="drawer-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:i="secondary",children:s,...c}){return jsx(Ei,{primaryAction:{label:r,onPress:()=>{let d=document.getElementById(e);d&&d.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:i}:void 0,...c,children:jsx(Ia,{id:e,onSubmit:t,className:"mt-2",children:s})})}function HD({align:e="end",className:t,...r}){return jsx("div",{...r,className:twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",t)})}var UD={sm:"gap-2",md:"gap-4",lg:"gap-6"};function KD(e){if(!e)return "";let t=e.base?`grid-cols-${e.base}`:"",r=e.md?`md:grid-cols-${e.md}`:"",o=e.lg?`lg:grid-cols-${e.lg}`:"";return [t,r,o].filter(Boolean).join(" ")}function YD({cols:e={base:1},gap:t="lg",className:r,...o}){return jsx("div",{...o,className:twMerge("grid",KD(e),UD[t],r)})}function jD({title:e,description:t,showDivider:r,className:o,children:n,...a}){return jsxs("section",{...a,className:twMerge("flex flex-col",o),children:[(e||t)&&jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsx(Qt,{tag:"h3",size:"sm",children:e}):e,t?jsx(Te,{size:"lg",children:t}):null]}),jsx("div",{className:"flex flex-col gap-6",children:n}),r&&jsx("hr",{className:"mt-2 border-border-muted"})]})}function qD(){return jsx("hr",{className:"border-border-muted"})}function QD({steps:e,currentStepId:t,onStepClick:r,className:o}){let n=e.findIndex(a=>a.id===t);return jsx("nav",{"aria-label":"Progress",className:twMerge("w-full",o),children:jsx("div",{className:"relative mb-12",children:jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,i)=>{let s=a.id===t,c=i<n,l=r&&(c||s);return jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsx("button",{type:"button",disabled:!l,onClick:()=>l&&r?.(a.id),className:twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",c&&"border-action-primary bg-action-primary text-text-inverse hover:bg-action-primary/90",s&&"border-action-primary bg-background-body text-action-primary",!c&&!s&&"border-border-default bg-background-body text-text-secondary",l&&"cursor-pointer",!l&&"cursor-default"),"aria-current":s?"step":void 0,children:c?jsx(B,{name:"Check",size:20,weight:"bold"}):jsx("span",{className:"text-sm font-semibold",children:i+1})}),i<e.length-1&&jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:i<n?"var(--color-action-primary)":"var(--color-border-default)"}}),jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsx("span",{className:twMerge("text-sm font-medium",s&&"text-text-default",c&&"text-text-primary",!s&&!c&&"text-text-secondary"),children:a.title}),a.description&&jsx("span",{className:"mt-1 text-xs text-text-secondary",children:a.description})]})]},a.id)})})})})}function _D({formId:e,show:t,isSubmitting:r,onCancel:o,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:i}){return t?jsx("div",{className:twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",i),children:jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsx("div",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),jsxs("div",{className:"flex gap-2",children:[jsx(_,{variant:"secondary",onPress:o,children:a}),jsx(_,{type:"submit",form:e,isDisabled:!!r,children:r?"Saving...":n})]})]})}):null}function $D({when:e,message:t="You have unsaved changes. Leave anyway?"}){return Oe.useEffect(()=>{if(!e)return;let r=o=>(o.preventDefault(),o.returnValue=t,t);return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[e,t]),null}function eL({steps:e,initialStepId:t,canNavigate:r}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[o,n]=Oe.useState(t||e[0].id),a=e.findIndex(u=>u.id===o),i=a>0,s=a<e.length-1,c=async u=>u===o?true:r&&!await r(o,u)?false:(n(u),true);return {steps:e,currentStepId:o,setCurrentStepId:c,next:async()=>!s||a===-1?false:c(e[a+1].id),prev:async()=>!i||a===-1?false:c(e[a-1].id),hasNext:s,hasPrev:i,stepIndex:a}}function _i(e,t){return t.split(".").reduce((r,o)=>r?.[o],e)}function rL(e,t){let r=_i(e,t.field),o=t.value;switch(t.operator){case "eq":return r===o;case "neq":return r!==o;case "in":return Array.isArray(o)?Array.isArray(r)?r.some(n=>o.includes(n)):o.includes(r):false;case "nin":return Array.isArray(o)?Array.isArray(r)?!r.some(n=>o.includes(n)):!o.includes(r):false;case "gt":return r instanceof Date&&typeof o=="string"?r>new Date(o):r>o;case "gte":return r instanceof Date&&typeof o=="string"?r>=new Date(o):r>=o;case "lt":return r instanceof Date&&typeof o=="string"?r<new Date(o):r<o;case "lte":return r instanceof Date&&typeof o=="string"?r<=new Date(o):r<=o;case "contains":return typeof r!="string"?false:r.toLowerCase().includes(String(o).toLowerCase());case "startsWith":return typeof r!="string"?false:r.toLowerCase().startsWith(String(o).toLowerCase());case "endsWith":return typeof r!="string"?false:r.toLowerCase().endsWith(String(o).toLowerCase());default:return false}}function iv(e,t){if(t.conditions.length===0)return true;let r=t.conditions.map(o=>"conditions"in o?iv(e,o):rL(e,o));return t.logic==="AND"?r.every(Boolean):r.some(Boolean)}function oL(e,t){return !t||t.conditions.length===0?e:e.filter(r=>iv(r,t))}function nL(e,t,r){if(e==null&&t==null)return 0;if(e==null)return r==="asc"?1:-1;if(t==null)return r==="asc"?-1:1;if(e instanceof Date&&t instanceof Date){let o=e.getTime()-t.getTime();return r==="asc"?o:-o}if(typeof e=="string"&&typeof t=="string"){let o=e.toLowerCase().localeCompare(t.toLowerCase());return r==="asc"?o:-o}return e<t?r==="asc"?-1:1:e>t?r==="asc"?1:-1:0}function aL(e,t){return t?[...e].sort((r,o)=>{let n=_i(r,t.field),a=_i(o,t.field);return nL(n,a,t.direction)}):e}function iL(e,t){if(!t||!t.query.trim())return e;let{query:r,fields:o,fuzzy:n=true,threshold:a=.3}=t;if(n)return new tL(e,{keys:o,threshold:a,ignoreLocation:true,includeScore:true}).search(r).map(l=>l.item);let i=r.toLowerCase();return e.filter(s=>o.some(c=>{let l=_i(s,c);return l==null?false:String(l).toLowerCase().includes(i)}))}function sL(e,t){let r={};for(let o of t){if(r[o.field]={},o.values)for(let n of o.values)r[o.field][String(n.value)]=0;for(let n of e){let a=_i(n,o.field);if(a!=null)if(Array.isArray(a))for(let i of a){let s=String(i);r[o.field][s]=(r[o.field][s]||0)+1;}else {let i=String(a);r[o.field][i]=(r[o.field][i]||0)+1;}}}return r}function Dp({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){let a=iL(e,o||null);a=oL(a,t||null);let i=sL(a,n);return a=aL(a,r||null),{data:a,facetCounts:i,resultCount:a.length}}function hc({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){return useMemo(()=>Dp({data:e,filters:t,sort:r,search:o,facetConfigs:n}),[e,t,r,o,n])}function yc({filters:e,sort:t,search:r,onStateChange:o,searchDebounce:n=300}){let a=Vo(r,n),i=useRef(true);useEffect(()=>{if(i.current){i.current=false;return}o({filters:e,sort:t,search:a});},[e,t,a,o]);}function sv(e){return e.mode==="client"?hc({data:e.data,filters:e.filters,sort:e.sort,search:e.search,facetConfigs:e.facetConfigs}):(yc({filters:e.filters,sort:e.sort,search:e.search,onStateChange:e.onStateChange,searchDebounce:e.searchDebounce}),{data:e.data,facetCounts:e.facetCounts||{},resultCount:e.resultCount??e.data.length})}var lv=Op(su());function pL(e,t,r=true){let o=e;if(r){let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${n}.${t}`}return `${o}.${t}`}function mL(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function cv(e,t){let r=mL(t,e);return e.exportValue?e.exportValue(r,t)??"":r==null?"":r instanceof Date?r.toISOString():typeof r=="object"?JSON.stringify(r):r}function Lp(e){return e.filter(t=>t.exportable!==false)}function dv(e){let t=e.map(n=>n.exportLabel||n.label),r=new Set,o=[];for(let n of t)r.has(n)?o.includes(n)||o.push(n):r.add(n);if(o.length>0)throw new Error(`Duplicate export headers found: ${o.join(", ")}. Use exportLabel to provide unique headers.`)}async function Ap(e){let{columns:t,data:r,metadata:o={}}=e;try{let n=Lp(t);if(n.length===0)throw new Error("No exportable columns found");dv(n);let a=r.map(l=>{let d={};for(let u of n){let m=u.exportLabel||u.label;d[m]=cv(u,l);}return d}),i=dk.unparse(a,{header:!0,skipEmptyLines:!0}),s=new Blob([i],{type:"text/csv;charset=utf-8;"}),c=pL(o.filename||"table-data","csv",o.timestamp!==!1);(0,lv.saveAs)(s,c);}catch(n){throw new Error(`CSV export failed: ${n instanceof Error?n.message:"Unknown error"}`)}}function fL(e){let{columns:t,data:r}=e,o=Lp(t);return dv(o),r.map(n=>{let a={};for(let i of o){let s=i.exportLabel||i.label;a[s]=cv(i,n);}return a})}function gL(e){return Lp(e).map(t=>t.exportLabel||t.label)}function uv({columns:e,data:t,metadata:r}){let n=e.filter(i=>i.exportable!==false).length>0&&t.length>0;return {exportCSV:useCallback(async()=>{try{await Ap({columns:e,data:t,metadata:r});}catch(i){throw console.error("Table export failed:",i),i}},[e,t,r]),canExport:n}}function Doe(e){switch(e){case "charging":case "on":return "success";case "discharging":return "warning";case "heat":case "cool":return "info";case "off":case "idle":case "eco":case "auto":return "neutral";default:return "neutral"}}export{PD as ABSENT_GRID_FIELDS,Jb as ActionCell,fa as ActionMenu,Cd as ActivityFeed,xs as ActivityFeedGroup,hs as ActivityItem,cf as Alert,bf as AppShell,Jo as AreaSeries,wl as AutoMobileRenderer,Ps as Autocomplete,xo as Avatar,ln as BREAKPOINTS,nt as Badge,jb as BadgeCell,Ms as Banner,Hs as BarSeries,qb as BooleanCell,Qp as BrandProvider,Ds as BreadcrumbItem,Es as Breadcrumbs,_ as Button,ia as CUSTOM_ICON_REGISTRY,ha as Calendar,Ue as Card,md as CardContent,fd as CardFooter,ud as CardHeader,pd as CardMedia,Nl as CardMobileRenderer,Yf as CarouselAutoplayTrigger,Wf as CarouselControl,Ud as CarouselIndicator,Kf as CarouselIndicatorGroup,Hf as CarouselItem,Of as CarouselItemGroup,Uf as CarouselNextTrigger,Gf as CarouselPrevTrigger,Jf as CarouselProgressText,zf as CarouselRoot,wg as CategoryBarChart,Mr as ChartAxis,Ta as ChartBottomBar,Gg as ChartContainer,Rr as ChartContext,Js as ChartEventMarkers,Xs as ChartEventSpans,Xo as ChartTooltip,Sn as Checkbox,Kd as CheckboxGroup,eo as Chip,$f as ChipInputField,ni as ClearButton,rg as CodeEditor,ya as Collapse,Ko as CollapseContent,Uo as CollapseHeader,Go as CollapseItem,fN as ColorField,sm as ColorModeProvider,zx as CommandPalette,lg as Confirm,cg as ConnectionStatusBadge,dg as ContactCard,Zb as ContactMetaCell,Bs as ContactMetaDisplay,mg as ContainerQueryProvider,Oo as CopyToClipboard,_b as CustomCell,$l as DEFAULT_MAP_TYPE,Bb as DataControls,Tx as DataTable,$b as DateCell,Ob as DateField,sl as DateRangePicker,Te as Description,Rx as DeviceHealthBadge,tx as DeviceMetaCell,ml as DeviceMetaDisplay,zn as DeviceStateBadge,nx as DeviceStateCell,bl as DeviceStateWithMetric,Ex as DeviceTypeIcon,kr as Dialog,VD as DialogForm,Ht as DialogHeader,Ei as Drawer,zD as DrawerForm,TD as ENTITY_CATEGORY_CONFIG,oa as ENTITY_CONFIG,_s as EmptyState,Lx as EnrollmentStatusBadge,zr as ErrorBoundary,be as FieldError,yf as FieldGroup,Ix as FileUpload,Vb as FilterChips,Ub as FilterDialog,Bx as FirmwareVersionBadge,Ia as Form,HD as FormActions,qD as FormDivider,YD as FormGrid,jD as FormSection,QD as FormStepper,oe as FormatRegistry,ix as FormattedCell,Jg as FunnelSeries,RD as GRID_ELEMENT_TYPE_BY_ENTITY,kD as GRID_STATE_COLORS,st as GRID_STAT_LIST,Wx as GlobalSearch,qu as Grid,gl as GridStateBadge,LD as HEADLINE_METRIC_BOUNDS,Qt as Heading,gh as HierarchyExplorer,Vu as HorizontalBarCell,vR as HoverCard,B as Icon,Nr as InfiniteScrollIndicator,Ns as Input,yt as InputWrapper,Gi as InteractiveMap,Ch as Kpi,op as KpiGroup,ze as Label,Pn as LineSeries,Ph as List,HR as ListBox,_t as ListBoxItem,Mh as ListItem,Eh as ListPane,go as Loader,ba as Logo,ny as MAP_TYPES,cy as Meter,zu as MiniBarCell,cr as ModalBackdrop,nc as Notice,ac as NoticeContainer,uy as NoticeProvider,ux as NumberCell,ki as NumberField,Ef as PageBanner,Qn as PageLayout,Ou as PercentBarCell,yy as PlaceSearch,lt as Popover,Cy as ProgressBar,Sy as Prose,Py as Radio,wy as RadioCard,Ny as RadioCardGroup,Ty as RadioGroup,Ma as RangeCalendar,Ci as ResultsCount,Ey as RichTextEditor,_o as SKELETON_SIZES,Xc as SOURCE_UNIT_TO_WH,_D as SaveBar,In as SearchControl,Gx as SearchEmptyState,Kx as SearchLoadingState,Jx as SearchResultGroup,Xx as SearchResultItem,jx as SearchResultsList,Qx as SearchTrigger,Ua as Section,lc as SectionNav,tl as SegmentedControl,bo as Select,mx as SelectCell,vs as SideNav,Dy as SiteCard,Ay as SiteContactCard,gx as SiteMetaCell,yl as SiteMetaDisplay,J as Skeleton,Iy as Slider,Si as SortControl,Hu as SparklineCell,gc as SplitPane,Cs as StackNav,Ll as StatList,Ga as StaticMap,ll as Switch,mc as Tab,pc as TabList,by as TabPanel,uc as Tabs,Hy as TextArea,Ky as TextAreaWithChips,yx as TextCell,Lr as TextField,Ze as TextLink,Qs as TiledTimeSeriesChart,Db as TiledTimeSeriesExplorer,rl as TimeControls,Jy as TimeField,Xy as Timeline,jy as TimelineItem,Zy as ToggleButton,Zt as Tooltip,oi as TopNav,ct as Tray,$D as UnsavedChangesPrompt,_1 as activeDeviceStates,Zo as addFilterCondition,Dp as applyDataOperations,AD as archetypeFor,db as assembleSeries,IC as autoScaleCurrent,bm as autoScaleDistance,vm as autoScaleEnergy,GC as autoScalePower,UC as autoScaleResistance,QC as autoScaleVoltage,KN as baselineFromPoint,Bm as camelCaseToWords,Im as capitalize,KC as celsiusToFahrenheit,u5 as celsiusToKelvin,JA as centimetersToInches,rs as clearColorCache,bC as createCategoryColorMap,wi as createEmptyFilter,g1 as createFilter,b1 as createFilters,z5 as createFormat,rt as createTextureIcon,Xg as createTiledCameraSyncGroup,ru as createXScale,di as createYScale,ad as csvUnitFor,Om as csvValueFor,Ie as defaultMargin,$1 as deviceStateLabels,xU as deviceStateMetricFormats,ub as emptyStore,ID as entityHasDetailPage,BD as entityHasStatList,FD as entityShowsNow,jC as enumToSentenceCase,cu as exportChart,Ap as exportTableAsCSV,YC as fahrenheitToCelsius,p5 as fahrenheitToKelvin,VA as feetToMeters,HA as feetToMiles,x1 as filterToChips,lm as formatBoolean,gA as formatCapacity,jr as formatComponentValue,mm as formatCurrency,zc as formatCurrent,fm as formatDate,xm as formatDistance,ul as formatEmptyValue,jc as formatEnergy,Vr as formatFieldValue,qc as formatInternationalPhone,pm as formatNumber,dm as formatPercent,Cm as formatPhone,ca as formatPhoneNumber,$c as formatPower,bA as formatPowerRating,td as formatResistance,Mm as formatTemperature,zm as formatText,is as formatUSPhone,nd as formatVoltage,Kb as getBadgeClasses,Yb as getBooleanBadgeVariant,Lu as getCellAlignmentClasses,Me as getCellContainerClasses,Ar as getCellTextClasses,xC as getContrastingTextColor,DA as getDateParts,qa as getDefaultChartColor,_p as getDefaultColors,Fu as getDeviceStateDisplayLabel,Fu as getDeviceStateLabel,DD as getEntityCategory,bc as getEntityConfig,MD as getEntityIcon,ED as getEntityLabel,_y as getEntityStatList,yo as getEventColor,gk as getExportFormatName,gL as getExportHeaders,bS as getFieldGroupStyles,Bn as getFilterFields,ox as getGridStateLabel,hf as getInputBackgroundStyles,zt as getInputBaseStyles,zo as getInputStateStyles,Au as getLinkClasses,pl as getNumericColorClasses,Pt as getResolvedColor,nr as getSkeletonSize,Doe as getStateTone,cn as getThemeCategoricalColors,Hr as getYFormatSettings,tP as gridStateLabels,YA as inchesToCentimeters,Iu as isActiveDeviceState,Iu as isActiveState,pp as isCustomPinsLayer,fk as isExportSupported,il as isFilterEmpty,up as isGeoJsonLayer,$p as isLightColor,me as isNil,mp as isRasterLayer,dp as isVectorLayer,JC as kelvinToCelsius,m5 as kelvinToFahrenheit,OA as kilometersToMiles,cp as layer,Mc as mapValuesToCategoricalColors,BA as metersToFeet,WA as metersToMiles,KA as metersToYards,gm as milesToFeet,zA as milesToKilometers,GA as milesToMeters,Lo as parseBoolean,Jc as pickEnergyUnit,fL as prepareTableDataForExport,sy as registerPhosphorIcon,Fn as removeFilterCondition,Se as resolveValue,Vm as snakeCaseToWords,$s as telemetryPresetRanges,Nm as temperatureStringToSymbol,Zs as tierForViewport,hT as tileIndexAt,rr as tileKey,pb as tileReducer,jo as tilesForViewport,TA as toA,kC as toActiveInactive,ns as toAmps,Do as toBoolean,Tm as toCelsius,OC as toCentimeters,PC as toCheckmark,DC as toCompactNumber,um as toCurrency,zC as toCustomDateFormat,FC as toDateString,wC as toEnabledDisabled,km as toFahrenheit,Wc as toFeet,MC as toFloat,EC as toFormattedNumber,BC as toFullDateTime,n5 as toGW,ym as toGWh,_c as toGigawatts,VC as toISOString,WC as toInches,RC as toInteger,PA as toKA,C5 as toKV,r5 as toKW,Pm as toKelvin,Vc as toKiloamps,Sm as toKilohms,Hc as toKilometers,od as toKilovolts,Qc as toKilowatts,Dm as toLowerCase,kA as toMA,y5 as toMV,o5 as toMW,hm as toMWh,Zc as toMegawatts,wm as toMegohms,Oc as toMeters,Gc as toMiles,Bc as toMilliamps,HC as toMillimeters,ed as toMilliohms,rd as toMillivolts,FA as toNauticalMiles,ls as toOhms,NC as toOnOff,cm as toPercentage,as as toRelativeTime,LC as toScientificNotation,qC as toSecret,Lm as toSentenceCase,Rm as toTemperature,Am as toTitleCase,TC as toTrueFalse,Em as toUpperCase,v5 as toV,us as toVolts,t5 as toW,ss as toWatts,Kc as toWh,Uc as toYards,Yc as tokWh,ds as truncateEnd,da as truncateMiddle,cs as truncateStart,gt as typeRole,qr as typographyRole,Fm as ucFirst,Xt as useBreakpoint,Tn as useChartContext,hc as useClientDataControls,Vt as useColorMode,vA as useComponentFormatter,ug as useContainerBreakpoint,sv as useDataControls,Vo as useDebounce,xa as useElementSize,Fo as useInfiniteScroll,Pr as useInputFocus,Ul as useLocalStorage,Jt as useMediaQuery,my as useNotice,yc as useServerDataControls,uv as useTableExport,yb as useTileWindow,vu as useTiledTimeSeries,eL as useWizard,ao as wrapWithLink,UA as yardsToMeters};//# sourceMappingURL=index.js.map
|
|
47
|
+
`).length-1&&jsx("br",{})]},`line-${O}-${P}`)):Q}):null;return jsx("div",{className:"group flex flex-col",children:jsxs("div",{className:"flex flex-col",children:[e&&jsx(ze,{size:o,tooltip:n,isRequired:a,children:e}),jsx(yt,{children:jsx("div",{ref:N,contentEditable:!c,suppressContentEditableWarning:true,onInput:j=>{if(c)return;let Q=j.target,O=Q.querySelector("[data-chip-id]")!==null,L;if(O?(L=D(Q),L=L.replace(/(\{\{[^}]+\}\})\s{2,}/g,"$1 ").replace(/\s{2,}(\{\{[^}]+\}\})/g," $1")):L=Q.textContent||"",L===""){try{let C=document.createRange();C.selectNodeContents(Q),C.collapse(!0);let I=window.getSelection();I?.removeAllRanges(),I?.addRange(C),E.current=0;}catch{}H("",0);return}if(L===m)return;let Y=window.getSelection(),P=0;if(Y&&Y.rangeCount>0)try{let C=Y.getRangeAt(0);if(O){let I=0,F=!1,U=$=>{if(F)return !0;if($===C.startContainer)return I+=C.startOffset,F=!0,!0;if($.nodeType===Node.TEXT_NODE){if(!$.parentElement?.closest("[data-chip-id]")){if($.contains(C.startContainer))return I+=C.startOffset,F=!0,!0;I+=($.textContent||"").length;}}else if($.nodeType===Node.ELEMENT_NODE){let ae=$;if(ae.hasAttribute("data-chip-id")){if(ae.contains(C.startContainer)||ae===C.startContainer){let ie=ae.getAttribute("data-chip-id");return I+=`{{${ie}}}`.length,F=!0,!0}let Z=ae.getAttribute("data-chip-id");return I+=`{{${Z}}}`.length,!1}else if(ae.tagName==="BR")return ae===C.startContainer?(F=!0,!0):(I+=1,!1)}for(let ae=0;ae<$.childNodes.length;ae++)if(U($.childNodes[ae]))return !0;return !1};U(Q),P=I;}else {let I=document.createRange();I.setStart(Q,0),I.setEnd(C.startContainer,C.startOffset),P=I.toString().length;}}catch{P=L.length;}E.current=P,H(L,P);},onKeyDown:j=>{if(c)return;let Q=window.getSelection();if(!(!Q||Q.rangeCount===0))try{let O=Q.getRangeAt(0),L=O.commonAncestorContainer;if(j.key==="ArrowLeft"||j.key==="ArrowRight"){let Y=L.nodeType===Node.TEXT_NODE?L.parentElement?.closest("[data-chip-id]"):L.closest("[data-chip-id]");if(Y){j.preventDefault();try{let P=document.createRange(),C=window.getSelection();j.key==="ArrowLeft"?P.setStartBefore(Y):P.setStartAfter(Y),P.collapse(!0),C?.removeAllRanges(),C?.addRange(P);}catch{}}}if(j.key==="Backspace"){let Y=null;if(Y=(L.nodeType===Node.TEXT_NODE?L.parentElement?.closest("[data-chip-id]"):L.closest("[data-chip-id]"))||null,!Y)if(L.nodeType===Node.TEXT_NODE){let P=L;if(O.startOffset===0&&P.parentElement){let C=P.previousSibling;if(C&&C.nodeType===Node.ELEMENT_NODE){let I=C.closest("[data-chip-id]");I&&(Y=I);}}}else {let P=L;if(O.startOffset>0){let C=P.childNodes[O.startOffset-1];if(C&&C.nodeType===Node.ELEMENT_NODE){let I=C.closest("[data-chip-id]");I&&(Y=I);}}}if(Y){j.preventDefault(),j.stopPropagation();let P=Y.getAttribute("data-chip-id");if(!P)return;let C=`{{${P}}}`,I=m.indexOf(C);if(I!==-1){let F=m.slice(0,I)+m.slice(I+C.length),U=g.filter($=>$.id!==P);E.current=I;try{window.getSelection()?.removeAllRanges();}catch{}f?.(U),p?.(F);}}}}catch{}},onFocus:j=>{c||(w.onFocus&&w.onFocus(j),k(j));},onBlur:j=>{c||(w.onBlur&&w.onBlur(j),T(j));},className:W(),style:{whiteSpace:"pre-wrap",wordBreak:"break-word",...w.style},"data-placeholder":w.placeholder,children:q()},m===""?"empty":"content")}),t&&jsx(Te,{size:o,className:"mt-3",children:t}),typeof r=="string"&&jsx(be,{size:o,className:"mt-1",children:r}),typeof r=="function"&&u&&jsx(be,{size:o,className:"mt-1",children:r(u)})]})})}function pD({isPlaceholder:e,isDisabled:t,size:r="md"}){return twMerge("inline-block box-content px-0.5 rounded outline-none tabular-nums text-center transition-colors",{sm:"text-base md:text-xs",md:"text-base md:text-sm",lg:"text-base",xl:"text-lg"}[r],e?"text-text-disabled italic":"text-text-primary",t?"text-text-disabled cursor-not-allowed":"cursor-text",!t&&"hover:bg-background-hover","data-[focused]:bg-background-selected data-[focused]:text-text-primary")}function Jy({label:e,description:t,errorMessage:r,size:o="md",tooltip:n,isRequired:a,isDisabled:i,isInvalid:s,reserveErrorSpace:c=true,validationResult:l,className:d,descriptionPlacement:u="below",...m}){return jsxs(TimeField,{...m,isDisabled:i,isRequired:a,isInvalid:s,className:ke(d,"flex flex-col gap-1"),children:[e&&jsx(ze,{size:o,tooltip:n,description:u==="tooltip"||u==="inline"?t:void 0,descriptionPlacement:u,isRequired:a,children:e}),jsx(yt,{children:jsx(DateInput,{className:twMerge(zo({isInvalid:s,isDisabled:i}),"px-3 py-2 flex items-center gap-0.5 w-full"),children:p=>jsx(DateSegment,{segment:p,className:pD({isPlaceholder:p.isPlaceholder,isDisabled:!p.isEditable||i,size:o})})})}),c?jsx("div",{className:"mt-1 min-h-[20px]",children:typeof r=="string"?jsx(be,{size:o,children:r}):typeof r=="function"&&l?jsx(be,{size:o,children:r(l)}):t&&u==="below"?jsx(Te,{size:o,children:t}):null}):jsx(Fragment,{children:typeof r=="string"?jsx(be,{size:o,className:"mt-1",children:r}):typeof r=="function"&&l?jsx(be,{size:o,className:"mt-1",children:r(l)}):t&&u==="below"?jsx(Te,{size:o,className:"mt-1",children:t}):null})]})}function Xy({children:e,className:t=""}){return jsx("div",{className:`flex flex-col ${t}`.trim(),role:"list",children:e})}function jy({children:e,variant:t="default",icon:r,label:o,isLast:n=false,className:a=""}){let s={default:{dot:"bg-border-default border-border-default",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},active:{dot:"bg-text-primary border-text-primary",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary font-medium"},muted:{dot:"bg-border-muted border-border-muted",line:"bg-border-muted",label:"text-text-secondary",content:"text-text-secondary"},success:{dot:"bg-feedback-success-border border-feedback-success-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},error:{dot:"bg-feedback-error-border border-feedback-error-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},warning:{dot:"bg-feedback-warning-border border-feedback-warning-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"},info:{dot:"bg-feedback-info-border border-feedback-info-border",line:"bg-border-default",label:"text-text-secondary",content:"text-text-primary"}}[t];return jsxs("div",{className:`flex gap-3 ${a}`.trim(),role:"listitem",children:[jsxs("div",{className:"flex flex-col items-center",style:{width:"20px"},children:[jsx("div",{className:`flex items-center justify-center rounded-full border-2 ${s.dot}`,style:{width:"20px",height:"20px",flexShrink:0},children:r&&jsx(B,{name:r,size:12,className:"text-background-body"})}),!n&&jsx("div",{className:`w-0.5 flex-1 ${s.line}`,style:{minHeight:"24px"}})]}),jsxs("div",{className:"flex-1 pb-6",children:[o&&jsx("div",{className:`text-xs mb-1 ${s.label}`,children:o}),jsx("div",{className:`text-sm ${s.content}`,children:e})]})]})}function xD(e){return "primary"}var hD="flex font-medium justify-center items-center gap-2 text-center transition whitespace-nowrap box-border",qy={primary:{selected:"bg-action-primary text-[color:var(--color-action-primary-text)] hover:bg-action-primary-hover forced-colors:bg-[ButtonText] forced-colors:text-[ButtonFace] border-2 border-transparent",unselected:"bg-transparent text-action-primary border-2 border-border-muted hover:bg-text-primary/[0.05] forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]"}},yD="opacity-[--control-hover-opacity] cursor-not-allowed pointer-events-none grayscale",vD="opacity-100 cursor-pointer",CD={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},SD={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function wD(e){let{variant:t="primary",size:r="md",isDisabled:o,isSelected:n,borderRadius:a,borderRight:i,borderLeft:s}=e,c=xD(),l=`${hD} ${n?qy[c].selected:qy[c].unselected}`;return l+=` ${Ge[r].text} ${Ge[r].height} ${Ge[r].padding} ${Ge[r].gap}`,l+=` ${o?yD:vD}`,a==="left"&&(l+=" rounded-l-sm"),a==="right"&&(l+=" rounded-r-sm"),i&&(l+=" border-r"),s&&(l+=" border-l"),l+=` ${Je()}`,(l+=" focus-visible:outline-action-primary"),twMerge(l)}function Zy(e){let{className:t,children:r,onPress:o,icon:n,iconPosition:a="left",iconWeight:i,isLoading:s=false,loadingText:c,loadingIndicator:l,size:d="md",badgeNumber:u,badgeVariant:m="primary",badgePosition:p="top-right",...g}=e,f=n?jsx(B,{name:n,size:d,weight:i}):null,h=()=>{let x=jsxs(Fragment,{children:[a==="left"&&f,r,a==="right"&&f]});return s?jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:l||jsx(B,{name:"CircleNotch",size:d,className:"animate-spin","aria-hidden":"true"})}),jsx("div",{className:"invisible","aria-hidden":"true",children:x}),c&&jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:c})]}):x},b=jsx(ToggleButton,{onPress:o,...g,className:twMerge(wD(e),t),"aria-busy":s,children:h()});return u&&u>0?jsxs("div",{className:"relative",children:[b,jsx("span",{className:`absolute ${CD[p]} flex h-5 w-5 items-center justify-center rounded-full ${SD[m]} text-xs`,"aria-label":`${u} items`,children:u})]}):b}var kD={open:{className:"text-feedback-success-border",token:"--color-feedback-success-border",label:"Open"},closed:{className:"text-feedback-error-border",token:"--color-feedback-error-border",label:"Closed"}},TD={platform:{label:"Platform",description:"Core product objects that structure the Texture workspace.",icon:"Stack",order:0},grid:{label:"Grid Elements",description:"Physical utility-grid infrastructure imported from a customer's GIS export.",icon:"TreeStructure",order:1},device:{label:"Devices",description:"Behind-the-meter connected energy devices.",icon:"Lightning",order:2}},PD=["energized","customerName","gs_max_continuous_current"],st={TRANSFORMER:[{key:"capacityKva",label:"kVA Rating",format:{type:"power",unit:"kVA",decimals:0}},{key:"primaryRatedVoltage",label:"Primary Voltage",format:{type:"voltage",unit:"V",decimals:0}}],CONSUMER:[{key:"meterNumber",label:"Meter Number",format:{type:"text"}}],SOURCE:[{key:"busVoltage",label:"Bus Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}},{key:"substationNumber",label:"Substation Number",format:{type:"text"}}],SWITCH:[{key:"switchId",label:"Switch ID",format:{type:"text"}},{key:"ratedCurrent",label:"Rated Current",format:{type:"number",unit:"A",decimals:0}},{key:"normalState",label:"Normal State",format:{type:"text"}}],CAPACITOR:[{key:"unitSizeKvar",label:"Capacity",format:{type:"power",unit:"kVar",decimals:1}},{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}}],OVERCURRENT_DEVICE:[{key:"ratedCurrent",label:"Rated Current",format:{type:"number",unit:"A",decimals:0}},{key:"deviceType",label:"Device Type",format:{type:"text"}}],REGULATOR:[{key:"outputVoltagePhA",label:"Output Voltage Phase A",format:{type:"voltage",unit:"V",decimals:0}},{key:"outputVoltagePhB",label:"Output Voltage Phase B",format:{type:"voltage",unit:"V",decimals:0}},{key:"outputVoltagePhC",label:"Output Voltage Phase C",format:{type:"voltage",unit:"V",decimals:0}},{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kVA",decimals:1}}],OVERHEAD_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:0}},{key:"conductorDescPhA",label:"Conductor Phase A",format:{type:"text"}},{key:"conductorDescPhB",label:"Conductor Phase B",format:{type:"text"}},{key:"conductorDescPhC",label:"Conductor Phase C",format:{type:"text"}}],UNDERGROUND_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:0}},{key:"conductorDescPhA",label:"Conductor Phase A",format:{type:"text"}},{key:"conductorDescPhB",label:"Conductor Phase B",format:{type:"text"}},{key:"conductorDescPhC",label:"Conductor Phase C",format:{type:"text"}}],NODE:[{key:"nominalVoltage",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}}],GENERATOR:[{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kW",decimals:1}},{key:"outputVoltage",label:"Output Voltage",format:{type:"voltage",unit:"V",decimals:0}}],MOTOR:[{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kW",decimals:1}},{key:"voltage",label:"Voltage",format:{type:"voltage",unit:"V",decimals:0}}]},oa={app:{icon:"AppWindow",category:"platform",archetype:"platform",detailPage:false,label:{singular:"App",plural:"Apps"},description:"Workspace tools and third-party integrations"},site:{icon:"MapPin",category:"platform",archetype:"platform",detailPage:true,label:{singular:"Site",plural:"Sites"},description:"Physical location housing energy systems"},device:{icon:"ShareNetwork",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Device",plural:"Devices"},description:"Connected, controllable energy device"},customer:{icon:"Users",category:"platform",archetype:"platform",detailPage:true,label:{singular:"Customer",plural:"Customers"},description:"End customer or owner of one or more sites"},contact:{icon:"Users",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Contact",plural:"Contacts"},description:"Person associated with a customer or site"},program:{icon:"ClipboardText",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Program",plural:"Programs"},description:"Demand-response or virtual power plant program"},workflow:{icon:"FlowArrow",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Workflow",plural:"Workflows"},description:"Automated rule that runs in response to events"},collection:{icon:"Stack",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Collection",plural:"Collections"},description:"Named group of related entities or records"},board:{icon:"SquaresFour",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Board",plural:"Boards"},description:"Dashboard for monitoring metrics and devices"},report:{icon:"ChartLine",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Report",plural:"Reports"},description:"Saved analytics view or generated report"},event:{icon:"ClockCounterClockwise",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Event",plural:"Events"},description:"Recorded system event or logged activity"},alert:{icon:"Warning",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Alert",plural:"Alerts"},description:"Notification raised when attention is needed"},monitor:{icon:"Pulse",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Monitor",plural:"Monitors"},description:"Rule that watches a metric against a threshold"},command:{icon:"Play",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Command",plural:"Commands"},description:"Control action issued to a connected device"},source:{icon:"TextureSource",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.SOURCE},label:{singular:"Source",plural:"Sources"},description:"Upstream feed where the network originates"},substation:{icon:"TextureSource",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.SOURCE},label:{singular:"Substation",plural:"Substations"},description:"Facility that steps down transmission voltage"},capacitor:{icon:"TextureCapacitor",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.CAPACITOR},label:{singular:"Capacitor",plural:"Capacitors"},description:"Capacitor bank for power-factor and voltage support"},switch:{icon:"TextureSwitchClosed",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.SWITCH},label:{singular:"Switch",plural:"Switches"},description:"Sectionalizing or disconnect switch on the line",states:{open:{icon:"TextureSwitch",color:"open"},closed:{icon:"TextureSwitchClosed",color:"closed"}}},sectionalizer:{icon:"TextureSectionalizerClosed",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.SWITCH},label:{singular:"Sectionalizer",plural:"Sectionalizers"},description:"Counts upstream recloser trips and opens to isolate a faulted section",states:{open:{icon:"TextureSectionalizerOpen",color:"open"},closed:{icon:"TextureSectionalizerClosed",color:"closed"}}},relay:{icon:"Cpu",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.NODE},label:{singular:"Relay",plural:"Relays"},description:"Microprocessor relay that senses faults and trips devices"},transformer:{icon:"TextureTransformer",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.TRANSFORMER},label:{singular:"Transformer",plural:"Transformers"},description:"Transformer that steps voltage up or down"},meter:{icon:"Gauge",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.CONSUMER},label:{singular:"Meter",plural:"Meters"},description:"Revenue meter at the point of consumption"},consumer:{icon:"Gauge",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.CONSUMER},label:{singular:"Consumer",plural:"Consumers"},description:"Service point or customer premise on the grid"},singlePhaseOverheadLine:{icon:"TextureSinglePhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.OVERHEAD_LINE},label:{singular:"Single-Phase Overhead Line",plural:"Single-Phase Overhead Lines"},description:"Overhead line carrying one phase conductor"},twoPhaseOverheadLine:{icon:"TextureTwoPhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.OVERHEAD_LINE},label:{singular:"Two-Phase Overhead Line",plural:"Two-Phase Overhead Lines"},description:"Overhead line carrying two phase conductors"},threePhaseOverheadLine:{icon:"TextureThreePhaseOverheadLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.OVERHEAD_LINE},label:{singular:"Three-Phase Overhead Line",plural:"Three-Phase Overhead Lines"},description:"Overhead line carrying three phase conductors"},singlePhaseUndergroundLine:{icon:"TextureSinglePhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.UNDERGROUND_LINE},label:{singular:"Single-Phase Underground Line",plural:"Single-Phase Underground Lines"},description:"Buried line carrying one phase conductor"},twoPhaseUndergroundLine:{icon:"TextureTwoPhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.UNDERGROUND_LINE},label:{singular:"Two-Phase Underground Line",plural:"Two-Phase Underground Lines"},description:"Buried line carrying two phase conductors"},threePhaseUndergroundLine:{icon:"TextureThreePhaseUndergroundLine",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.UNDERGROUND_LINE},label:{singular:"Three-Phase Underground Line",plural:"Three-Phase Underground Lines"},description:"Buried line carrying three phase conductors"},motorSwitch:{icon:"Diamond",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.MOTOR},label:{singular:"Motor Switch",plural:"Motor Switches"},description:"Motor-operated switch or motor load element"},recloser:{icon:"TextureRecloser",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.OVERCURRENT_DEVICE},label:{singular:"Recloser",plural:"Reclosers"},description:"Auto-reclosing device that clears transient faults",states:{open:{color:"open"},closed:{color:"closed"}}},fuse:{icon:"TextureFuse",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.OVERCURRENT_DEVICE},label:{singular:"Fuse",plural:"Fuses"},description:"Fusible element providing overcurrent protection"},breaker:{icon:"TextureBreaker",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.OVERCURRENT_DEVICE},label:{singular:"Breaker",plural:"Breakers"},description:"Circuit breaker that interrupts fault current",states:{open:{color:"open"},closed:{color:"closed"}}},generator:{icon:"Wind",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.GENERATOR},label:{singular:"Generator",plural:"Generators"},description:"Distributed generation unit feeding the grid"},regulator:{icon:"TextureRegulator",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:st.REGULATOR},label:{singular:"Regulator",plural:"Regulators"},description:"Voltage regulator that holds line voltage in range"},supportStructure:{icon:"TextureSupportStructure",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:st.NODE},label:{singular:"Support Structure",plural:"Support Structures"},description:"Structure carrying overhead line equipment"},battery:{icon:"BatteryHigh",category:"device",archetype:"device",detailPage:true,label:{singular:"Battery",plural:"Batteries"},description:"Behind-the-meter battery or storage system",fusedMetricId:"soc",fields:{headlineMetrics:[{id:"power",label:"device.battery.fields.power",source:{kind:"state",path:"state.gridPower"},format:{type:"power",decimals:1},icon:"Lightning"},{id:"soc",label:"device.battery.fields.soc",source:{kind:"state",path:"state.chargePercentage"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"backupReserve",label:"device.battery.fields.backupReserve",source:{kind:"state",path:"state.backupReserve"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"loadPower",label:"device.battery.fields.loadPower",source:{kind:"state",path:"state.loadPower"},format:{type:"power",decimals:1},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.battery.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"},secondaryState:{label:"device.battery.fields.gridState",fieldPath:"state.gridStatus",mapping:{importing:"importing",exporting:"exporting",idle:"importing",unknown:"importing"},fallback:"importing"}}},evCharger:{icon:"ChargingStation",category:"device",archetype:"device",detailPage:true,label:{singular:"EV Charger",plural:"EV Chargers"},description:"Electric-vehicle charging station or port",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.evCharger.fields.power",source:{kind:"state",path:"state.chargerWattage"},format:{type:"power",decimals:1},icon:"Lightning"},{id:"isPluggedIn",label:"device.evCharger.fields.isPluggedIn",source:{kind:"state",path:"state.isPluggedIn"},format:{type:"boolean",trueText:"Yes",falseText:"No"},icon:"Plug"},{id:"voltage",label:"device.evCharger.fields.voltage",source:{kind:"state",path:"state.chargerVoltage"},format:{type:"voltage",decimals:1},icon:"Lightning"},{id:"current",label:"device.evCharger.fields.current",source:{kind:"state",path:"state.chargerCurrent"},format:{type:"current",decimals:1},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.evCharger.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"}}},inverter:{icon:"Sun",category:"device",archetype:"device",detailPage:true,label:{singular:"Solar / Inverter",plural:"Solar / Inverters"},description:"Solar PV inverter and its connected array",fusedMetricId:"power",fields:{headlineMetrics:[{id:"power",label:"device.inverter.fields.power",source:{kind:"state",path:"state.power"},format:{type:"power",decimals:0},icon:"Lightning"},{id:"gridPower",label:"device.inverter.fields.gridPower",source:{kind:"state",path:"state.gridPower"},format:{type:"power",decimals:0},icon:"GridFour"},{id:"generatedEnergy",label:"device.inverter.fields.generatedEnergy",source:{kind:"state",path:"state.generatedEnergy"},format:{type:"energy",decimals:1},icon:"Lightning"},{id:"lifetimeEnergyGenerated",label:"device.inverter.fields.lifetimeEnergyGenerated",source:{kind:"state",path:"state.lifetimeEnergyGenerated"},format:{type:"energy",decimals:0},icon:"Lightning"}]},stateRules:{primaryState:{label:"device.inverter.fields.gridStatus",fieldPath:"state.gridStatus",mapping:{exporting:"exporting",importing:"importing",idle:"idle"},fallback:"unknown"}}},thermostat:{icon:"Thermometer",category:"device",archetype:"device",detailPage:true,label:{singular:"Thermostat",plural:"Thermostats"},description:"Smart thermostat or connected HVAC control",fusedMetricId:"ambientTemperature",fields:{headlineMetrics:[{id:"ambientTemperature",label:"device.thermostat.fields.ambientTemperature",source:{kind:"state",path:"state.ambientTemperature"},format:{type:"temperature",decimals:0},icon:"Thermometer"},{id:"heatTarget",label:"device.thermostat.fields.heatTarget",source:{kind:"state",path:"state.heatTarget"},format:{type:"temperature",decimals:0},icon:"Flame"},{id:"coolTarget",label:"device.thermostat.fields.coolTarget",source:{kind:"state",path:"state.coolTarget"},format:{type:"temperature",decimals:0},icon:"Snowflake"},{id:"fanMode",label:"device.thermostat.fields.fanMode",source:{kind:"state",path:"state.fanMode"},format:{type:"text"}}]},stateRules:{primaryState:{label:"device.thermostat.fields.operatingMode",fieldPath:"state.operatingMode",mapping:{heat:"heat",cool:"cool",auto:"auto",off:"off",eco:"eco",unknown:"unknown"},fallback:"unknown"}}},vehicle:{icon:"Car",category:"device",archetype:"device",detailPage:true,label:{singular:"EV",plural:"EVs"},description:"Electric vehicle managed as a flexible load",fusedMetricId:"chargePercentage",fields:{headlineMetrics:[{id:"chargePercentage",label:"device.vehicle.fields.chargePercentage",source:{kind:"state",path:"state.chargePercentage"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"range",label:"device.vehicle.fields.range",source:{kind:"state",path:"state.range"},format:{type:"distance",unit:"mi",decimals:0},icon:"GasPump"},{id:"chargeLimit",label:"device.vehicle.fields.chargeLimit",source:{kind:"state",path:"state.chargeLimit"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"},{id:"isPluggedIn",label:"device.vehicle.fields.isPluggedIn",source:{kind:"state",path:"state.isPluggedIn"},format:{type:"boolean",trueText:"Yes",falseText:"No"},icon:"Plug"}]},stateRules:{primaryState:{label:"device.vehicle.fields.status",fieldPath:"state.chargingState",mapping:{charging:"charging",discharging:"discharging",idle:"idle",unknown:"unknown"},fallback:"unknown"}}},waterHeater:{icon:"Drop",category:"device",archetype:"device",detailPage:true,label:{singular:"Water Heater",plural:"Water Heaters"},description:"Connected or smart electric water heater"}},RD={source:"SOURCE",substation:"SOURCE",capacitor:"CAPACITOR",switch:"SWITCH",sectionalizer:"SWITCH",relay:"NODE",transformer:"TRANSFORMER",meter:"CONSUMER",consumer:"CONSUMER",singlePhaseOverheadLine:"OVERHEAD_LINE",twoPhaseOverheadLine:"OVERHEAD_LINE",threePhaseOverheadLine:"OVERHEAD_LINE",singlePhaseUndergroundLine:"UNDERGROUND_LINE",twoPhaseUndergroundLine:"UNDERGROUND_LINE",threePhaseUndergroundLine:"UNDERGROUND_LINE",motorSwitch:"MOTOR",recloser:"OVERCURRENT_DEVICE",fuse:"OVERCURRENT_DEVICE",breaker:"OVERCURRENT_DEVICE",generator:"GENERATOR",regulator:"REGULATOR",supportStructure:"NODE"};function bc(e){return oa[e]}function MD(e){return oa[e].icon}function ED(e,t=false){return t?oa[e].label.plural:oa[e].label.singular}function DD(e){return oa[e].category}var LD={min:2,max:4};function AD(e){let t=oa[e];if(!t)throw new Error(`archetypeFor: unknown entity type "${String(e)}"`);return t.archetype}function ID(e){return bc(e).detailPage}function FD(e){return (bc(e).fields?.headlineMetrics.length??0)>0}function _y(e){return bc(e).properties?.statList??[]}function BD(e){return _y(e).length>0}function VD({formId:e="dialog-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:i="secondary",children:s,title:c,...l}){return jsx(kr,{title:c,primaryAction:{label:r,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:i}:void 0,...l,children:jsx(Ia,{id:e,onSubmit:t,children:s})})}function zD({formId:e="drawer-form",onSubmit:t,primaryLabel:r="Save",secondaryLabel:o="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:i="secondary",children:s,...c}){return jsx(Ei,{primaryAction:{label:r,onPress:()=>{let d=document.getElementById(e);d&&d.requestSubmit();},variant:a},secondaryAction:n?{label:o,onPress:n,variant:i}:void 0,...c,children:jsx(Ia,{id:e,onSubmit:t,className:"mt-2",children:s})})}function HD({align:e="end",className:t,...r}){return jsx("div",{...r,className:twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",t)})}var UD={sm:"gap-2",md:"gap-4",lg:"gap-6"};function KD(e){if(!e)return "";let t=e.base?`grid-cols-${e.base}`:"",r=e.md?`md:grid-cols-${e.md}`:"",o=e.lg?`lg:grid-cols-${e.lg}`:"";return [t,r,o].filter(Boolean).join(" ")}function YD({cols:e={base:1},gap:t="lg",className:r,...o}){return jsx("div",{...o,className:twMerge("grid",KD(e),UD[t],r)})}function jD({title:e,description:t,showDivider:r,className:o,children:n,...a}){return jsxs("section",{...a,className:twMerge("flex flex-col",o),children:[(e||t)&&jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsx(Qt,{tag:"h3",size:"sm",children:e}):e,t?jsx(Te,{size:"lg",children:t}):null]}),jsx("div",{className:"flex flex-col gap-6",children:n}),r&&jsx("hr",{className:"mt-2 border-border-muted"})]})}function qD(){return jsx("hr",{className:"border-border-muted"})}function QD({steps:e,currentStepId:t,onStepClick:r,className:o}){let n=e.findIndex(a=>a.id===t);return jsx("nav",{"aria-label":"Progress",className:twMerge("w-full",o),children:jsx("div",{className:"relative mb-12",children:jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,i)=>{let s=a.id===t,c=i<n,l=r&&(c||s);return jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsx("button",{type:"button",disabled:!l,onClick:()=>l&&r?.(a.id),className:twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",c&&"border-action-primary bg-action-primary text-text-inverse hover:bg-action-primary/90",s&&"border-action-primary bg-background-body text-action-primary",!c&&!s&&"border-border-default bg-background-body text-text-secondary",l&&"cursor-pointer",!l&&"cursor-default"),"aria-current":s?"step":void 0,children:c?jsx(B,{name:"Check",size:20,weight:"bold"}):jsx("span",{className:"text-sm font-semibold",children:i+1})}),i<e.length-1&&jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:i<n?"var(--color-action-primary)":"var(--color-border-default)"}}),jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsx("span",{className:twMerge("text-sm font-medium",s&&"text-text-default",c&&"text-text-primary",!s&&!c&&"text-text-secondary"),children:a.title}),a.description&&jsx("span",{className:"mt-1 text-xs text-text-secondary",children:a.description})]})]},a.id)})})})})}function _D({formId:e,show:t,isSubmitting:r,onCancel:o,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:i}){return t?jsx("div",{className:twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",i),children:jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsx("div",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),jsxs("div",{className:"flex gap-2",children:[jsx(_,{variant:"secondary",onPress:o,children:a}),jsx(_,{type:"submit",form:e,isDisabled:!!r,children:r?"Saving...":n})]})]})}):null}function $D({when:e,message:t="You have unsaved changes. Leave anyway?"}){return Oe.useEffect(()=>{if(!e)return;let r=o=>(o.preventDefault(),o.returnValue=t,t);return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[e,t]),null}function eL({steps:e,initialStepId:t,canNavigate:r}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[o,n]=Oe.useState(t||e[0].id),a=e.findIndex(u=>u.id===o),i=a>0,s=a<e.length-1,c=async u=>u===o?true:r&&!await r(o,u)?false:(n(u),true);return {steps:e,currentStepId:o,setCurrentStepId:c,next:async()=>!s||a===-1?false:c(e[a+1].id),prev:async()=>!i||a===-1?false:c(e[a-1].id),hasNext:s,hasPrev:i,stepIndex:a}}function _i(e,t){return t.split(".").reduce((r,o)=>r?.[o],e)}function rL(e,t){let r=_i(e,t.field),o=t.value;switch(t.operator){case "eq":return r===o;case "neq":return r!==o;case "in":return Array.isArray(o)?Array.isArray(r)?r.some(n=>o.includes(n)):o.includes(r):false;case "nin":return Array.isArray(o)?Array.isArray(r)?!r.some(n=>o.includes(n)):!o.includes(r):false;case "gt":return r instanceof Date&&typeof o=="string"?r>new Date(o):r>o;case "gte":return r instanceof Date&&typeof o=="string"?r>=new Date(o):r>=o;case "lt":return r instanceof Date&&typeof o=="string"?r<new Date(o):r<o;case "lte":return r instanceof Date&&typeof o=="string"?r<=new Date(o):r<=o;case "contains":return typeof r!="string"?false:r.toLowerCase().includes(String(o).toLowerCase());case "startsWith":return typeof r!="string"?false:r.toLowerCase().startsWith(String(o).toLowerCase());case "endsWith":return typeof r!="string"?false:r.toLowerCase().endsWith(String(o).toLowerCase());default:return false}}function iv(e,t){if(t.conditions.length===0)return true;let r=t.conditions.map(o=>"conditions"in o?iv(e,o):rL(e,o));return t.logic==="AND"?r.every(Boolean):r.some(Boolean)}function oL(e,t){return !t||t.conditions.length===0?e:e.filter(r=>iv(r,t))}function nL(e,t,r){if(e==null&&t==null)return 0;if(e==null)return r==="asc"?1:-1;if(t==null)return r==="asc"?-1:1;if(e instanceof Date&&t instanceof Date){let o=e.getTime()-t.getTime();return r==="asc"?o:-o}if(typeof e=="string"&&typeof t=="string"){let o=e.toLowerCase().localeCompare(t.toLowerCase());return r==="asc"?o:-o}return e<t?r==="asc"?-1:1:e>t?r==="asc"?1:-1:0}function aL(e,t){return t?[...e].sort((r,o)=>{let n=_i(r,t.field),a=_i(o,t.field);return nL(n,a,t.direction)}):e}function iL(e,t){if(!t||!t.query.trim())return e;let{query:r,fields:o,fuzzy:n=true,threshold:a=.3}=t;if(n)return new tL(e,{keys:o,threshold:a,ignoreLocation:true,includeScore:true}).search(r).map(l=>l.item);let i=r.toLowerCase();return e.filter(s=>o.some(c=>{let l=_i(s,c);return l==null?false:String(l).toLowerCase().includes(i)}))}function sL(e,t){let r={};for(let o of t){if(r[o.field]={},o.values)for(let n of o.values)r[o.field][String(n.value)]=0;for(let n of e){let a=_i(n,o.field);if(a!=null)if(Array.isArray(a))for(let i of a){let s=String(i);r[o.field][s]=(r[o.field][s]||0)+1;}else {let i=String(a);r[o.field][i]=(r[o.field][i]||0)+1;}}}return r}function Dp({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){let a=iL(e,o||null);a=oL(a,t||null);let i=sL(a,n);return a=aL(a,r||null),{data:a,facetCounts:i,resultCount:a.length}}function hc({data:e,filters:t,sort:r,search:o,facetConfigs:n=[]}){return useMemo(()=>Dp({data:e,filters:t,sort:r,search:o,facetConfigs:n}),[e,t,r,o,n])}function yc({filters:e,sort:t,search:r,onStateChange:o,searchDebounce:n=300}){let a=Vo(r,n),i=useRef(true);useEffect(()=>{if(i.current){i.current=false;return}o({filters:e,sort:t,search:a});},[e,t,a,o]);}function sv(e){return e.mode==="client"?hc({data:e.data,filters:e.filters,sort:e.sort,search:e.search,facetConfigs:e.facetConfigs}):(yc({filters:e.filters,sort:e.sort,search:e.search,onStateChange:e.onStateChange,searchDebounce:e.searchDebounce}),{data:e.data,facetCounts:e.facetCounts||{},resultCount:e.resultCount??e.data.length})}var lv=Op(su());function pL(e,t,r=true){let o=e;if(r){let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);return `${o}-${n}.${t}`}return `${o}.${t}`}function mL(e,t){return t.accessor?typeof t.accessor=="function"?t.accessor(e):e[t.accessor]:null}function cv(e,t){let r=mL(t,e);return e.exportValue?e.exportValue(r,t)??"":r==null?"":r instanceof Date?r.toISOString():typeof r=="object"?JSON.stringify(r):r}function Lp(e){return e.filter(t=>t.exportable!==false)}function dv(e){let t=e.map(n=>n.exportLabel||n.label),r=new Set,o=[];for(let n of t)r.has(n)?o.includes(n)||o.push(n):r.add(n);if(o.length>0)throw new Error(`Duplicate export headers found: ${o.join(", ")}. Use exportLabel to provide unique headers.`)}async function Ap(e){let{columns:t,data:r,metadata:o={}}=e;try{let n=Lp(t);if(n.length===0)throw new Error("No exportable columns found");dv(n);let a=r.map(l=>{let d={};for(let u of n){let m=u.exportLabel||u.label;d[m]=cv(u,l);}return d}),i=dk.unparse(a,{header:!0,skipEmptyLines:!0}),s=new Blob([i],{type:"text/csv;charset=utf-8;"}),c=pL(o.filename||"table-data","csv",o.timestamp!==!1);(0,lv.saveAs)(s,c);}catch(n){throw new Error(`CSV export failed: ${n instanceof Error?n.message:"Unknown error"}`)}}function fL(e){let{columns:t,data:r}=e,o=Lp(t);return dv(o),r.map(n=>{let a={};for(let i of o){let s=i.exportLabel||i.label;a[s]=cv(i,n);}return a})}function gL(e){return Lp(e).map(t=>t.exportLabel||t.label)}function uv({columns:e,data:t,metadata:r}){let n=e.filter(i=>i.exportable!==false).length>0&&t.length>0;return {exportCSV:useCallback(async()=>{try{await Ap({columns:e,data:t,metadata:r});}catch(i){throw console.error("Table export failed:",i),i}},[e,t,r]),canExport:n}}function Doe(e){switch(e){case "charging":case "on":return "success";case "discharging":return "warning";case "heat":case "cool":return "info";case "off":case "idle":case "eco":case "auto":return "neutral";default:return "neutral"}}export{PD as ABSENT_GRID_FIELDS,Jb as ActionCell,fa as ActionMenu,Cd as ActivityFeed,xs as ActivityFeedGroup,hs as ActivityItem,cf as Alert,bf as AppShell,Jo as AreaSeries,wl as AutoMobileRenderer,Ps as Autocomplete,xo as Avatar,ln as BREAKPOINTS,nt as Badge,jb as BadgeCell,Ms as Banner,Hs as BarSeries,qb as BooleanCell,Qp as BrandProvider,Ds as BreadcrumbItem,Es as Breadcrumbs,_ as Button,ia as CUSTOM_ICON_REGISTRY,ha as Calendar,Ue as Card,md as CardContent,fd as CardFooter,ud as CardHeader,pd as CardMedia,Nl as CardMobileRenderer,Yf as CarouselAutoplayTrigger,Wf as CarouselControl,Ud as CarouselIndicator,Kf as CarouselIndicatorGroup,Hf as CarouselItem,Of as CarouselItemGroup,Uf as CarouselNextTrigger,Gf as CarouselPrevTrigger,Jf as CarouselProgressText,zf as CarouselRoot,wg as CategoryBarChart,Mr as ChartAxis,Ta as ChartBottomBar,Gg as ChartContainer,Rr as ChartContext,Js as ChartEventMarkers,Xs as ChartEventSpans,Xo as ChartTooltip,Sn as Checkbox,Kd as CheckboxGroup,eo as Chip,$f as ChipInputField,ni as ClearButton,rg as CodeEditor,ya as Collapse,Ko as CollapseContent,Uo as CollapseHeader,Go as CollapseItem,fN as ColorField,sm as ColorModeProvider,zx as CommandPalette,lg as Confirm,cg as ConnectionStatusBadge,dg as ContactCard,Zb as ContactMetaCell,Bs as ContactMetaDisplay,mg as ContainerQueryProvider,Oo as CopyToClipboard,_b as CustomCell,$l as DEFAULT_MAP_TYPE,Bb as DataControls,Tx as DataTable,$b as DateCell,Ob as DateField,sl as DateRangePicker,Te as Description,Rx as DeviceHealthBadge,tx as DeviceMetaCell,ml as DeviceMetaDisplay,zn as DeviceStateBadge,nx as DeviceStateCell,bl as DeviceStateWithMetric,Ex as DeviceTypeIcon,kr as Dialog,VD as DialogForm,Ht as DialogHeader,Ei as Drawer,zD as DrawerForm,TD as ENTITY_CATEGORY_CONFIG,oa as ENTITY_CONFIG,_s as EmptyState,Lx as EnrollmentStatusBadge,zr as ErrorBoundary,be as FieldError,yf as FieldGroup,Ix as FileUpload,Vb as FilterChips,Ub as FilterDialog,Bx as FirmwareVersionBadge,Ia as Form,HD as FormActions,qD as FormDivider,YD as FormGrid,jD as FormSection,QD as FormStepper,oe as FormatRegistry,ix as FormattedCell,Jg as FunnelSeries,RD as GRID_ELEMENT_TYPE_BY_ENTITY,kD as GRID_STATE_COLORS,st as GRID_STAT_LIST,Wx as GlobalSearch,qu as Grid,gl as GridStateBadge,LD as HEADLINE_METRIC_BOUNDS,Qt as Heading,gh as HierarchyExplorer,Vu as HorizontalBarCell,vR as HoverCard,B as Icon,Nr as InfiniteScrollIndicator,Ns as Input,yt as InputWrapper,Gi as InteractiveMap,Ch as Kpi,op as KpiGroup,ze as Label,Pn as LineSeries,Ph as List,HR as ListBox,_t as ListBoxItem,Mh as ListItem,Eh as ListPane,go as Loader,ba as Logo,ny as MAP_TYPES,cy as Meter,zu as MiniBarCell,cr as ModalBackdrop,nc as Notice,ac as NoticeContainer,uy as NoticeProvider,ux as NumberCell,ki as NumberField,Ef as PageBanner,Qn as PageLayout,Ou as PercentBarCell,yy as PlaceSearch,lt as Popover,Cy as ProgressBar,Sy as Prose,Py as Radio,wy as RadioCard,Ny as RadioCardGroup,Ty as RadioGroup,Ma as RangeCalendar,Ci as ResultsCount,Ey as RichTextEditor,_o as SKELETON_SIZES,Xc as SOURCE_UNIT_TO_WH,_D as SaveBar,In as SearchControl,Gx as SearchEmptyState,Kx as SearchLoadingState,Jx as SearchResultGroup,Xx as SearchResultItem,jx as SearchResultsList,Qx as SearchTrigger,Ua as Section,lc as SectionNav,tl as SegmentedControl,bo as Select,mx as SelectCell,vs as SideNav,Dy as SiteCard,Ay as SiteContactCard,gx as SiteMetaCell,yl as SiteMetaDisplay,J as Skeleton,Iy as Slider,Si as SortControl,Hu as SparklineCell,gc as SplitPane,Cs as StackNav,Ll as StatList,Ga as StaticMap,ll as Switch,mc as Tab,pc as TabList,by as TabPanel,uc as Tabs,Hy as TextArea,Ky as TextAreaWithChips,yx as TextCell,Lr as TextField,Ze as TextLink,Qs as TiledTimeSeriesChart,Db as TiledTimeSeriesExplorer,rl as TimeControls,Jy as TimeField,Xy as Timeline,jy as TimelineItem,Zy as ToggleButton,Zt as Tooltip,oi as TopNav,ct as Tray,$D as UnsavedChangesPrompt,_1 as activeDeviceStates,Zo as addFilterCondition,Dp as applyDataOperations,AD as archetypeFor,db as assembleSeries,IC as autoScaleCurrent,bm as autoScaleDistance,vm as autoScaleEnergy,GC as autoScalePower,UC as autoScaleResistance,QC as autoScaleVoltage,KN as baselineFromPoint,Bm as camelCaseToWords,Im as capitalize,KC as celsiusToFahrenheit,u5 as celsiusToKelvin,JA as centimetersToInches,rs as clearColorCache,bC as createCategoryColorMap,wi as createEmptyFilter,g1 as createFilter,b1 as createFilters,z5 as createFormat,rt as createTextureIcon,Xg as createTiledCameraSyncGroup,ru as createXScale,di as createYScale,ad as csvUnitFor,Om as csvValueFor,Ie as defaultMargin,$1 as deviceStateLabels,xU as deviceStateMetricFormats,ub as emptyStore,ID as entityHasDetailPage,BD as entityHasStatList,FD as entityShowsNow,jC as enumToSentenceCase,cu as exportChart,Ap as exportTableAsCSV,YC as fahrenheitToCelsius,p5 as fahrenheitToKelvin,VA as feetToMeters,HA as feetToMiles,x1 as filterToChips,lm as formatBoolean,gA as formatCapacity,jr as formatComponentValue,mm as formatCurrency,zc as formatCurrent,fm as formatDate,xm as formatDistance,ul as formatEmptyValue,jc as formatEnergy,Vr as formatFieldValue,qc as formatInternationalPhone,pm as formatNumber,dm as formatPercent,Cm as formatPhone,ca as formatPhoneNumber,$c as formatPower,bA as formatPowerRating,td as formatResistance,Mm as formatTemperature,zm as formatText,is as formatUSPhone,nd as formatVoltage,Kb as getBadgeClasses,Yb as getBooleanBadgeVariant,Lu as getCellAlignmentClasses,Me as getCellContainerClasses,Ar as getCellTextClasses,xC as getContrastingTextColor,DA as getDateParts,qa as getDefaultChartColor,_p as getDefaultColors,Fu as getDeviceStateDisplayLabel,Fu as getDeviceStateLabel,DD as getEntityCategory,bc as getEntityConfig,MD as getEntityIcon,ED as getEntityLabel,_y as getEntityStatList,yo as getEventColor,gk as getExportFormatName,gL as getExportHeaders,bS as getFieldGroupStyles,Bn as getFilterFields,ox as getGridStateLabel,hf as getInputBackgroundStyles,zt as getInputBaseStyles,zo as getInputStateStyles,Au as getLinkClasses,pl as getNumericColorClasses,Pt as getResolvedColor,nr as getSkeletonSize,Doe as getStateTone,cn as getThemeCategoricalColors,Hr as getYFormatSettings,tP as gridStateLabels,YA as inchesToCentimeters,Iu as isActiveDeviceState,Iu as isActiveState,pp as isCustomPinsLayer,fk as isExportSupported,il as isFilterEmpty,up as isGeoJsonLayer,$p as isLightColor,me as isNil,mp as isRasterLayer,dp as isVectorLayer,JC as kelvinToCelsius,m5 as kelvinToFahrenheit,OA as kilometersToMiles,cp as layer,Mc as mapValuesToCategoricalColors,BA as metersToFeet,WA as metersToMiles,KA as metersToYards,gm as milesToFeet,zA as milesToKilometers,GA as milesToMeters,Lo as parseBoolean,Jc as pickEnergyUnit,fL as prepareTableDataForExport,sy as registerPhosphorIcon,Fn as removeFilterCondition,Se as resolveValue,Vm as snakeCaseToWords,$s as telemetryPresetRanges,Nm as temperatureStringToSymbol,Zs as tierForViewport,hT as tileIndexAt,rr as tileKey,pb as tileReducer,jo as tilesForViewport,TA as toA,kC as toActiveInactive,ns as toAmps,Do as toBoolean,Tm as toCelsius,OC as toCentimeters,PC as toCheckmark,DC as toCompactNumber,um as toCurrency,zC as toCustomDateFormat,FC as toDateString,wC as toEnabledDisabled,km as toFahrenheit,Wc as toFeet,MC as toFloat,EC as toFormattedNumber,BC as toFullDateTime,n5 as toGW,ym as toGWh,_c as toGigawatts,VC as toISOString,WC as toInches,RC as toInteger,PA as toKA,C5 as toKV,r5 as toKW,Pm as toKelvin,Vc as toKiloamps,Sm as toKilohms,Hc as toKilometers,od as toKilovolts,Qc as toKilowatts,Dm as toLowerCase,kA as toMA,y5 as toMV,o5 as toMW,hm as toMWh,Zc as toMegawatts,wm as toMegohms,Oc as toMeters,Gc as toMiles,Bc as toMilliamps,HC as toMillimeters,ed as toMilliohms,rd as toMillivolts,FA as toNauticalMiles,ls as toOhms,NC as toOnOff,cm as toPercentage,as as toRelativeTime,LC as toScientificNotation,qC as toSecret,Lm as toSentenceCase,Rm as toTemperature,Am as toTitleCase,TC as toTrueFalse,Em as toUpperCase,v5 as toV,us as toVolts,t5 as toW,ss as toWatts,Kc as toWh,Uc as toYards,Yc as tokWh,ds as truncateEnd,da as truncateMiddle,cs as truncateStart,gt as typeRole,qr as typographyRole,Fm as ucFirst,Xt as useBreakpoint,Tn as useChartContext,hc as useClientDataControls,Vt as useColorMode,vA as useComponentFormatter,ug as useContainerBreakpoint,sv as useDataControls,Vo as useDebounce,xa as useElementSize,Fo as useInfiniteScroll,Pr as useInputFocus,Ul as useLocalStorage,Jt as useMediaQuery,my as useNotice,yc as useServerDataControls,uv as useTableExport,yb as useTileWindow,vu as useTiledTimeSeries,eL as useWizard,ao as wrapWithLink,UA as yardsToMeters};//# sourceMappingURL=index.js.map
|
|
48
48
|
//# sourceMappingURL=index.js.map
|