@texturehq/edges 5.23.3 → 5.23.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {TooltipTrigger,Tooltip,OverlayArrow,composeRenderProps,DialogTrigger,Menu,MenuItem,Link,Button,Modal,Dialog,useSlottedContext,PopoverContext,Popover,ModalOverlay,Checkbox,Select,SelectValue,ListBox,ListBoxItem,MenuTrigger,ComboBox,Input,ListBoxSection,Header,Breadcrumbs,Breadcrumb,Calendar,CalendarGrid,CalendarGridBody,CalendarCell,Text,useLocale,Heading,CalendarGridHeader,CalendarHeaderCell,CheckboxGroup,DisclosureGroup,Disclosure,DisclosurePanel,TextField,RangeCalendar,ToggleButton,DateField,DateInput,DateSegment,DateRangePicker,NumberField,Group as Group$1,Switch,DropZone,FileTrigger,Form,Meter,Tabs,TabList,Tab,TabPanel,ProgressBar,Radio,RadioGroup,TimeField}from'react-aria-components';export{DialogTrigger,Focusable}from'react-aria-components';import*as ot from'react';import ot__default,{memo,createContext,forwardRef,useMemo,useId,useRef,useImperativeHandle,useState,useEffect,useCallback,isValidElement,useContext,Children,Fragment as Fragment$1,cloneElement,Component,useLayoutEffect,useReducer,createElement}from'react';import {twMerge}from'tailwind-merge';import {jsxs,Fragment,jsx}from'react/jsx-runtime';import*as bg from'@phosphor-icons/react';import {icons}from'@phosphor-icons/core';import cT from'fuse.js';import {DateTime}from'luxon';import {useVirtualizer}from'@tanstack/react-virtual';import*as mk from'@phosphor-icons/react/ssr';import {useFilter}from'react-aria';import {useAsyncList}from'react-stately';import {Minus,Check,Lightbulb,XCircle,AlertCircle,CheckCircle,Info,X,ChevronRight,ArrowUp,ArrowDown,CalendarIcon,Image as Image$1,Upload,AlertTriangle,User,Building2,Users}from'lucide-react';import {motion,AnimatePresence}from'framer-motion';import v1 from'react-ace';import {HexColorPicker}from'react-colorful';import {curveLinear}from'@visx/curve';import {Bar,AreaClosed,LinePath,Line,Area,Pie}from'@visx/shape';import {LinearGradient}from'@visx/gradient';import {Group}from'@visx/group';import {scaleLinear,scaleTime,scaleBand}from'@visx/scale';import {bisector,extent,min,max}from'd3-array';import {Axis}from'@visx/axis';import {withParentSize}from'@visx/responsive';import {Zoom}from'@visx/zoom';import WR from'papaparse';import {Brush}from'@visx/brush';import {PatternLines}from'@visx/pattern';import {subDays}from'date-fns';import {fromDate,getLocalTimeZone,parseDate}from'@internationalized/date';import {scaleTime as scaleTime$1}from'd3-scale';import {timeTickInterval}from'd3-time';import {useSensors,useSensor,PointerSensor,KeyboardSensor,DndContext,closestCenter}from'@dnd-kit/core';import {sortableKeyboardCoordinates,SortableContext,horizontalListSortingStrategy,arrayMove,useSortable}from'@dnd-kit/sortable';import {CSS}from'@dnd-kit/utilities';import {createPortal}from'react-dom';import h4,{AttributionControl,Marker,Popup,Source,Layer}from'react-map-gl';import {renderToStaticMarkup}from'react-dom/server';import z5 from'@tiptap/extension-link';import {useEditor,EditorContent}from'@tiptap/react';import {BubbleMenu}from'@tiptap/react/menus';import U5 from'@tiptap/starter-kit';var ow=Object.create;var Ru=Object.defineProperty;var nw=Object.getOwnPropertyDescriptor;var aw=Object.getOwnPropertyNames;var iw=Object.getPrototypeOf,sw=Object.prototype.hasOwnProperty;var lw=(e,t,r)=>t in e?Ru(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var cw=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var dw=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of aw(t))!sw.call(e,n)&&n!==r&&Ru(e,n,{get:()=>t[n],enumerable:!(o=nw(t,n))||o.enumerable});return e};var mg=(e,t,r)=>(r=e!=null?ow(iw(e)):{},dw(Ru(r,"default",{value:e,enumerable:true}),e));var Qi=(e,t,r)=>lw(e,typeof t!="symbol"?t+"":t,r);var fm=cw((pm,mm)=>{(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof pm<"u"?t():(t(),e.FileSaver={});})(pm,function(){function e(s,d){return typeof d>"u"?d={autoBom:false}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(s.type)?new Blob(["\uFEFF",s],{type:s.type}):s}function t(s,d,c){var l=new XMLHttpRequest;l.open("GET",s),l.responseType="blob",l.onload=function(){i(l.response,d,c);},l.onerror=function(){console.error("could not download file");},l.send();}function r(s){var d=new XMLHttpRequest;d.open("HEAD",s,false);try{d.send();}catch{}return 200<=d.status&&299>=d.status}function o(s){try{s.dispatchEvent(new MouseEvent("click"));}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",true,true,window,0,0,0,80,20,false,false,false,false,0,null),s.dispatchEvent(d);}}var n=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,a=n.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),i=n.saveAs||(typeof window!="object"||window!==n?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(s,d,c){var l=n.URL||n.webkitURL,u=document.createElement("a");d=d||s.name||"download",u.download=d,u.rel="noopener",typeof s=="string"?(u.href=s,u.origin===location.origin?o(u):r(u.href)?t(s,d,c):o(u,u.target="_blank")):(u.href=l.createObjectURL(s),setTimeout(function(){l.revokeObjectURL(u.href);},4e4),setTimeout(function(){o(u);},0));}:"msSaveOrOpenBlob"in navigator?function(s,d,c){if(d=d||s.name||"download",typeof s!="string")navigator.msSaveOrOpenBlob(e(s,c),d);else if(r(s))t(s,d,c);else {var l=document.createElement("a");l.href=s,l.target="_blank",setTimeout(function(){o(l);});}}:function(s,d,c,l){if(l=l||open("","_blank"),l&&(l.document.title=l.document.body.innerText="downloading..."),typeof s=="string")return t(s,d,c);var u=s.type==="application/octet-stream",m=/constructor/i.test(n.HTMLElement)||n.safari,p=/CriOS\/[\d]+/.test(navigator.userAgent);if((p||u&&m||a)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var b=g.result;b=p?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),l?l.location.href=b:location=b,l=null;},g.readAsDataURL(s);}else {var f=n.URL||n.webkitURL,h=f.createObjectURL(s);l?l.location=h:location.href=h,l=null,setTimeout(function(){f.revokeObjectURL(h);},4e4);}});n.saveAs=i.saveAs=i,typeof mm<"u"&&(mm.exports=i);});});function Pr(e,t=false){let[r,o]=useState(t);return useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);o(n.matches);let a=i=>{o(i.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),r}var oa={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function Rr(e="base"){let t=Pr(`(min-width: ${oa.sm})`,e!=="base"),r=Pr(`(min-width: ${oa.md})`,["md","lg","xl","2xl"].includes(e)),o=Pr(`(min-width: ${oa.lg})`,["lg","xl","2xl"].includes(e)),n=Pr(`(min-width: ${oa.xl})`,["xl","2xl"].includes(e)),a=Pr(`(min-width: ${oa["2xl"]})`,e==="2xl"),i=!r,s=r,d="base";return a?d="2xl":n?d="xl":o?d="lg":r?d="md":t&&(d="sm"),{current:d,isSm:t,isMd:r,isLg:o,isXl:n,is2Xl:a,isMobile:i,isDesktop:s}}function Xe(e,t){let r=forwardRef(({size:o=24,color:n="currentColor",className:a,mirrored:i,alt:s,weight:d,...c},l)=>{let u=!!s||"aria-label"in c;return jsx("svg",{ref:l,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 256 256",fill:n,color:n,className:a,transform:i?"scale(-1, 1)":void 0,"aria-hidden":u?void 0:true,role:u?"img":void 0,"aria-label":s,...c,children:t})});return r.displayName=e,r}var wl=()=>jsxs(Fragment,{children:[jsx("path",{d:"M12 128h44M200 128h44",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsx("circle",{cx:"76",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsx("circle",{cx:"180",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"})]}),fg=()=>jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),gg=()=>jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),hg=()=>jsxs(Fragment,{children:[jsx("path",{d:"M112 85.7 A32 32 0 1 1 144 85.7",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsx("circle",{cx:"128",cy:"58",r:"8",fill:"currentColor",stroke:"none"})]}),gw=Xe("TextureRecloser",jsxs(Fragment,{children:[jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"R"})]})),hw=Xe("TextureFuse",jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),bw=Xe("TextureBreaker",jsxs(Fragment,{children:[jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"140",fontWeight:"700",fill:"currentColor",stroke:"none",children:"B"})]})),xw=Xe("TextureSource",jsxs(Fragment,{children:[jsx("path",{d:"M4 128h40M212 128h40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsx("circle",{cx:"128",cy:"128",r:"84",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsx("path",{d:"M92 128q18 -84 36 0q18 84 36 0",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),yw=Xe("TextureCapacitor",jsx(Fragment,{children:jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),vw=Xe("TextureRegulator",jsxs(Fragment,{children:[jsx("circle",{cx:"128",cy:"128",r:"92",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsx("text",{x:"128",y:"126",textAnchor:"middle",dominantBaseline:"central",fontFamily:"ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",fontSize:"128",fontWeight:"700",fill:"currentColor",stroke:"none",children:"V"})]})),Cw=Xe("TextureSwitch",jsxs(Fragment,{children:[jsx(wl,{}),jsx(fg,{})]})),Sw=Xe("TextureSwitchClosed",jsxs(Fragment,{children:[jsx(wl,{}),jsx(gg,{})]})),ww=Xe("TextureOpenPoint",jsxs(Fragment,{children:[jsx("path",{d:"M112 52 C 74 92, 74 164, 112 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"}),jsx("path",{d:"M144 52 C 182 92, 182 164, 144 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"})]})),Tw=Xe("TextureSectionalizerOpen",jsxs(Fragment,{children:[jsx(wl,{}),jsx(fg,{}),jsx(hg,{})]})),Nw=Xe("TextureSectionalizerClosed",jsxs(Fragment,{children:[jsx(wl,{}),jsx(gg,{}),jsx(hg,{})]})),kw=Xe("TextureTransformer",jsxs(Fragment,{children:[jsx("path",{d:"M40 64H88A22 22 0 0 1 88 108A22 22 0 0 1 88 152A22 22 0 0 1 88 196H40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M216 64H168A22 22 0 0 0 168 108A22 22 0 0 0 168 152A22 22 0 0 0 168 196H216",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),ri={1:[128],2:[110,146],3:[92,128,164]},Mu=e=>jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),Eu=e=>jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),Pw=Xe("TextureSinglePhaseOverheadLine",jsx(Fragment,{children:ri[1].map(Mu)})),Rw=Xe("TextureTwoPhaseOverheadLine",jsx(Fragment,{children:ri[2].map(Mu)})),Mw=Xe("TextureThreePhaseOverheadLine",jsx(Fragment,{children:ri[3].map(Mu)})),Ew=Xe("TextureSinglePhaseUndergroundLine",jsx(Fragment,{children:ri[1].map(Eu)})),Lw=Xe("TextureTwoPhaseUndergroundLine",jsx(Fragment,{children:ri[2].map(Eu)})),Dw=Xe("TextureThreePhaseUndergroundLine",jsx(Fragment,{children:ri[3].map(Eu)})),Aw=Xe("TextureSupportStructure",jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),Iw=Xe("TextureExplore",jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"2",children:[jsx("circle",{cx:"128",cy:"128",r:"96"}),jsx("path",{d:"M170.667 85.333 149.333 149.333 85.333 170.667 106.667 106.667Z M106.667 106.667 149.333 149.333"})]})),Fw=Xe("TextureBoards",jsx("path",{d:"M32 21.333H106.667V128H32Z M149.333 21.333H224V85.333H149.333Z M32 170.667H106.667V234.667H32Z M149.333 128H224V234.667H149.333Z",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"2"})),Bw=Xe("TextureMonitors",jsx("path",{d:"M32 74.667H224 M42.667 202.667H106.667L170.667 117.333H224",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"2"})),Vw=Xe("TextureSurvey",jsx("path",{d:"M 32 74.667 V 32 H 74.667 M 181.333 32 H 224 V 74.667 M 224 181.333 V 224 H 181.333 M 74.667 224 H 32 V 181.333 M 74.667 128 H 96 M 160 128 H 181.333 M 128 74.667 V 96 M 128 160 V 181.333 M 96 128 A 32 32 0 1 0 160 128 A 32 32 0 1 0 96 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"2"})),Ow=Xe("TextureSeismic",jsx("path",{d:"M 32 55.36 H 224 M 21.333 162.027 H 53.333 L 74.667 119.36 L 96 204.693 L 117.333 98.027 L 138.667 183.36 L 160 140.693 L 181.333 162.027 H 234.667",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"2"})),zw=Xe("TextureWaypoint",jsx("path",{d:"M 17.067 180.267 L 49.067 148.267 L 81.067 180.267 L 49.067 212.267 Z M 81.067 180.267 H 102.4 L 166.4 116.267 M 155.733 41.6 H 134.4 C 91.733 41.6 91.733 105.6 134.4 105.6 H 155.733 M 198.4 41.6 H 209.067 C 251.733 41.6 251.733 105.6 209.067 105.6 H 198.4 M 145.067 73.6 H 198.4",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"2"})),Hw=Xe("TextureTerrain",jsx("path",{d:"M 32 32 H 224 V 224 H 32 Z M 32 128 H 224 M 128 32 V 224 M 32 128 L 128 32 M 128 224 L 224 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"2"})),Gw=Xe("TextureMagma",jsx("path",{d:"M 32 226.667 V 162.667 C 32 88 128 130.667 128 56 V 34.667 H 224 M 85.333 226.667 V 194.667 C 85.333 130.667 181.333 173.333 181.333 98.667 V 88 H 224 M 138.667 226.667 C 138.667 184 224 194.667 224 141.333",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"2"})),Ww=Xe("TextureGround",jsx("path",{d:"M 32 80 L 128 32 L 224 80 V 176 L 128 224 L 32 176 Z M 32 80 L 85.333 106.667 M 170.667 106.667 L 224 80 M 128 170.667 V 224 M 85.333 106.667 L 128 85.333 L 170.667 106.667 V 149.333 L 128 170.667 L 85.333 149.333 Z M 85.333 106.667 L 128 128 L 170.667 106.667 M 128 128 V 170.667",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"2"})),Uw=Xe("TextureSensor",jsxs(Fragment,{children:[jsx("path",{d:"M88 40H40v48M168 40h48v48M216 168v48h-48M88 216H40v-48",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("circle",{cx:"128",cy:"128",r:"36",fill:"currentColor",stroke:"none"})]})),Io={TextureSensor:Uw,TextureSurvey:Vw,TextureSeismic:Ow,TextureWaypoint:zw,TextureTerrain:Hw,TextureMagma:Gw,TextureGround:Ww,TextureExplore:Iw,TextureBoards:Fw,TextureMonitors:Bw,TextureRecloser:gw,TextureFuse:hw,TextureBreaker:bw,TextureSource:xw,TextureCapacitor:yw,TextureRegulator:vw,TextureSwitch:Cw,TextureSwitchClosed:Sw,TextureOpenPoint:ww,TextureSectionalizerOpen:Tw,TextureSectionalizerClosed:Nw,TextureTransformer:kw,TextureSinglePhaseOverheadLine:Pw,TextureTwoPhaseOverheadLine:Rw,TextureThreePhaseOverheadLine:Mw,TextureSinglePhaseUndergroundLine:Ew,TextureTwoPhaseUndergroundLine:Lw,TextureThreePhaseUndergroundLine:Dw,TextureSupportStructure:Aw};if(process.env.NODE_ENV==="development")for(let e of Object.keys(Io))e in bg&&console.error(`Custom icon "${e}" collides with a Phosphor icon of the same name. Rename it (use the "Texture" prefix) to keep the icon namespace unambiguous.`);var oi={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},W=memo(({name:e,size:t="md",color:r,weight:o="regular",className:n,ariaLabel:a,...i})=>{let s=Io[e]??bg[e];if(!s)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let d=typeof t=="string"&&t in oi?oi[t]:t,c=twMerge("inline-block flex-shrink-0",!r&&"text-current",n);return jsx(s,{...i,size:d,color:r,weight:o,className:c,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});W.displayName="Icon";var Kw=memo(({variant:e="subtle",shape:t="square",containerSize:r,containerClassName:o,size:n="md",className:a,name:i,color:s,weight:d,ariaLabel:c,ref:l,...u})=>{let m=typeof n=="string"&&n in oi?oi[n]:n,p=r?typeof r=="string"&&r in oi?oi[r]:r:m*1.75,g=twMerge("inline-flex items-center justify-center flex-shrink-0",t==="circle"?"rounded-full":"rounded-lg",e==="subtle"&&"bg-background-muted",e==="solid"&&"bg-action-brand text-[color:var(--color-action-brand-text)]",e==="outline"&&"border-2 border-current",o);return jsx("div",{className:g,style:{width:p,height:p},children:jsx(W,{...u,name:i,size:n,color:s,weight:d,className:a,ariaLabel:c})})});Kw.displayName="IconWithContainer";var Yw={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"}},Xw={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}},Jw=["energized","customerName","gs_max_continuous_current"],jw=["MOTOR.voltage"],qw=[{key:"total_kvar",label:"Rated kvar",format:{type:"power",unit:"kvar",decimals:1}}],Zw=[{key:"kvar_a",label:"kvar A",format:{type:"power",unit:"kvar",decimals:1}},{key:"kvar_b",label:"kvar B",format:{type:"power",unit:"kvar",decimals:1}},{key:"kvar_c",label:"kvar C",format:{type:"power",unit:"kvar",decimals:1}}],gt={TRANSFORMER:[{key:"capacityKva",label:"kVA Rating",format:{type:"power",unit:"kVA",decimals:0}},{key:"phase",label:"Phase",format:{type:"text"}},{key:"primaryVoltageKv",label:"Primary Voltage",format:{type:"voltage",unit:"kV",decimals:1}},{key:"outputVoltageKv",label:"Output Voltage",format:{type:"voltage",unit:"kV",decimals:2}},{key:"manufacturer",label:"Manufacturer",format:{type:"text"}},{key:"xfmr_conductor_description",label:"Conductor",format:{type:"text"}}],CONSUMER:[{key:"service_address",label:"Service address",format:{type:"text"}},{key:"name",label:"Customer",format:{type:"text"}},{key:"account_number",label:"Account #",format:{type:"text"}},{key:"meterNumber",label:"Meter Number",format:{type:"text"}},{key:"service_type",label:"Service type",format:{type:"text"}}],SOURCE:[{key:"voltageKv",label:"Nominal Voltage",format:{type:"voltage",unit:"kV",decimals:1}},{key:"substationNumber",label:"Substation Number",format:{type:"text"}},{key:"trf_capacity",label:"Rated Capacity",format:{type:"text"}},{key:"connection_code",label:"Connection",format:{type:"text"}}],SWITCH:[{key:"switchId",label:"Switch ID",format:{type:"text"}},{key:"phase",label:"Phase",format:{type:"text"}},{key:"max_continuous_current",label:"Max Continuous Current",format:{type:"number",unit:"A",decimals:0}},{key:"switchIsOpen",label:"Position",format:{type:"text"}},{key:"switch_status",label:"Status",format:{type:"text"}},{key:"partnerIdentifier",label:"Partner ID",format:{type:"text"}}],CAPACITOR:[{key:"phase",label:"Phase",format:{type:"text"}},{key:"nominalVoltageV",label:"Nominal Voltage",format:{type:"voltage",unit:"V",decimals:0}}],OVERCURRENT_DEVICE:[{key:"size_value",label:"Size",format:{type:"text"}},{key:"phase",label:"Phase",format:{type:"text"}}],REGULATOR:[{key:"rated_kva",label:"Rated kVA",format:{type:"power",unit:"kVA",decimals:0}},{key:"phase",label:"Phase",format:{type:"text"}},{key:"manufacturer",label:"Manufacturer",format:{type:"text"}},{key:"high_side_configuration",label:"High Side",format:{type:"text"}},{key:"forwardSetVoltageV",label:"Forward Set Voltage",format:{type:"voltage",unit:"V",decimals:1}}],OVERHEAD_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:2}},{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"}},{key:"conductorDescNeutral",label:"Conductor Neutral",format:{type:"text"}},{key:"phase",label:"Phase",format:{type:"text"}},{key:"subtype_cd",label:"Subtype",format:{type:"text"}}],UNDERGROUND_LINE:[{key:"impedanceLength",label:"Length",format:{type:"distance",unit:"ft",decimals:2}},{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"}},{key:"phase",label:"Phase",format:{type:"text"}},{key:"subtype_cd",label:"Subtype",format:{type:"text"}}],NODE:[],SUPPORT_STRUCTURE:[{key:"height",label:"Height",format:{type:"distance",unit:"ft",decimals:0}},{key:"class",label:"Class",format:{type:"text"}},{key:"species",label:"Material",format:{type:"text"}},{key:"phase",label:"Phase",format:{type:"text"}},{key:"substation",label:"Substation",format:{type:"text"}}],GENERATOR:[{key:"phase",label:"Phase",format:{type:"text"}},{key:"generator_system_size",label:"System Size",format:{type:"number",decimals:1}}],MOTOR:[{key:"ratedPower",label:"Rated Power",format:{type:"power",unit:"kW",decimals:1}},{key:"voltage",label:"Voltage",format:{type:"voltage",unit:"V",decimals:0}}],DEVICE_LEADER:[],TRANSFORMER_BANK:[]},ao={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:"TextureBoards",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:"TextureMonitors",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Monitor",plural:"Monitors"},description:"Rule that watches a metric against a threshold"},insight:{icon:"LightbulbFilament",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Insight",plural:"Insights"},description:"Derived finding surfaced from platform data"},command:{icon:"Play",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Command",plural:"Commands"},description:"Control action issued to a connected device"},explore:{icon:"TextureExplore",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Explore",plural:"Explore"},description:"The BEAM map surface for exploring the connected grid."},boards:{icon:"TextureBoards",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Boards",plural:"Boards"},description:"The BEAM surface for building and viewing grid dashboards."},monitors:{icon:"TextureMonitors",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Monitors",plural:"Monitors"},description:"The BEAM surface for watching conditions across the grid."},askTexture:{icon:"Sparkle",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Ask Texture",plural:"Ask Texture"},description:"The BEAM conversational surface for investigating grid data and creating views and monitors."},survey:{icon:"TextureSurvey",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Survey",plural:"Survey"},description:"The onboarding engagement that maps a utility's systems to the Terrain schema."},seismic:{icon:"TextureSeismic",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Seismic",plural:"Seismic"},description:"AI-powered interpretation of raw data, automatically mapped into the grid model."},waypoint:{icon:"TextureWaypoint",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Waypoint",plural:"Waypoint"},description:"Flexible customer data collection and authorization for consumer devices."},terrain:{icon:"TextureTerrain",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Terrain",plural:"Terrain"},description:"The shared schema for grid assets, locations, and relationships. An AI-ready data model standard."},magma:{icon:"TextureMagma",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Magma",plural:"Magma"},description:"The execution engine for streaming, monitoring, automation, insights, and simulations, using data in the Terrain schema."},ground:{icon:"TextureGround",category:"platform",archetype:"platform",detailPage:false,label:{singular:"Ground",plural:"Ground"},description:"On-premises hardware Stations for local control, AI processing, and continuity when cloud connectivity drops."},source:{icon:"TextureSource",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.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:gt.SUPPORT_STRUCTURE},label:{singular:"Support Structure",plural:"Support Structures"},description:"Structure carrying overhead line equipment"},deviceLeader:{icon:"FlowArrow",category:"grid",archetype:"grid-line",detailPage:true,properties:{statList:gt.DEVICE_LEADER},label:{singular:"Device Leader",plural:"Device Leaders"},description:"Cartographic leader line pointing an offset device symbol to its true location"},transformerBank:{icon:"TextureTransformer",category:"grid",archetype:"grid-energized",detailPage:true,properties:{statList:gt.TRANSFORMER_BANK},label:{singular:"Transformer Bank",plural:"Transformer Banks"},description:"Grouping of single-phase transformer units sharing a bank id"},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.gridPower",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:"batteryPower",label:"device.battery.fields.batteryPower",source:{kind:"state",path:"state.chargeRate"},format:{type:"power",decimals:1},icon:"TrendUp"},{id:"backupReserve",label:"device.battery.fields.backupReserve",source:{kind:"state",path:"state.backupReserve"},format:{type:"percentage",decimals:0},icon:"BatteryCharging"}]},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:"idle",unknown:"unknown"},fallback:"unknown"}}},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"}}},sensor:{icon:"TextureSensor",category:"device",archetype:"device",detailPage:true,label:{singular:"Sensor",plural:"Sensors"},description:"Connected grid and power-quality sensor"},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"}},vg=Object.freeze(Object.keys(ao).filter(e=>ao[e].category==="grid")),Qw=new Set(vg);function _w(e){return typeof e=="string"&&Qw.has(e)}var $w={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:"SUPPORT_STRUCTURE",deviceLeader:"DEVICE_LEADER",transformerBank:"TRANSFORMER_BANK"};function Tl(e){return ao[e]}function _i(e){return ao[e].icon}function eT(e,t=false){return t?ao[e].label.plural:ao[e].label.singular}function tT(e){return ao[e].category}var rT={min:2,max:4};function oT(e){let t=ao[e];if(!t)throw new Error(`archetypeFor: unknown entity type "${String(e)}"`);return t.archetype}function nT(e){return Tl(e).detailPage}function aT(e){return (Tl(e).fields?.headlineMetrics.length??0)>0}function Cg(e){return Tl(e).properties?.statList??[]}function iT(e){return Cg(e).length>0}var Du=e=>e.replace(/([a-z\d])([A-Z])/g,"$1 $2"),Nl=e=>Du(e).toLowerCase().replace(/[^a-z0-9]+/g," ").trim(),Sg=e=>Nl(e).replace(/ /g,""),wg=Object.keys(bg).filter(e=>!e.endsWith("Icon")&&e!=="SSR"&&e!=="IconContext"&&e!=="IconBase"),Tg=Object.keys(Io),dT=new Set([...Tg,...wg]),Au=[...Tg.map(e=>({name:e,label:Du(e),source:"texture"})),...wg.map(e=>({name:e,label:Du(e),source:"phosphor"}))];function Ng(e){return dT.has(e)}var uT=new Map(icons.map(e=>[e.pascal_name,e])),pT={[ao.meter.icon]:["AMI","advanced metering infrastructure","smart meter"]},mT=Object.values(ao),kg=Au.map(e=>{let t=uT.get(e.name),r=mT.filter(o=>o.icon===e.name);return {...e,aliases:t?.alias?[t.alias.name,t.alias.pascal_name]:[],tags:[...t?.tags.filter(o=>!o.startsWith("*"))??[],...pT[e.name]??[]],categories:t?.categories??[],entities:r.flatMap(o=>[o.label.singular,o.label.plural]),descriptions:r.flatMap(o=>o.description?[o.description]:[])}}),fT=new cT(kg,{keys:[{name:"label",weight:4},{name:"aliases",weight:4},{name:"entities",weight:4},{name:"tags",weight:3},{name:"categories",weight:1},{name:"descriptions",weight:1}],includeScore:true,includeMatches:true,ignoreLocation:true,threshold:.25}),gT=new Set("a an and are as at be by for from in into is it of on or the this to with icon icons".split(" "));function Pg(e,t=12){let r=Nl(e.slice(0,600)),o=[...new Set(r.split(" ").filter(i=>i&&!gT.has(i)))].slice(0,24);if(!o.length)return [];let n=new Map;for(let i of o){let s=fT.search(i),d=s.filter(c=>c.matches?.some(l=>Nl(l.value??"").split(" ").some(u=>u===i||i.length>=4&&u.startsWith(i))));for(let c of d.length?d:i.length>=4?s:[]){let l=n.get(c.item.name)??{entry:c.item,score:0,matches:new Set};l.score+=1+(1-(c.score??1));for(let u of c.matches??[])u.value&&u.value.length<=60&&l.matches.add(u.value);n.set(c.item.name,l);}}for(let i of kg){let s=[i.name,...i.aliases].some(c=>Sg(c)===Sg(r)),d=i.entities.some(c=>Nl(c)===r);if(s||d){let c=n.get(i.name)??{entry:i,score:0,matches:new Set};c.score+=s?1e3:500,c.matches.add(s?i.label:r),n.set(i.name,c);}}let a=Number.isFinite(t)?Math.max(1,Math.min(Math.floor(t),24)):12;return [...n.values()].sort((i,s)=>s.score-i.score||i.entry.name.length-s.entry.name.length||i.entry.name.localeCompare(s.entry.name)).slice(0,a).map(({entry:i,matches:s})=>({name:i.name,label:i.label,source:i.source,matches:[...s].slice(0,3)}))}function Kr({transparent:e=false,className:t,children:r,...o}){return jsx(ModalOverlay,{...o,className:composeRenderProps(t,(n,a)=>twMerge("fixed inset-0 z-50","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",e?"bg-transparent":["bg-gradient-to-br from-background-modal/20 via-background-modal/15 to-background-modal/20","backdrop-blur-[2px]","supports-[backdrop-filter]:bg-background-modal/15"].join(" "),a.isEntering&&["animate-in fade-in","duration-300 ease-out"].join(" "),a.isExiting&&["animate-out fade-out","duration-200 ease-in"].join(" "),n)),children:r})}function kT({isEntering:e,isExiting:t,className:r="",disableGroup:o=false}){let n=[!o&&"group","bg-background-surface","forced-colors:bg-[Canvas]","shadow-lg","rounded-[var(--control-border-radius)]","bg-clip-padding","border","border-border-default","outline-none"].filter(Boolean).join(" "),a=e?["animate-in","fade-in","placement-bottom:slide-in-from-top-1","placement-top:slide-in-from-bottom-1","placement-left:slide-in-from-right-1","placement-right:slide-in-from-left-1","ease-out","duration-200"].join(" "):"",i=t?["animate-out","fade-out","placement-bottom:slide-out-to-top-1","placement-top:slide-out-to-bottom-1","placement-left:slide-out-to-right-1","placement-right:slide-out-to-left-1","ease-in","duration-150"].join(" "):"";return [n,a,i,r].filter(Boolean).join(" ")}function Et({children:e,showArrow:t=false,withBackdrop:r=false,className:o,isDismissable:n=true,disableGroup:a=false,...i}){let d=useSlottedContext(PopoverContext)?.trigger==="SubmenuTrigger",c=t?12:8;c=d?c-6:c;let l=jsxs(Popover,{offset:c,...i,className:composeRenderProps(o,(u,m)=>kT({...m,className:u,disableGroup:a})),children:[t&&jsx(OverlayArrow,{children:jsx("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"block fill-background-surface stroke-border-default stroke-1 group-placement-left:-rotate-90 group-placement-right:rotate-90 group-placement-bottom:rotate-180 forced-colors:fill-[Canvas] forced-colors:stroke-[ButtonBorder]",children:jsx("path",{d:"M0 0 L6 6 L12 0"})})}),e]});return r?jsx(Kr,{isDismissable:n,children:jsx(Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:n,children:l})}):l}function kl(e=true){let[t,r]=useState(null);return useEffect(()=>{if(!e){r(null);return}let o=typeof window<"u"?window.visualViewport:null;if(!o)return;let n=()=>{let a=Math.max(0,window.innerHeight-o.height-(o.offsetTop??0));r({height:o.height,keyboardOffset:a});};return n(),o.addEventListener("resize",n),o.addEventListener("scroll",n),()=>{o.removeEventListener("resize",n),o.removeEventListener("scroll",n);}},[e]),t}var LT={"--color-brand-primary":["--color-action-brand","--color-text-link-default","--action-brand-background"],"--color-brand-dark":["--color-action-brand-hover","--color-text-link-hover","--action-brand-hover"],"--color-action-brand":["--color-text-link-default","--action-brand-background"],"--color-action-brand-hover":["--color-text-link-hover","--action-brand-hover"]};function Rg(e){let t={...e};for(let[r,o]of Object.entries(LT))if(e[r])for(let n of o)e[n]||(t[n]=e[r]);return t}function Mg(e){return e.replace(/[{}<>]/g,"")}function Eg(e){return Object.entries(e).map(([t,r])=>`${Mg(t)}: ${Mg(r)};`).join(" ")}function Dg({variables:e,darkVariables:t,children:r}){let n=useId().replace(/:/g,""),a=e&&Object.keys(e).length>0,i=t&&Object.keys(t).length>0;if(!a&&!i)return jsx(Fragment,{children:r});let s=a?Rg(e):null,d=i?Rg(t):null,c=s?`[data-brand-scope="${n}"] { ${Eg(s)} }`:"",l=d?`.theme-dark [data-brand-scope="${n}"] { ${Eg(d)} }`:"",u=[c,l].filter(Boolean).join(`
|
|
2
|
-
`);return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:u}}),jsx("div",{"data-brand-scope":n,children:r})]})}var ni=new Map,AT=8;function IT(e){if(!e.startsWith("var("))return e;let t=e.slice(4,e.lastIndexOf(")")).trim(),r=t.indexOf(",");return (r===-1?t:t.slice(0,r)).trim()}var _t=(e,t="#000000")=>typeof window>"u"?t:Ag(e,t,0);function Ag(e,t,r){if(r>AT)return t;let o=e.startsWith("var(")?IT(e):e.startsWith("--")?e:`--${e}`;if(!e.startsWith("--")&&!e.startsWith("var(")&&!o.startsWith("--color-")&&(o=`--color-${o.slice(2)}`),ni.has(o))return ni.get(o);try{let n=document.body||document.documentElement,i=getComputedStyle(n).getPropertyValue(o).trim();if(i){if(i.startsWith("var(")){let c=Ag(i,t,r+1);return ni.set(o,c),c}return ni.set(o,i),i}let s=document.createElement("div");s.style.color=`var(${o})`,document.body.appendChild(s);let d=getComputedStyle(s).color;return document.body.removeChild(s),d&&d!=="rgb(0, 0, 0)"?(ni.set(o,d),d):t}catch(n){return console.warn(`Failed to resolve color for ${e}:`,n),t}}var Pl=()=>{ni.clear();},on=()=>{let e=[];for(let t=1;t<=12;t++){let r=_t(`--color-viz-categorical-${t}`,"");r&&e.push(r);}return e.length===0?Rl():e},Rl=()=>["#5424db","#d92361","#e86a00","#5d89ff","#9a47e2","#f24cb8","#0ba286","#9c28af","#036e45","#52a119","#ff513d","#046691"],es=()=>_t("--color-viz-default","#444ae1"),FT=(e,t)=>{let r={},o=on();return e.forEach((n,a)=>{t&&t[n]?r[n]=t[n]:r[n]=o[a%o.length];}),r},Ig=e=>{let t=e.match(/\d+/g);if(!t||t.length<3)return true;let[r,o,n]=t.map(Number);return (.299*r+.587*o+.114*n)/255>.5},BT=e=>Ig(e)?_t("--color-text-primary","#333333"):_t("--color-text-inverse","#ffffff"),Fg=(e,t)=>{if(!e||typeof e!="object")return console.warn("[Colors] Invalid GeoJSON data provided to extractUniqueValues"),[];if(!("type"in e)||e.type!=="FeatureCollection"&&e.type!=="Feature")return console.warn("[Colors] Data is not valid GeoJSON (missing type or invalid type)"),[];let r=new Set,o="features"in e?e.features:[e];if(!Array.isArray(o)||o.length===0)return console.warn("[Colors] No features found in GeoJSON data"),[];let n=0;return o.forEach(a=>{if(!(!a||typeof a!="object")&&a.properties&&t in a.properties){n++;let i=a.properties[t];i!=null&&r.add(i);}}),n===0&&console.warn(`[Colors] Property "${t}" not found on any features. Available properties: ${o[0]?.properties?Object.keys(o[0].properties).join(", "):"none"}`),Array.from(r).sort()},ts=e=>{let t=on(),r={};return e.forEach((o,n)=>{r[o]=t[n%t.length];}),r};var Fu=(e,t)=>{if(!e||typeof e!="object")return console.warn("[Colors] Invalid GeoJSON data provided to extractNumericValues"),[];if(!("type"in e)||e.type!=="FeatureCollection"&&e.type!=="Feature")return console.warn("[Colors] Data is not valid GeoJSON (missing type or invalid type)"),[];let r="features"in e?e.features:[e];if(!Array.isArray(r)||r.length===0)return console.warn("[Colors] No features found in GeoJSON data"),[];let o=new Set,n=0;return r.forEach(a=>{if(!(!a||typeof a!="object")&&a.properties&&t in a.properties){n++;let i=a.properties[t];typeof i=="number"&&!isNaN(i)&&o.add(i);}}),n===0&&console.warn(`[Colors] Property "${t}" not found on any features. Available properties: ${r[0]?.properties?Object.keys(r[0].properties).join(", "):"none"}`),Array.from(o).sort((a,i)=>a-i)},Bu=e=>e.length===0?(console.warn("[Colors] Cannot calculate bounds from empty array"),{min:0,max:1}):{min:e[0],max:e[e.length-1]},Bg=(e,t)=>{if(typeof t=="number")return t;if(e.length===0)return console.warn("[Colors] Cannot calculate center from empty array, defaulting to 0"),0;if(t==="median"){let r=Math.floor(e.length/2);return e.length%2===0?(e[r-1]+e[r])/2:e[r]}return e.reduce((r,o)=>r+o,0)/e.length},rs=(e="viridis")=>{let o=`viz-sequential-${{redYellowGreen:"red-yellow-green"}[e]||e}`,n=[];for(let a=1;a<=10;a++){let i=`${o}-${a}`,s=_t(i);n.push(s);}return n},os=(e="redYellowBlue")=>{let o=`viz-diverging-${{orangeYellowSeafoam:"orange-yellow-seafoam",redYellowBlue:"red-yellow-blue",redBlue:"red-blue"}[e]||e}`,n=[];for(let a=1;a<=10;a++){let i=`${o}-${a}`,s=_t(i);n.push(s);}return n},ns=(e,t,r,o="viridis")=>{let n=rs(o);if(e<=t)return n[0];if(e>=r)return n[n.length-1];if(t===r)return n[Math.floor(n.length/2)];let i=(e-t)/(r-t)*(n.length-1),s=Math.floor(i);return n[s]},as=(e,t,r,o,n="redYellowBlue")=>{let a=os(n),i=4;if(e<=t)return a[0];if(e>=r)return a[a.length-1];if(e===o||t===r)return a[i];if(e<o){let d=(e-t)/(o-t)*i,c=Math.floor(d);return a[Math.min(c,i)]}else {let s=(e-o)/(r-o),d=i+s*(a.length-1-i),c=Math.floor(d);return a[Math.min(c,a.length-1)]}};var Ou=createContext({mode:"system",colorMode:"light",isDarkTheme:false,setMode:()=>{},toggleTheme:()=>{}}),hr=()=>useContext(Ou);function GT(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function WT(e){if(typeof window>"u")return e;try{let t=window.localStorage.getItem("colorModePreference");if(t==="light"||t==="dark"||t==="system")return t}catch{}return e}function Og(e){try{window.localStorage.setItem("colorModePreference",e);}catch{}}function zg(e){return e==="system"?GT():e}var Gg=({children:e,fallbackMode:t="system"})=>{let[r,o]=useState(()=>WT(t)),[n,a]=useState(()=>zg(r)),i=n==="dark",s=useCallback(l=>{l==="dark"?(document.documentElement.classList.add("theme-dark"),document.body.classList.add("theme-dark")):(document.documentElement.classList.remove("theme-dark"),document.body.classList.remove("theme-dark")),Pl();},[]);useLayoutEffect(()=>{Pl();let l=zg(r);if(a(l),s(l),r==="system"){let u=window.matchMedia("(prefers-color-scheme: dark)"),m=p=>{let g=p.matches?"dark":"light";a(g),s(g);};return u.addEventListener("change",m),()=>{u.removeEventListener("change",m);}}},[r,s]);let d=useCallback(l=>{o(l),Og(l);},[]),c=useCallback(()=>{o(l=>{let u=l==="system"?"light":l==="light"?"dark":"system";return Og(u),u});},[]);return jsx(Ou.Provider,{value:{mode:r,colorMode:n,isDarkTheme:i,setMode:d,toggleTheme:c},children:e})};function Yr(...e){return e.filter(Boolean).join(" ")}var zu=class{constructor(){Qi(this,"formatters",new Map);}register(t,r){this.formatters.set(t,r);}format(t,r,...o){let n=this.formatters.get(t);return n?n(r,...o):(console.warn(`No formatter registered for key: ${t}`),null)}has(t){return this.formatters.has(t)}keys(){return Array.from(this.formatters.keys())}unregister(t){this.formatters.delete(t);}clear(){this.formatters.clear();}},de=new zu;var Tn=(e,t="Yes",r="No")=>e==null?null:e?t:r,UT=e=>Tn(e,"Enabled","Disabled"),KT=e=>Tn(e,"On","Off"),YT=e=>Tn(e,"Active","Inactive"),XT=e=>Tn(e,"True","False"),JT=e=>Tn(e,"\u2713","\u2717"),Nn=e=>{if(e==null)return null;if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"||t==="enabled"?true:t==="false"||t==="no"||t==="0"||t==="off"||t==="disabled"?false:null}return typeof e=="number"?e!==0:null},Wg=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=Nn(e);return r===null?t.nullText??null:Tn(r,t.trueText??"Yes",t.falseText??"No")};de.register("boolean",(e,t,r)=>{let o=Nn(e);return o!==null?Tn(o,typeof t=="string"?t:"Yes",typeof r=="string"?r:"No"):null});de.register("yesNo",e=>{let t=Nn(e);return t!==null?Tn(t,"Yes","No"):null});de.register("enabledDisabled",e=>{let t=Nn(e);return t!==null?UT(t):null});de.register("onOff",e=>{let t=Nn(e);return t!==null?KT(t):null});de.register("activeInactive",e=>{let t=Nn(e);return t!==null?YT(t):null});de.register("trueFalse",e=>{let t=Nn(e);return t!==null?XT(t):null});de.register("checkmark",e=>{let t=Nn(e);return t!==null?JT(t):null});var xe=e=>e==null,Ug=(e,t=0)=>xe(e)?null:`${e.toFixed(t)}%`,Kg=(e,t=0)=>Ug(e,t)??"\u2014",jT=e=>xe(e)?null:Math.round(e).toString(),qT=(e,t=1)=>xe(e)?null:e.toFixed(t),ZT=(e,t,r=true)=>{if(xe(e))return null;let o={useGrouping:r};return t!==void 0&&(o.minimumFractionDigits=t,o.maximumFractionDigits=t),new Intl.NumberFormat("en-US",o).format(e)},QT=(e,t="short")=>xe(e)?null:new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:t}).format(e),_T=(e,t=2)=>xe(e)?null:e.toExponential(t),Yg=(e,t="USD",r)=>{if(xe(e))return null;let o={style:"currency",currency:t,currencyDisplay:r?.currencyDisplay??"symbol",useGrouping:r?.thousandsSeparator??true};return r?.minimumFractionDigits!==void 0&&(o.minimumFractionDigits=r.minimumFractionDigits),r?.maximumFractionDigits!==void 0&&(o.maximumFractionDigits=r.maximumFractionDigits),new Intl.NumberFormat("en-US",o).format(e)},Xg=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o={useGrouping:t.thousandsSeparator??false};return t.decimals!==void 0&&(o.minimumFractionDigits=t.decimals,o.maximumFractionDigits=t.decimals),t.notation&&(o.notation=t.notation,t.notation==="compact"&&t.compactDisplay&&(o.compactDisplay=t.compactDisplay)),t.sign&&(o.signDisplay=t.sign),new Intl.NumberFormat("en-US",o).format(r)},Jg=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);return isNaN(r)?t.nullText??null:Yg(r,t.currency,t)};de.register("percentage",(e,t)=>typeof e=="number"?Ug(e,typeof t=="number"?t:0):null);de.register("integer",e=>typeof e=="number"?jT(e):null);de.register("float",(e,t)=>typeof e=="number"?qT(e,typeof t=="number"?t:1):null);de.register("number",(e,t,r)=>{let o=typeof e=="string"?parseFloat(e):Number(e);return isNaN(o)?null:ZT(o,typeof t=="number"?t:void 0,typeof r=="boolean"?r:true)});de.register("compact",(e,t)=>typeof e=="number"?QT(e,t==="long"?"long":"short"):null);de.register("scientific",(e,t)=>typeof e=="number"?_T(e,typeof t=="number"?t:2):null);de.register("currency",(e,t,r)=>typeof e=="number"?Yg(e,typeof t=="string"?t:"USD",typeof r=="object"&&r!==null?r:{}):null);function pB(e,t=1){return xe(e)?null:Math.abs(e)>=1e3?`${(e/1e3).toFixed(t)} MWh`:`${e.toFixed(t)} kWh`}function mB(e,t=1){return xe(e)?null:Math.abs(e)>=1e3?`${(e/1e3).toFixed(t)} MW`:`${e.toFixed(t)} kW`}function Fo({value:e,formatter:t,emptyClassName:r="text-text-secondary",emptyText:o="\u2014"}){if(e==null)return jsx("span",{className:r,children:o});if(typeof t=="function")return t(e);if(t&&typeof t=="object"){let n=Xr(e,t);return e instanceof Date&&n?jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n}):n||jsx("span",{className:r,children:o})}if(!t){if(typeof e=="string")return e;if(e instanceof Date){let n=Xr(e,{type:"date"});return jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n})}if(typeof e=="number")return Xr(e,{type:"number"});if(typeof e=="boolean")return Xr(e,{type:"boolean"})}return String(e)}function bB(e,t,r){return ot__default.useCallback(o=>Fo({value:o,formatter:e,emptyClassName:t,emptyText:r}),[e,t,r])}var Hu=(e,t=0)=>{if(xe(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mA`:`${r.toFixed(t)} mA`},El=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} A`,Gu=(e,t=2)=>xe(e)?null:`${(e/1e3).toFixed(t)} kA`,eN=(e,t)=>{if(xe(e))return null;let r=Math.abs(e);return r>=1e3?Gu(e,t??2):r<1?Hu(e,t??0):El(e,t??1)},Wu=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kA":return Gu(r,o??2);case "mA":return Hu(r,o??0);case "A":return El(r,o??1)}return t.autoScale!==false?eN(r,o):El(r,o??1)};de.register("current",Wu);var SB=Hu,wB=El,TB=Gu;var na=e=>{if(e==null)return null;if(e instanceof Date)return DateTime.fromJSDate(e);if(typeof e=="string"){let t=DateTime.fromISO(e);return t.isValid?t:null}if(typeof e=="number"){let t=DateTime.fromMillis(e);return t.isValid?t:null}return null},tN=(e,t=false,r)=>{if(!e)return null;let o=na(e);if(!o)return "Invalid Date";let n=r?o.setZone(r):o;return t?n.toLocaleString(DateTime.DATETIME_SHORT):n.toLocaleString(DateTime.DATE_SHORT)},Ll=e=>{if(!e)return null;let t=na(e);return t?t.toRelative():"Invalid Date"},rN=(e,t)=>{if(!e)return null;let r=na(e);return r?(t?r.setZone(t):r).toLocaleString(DateTime.DATETIME_MED_WITH_WEEKDAY):"Invalid Date"},oN=e=>{if(!e)return null;let t=na(e);return t?t.toISO():null},nN=(e,t,r)=>{if(!e)return null;let o=na(e);return o?(r?o.setZone(r):o).toFormat(t):"Invalid Date"},RB=e=>{let t=na(e);return t?{year:t.year,month:t.month,day:t.day,weekday:t.weekday,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,weekdayShort:t.weekdayShort,weekdayLong:t.weekdayLong,monthShort:t.monthShort,monthLong:t.monthLong}:null},jg=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=na(e);if(!r)return t.nullText??"Invalid Date";let o=t.timezone?r.setZone(t.timezone):r;if(t.relative)return o.toRelative();if(t.format)return o.toFormat(t.format);if(t.dateStyle||t.timeStyle){let n={};if(t.dateStyle)switch(t.dateStyle){case "short":n.date=DateTime.DATE_SHORT;break;case "medium":n.date=DateTime.DATE_MED;break;case "long":n.date=DateTime.DATE_FULL;break;case "full":n.date=DateTime.DATE_HUGE;break}if(t.timeStyle)switch(t.timeStyle){case "short":n.time=DateTime.TIME_SIMPLE;break;case "medium":n.time=DateTime.TIME_WITH_SECONDS;break;case "long":case "full":n.time=DateTime.TIME_WITH_SHORT_OFFSET;break}if(n.date&&n.time)return o.toLocaleString({...n.date,...n.time});if(n.date)return o.toLocaleString(n.date);if(n.time)return o.toLocaleString(n.time)}return o.toLocaleString(DateTime.DATETIME_SHORT)};de.register("date",(e,t,r)=>tN(e,typeof t=="boolean"?t:false,typeof r=="string"?r:void 0));de.register("relativeTime",e=>Ll(e));de.register("fullDateTime",(e,t)=>rN(e,typeof t=="string"?t:void 0));de.register("isoString",e=>oN(e));de.register("customDateFormat",(e,t,r)=>typeof t=="string"?nN(e,t,typeof r=="string"?r:void 0):null);var Uu=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} m`,aN=(e,t=1)=>xe(e)?null:`${(e*100).toFixed(t)} cm`,iN=(e,t=0)=>xe(e)?null:`${(e*1e3).toFixed(t)} mm`,Ku=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} km`,Yu=(e,t=0)=>xe(e)?null:`${e.toFixed(t)} ft`,sN=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} in`,Xu=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} mi`,Ju=(e,t=0)=>xe(e)?null:`${e.toFixed(t)} yd`,DB=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} nm`,AB=e=>e*3.28084,IB=e=>e/3.28084,FB=e=>e*1.60934,BB=e=>e/1.60934,VB=e=>e/5280,qg=e=>e*5280,OB=e=>e/1609.34,zB=e=>e*1609.34,HB=e=>e*.9144,GB=e=>e/.9144,WB=e=>e*2.54,UB=e=>e/2.54,Zg=(e,t=false,r=1)=>{if(xe(e))return null;let o=Math.abs(e);return t?o>=1e3?Ku(e,r):o<.01?iN(e,0):o<1?aN(e,r):Uu(e,r):o<.01?Yu(qg(e),0):o<.1?Ju(qg(e)/3,0):Xu(e,r)},Qg=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??1;if(t.autoScale){let n=t.unit==="m"||t.unit==="km";return Zg(r,n,o)}switch(t.unit){case "km":return Ku(r,o);case "ft":return Yu(r,o);case "mi":return Xu(r,o);case "yd":return Ju(r,o);default:return Uu(r,o)}};de.register("miles",(e,t)=>typeof e=="number"?Xu(e,typeof t=="number"?t:1):null);de.register("kilometers",(e,t)=>typeof e=="number"?Ku(e,typeof t=="number"?t:1):null);de.register("meters",(e,t)=>typeof e=="number"?Uu(e,typeof t=="number"?t:1):null);de.register("feet",(e,t)=>typeof e=="number"?Yu(e,typeof t=="number"?t:0):null);de.register("yards",(e,t)=>typeof e=="number"?Ju(e,typeof t=="number"?t:0):null);de.register("inches",(e,t)=>typeof e=="number"?sN(e,typeof t=="number"?t:1):null);de.register("autoScaleDistance",(e,t,r)=>typeof e=="number"?Zg(e,typeof t=="boolean"?t:false,typeof r=="number"?r:1):null);var ju=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} Wh`,qu=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} kWh`,_g=(e,t=1)=>xe(e)?null:`${(e/1e6).toFixed(t)} MWh`,$g=(e,t=1)=>xe(e)?null:`${(e/1e9).toFixed(t)} GWh`,Zu=e=>{let t=Math.abs(e);return t>=1e9?"GWh":t>=1e6?"MWh":t>=1e3?"kWh":"Wh"},eh=(e,t=1)=>{if(xe(e))return null;switch(Zu(e)){case "GWh":return $g(e,t);case "MWh":return _g(e,t);case "kWh":return qu(e,t);default:return ju(e,t)}},Qu={Wh:1,kWh:1e3,MWh:1e6,GWh:1e9},_u=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.sourceUnit?r*Qu[t.sourceUnit]:r,n=t.decimals??1;if(t.unit)switch(t.unit){case "GWh":return $g(o,n);case "MWh":return _g(o,n);case "kWh":return qu(o,n);case "Wh":return ju(o,n)}return t.autoScale!==false?eh(o,n):ju(o,n)};de.register("kWh",e=>typeof e=="number"?qu(e):null);de.register("autoScaleEnergy",(e,t)=>typeof e=="number"?eh(e,typeof t=="number"?t:1):null);de.register("energy",_u);var Dl=e=>{if(!e)return null;let t=e.replace(/\D/g,"");return t.length===10?t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"):t.length===11&&t.startsWith("1")?t.replace(/1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):e},$u=e=>{if(!e)return null;let t=e.replace(/[^\d+]/g,"");return t.startsWith("+")?t.length===12&&t.startsWith("+1")?t.replace(/\+1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):t.length===13&&t.startsWith("+44")?t.replace(/\+44(\d{2})(\d{4})(\d{4})/,"+44 $1 $2 $3"):t.replace(/(\+\d{1,3})(\d{3,4})(\d{3,4})(\d{3,4})?/,"$1 $2 $3 $4").trim():Dl(e)},ai=e=>e?e.startsWith("+")||e.length>11?$u(e):Dl(e):null,th=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=String(e);if(t.international)return $u(r);switch(t.country){case "US":case "CA":return Dl(r);default:return ai(r)}};de.register("phoneNumber",e=>typeof e=="string"?ai(e):null);de.register("usPhone",e=>typeof e=="string"?Dl(e):null);de.register("internationalPhone",e=>typeof e=="string"?$u(e):null);var Al=(e,t=0)=>xe(e)?null:t===0?`${Math.round(e)} W`:`${e.toFixed(t)} W`,ep=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} kW`,tp=(e,t=1)=>xe(e)?null:`${(e/1e6).toFixed(t)} MW`,rp=(e,t=2)=>xe(e)?null:`${(e/1e9).toFixed(t)} GW`,lN=(e,t)=>{if(xe(e))return null;let r=Math.abs(e);return r>=1e9?rp(e,t??2):r>=1e6?tp(e,t??1):r>=1e3?ep(e,t??1):Al(e,t??0)},op=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "GW":return rp(r,o??2);case "MW":return tp(r,o??1);case "kW":return ep(r,o??1);case "W":return Al(r,o??0)}return t.autoScale!==false?lN(r,o):Al(r,o??0)};de.register("power",op);var _B=Al,$B=ep,eV=tp,tV=rp;var np=(e,t=1)=>xe(e)?null:`${(e*1e3).toFixed(t)} m\u03A9`,Il=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} \u03A9`,rh=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} k\u03A9`,oh=(e,t=2)=>xe(e)?null:`${(e/1e6).toFixed(t)} M\u03A9`,cN=(e,t)=>{if(xe(e))return null;let r=Math.abs(e);return r>=1e6?oh(e,t??2):r>=1e3?rh(e,t??1):r<1?np(e,t??1):Il(e,t??1)},ap=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "M\u03A9":return oh(r,o??2);case "k\u03A9":return rh(r,o??1);case "m\u03A9":return np(r,o??1);case "\u03A9":return Il(r,o??1)}return t.autoScale!==false?cN(r,o):Il(r,o??1)};de.register("resistance",ap);de.register("ohms",e=>typeof e=="number"?Il(e):null);de.register("milliohms",e=>typeof e=="number"?np(e):null);var nh=e=>{switch(e){case "FAHRENHEIT":return "F";case "CELSIUS":return "C";case "KELVIN":return "K";default:return "F"}},ah=(e,t=0)=>xe(e)?null:`${e.toFixed(t)}\xB0F`,ih=(e,t=true,r=0)=>xe(e)?null:`${(t?(e-32)*(5/9):e).toFixed(r)}\xB0C`,sh=(e,t=true,r=0)=>xe(e)?null:`${(t?(e-32)*(5/9)+273.15:e+273.15).toFixed(r)}K`,dN=e=>e*9/5+32,uN=e=>(e-32)*(5/9),lV=e=>e+273.15,pN=e=>e-273.15,cV=e=>uN(e)+273.15,dV=e=>dN(pN(e)),lh=(e,t="F",r=0)=>{if(xe(e))return null;switch(typeof t=="string"&&t.length>1?nh(t):t){case "C":return ih(e,true,r);case "K":return sh(e,true,r);default:return ah(e,r)}},ch=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??0,n=t.unit??"F";if(t.showUnit===false)switch(typeof n=="string"&&n.length>1?nh(n):n){case "C":return ((r-32)*.5555555555555556).toFixed(o);case "K":return ((r-32)*.5555555555555556+273.15).toFixed(o);default:return r.toFixed(o)}return lh(r,n,o)};de.register("temperature",(e,t,r)=>typeof e=="number"?lh(e,typeof t=="string"?t:"F",typeof r=="number"?r:0):null);de.register("fahrenheit",(e,t)=>typeof e=="number"?ah(e,typeof t=="number"?t:0):null);de.register("celsius",(e,t,r)=>typeof e=="number"?ih(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);de.register("kelvin",(e,t,r)=>typeof e=="number"?sh(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);var mN=(e,t)=>!!(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0),dh=e=>e?.toUpperCase()??"",uh=e=>e?.toLowerCase()??"",ph=e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",mh=e=>{if(!e)return "";let t=new Set(["a","an","the","and","but","or","for","nor","on","at","of","to","with","in","as","by"]);return e.toLowerCase().split(/\s+/).map((r,o)=>t.has(r)&&o!==0?r:r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},fh=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" "):"",gh=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",hh=e=>e?e.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase()).trim():"",bh=e=>e?e.toLowerCase().split("_").map(t=>gh(t)).join(" "):"",fN=e=>e?e.includes("_")?bh(e):e.toUpperCase()===e?gh(e.toLowerCase()):hh(e):"",ii=(e,t=16)=>{if(!e)return "";if(t<5||e.length<=t)return e;let r=t-3,o=Math.ceil(r/2),n=Math.floor(r/2);return `${e.slice(0,o)}...${e.slice(-n)}`},Fl=(e,t=8)=>e?e.length<=t?e:`...${e.slice(-t)}`:"",Bl=(e,t=16,r="...")=>e?e.length<=t?e:e.slice(0,t)+r:"",gN=e=>{if(!e)return "";let t=e.toString(),r=t.slice(-4),o=t.length-4;return o>0?"*".repeat(o)+r:t},xh=(e,t)=>{if(mN(e,t))return null;if(e==null)return t.nullText??null;let r=String(e);if(t.transform&&(Array.isArray(t.transform)?t.transform:[t.transform]).forEach(n=>{switch(n){case "uppercase":r=dh(r);break;case "lowercase":r=uh(r);break;case "capitalize":r=fh(r);break;case "titleCase":r=mh(r);break;case "sentenceCase":r=ph(r);break}}),t.truncate){let{length:o,position:n,ellipsis:a="..."}=t.truncate;switch(n){case "start":r=Fl(r,o);break;case "middle":r=ii(r,o);break;case "end":r=Bl(r,o,a);break}}return r};de.register("uppercase",e=>dh(String(e)));de.register("lowercase",e=>uh(String(e)));de.register("sentenceCase",e=>ph(String(e)));de.register("titleCase",e=>mh(String(e)));de.register("capitalize",e=>fh(String(e)));de.register("camelCaseToWords",e=>hh(String(e)));de.register("snakeCaseToWords",e=>bh(String(e)));de.register("enumToSentenceCase",e=>fN(String(e)));de.register("truncateMiddle",(e,t)=>ii(String(e),typeof t=="number"?t:16));de.register("truncateStart",(e,t)=>Fl(String(e),typeof t=="number"?t:8));de.register("truncateEnd",(e,t,r)=>Bl(String(e),typeof t=="number"?t:16,typeof r=="string"?r:"..."));de.register("secret",e=>gN(String(e)));var ip=(e,t=0)=>{if(xe(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mV`:`${r.toFixed(t)} mV`},Vl=(e,t=0)=>xe(e)?null:t===0?`${Math.round(e)} V`:`${e.toFixed(t)} V`,sp=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} kV`,hN=(e,t)=>{if(xe(e))return null;let r=Math.abs(e);return r>=1e3?sp(e,t??1):r<1?ip(e,t??0):Vl(e,t??0)},lp=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kV":return sp(r,o??1);case "mV":return ip(r,o??0);case "V":return Vl(r,o??0)}return t.autoScale!==false?hN(r,o):Vl(r,o??0)};de.register("voltage",lp);var hV=ip,bV=Vl,xV=sp;var bN=(e,t)=>{if(e==null)return t.nullText??null;if(t.hideWhenNull&&e===null)return null;let r=typeof e=="number"?e:Number(e);return Number.isNaN(r)?t.nullText??null:Kg(r,t.decimals??0)},Xr=(e,t)=>{switch(t.type){case "text":return xh(e,t);case "number":return Xg(e,t);case "percentage":return bN(e,t);case "currency":return Jg(e,t);case "date":return jg(e,t);case "boolean":return Wg(e,t);case "energy":return _u(e,t);case "power":return op(e,t);case "voltage":return lp(e,t);case "current":return Wu(e,t);case "resistance":return ap(e,t);case "temperature":return ch(e,t);case "distance":return Qg(e,t);case "phone":return th(e,t);case "custom":{let r=t;return r.hideWhenNull&&e==null?null:e==null?r.nullText??null:r.formatter(e,r.options)}default:return e!=null?String(e):null}};var si={power:"W",energy:"Wh",voltage:"V",current:"A",resistance:"\u03A9",distance:"m"},xN=new Set(["number","power","energy","voltage","current","resistance","temperature","distance","percentage"]);function cp(e){if(!e)return null;switch(e.type){case "percentage":return "%";case "power":return e.unit??si.power;case "energy":return e.unit??e.sourceUnit??si.energy;case "voltage":return e.unit??si.voltage;case "current":return e.unit??si.current;case "resistance":return e.unit??si.resistance;case "temperature":{let t=typeof e.unit=="string"?e.unit:"F";return t==="C"||t==="CELSIUS"?"\xB0C":t==="F"||t==="FAHRENHEIT"?"\xB0F":t==="K"||t==="KELVIN"?"K":t}case "distance":return e.unit??si.distance;default:return null}}function yh(e,t){if(!xN.has(t.type))return null;let r;if(typeof e=="number")r=e;else if(typeof e=="string"){let n=parseFloat(e);if(Number.isNaN(n))return null;r=n;}else return null;let o=cp(t);if(o!==null){let n;if(t.type==="percentage")n=t;else if(t.type==="energy")n=t.unit?{...t,autoScale:false}:{...t,unit:t.sourceUnit??"Wh",autoScale:false};else if(t.type==="temperature")n={...t};else {let s=t.unit;n={...t,unit:s??o,autoScale:false};}let a=Xr(r,n);if(!a)return "";if(typeof a=="string"&&a.startsWith("device."))return null;let i=String(a);return i.endsWith(` ${o}`)?i.slice(0,-(o.length+1)):i.endsWith(o)?i.slice(0,-o.length):i}if(t.type==="number"){let n=Xr(r,t);return n?String(n):""}return String(r)}var FV=(e,t)=>({type:e,...t});function ia(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function aa(e,t){return ia(e)?t.format(e):""}function vh(e){if(!ia(e.start)||!ia(e.end))return ()=>"";if((e.end.getTime()-e.start.getTime())/(1e3*60*60)<=720){let i=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});return s=>aa(s,i)}let r=e.start.getFullYear(),o=e.end.getFullYear(),n=r!==o,a=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",...n&&{year:"numeric"}});return i=>aa(i,a)}var yN=864e5;function Ch(e,t){let r=t?.compact??false,o=e<5*yN,n=a=>{let i=a.getHours(),s=i>=12?"PM":"AM";return {displayHour:i%12||12,period:s}};return a=>{if(!ia(a))return "";let i=a.getHours()===0&&a.getMinutes()===0&&a.getSeconds()===0&&a.getMilliseconds()===0;if(i&&a.getDate()===1)return a.getMonth()===0?String(a.getFullYear()):a.toLocaleDateString("en",{month:"short"});if(i){let l=a.getDate();if(o){let u=a.toLocaleDateString("en",{weekday:"short"});return r?`${u.charAt(0)}${l}`:`${u} ${l}`}return r?`${a.getMonth()+1}/${l}`:`${a.toLocaleDateString("en",{month:"short"})} ${l}`}let{displayHour:s,period:d}=n(a);if(a.getMinutes()===0&&a.getSeconds()===0)return r?`${s}${d.charAt(0).toLowerCase()}`:`${s} ${d}`;let c=String(a.getMinutes()).padStart(2,"0");return r?`${s}:${c}${d.charAt(0).toLowerCase()}`:`${s}:${c} ${d}`}}function dp(e,t){if(!ia(e.start)||!ia(e.end))return ()=>"";let r=(e.end.getTime()-e.start.getTime())/(1e3*60*60),o=t?.compact??false,n=c=>l=>ia(l)?c(l):"";if(r<=24){if(o)return n(l=>{let u=l.getHours(),m=u>=12?"pm":"am";return `${u%12||12}${m}`});let c=new Intl.DateTimeFormat("en",{hour:"numeric",minute:"2-digit"});return l=>aa(l,c)}if(r<=48){if(o)return n(l=>{let u=l.getMonth()+1,m=l.getDate(),p=l.getHours(),g=p>=12?"p":"a",f=p%12||12;return `${u}/${m} ${f}${g}`});let c=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric"});return l=>aa(l,c)}if(r<=168){if(o)return n(l=>{let u=l.getDate();return `${l.toLocaleDateString("en",{weekday:"short"}).charAt(0)}${u}`});let c=new Intl.DateTimeFormat("en",{weekday:"short",day:"numeric"});return l=>aa(l,c)}if(r<=720){if(o)return n(l=>{let u=l.getMonth()+1,m=l.getDate();return `${u}/${m}`});let c=new Intl.DateTimeFormat("en",{month:"short",day:"numeric"});return l=>aa(l,c)}let a=e.start.getFullYear(),i=e.end.getFullYear(),s=a!==i;if(o)return n(c=>{let l=c.getMonth()+1,u=c.getDate(),m=s?`/${c.getFullYear().toString().slice(-2)}`:"";return `${l}/${u}${m}`});let d=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",...s&&{year:"numeric"}});return c=>aa(c,d)}var Bo={displayXl:"text-display-xl",displayLg:"text-display-lg",displayMd:"text-display-md",displaySm:"text-display-sm",headingXl:"text-heading-xl",headingLg:"text-heading-lg",headingMd:"text-heading-md",headingSm:"text-heading-sm",bodyLg:"text-body-lg",bodyMd:"text-body-md",bodySm:"text-body-sm",labelLg:"text-label-lg",labelMd:"text-label-md",labelSm:"text-label-sm",code:"text-code",agent:"text-agent"};function zt(e,...t){return Yr(Bo[e],...t)}function pt(e=false){return `${e?"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function Fe(e,t){return composeRenderProps(e,r=>twMerge(t,r))}var _e={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};var TN="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",NN="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",kN={primary:NN,secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border-2 border-border-muted hover:bg-action-secondary-hover forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-primary hover:bg-text-primary/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-primary hover:bg-background-hover hover:text-text-primary forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},wh={full:"w-full",default:"w-fit"},PN="opacity-50 cursor-not-allowed pointer-events-none",RN="opacity-100 cursor-pointer",MN={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},EN={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function LN(e){return !e||e==="default"||e==="brand"?"primary":e}function DN(e){let{variant:t="primary",size:r="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,i=LN(t),s=i==="unstyled"?"":`${TN} ${kN[i]}`;i!=="unstyled"&&(s+=` ${_e[r].text} ${_e[r].height} ${_e[r].padding} ${_e[r].gap}`),o||a?s+=` ${PN}`:s+=` ${RN}`,n?s+=` ${wh.full}`:s+=` ${wh.default}`;let d=i==="primary"?"focus-visible:outline-action-primary":void 0;return [s,pt(),d].filter(Boolean).join(" ")}function te(e){let{icon:t,children:r,isLoading:o=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:s="left",iconWeight:d,href:c,className:l,badgeNumber:u,badgeVariant:m="primary",badgePosition:p="top-right",style:g,target:f,rel:h,...b}=e,v=t?jsx(W,{name:t,size:i,weight:d}):null,x=jsxs(Fragment,{children:[s==="left"&&v,typeof r=="function"?null:r,s==="right"&&v]}),C=jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsx(W,{name:"CircleNotch",size:i,className:"animate-spin","aria-hidden":"true"})}),jsx("div",{className:"invisible","aria-hidden":"true",children:x}),n&&jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),w=(u??0)>0,S=twMerge(DN(e),l),T=c?{href:c,target:f,rel:h,...b}:{};if(c){let{onPress:k,onPressStart:R,onPressEnd:L,onPressChange:E,onPressUp:B,onAuxClick:A,onContextMenu:H,onDoubleClick:Y,...G}=b;Object.assign(T,G);}let N=c?jsx(Link,{...T,...o&&{"aria-busy":true},style:w?void 0:g,className:S,children:o?C:typeof r=="function"?(function(k){return jsxs(Fragment,{children:[s==="left"&&v,r(k),s==="right"&&v]})}):x}):jsx(Button,{...b,...o&&{"aria-busy":true},style:w?void 0:g,className:S,children:o?C:typeof r=="function"?(function(k){return jsxs(Fragment,{children:[s==="left"&&v,r(k),s==="right"&&v]})}):x});return w?jsxs("div",{className:twMerge("relative flex",l),style:g,children:[N,jsx("span",{className:`absolute ${MN[p]} flex h-5 w-5 items-center justify-center rounded-full ${EN[m]} text-xs font-medium`,"aria-label":`${u} items`,children:u})]}):N}function pp({action:e,defaultVariant:t,defaultSize:r="lg"}){let o=!!e.formId;return jsx(te,{type:o?"submit":"button",form:o?e.formId:void 0,size:e.size||r,variant:e.variant||t,onPress:o?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function Pn({primaryAction:e,secondaryAction:t,tertiaryAction:r,footerContent:o}){let n=e||t||r;return !n&&!o?null:jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${o?"h-28":""}`,children:[o&&jsx("div",{className:"flex h-10 justify-center",children:o}),n&&jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsx("div",{children:r&&jsx(pp,{action:r,defaultVariant:"destructive"})}),jsxs("div",{className:"flex items-center gap-3",children:[t&&jsx(pp,{action:t,defaultVariant:"secondary"}),e&&jsx(pp,{action:e,defaultVariant:"primary"})]})]})]})}var AN={heading:{sm:Bo.headingSm,md:Bo.headingMd,lg:Bo.headingLg,xl:Bo.headingXl},display:{sm:Bo.displaySm,md:Bo.displayMd,lg:Bo.displayLg,xl:Bo.displayXl}},IN={page:"h-16 leading-[62px]"};function vr({tag:e="h1",variant:t="heading",size:r="lg",height:o,className:n="",children:a}){let i=r==="xs"?"sm":r,s=AN[t][i],d=o?IN[o]:"";return jsx(e,{className:Yr(s,"text-text-primary",d,n),children:a})}var Cr=({title:e,onClose:t,hideCloseIcon:r=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,headerContent:i})=>jsxs("div",{className:twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",o==="center"?"justify-center":""),children:[n&&jsx(te,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsx(W,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxs(Fragment,{children:[e&&jsx(vr,{size:"xs",children:e}),t&&!r&&jsx(te,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsx(W,{name:"X","data-testid":"close-button"})})]})]});var gp=48,ls=createContext(false),Eh=createContext(null);function Lh(){return useContext(Eh)}function Mn({children:e}){return jsx(ls.Provider,{value:true,children:e})}function Dh({children:e}){return jsx(ls.Provider,{value:false,children:e})}function ci(e,t){let r=useContext(ls),{ref:o,height:n}=Hl();return {headerRef:o,headerHeight:!r||e||t?n||gp:0}}function zl(){return !useContext(ls)}function Hl(){let[e,t]=useState(0),r=useRef(null),o=useRef(null),n=useCallback(a=>{if(o.current?.disconnect(),o.current=null,r.current=a,!a){t(0);return}let i=()=>t(r.current?.offsetHeight??0);i(),o.current=new ResizeObserver(i),o.current.observe(a);},[]);return useEffect(()=>()=>o.current?.disconnect(),[]),{ref:n,height:e}}var ON=`
|
|
2
|
+
`);return jsxs(Fragment,{children:[jsx("style",{dangerouslySetInnerHTML:{__html:u}}),jsx("div",{"data-brand-scope":n,children:r})]})}var ni=new Map,AT=8;function IT(e){if(!e.startsWith("var("))return e;let t=e.slice(4,e.lastIndexOf(")")).trim(),r=t.indexOf(",");return (r===-1?t:t.slice(0,r)).trim()}var _t=(e,t="#000000")=>typeof window>"u"?t:Ag(e,t,0);function Ag(e,t,r){if(r>AT)return t;let o=e.startsWith("var(")?IT(e):e.startsWith("--")?e:`--${e}`;if(!e.startsWith("--")&&!e.startsWith("var(")&&!o.startsWith("--color-")&&(o=`--color-${o.slice(2)}`),ni.has(o))return ni.get(o);try{let n=document.body||document.documentElement,i=getComputedStyle(n).getPropertyValue(o).trim();if(i){if(i.startsWith("var(")){let c=Ag(i,t,r+1);return ni.set(o,c),c}return ni.set(o,i),i}let s=document.createElement("div");s.style.color=`var(${o})`,document.body.appendChild(s);let d=getComputedStyle(s).color;return document.body.removeChild(s),d&&d!=="rgb(0, 0, 0)"?(ni.set(o,d),d):t}catch(n){return console.warn(`Failed to resolve color for ${e}:`,n),t}}var Pl=()=>{ni.clear();},on=()=>{let e=[];for(let t=1;t<=12;t++){let r=_t(`--color-viz-categorical-${t}`,"");r&&e.push(r);}return e.length===0?Rl():e},Rl=()=>["#5424db","#d92361","#e86a00","#5d89ff","#9a47e2","#f24cb8","#0ba286","#9c28af","#036e45","#52a119","#ff513d","#046691"],es=()=>_t("--color-viz-default","#444ae1"),FT=(e,t)=>{let r={},o=on();return e.forEach((n,a)=>{t&&t[n]?r[n]=t[n]:r[n]=o[a%o.length];}),r},Ig=e=>{let t=e.match(/\d+/g);if(!t||t.length<3)return true;let[r,o,n]=t.map(Number);return (.299*r+.587*o+.114*n)/255>.5},BT=e=>Ig(e)?_t("--color-text-primary","#333333"):_t("--color-text-inverse","#ffffff"),Fg=(e,t)=>{if(!e||typeof e!="object")return console.warn("[Colors] Invalid GeoJSON data provided to extractUniqueValues"),[];if(!("type"in e)||e.type!=="FeatureCollection"&&e.type!=="Feature")return console.warn("[Colors] Data is not valid GeoJSON (missing type or invalid type)"),[];let r=new Set,o="features"in e?e.features:[e];if(!Array.isArray(o)||o.length===0)return console.warn("[Colors] No features found in GeoJSON data"),[];let n=0;return o.forEach(a=>{if(!(!a||typeof a!="object")&&a.properties&&t in a.properties){n++;let i=a.properties[t];i!=null&&r.add(i);}}),n===0&&console.warn(`[Colors] Property "${t}" not found on any features. Available properties: ${o[0]?.properties?Object.keys(o[0].properties).join(", "):"none"}`),Array.from(r).sort()},ts=e=>{let t=on(),r={};return e.forEach((o,n)=>{r[o]=t[n%t.length];}),r};var Fu=(e,t)=>{if(!e||typeof e!="object")return console.warn("[Colors] Invalid GeoJSON data provided to extractNumericValues"),[];if(!("type"in e)||e.type!=="FeatureCollection"&&e.type!=="Feature")return console.warn("[Colors] Data is not valid GeoJSON (missing type or invalid type)"),[];let r="features"in e?e.features:[e];if(!Array.isArray(r)||r.length===0)return console.warn("[Colors] No features found in GeoJSON data"),[];let o=new Set,n=0;return r.forEach(a=>{if(!(!a||typeof a!="object")&&a.properties&&t in a.properties){n++;let i=a.properties[t];typeof i=="number"&&!isNaN(i)&&o.add(i);}}),n===0&&console.warn(`[Colors] Property "${t}" not found on any features. Available properties: ${r[0]?.properties?Object.keys(r[0].properties).join(", "):"none"}`),Array.from(o).sort((a,i)=>a-i)},Bu=e=>e.length===0?(console.warn("[Colors] Cannot calculate bounds from empty array"),{min:0,max:1}):{min:e[0],max:e[e.length-1]},Bg=(e,t)=>{if(typeof t=="number")return t;if(e.length===0)return console.warn("[Colors] Cannot calculate center from empty array, defaulting to 0"),0;if(t==="median"){let r=Math.floor(e.length/2);return e.length%2===0?(e[r-1]+e[r])/2:e[r]}return e.reduce((r,o)=>r+o,0)/e.length},rs=(e="viridis")=>{let o=`viz-sequential-${{redYellowGreen:"red-yellow-green"}[e]||e}`,n=[];for(let a=1;a<=10;a++){let i=`${o}-${a}`,s=_t(i);n.push(s);}return n},os=(e="redYellowBlue")=>{let o=`viz-diverging-${{orangeYellowSeafoam:"orange-yellow-seafoam",redYellowBlue:"red-yellow-blue",redBlue:"red-blue"}[e]||e}`,n=[];for(let a=1;a<=10;a++){let i=`${o}-${a}`,s=_t(i);n.push(s);}return n},ns=(e,t,r,o="viridis")=>{let n=rs(o);if(e<=t)return n[0];if(e>=r)return n[n.length-1];if(t===r)return n[Math.floor(n.length/2)];let i=(e-t)/(r-t)*(n.length-1),s=Math.floor(i);return n[s]},as=(e,t,r,o,n="redYellowBlue")=>{let a=os(n),i=4;if(e<=t)return a[0];if(e>=r)return a[a.length-1];if(e===o||t===r)return a[i];if(e<o){let d=(e-t)/(o-t)*i,c=Math.floor(d);return a[Math.min(c,i)]}else {let s=(e-o)/(r-o),d=i+s*(a.length-1-i),c=Math.floor(d);return a[Math.min(c,a.length-1)]}};var Ou=createContext({mode:"system",colorMode:"light",isDarkTheme:false,setMode:()=>{},toggleTheme:()=>{}}),hr=()=>useContext(Ou);function GT(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function WT(e){if(typeof window>"u")return e;try{let t=window.localStorage.getItem("colorModePreference");if(t==="light"||t==="dark"||t==="system")return t}catch{}return e}function Og(e){try{window.localStorage.setItem("colorModePreference",e);}catch{}}function zg(e){return e==="system"?GT():e}var Gg=({children:e,fallbackMode:t="system"})=>{let[r,o]=useState(()=>WT(t)),[n,a]=useState(()=>zg(r)),i=n==="dark",s=useCallback(l=>{l==="dark"?(document.documentElement.classList.add("theme-dark"),document.body.classList.add("theme-dark")):(document.documentElement.classList.remove("theme-dark"),document.body.classList.remove("theme-dark")),Pl();},[]);useLayoutEffect(()=>{Pl();let l=zg(r);if(a(l),s(l),r==="system"){let u=window.matchMedia("(prefers-color-scheme: dark)"),m=p=>{let g=p.matches?"dark":"light";a(g),s(g);};return u.addEventListener("change",m),()=>{u.removeEventListener("change",m);}}},[r,s]);let d=useCallback(l=>{o(l),Og(l);},[]),c=useCallback(()=>{o(l=>{let u=l==="system"?"light":l==="light"?"dark":"system";return Og(u),u});},[]);return jsx(Ou.Provider,{value:{mode:r,colorMode:n,isDarkTheme:i,setMode:d,toggleTheme:c},children:e})};function Yr(...e){return e.filter(Boolean).join(" ")}var zu=class{constructor(){Qi(this,"formatters",new Map);}register(t,r){this.formatters.set(t,r);}format(t,r,...o){let n=this.formatters.get(t);return n?n(r,...o):(console.warn(`No formatter registered for key: ${t}`),null)}has(t){return this.formatters.has(t)}keys(){return Array.from(this.formatters.keys())}unregister(t){this.formatters.delete(t);}clear(){this.formatters.clear();}},de=new zu;var Tn=(e,t="Yes",r="No")=>e==null?null:e?t:r,UT=e=>Tn(e,"Enabled","Disabled"),KT=e=>Tn(e,"On","Off"),YT=e=>Tn(e,"Active","Inactive"),XT=e=>Tn(e,"True","False"),JT=e=>Tn(e,"\u2713","\u2717"),Nn=e=>{if(e==null)return null;if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"||t==="enabled"?true:t==="false"||t==="no"||t==="0"||t==="off"||t==="disabled"?false:null}return typeof e=="number"?e!==0:null},Wg=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=Nn(e);return r===null?t.nullText??null:Tn(r,t.trueText??"Yes",t.falseText??"No")};de.register("boolean",(e,t,r)=>{let o=Nn(e);return o!==null?Tn(o,typeof t=="string"?t:"Yes",typeof r=="string"?r:"No"):null});de.register("yesNo",e=>{let t=Nn(e);return t!==null?Tn(t,"Yes","No"):null});de.register("enabledDisabled",e=>{let t=Nn(e);return t!==null?UT(t):null});de.register("onOff",e=>{let t=Nn(e);return t!==null?KT(t):null});de.register("activeInactive",e=>{let t=Nn(e);return t!==null?YT(t):null});de.register("trueFalse",e=>{let t=Nn(e);return t!==null?XT(t):null});de.register("checkmark",e=>{let t=Nn(e);return t!==null?JT(t):null});var xe=e=>e==null,Ug=(e,t=0)=>xe(e)?null:`${e.toFixed(t)}%`,Kg=(e,t=0)=>Ug(e,t)??"\u2014",jT=e=>xe(e)?null:Math.round(e).toString(),qT=(e,t=1)=>xe(e)?null:e.toFixed(t),ZT=(e,t,r=true)=>{if(xe(e))return null;let o={useGrouping:r};return t!==void 0&&(o.minimumFractionDigits=t,o.maximumFractionDigits=t),new Intl.NumberFormat("en-US",o).format(e)},QT=(e,t="short")=>xe(e)?null:new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:t}).format(e),_T=(e,t=2)=>xe(e)?null:e.toExponential(t),Yg=(e,t="USD",r)=>{if(xe(e))return null;let o={style:"currency",currency:t,currencyDisplay:r?.currencyDisplay??"symbol",useGrouping:r?.thousandsSeparator??true};return r?.minimumFractionDigits!==void 0&&(o.minimumFractionDigits=r.minimumFractionDigits),r?.maximumFractionDigits!==void 0&&(o.maximumFractionDigits=r.maximumFractionDigits),new Intl.NumberFormat("en-US",o).format(e)},Xg=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o={useGrouping:t.thousandsSeparator??false};return t.decimals!==void 0&&(o.minimumFractionDigits=t.decimals,o.maximumFractionDigits=t.decimals),t.notation&&(o.notation=t.notation,t.notation==="compact"&&t.compactDisplay&&(o.compactDisplay=t.compactDisplay)),t.sign&&(o.signDisplay=t.sign),new Intl.NumberFormat("en-US",o).format(r)},Jg=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);return isNaN(r)?t.nullText??null:Yg(r,t.currency,t)};de.register("percentage",(e,t)=>typeof e=="number"?Ug(e,typeof t=="number"?t:0):null);de.register("integer",e=>typeof e=="number"?jT(e):null);de.register("float",(e,t)=>typeof e=="number"?qT(e,typeof t=="number"?t:1):null);de.register("number",(e,t,r)=>{let o=typeof e=="string"?parseFloat(e):Number(e);return isNaN(o)?null:ZT(o,typeof t=="number"?t:void 0,typeof r=="boolean"?r:true)});de.register("compact",(e,t)=>typeof e=="number"?QT(e,t==="long"?"long":"short"):null);de.register("scientific",(e,t)=>typeof e=="number"?_T(e,typeof t=="number"?t:2):null);de.register("currency",(e,t,r)=>typeof e=="number"?Yg(e,typeof t=="string"?t:"USD",typeof r=="object"&&r!==null?r:{}):null);function pB(e,t=1){return xe(e)?null:Math.abs(e)>=1e3?`${(e/1e3).toFixed(t)} MWh`:`${e.toFixed(t)} kWh`}function mB(e,t=1){return xe(e)?null:Math.abs(e)>=1e3?`${(e/1e3).toFixed(t)} MW`:`${e.toFixed(t)} kW`}function Fo({value:e,formatter:t,emptyClassName:r="text-text-secondary",emptyText:o="\u2014"}){if(e==null)return jsx("span",{className:r,children:o});if(typeof t=="function")return t(e);if(t&&typeof t=="object"){let n=Xr(e,t);return e instanceof Date&&n?jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n}):n||jsx("span",{className:r,children:o})}if(!t){if(typeof e=="string")return e;if(e instanceof Date){let n=Xr(e,{type:"date"});return jsx("time",{dateTime:e.toISOString(),title:e.toISOString(),children:n})}if(typeof e=="number")return Xr(e,{type:"number"});if(typeof e=="boolean")return Xr(e,{type:"boolean"})}return String(e)}function bB(e,t,r){return ot__default.useCallback(o=>Fo({value:o,formatter:e,emptyClassName:t,emptyText:r}),[e,t,r])}var Hu=(e,t=0)=>{if(xe(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mA`:`${r.toFixed(t)} mA`},El=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} A`,Gu=(e,t=2)=>xe(e)?null:`${(e/1e3).toFixed(t)} kA`,eN=(e,t)=>{if(xe(e))return null;let r=Math.abs(e);return r>=1e3?Gu(e,t??2):r<1?Hu(e,t??0):El(e,t??1)},Wu=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kA":return Gu(r,o??2);case "mA":return Hu(r,o??0);case "A":return El(r,o??1)}return t.autoScale!==false?eN(r,o):El(r,o??1)};de.register("current",Wu);var SB=Hu,wB=El,TB=Gu;var na=e=>{if(e==null)return null;if(e instanceof Date)return DateTime.fromJSDate(e);if(typeof e=="string"){let t=DateTime.fromISO(e);return t.isValid?t:null}if(typeof e=="number"){let t=DateTime.fromMillis(e);return t.isValid?t:null}return null},tN=(e,t=false,r)=>{if(!e)return null;let o=na(e);if(!o)return "Invalid Date";let n=r?o.setZone(r):o;return t?n.toLocaleString(DateTime.DATETIME_SHORT):n.toLocaleString(DateTime.DATE_SHORT)},Ll=e=>{if(!e)return null;let t=na(e);return t?t.toRelative():"Invalid Date"},rN=(e,t)=>{if(!e)return null;let r=na(e);return r?(t?r.setZone(t):r).toLocaleString(DateTime.DATETIME_MED_WITH_WEEKDAY):"Invalid Date"},oN=e=>{if(!e)return null;let t=na(e);return t?t.toISO():null},nN=(e,t,r)=>{if(!e)return null;let o=na(e);return o?(r?o.setZone(r):o).toFormat(t):"Invalid Date"},RB=e=>{let t=na(e);return t?{year:t.year,month:t.month,day:t.day,weekday:t.weekday,hour:t.hour,minute:t.minute,second:t.second,millisecond:t.millisecond,weekdayShort:t.weekdayShort,weekdayLong:t.weekdayLong,monthShort:t.monthShort,monthLong:t.monthLong}:null},jg=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=na(e);if(!r)return t.nullText??"Invalid Date";let o=t.timezone?r.setZone(t.timezone):r;if(t.relative)return o.toRelative();if(t.format)return o.toFormat(t.format);if(t.dateStyle||t.timeStyle){let n={};if(t.dateStyle)switch(t.dateStyle){case "short":n.date=DateTime.DATE_SHORT;break;case "medium":n.date=DateTime.DATE_MED;break;case "long":n.date=DateTime.DATE_FULL;break;case "full":n.date=DateTime.DATE_HUGE;break}if(t.timeStyle)switch(t.timeStyle){case "short":n.time=DateTime.TIME_SIMPLE;break;case "medium":n.time=DateTime.TIME_WITH_SECONDS;break;case "long":case "full":n.time=DateTime.TIME_WITH_SHORT_OFFSET;break}if(n.date&&n.time)return o.toLocaleString({...n.date,...n.time});if(n.date)return o.toLocaleString(n.date);if(n.time)return o.toLocaleString(n.time)}return o.toLocaleString(DateTime.DATETIME_SHORT)};de.register("date",(e,t,r)=>tN(e,typeof t=="boolean"?t:false,typeof r=="string"?r:void 0));de.register("relativeTime",e=>Ll(e));de.register("fullDateTime",(e,t)=>rN(e,typeof t=="string"?t:void 0));de.register("isoString",e=>oN(e));de.register("customDateFormat",(e,t,r)=>typeof t=="string"?nN(e,t,typeof r=="string"?r:void 0):null);var Uu=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} m`,aN=(e,t=1)=>xe(e)?null:`${(e*100).toFixed(t)} cm`,iN=(e,t=0)=>xe(e)?null:`${(e*1e3).toFixed(t)} mm`,Ku=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} km`,Yu=(e,t=0)=>xe(e)?null:`${e.toFixed(t)} ft`,sN=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} in`,Xu=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} mi`,Ju=(e,t=0)=>xe(e)?null:`${e.toFixed(t)} yd`,DB=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} nm`,AB=e=>e*3.28084,IB=e=>e/3.28084,FB=e=>e*1.60934,BB=e=>e/1.60934,VB=e=>e/5280,qg=e=>e*5280,OB=e=>e/1609.34,zB=e=>e*1609.34,HB=e=>e*.9144,GB=e=>e/.9144,WB=e=>e*2.54,UB=e=>e/2.54,Zg=(e,t=false,r=1)=>{if(xe(e))return null;let o=Math.abs(e);return t?o>=1e3?Ku(e,r):o<.01?iN(e,0):o<1?aN(e,r):Uu(e,r):o<.01?Yu(qg(e),0):o<.1?Ju(qg(e)/3,0):Xu(e,r)},Qg=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??1;if(t.autoScale){let n=t.unit==="m"||t.unit==="km";return Zg(r,n,o)}switch(t.unit){case "km":return Ku(r,o);case "ft":return Yu(r,o);case "mi":return Xu(r,o);case "yd":return Ju(r,o);default:return Uu(r,o)}};de.register("miles",(e,t)=>typeof e=="number"?Xu(e,typeof t=="number"?t:1):null);de.register("kilometers",(e,t)=>typeof e=="number"?Ku(e,typeof t=="number"?t:1):null);de.register("meters",(e,t)=>typeof e=="number"?Uu(e,typeof t=="number"?t:1):null);de.register("feet",(e,t)=>typeof e=="number"?Yu(e,typeof t=="number"?t:0):null);de.register("yards",(e,t)=>typeof e=="number"?Ju(e,typeof t=="number"?t:0):null);de.register("inches",(e,t)=>typeof e=="number"?sN(e,typeof t=="number"?t:1):null);de.register("autoScaleDistance",(e,t,r)=>typeof e=="number"?Zg(e,typeof t=="boolean"?t:false,typeof r=="number"?r:1):null);var ju=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} Wh`,qu=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} kWh`,_g=(e,t=1)=>xe(e)?null:`${(e/1e6).toFixed(t)} MWh`,$g=(e,t=1)=>xe(e)?null:`${(e/1e9).toFixed(t)} GWh`,Zu=e=>{let t=Math.abs(e);return t>=1e9?"GWh":t>=1e6?"MWh":t>=1e3?"kWh":"Wh"},eh=(e,t=1)=>{if(xe(e))return null;switch(Zu(e)){case "GWh":return $g(e,t);case "MWh":return _g(e,t);case "kWh":return qu(e,t);default:return ju(e,t)}},Qu={Wh:1,kWh:1e3,MWh:1e6,GWh:1e9},_u=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.sourceUnit?r*Qu[t.sourceUnit]:r,n=t.decimals??1;if(t.unit)switch(t.unit){case "GWh":return $g(o,n);case "MWh":return _g(o,n);case "kWh":return qu(o,n);case "Wh":return ju(o,n)}return t.autoScale!==false?eh(o,n):ju(o,n)};de.register("kWh",e=>typeof e=="number"?qu(e):null);de.register("autoScaleEnergy",(e,t)=>typeof e=="number"?eh(e,typeof t=="number"?t:1):null);de.register("energy",_u);var Dl=e=>{if(!e)return null;let t=e.replace(/\D/g,"");return t.length===10?t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"):t.length===11&&t.startsWith("1")?t.replace(/1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):e},$u=e=>{if(!e)return null;let t=e.replace(/[^\d+]/g,"");return t.startsWith("+")?t.length===12&&t.startsWith("+1")?t.replace(/\+1(\d{3})(\d{3})(\d{4})/,"+1 ($1) $2-$3"):t.length===13&&t.startsWith("+44")?t.replace(/\+44(\d{2})(\d{4})(\d{4})/,"+44 $1 $2 $3"):t.replace(/(\+\d{1,3})(\d{3,4})(\d{3,4})(\d{3,4})?/,"$1 $2 $3 $4").trim():Dl(e)},ai=e=>e?e.startsWith("+")||e.length>11?$u(e):Dl(e):null,th=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=String(e);if(t.international)return $u(r);switch(t.country){case "US":case "CA":return Dl(r);default:return ai(r)}};de.register("phoneNumber",e=>typeof e=="string"?ai(e):null);de.register("usPhone",e=>typeof e=="string"?Dl(e):null);de.register("internationalPhone",e=>typeof e=="string"?$u(e):null);var Al=(e,t=0)=>xe(e)?null:t===0?`${Math.round(e)} W`:`${e.toFixed(t)} W`,ep=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} kW`,tp=(e,t=1)=>xe(e)?null:`${(e/1e6).toFixed(t)} MW`,rp=(e,t=2)=>xe(e)?null:`${(e/1e9).toFixed(t)} GW`,lN=(e,t)=>{if(xe(e))return null;let r=Math.abs(e);return r>=1e9?rp(e,t??2):r>=1e6?tp(e,t??1):r>=1e3?ep(e,t??1):Al(e,t??0)},op=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "GW":return rp(r,o??2);case "MW":return tp(r,o??1);case "kW":return ep(r,o??1);case "W":return Al(r,o??0)}return t.autoScale!==false?lN(r,o):Al(r,o??0)};de.register("power",op);var _B=Al,$B=ep,eV=tp,tV=rp;var np=(e,t=1)=>xe(e)?null:`${(e*1e3).toFixed(t)} m\u03A9`,Il=(e,t=1)=>xe(e)?null:`${e.toFixed(t)} \u03A9`,rh=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} k\u03A9`,oh=(e,t=2)=>xe(e)?null:`${(e/1e6).toFixed(t)} M\u03A9`,cN=(e,t)=>{if(xe(e))return null;let r=Math.abs(e);return r>=1e6?oh(e,t??2):r>=1e3?rh(e,t??1):r<1?np(e,t??1):Il(e,t??1)},ap=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "M\u03A9":return oh(r,o??2);case "k\u03A9":return rh(r,o??1);case "m\u03A9":return np(r,o??1);case "\u03A9":return Il(r,o??1)}return t.autoScale!==false?cN(r,o):Il(r,o??1)};de.register("resistance",ap);de.register("ohms",e=>typeof e=="number"?Il(e):null);de.register("milliohms",e=>typeof e=="number"?np(e):null);var nh=e=>{switch(e){case "FAHRENHEIT":return "F";case "CELSIUS":return "C";case "KELVIN":return "K";default:return "F"}},ah=(e,t=0)=>xe(e)?null:`${e.toFixed(t)}\xB0F`,ih=(e,t=true,r=0)=>xe(e)?null:`${(t?(e-32)*(5/9):e).toFixed(r)}\xB0C`,sh=(e,t=true,r=0)=>xe(e)?null:`${(t?(e-32)*(5/9)+273.15:e+273.15).toFixed(r)}K`,dN=e=>e*9/5+32,uN=e=>(e-32)*(5/9),lV=e=>e+273.15,pN=e=>e-273.15,cV=e=>uN(e)+273.15,dV=e=>dN(pN(e)),lh=(e,t="F",r=0)=>{if(xe(e))return null;switch(typeof t=="string"&&t.length>1?nh(t):t){case "C":return ih(e,true,r);case "K":return sh(e,true,r);default:return ah(e,r)}},ch=(e,t)=>{if(t.hideWhenNull&&e==null)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals??0,n=t.unit??"F";if(t.showUnit===false)switch(typeof n=="string"&&n.length>1?nh(n):n){case "C":return ((r-32)*.5555555555555556).toFixed(o);case "K":return ((r-32)*.5555555555555556+273.15).toFixed(o);default:return r.toFixed(o)}return lh(r,n,o)};de.register("temperature",(e,t,r)=>typeof e=="number"?lh(e,typeof t=="string"?t:"F",typeof r=="number"?r:0):null);de.register("fahrenheit",(e,t)=>typeof e=="number"?ah(e,typeof t=="number"?t:0):null);de.register("celsius",(e,t,r)=>typeof e=="number"?ih(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);de.register("kelvin",(e,t,r)=>typeof e=="number"?sh(e,typeof t=="boolean"?t:true,typeof r=="number"?r:0):null);var mN=(e,t)=>!!(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0),dh=e=>e?.toUpperCase()??"",uh=e=>e?.toLowerCase()??"",ph=e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",mh=e=>{if(!e)return "";let t=new Set(["a","an","the","and","but","or","for","nor","on","at","of","to","with","in","as","by"]);return e.toLowerCase().split(/\s+/).map((r,o)=>t.has(r)&&o!==0?r:r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},fh=e=>e?e.split(/\s+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" "):"",gh=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",hh=e=>e?e.replace(/([A-Z])/g," $1").replace(/^./,t=>t.toUpperCase()).trim():"",bh=e=>e?e.toLowerCase().split("_").map(t=>gh(t)).join(" "):"",fN=e=>e?e.includes("_")?bh(e):e.toUpperCase()===e?gh(e.toLowerCase()):hh(e):"",ii=(e,t=16)=>{if(!e)return "";if(t<5||e.length<=t)return e;let r=t-3,o=Math.ceil(r/2),n=Math.floor(r/2);return `${e.slice(0,o)}...${e.slice(-n)}`},Fl=(e,t=8)=>e?e.length<=t?e:`...${e.slice(-t)}`:"",Bl=(e,t=16,r="...")=>e?e.length<=t?e:e.slice(0,t)+r:"",gN=e=>{if(!e)return "";let t=e.toString(),r=t.slice(-4),o=t.length-4;return o>0?"*".repeat(o)+r:t},xh=(e,t)=>{if(mN(e,t))return null;if(e==null)return t.nullText??null;let r=String(e);if(t.transform&&(Array.isArray(t.transform)?t.transform:[t.transform]).forEach(n=>{switch(n){case "uppercase":r=dh(r);break;case "lowercase":r=uh(r);break;case "capitalize":r=fh(r);break;case "titleCase":r=mh(r);break;case "sentenceCase":r=ph(r);break}}),t.truncate){let{length:o,position:n,ellipsis:a="..."}=t.truncate;switch(n){case "start":r=Fl(r,o);break;case "middle":r=ii(r,o);break;case "end":r=Bl(r,o,a);break}}return r};de.register("uppercase",e=>dh(String(e)));de.register("lowercase",e=>uh(String(e)));de.register("sentenceCase",e=>ph(String(e)));de.register("titleCase",e=>mh(String(e)));de.register("capitalize",e=>fh(String(e)));de.register("camelCaseToWords",e=>hh(String(e)));de.register("snakeCaseToWords",e=>bh(String(e)));de.register("enumToSentenceCase",e=>fN(String(e)));de.register("truncateMiddle",(e,t)=>ii(String(e),typeof t=="number"?t:16));de.register("truncateStart",(e,t)=>Fl(String(e),typeof t=="number"?t:8));de.register("truncateEnd",(e,t,r)=>Bl(String(e),typeof t=="number"?t:16,typeof r=="string"?r:"..."));de.register("secret",e=>gN(String(e)));var ip=(e,t=0)=>{if(xe(e))return null;let r=e*1e3;return t===0?`${Math.round(r)} mV`:`${r.toFixed(t)} mV`},Vl=(e,t=0)=>xe(e)?null:t===0?`${Math.round(e)} V`:`${e.toFixed(t)} V`,sp=(e,t=1)=>xe(e)?null:`${(e/1e3).toFixed(t)} kV`,hN=(e,t)=>{if(xe(e))return null;let r=Math.abs(e);return r>=1e3?sp(e,t??1):r<1?ip(e,t??0):Vl(e,t??0)},lp=(e,t)=>{if(t.hideWhenNull&&e==null||t.hideWhenZero&&e===0)return null;if(e==null)return t.nullText??null;let r=typeof e=="string"?parseFloat(e):Number(e);if(isNaN(r))return t.nullText??null;let o=t.decimals;if(t.unit)switch(t.unit){case "kV":return sp(r,o??1);case "mV":return ip(r,o??0);case "V":return Vl(r,o??0)}return t.autoScale!==false?hN(r,o):Vl(r,o??0)};de.register("voltage",lp);var hV=ip,bV=Vl,xV=sp;var bN=(e,t)=>{if(e==null)return t.nullText??null;if(t.hideWhenNull&&e===null)return null;let r=typeof e=="number"?e:Number(e);return Number.isNaN(r)?t.nullText??null:Kg(r,t.decimals??0)},Xr=(e,t)=>{switch(t.type){case "text":return xh(e,t);case "number":return Xg(e,t);case "percentage":return bN(e,t);case "currency":return Jg(e,t);case "date":return jg(e,t);case "boolean":return Wg(e,t);case "energy":return _u(e,t);case "power":return op(e,t);case "voltage":return lp(e,t);case "current":return Wu(e,t);case "resistance":return ap(e,t);case "temperature":return ch(e,t);case "distance":return Qg(e,t);case "phone":return th(e,t);case "custom":{let r=t;return r.hideWhenNull&&e==null?null:e==null?r.nullText??null:r.formatter(e,r.options)}default:return e!=null?String(e):null}};var si={power:"W",energy:"Wh",voltage:"V",current:"A",resistance:"\u03A9",distance:"m"},xN=new Set(["number","power","energy","voltage","current","resistance","temperature","distance","percentage"]);function cp(e){if(!e)return null;switch(e.type){case "percentage":return "%";case "power":return e.unit??si.power;case "energy":return e.unit??e.sourceUnit??si.energy;case "voltage":return e.unit??si.voltage;case "current":return e.unit??si.current;case "resistance":return e.unit??si.resistance;case "temperature":{let t=typeof e.unit=="string"?e.unit:"F";return t==="C"||t==="CELSIUS"?"\xB0C":t==="F"||t==="FAHRENHEIT"?"\xB0F":t==="K"||t==="KELVIN"?"K":t}case "distance":return e.unit??si.distance;default:return null}}function yh(e,t){if(!xN.has(t.type))return null;let r;if(typeof e=="number")r=e;else if(typeof e=="string"){let n=parseFloat(e);if(Number.isNaN(n))return null;r=n;}else return null;let o=cp(t);if(o!==null){let n;if(t.type==="percentage")n=t;else if(t.type==="energy")n=t.unit?{...t,autoScale:false}:{...t,unit:t.sourceUnit??"Wh",autoScale:false};else if(t.type==="temperature")n={...t};else {let s=t.unit;n={...t,unit:s??o,autoScale:false};}let a=Xr(r,n);if(!a)return "";if(typeof a=="string"&&a.startsWith("device."))return null;let i=String(a);return i.endsWith(` ${o}`)?i.slice(0,-(o.length+1)):i.endsWith(o)?i.slice(0,-o.length):i}if(t.type==="number"){let n=Xr(r,t);return n?String(n):""}return String(r)}var FV=(e,t)=>({type:e,...t});function ia(e){return e instanceof Date&&!Number.isNaN(e.getTime())}function aa(e,t){return ia(e)?t.format(e):""}function vh(e){if(!ia(e.start)||!ia(e.end))return ()=>"";if((e.end.getTime()-e.start.getTime())/(1e3*60*60)<=720){let i=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});return s=>aa(s,i)}let r=e.start.getFullYear(),o=e.end.getFullYear(),n=r!==o,a=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",...n&&{year:"numeric"}});return i=>aa(i,a)}var yN=864e5;function Ch(e,t){let r=t?.compact??false,o=e<5*yN,n=a=>{let i=a.getHours(),s=i>=12?"PM":"AM";return {displayHour:i%12||12,period:s}};return a=>{if(!ia(a))return "";let i=a.getHours()===0&&a.getMinutes()===0&&a.getSeconds()===0&&a.getMilliseconds()===0;if(i&&a.getDate()===1)return a.getMonth()===0?String(a.getFullYear()):a.toLocaleDateString("en",{month:"short"});if(i){let l=a.getDate();if(o){let u=a.toLocaleDateString("en",{weekday:"short"});return r?`${a.getMonth()+1}/${l}`:`${u} ${l}`}return r?`${a.getMonth()+1}/${l}`:`${a.toLocaleDateString("en",{month:"short"})} ${l}`}let{displayHour:s,period:d}=n(a);if(a.getMinutes()===0&&a.getSeconds()===0)return r?`${s}${d.charAt(0).toLowerCase()}`:`${s} ${d}`;let c=String(a.getMinutes()).padStart(2,"0");return r?`${s}:${c}${d.charAt(0).toLowerCase()}`:`${s}:${c} ${d}`}}function dp(e,t){if(!ia(e.start)||!ia(e.end))return ()=>"";let r=(e.end.getTime()-e.start.getTime())/(1e3*60*60),o=t?.compact??false,n=c=>l=>ia(l)?c(l):"";if(r<=24){if(o)return n(l=>{let u=l.getHours(),m=u>=12?"pm":"am";return `${u%12||12}${m}`});let c=new Intl.DateTimeFormat("en",{hour:"numeric",minute:"2-digit"});return l=>aa(l,c)}if(r<=48){if(o)return n(l=>{let u=l.getMonth()+1,m=l.getDate(),p=l.getHours(),g=p>=12?"p":"a",f=p%12||12;return `${u}/${m} ${f}${g}`});let c=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"numeric"});return l=>aa(l,c)}if(r<=168){if(o)return n(l=>`${l.getMonth()+1}/${l.getDate()}`);let c=new Intl.DateTimeFormat("en",{weekday:"short",day:"numeric"});return l=>aa(l,c)}if(r<=720){if(o)return n(l=>{let u=l.getMonth()+1,m=l.getDate();return `${u}/${m}`});let c=new Intl.DateTimeFormat("en",{month:"short",day:"numeric"});return l=>aa(l,c)}let a=e.start.getFullYear(),i=e.end.getFullYear(),s=a!==i;if(o)return n(c=>{let l=c.getMonth()+1,u=c.getDate(),m=s?`/${c.getFullYear().toString().slice(-2)}`:"";return `${l}/${u}${m}`});let d=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",...s&&{year:"numeric"}});return c=>aa(c,d)}var Bo={displayXl:"text-display-xl",displayLg:"text-display-lg",displayMd:"text-display-md",displaySm:"text-display-sm",headingXl:"text-heading-xl",headingLg:"text-heading-lg",headingMd:"text-heading-md",headingSm:"text-heading-sm",bodyLg:"text-body-lg",bodyMd:"text-body-md",bodySm:"text-body-sm",labelLg:"text-label-lg",labelMd:"text-label-md",labelSm:"text-label-sm",code:"text-code",agent:"text-agent"};function zt(e,...t){return Yr(Bo[e],...t)}function pt(e=false){return `${e?"outline outline-1 outline-border-input data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2":"outline-none data-[focus-visible]:outline data-[focus-visible]:outline-2 data-[focus-visible]:outline-action-default data-[focus-visible]:outline-offset-0 invalid:outline-2 invalid:outline-feedback-error-border group-invalid:outline-2 group-invalid:outline-feedback-error-border forced-colors:focus:outline-[Highlight] forced-colors:focus:outline-2 forced-colors:focus:outline-offset-2"}`}function Fe(e,t){return composeRenderProps(e,r=>twMerge(t,r))}var _e={sm:{text:"text-[length:var(--control-text-sm)]",height:"h-[var(--control-sm-height)]",padding:"px-[var(--control-padding-sm)]",paddingY:"py-[var(--control-gap-sm)]",gap:"gap-[var(--control-gap-sm)]"},md:{text:"text-[length:var(--control-text-md)]",height:"h-[var(--control-md-height)]",padding:"px-[var(--control-padding-md)]",paddingY:"py-[var(--control-gap-md)]",gap:"gap-[var(--control-gap-md)]"},lg:{text:"text-[length:var(--control-text-lg)]",height:"h-[var(--control-lg-height)]",padding:"px-[var(--control-padding-lg)]",paddingY:"py-[var(--control-gap-lg)]",gap:"gap-[var(--control-gap-lg)]"},xl:{text:"text-[length:var(--control-text-xl)]",height:"h-[var(--control-xl-height)]",padding:"px-[var(--control-padding-xl)]",paddingY:"py-[var(--control-gap-xl)]",gap:"gap-[var(--control-gap-xl)]"}};var TN="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",NN="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",kN={primary:NN,secondary:"bg-action-secondary text-[color:var(--color-action-secondary-text)] border-2 border-border-muted hover:bg-action-secondary-hover forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[ButtonText]",ghost:"border-none text-text-primary hover:bg-text-primary/5 forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace]",destructive:"bg-transparent text-feedback-error-text border-2 border-border-muted hover:bg-feedback-error-background/50 forced-colors:border-[ButtonBorder] forced-colors:bg-[ButtonFace] forced-colors:text-[Mark]",link:"!text-action-primary hover:text-action-primary/90 hover:underline hover:decoration-2 hover:underline-offset-4",icon:"border-none text-text-primary hover:bg-background-hover hover:text-text-primary forced-colors:text-[ButtonText] forced-colors:hover:bg-[ButtonFace] p-1 flex-shrink-0 rounded-[var(--control-border-radius)]",unstyled:"bg-transparent"},wh={full:"w-full",default:"w-fit"},PN="opacity-50 cursor-not-allowed pointer-events-none",RN="opacity-100 cursor-pointer",MN={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},EN={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function LN(e){return !e||e==="default"||e==="brand"?"primary":e}function DN(e){let{variant:t="primary",size:r="md",isDisabled:o,fullWidth:n=false,isLoading:a=false}=e,i=LN(t),s=i==="unstyled"?"":`${TN} ${kN[i]}`;i!=="unstyled"&&(s+=` ${_e[r].text} ${_e[r].height} ${_e[r].padding} ${_e[r].gap}`),o||a?s+=` ${PN}`:s+=` ${RN}`,n?s+=` ${wh.full}`:s+=` ${wh.default}`;let d=i==="primary"?"focus-visible:outline-action-primary":void 0;return [s,pt(),d].filter(Boolean).join(" ")}function te(e){let{icon:t,children:r,isLoading:o=false,loadingText:n,loadingIndicator:a,size:i="md",iconPosition:s="left",iconWeight:d,href:c,className:l,badgeNumber:u,badgeVariant:m="primary",badgePosition:p="top-right",style:g,target:f,rel:h,...b}=e,v=t?jsx(W,{name:t,size:i,weight:d}):null,x=jsxs(Fragment,{children:[s==="left"&&v,typeof r=="function"?null:r,s==="right"&&v]}),C=jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsx(W,{name:"CircleNotch",size:i,className:"animate-spin","aria-hidden":"true"})}),jsx("div",{className:"invisible","aria-hidden":"true",children:x}),n&&jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),w=(u??0)>0,S=twMerge(DN(e),l),T=c?{href:c,target:f,rel:h,...b}:{};if(c){let{onPress:k,onPressStart:R,onPressEnd:L,onPressChange:E,onPressUp:B,onAuxClick:A,onContextMenu:H,onDoubleClick:Y,...G}=b;Object.assign(T,G);}let N=c?jsx(Link,{...T,...o&&{"aria-busy":true},style:w?void 0:g,className:S,children:o?C:typeof r=="function"?(function(k){return jsxs(Fragment,{children:[s==="left"&&v,r(k),s==="right"&&v]})}):x}):jsx(Button,{...b,...o&&{"aria-busy":true},style:w?void 0:g,className:S,children:o?C:typeof r=="function"?(function(k){return jsxs(Fragment,{children:[s==="left"&&v,r(k),s==="right"&&v]})}):x});return w?jsxs("div",{className:twMerge("relative flex",l),style:g,children:[N,jsx("span",{className:`absolute ${MN[p]} flex h-5 w-5 items-center justify-center rounded-full ${EN[m]} text-xs font-medium`,"aria-label":`${u} items`,children:u})]}):N}function pp({action:e,defaultVariant:t,defaultSize:r="lg"}){let o=!!e.formId;return jsx(te,{type:o?"submit":"button",form:o?e.formId:void 0,size:e.size||r,variant:e.variant||t,onPress:o?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function Pn({primaryAction:e,secondaryAction:t,tertiaryAction:r,footerContent:o}){let n=e||t||r;return !n&&!o?null:jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${o?"h-28":""}`,children:[o&&jsx("div",{className:"flex h-10 justify-center",children:o}),n&&jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsx("div",{children:r&&jsx(pp,{action:r,defaultVariant:"destructive"})}),jsxs("div",{className:"flex items-center gap-3",children:[t&&jsx(pp,{action:t,defaultVariant:"secondary"}),e&&jsx(pp,{action:e,defaultVariant:"primary"})]})]})]})}var AN={heading:{sm:Bo.headingSm,md:Bo.headingMd,lg:Bo.headingLg,xl:Bo.headingXl},display:{sm:Bo.displaySm,md:Bo.displayMd,lg:Bo.displayLg,xl:Bo.displayXl}},IN={page:"h-16 leading-[62px]"};function vr({tag:e="h1",variant:t="heading",size:r="lg",height:o,className:n="",children:a}){let i=r==="xs"?"sm":r,s=AN[t][i],d=o?IN[o]:"";return jsx(e,{className:Yr(s,"text-text-primary",d,n),children:a})}var Cr=({title:e,onClose:t,hideCloseIcon:r=false,titleAlign:o="left",hasBackArrow:n=false,onBack:a,headerContent:i})=>jsxs("div",{className:twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",o==="center"?"justify-center":""),children:[n&&jsx(te,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsx(W,{name:"CaretLeft","data-testid":"back-arrow"})}),i||jsxs(Fragment,{children:[e&&jsx(vr,{size:"xs",children:e}),t&&!r&&jsx(te,{variant:"icon",onPress:t,"aria-label":"Close dialog",children:jsx(W,{name:"X","data-testid":"close-button"})})]})]});var gp=48,ls=createContext(false),Eh=createContext(null);function Lh(){return useContext(Eh)}function Mn({children:e}){return jsx(ls.Provider,{value:true,children:e})}function Dh({children:e}){return jsx(ls.Provider,{value:false,children:e})}function ci(e,t){let r=useContext(ls),{ref:o,height:n}=Hl();return {headerRef:o,headerHeight:!r||e||t?n||gp:0}}function zl(){return !useContext(ls)}function Hl(){let[e,t]=useState(0),r=useRef(null),o=useRef(null),n=useCallback(a=>{if(o.current?.disconnect(),o.current=null,r.current=a,!a){t(0);return}let i=()=>t(r.current?.offsetHeight??0);i(),o.current=new ResizeObserver(i),o.current.observe(a);},[]);return useEffect(()=>()=>o.current?.disconnect(),[]),{ref:n,height:e}}var ON=`
|
|
3
3
|
/*
|
|
4
4
|
* The container is a WRAPPER, not the grid itself. A container query cannot
|
|
5
5
|
* style its own container, so when .chart-header carried container-type the
|