@texturehq/edges 2.4.9 → 2.5.0

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.
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
3
  import React__default, { ReactNode, ComponentType } from 'react';
4
- import { d as IconName } from './RichTextEditor-BNXNpG4s.js';
4
+ import { d as IconName } from './RichTextEditor-B_GaE_Yf.cjs';
5
5
  import * as _visx_vendor_d3_scale from '@visx/vendor/d3-scale';
6
6
  import { ScaleTime, ScaleLinear } from 'd3-scale';
7
7
  import * as react_map_gl from 'react-map-gl';
@@ -552,6 +552,15 @@ interface BadgeProps {
552
552
  dotPosition?: "left" | "right";
553
553
  /** Whether the dot should pulse (animated) */
554
554
  dotPulse?: boolean;
555
+ /**
556
+ * Native tooltip text.
557
+ *
558
+ * A badge is often an abbreviation of something the reader cannot infer — a state,
559
+ * a threshold, a data-quality caveat. Without this, callers wrap the badge in a bare
560
+ * `<span title>` purely to explain it, which adds a layout box around an inline-flex
561
+ * element for no visual reason.
562
+ */
563
+ title?: string;
555
564
  /** Additional CSS classes */
556
565
  className?: string;
557
566
  }
@@ -564,7 +573,7 @@ interface BadgeProps {
564
573
  * Supports device states (charging, discharging, heat, cool, etc.) and
565
574
  * grid states (importing, exporting) as variant values.
566
575
  */
567
- declare function Badge({ children, variant, size, shape, dot, dotPosition, dotPulse, className, }: BadgeProps): react_jsx_runtime.JSX.Element;
576
+ declare function Badge({ children, variant, size, shape, dot, dotPosition, dotPulse, title, className, }: BadgeProps): react_jsx_runtime.JSX.Element;
568
577
 
569
578
  type CodeLanguage = "json" | "javascript" | "typescript" | "html" | "css" | "markdown" | "yaml" | "xml" | "python" | "sql";
570
579
  type CodeTheme = "github" | "github_dark";
@@ -1305,6 +1314,15 @@ interface VectorLayerSpec extends BaseLayerSpec {
1305
1314
  style?: LayerStyle;
1306
1315
  /** Mapbox filter expression (escape hatch for advanced filtering) */
1307
1316
  filter?: any;
1317
+ /**
1318
+ * Per-feature chip suppression for point (`circle`) layers. A Mapbox boolean
1319
+ * expression; where it evaluates true, the chip's fill + border render fully
1320
+ * transparent (`circle-opacity`/`circle-stroke-opacity` → 0) while the feature
1321
+ * stays interactive (click/hover still hit-test). Lets a glyph drawn on top
1322
+ * read as "on the geometry" with no chip behind it — e.g. Open Point switches
1323
+ * rendered as a bracket over the conductor line. Ignored for non-circle layers.
1324
+ */
1325
+ hideChipWhen?: any;
1308
1326
  }
1309
1327
  /**
1310
1328
  * GeoJSON layer (client-side data or URL)
@@ -1948,6 +1966,15 @@ interface StaticMapProps {
1948
1966
  * Optional address or location label to show in expanded view
1949
1967
  */
1950
1968
  expandedMapAddressLabel?: string;
1969
+ /**
1970
+ * When no Mapbox token is available, render the designed **schematic**
1971
+ * placeholder (grid + centered pin + soft radius circle) instead of the bare
1972
+ * "Map requires Mapbox token" message. Additive: default `false` keeps the
1973
+ * message so existing consumers are unchanged. A real token always shows the
1974
+ * real map regardless of this flag.
1975
+ * @default false
1976
+ */
1977
+ schematicPlaceholder?: boolean;
1951
1978
  }
1952
1979
  /**
1953
1980
  * StaticMap
@@ -1957,7 +1984,7 @@ interface StaticMapProps {
1957
1984
  *
1958
1985
  * Automatically adapts to light/dark mode using the global ColorModeProvider.
1959
1986
  */
1960
- declare function StaticMap({ width, height, initialViewState, isLoading, mapType, layers, mapboxAccessToken, showMarker, showAttribution, onLoad, className, showExpandToggle, expandedMapTitle, expandedMapAddressLabel, }: StaticMapProps): react_jsx_runtime.JSX.Element;
1987
+ declare function StaticMap({ width, height, initialViewState, isLoading, mapType, layers, mapboxAccessToken, showMarker, showAttribution, onLoad, className, showExpandToggle, expandedMapTitle, expandedMapAddressLabel, schematicPlaceholder, }: StaticMapProps): react_jsx_runtime.JSX.Element;
1961
1988
 
1962
1989
  /**
1963
1990
  * Represents a geographic point with coordinates
@@ -1970,14 +1997,27 @@ interface MapPoint {
1970
1997
  interface MeterProps extends MeterProps$1 {
1971
1998
  /** Label displayed above the meter */
1972
1999
  label?: string;
1973
- /** Size variant of the meter */
1974
- size?: "sm" | "md" | "lg";
1975
- /** Visual variant based on semantic meaning */
1976
- variant?: "default" | "success" | "warning" | "error" | "info";
2000
+ /** Size variant of the meter. `xs` is a bare track sized for a dense table cell. */
2001
+ size?: "xs" | "sm" | "md" | "lg";
2002
+ /** Visual variant based on semantic meaning. `neutral` opts out of value-derived colouring. */
2003
+ variant?: "default" | "success" | "warning" | "error" | "info" | "neutral";
1977
2004
  /** Whether to show warning indicator at high values */
1978
2005
  showWarningIndicator?: boolean;
1979
2006
  /** Threshold percentage for showing warning (default: 80) */
1980
2007
  warningThreshold?: number;
2008
+ /**
2009
+ * Render the track alone, without the label / value row.
2010
+ *
2011
+ * For callers that already print the measurement next to the meter — a table cell whose
2012
+ * column *is* the value — where the built-in row would repeat it.
2013
+ *
2014
+ * The meter still needs a name: pass `label` (promoted to `aria-label`, since the visible
2015
+ * `<Label>` is no longer rendered) or an explicit `aria-label`. A caller whose track is
2016
+ * purely decorative — or whose displayed `value` is clamped, so the meter would state a
2017
+ * number the adjacent text contradicts — should pass `aria-hidden` instead and leave the
2018
+ * printed value as the only accessible one.
2019
+ */
2020
+ hideValueText?: boolean;
1981
2021
  /** Additional CSS classes */
1982
2022
  className?: string;
1983
2023
  }
@@ -1987,7 +2027,7 @@ interface MeterProps extends MeterProps$1 {
1987
2027
  * Displays a measurement within a known range, with visual indicators for different value ranges.
1988
2028
  * Perfect for showing capacity, usage levels, scores, or any bounded measurement.
1989
2029
  */
1990
- declare function Meter({ label, size, variant, showWarningIndicator, warningThreshold, className, ...props }: MeterProps): react_jsx_runtime.JSX.Element;
2030
+ declare function Meter({ label, size, variant, showWarningIndicator, warningThreshold, hideValueText, className, ...props }: MeterProps): react_jsx_runtime.JSX.Element;
1991
2031
 
1992
2032
  type SegmentOption = {
1993
2033
  id: string;
@@ -2303,6 +2343,17 @@ interface EntityConfig {
2303
2343
  */
2304
2344
  headlineMetrics: HeadlineMetric[];
2305
2345
  };
2346
+ /**
2347
+ * Which headline metric `entity.now` promotes to the hero ("fused") slot — a
2348
+ * single large number the design leads the rail with (e.g. Battery → SoC,
2349
+ * Inverter → Output). MUST be the `id` of one of this entity's
2350
+ * `fields.headlineMetrics`; the conformance test enforces that. Optional:
2351
+ * entities with no metric rail (Gateway, Water Heater) omit it, and a rail
2352
+ * with no promoted hero simply renders every cell equally. The hero choice
2353
+ * lives here, alongside the serialized metrics, so no per-instance prop is
2354
+ * needed (design build spec: "no per-instance metric props").
2355
+ */
2356
+ fusedMetricId?: string;
2306
2357
  /**
2307
2358
  * State rules for `entity.now`'s status chips. `primaryState` drives the
2308
2359
  * pulsing primary chip; `secondaryState` (battery/inverter: charge + grid)
@@ -3090,6 +3141,7 @@ declare const ENTITY_CONFIG: {
3090
3141
  readonly plural: "Meters";
3091
3142
  };
3092
3143
  readonly description: "Revenue meter at the point of consumption";
3144
+ readonly fusedMetricId: "power";
3093
3145
  readonly fields: {
3094
3146
  readonly headlineMetrics: [{
3095
3147
  readonly id: "power";
@@ -3117,6 +3169,30 @@ declare const ENTITY_CONFIG: {
3117
3169
  readonly decimals: 2;
3118
3170
  };
3119
3171
  readonly icon: "Lightning";
3172
+ }, {
3173
+ readonly id: "voltage";
3174
+ readonly label: "device.meter.fields.voltage";
3175
+ readonly source: {
3176
+ readonly kind: "state";
3177
+ readonly path: "state.phaseAVoltage";
3178
+ };
3179
+ readonly format: {
3180
+ readonly type: "voltage";
3181
+ readonly decimals: 1;
3182
+ };
3183
+ readonly icon: "Lightning";
3184
+ }, {
3185
+ readonly id: "current";
3186
+ readonly label: "device.meter.fields.current";
3187
+ readonly source: {
3188
+ readonly kind: "state";
3189
+ readonly path: "state.phaseACurrent";
3190
+ };
3191
+ readonly format: {
3192
+ readonly type: "current";
3193
+ readonly decimals: 2;
3194
+ };
3195
+ readonly icon: "Lightning";
3120
3196
  }];
3121
3197
  };
3122
3198
  };
@@ -3618,6 +3694,7 @@ declare const ENTITY_CONFIG: {
3618
3694
  readonly plural: "Batteries";
3619
3695
  };
3620
3696
  readonly description: "Behind-the-meter battery or storage system";
3697
+ readonly fusedMetricId: "soc";
3621
3698
  readonly fields: {
3622
3699
  readonly headlineMetrics: [{
3623
3700
  readonly id: "power";
@@ -3643,6 +3720,30 @@ declare const ENTITY_CONFIG: {
3643
3720
  readonly decimals: 0;
3644
3721
  };
3645
3722
  readonly icon: "BatteryCharging";
3723
+ }, {
3724
+ readonly id: "backupReserve";
3725
+ readonly label: "device.battery.fields.backupReserve";
3726
+ readonly source: {
3727
+ readonly kind: "state";
3728
+ readonly path: "state.backupReserve";
3729
+ };
3730
+ readonly format: {
3731
+ readonly type: "percentage";
3732
+ readonly decimals: 0;
3733
+ };
3734
+ readonly icon: "BatteryCharging";
3735
+ }, {
3736
+ readonly id: "loadPower";
3737
+ readonly label: "device.battery.fields.loadPower";
3738
+ readonly source: {
3739
+ readonly kind: "state";
3740
+ readonly path: "state.loadPower";
3741
+ };
3742
+ readonly format: {
3743
+ readonly type: "power";
3744
+ readonly decimals: 1;
3745
+ };
3746
+ readonly icon: "Lightning";
3646
3747
  }];
3647
3748
  };
3648
3749
  readonly stateRules: {
@@ -3680,6 +3781,7 @@ declare const ENTITY_CONFIG: {
3680
3781
  readonly plural: "EV Chargers";
3681
3782
  };
3682
3783
  readonly description: "Electric-vehicle charging station or port";
3784
+ readonly fusedMetricId: "power";
3683
3785
  readonly fields: {
3684
3786
  readonly headlineMetrics: [{
3685
3787
  readonly id: "power";
@@ -3706,6 +3808,30 @@ declare const ENTITY_CONFIG: {
3706
3808
  readonly falseText: "No";
3707
3809
  };
3708
3810
  readonly icon: "Plug";
3811
+ }, {
3812
+ readonly id: "voltage";
3813
+ readonly label: "device.evCharger.fields.voltage";
3814
+ readonly source: {
3815
+ readonly kind: "state";
3816
+ readonly path: "state.chargerVoltage";
3817
+ };
3818
+ readonly format: {
3819
+ readonly type: "voltage";
3820
+ readonly decimals: 1;
3821
+ };
3822
+ readonly icon: "Lightning";
3823
+ }, {
3824
+ readonly id: "current";
3825
+ readonly label: "device.evCharger.fields.current";
3826
+ readonly source: {
3827
+ readonly kind: "state";
3828
+ readonly path: "state.chargerCurrent";
3829
+ };
3830
+ readonly format: {
3831
+ readonly type: "current";
3832
+ readonly decimals: 1;
3833
+ };
3834
+ readonly icon: "Lightning";
3709
3835
  }];
3710
3836
  };
3711
3837
  readonly stateRules: {
@@ -3732,6 +3858,7 @@ declare const ENTITY_CONFIG: {
3732
3858
  readonly plural: "Solar / Inverters";
3733
3859
  };
3734
3860
  readonly description: "Solar PV inverter and its connected array";
3861
+ readonly fusedMetricId: "power";
3735
3862
  readonly fields: {
3736
3863
  readonly headlineMetrics: [{
3737
3864
  readonly id: "power";
@@ -3757,6 +3884,30 @@ declare const ENTITY_CONFIG: {
3757
3884
  readonly decimals: 0;
3758
3885
  };
3759
3886
  readonly icon: "GridFour";
3887
+ }, {
3888
+ readonly id: "generatedEnergy";
3889
+ readonly label: "device.inverter.fields.generatedEnergy";
3890
+ readonly source: {
3891
+ readonly kind: "state";
3892
+ readonly path: "state.generatedEnergy";
3893
+ };
3894
+ readonly format: {
3895
+ readonly type: "energy";
3896
+ readonly decimals: 1;
3897
+ };
3898
+ readonly icon: "Lightning";
3899
+ }, {
3900
+ readonly id: "lifetimeEnergyGenerated";
3901
+ readonly label: "device.inverter.fields.lifetimeEnergyGenerated";
3902
+ readonly source: {
3903
+ readonly kind: "state";
3904
+ readonly path: "state.lifetimeEnergyGenerated";
3905
+ };
3906
+ readonly format: {
3907
+ readonly type: "energy";
3908
+ readonly decimals: 0;
3909
+ };
3910
+ readonly icon: "Lightning";
3760
3911
  }];
3761
3912
  };
3762
3913
  readonly stateRules: {
@@ -3782,6 +3933,7 @@ declare const ENTITY_CONFIG: {
3782
3933
  readonly plural: "Thermostats";
3783
3934
  };
3784
3935
  readonly description: "Smart thermostat or connected HVAC control";
3936
+ readonly fusedMetricId: "ambientTemperature";
3785
3937
  readonly fields: {
3786
3938
  readonly headlineMetrics: [{
3787
3939
  readonly id: "ambientTemperature";
@@ -3819,6 +3971,16 @@ declare const ENTITY_CONFIG: {
3819
3971
  readonly decimals: 0;
3820
3972
  };
3821
3973
  readonly icon: "Snowflake";
3974
+ }, {
3975
+ readonly id: "fanMode";
3976
+ readonly label: "device.thermostat.fields.fanMode";
3977
+ readonly source: {
3978
+ readonly kind: "state";
3979
+ readonly path: "state.fanMode";
3980
+ };
3981
+ readonly format: {
3982
+ readonly type: "text";
3983
+ };
3822
3984
  }];
3823
3985
  };
3824
3986
  readonly stateRules: {
@@ -3847,6 +4009,7 @@ declare const ENTITY_CONFIG: {
3847
4009
  readonly plural: "EVs";
3848
4010
  };
3849
4011
  readonly description: "Electric vehicle managed as a flexible load";
4012
+ readonly fusedMetricId: "chargePercentage";
3850
4013
  readonly fields: {
3851
4014
  readonly headlineMetrics: [{
3852
4015
  readonly id: "chargePercentage";
@@ -3873,6 +4036,31 @@ declare const ENTITY_CONFIG: {
3873
4036
  readonly decimals: 0;
3874
4037
  };
3875
4038
  readonly icon: "GasPump";
4039
+ }, {
4040
+ readonly id: "chargeLimit";
4041
+ readonly label: "device.vehicle.fields.chargeLimit";
4042
+ readonly source: {
4043
+ readonly kind: "state";
4044
+ readonly path: "state.chargeLimit";
4045
+ };
4046
+ readonly format: {
4047
+ readonly type: "percentage";
4048
+ readonly decimals: 0;
4049
+ };
4050
+ readonly icon: "BatteryCharging";
4051
+ }, {
4052
+ readonly id: "isPluggedIn";
4053
+ readonly label: "device.vehicle.fields.isPluggedIn";
4054
+ readonly source: {
4055
+ readonly kind: "state";
4056
+ readonly path: "state.isPluggedIn";
4057
+ };
4058
+ readonly format: {
4059
+ readonly type: "boolean";
4060
+ readonly trueText: "Yes";
4061
+ readonly falseText: "No";
4062
+ };
4063
+ readonly icon: "Plug";
3876
4064
  }];
3877
4065
  };
3878
4066
  readonly stateRules: {
@@ -1,3 +1,3 @@
1
- 'use strict';var Go=require('react'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),Ze=require('@phosphor-icons/react');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Go__namespace=/*#__PURE__*/_interopNamespace(Go);var Ze__namespace=/*#__PURE__*/_interopNamespace(Ze);var Dt=Object.defineProperty;var It=(e,o,t)=>o in e?Dt(e,o,{enumerable:true,configurable:true,writable:true,value:t}):e[o]=t;var Me=(e,o,t)=>It(e,typeof o!="symbol"?o+"":o,t);function Ge(e,o=false){let[t,r]=Go.useState(o);return Go.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);r(n.matches);let a=l=>{r(l.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),t}function ve(e=true){let[o,t]=Go.useState(null);return Go.useEffect(()=>{if(!e){t(null);return}let r=typeof window<"u"?window.visualViewport:null;if(!r)return;let n=()=>{let a=Math.max(0,window.innerHeight-r.height-(r.offsetTop??0));t({height:r.height,keyboardOffset:a});};return n(),r.addEventListener("resize",n),r.addEventListener("scroll",n),()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n);}},[e]),o}function ye(...e){return e.filter(Boolean).join(" ")}var H={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 qe(e,...o){return ye(H[e],...o)}function Xe(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"}`}var ee={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)]"}};function h(e,o){let t=Go.forwardRef(({size:r=24,color:n="currentColor",className:a,mirrored:l,alt:i,...s},c)=>{let p=!!i||"aria-label"in s;return jsxRuntime.jsx("svg",{ref:c,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 256 256",fill:n,className:a,transform:l?"scale(-1, 1)":void 0,"aria-hidden":p?void 0:true,role:p?"img":void 0,"aria-label":i,...s,children:o})});return t.displayName=e,t}var Pe=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M12 128h44M200 128h44",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"76",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("circle",{cx:"180",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"})]}),Qe=()=>jsxRuntime.jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Je=()=>jsxRuntime.jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Ke=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 85.7 A32 32 0 1 1 144 85.7",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"58",r:"8",fill:"currentColor",stroke:"none"})]}),At=h("TextureRecloser",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.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"})]})),zt=h("TextureFuse",jsxRuntime.jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),Ot=h("TextureBreaker",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.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"})]})),Vt=h("TextureSource",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 128h40M212 128h40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"84",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("path",{d:"M92 128q18 -84 36 0q18 84 36 0",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),Wt=h("TextureCapacitor",jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),_t=h("TextureRegulator",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"92",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.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"})]})),$t=h("TextureSwitch",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Pe,{}),jsxRuntime.jsx(Qe,{})]})),Yt=h("TextureSwitchClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Pe,{}),jsxRuntime.jsx(Je,{})]})),Ut=h("TextureSectionalizerOpen",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Pe,{}),jsxRuntime.jsx(Qe,{}),jsxRuntime.jsx(Ke,{})]})),jt=h("TextureSectionalizerClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Pe,{}),jsxRuntime.jsx(Je,{}),jsxRuntime.jsx(Ke,{})]})),Gt=h("TextureTransformer",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.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"}),jsxRuntime.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"})]})),ie={1:[128],2:[110,146],3:[92,128,164]},Le=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),Ee=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),qt=h("TextureSinglePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[1].map(Le)})),Xt=h("TextureTwoPhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[2].map(Le)})),Qt=h("TextureThreePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[3].map(Le)})),Jt=h("TextureSinglePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[1].map(Ee)})),Kt=h("TextureTwoPhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[2].map(Ee)})),Zt=h("TextureThreePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[3].map(Ee)})),eo=h("TextureSupportStructure",jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),ke={TextureRecloser:At,TextureFuse:zt,TextureBreaker:Ot,TextureSource:Vt,TextureCapacitor:Wt,TextureRegulator:_t,TextureSwitch:$t,TextureSwitchClosed:Yt,TextureSectionalizerOpen:Ut,TextureSectionalizerClosed:jt,TextureTransformer:Gt,TextureSinglePhaseOverheadLine:qt,TextureTwoPhaseOverheadLine:Xt,TextureThreePhaseOverheadLine:Qt,TextureSinglePhaseUndergroundLine:Jt,TextureTwoPhaseUndergroundLine:Kt,TextureThreePhaseUndergroundLine:Zt,TextureSupportStructure:eo};if(process.env.NODE_ENV==="development")for(let e of Object.keys(ke))e in Ze__namespace&&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 se={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},I=Go.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:a,...l})=>{let i=ke[e]??Ze__namespace[e];if(!i)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let s=typeof o=="string"&&o in se?se[o]:o,c=tailwindMerge.twMerge("inline-block flex-shrink-0",!t&&"text-current",n);return jsxRuntime.jsx(i,{...l,size:s,color:t,weight:r,className:c,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});I.displayName="Icon";var to=Go.memo(({variant:e="subtle",shape:o="square",containerSize:t,containerClassName:r,size:n="md",className:a,name:l,color:i,weight:s,ariaLabel:c,ref:p,...u})=>{let b=typeof n=="string"&&n in se?se[n]:n,k=t?typeof t=="string"&&t in se?se[t]:t:b*1.75,x=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",o==="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",r);return jsxRuntime.jsx("div",{className:x,style:{width:k,height:k},children:jsxRuntime.jsx(I,{...u,name:l,size:n,color:i,weight:s,className:a,ariaLabel:c})})});to.displayName="IconWithContainer";var no="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",ao="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",io={primary:ao,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"},rt={full:"w-full",default:"w-fit"},so="opacity-50 cursor-not-allowed pointer-events-none",lo="opacity-100 cursor-pointer",co={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},uo={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function po(e){return !e||e==="default"||e==="brand"?"primary":e}function fo(e){let{variant:o="primary",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,l=po(o),i=l==="unstyled"?"":`${no} ${io[l]}`;l!=="unstyled"&&(i+=` ${ee[t].text} ${ee[t].height} ${ee[t].padding} ${ee[t].gap}`),r||a?i+=` ${so}`:i+=` ${lo}`,n?i+=` ${rt.full}`:i+=` ${rt.default}`;let s=l==="primary"?"focus-visible:outline-action-primary":void 0;return [i,Xe(),s].filter(Boolean).join(" ")}function $(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:a,size:l="md",iconPosition:i="left",iconWeight:s,href:c,className:p,badgeNumber:u,badgeVariant:b="primary",badgePosition:k="top-right",style:x,target:S,rel:M,...N}=e,m=o?jsxRuntime.jsx(I,{name:o,size:l,weight:s}):null,C=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,typeof t=="function"?null:t,i==="right"&&m]}),R=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(I,{name:"CircleNotch",size:l,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:C}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),v=(u??0)>0,w=tailwindMerge.twMerge(fo(e),p),j=c?{href:c,target:S,rel:M,...N}:{};if(c){let{onPress:V,onPressStart:E,onPressEnd:ce,onPressChange:G,onPressUp:re,onAuxClick:ue,onContextMenu:ne,onDoubleClick:W,...F}=N;Object.assign(j,F);}let L=c?jsxRuntime.jsx(reactAriaComponents.Link,{...j,...r&&{"aria-busy":true},style:v?void 0:x,className:w,children:r?R:typeof t=="function"?(function(V){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t(V),i==="right"&&m]})}):C}):jsxRuntime.jsx(reactAriaComponents.Button,{...N,...r&&{"aria-busy":true},style:v?void 0:x,className:w,children:r?R:typeof t=="function"?(function(V){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t(V),i==="right"&&m]})}):C});return v?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",p),style:x,children:[L,jsxRuntime.jsx("span",{className:`absolute ${co[k]} flex h-5 w-5 items-center justify-center rounded-full ${uo[b]} text-xs font-medium`,"aria-label":`${u} items`,children:u})]}):L}function Ae({action:e,defaultVariant:o,defaultSize:t="lg"}){let r=!!e.formId;return jsxRuntime.jsx($,{type:r?"submit":"button",form:r?e.formId:void 0,size:e.size||t,variant:e.variant||o,onPress:r?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function X({primaryAction:e,secondaryAction:o,tertiaryAction:t,footerContent:r}){let n=e||o||t;return !n&&!r?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${r?"h-28":""}`,children:[r&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:r}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:t&&jsxRuntime.jsx(Ae,{action:t,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[o&&jsxRuntime.jsx(Ae,{action:o,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(Ae,{action:e,defaultVariant:"primary"})]})]})]})}var mo={heading:{sm:H.headingSm,md:H.headingMd,lg:H.headingLg,xl:H.headingXl},display:{sm:H.displaySm,md:H.displayMd,lg:H.displayLg,xl:H.displayXl}},go={page:"h-16 leading-[62px]"};function te({tag:e="h1",variant:o="heading",size:t="lg",height:r,className:n="",children:a}){let l=t==="xs"?"sm":t,i=mo[o][l],s=r?go[r]:"";return jsxRuntime.jsx(e,{className:ye(i,"text-text-primary",s,n),children:a})}var T=({title:e,onClose:o,hideCloseIcon:t=false,titleAlign:r="left",hasBackArrow:n=false,onBack:a,headerContent:l})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",r==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx($,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(I,{name:"CaretLeft","data-testid":"back-arrow"})}),l||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(te,{size:"xs",children:e}),o&&!t&&jsxRuntime.jsx($,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(I,{name:"X","data-testid":"close-button"})})]})]});var B=({width:e,height:o,variant:t="rect",animation:r="pulse",gradient:n=false,flex:a=false,stack:l,responsive:i,delay:s=0,adjustAnimationSpeedBasedOnWidth:c=false,ariaLabel:p,className:u,"data-testid":b})=>{let[k,x]=Go.useState(s===0);if(Go.useEffect(()=>{if(s>0){let v=setTimeout(()=>x(true),s);return ()=>clearTimeout(v)}},[s]),!k)return null;let S=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",M=c&&e?(()=>{let v=typeof e=="number"?e:parseFloat(String(e));return isNaN(v)?"":`animation-duration-[${Math.max(.8,v/100)}s]`})():"",N=r==="pulse"?`animate-pulse ${M}`:r==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${M}`:"",m="rounded-sm";t==="circle"&&(m="rounded-full"),t==="text"&&(m="h-4 w-full rounded-sm");let C=a?"flex-1 min-w-0":"",R=i?Object.entries(i).map(([v,w])=>`${v}:w-[${w}]`).join(" "):"";return l?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":b,children:l.map((v,w)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(S,N,m,C,R,u),style:{width:v,height:o}},w))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(S,N,m,C,R,u),style:{width:e,height:o},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":b})};var Po={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},ko="rounded-lg",Ve={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},Co={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function Y({variant:e="outlined",className:o,children:t,isLoading:r=false,layout:n="default"}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",Po[e],ko,n==="flex"&&"flex flex-col",o),"data-testid":"card",children:r?jsxRuntime.jsx(B,{width:"100%",height:"100%",className:"rounded-none"}):t})}function it({title:e,subtitle:o,actions:t,className:r,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(B,{width:120,height:20}),jsxRuntime.jsx(B,{width:24,height:24})]}),o&&jsxRuntime.jsx(B,{width:200,height:16})]}):!e&&!o&&!t?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(te,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),o&&jsxRuntime.jsx("div",{className:qe("bodySm","text-text-secondary"),children:o})]}),t&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:t})]})})}function st({src:e,alt:o,aspectRatio:t="auto",className:r,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",Ve[t],r),children:jsxRuntime.jsx(B,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Ve[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",Ve[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function lt({className:e,children:o,isLoading:t=false,fill:r=false}){let a=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,r&&"flex-1 flex flex-col min-h-0",e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(B,{width:"100%",height:16}),jsxRuntime.jsx(B,{width:"80%",height:16}),jsxRuntime.jsx(B,{width:"60%",height:16})]})}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-primary",r&&"flex-1 flex flex-col min-h-0",e),children:o}):null}function dt({className:e,children:o,align:t="end",isLoading:r=false}){return r?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(B,{width:80,height:32}),jsxRuntime.jsx(B,{width:60,height:32})]}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",Co[t],e),children:o}):null}Y.Header=it;Y.Media=st;Y.Content=lt;Y.Footer=dt;var z=class extends Go.Component{constructor(){super(...arguments);Me(this,"state",{hasError:false});Me(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,r){console.error("Error Boundary caught an error:",t,r);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Y,{children:[this.props.title&&jsxRuntime.jsx(Y.Header,{title:this.props.title}),jsxRuntime.jsx(Y.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-feedback-error-text",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-action-default px-4 py-2 text-[color:var(--color-action-default-text)] hover:bg-action-default-hover",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};function Q({transparent:e=false,className:o,children:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(o,(n,a)=>tailwindMerge.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:t})}var Bo=.3,Mo=.5;function Re({children:e,title:o,headerContent:t,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:l,isOpen:i,onClose:s,isDismissable:c=true,transparentOverlay:p=false,primaryAction:u,secondaryAction:b,footerContent:k,maxHeight:x="80vh",height:S,maxWidth:M="640px",contentPadding:N=true,showHandle:m=true,animationVariant:C="scale",className:R}){let[v,w]=Go.useState(false),[j,L]=Go.useState(0),[V,E]=Go.useState(false),ce=ve(i),G=ce?.height??null,re=ce?.keyboardOffset??0,ue=Go.useRef(null),ne=Go.useRef(null),W=Go.useRef(null),F=Go.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});Go.useEffect(()=>{if(i){let g=setTimeout(()=>{w(true),setTimeout(()=>w(false),600);},400);return ()=>clearTimeout(g)}},[i]),Go.useEffect(()=>{i||(L(0),E(false),F.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]),Go.useEffect(()=>{let g=ne.current;if(!g||!i)return;let _=null,ae=me=>{let Z=me.target;Z&&["INPUT","TEXTAREA","SELECT"].includes(Z.tagName)&&(_&&clearTimeout(_),_=setTimeout(()=>{Z.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return g.addEventListener("focusin",ae),()=>{g.removeEventListener("focusin",ae),_&&clearTimeout(_);}},[i]);let J=Go.useCallback(g=>{c&&(g.pointerType!=="touch"&&g.pointerType!=="pen"||(W.current&&(clearTimeout(W.current),W.current=null),F.current={isDragging:true,startY:g.clientY,startTime:Date.now(),pointerId:g.pointerId},E(false),g.currentTarget.setPointerCapture(g.pointerId)));},[c]),K=Go.useCallback(g=>{let{isDragging:_,startY:ae,pointerId:me}=F.current;if(!_||g.pointerId!==me)return;let Z=g.clientY-ae;L(Math.max(0,Z));},[]),pe=Go.useCallback(g=>{let{isDragging:_,startY:ae,startTime:me,pointerId:Z}=F.current;if(!_||g.pointerId!==Z)return;let Be=g.clientY-ae,Rt=Date.now()-me,St=Be/Rt;F.current={isDragging:false,startY:0,startTime:0,pointerId:null};let Tt=(ue.current?.getBoundingClientRect().height??0)*Bo;(Be>Tt||St>Mo&&Be>50)&&c?(s?.(),L(0)):(E(true),L(0),W.current=setTimeout(()=>{E(false),W.current=null;},200));},[c,s]);if(!i)return null;let Ie=o||t,fe=u||b||k;return jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{isOpen:i,onOpenChange:g=>{g||s?.();},isDismissable:c,transparent:p,style:{paddingBottom:re>0?`${re}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:c,children:jsxRuntime.jsx("div",{ref:ue,className:tailwindMerge.twMerge("w-full",V&&"transition-transform duration-200"),style:{transform:j>0?`translateY(${j}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",C==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",C==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",R),style:{maxWidth:M,...S?{height:S}:{maxHeight:/\d/.test(x)?G!==null?`min(${x}, ${Math.max(G-8,0)}px, 100dvh)`:`min(${x}, 100dvh)`:x}},children:[m&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:J,onPointerMove:K,onPointerUp:pe,onPointerCancel:pe,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",v&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),Ie&&(a?jsxRuntime.jsx(T,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!s,hasBackArrow:true,onBack:l??(()=>{}),onClose:s||(()=>{})}):jsxRuntime.jsx(T,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!s,onClose:s||(()=>{})})),jsxRuntime.jsx("div",{ref:ne,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",N?"p-4":"p-0"),children:e}),fe&&jsxRuntime.jsx(X,{primaryAction:u,secondaryAction:b,footerContent:k})]})})})})})}Re.displayName="Tray";function Ue({isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:l=false,onBack:i,children:s,primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:b,transparentOverlay:k=false,maxWidth:x="600px",minWidth:S="400px",maxHeight:M="85vh",height:N,mobileMaxHeight:m="90vh",mobileHeight:C,contentPadding:R=true,className:v}){let w=Ge("(max-width: 767px)"),j=ve(w&&e===void 0),L=j?.height??null,V=j?.keyboardOffset??0,E=Go.useRef(null),ce=Go.useCallback(()=>{E.current&&E.current.scrollTop!==0&&(E.current.scrollTop=0);},[]),G=Go.useRef(null),re=Go.useRef(null);Go.useEffect(()=>{let J=re.current;if(!J||!w)return;let K=null,pe=Ie=>{let fe=Ie.target;fe&&["INPUT","TEXTAREA","SELECT"].includes(fe.tagName)&&(K&&clearTimeout(K),K=setTimeout(()=>{fe.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return J.addEventListener("focusin",pe),()=>{J.removeEventListener("focusin",pe),K&&clearTimeout(K);}},[w]);let ue=Go.useCallback(()=>{G.current&&G.current.scrollTop!==0&&(G.current.scrollTop=0);},[]);if(e===false)return null;let ne=t||r,W=c||p||u||b,F=e!==void 0;return w?F?jsxRuntime.jsx(Re,{isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n,hideCloseIcon:a,hasBackArrow:l,onBack:i,primaryAction:c,secondaryAction:p,footerContent:b,transparentOverlay:k,maxHeight:m,height:C,maxWidth:x,contentPadding:R,showHandle:true,animationVariant:"scale",className:v,children:s}):jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{isDismissable:true,transparent:k,style:{paddingBottom:V>0?`${V}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-0 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:E,onScroll:ce,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border-t border-x border-border-default/40","rounded-t-xl","overflow-hidden","animate-in slide-in-from-bottom","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:slide-out-to-bottom","data-[exiting]:duration-200 data-[exiting]:ease-in",v),style:{...C?{height:C}:{maxHeight:/\d/.test(m)?L!==null?`min(${m}, ${Math.max(L-8,0)}px, 100dvh)`:`min(${m}, 100dvh)`:m}},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-2",children:jsxRuntime.jsx("div",{className:"h-1.5 w-12 rounded-full bg-border-muted"})}),ne&&(l?jsxRuntime.jsx(T,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(T,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,onClose:o||(()=>{})})),jsxRuntime.jsx("div",{ref:re,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",R?"px-6 py-6":"p-0"),children:s}),W&&jsxRuntime.jsx(X,{primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:b})]})})})}):jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{...F?{isOpen:e,onOpenChange:J=>{!J&&o&&o();}}:{},isDismissable:true,transparent:k,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",style:{maxWidth:x},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:G,onScroll:ue,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border border-border-default/50","rounded-md","overflow-hidden","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0","animate-in fade-in zoom-in-96 slide-in-from-bottom-2","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-95","data-[exiting]:duration-200 data-[exiting]:ease-in",v),style:{minWidth:S,...N?{height:N}:{maxHeight:M}},children:[ne&&(l?jsxRuntime.jsx(T,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(T,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,onClose:o||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",R?"px-6 py-6":"p-0"),children:s}),W&&jsxRuntime.jsx(X,{primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:b})]})})})})}function be(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function ka({formId:e="dialog-form",onSubmit:o,primaryLabel:t="Save",secondaryLabel:r="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:l="secondary",children:i,title:s,...c}){return jsxRuntime.jsx(Ue,{title:s,primaryAction:{label:t,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:l}:void 0,...c,children:jsxRuntime.jsx(be,{id:e,onSubmit:o,children:i})})}function Te({children:e,title:o,headerContent:t,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:l,isOpen:i,slideInFrom:s="right",transparentOverlay:c=false,onClose:p,className:u,primaryAction:b,secondaryAction:k,tertiaryAction:x,footerContent:S,contentPadding:M=true,maxWidth:N="400px"}){if(!i)return null;let m=o||t,C=b||k||x||S;return jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{isOpen:i,onOpenChange:R=>!R&&p?.(),isDismissable:true,transparent:c,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("fixed top-0 bottom-0 flex flex-col bg-background-surface shadow-xl overflow-hidden",s==="right"?"right-0":"left-0",s==="right"?"animate-in slide-in-from-right duration-300 ease-out":"animate-in slide-in-from-left duration-300 ease-out","data-[exiting]:animate-out",s==="right"?"data-[exiting]:slide-out-to-right":"data-[exiting]:slide-out-to-left","data-[exiting]:duration-200 data-[exiting]:ease-in","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0",u),style:{maxWidth:N,width:"100%"},children:[m&&(a&&l?jsxRuntime.jsx(T,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,hasBackArrow:true,onBack:l,onClose:p}):jsxRuntime.jsx(T,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,onClose:p})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",M?"px-6 py-6":"p-0"),children:e}),C&&jsxRuntime.jsx(X,{primaryAction:b,secondaryAction:k,tertiaryAction:x,footerContent:S})]})})})})}Te.displayName="Drawer";function Aa({formId:e="drawer-form",onSubmit:o,primaryLabel:t="Save",secondaryLabel:r="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:l="secondary",children:i,...s}){return jsxRuntime.jsx(Te,{primaryAction:{label:t,onPress:()=>{let p=document.getElementById(e);p&&p.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:l}:void 0,...s,children:jsxRuntime.jsx(be,{id:e,onSubmit:o,className:"mt-2",children:i})})}function Wa({align:e="end",className:o,...t}){return jsxRuntime.jsx("div",{...t,className:tailwindMerge.twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",o)})}var Yo={sm:"gap-2",md:"gap-4",lg:"gap-6"};function Uo(e){if(!e)return "";let o=e.base?`grid-cols-${e.base}`:"",t=e.md?`md:grid-cols-${e.md}`:"",r=e.lg?`lg:grid-cols-${e.lg}`:"";return [o,t,r].filter(Boolean).join(" ")}function Ua({cols:e={base:1},gap:o="lg",className:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("grid",Uo(e),Yo[o],t)})}var qo=Go__namespace.default.forwardRef(({children:e,className:o},t)=>jsxRuntime.jsx("div",{ref:t,className:tailwindMerge.twMerge("relative w-full",o),children:e}));qo.displayName="InputWrapper";function vt({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",ee[e].text,o),children:t})}function ri({title:e,description:o,showDivider:t,className:r,children:n,...a}){return jsxRuntime.jsxs("section",{...a,className:tailwindMerge.twMerge("flex flex-col",r),children:[(e||o)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsxRuntime.jsx(te,{tag:"h3",size:"sm",children:e}):e,o?jsxRuntime.jsx(vt,{size:"lg",children:o}):null]}),jsxRuntime.jsx("div",{className:"flex flex-col gap-6",children:n}),t&&jsxRuntime.jsx("hr",{className:"mt-2 border-border-muted"})]})}function ni(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function di({steps:e,currentStepId:o,onStepClick:t,className:r}){let n=e.findIndex(a=>a.id===o);return jsxRuntime.jsx("nav",{"aria-label":"Progress",className:tailwindMerge.twMerge("w-full",r),children:jsxRuntime.jsx("div",{className:"relative mb-12",children:jsxRuntime.jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,l)=>{let i=a.id===o,s=l<n,c=t&&(s||i);return jsxRuntime.jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsxRuntime.jsx("button",{type:"button",disabled:!c,onClick:()=>c&&t?.(a.id),className:tailwindMerge.twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",s&&"border-action-primary bg-action-primary text-text-inverse hover:bg-action-primary/90",i&&"border-action-primary bg-background-body text-action-primary",!s&&!i&&"border-border-default bg-background-body text-text-secondary",c&&"cursor-pointer",!c&&"cursor-default"),"aria-current":i?"step":void 0,children:s?jsxRuntime.jsx(I,{name:"Check",size:20,weight:"bold"}):jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:l+1})}),l<e.length-1&&jsxRuntime.jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:l<n?"var(--color-action-primary)":"var(--color-border-default)"}}),jsxRuntime.jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("text-sm font-medium",i&&"text-text-default",s&&"text-text-primary",!i&&!s&&"text-text-secondary"),children:a.title}),a.description&&jsxRuntime.jsx("span",{className:"mt-1 text-xs text-text-secondary",children:a.description})]})]},a.id)})})})})}function mi({formId:e,show:o,isSubmitting:t,onCancel:r,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:l}){return o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",l),children:jsxRuntime.jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsxRuntime.jsx("div",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx($,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx($,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function bi({when:e,message:o="You have unsaved changes. Leave anyway?"}){return Go__namespace.useEffect(()=>{if(!e)return;let t=r=>(r.preventDefault(),r.returnValue=o,o);return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[e,o]),null}function vi({steps:e,initialStepId:o,canNavigate:t}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,n]=Go__namespace.useState(o||e[0].id),a=e.findIndex(u=>u.id===r),l=a>0,i=a<e.length-1,s=async u=>u===r?true:t&&!await t(r,u)?false:(n(u),true);return {steps:e,currentStepId:r,setCurrentStepId:s,next:async()=>!i||a===-1?false:s(e[a+1].id),prev:async()=>!l||a===-1?false:s(e[a-1].id),hasNext:i,hasPrev:l,stepIndex:a}}
2
- exports.DialogForm=ka;exports.DrawerForm=Aa;exports.FormActions=Wa;exports.FormDivider=ni;exports.FormGrid=Ua;exports.FormSection=ri;exports.FormStepper=di;exports.SaveBar=mi;exports.UnsavedChangesPrompt=bi;exports.useWizard=vi;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var qo=require('react'),reactAriaComponents=require('react-aria-components'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),Ze=require('@phosphor-icons/react');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var qo__namespace=/*#__PURE__*/_interopNamespace(qo);var Ze__namespace=/*#__PURE__*/_interopNamespace(Ze);var Dt=Object.defineProperty;var It=(e,o,t)=>o in e?Dt(e,o,{enumerable:true,configurable:true,writable:true,value:t}):e[o]=t;var Me=(e,o,t)=>It(e,typeof o!="symbol"?o+"":o,t);function Ge(e,o=false){let[t,r]=qo.useState(o);return qo.useEffect(()=>{if(typeof window>"u")return;let n=window.matchMedia(e);r(n.matches);let a=l=>{r(l.matches);};return n.addEventListener("change",a),()=>{n.removeEventListener("change",a);}},[e]),t}function ve(e=true){let[o,t]=qo.useState(null);return qo.useEffect(()=>{if(!e){t(null);return}let r=typeof window<"u"?window.visualViewport:null;if(!r)return;let n=()=>{let a=Math.max(0,window.innerHeight-r.height-(r.offsetTop??0));t({height:r.height,keyboardOffset:a});};return n(),r.addEventListener("resize",n),r.addEventListener("scroll",n),()=>{r.removeEventListener("resize",n),r.removeEventListener("scroll",n);}},[e]),o}function ye(...e){return e.filter(Boolean).join(" ")}var H={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 qe(e,...o){return ye(H[e],...o)}function Xe(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"}`}var ee={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)]"}};function h(e,o){let t=qo.forwardRef(({size:r=24,color:n="currentColor",className:a,mirrored:l,alt:i,...s},c)=>{let p=!!i||"aria-label"in s;return jsxRuntime.jsx("svg",{ref:c,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 256 256",fill:n,className:a,transform:l?"scale(-1, 1)":void 0,"aria-hidden":p?void 0:true,role:p?"img":void 0,"aria-label":i,...s,children:o})});return t.displayName=e,t}var Pe=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M12 128h44M200 128h44",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"76",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("circle",{cx:"180",cy:"128",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"16"})]}),Qe=()=>jsxRuntime.jsx("path",{d:"M166 120 88 70",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Je=()=>jsxRuntime.jsx("path",{d:"M162 122 92 128",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),Ke=()=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 85.7 A32 32 0 1 1 144 85.7",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"58",r:"8",fill:"currentColor",stroke:"none"})]}),At=h("TextureRecloser",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.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"})]})),zt=h("TextureFuse",jsxRuntime.jsx("path",{d:"M20 128h72q18 -84 36 0q18 84 36 0h72",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})),Ot=h("TextureBreaker",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"36",y:"36",width:"184",height:"184",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.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"})]})),Wt=h("TextureSource",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 128h40M212 128h40",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"}),jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"84",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.jsx("path",{d:"M92 128q18 -84 36 0q18 84 36 0",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",strokeLinejoin:"round"})]})),Vt=h("TextureCapacitor",jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("path",{d:"M4 128h106M146 128h106M110 72v112M146 72v112",fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"})})),_t=h("TextureRegulator",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"92",fill:"none",stroke:"currentColor",strokeWidth:"16"}),jsxRuntime.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"})]})),$t=h("TextureSwitch",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Pe,{}),jsxRuntime.jsx(Qe,{})]})),Yt=h("TextureSwitchClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Pe,{}),jsxRuntime.jsx(Je,{})]})),Ut=h("TextureOpenPoint",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M112 52 C 74 92, 74 164, 112 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M144 52 C 182 92, 182 164, 144 204",fill:"none",stroke:"currentColor",strokeWidth:"18",strokeLinecap:"round"})]})),jt=h("TextureSectionalizerOpen",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Pe,{}),jsxRuntime.jsx(Qe,{}),jsxRuntime.jsx(Ke,{})]})),Gt=h("TextureSectionalizerClosed",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Pe,{}),jsxRuntime.jsx(Je,{}),jsxRuntime.jsx(Ke,{})]})),qt=h("TextureTransformer",jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.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"}),jsxRuntime.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"})]})),ie={1:[128],2:[110,146],3:[92,128,164]},Le=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round"},e),Ee=e=>jsxRuntime.jsx("path",{d:`M24 ${e}h208`,fill:"none",stroke:"currentColor",strokeWidth:"16",strokeLinecap:"round",pathLength:100,strokeDasharray:"20 20"},e),Xt=h("TextureSinglePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[1].map(Le)})),Qt=h("TextureTwoPhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[2].map(Le)})),Jt=h("TextureThreePhaseOverheadLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[3].map(Le)})),Kt=h("TextureSinglePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[1].map(Ee)})),Zt=h("TextureTwoPhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[2].map(Ee)})),eo=h("TextureThreePhaseUndergroundLine",jsxRuntime.jsx(jsxRuntime.Fragment,{children:ie[3].map(Ee)})),to=h("TextureSupportStructure",jsxRuntime.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"currentColor",stroke:"none"})),ke={TextureRecloser:At,TextureFuse:zt,TextureBreaker:Ot,TextureSource:Wt,TextureCapacitor:Vt,TextureRegulator:_t,TextureSwitch:$t,TextureSwitchClosed:Yt,TextureOpenPoint:Ut,TextureSectionalizerOpen:jt,TextureSectionalizerClosed:Gt,TextureTransformer:qt,TextureSinglePhaseOverheadLine:Xt,TextureTwoPhaseOverheadLine:Qt,TextureThreePhaseOverheadLine:Jt,TextureSinglePhaseUndergroundLine:Kt,TextureTwoPhaseUndergroundLine:Zt,TextureThreePhaseUndergroundLine:eo,TextureSupportStructure:to};if(process.env.NODE_ENV==="development")for(let e of Object.keys(ke))e in Ze__namespace&&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 se={xs:16,sm:20,md:24,lg:32,xl:40,"2xl":48},I=qo.memo(({name:e,size:o="md",color:t,weight:r="regular",className:n,ariaLabel:a,...l})=>{let i=ke[e]??Ze__namespace[e];if(!i)return process.env.NODE_ENV==="development"&&console.error(`Icon "${e}" not found in @phosphor-icons/react or the custom icon registry`),null;let s=typeof o=="string"&&o in se?se[o]:o,c=tailwindMerge.twMerge("inline-block flex-shrink-0",!t&&"text-current",n);return jsxRuntime.jsx(i,{...l,size:s,color:t,weight:r,className:c,"aria-label":a||`${e} icon`,"data-testid":`icon-${e}`})});I.displayName="Icon";var oo=qo.memo(({variant:e="subtle",shape:o="square",containerSize:t,containerClassName:r,size:n="md",className:a,name:l,color:i,weight:s,ariaLabel:c,ref:p,...u})=>{let x=typeof n=="string"&&n in se?se[n]:n,k=t?typeof t=="string"&&t in se?se[t]:t:x*1.75,v=tailwindMerge.twMerge("inline-flex items-center justify-center flex-shrink-0",o==="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",r);return jsxRuntime.jsx("div",{className:v,style:{width:k,height:k},children:jsxRuntime.jsx(I,{...u,name:l,size:n,color:i,weight:s,className:a,ariaLabel:c})})});oo.displayName="IconWithContainer";var ao="flex font-medium justify-center items-center gap-2 text-center transition rounded-[var(--control-border-radius)] whitespace-nowrap box-border",io="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",so={primary:io,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"},rt={full:"w-full",default:"w-fit"},lo="opacity-50 cursor-not-allowed pointer-events-none",co="opacity-100 cursor-pointer",uo={"top-right":"-right-2 -top-2","top-left":"-left-2 -top-2","bottom-right":"-right-2 -bottom-2","bottom-left":"-left-2 -bottom-2"},po={primary:"bg-action-primary text-[color:var(--color-action-primary-text)]",destructive:"bg-feedback-error-border text-text-inverse"};function fo(e){return !e||e==="default"||e==="brand"?"primary":e}function mo(e){let{variant:o="primary",size:t="md",isDisabled:r,fullWidth:n=false,isLoading:a=false}=e,l=fo(o),i=l==="unstyled"?"":`${ao} ${so[l]}`;l!=="unstyled"&&(i+=` ${ee[t].text} ${ee[t].height} ${ee[t].padding} ${ee[t].gap}`),r||a?i+=` ${lo}`:i+=` ${co}`,n?i+=` ${rt.full}`:i+=` ${rt.default}`;let s=l==="primary"?"focus-visible:outline-action-primary":void 0;return [i,Xe(),s].filter(Boolean).join(" ")}function $(e){let{icon:o,children:t,isLoading:r=false,loadingText:n,loadingIndicator:a,size:l="md",iconPosition:i="left",iconWeight:s,href:c,className:p,badgeNumber:u,badgeVariant:x="primary",badgePosition:k="top-right",style:v,target:S,rel:M,...N}=e,m=o?jsxRuntime.jsx(I,{name:o,size:l,weight:s}):null,C=jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,typeof t=="function"?null:t,i==="right"&&m]}),R=jsxRuntime.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a||jsxRuntime.jsx(I,{name:"CircleNotch",size:l,className:"animate-spin","aria-hidden":"true"})}),jsxRuntime.jsx("div",{className:"invisible","aria-hidden":"true",children:C}),n&&jsxRuntime.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n})]}),y=(u??0)>0,w=tailwindMerge.twMerge(mo(e),p),j=c?{href:c,target:S,rel:M,...N}:{};if(c){let{onPress:W,onPressStart:E,onPressEnd:ce,onPressChange:G,onPressUp:re,onAuxClick:ue,onContextMenu:ne,onDoubleClick:V,...F}=N;Object.assign(j,F);}let L=c?jsxRuntime.jsx(reactAriaComponents.Link,{...j,...r&&{"aria-busy":true},style:y?void 0:v,className:w,children:r?R:typeof t=="function"?(function(W){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t(W),i==="right"&&m]})}):C}):jsxRuntime.jsx(reactAriaComponents.Button,{...N,...r&&{"aria-busy":true},style:y?void 0:v,className:w,children:r?R:typeof t=="function"?(function(W){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[i==="left"&&m,t(W),i==="right"&&m]})}):C});return y?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex",p),style:v,children:[L,jsxRuntime.jsx("span",{className:`absolute ${uo[k]} flex h-5 w-5 items-center justify-center rounded-full ${po[x]} text-xs font-medium`,"aria-label":`${u} items`,children:u})]}):L}function Ae({action:e,defaultVariant:o,defaultSize:t="lg"}){let r=!!e.formId;return jsxRuntime.jsx($,{type:r?"submit":"button",form:r?e.formId:void 0,size:e.size||t,variant:e.variant||o,onPress:r?void 0:e.onPress,isLoading:e.isLoading,isDisabled:e.isDisabled,children:e.label})}function X({primaryAction:e,secondaryAction:o,tertiaryAction:t,footerContent:r}){let n=e||o||t;return !n&&!r?null:jsxRuntime.jsxs("div",{className:`flex w-full flex-col items-center justify-center border-t p-4 ${r?"h-28":""}`,children:[r&&jsxRuntime.jsx("div",{className:"flex h-10 justify-center",children:r}),n&&jsxRuntime.jsxs("div",{className:"flex w-full items-center justify-between gap-3",children:[jsxRuntime.jsx("div",{children:t&&jsxRuntime.jsx(Ae,{action:t,defaultVariant:"destructive"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[o&&jsxRuntime.jsx(Ae,{action:o,defaultVariant:"secondary"}),e&&jsxRuntime.jsx(Ae,{action:e,defaultVariant:"primary"})]})]})]})}var go={heading:{sm:H.headingSm,md:H.headingMd,lg:H.headingLg,xl:H.headingXl},display:{sm:H.displaySm,md:H.displayMd,lg:H.displayLg,xl:H.displayXl}},ho={page:"h-16 leading-[62px]"};function te({tag:e="h1",variant:o="heading",size:t="lg",height:r,className:n="",children:a}){let l=t==="xs"?"sm":t,i=go[o][l],s=r?ho[r]:"";return jsxRuntime.jsx(e,{className:ye(i,"text-text-primary",s,n),children:a})}var D=({title:e,onClose:o,hideCloseIcon:t=false,titleAlign:r="left",hasBackArrow:n=false,onBack:a,headerContent:l})=>jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("relative flex h-16 w-full flex-shrink-0 items-center justify-between border-b px-6",e&&"border-b",r==="center"?"justify-center":""),children:[n&&jsxRuntime.jsx($,{variant:"icon",onPress:a,className:"absolute left-6","aria-label":"Go back",children:jsxRuntime.jsx(I,{name:"CaretLeft","data-testid":"back-arrow"})}),l||jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[e&&jsxRuntime.jsx(te,{size:"xs",children:e}),o&&!t&&jsxRuntime.jsx($,{variant:"icon",onPress:o,"aria-label":"Close dialog",children:jsxRuntime.jsx(I,{name:"X","data-testid":"close-button"})})]})]});var B=({width:e,height:o,variant:t="rect",animation:r="pulse",gradient:n=false,flex:a=false,stack:l,responsive:i,delay:s=0,adjustAnimationSpeedBasedOnWidth:c=false,ariaLabel:p,className:u,"data-testid":x})=>{let[k,v]=qo.useState(s===0);if(qo.useEffect(()=>{if(s>0){let y=setTimeout(()=>v(true),s);return ()=>clearTimeout(y)}},[s]),!k)return null;let S=n?"bg-gradient-to-r from-[var(--color-skeleton-base)] via-[var(--color-skeleton-highlight)] to-[var(--color-skeleton-base)]":"bg-[var(--color-skeleton-base)]",M=c&&e?(()=>{let y=typeof e=="number"?e:parseFloat(String(e));return isNaN(y)?"":`animation-duration-[${Math.max(.8,y/100)}s]`})():"",N=r==="pulse"?`animate-pulse ${M}`:r==="wave"?`relative overflow-hidden before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-[var(--color-skeleton-wave)] before:to-transparent before:animate-wave ${M}`:"",m="rounded-sm";t==="circle"&&(m="rounded-full"),t==="text"&&(m="h-4 w-full rounded-sm");let C=a?"flex-1 min-w-0":"",R=i?Object.entries(i).map(([y,w])=>`${y}:w-[${w}]`).join(" "):"";return l?jsxRuntime.jsx("div",{className:"space-y-2","data-testid":x,children:l.map((y,w)=>jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(S,N,m,C,R,u),style:{width:y,height:o}},w))}):jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(S,N,m,C,R,u),style:{width:e,height:o},role:"presentation","aria-hidden":!p,"aria-label":p??void 0,"data-testid":x})};var ko={outlined:"bg-background-surface border border-border-default",elevated:"bg-background-surface border-0 shadow-md",filled:"bg-background-muted border-0",ghost:"bg-transparent border-0 shadow-none"},Co="rounded-lg",We={square:"aspect-square",video:"aspect-video",wide:"aspect-[2/1]",auto:""},wo={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between"};function Y({variant:e="outlined",className:o,children:t,isLoading:r=false,layout:n="default"}){return jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("w-full overflow-hidden",ko[e],Co,n==="flex"&&"flex flex-col",o),"data-testid":"card",children:r?jsxRuntime.jsx(B,{width:"100%",height:"100%",className:"rounded-none"}):t})}function it({title:e,subtitle:o,actions:t,className:r,isLoading:n=false}){return n?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx(B,{width:120,height:20}),jsxRuntime.jsx(B,{width:24,height:24})]}),o&&jsxRuntime.jsx(B,{width:200,height:16})]}):!e&&!o&&!t?null:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("p-6 pb-4",r),children:jsxRuntime.jsxs("div",{className:"flex justify-between items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"min-w-0 flex-1",children:[e&&jsxRuntime.jsx("div",{className:"mb-1",children:typeof e=="string"?jsxRuntime.jsx(te,{tag:"h3",size:"sm",className:"text-text-primary",children:e}):e}),o&&jsxRuntime.jsx("div",{className:qe("bodySm","text-text-secondary"),children:o})]}),t&&jsxRuntime.jsx("div",{className:"flex-shrink-0",children:t})]})})}function st({src:e,alt:o,aspectRatio:t="auto",className:r,children:n,isLoading:a=false}){return a?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("bg-background-muted",We[t],r),children:jsxRuntime.jsx(B,{width:"100%",height:"100%"})}):n?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",We[t],r),children:n}):e?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("overflow-hidden",We[t],r),children:jsxRuntime.jsx("img",{src:e,alt:o||"",className:"w-full h-full object-cover",loading:"lazy"})}):null}function lt({className:e,children:o,isLoading:t=false,fill:r=false}){let a=e?.match(/p(?:t|b|l|r|x|y)?-(?:\d+(?:\.\d+)?|px|\[.+?\])/)?"":"px-6 py-4";return t?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge(a,r&&"flex-1 flex flex-col min-h-0",e),children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(B,{width:"100%",height:16}),jsxRuntime.jsx(B,{width:"80%",height:16}),jsxRuntime.jsx(B,{width:"60%",height:16})]})}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 text-text-primary",r&&"flex-1 flex flex-col min-h-0",e),children:o}):null}function dt({className:e,children:o,align:t="end",isLoading:r=false}){return r?jsxRuntime.jsxs("div",{className:tailwindMerge.twMerge("px-6 py-4 flex gap-2 justify-end",e),children:[jsxRuntime.jsx(B,{width:80,height:32}),jsxRuntime.jsx(B,{width:60,height:32})]}):o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("px-6 py-4 flex items-center gap-2",wo[t],e),children:o}):null}Y.Header=it;Y.Media=st;Y.Content=lt;Y.Footer=dt;var z=class extends qo.Component{constructor(){super(...arguments);Me(this,"state",{hasError:false});Me(this,"handleRetry",()=>{this.setState({hasError:false,error:void 0}),typeof window<"u"&&window.location.reload();});}static getDerivedStateFromError(t){return {hasError:true,error:t}}componentDidCatch(t,r){console.error("Error Boundary caught an error:",t,r);}render(){return this.state.hasError?this.props.fallback?this.props.fallback:jsxRuntime.jsxs(Y,{children:[this.props.title&&jsxRuntime.jsx(Y.Header,{title:this.props.title}),jsxRuntime.jsx(Y.Content,{children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center gap-4","data-testid":"error-boundary",children:[jsxRuntime.jsx("p",{className:"text-feedback-error-text",children:this.state.error?.message||"Something went wrong"}),jsxRuntime.jsx("button",{className:"rounded bg-action-default px-4 py-2 text-[color:var(--color-action-default-text)] hover:bg-action-default-hover",onClick:this.handleRetry,children:"Retry"})]})})]}):this.props.children}};function Q({transparent:e=false,className:o,children:t,...r}){return jsxRuntime.jsx(reactAriaComponents.ModalOverlay,{...r,className:reactAriaComponents.composeRenderProps(o,(n,a)=>tailwindMerge.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:t})}var Mo=.3,Lo=.5;function Re({children:e,title:o,headerContent:t,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:l,isOpen:i,onClose:s,isDismissable:c=true,transparentOverlay:p=false,primaryAction:u,secondaryAction:x,footerContent:k,maxHeight:v="80vh",height:S,maxWidth:M="640px",contentPadding:N=true,showHandle:m=true,animationVariant:C="scale",className:R}){let[y,w]=qo.useState(false),[j,L]=qo.useState(0),[W,E]=qo.useState(false),ce=ve(i),G=ce?.height??null,re=ce?.keyboardOffset??0,ue=qo.useRef(null),ne=qo.useRef(null),V=qo.useRef(null),F=qo.useRef({isDragging:false,startY:0,startTime:0,pointerId:null});qo.useEffect(()=>{if(i){let g=setTimeout(()=>{w(true),setTimeout(()=>w(false),600);},400);return ()=>clearTimeout(g)}},[i]),qo.useEffect(()=>{i||(L(0),E(false),F.current={isDragging:false,startY:0,startTime:0,pointerId:null});},[i]),qo.useEffect(()=>{let g=ne.current;if(!g||!i)return;let _=null,ae=me=>{let Z=me.target;Z&&["INPUT","TEXTAREA","SELECT"].includes(Z.tagName)&&(_&&clearTimeout(_),_=setTimeout(()=>{Z.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return g.addEventListener("focusin",ae),()=>{g.removeEventListener("focusin",ae),_&&clearTimeout(_);}},[i]);let J=qo.useCallback(g=>{c&&(g.pointerType!=="touch"&&g.pointerType!=="pen"||(V.current&&(clearTimeout(V.current),V.current=null),F.current={isDragging:true,startY:g.clientY,startTime:Date.now(),pointerId:g.pointerId},E(false),g.currentTarget.setPointerCapture(g.pointerId)));},[c]),K=qo.useCallback(g=>{let{isDragging:_,startY:ae,pointerId:me}=F.current;if(!_||g.pointerId!==me)return;let Z=g.clientY-ae;L(Math.max(0,Z));},[]),pe=qo.useCallback(g=>{let{isDragging:_,startY:ae,startTime:me,pointerId:Z}=F.current;if(!_||g.pointerId!==Z)return;let Be=g.clientY-ae,Rt=Date.now()-me,St=Be/Rt;F.current={isDragging:false,startY:0,startTime:0,pointerId:null};let Tt=(ue.current?.getBoundingClientRect().height??0)*Mo;(Be>Tt||St>Lo&&Be>50)&&c?(s?.(),L(0)):(E(true),L(0),V.current=setTimeout(()=>{E(false),V.current=null;},200));},[c,s]);if(!i)return null;let Ie=o||t,fe=u||x||k;return jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{isOpen:i,onOpenChange:g=>{g||s?.();},isDismissable:c,transparent:p,style:{paddingBottom:re>0?`${re}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center p-0 sm:p-4",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full max-w-full p-0 sm:p-2 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",isDismissable:c,children:jsxRuntime.jsx("div",{ref:ue,className:tailwindMerge.twMerge("w-full",W&&"transition-transform duration-200"),style:{transform:j>0?`translateY(${j}px)`:void 0},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("relative flex w-full flex-col overflow-hidden","bg-background-surface","shadow-2xl shadow-black/30 dark:shadow-black/60","border-t border-x border-border-default/40","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0 focus:shadow-none","origin-bottom",C==="scale"?"animate-[tray-enter-scale_400ms_cubic-bezier(0.32,0.72,0,1)]":"animate-[tray-enter_400ms_cubic-bezier(0.32,0.72,0,1)]",C==="scale"?"data-[exiting]:animate-[tray-exit-scale_250ms_cubic-bezier(0.32,0,0.67,0)]":"data-[exiting]:animate-[tray-exit_250ms_cubic-bezier(0.32,0,0.67,0)]",R),style:{maxWidth:M,...S?{height:S}:{maxHeight:/\d/.test(v)?G!==null?`min(${v}, ${Math.max(G-8,0)}px, 100dvh)`:`min(${v}, 100dvh)`:v}},children:[m&&jsxRuntime.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-10 flex justify-center items-start pt-2 touch-none cursor-grab active:cursor-grabbing",onPointerDown:J,onPointerMove:K,onPointerUp:pe,onPointerCancel:pe,children:jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("h-1 w-12 rounded-full bg-border-muted transition-all duration-300","hover:bg-border-default hover:w-16",y&&"animate-[handle-wiggle_0.6s_ease-in-out]")})}),Ie&&(a?jsxRuntime.jsx(D,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!s,hasBackArrow:true,onBack:l??(()=>{}),onClose:s||(()=>{})}):jsxRuntime.jsx(D,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n||!s,onClose:s||(()=>{})})),jsxRuntime.jsx("div",{ref:ne,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",N?"p-4":"p-0"),children:e}),fe&&jsxRuntime.jsx(X,{primaryAction:u,secondaryAction:x,footerContent:k})]})})})})})}Re.displayName="Tray";function Ue({isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n="left",hideCloseIcon:a=false,hasBackArrow:l=false,onBack:i,children:s,primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:x,transparentOverlay:k=false,maxWidth:v="600px",minWidth:S="400px",maxHeight:M="85vh",height:N,mobileMaxHeight:m="90vh",mobileHeight:C,contentPadding:R=true,className:y}){let w=Ge("(max-width: 767px)"),j=ve(w&&e===void 0),L=j?.height??null,W=j?.keyboardOffset??0,E=qo.useRef(null),ce=qo.useCallback(()=>{E.current&&E.current.scrollTop!==0&&(E.current.scrollTop=0);},[]),G=qo.useRef(null),re=qo.useRef(null);qo.useEffect(()=>{let J=re.current;if(!J||!w)return;let K=null,pe=Ie=>{let fe=Ie.target;fe&&["INPUT","TEXTAREA","SELECT"].includes(fe.tagName)&&(K&&clearTimeout(K),K=setTimeout(()=>{fe.scrollIntoView({block:"nearest",behavior:"smooth"});},320));};return J.addEventListener("focusin",pe),()=>{J.removeEventListener("focusin",pe),K&&clearTimeout(K);}},[w]);let ue=qo.useCallback(()=>{G.current&&G.current.scrollTop!==0&&(G.current.scrollTop=0);},[]);if(e===false)return null;let ne=t||r,V=c||p||u||x,F=e!==void 0;return w?F?jsxRuntime.jsx(Re,{isOpen:e,onClose:o,title:t,headerContent:r,titleAlign:n,hideCloseIcon:a,hasBackArrow:l,onBack:i,primaryAction:c,secondaryAction:p,footerContent:x,transparentOverlay:k,maxHeight:m,height:C,maxWidth:v,contentPadding:R,showHandle:true,animationVariant:"scale",className:y,children:s}):jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{isDismissable:true,transparent:k,style:{paddingBottom:W>0?`${W}px`:void 0,transition:"padding-bottom 0.25s ease-out"},className:"flex items-end justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-0 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:E,onScroll:ce,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border-t border-x border-border-default/40","rounded-t-xl","overflow-hidden","animate-in slide-in-from-bottom","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:slide-out-to-bottom","data-[exiting]:duration-200 data-[exiting]:ease-in",y),style:{...C?{height:C}:{maxHeight:/\d/.test(m)?L!==null?`min(${m}, ${Math.max(L-8,0)}px, 100dvh)`:`min(${m}, 100dvh)`:m}},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-2",children:jsxRuntime.jsx("div",{className:"h-1.5 w-12 rounded-full bg-border-muted"})}),ne&&(l?jsxRuntime.jsx(D,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(D,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,onClose:o||(()=>{})})),jsxRuntime.jsx("div",{ref:re,className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto overscroll-contain",R?"px-6 py-6":"p-0"),children:s}),V&&jsxRuntime.jsx(X,{primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:x})]})})})}):jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{...F?{isOpen:e,onOpenChange:J=>{!J&&o&&o();}}:{},isDismissable:true,transparent:k,className:"flex items-center justify-center",children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"w-full p-4 outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",style:{maxWidth:v},children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{ref:G,onScroll:ue,className:tailwindMerge.twMerge("relative flex w-full flex-col","bg-background-surface","shadow-2xl shadow-black/20","border border-border-default/50","rounded-md","overflow-hidden","outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0","animate-in fade-in zoom-in-96 slide-in-from-bottom-2","duration-300 ease-out","data-[exiting]:animate-out data-[exiting]:fade-out data-[exiting]:zoom-out-95","data-[exiting]:duration-200 data-[exiting]:ease-in",y),style:{minWidth:S,...N?{height:N}:{maxHeight:M}},children:[ne&&(l?jsxRuntime.jsx(D,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,hasBackArrow:true,onBack:i,onClose:o||(()=>{})}):jsxRuntime.jsx(D,{title:t,headerContent:r,titleAlign:n,hideCloseIcon:a||!o,onClose:o||(()=>{})})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 min-h-0 overflow-y-auto",R?"px-6 py-6":"p-0"),children:s}),V&&jsxRuntime.jsx(X,{primaryAction:c,secondaryAction:p,tertiaryAction:u,footerContent:x})]})})})})}function be(e){return jsxRuntime.jsx(reactAriaComponents.Form,{validationBehavior:"aria",...e,className:tailwindMerge.twMerge("flex flex-col gap-6",e.className)})}function Ca({formId:e="dialog-form",onSubmit:o,primaryLabel:t="Save",secondaryLabel:r="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:l="secondary",children:i,title:s,...c}){return jsxRuntime.jsx(Ue,{title:s,primaryAction:{label:t,onPress:()=>{let u=document.getElementById(e);u&&u.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:l}:void 0,...c,children:jsxRuntime.jsx(be,{id:e,onSubmit:o,children:i})})}function Te({children:e,title:o,headerContent:t,titleAlign:r="left",hideCloseIcon:n=false,hasBackArrow:a=false,onBack:l,isOpen:i,slideInFrom:s="right",transparentOverlay:c=false,onClose:p,className:u,primaryAction:x,secondaryAction:k,tertiaryAction:v,footerContent:S,contentPadding:M=true,maxWidth:N="400px"}){if(!i)return null;let m=o||t,C=x||k||v||S;return jsxRuntime.jsx(z,{children:jsxRuntime.jsx(Q,{isOpen:i,onOpenChange:R=>!R&&p?.(),isDismissable:true,transparent:c,children:jsxRuntime.jsx(reactAriaComponents.Modal,{className:"outline-none focus:outline-none focus-visible:outline-none ring-0 focus:ring-0 focus-visible:ring-0",children:jsxRuntime.jsxs(reactAriaComponents.Dialog,{className:tailwindMerge.twMerge("fixed top-0 bottom-0 flex flex-col bg-background-surface shadow-xl overflow-hidden",s==="right"?"right-0":"left-0",s==="right"?"animate-in slide-in-from-right duration-300 ease-out":"animate-in slide-in-from-left duration-300 ease-out","data-[exiting]:animate-out",s==="right"?"data-[exiting]:slide-out-to-right":"data-[exiting]:slide-out-to-left","data-[exiting]:duration-200 data-[exiting]:ease-in","outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-action-default focus-visible:outline-offset-0",u),style:{maxWidth:N,width:"100%"},children:[m&&(a&&l?jsxRuntime.jsx(D,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,hasBackArrow:true,onBack:l,onClose:p}):jsxRuntime.jsx(D,{title:o,headerContent:t,titleAlign:r,hideCloseIcon:n,onClose:p})),jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("flex-1 overflow-y-auto overscroll-contain",M?"px-6 py-6":"p-0"),children:e}),C&&jsxRuntime.jsx(X,{primaryAction:x,secondaryAction:k,tertiaryAction:v,footerContent:S})]})})})})}Te.displayName="Drawer";function za({formId:e="drawer-form",onSubmit:o,primaryLabel:t="Save",secondaryLabel:r="Cancel",onCancel:n,primaryVariant:a,secondaryVariant:l="secondary",children:i,...s}){return jsxRuntime.jsx(Te,{primaryAction:{label:t,onPress:()=>{let p=document.getElementById(e);p&&p.requestSubmit();},variant:a},secondaryAction:n?{label:r,onPress:n,variant:l}:void 0,...s,children:jsxRuntime.jsx(be,{id:e,onSubmit:o,className:"mt-2",children:i})})}function _a({align:e="end",className:o,...t}){return jsxRuntime.jsx("div",{...t,className:tailwindMerge.twMerge("flex gap-2",e==="start"?"justify-start":e==="between"?"justify-between":"justify-end",o)})}var Uo={sm:"gap-2",md:"gap-4",lg:"gap-6"};function jo(e){if(!e)return "";let o=e.base?`grid-cols-${e.base}`:"",t=e.md?`md:grid-cols-${e.md}`:"",r=e.lg?`lg:grid-cols-${e.lg}`:"";return [o,t,r].filter(Boolean).join(" ")}function ja({cols:e={base:1},gap:o="lg",className:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("grid",jo(e),Uo[o],t)})}var Xo=qo__namespace.default.forwardRef(({children:e,className:o},t)=>jsxRuntime.jsx("div",{ref:t,className:tailwindMerge.twMerge("relative w-full",o),children:e}));Xo.displayName="InputWrapper";function vt({size:e="md",className:o,children:t,...r}){return jsxRuntime.jsx("div",{...r,className:tailwindMerge.twMerge("leading-[2.25] text-text-secondary",ee[e].text,o),children:t})}function ni({title:e,description:o,showDivider:t,className:r,children:n,...a}){return jsxRuntime.jsxs("section",{...a,className:tailwindMerge.twMerge("flex flex-col",r),children:[(e||o)&&jsxRuntime.jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[typeof e=="string"?jsxRuntime.jsx(te,{tag:"h3",size:"sm",children:e}):e,o?jsxRuntime.jsx(vt,{size:"lg",children:o}):null]}),jsxRuntime.jsx("div",{className:"flex flex-col gap-6",children:n}),t&&jsxRuntime.jsx("hr",{className:"mt-2 border-border-muted"})]})}function ai(){return jsxRuntime.jsx("hr",{className:"border-border-muted"})}function ci({steps:e,currentStepId:o,onStepClick:t,className:r}){let n=e.findIndex(a=>a.id===o);return jsxRuntime.jsx("nav",{"aria-label":"Progress",className:tailwindMerge.twMerge("w-full",r),children:jsxRuntime.jsx("div",{className:"relative mb-12",children:jsxRuntime.jsx("ol",{className:"relative flex items-start justify-between",children:e.map((a,l)=>{let i=a.id===o,s=l<n,c=t&&(s||i);return jsxRuntime.jsxs("li",{className:"relative flex flex-col items-center",style:{flex:`1 1 ${100/e.length}%`},children:[jsxRuntime.jsx("button",{type:"button",disabled:!c,onClick:()=>c&&t?.(a.id),className:tailwindMerge.twMerge("relative z-10 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors bg-background-body",s&&"border-action-primary bg-action-primary text-text-inverse hover:bg-action-primary/90",i&&"border-action-primary bg-background-body text-action-primary",!s&&!i&&"border-border-default bg-background-body text-text-secondary",c&&"cursor-pointer",!c&&"cursor-default"),"aria-current":i?"step":void 0,children:s?jsxRuntime.jsx(I,{name:"Check",size:20,weight:"bold"}):jsxRuntime.jsx("span",{className:"text-sm font-semibold",children:l+1})}),l<e.length-1&&jsxRuntime.jsx("div",{className:"absolute top-5 h-0.5 transition-colors",style:{left:"50%",width:"100%",marginLeft:"20px",backgroundColor:l<n?"var(--color-action-primary)":"var(--color-border-default)"}}),jsxRuntime.jsxs("div",{className:"mt-3 flex flex-col items-center text-center w-32",children:[jsxRuntime.jsx("span",{className:tailwindMerge.twMerge("text-sm font-medium",i&&"text-text-default",s&&"text-text-primary",!i&&!s&&"text-text-secondary"),children:a.title}),a.description&&jsxRuntime.jsx("span",{className:"mt-1 text-xs text-text-secondary",children:a.description})]})]},a.id)})})})})}function gi({formId:e,show:o,isSubmitting:t,onCancel:r,primaryLabel:n="Save changes",secondaryLabel:a="Cancel",className:l}){return o?jsxRuntime.jsx("div",{className:tailwindMerge.twMerge("fixed inset-x-0 bottom-0 z-40 border-t border-border-muted bg-background-surface/95 backdrop-blur supports-[backdrop-filter]:bg-background-surface/70",l),children:jsxRuntime.jsxs("div",{className:"mx-auto flex max-w-screen-lg items-center justify-between gap-3 p-3",children:[jsxRuntime.jsx("div",{className:"text-sm text-text-secondary",children:"You have unsaved changes"}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[jsxRuntime.jsx($,{variant:"secondary",onPress:r,children:a}),jsxRuntime.jsx($,{type:"submit",form:e,isDisabled:!!t,children:t?"Saving...":n})]})]})}):null}function xi({when:e,message:o="You have unsaved changes. Leave anyway?"}){return qo__namespace.useEffect(()=>{if(!e)return;let t=r=>(r.preventDefault(),r.returnValue=o,o);return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[e,o]),null}function yi({steps:e,initialStepId:o,canNavigate:t}){if(e.length===0)throw new Error("useWizard: steps array cannot be empty");let[r,n]=qo__namespace.useState(o||e[0].id),a=e.findIndex(u=>u.id===r),l=a>0,i=a<e.length-1,s=async u=>u===r?true:t&&!await t(r,u)?false:(n(u),true);return {steps:e,currentStepId:r,setCurrentStepId:s,next:async()=>!i||a===-1?false:s(e[a+1].id),prev:async()=>!l||a===-1?false:s(e[a-1].id),hasNext:i,hasPrev:l,stepIndex:a}}
2
+ exports.DialogForm=Ca;exports.DrawerForm=za;exports.FormActions=_a;exports.FormDivider=ai;exports.FormGrid=ja;exports.FormSection=ni;exports.FormStepper=ci;exports.SaveBar=gi;exports.UnsavedChangesPrompt=xi;exports.useWizard=yi;//# sourceMappingURL=index.cjs.map
3
3
  //# sourceMappingURL=index.cjs.map