@editora/ui-react 0.1.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.
- package/README.md +268 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.esm.js +4051 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# @editora/ui-react
|
|
2
|
+
|
|
3
|
+
React wrappers for `@editora/ui-core` Web Components.
|
|
4
|
+
|
|
5
|
+
This package gives React-friendly props, typed callback details, and hooks/providers for form and dialog workflows.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @editora/ui-react @editora/ui-core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Peer dependencies:
|
|
14
|
+
- `react`
|
|
15
|
+
- `react-dom`
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
Import from package root. This also registers all custom elements (`import '@editora/ui-core'`) internally.
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { Button, Input, ThemeProvider } from '@editora/ui-react';
|
|
23
|
+
|
|
24
|
+
export function App() {
|
|
25
|
+
return (
|
|
26
|
+
<ThemeProvider>
|
|
27
|
+
<div style={{ display: 'grid', gap: 12, maxWidth: 360 }}>
|
|
28
|
+
<Input name="title" label="Title" placeholder="Untitled" clearable />
|
|
29
|
+
<Button variant="primary">Save</Button>
|
|
30
|
+
</div>
|
|
31
|
+
</ThemeProvider>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Important Import Rule
|
|
37
|
+
|
|
38
|
+
Recommended:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { Button, DataTable } from '@editora/ui-react';
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If you deep-import wrappers directly (not recommended), ensure custom elements are registered:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import '@editora/ui-core';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Common Usage Examples
|
|
51
|
+
|
|
52
|
+
### 1. Form + `useForm`
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { Form, Field, Input, Button, useForm } from '@editora/ui-react';
|
|
56
|
+
|
|
57
|
+
export function ProfileForm() {
|
|
58
|
+
const { ref, submit, validate, getValues, reset, isDirty } = useForm();
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Form
|
|
62
|
+
ref={ref}
|
|
63
|
+
autosave
|
|
64
|
+
guardUnsaved
|
|
65
|
+
onSubmit={(values) => console.log('submit', values)}
|
|
66
|
+
onInvalid={(errors) => console.log('invalid', errors)}
|
|
67
|
+
style={{ display: 'grid', gap: 12, maxWidth: 520 }}
|
|
68
|
+
>
|
|
69
|
+
<Field label="Full name" required>
|
|
70
|
+
<Input name="fullName" required />
|
|
71
|
+
</Field>
|
|
72
|
+
|
|
73
|
+
<Field label="Email" required>
|
|
74
|
+
<Input name="email" type="email" required />
|
|
75
|
+
</Field>
|
|
76
|
+
|
|
77
|
+
<div style={{ display: 'flex', gap: 8 }}>
|
|
78
|
+
<Button variant="secondary" onClick={() => validate()}>Validate</Button>
|
|
79
|
+
<Button variant="secondary" onClick={() => console.log(getValues())}>Values</Button>
|
|
80
|
+
<Button variant="secondary" onClick={() => reset()}>Reset</Button>
|
|
81
|
+
<Button onClick={() => submit()} disabled={!isDirty()}>Submit</Button>
|
|
82
|
+
</div>
|
|
83
|
+
</Form>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 2. Promise dialogs with provider hooks
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import { DialogProvider, useDialog, AlertDialogProvider, useAlertDialog, Button } from '@editora/ui-react';
|
|
92
|
+
|
|
93
|
+
function Actions() {
|
|
94
|
+
const dialog = useDialog();
|
|
95
|
+
const alerts = useAlertDialog();
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<div style={{ display: 'flex', gap: 8 }}>
|
|
99
|
+
<Button
|
|
100
|
+
onClick={async () => {
|
|
101
|
+
const res = await dialog.confirm({
|
|
102
|
+
title: 'Archive project?',
|
|
103
|
+
description: 'You can restore it later.',
|
|
104
|
+
submitText: 'Archive'
|
|
105
|
+
});
|
|
106
|
+
console.log(res);
|
|
107
|
+
}}
|
|
108
|
+
>
|
|
109
|
+
Confirm
|
|
110
|
+
</Button>
|
|
111
|
+
|
|
112
|
+
<Button
|
|
113
|
+
variant="secondary"
|
|
114
|
+
onClick={async () => {
|
|
115
|
+
const res = await alerts.prompt({
|
|
116
|
+
title: 'Rename',
|
|
117
|
+
input: { required: true, placeholder: 'New name' }
|
|
118
|
+
});
|
|
119
|
+
console.log(res);
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
Prompt
|
|
123
|
+
</Button>
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function DialogExample() {
|
|
129
|
+
return (
|
|
130
|
+
<DialogProvider>
|
|
131
|
+
<AlertDialogProvider>
|
|
132
|
+
<Actions />
|
|
133
|
+
</AlertDialogProvider>
|
|
134
|
+
</DialogProvider>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 3. Data table (sorting, selection, paging, filters)
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
import { DataTable, Pagination } from '@editora/ui-react';
|
|
143
|
+
import { useState } from 'react';
|
|
144
|
+
|
|
145
|
+
export function UsersTable() {
|
|
146
|
+
const [page, setPage] = useState(1);
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<div style={{ display: 'grid', gap: 10 }}>
|
|
150
|
+
<DataTable
|
|
151
|
+
sortable
|
|
152
|
+
selectable
|
|
153
|
+
resizableColumns
|
|
154
|
+
draggableColumns
|
|
155
|
+
page={page}
|
|
156
|
+
pageSize={10}
|
|
157
|
+
paginationId="users-pager"
|
|
158
|
+
onPageChange={(d) => setPage(d.page)}
|
|
159
|
+
onSortChange={(d) => console.log('sort', d)}
|
|
160
|
+
onRowSelect={(d) => console.log('rows', d.indices)}
|
|
161
|
+
>
|
|
162
|
+
<table>
|
|
163
|
+
<thead>
|
|
164
|
+
<tr>
|
|
165
|
+
<th data-key="id">ID</th>
|
|
166
|
+
<th data-key="name">Name</th>
|
|
167
|
+
<th data-key="role">Role</th>
|
|
168
|
+
</tr>
|
|
169
|
+
</thead>
|
|
170
|
+
<tbody>
|
|
171
|
+
<tr><td>1</td><td>Asha</td><td>Admin</td></tr>
|
|
172
|
+
<tr><td>2</td><td>Marco</td><td>Editor</td></tr>
|
|
173
|
+
</tbody>
|
|
174
|
+
</table>
|
|
175
|
+
</DataTable>
|
|
176
|
+
|
|
177
|
+
<Pagination id="users-pager" page={String(page)} />
|
|
178
|
+
</div>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### 4. Date/time and color pickers
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
import { DatePicker, DateRangePicker, DateTimePicker, ColorPicker } from '@editora/ui-react';
|
|
187
|
+
|
|
188
|
+
export function PickersDemo() {
|
|
189
|
+
return (
|
|
190
|
+
<div style={{ display: 'grid', gap: 12, maxWidth: 420 }}>
|
|
191
|
+
<DatePicker label="Start date" clearable onValueChange={(v) => console.log(v)} />
|
|
192
|
+
<DateRangePicker label="Window" closeOnSelect />
|
|
193
|
+
<DateTimePicker label="Publish at" />
|
|
194
|
+
<ColorPicker mode="popover" format="hex" alpha presets={['#2563eb', '#16a34a', '#dc2626']} />
|
|
195
|
+
</div>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Theming
|
|
201
|
+
|
|
202
|
+
`ThemeProvider` applies `@editora/ui-core` token variables and supports persistence.
|
|
203
|
+
|
|
204
|
+
```tsx
|
|
205
|
+
import { ThemeProvider } from '@editora/ui-react';
|
|
206
|
+
|
|
207
|
+
<ThemeProvider
|
|
208
|
+
tokens={{
|
|
209
|
+
colors: { primary: '#0f766e', text: '#0f172a', background: '#ffffff' },
|
|
210
|
+
radius: '10px'
|
|
211
|
+
}}
|
|
212
|
+
storageKey="my-app.theme"
|
|
213
|
+
>
|
|
214
|
+
{/** app */}
|
|
215
|
+
</ThemeProvider>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Component Catalog
|
|
219
|
+
|
|
220
|
+
### Form and inputs
|
|
221
|
+
- `Form`, `Field`, `Label`, `Input`, `Textarea`, `Select`, `Combobox`
|
|
222
|
+
- `Checkbox`, `RadioGroup`, `Switch`, `Slider`
|
|
223
|
+
- `DatePicker`, `DateRangePicker`, `TimePicker`, `DateTimePicker`, `DateRangeTimePicker`
|
|
224
|
+
- `ColorPicker`
|
|
225
|
+
|
|
226
|
+
### Data and display
|
|
227
|
+
- `Table`, `DataTable`, `Pagination`
|
|
228
|
+
- `Calendar`, `Chart`, `Timeline`, `Gantt`
|
|
229
|
+
- `Badge`, `Alert`, `Skeleton`, `EmptyState`, `Progress`, `Avatar`, `AspectRatio`
|
|
230
|
+
|
|
231
|
+
### Overlay and interaction
|
|
232
|
+
- `Tooltip`, `HoverCard`, `Popover`, `Dropdown`, `Menu`, `Menubar`, `ContextMenu`
|
|
233
|
+
- `Dialog`, `AlertDialog`, `Drawer`, `Portal`, `Presence`
|
|
234
|
+
- `CommandPalette`, `QuickActions`, `Toolbar`, `FloatingToolbar`, `BlockControls`, `SelectionPopup`, `PluginPanel`
|
|
235
|
+
|
|
236
|
+
### Navigation and layout
|
|
237
|
+
- `Layout`, `Sidebar`, `AppHeader`, `Breadcrumb`, `NavigationMenu`, `Tabs`
|
|
238
|
+
- `Box`, `Flex`, `Grid`, `Section`, `Container`, `Separator`, `Slot`, `VisuallyHidden`
|
|
239
|
+
- `Accordion`, `Collapsible`, `Stepper`, `Wizard`, `DirectionProvider`
|
|
240
|
+
|
|
241
|
+
### APIs and hooks
|
|
242
|
+
- `DialogProvider`, `useDialog`
|
|
243
|
+
- `AlertDialogProvider`, `useAlertDialog`
|
|
244
|
+
- `ThemeProvider`, `useTheme`
|
|
245
|
+
- `useForm`, `useFloating`
|
|
246
|
+
|
|
247
|
+
## SSR and StrictMode Notes
|
|
248
|
+
|
|
249
|
+
- Providers are SSR-safe (they create hosts in `useEffect` on client).
|
|
250
|
+
- Promise dialog providers are StrictMode-safe and handle unmount cleanup.
|
|
251
|
+
- For server render, avoid accessing custom element methods until mounted.
|
|
252
|
+
|
|
253
|
+
## Development
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
cd packages/ui-react
|
|
257
|
+
npm run build
|
|
258
|
+
npm run dev:examples
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Examples live under `packages/ui-react/examples`.
|
|
262
|
+
|
|
263
|
+
## Troubleshooting
|
|
264
|
+
|
|
265
|
+
- Warning: `tagName is not registered`
|
|
266
|
+
- Import wrappers from package root (`@editora/ui-react`), or import `@editora/ui-core` manually before rendering wrappers.
|
|
267
|
+
- Event callback not firing as expected
|
|
268
|
+
- For wrapper callbacks like `onChange`, use the typed `detail` payload from wrapper props (not raw DOM event parsing).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),V=require("@editora/ui-core");function Rt(w){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(w){for(const r in w)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(w,r);Object.defineProperty(f,r,s.get?s:{enumerable:!0,get:()=>w[r]})}}return f.default=w,Object.freeze(f)}const K=Rt(e);function Ht(w){const{children:f,onClick:r,variant:s,size:n,icon:c,loading:m,block:l,headless:i,disabled:d,animation:v,theme:u,...y}=w,p=e.useRef(null),g=typeof window<"u"?e.useLayoutEffect:e.useEffect;e.useEffect(()=>{const b=p.current;if(!b)return;const E=t=>r&&r(t);return r&&b.addEventListener("click",E),()=>{r&&b.removeEventListener("click",E)}},[r]),g(()=>{const b=p.current;b&&(s?b.setAttribute("variant",s):b.removeAttribute("variant"),n?b.setAttribute("size",n):b.removeAttribute("size"),c?b.setAttribute("icon",c):b.removeAttribute("icon"),m?b.setAttribute("loading",""):b.removeAttribute("loading"),l?b.setAttribute("block",""):b.removeAttribute("block"),i?b.setAttribute("headless",""):b.removeAttribute("headless"),d?b.setAttribute("disabled",""):b.removeAttribute("disabled"),v?b.setAttribute("animation",v):b.removeAttribute("animation"),u&&u!=="default"?b.setAttribute("theme",u):b.removeAttribute("theme"))},[s,n,c,m,l,i,d,v,u]);const A={ref:p,...y,variant:s,size:n,icon:c,animation:v,theme:u&&u!=="default"?u:void 0,loading:m?"":void 0,block:l?"":void 0,headless:i?"":void 0,disabled:d?"":void 0};return e.createElement("ui-button",A,f)}const de=e.forwardRef(function({children:f,text:r,placement:s,open:n,disabled:c,headless:m,variant:l,size:i,tone:d,delay:v,closeDelay:u,trigger:y,offset:p,interactive:g,arrow:A,onOpen:b,onClose:E,onOpenChange:t,...o},h){const L=e.useRef(null);return e.useImperativeHandle(h,()=>L.current),e.useEffect(()=>{const H=L.current;if(!H)return;const a=()=>{b==null||b()},k=()=>{E==null||E()},R=P=>{const F=P.detail;F&&typeof F.open=="boolean"&&(t==null||t(F.open))};return H.addEventListener("open",a),H.addEventListener("close",k),H.addEventListener("change",R),()=>{H.removeEventListener("open",a),H.removeEventListener("close",k),H.removeEventListener("change",R)}},[b,E,t]),e.useEffect(()=>{const H=L.current;if(!H)return;const a=(R,P)=>{const F=H.getAttribute(R);if(P==null){F!=null&&H.removeAttribute(R);return}F!==P&&H.setAttribute(R,P)},k=(R,P)=>{P?a(R,""):a(R,null)};a("text",r||null),a("placement",s||null),k("open",n),k("disabled",c),k("headless",m),a("variant",l&&l!=="default"?l:null),a("size",i&&i!=="md"?i:null),a("tone",d&&d!=="default"?d:null),a("delay",typeof v=="number"&&Number.isFinite(v)?String(v):null),a("close-delay",typeof u=="number"&&Number.isFinite(u)?String(u):null),a("trigger",y||null),a("offset",typeof p=="number"&&Number.isFinite(p)?String(p):null),k("interactive",g),typeof A=="boolean"?a("arrow",A?"true":"false"):a("arrow",null)},[r,s,n,c,m,l,i,d,v,u,y,p,g,A]),e.createElement("ui-tooltip",{ref:L,...o},f)});de.displayName="Tooltip";function Nt(w){const{title:f,description:r,tone:s,variant:n,layout:c,dismissible:m,open:l,headless:i,onClose:d,children:v,...u}=w,y=e.useRef(null);return e.useEffect(()=>{const p=y.current;if(!p)return;const g=()=>d==null?void 0:d();return p.addEventListener("close",g),()=>p.removeEventListener("close",g)},[d]),e.useEffect(()=>{const p=y.current;p&&(f?p.setAttribute("title",f):p.removeAttribute("title"),r?p.setAttribute("description",r):p.removeAttribute("description"),s?p.setAttribute("tone",s):p.removeAttribute("tone"),n?p.setAttribute("variant",n):p.removeAttribute("variant"),c?p.setAttribute("layout",c):p.removeAttribute("layout"),m?p.setAttribute("dismissible",""):p.removeAttribute("dismissible"),i?p.setAttribute("headless",""):p.removeAttribute("headless"),typeof l=="boolean"&&(l?p.removeAttribute("hidden"):p.setAttribute("hidden","")))},[f,r,s,n,c,m,l,i]),e.createElement("ui-alert",{ref:y,...u},v)}const be=e.forwardRef(function({children:f,open:r,placement:s,variant:n,density:c,shape:m,elevation:l,tone:i,closeOnSelect:d,typeahead:v,onOpen:u,onClose:y,onChange:p,onSelect:g,...A},b){const E=e.useRef(null);return e.useImperativeHandle(b,()=>E.current),e.useEffect(()=>{const t=E.current;if(!t)return;const o=()=>u==null?void 0:u(),h=()=>y==null?void 0:y(),L=a=>{var R;const k=(R=a.detail)==null?void 0:R.open;typeof k=="boolean"&&(p==null||p(k))},H=a=>{g==null||g(a.detail||{})};return t.addEventListener("open",o),t.addEventListener("close",h),t.addEventListener("change",L),t.addEventListener("select",H),()=>{t.removeEventListener("open",o),t.removeEventListener("close",h),t.removeEventListener("change",L),t.removeEventListener("select",H)}},[u,y,p,g]),e.useEffect(()=>{const t=E.current;!t||r==null||(r?t.setAttribute("open",""):t.removeAttribute("open"))},[r]),e.useEffect(()=>{const t=E.current;t&&(s?t.setAttribute("placement",s):t.removeAttribute("placement"))},[s]),e.useEffect(()=>{const t=E.current;t&&(n&&n!=="default"?t.setAttribute("variant",n):t.removeAttribute("variant"))},[n]),e.useEffect(()=>{const t=E.current;t&&(c&&c!=="default"?t.setAttribute("density",c):t.removeAttribute("density"))},[c]),e.useEffect(()=>{const t=E.current;t&&(m&&m!=="default"?t.setAttribute("shape",m):t.removeAttribute("shape"))},[m]),e.useEffect(()=>{const t=E.current;t&&(l&&l!=="default"?t.setAttribute("elevation",l):t.removeAttribute("elevation"))},[l]),e.useEffect(()=>{const t=E.current;t&&(i&&i!=="default"&&i!=="brand"?t.setAttribute("tone",i):t.removeAttribute("tone"))},[i]),e.useEffect(()=>{const t=E.current;if(t){if(d==null){t.removeAttribute("close-on-select");return}t.setAttribute("close-on-select",d?"true":"false")}},[d]),e.useEffect(()=>{const t=E.current;if(t){if(v==null){t.removeAttribute("typeahead");return}t.setAttribute("typeahead",v?"true":"false")}},[v]),e.createElement("ui-dropdown",{ref:E,...A},f)});be.displayName="Dropdown";const me=e.forwardRef(function(f,r){const{value:s,onChange:n,onInput:c,onDebouncedInput:m,onClear:l,clearable:i,debounce:d,validation:v,size:u,minlength:y,maxlength:p,readOnly:g,autofocus:A,disabled:b,counter:E,floatingLabel:t,type:o,name:h,required:L,pattern:H,inputMode:a,autoComplete:k,min:R,max:P,step:F,spellCheck:B,placeholder:T,headless:N,variant:I,tone:S,density:x,shape:D,color:q,radius:$,label:j,description:_,children:G,...Q}=f,M=e.useRef(null);return e.useImperativeHandle(r,()=>M.current),e.useEffect(()=>{const J=M.current;if(!J)return;const Z=C=>{const z=C.detail;typeof(z==null?void 0:z.value)=="string"&&(c==null||c(z.value))},Y=C=>{const z=C.detail;typeof(z==null?void 0:z.value)=="string"&&(n==null||n(z.value))},re=C=>{const z=C.detail;typeof(z==null?void 0:z.value)=="string"&&(m==null||m(z.value))},ie=()=>{l==null||l()};return J.addEventListener("input",Z),J.addEventListener("change",Y),J.addEventListener("debounced-input",re),J.addEventListener("clear",ie),()=>{J.removeEventListener("input",Z),J.removeEventListener("change",Y),J.removeEventListener("debounced-input",re),J.removeEventListener("clear",ie)}},[n,c,m,l]),e.useEffect(()=>{const J=M.current;J&&(i?J.setAttribute("clearable",""):J.removeAttribute("clearable"),typeof d=="number"&&Number.isFinite(d)?J.setAttribute("debounce",String(d)):J.removeAttribute("debounce"),v&&v!=="none"?J.setAttribute("validation",v):J.removeAttribute("validation"),u&&u!=="md"&&u!=="2"?J.setAttribute("size",String(u)):J.removeAttribute("size"),typeof y=="number"?J.setAttribute("minlength",String(y)):J.removeAttribute("minlength"),typeof p=="number"?J.setAttribute("maxlength",String(p)):J.removeAttribute("maxlength"),g?J.setAttribute("readonly",""):J.removeAttribute("readonly"),A?J.setAttribute("autofocus",""):J.removeAttribute("autofocus"),b?J.setAttribute("disabled",""):J.removeAttribute("disabled"),E?J.setAttribute("counter",""):J.removeAttribute("counter"),t?J.setAttribute("floating-label",""):J.removeAttribute("floating-label"),o?J.setAttribute("type",o):J.removeAttribute("type"),h?J.setAttribute("name",h):J.removeAttribute("name"),L?J.setAttribute("required",""):J.removeAttribute("required"),H?J.setAttribute("pattern",H):J.removeAttribute("pattern"),a?J.setAttribute("inputmode",a):J.removeAttribute("inputmode"),k?J.setAttribute("autocomplete",k):J.removeAttribute("autocomplete"),R!=null&&R!==""?J.setAttribute("min",String(R)):J.removeAttribute("min"),P!=null&&P!==""?J.setAttribute("max",String(P)):J.removeAttribute("max"),F!=null&&F!==""?J.setAttribute("step",String(F)):J.removeAttribute("step"),typeof B=="boolean"?J.setAttribute("spellcheck",B?"true":"false"):J.removeAttribute("spellcheck"),T?J.setAttribute("placeholder",T):J.removeAttribute("placeholder"),N?J.setAttribute("headless",""):J.removeAttribute("headless"),I&&I!=="classic"?J.setAttribute("variant",I):J.removeAttribute("variant"),S&&S!=="default"?J.setAttribute("tone",S):J.removeAttribute("tone"),x&&x!=="default"?J.setAttribute("density",x):J.removeAttribute("density"),D&&D!=="default"?J.setAttribute("shape",D):J.removeAttribute("shape"),q?J.setAttribute("color",q):J.removeAttribute("color"),$?J.setAttribute("radius",String($)):J.removeAttribute("radius"),j?J.setAttribute("label",j):J.removeAttribute("label"),_?J.setAttribute("description",_):J.removeAttribute("description"))},[i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R,P,F,B,T,N,I,S,x,D,q,$,j,_]),e.createElement("ui-input",{ref:M,value:s??void 0,...Q},G)});me.displayName="Input";const ve=e.forwardRef(function({value:f,onChange:r,onInput:s,onDebouncedInput:n,onClear:c,clearable:m,debounce:l,validation:i,size:d,minlength:v,maxlength:u,rows:y,readOnly:p,autofocus:g,disabled:A,name:b,required:E,placeholder:t,resize:o,variant:h,color:L,radius:H,label:a,description:k,autosize:R,maxRows:P,showCount:F,density:B,tone:T,headless:N,children:I,...S},x){const D=e.useRef(null);return e.useImperativeHandle(x,()=>D.current),e.useEffect(()=>{const q=D.current;if(!q)return;const $=Q=>{const M=Q.detail;M&&(s==null||s(M.value))},j=Q=>{const M=Q.detail;M&&(r==null||r(M.value))},_=Q=>{const M=Q.detail;M&&(n==null||n(M.value))},G=()=>c==null?void 0:c();return q.addEventListener("input",$),q.addEventListener("change",j),q.addEventListener("debounced-input",_),q.addEventListener("clear",G),()=>{q.removeEventListener("input",$),q.removeEventListener("change",j),q.removeEventListener("debounced-input",_),q.removeEventListener("clear",G)}},[r,s,n,c]),e.useEffect(()=>{const q=D.current;if(!q)return;const $=(_,G)=>{const Q=q.getAttribute(_);if(G==null){Q!=null&&q.removeAttribute(_);return}Q!==G&&q.setAttribute(_,G)},j=(_,G)=>{G?$(_,""):$(_,null)};$("value",f!=null?String(f):null),j("clearable",m),j("readonly",p),j("autofocus",g),j("disabled",A),j("required",E),j("autosize",R),j("show-count",F),j("headless",N),$("debounce",typeof l=="number"&&Number.isFinite(l)?String(l):null),$("validation",i&&i!=="none"?i:null),$("size",d&&d!=="md"&&d!=="2"?String(d):null),$("minlength",typeof v=="number"?String(v):null),$("maxlength",typeof u=="number"?String(u):null),$("rows",typeof y=="number"?String(y):null),$("name",b||null),$("placeholder",t||null),$("resize",o||null),$("variant",h&&h!=="classic"?h:null),$("color",L||null),$("radius",H?String(H):null),$("label",a||null),$("description",k||null),$("max-rows",typeof P=="number"?String(P):null),$("density",B&&B!=="default"?B:null),$("tone",T&&T!=="brand"?T:null)},[f,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R,P,F,B,T,N]),e.createElement("ui-textarea",{ref:D,...S},I)});ve.displayName="Textarea";function kt(w){const{children:f,label:r,description:s,error:n,htmlFor:c,required:m,invalid:l,orientation:i,variant:d,tone:v,density:u,shape:y,labelWidth:p,headless:g,...A}=w,b=e.useRef(null);return e.useEffect(()=>{const E=b.current;E&&(r!=null&&r!==""?E.setAttribute("label",r):E.removeAttribute("label"),s!=null&&s!==""?E.setAttribute("description",s):E.removeAttribute("description"),n!=null&&n!==""?E.setAttribute("error",n):E.removeAttribute("error"),c?E.setAttribute("for",c):E.removeAttribute("for"),m?E.setAttribute("required",""):E.removeAttribute("required"),l?E.setAttribute("invalid",""):E.removeAttribute("invalid"),i&&i!=="vertical"?E.setAttribute("orientation",i):E.removeAttribute("orientation"),d&&d!=="default"?E.setAttribute("variant",d):E.removeAttribute("variant"),v&&v!=="default"?E.setAttribute("tone",v):E.removeAttribute("tone"),u&&u!=="default"?E.setAttribute("density",u):E.removeAttribute("density"),y&&y!=="default"?E.setAttribute("shape",y):E.removeAttribute("shape"),p?E.setAttribute("label-width",p):E.removeAttribute("label-width"),g?E.setAttribute("headless",""):E.removeAttribute("headless"))},[r,s,n,c,m,l,i,d,v,u,y,p,g]),e.createElement("ui-field",{ref:b,...A},f)}function Pt(w){const{value:f,onChange:r,onInput:s,onDebouncedInput:n,onSelect:c,onOpen:m,onClose:l,onClear:i,clearable:d,debounce:v,validation:u,size:y,maxlength:p,readOnly:g,autofocus:A,disabled:b,name:E,required:t,placeholder:o,variant:h,radius:L,label:H,description:a,emptyText:k,noFilter:R,allowCustom:P,children:F,...B}=w,T=e.useRef(null);return e.useEffect(()=>{const N=T.current;if(!N)return;const I=_=>{var Q;const G=(Q=_.detail)==null?void 0:Q.query;typeof G=="string"&&(s==null||s(G))},S=_=>{var Q;const G=(Q=_.detail)==null?void 0:Q.value;typeof G=="string"&&(r==null||r(G))},x=_=>{var Q;const G=(Q=_.detail)==null?void 0:Q.query;typeof G=="string"&&(n==null||n(G))},D=_=>{const G=_.detail;typeof(G==null?void 0:G.value)=="string"&&(c==null||c(G.value,G.label||G.value))},q=()=>m==null?void 0:m(),$=()=>l==null?void 0:l(),j=()=>i==null?void 0:i();return N.addEventListener("input",I),N.addEventListener("change",S),N.addEventListener("debounced-input",x),N.addEventListener("select",D),N.addEventListener("open",q),N.addEventListener("close",$),N.addEventListener("clear",j),()=>{N.removeEventListener("input",I),N.removeEventListener("change",S),N.removeEventListener("debounced-input",x),N.removeEventListener("select",D),N.removeEventListener("open",q),N.removeEventListener("close",$),N.removeEventListener("clear",j)}},[r,s,n,c,m,l,i]),e.useEffect(()=>{const N=T.current;N&&(d?N.setAttribute("clearable",""):N.removeAttribute("clearable"),typeof v=="number"&&Number.isFinite(v)?N.setAttribute("debounce",String(v)):N.removeAttribute("debounce"),u&&u!=="none"?N.setAttribute("validation",u):N.removeAttribute("validation"),y&&y!=="md"&&y!=="2"?N.setAttribute("size",String(y)):N.removeAttribute("size"),typeof p=="number"?N.setAttribute("maxlength",String(p)):N.removeAttribute("maxlength"),g?N.setAttribute("readonly",""):N.removeAttribute("readonly"),A?N.setAttribute("autofocus",""):N.removeAttribute("autofocus"),b?N.setAttribute("disabled",""):N.removeAttribute("disabled"),E?N.setAttribute("name",E):N.removeAttribute("name"),t?N.setAttribute("required",""):N.removeAttribute("required"),o?N.setAttribute("placeholder",o):N.removeAttribute("placeholder"),h?N.setAttribute("variant",h):N.removeAttribute("variant"),L?N.setAttribute("radius",String(L)):N.removeAttribute("radius"),H?N.setAttribute("label",H):N.removeAttribute("label"),a?N.setAttribute("description",a):N.removeAttribute("description"),k?N.setAttribute("empty-text",k):N.removeAttribute("empty-text"),R?N.setAttribute("no-filter",""):N.removeAttribute("no-filter"),P?N.setAttribute("allow-custom",""):N.removeAttribute("allow-custom"))},[d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R,P]),e.createElement("ui-combobox",{ref:T,value:f,...B},F)}function St(w){const{text:f,tone:r,variant:s,size:n,radius:c,pill:m,dot:l,removable:i,autoRemove:d,iconOnly:v,disabled:u,onRemove:y,children:p,...g}=w,A=e.useRef(null);return e.useEffect(()=>{const b=A.current;if(!b)return;const E=()=>y==null?void 0:y();return b.addEventListener("remove",E),()=>b.removeEventListener("remove",E)},[y]),e.useEffect(()=>{const b=A.current;b&&(f?b.setAttribute("text",f):b.removeAttribute("text"),r?b.setAttribute("tone",r):b.removeAttribute("tone"),s?b.setAttribute("variant",s):b.removeAttribute("variant"),n&&n!=="md"&&n!=="2"?b.setAttribute("size",n):b.removeAttribute("size"),c?b.setAttribute("radius",String(c)):b.removeAttribute("radius"),m?b.setAttribute("pill",""):b.removeAttribute("pill"),l?b.setAttribute("dot",""):b.removeAttribute("dot"),i?b.setAttribute("removable",""):b.removeAttribute("removable"),d?b.setAttribute("auto-remove",""):b.removeAttribute("auto-remove"),v?b.setAttribute("icon-only",""):b.removeAttribute("icon-only"),u?b.setAttribute("disabled",""):b.removeAttribute("disabled"))},[f,r,s,n,c,m,l,i,d,v,u]),e.createElement("ui-badge",{ref:A,...g},p)}function Ft(w){const{title:f,description:r,actionLabel:s,tone:n,compact:c,headless:m,onAction:l,children:i,...d}=w,v=e.useRef(null);return e.useEffect(()=>{const u=v.current;if(!u)return;const y=()=>l==null?void 0:l();return u.addEventListener("action",y),()=>u.removeEventListener("action",y)},[l]),e.useEffect(()=>{const u=v.current;u&&(f?u.setAttribute("title",f):u.removeAttribute("title"),r?u.setAttribute("description",r):u.removeAttribute("description"),s?u.setAttribute("action-label",s):u.removeAttribute("action-label"),n?u.setAttribute("tone",n):u.removeAttribute("tone"),c?u.setAttribute("compact",""):u.removeAttribute("compact"),m?u.setAttribute("headless",""):u.removeAttribute("headless"))},[f,r,s,n,c,m]),e.createElement("ui-empty-state",{ref:v,...d},i)}function Tt(w){const{sortable:f,selectable:r,multiSelect:s,striped:n,hover:c,compact:m,bordered:l,stickyHeader:i,loading:d,headless:v,emptyText:u,onSortChange:y,onRowSelect:p,children:g,...A}=w,b=e.useRef(null);return e.useEffect(()=>{const E=b.current;if(!E)return;const t=h=>{const L=h.detail;L&&(y==null||y(L))},o=h=>{const L=h.detail;L&&(p==null||p(L))};return E.addEventListener("sort-change",t),E.addEventListener("row-select",o),()=>{E.removeEventListener("sort-change",t),E.removeEventListener("row-select",o)}},[y,p]),e.createElement("ui-table",{ref:b,...A,...f?{sortable:""}:{},...r?{selectable:""}:{},...s?{"multi-select":""}:{},...n?{striped:""}:{},...c?{hover:""}:{},...m?{compact:""}:{},...l?{bordered:""}:{},...i?{"sticky-header":""}:{},...d?{loading:""}:{},...v?{headless:""}:{},...u?{"empty-text":u}:{}},g)}function xt(w){const{sortable:f,selectable:r,multiSelect:s,striped:n,hover:c,compact:m,bordered:l,stickyHeader:i,loading:d,headless:v,hideSummary:u,emptyText:y,page:p,pageSize:g,paginationId:A,filterQuery:b,filterColumn:E,filterRules:t,columnOrder:o,pinColumns:h,draggableColumns:L,resizableColumns:H,bulkActionsLabel:a,bulkClearLabel:k,virtualize:R,rowHeight:P,overscan:F,onSortChange:B,onRowSelect:T,onPageChange:N,onFilterChange:I,onColumnResize:S,onVirtualRangeChange:x,onColumnOrderChange:D,onBulkClear:q,children:$,...j}=w,_=e.useRef(null);e.useEffect(()=>{const M=_.current;if(!M)return;const J=W=>{const X=W.detail;X&&(B==null||B(X))},Z=W=>{const X=W.detail;X&&(T==null||T(X))},Y=W=>{const X=W.detail;X&&(N==null||N(X))},re=W=>{const X=W.detail;X&&(I==null||I(X))},ie=W=>{const X=W.detail;X&&(S==null||S(X))},C=W=>{const X=W.detail;X&&(x==null||x(X))},z=W=>{const X=W.detail;X&&(D==null||D(X))},le=W=>{const X=W.detail;X&&(q==null||q(X))};return M.addEventListener("sort-change",J),M.addEventListener("row-select",Z),M.addEventListener("page-change",Y),M.addEventListener("filter-change",re),M.addEventListener("column-resize",ie),M.addEventListener("virtual-range-change",C),M.addEventListener("column-order-change",z),M.addEventListener("bulk-clear",le),()=>{M.removeEventListener("sort-change",J),M.removeEventListener("row-select",Z),M.removeEventListener("page-change",Y),M.removeEventListener("filter-change",re),M.removeEventListener("column-resize",ie),M.removeEventListener("virtual-range-change",C),M.removeEventListener("column-order-change",z),M.removeEventListener("bulk-clear",le)}},[B,T,N,I,S,x,D,q]);const G=t&&t.length?(()=>{try{return JSON.stringify(t)}catch{return}})():void 0,Q=typeof h=="string"?h.trim()||void 0:h&&typeof h=="object"?(()=>{try{return JSON.stringify(h)}catch{return}})():void 0;return e.createElement("ui-data-table",{ref:_,...j,...f?{sortable:""}:{},...r?{selectable:""}:{},...s?{"multi-select":""}:{},...n?{striped:""}:{},...c?{hover:""}:{},...m?{compact:""}:{},...l?{bordered:""}:{},...i?{"sticky-header":""}:{},...d?{loading:""}:{},...v?{headless:""}:{},...u?{"hide-summary":""}:{},...y?{"empty-text":y}:{},...typeof p=="number"&&Number.isFinite(p)?{page:String(p)}:{},...typeof g=="number"&&Number.isFinite(g)?{"page-size":String(g)}:{},...A?{"pagination-id":A}:{},...typeof b=="string"?{"filter-query":b}:{},...typeof E=="number"&&Number.isFinite(E)?{"filter-column":String(E)}:typeof E=="string"&&E.trim()?{"filter-column":E}:{},...G?{filters:G}:{},...o?{"column-order":o}:{},...Q?{"pin-columns":Q}:{},...L?{"draggable-columns":""}:{},...H?{"resizable-columns":""}:{},...a?{"bulk-actions-label":a}:{},...k?{"bulk-clear-label":k}:{},...R?{virtualize:""}:{},...typeof P=="number"&&Number.isFinite(P)?{"row-height":String(P)}:{},...typeof F=="number"&&Number.isFinite(F)?{overscan:String(F)}:{}},$)}const Ae=e.forwardRef(function({data:f,values:r,labels:s,type:n,variant:c,title:m,subtitle:l,headless:i,children:d,...v},u){const y=e.useRef(null);return e.useImperativeHandle(u,()=>y.current),e.useEffect(()=>{const p=y.current;if(!p)return;const g=(b,E)=>{const t=p.getAttribute(b);if(E==null){t!=null&&p.removeAttribute(b);return}t!==E&&p.setAttribute(b,E)},A=(b,E)=>{E?g(b,""):g(b,null)};if(f&&f.length)try{g("data",JSON.stringify(f))}catch{g("data",null)}else g("data",null);r&&r.length?g("values",r.join(",")):g("values",null),s&&s.length?g("labels",s.join(",")):g("labels",null),g("type",n&&n!=="line"?n:null),g("variant",c&&c!=="default"?c:null),g("title",m||null),g("subtitle",l||null),A("headless",i)},[f,r,s,n,c,m,l,i]),e.createElement("ui-chart",{ref:y,...v},d)});Ae.displayName="Chart";const Ee=e.forwardRef(function({items:f,variant:r,headless:s,children:n,...c},m){const l=e.useRef(null);return e.useImperativeHandle(m,()=>l.current),e.useEffect(()=>{const i=l.current;if(!i)return;const d=(u,y)=>{const p=i.getAttribute(u);if(y==null){p!=null&&i.removeAttribute(u);return}p!==y&&i.setAttribute(u,y)},v=(u,y)=>{y?d(u,""):d(u,null)};if(f&&f.length)try{d("items",JSON.stringify(f))}catch{d("items",null)}else d("items",null);d("variant",r&&r!=="default"?r:null),v("headless",s)},[f,r,s]),e.createElement("ui-timeline",{ref:l,...c},n)});Ee.displayName="Timeline";const pe=e.forwardRef(function({year:f,month:r,value:s,events:n,variant:c,selection:m,min:l,max:i,disabled:d,readOnly:v,locale:u,weekStart:y,outsideClick:p,eventsMax:g,eventsDisplay:A,maxSelections:b,size:E,headless:t,hideToday:o,showToday:h,onSelect:L,onChange:H,onCalendarChange:a,onValueChange:k,children:R,...P},F){const B=e.useRef(null);return e.useImperativeHandle(F,()=>B.current),e.useEffect(()=>{const T=B.current;if(!T)return;const N=S=>{const x=S.detail;x&&(L==null||L(x),H==null||H(x),k==null||k(x.value))},I=S=>{const x=S.detail;x&&(a==null||a(x))};return T.addEventListener("select",N),T.addEventListener("change",I),()=>{T.removeEventListener("select",N),T.removeEventListener("change",I)}},[L,H,a,k]),e.useEffect(()=>{const T=B.current;if(!T)return;const N=(S,x)=>{const D=T.getAttribute(S);if(x==null){D!=null&&T.removeAttribute(S);return}D!==x&&T.setAttribute(S,x)},I=(S,x)=>{x?T.hasAttribute(S)||T.setAttribute(S,""):T.hasAttribute(S)&&T.removeAttribute(S)};if(typeof f=="number"&&Number.isFinite(f)?N("year",String(f)):N("year",null),typeof r=="number"&&Number.isFinite(r)?N("month",String(r)):N("month",null),N("value",s||null),N("selection",m&&m!=="single"?m:null),N("min",l||null),N("max",i||null),N("locale",u||null),N("week-start",typeof y=="number"?String(y):null),N("outside-click",p&&p!=="navigate"?p:null),N("events-max",typeof g=="number"&&Number.isFinite(g)?String(g):null),N("events-display",A&&A!=="dots"?A:null),N("max-selections",typeof b=="number"&&Number.isFinite(b)?String(b):null),N("size",E&&E!=="md"?E:null),N("show-today",typeof h=="boolean"?h?"true":"false":null),I("disabled",d),I("readonly",v),I("hide-today",o),I("headless",t),n&&n.length)try{N("events",JSON.stringify(n))}catch{N("events",null)}else N("events",null);N("variant",c&&c!=="default"?c:null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h]),e.createElement("ui-calendar",{ref:B,...P},R)});pe.displayName="Calendar";const ye=e.forwardRef(function({value:f,format:r,alpha:s,disabled:n,readOnly:c,size:m,variant:l,mode:i,open:d,placeholder:v,presets:u,recent:y,maxRecent:p,persist:g,onInput:A,onChange:b,onValueChange:E,onOpen:t,onClose:o,onInvalid:h,children:L,...H},a){const k=e.useRef(null);e.useImperativeHandle(a,()=>k.current),e.useEffect(()=>{const P=k.current;if(!P)return;const F=N=>{const I=N.detail;I&&(A==null||A(I))},B=N=>{const I=N.detail;I&&(b==null||b(I),E==null||E(I.value))},T=N=>{const I=N.detail;I&&(h==null||h(I))};return P.addEventListener("input",F),P.addEventListener("change",B),P.addEventListener("open",t),P.addEventListener("close",o),P.addEventListener("invalid",T),()=>{P.removeEventListener("input",F),P.removeEventListener("change",B),P.removeEventListener("open",t),P.removeEventListener("close",o),P.removeEventListener("invalid",T)}},[A,b,E,t,o,h]),e.useEffect(()=>{const P=k.current;if(!P)return;const F=(T,N)=>{const I=P.getAttribute(T);N==null?I!=null&&P.removeAttribute(T):I!==N&&P.setAttribute(T,N)},B=(T,N)=>{N?F(T,""):F(T,null)};if(F("value",f??null),F("format",r&&r!=="hex"?r:null),B("alpha",s),B("disabled",n),B("readonly",c),F("size",m&&m!=="md"?m:null),F("variant",l&&l!=="default"?l:null),F("mode",i&&i!=="inline"?i:null),typeof d=="boolean"?B("open",d):F("open",null),F("placeholder",v??null),B("recent",y),F("max-recent",typeof p=="number"?String(p):null),B("persist",g),u&&u.length>0)try{F("presets",JSON.stringify(u))}catch{F("presets",null)}else F("presets",null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g]);const R={ref:k,...H};if(i&&i!=="inline"&&(R.mode=i),typeof d=="boolean"&&d&&(R.open=""),f!=null&&(R.value=f),r&&r!=="hex"&&(R.format=r),s&&(R.alpha=""),n&&(R.disabled=""),c&&(R.readonly=""),m&&m!=="md"&&(R.size=m),l&&l!=="default"&&(R.variant=l),v&&(R.placeholder=v),y&&(R.recent=""),typeof p=="number"&&(R["max-recent"]=String(p)),g&&(R.persist=""),u&&u.length>0)try{R.presets=JSON.stringify(u)}catch{}return e.createElement("ui-color-picker",R,L)});ye.displayName="ColorPicker";const Le=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,min:c,max:m,locale:l,weekStart:i,size:d,variant:v,placeholder:u,label:y,hint:p,error:g,clearable:A,allowInput:b,closeOnSelect:E,outsideClick:t,disabled:o,readOnly:h,required:L,name:H,mode:a,events:k,eventsMax:R,eventsDisplay:P,format:F,displayFormat:B,onInput:T,onChange:N,onValueChange:I,onOpen:S,onClose:x,onInvalid:D,children:q,...$},j){const _=e.useRef(null);return e.useImperativeHandle(j,()=>_.current),e.useEffect(()=>{const G=_.current;if(!G)return;const Q=Z=>{const Y=Z.detail;Y&&(T==null||T(Y))},M=Z=>{const Y=Z.detail;Y&&(N==null||N(Y),I==null||I(Y.value))},J=Z=>{const Y=Z.detail;Y&&(D==null||D(Y))};return G.addEventListener("input",Q),G.addEventListener("change",M),G.addEventListener("open",S),G.addEventListener("close",x),G.addEventListener("invalid",J),()=>{G.removeEventListener("input",Q),G.removeEventListener("change",M),G.removeEventListener("open",S),G.removeEventListener("close",x),G.removeEventListener("invalid",J)}},[T,N,I,S,x,D]),e.useEffect(()=>{const G=_.current;if(!G)return;const Q=(J,Z)=>{const Y=G.getAttribute(J);Z==null?Y!=null&&G.removeAttribute(J):Y!==Z&&G.setAttribute(J,Z)},M=(J,Z)=>{Z?Q(J,""):Q(J,null)};if(Q("value",f??null),Q("default-value",r??null),typeof s=="boolean"?M("open",s):Q("open",null),M("default-open",n),Q("min",c??null),Q("max",m??null),Q("locale",l??null),Q("week-start",typeof i=="number"?String(i):null),Q("size",d&&d!=="md"?d:null),Q("variant",v&&v!=="default"?v:null),Q("placeholder",u??null),Q("label",y??null),Q("hint",p??null),Q("error",g??null),M("clearable",A),M("allow-input",b),M("close-on-select",E),Q("outside-click",t&&t!=="navigate"?t:null),M("disabled",o),M("readonly",h),M("required",L),Q("name",H??null),Q("mode",a&&a!=="popover"?a:null),Q("events-max",typeof R=="number"?String(R):null),Q("events-display",P&&P!=="dots"?P:null),Q("format",F&&F!=="locale"?F:null),Q("display-format",B??null),k!=null&&k.length)try{Q("events",JSON.stringify(k))}catch{Q("events",null)}else Q("events",null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R,P,F,B]),e.createElement("ui-date-picker",{ref:_,...$},q)});Le.displayName="DatePicker";const ge=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,min:c,max:m,locale:l,weekStart:i,size:d,variant:v,rangeVariant:u,label:y,hint:p,error:g,allowSameDay:A,allowPartial:b,closeOnSelect:E,clearable:t,disabled:o,readOnly:h,required:L,name:H,nameStart:a,nameEnd:k,mode:R,onInput:P,onChange:F,onValueChange:B,onOpen:T,onClose:N,onInvalid:I,children:S,...x},D){const q=e.useRef(null);return e.useImperativeHandle(D,()=>q.current),e.useEffect(()=>{const $=q.current;if(!$)return;const j=Q=>{const M=Q.detail;M&&(P==null||P(M))},_=Q=>{const M=Q.detail;M&&(F==null||F(M),B==null||B(M.value?JSON.stringify(M.value):null))},G=Q=>{const M=Q.detail;M&&(I==null||I(M))};return $.addEventListener("input",j),$.addEventListener("change",_),$.addEventListener("open",T),$.addEventListener("close",N),$.addEventListener("invalid",G),()=>{$.removeEventListener("input",j),$.removeEventListener("change",_),$.removeEventListener("open",T),$.removeEventListener("close",N),$.removeEventListener("invalid",G)}},[P,F,B,T,N,I]),e.useEffect(()=>{const $=q.current;if(!$)return;const j=(G,Q)=>{const M=$.getAttribute(G);Q==null?M!=null&&$.removeAttribute(G):M!==Q&&$.setAttribute(G,Q)},_=(G,Q)=>{Q?j(G,""):j(G,null)};j("value",f??null),j("default-value",r??null),typeof s=="boolean"?_("open",s):j("open",null),_("default-open",n),j("min",c??null),j("max",m??null),j("locale",l??null),j("week-start",typeof i=="number"?String(i):null),j("size",d&&d!=="md"?d:null),j("variant",v&&v!=="default"?v:null),j("range-variant",u&&u!=="two-fields"?u:null),j("label",y??null),j("hint",p??null),j("error",g??null),_("allow-same-day",A),_("allow-partial",b),_("close-on-select",E),_("clearable",t),_("disabled",o),_("readonly",h),_("required",L),j("name",H??null),j("name-start",a??null),j("name-end",k??null),j("mode",R&&R!=="popover"?R:null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a,k,R]),e.createElement("ui-date-range-picker",{ref:q,...x},S)});ge.displayName="DateRangePicker";const he=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,format:c,step:m,seconds:l,stepSeconds:i,min:d,max:v,disabled:u,readOnly:y,required:p,name:g,clearable:A,allowInput:b,mode:E,label:t,hint:o,error:h,locale:L,variant:H,onInput:a,onChange:k,onValueChange:R,onOpen:P,onClose:F,onInvalid:B,children:T,...N},I){const S=e.useRef(null);return e.useImperativeHandle(I,()=>S.current),e.useEffect(()=>{const x=S.current;if(!x)return;const D=j=>{const _=j.detail;_&&(a==null||a(_))},q=j=>{const _=j.detail;_&&(k==null||k(_),R==null||R(_.value))},$=j=>{const _=j.detail;_&&(B==null||B(_))};return x.addEventListener("input",D),x.addEventListener("change",q),x.addEventListener("open",P),x.addEventListener("close",F),x.addEventListener("invalid",$),()=>{x.removeEventListener("input",D),x.removeEventListener("change",q),x.removeEventListener("open",P),x.removeEventListener("close",F),x.removeEventListener("invalid",$)}},[a,k,R,P,F,B]),e.useEffect(()=>{const x=S.current;if(!x)return;const D=($,j)=>{const _=x.getAttribute($);j==null?_!=null&&x.removeAttribute($):_!==j&&x.setAttribute($,j)},q=($,j)=>{j?D($,""):D($,null)};D("value",f??null),D("default-value",r??null),typeof s=="boolean"?q("open",s):D("open",null),q("default-open",n),D("format",c&&c!=="24h"?c:null),D("step",typeof m=="number"?String(m):null),q("seconds",l),D("step-seconds",typeof i=="number"?String(i):null),D("min",d??null),D("max",v??null),q("disabled",u),q("readonly",y),q("required",p),D("name",g??null),q("clearable",A),q("allow-input",b),D("mode",E&&E!=="popover"?E:null),D("label",t??null),D("hint",o??null),D("error",h??null),D("locale",L??null),D("variant",H&&H!=="default"?H:null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H]),e.createElement("ui-time-picker",{ref:S,...N},T)});he.displayName="TimePicker";const we=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,min:c,max:m,locale:l,weekStart:i,size:d,variant:v,step:u,format:y,disabled:p,readOnly:g,required:A,name:b,closeOnSelect:E,clearable:t,allowInput:o,mode:h,label:L,hint:H,error:a,onInput:k,onChange:R,onValueChange:P,onOpen:F,onClose:B,onInvalid:T,children:N,...I},S){const x=e.useRef(null);return e.useImperativeHandle(S,()=>x.current),e.useEffect(()=>{const D=x.current;if(!D)return;const q=_=>{const G=_.detail;G&&(k==null||k(G))},$=_=>{const G=_.detail;G&&(R==null||R(G),P==null||P(G.value))},j=_=>{const G=_.detail;G&&(T==null||T(G))};return D.addEventListener("input",q),D.addEventListener("change",$),D.addEventListener("open",F),D.addEventListener("close",B),D.addEventListener("invalid",j),()=>{D.removeEventListener("input",q),D.removeEventListener("change",$),D.removeEventListener("open",F),D.removeEventListener("close",B),D.removeEventListener("invalid",j)}},[k,R,P,F,B,T]),e.useEffect(()=>{const D=x.current;if(!D)return;const q=(j,_)=>{const G=D.getAttribute(j);_==null?G!=null&&D.removeAttribute(j):G!==_&&D.setAttribute(j,_)},$=(j,_)=>{_?q(j,""):q(j,null)};q("value",f??null),q("default-value",r??null),typeof s=="boolean"?$("open",s):q("open",null),$("default-open",n),q("min",c??null),q("max",m??null),q("locale",l??null),q("week-start",typeof i=="number"?String(i):null),q("size",d&&d!=="md"?d:null),q("variant",v&&v!=="default"?v:null),q("step",typeof u=="number"?String(u):null),q("format",y&&y!=="24h"?y:null),$("disabled",p),$("readonly",g),$("required",A),q("name",b??null),$("close-on-select",E),$("clearable",t),$("allow-input",o),q("mode",h&&h!=="popover"?h:null),q("label",L??null),q("hint",H??null),q("error",a??null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a]),e.createElement("ui-date-time-picker",{ref:x,...I},N)});we.displayName="DateTimePicker";const Re=e.forwardRef(function({value:f,defaultValue:r,open:s,defaultOpen:n,min:c,max:m,locale:l,weekStart:i,size:d,variant:v,step:u,autoNormalize:y,allowPartial:p,disabled:g,readOnly:A,required:b,name:E,closeOnSelect:t,clearable:o,mode:h,label:L,hint:H,error:a,onInput:k,onChange:R,onValueChange:P,onOpen:F,onClose:B,onInvalid:T,children:N,...I},S){const x=e.useRef(null);return e.useImperativeHandle(S,()=>x.current),e.useEffect(()=>{const D=x.current;if(!D)return;const q=_=>{const G=_.detail;G&&(k==null||k(G))},$=_=>{const G=_.detail;G&&(R==null||R(G),P==null||P(G.value?JSON.stringify(G.value):null))},j=_=>{const G=_.detail;G&&(T==null||T(G))};return D.addEventListener("input",q),D.addEventListener("change",$),D.addEventListener("open",F),D.addEventListener("close",B),D.addEventListener("invalid",j),()=>{D.removeEventListener("input",q),D.removeEventListener("change",$),D.removeEventListener("open",F),D.removeEventListener("close",B),D.removeEventListener("invalid",j)}},[k,R,P,F,B,T]),e.useEffect(()=>{const D=x.current;if(!D)return;const q=(j,_)=>{const G=D.getAttribute(j);_==null?G!=null&&D.removeAttribute(j):G!==_&&D.setAttribute(j,_)},$=(j,_)=>{_?q(j,""):q(j,null)};q("value",f??null),q("default-value",r??null),typeof s=="boolean"?$("open",s):q("open",null),$("default-open",n),q("min",c??null),q("max",m??null),q("locale",l??null),q("week-start",typeof i=="number"?String(i):null),q("size",d&&d!=="md"?d:null),q("variant",v&&v!=="default"?v:null),q("step",typeof u=="number"?String(u):null),$("auto-normalize",y),$("allow-partial",p),$("disabled",g),$("readonly",A),$("required",b),q("name",E??null),$("close-on-select",t),$("clearable",o),q("mode",h&&h!=="popover"?h:null),q("label",L??null),q("hint",H??null),q("error",a??null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H,a]),e.createElement("ui-date-range-time-picker",{ref:x,...I},N)});Re.displayName="DateRangeTimePicker";const He=e.forwardRef(function({tasks:f,variant:r,headless:s,children:n,...c},m){const l=e.useRef(null);return e.useImperativeHandle(m,()=>l.current),e.useEffect(()=>{const i=l.current;if(!i)return;const d=(u,y)=>{const p=i.getAttribute(u);if(y==null){p!=null&&i.removeAttribute(u);return}p!==y&&i.setAttribute(u,y)},v=(u,y)=>{y?d(u,""):d(u,null)};if(f&&f.length)try{d("tasks",JSON.stringify(f))}catch{d("tasks",null)}else d("tasks",null);d("variant",r&&r!=="default"?r:null),v("headless",s)},[f,r,s]),e.createElement("ui-gantt",{ref:l,...c},n)});He.displayName="Gantt";const Ne=e.forwardRef(function({steps:f,value:r,orientation:s,variant:n,size:c,clickable:m,linear:l,headless:i,onChange:d,onSelect:v,children:u,...y},p){const g=e.useRef(null);return e.useImperativeHandle(p,()=>g.current),e.useEffect(()=>{const A=g.current;if(!A)return;const b=t=>{const o=t.detail;o&&(d==null||d(o))},E=t=>{const o=t.detail;o&&(v==null||v(o))};return A.addEventListener("change",b),A.addEventListener("select",E),()=>{A.removeEventListener("change",b),A.removeEventListener("select",E)}},[d,v]),e.useEffect(()=>{const A=g.current;if(!A)return;const b=(t,o)=>{const h=A.getAttribute(t);if(o==null){h!=null&&A.removeAttribute(t);return}h!==o&&A.setAttribute(t,o)},E=(t,o)=>{o?b(t,""):b(t,null)};if(f&&f.length)try{b("steps",JSON.stringify(f))}catch{b("steps",null)}else b("steps",null);b("value",r||null),b("orientation",s&&s!=="horizontal"?s:null),b("variant",n&&n!=="default"?n:null),b("size",c&&c!=="md"?c:null),E("clickable",m),E("linear",l),E("headless",i)},[f,r,s,n,c,m,l,i]),e.createElement("ui-stepper",{ref:g,...y},u)});Ne.displayName="Stepper";const ke=e.forwardRef(function({value:f,linear:r,showStepper:s,stepperPosition:n,hideControls:c,keepMounted:m,variant:l,headless:i,nextLabel:d,prevLabel:v,finishLabel:u,onBeforeChange:y,onChange:p,onStepChange:g,onComplete:A,children:b,...E},t){const o=e.useRef(null);return e.useImperativeHandle(t,()=>o.current),e.useEffect(()=>{const h=o.current;if(!h)return;const L=R=>{if(!y)return;const P=R.detail;y(P)===!1&&R.preventDefault()},H=R=>{const P=R.detail;P&&(p==null||p(P))},a=R=>{const P=R.detail;P&&(g==null||g(P))},k=R=>{const P=R.detail;P&&(A==null||A(P))};return h.addEventListener("before-change",L),h.addEventListener("change",H),h.addEventListener("step-change",a),h.addEventListener("complete",k),()=>{h.removeEventListener("before-change",L),h.removeEventListener("change",H),h.removeEventListener("step-change",a),h.removeEventListener("complete",k)}},[y,p,g,A]),e.useEffect(()=>{const h=o.current;if(!h)return;const L=(a,k)=>{const R=h.getAttribute(a);if(k==null){R!=null&&h.removeAttribute(a);return}R!==k&&h.setAttribute(a,k)},H=(a,k,R)=>{if(typeof k=="boolean"){k?L(a,""):L(a,null);return}R!==void 0&&(R?L(a,""):L(a,null))};L("value",f||null),H("linear",r),typeof s=="boolean"?L("show-stepper",s?"true":"false"):L("show-stepper",null),L("stepper-position",n&&n!=="top"?n:null),H("hide-controls",c),H("keep-mounted",m),L("variant",l&&l!=="default"?l:null),H("headless",i),L("next-label",d||null),L("prev-label",v||null),L("finish-label",u||null)},[f,r,s,n,c,m,l,i,d,v,u]),e.createElement("ui-wizard",{ref:o,...E},b)});ke.displayName="Wizard";const Pe=e.forwardRef(function({open:f,mode:r,orientation:s,variant:n,floating:c,placement:m,collapsible:l,label:i,headless:d,onSelect:v,onOpenChange:u,onToggle:y,children:p,...g},A){const b=e.useRef(null);return e.useImperativeHandle(A,()=>b.current),e.useEffect(()=>{const E=b.current;if(!E)return;const t=L=>{const H=L.detail;H&&(v==null||v(H))},o=L=>{var a;const H=(a=L.detail)==null?void 0:a.open;typeof H=="boolean"&&(u==null||u(H))},h=L=>{var a;const H=(a=L.detail)==null?void 0:a.open;typeof H=="boolean"&&(y==null||y(H))};return E.addEventListener("select",t),E.addEventListener("change",o),E.addEventListener("toggle",h),()=>{E.removeEventListener("select",t),E.removeEventListener("change",o),E.removeEventListener("toggle",h)}},[v,u,y]),e.useEffect(()=>{const E=b.current;if(!E)return;const t=(h,L)=>{const H=E.getAttribute(h);if(L==null){H!=null&&E.removeAttribute(h);return}H!==L&&E.setAttribute(h,L)},o=(h,L)=>{L?t(h,""):t(h,null)};typeof f=="boolean"?o("open",f):t("open",null),t("mode",r&&r!=="bar"?r:null),t("orientation",s&&s!=="horizontal"?s:null),t("variant",n&&n!=="default"?n:null),o("floating",c),t("placement",m&&m!=="bottom-right"?m:null),o("collapsible",l),t("label",i||null),o("headless",d)},[f,r,s,n,c,m,l,i,d]),e.createElement("ui-quick-actions",{ref:b,...g},p)});Pe.displayName="QuickActions";function Dt(w){const{selected:f,orientation:r,activation:s,loop:n,collapsible:c,headless:m,onChange:l,onSelect:i,children:d,...v}=w,u=e.useRef(null);return e.useEffect(()=>{const y=u.current;if(!y)return;const p=g=>{const A=g.detail;A&&(l==null||l(A),i==null||i(A.selected))};return y.addEventListener("change",p),()=>y.removeEventListener("change",p)},[l,i]),e.useEffect(()=>{const y=u.current;y&&(typeof f=="number"?y.setAttribute("selected",String(f)):y.removeAttribute("selected"),r?y.setAttribute("orientation",r):y.removeAttribute("orientation"),s?y.setAttribute("activation",s):y.removeAttribute("activation"),typeof n=="boolean"?y.setAttribute("loop",String(n)):y.removeAttribute("loop"),c?y.setAttribute("collapsible",""):y.removeAttribute("collapsible"),m?y.setAttribute("headless",""):y.removeAttribute("headless"))},[f,r,s,n,c,m]),e.createElement("ui-navigation-menu",{ref:u,...v},d)}function Bt(w){const{selected:f,open:r,loop:s,headless:n,orientation:c,placement:m,variant:l,density:i,shape:d,elevation:v,tone:u,closeOnSelect:y,typeahead:p,onChange:g,onOpen:A,onClose:b,onSelect:E,children:t,...o}=w,h=e.useRef(null);return e.useEffect(()=>{const L=h.current;if(!L)return;const H=P=>{const F=P.detail;F&&(g==null||g(F))},a=P=>{const F=P.detail;typeof(F==null?void 0:F.selected)=="number"?A==null||A(F.selected):A==null||A(-1)},k=()=>b==null?void 0:b(),R=P=>{const F=P.detail;F&&(E==null||E(F))};return L.addEventListener("change",H),L.addEventListener("open",a),L.addEventListener("close",k),L.addEventListener("select",R),()=>{L.removeEventListener("change",H),L.removeEventListener("open",a),L.removeEventListener("close",k),L.removeEventListener("select",R)}},[g,A,b,E]),e.useEffect(()=>{const L=h.current;L&&(typeof f=="number"?L.setAttribute("selected",String(f)):L.removeAttribute("selected"),typeof r=="boolean"&&r?L.setAttribute("open",""):L.removeAttribute("open"),typeof s=="boolean"?L.setAttribute("loop",String(s)):L.removeAttribute("loop"),n?L.setAttribute("headless",""):L.removeAttribute("headless"),c&&c!=="horizontal"?L.setAttribute("orientation",c):L.removeAttribute("orientation"),m?L.setAttribute("placement",m):L.removeAttribute("placement"),l&&l!=="default"?L.setAttribute("variant",l):L.removeAttribute("variant"),i&&i!=="default"?L.setAttribute("density",i):L.removeAttribute("density"),d&&d!=="default"?L.setAttribute("shape",d):L.removeAttribute("shape"),v&&v!=="default"?L.setAttribute("elevation",v):L.removeAttribute("elevation"),u&&u!=="default"&&u!=="brand"?L.setAttribute("tone",u):L.removeAttribute("tone"),y==null?L.removeAttribute("close-on-select"):L.setAttribute("close-on-select",y?"true":"false"),p==null?L.removeAttribute("typeahead"):L.setAttribute("typeahead",p?"true":"false"))},[f,r,s,n,c,m,l,i,d,v,u,y,p]),e.createElement("ui-menubar",{ref:h,...o},t)}const qt=typeof window<"u"?e.useLayoutEffect:e.useEffect,Se=e.forwardRef(function(f,r){const{open:s,title:n,description:c,closable:m,dismissible:l,closeOnOverlay:i,closeOnEsc:d,lockWhileLoading:v,roleType:u,size:y,state:p,initialFocus:g,submitText:A,cancelText:b,loadingText:E,dialogId:t,config:o,headless:h,onOpen:L,onClose:H,onRequestClose:a,onDialogOpen:k,onDialogSubmit:R,onDialogCancel:P,onDialogDismiss:F,onDialogClose:B,children:T,...N}=f,I=e.useRef(null);return e.useImperativeHandle(r,()=>I.current),e.useEffect(()=>{const S=I.current;if(!S)return;const x=()=>L==null?void 0:L(),D=()=>H==null?void 0:H(),q=M=>{const J=M.detail;J&&(a==null||a(J))},$=M=>k==null?void 0:k(M.detail),j=M=>R==null?void 0:R(M.detail),_=M=>P==null?void 0:P(M.detail),G=M=>F==null?void 0:F(M.detail),Q=M=>B==null?void 0:B(M.detail);return S.addEventListener("open",x),S.addEventListener("close",D),S.addEventListener("request-close",q),S.addEventListener("ui-open",$),S.addEventListener("ui-submit",j),S.addEventListener("ui-cancel",_),S.addEventListener("ui-dismiss",G),S.addEventListener("ui-close",Q),()=>{S.removeEventListener("open",x),S.removeEventListener("close",D),S.removeEventListener("request-close",q),S.removeEventListener("ui-open",$),S.removeEventListener("ui-submit",j),S.removeEventListener("ui-cancel",_),S.removeEventListener("ui-dismiss",G),S.removeEventListener("ui-close",Q)}},[L,H,a,k,R,P,F,B]),qt(()=>{const S=I.current;if(!S)return;typeof s=="boolean"&&(s?S.setAttribute("open",""):S.removeAttribute("open")),n?S.setAttribute("title",n):S.removeAttribute("title"),c?S.setAttribute("description",c):S.removeAttribute("description");const x=typeof l=="boolean"?l:m;typeof x=="boolean"?(S.setAttribute("dismissible",String(x)),S.setAttribute("closable",String(x))):(S.removeAttribute("dismissible"),S.removeAttribute("closable")),typeof i=="boolean"?(S.setAttribute("close-on-overlay",String(i)),S.setAttribute("close-on-backdrop",String(i))):(S.removeAttribute("close-on-overlay"),S.removeAttribute("close-on-backdrop")),typeof d=="boolean"?S.setAttribute("close-on-esc",String(d)):S.removeAttribute("close-on-esc"),typeof v=="boolean"?S.setAttribute("lock-while-loading",String(v)):S.removeAttribute("lock-while-loading"),u?S.setAttribute("role",u):S.removeAttribute("role"),y&&y!=="md"&&y!=="2"?S.setAttribute("size",y):S.removeAttribute("size"),p&&p!=="idle"?S.setAttribute("state",p):S.removeAttribute("state"),g?S.setAttribute("initial-focus",g):S.removeAttribute("initial-focus"),A?S.setAttribute("submit-text",A):S.removeAttribute("submit-text"),b?S.setAttribute("cancel-text",b):S.removeAttribute("cancel-text"),E?S.setAttribute("loading-text",E):S.removeAttribute("loading-text"),t&&(S.dialogId=t),o&&(S.config=o),h?S.setAttribute("headless",""):S.removeAttribute("headless")},[s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h]),e.createElement("ui-dialog",{ref:I,...N},T)});Se.displayName="Dialog";const Fe=e.createContext(null);function $t({children:w,hostId:f="ui-dialog-react-host"}){const r=e.useRef(null);r.current||(r.current=V.createDialogManager()),e.useEffect(()=>{var c;if(typeof document>"u")return;let n=document.getElementById(f);return n||(n=document.createElement("div"),n.id=f,n.setAttribute("data-ui-dialog-react-host","true"),document.body.appendChild(n)),(c=r.current)==null||c.setContainer(n),()=>{var m;(m=r.current)==null||m.destroy("unmount"),r.current=null,n&&n.parentElement&&n.parentElement.removeChild(n)}},[f]);const s=e.useMemo(()=>({open:(n={})=>{var c;return((c=r.current)==null?void 0:c.open(n))??Promise.resolve({id:"",action:"dismiss"})},confirm:(n={})=>{var c;return((c=r.current)==null?void 0:c.confirm(n))??Promise.resolve({id:"",action:"dismiss"})}}),[]);return e.createElement(Fe.Provider,{value:s},w)}function Jt(){const w=e.useContext(Fe);if(!w)throw new Error("useDialog must be used within <DialogProvider>.");return w}const Te=e.forwardRef(function({children:f,onOpen:r,onClose:s,...n},c){const m=e.useRef(null);return e.useImperativeHandle(c,()=>m.current),e.useEffect(()=>{const l=m.current;if(!l)return;const i=()=>r==null?void 0:r(),d=()=>s==null?void 0:s();return l.addEventListener("open",i),l.addEventListener("close",d),()=>{l.removeEventListener("open",i),l.removeEventListener("close",d)}},[r,s]),e.createElement("ui-popover",{ref:m,...n},f)});Te.displayName="Popover";const xe=e.forwardRef(function({children:f,selected:r,value:s,orientation:n,activation:c,variant:m,size:l,tone:i,stretched:d,headless:v,onChange:u,onTabChange:y,...p},g){const A=e.useRef(null);return e.useImperativeHandle(g,()=>A.current),e.useEffect(()=>{const b=A.current;if(!b)return;const E=t=>{const o=t.detail;o&&(u==null||u(o.index),y==null||y(o))};return b.addEventListener("change",E),()=>{b.removeEventListener("change",E)}},[u,y]),e.useEffect(()=>{const b=A.current;if(!b)return;const E=(o,h)=>{const L=b.getAttribute(o);if(h==null){L!=null&&b.removeAttribute(o);return}L!==h&&b.setAttribute(o,h)},t=(o,h)=>{h?E(o,""):E(o,null)};E("selected",r!=null?String(r):null),E("value",s||null),E("orientation",n&&n!=="horizontal"?n:null),E("activation",c&&c!=="auto"?c:null),E("variant",m&&m!=="default"?m:null),E("size",l&&l!=="md"?l:null),E("tone",i&&i!=="brand"?i:null),t("stretched",d),t("headless",v)},[r,s,n,c,m,l,i,d,v]),e.createElement("ui-tabs",{ref:A,...p},f)});xe.displayName="Tabs";const De=e.forwardRef(function({children:f,open:r,placement:s,variant:n,density:c,shape:m,elevation:l,tone:i,closeOnSelect:d,typeahead:v,onOpen:u,onClose:y,onChange:p,onSelect:g,onSelectDetail:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=()=>u==null?void 0:u(),L=()=>y==null?void 0:y(),H=k=>{var P;const R=(P=k.detail)==null?void 0:P.open;typeof R=="boolean"&&(p==null||p(R))},a=k=>{const R=k.detail||{};A==null||A(R),typeof R.index=="number"&&(g==null||g(R.index))};return o.addEventListener("open",h),o.addEventListener("close",L),o.addEventListener("change",H),o.addEventListener("select",a),()=>{o.removeEventListener("open",h),o.removeEventListener("close",L),o.removeEventListener("change",H),o.removeEventListener("select",a)}},[u,y,p,g,A]),e.useEffect(()=>{const o=t.current;!o||r==null||(r?o.setAttribute("open",""):o.removeAttribute("open"))},[r]),e.useEffect(()=>{const o=t.current;o&&(s?o.setAttribute("placement",s):o.removeAttribute("placement"))},[s]),e.useEffect(()=>{const o=t.current;o&&(n&&n!=="default"?o.setAttribute("variant",n):o.removeAttribute("variant"))},[n]),e.useEffect(()=>{const o=t.current;o&&(c&&c!=="default"?o.setAttribute("density",c):o.removeAttribute("density"))},[c]),e.useEffect(()=>{const o=t.current;o&&(m&&m!=="default"?o.setAttribute("shape",m):o.removeAttribute("shape"))},[m]),e.useEffect(()=>{const o=t.current;o&&(l&&l!=="default"?o.setAttribute("elevation",l):o.removeAttribute("elevation"))},[l]),e.useEffect(()=>{const o=t.current;o&&(i&&i!=="default"&&i!=="brand"?o.setAttribute("tone",i):o.removeAttribute("tone"))},[i]),e.useEffect(()=>{const o=t.current;if(o){if(d==null){o.removeAttribute("close-on-select");return}o.setAttribute("close-on-select",d?"true":"false")}},[d]),e.useEffect(()=>{const o=t.current;if(o){if(v==null){o.removeAttribute("typeahead");return}o.setAttribute("typeahead",v?"true":"false")}},[v]),e.createElement("ui-menu",{ref:t,...b},f)});De.displayName="Menu";const Be=e.forwardRef(function({children:f,name:r,iconVariant:s,size:n,color:c,secondaryColor:m,variant:l,tone:i,shape:d,spin:v,pulse:u,badge:y,label:p,decorative:g,strokeWidth:A,absoluteStrokeWidth:b,strokeLinecap:E,strokeLinejoin:t,rotate:o,flip:h,rtl:L,...H},a){const k=e.useRef(null);return e.useImperativeHandle(a,()=>k.current),e.useEffect(()=>{const R=k.current;R&&(r?R.setAttribute("name",r):R.removeAttribute("name"),s?R.setAttribute("icon-variant",s):R.removeAttribute("icon-variant"),n!=null&&n!==""?R.setAttribute("size",String(n)):R.removeAttribute("size"),c?R.setAttribute("color",c):R.removeAttribute("color"),m?R.setAttribute("secondary-color",m):R.removeAttribute("secondary-color"),l&&l!=="default"?R.setAttribute("variant",l):R.removeAttribute("variant"),i&&i!=="default"?R.setAttribute("tone",i):R.removeAttribute("tone"),d&&d!=="default"?R.setAttribute("shape",d):R.removeAttribute("shape"),v?R.setAttribute("spin",""):R.removeAttribute("spin"),u?R.setAttribute("pulse",""):R.removeAttribute("pulse"),y?R.setAttribute("badge",""):R.removeAttribute("badge"),p?R.setAttribute("label",p):R.removeAttribute("label"),g?R.setAttribute("decorative",""):R.removeAttribute("decorative"),A!=null&&A!==""?R.setAttribute("stroke-width",String(A)):R.removeAttribute("stroke-width"),b?R.setAttribute("absolute-stroke-width",""):R.removeAttribute("absolute-stroke-width"),E?R.setAttribute("stroke-linecap",E):R.removeAttribute("stroke-linecap"),t?R.setAttribute("stroke-linejoin",t):R.removeAttribute("stroke-linejoin"),o!=null&&Number.isFinite(o)?R.setAttribute("rotate",String(o)):R.removeAttribute("rotate"),h?R.setAttribute("flip",h):R.removeAttribute("flip"),L?R.setAttribute("rtl",""):R.removeAttribute("rtl"))},[r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L]),e.createElement("ui-icon",{ref:k,...H},f)});Be.displayName="Icon";const se={default:"",success:"Success: ",error:"Error: ",warning:"Warning: ",info:"Info: "};function jt(w,f={}){return V.showToast(w,f)}const Gt={show(w,f={}){return V.showToast(w,f)},success(w,f={}){return V.showToast(`${se.success}${w}`,f)},error(w,f={}){return V.showToast(`${se.error}${w}`,f)},warning(w,f={}){return V.showToast(`${se.warning}${w}`,f)},info(w,f={}){return V.showToast(`${se.info}${w}`,f)}};function _t(){return null}const qe=e.forwardRef(function({children:f,headless:r,onShow:s,onHide:n,...c},m){const l=e.useRef(null);return e.useImperativeHandle(m,()=>l.current),e.useEffect(()=>{const i=l.current;if(!i)return;const d=u=>{const y=u.detail;y&&(s==null||s(y))},v=u=>{const y=u.detail;y&&(n==null||n(y))};return i.addEventListener("show",d),i.addEventListener("hide",v),()=>{i.removeEventListener("show",d),i.removeEventListener("hide",v)}},[s,n]),e.useEffect(()=>{const i=l.current;i&&(r?i.setAttribute("headless",""):i.removeAttribute("headless"))},[r]),e.createElement("ui-toast",{ref:l,...c},f)});qe.displayName="Toast";function ee(w,f){if(typeof window>"u"||typeof customElements>"u"||customElements.get(w))return;const r=`__editora_warned_${w}`,s=window;s[r]||(s[r]=!0,console.warn(`[ui-react/${f}] ${w} is not registered. Import/register the matching web component before using this wrapper.`))}function Mt(w){const{children:f,anchorId:r,open:s,...n}=w,c=e.useRef(null);return e.useEffect(()=>{ee("ui-floating-toolbar","FloatingToolbar")},[]),e.useEffect(()=>{var l,i;const m=c.current;m&&(s&&r?(l=m.showForAnchorId)==null||l.call(m,r):(i=m.hide)==null||i.call(m))},[s,r]),e.createElement("ui-floating-toolbar",{ref:c,...n},f)}const $e=K.forwardRef(function({children:f,orientation:r,density:s,ariaLabel:n,...c},m){const l=K.useRef(null);return K.useImperativeHandle(m,()=>l.current),K.useEffect(()=>{ee("ui-block-controls","BlockControls")},[]),K.useEffect(()=>{const i=l.current;i&&(r?i.setAttribute("orientation",r):i.removeAttribute("orientation"),s?i.setAttribute("density",s):i.removeAttribute("density"),n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label"))},[r,s,n]),K.createElement("ui-block-controls",{ref:l,...c},f)});$e.displayName="BlockControls";function Qt(w){const{children:f,open:r,onSelect:s,...n}=w,c=e.useRef(null);return e.useEffect(()=>{ee("ui-command-palette","CommandPalette")},[]),e.useEffect(()=>{const m=c.current;if(!m)return;const l=i=>{var v;const d=(v=i.detail)==null?void 0:v.index;typeof d=="number"&&(s==null||s(d))};return m.addEventListener("select",l),r?m.setAttribute("open",""):m.removeAttribute("open"),()=>m.removeEventListener("select",l)},[r,s]),e.createElement("ui-command-palette",{ref:c,...n},f)}function It(w){const{items:f,anchorId:r,anchorPoint:s,open:n,variant:c,density:m,shape:l,elevation:i,tone:d,closeOnSelect:v,typeahead:u,children:y,onOpen:p,onClose:g,onChange:A,onSelect:b,...E}=w,t=e.useRef(null);e.useEffect(()=>{const H=t.current;if(!H)return;const a=()=>p==null?void 0:p(),k=()=>g==null?void 0:g(),R=F=>{var T;const B=(T=F.detail)==null?void 0:T.open;typeof B=="boolean"&&(A==null||A(B))},P=F=>{b==null||b(F.detail)};return H.addEventListener("open",a),H.addEventListener("close",k),H.addEventListener("change",R),H.addEventListener("select",P),()=>{H.removeEventListener("open",a),H.removeEventListener("close",k),H.removeEventListener("change",R),H.removeEventListener("select",P)}},[p,g,A,b]),e.useEffect(()=>{const H=t.current;if(!(!H||n==null)){if(!n){H.close?H.close():H.open=!1;return}if(s&&H.openAt){H.openAt(s);return}if(r){if(H.openForAnchorId){H.openForAnchorId(r);return}if(H.showForAnchorId){H.showForAnchorId(r);return}}H.open=!0}},[n,r,s]);const o=H=>H?H.map((a,k)=>{if(a.separator)return e.createElement("div",{key:k,className:"separator",role:"separator"});let R=null;a.icon&&(R=typeof a.icon=="string"?e.createElement("span",{className:"icon"},a.icon):a.icon);let P=null;return a.submenu&&(P=e.createElement("div",{className:"submenu"},o(a.submenu))),e.createElement("div",{key:k,className:"menuitem",role:"menuitem",tabIndex:a.disabled?-1:0,"aria-disabled":a.disabled?"true":void 0,"data-value":a.value,onClick:a.disabled?void 0:a.onClick},R,e.createElement("span",{className:"label"},a.label),a.submenu&&e.createElement("span",{className:"submenu-arrow"},"▶"),P)}):null,h=e.Children.count(y)>0,L=!!n&&!s&&!r;return e.createElement("ui-context-menu",{ref:t,...E,...L?{open:""}:{},...c&&c!=="default"?{variant:c}:{},...m&&m!=="default"?{density:m}:{},...l&&l!=="default"?{shape:l}:{},...i&&i!=="default"?{elevation:i}:{},...d&&d!=="default"&&d!=="brand"?{tone:d}:{},...v==null?{}:{"close-on-select":v?"true":"false"},...u==null?{}:{typeahead:u?"true":"false"}},h?y:e.createElement("div",{slot:"menu"},o(f)))}function Kt(w){const{children:f,anchorId:r,open:s,placement:n,offset:c,strategy:m,arrow:l,variant:i,tone:d,radius:v,size:u,closeOnOutside:y,closeOnEscape:p,onOpen:g,onClose:A,onOpenChange:b,...E}=w,t=e.useRef(null);return e.useEffect(()=>{ee("ui-selection-popup","SelectionPopup")},[]),e.useEffect(()=>{const o=t.current;if(!o)return;const h=()=>{g==null||g(),b==null||b(!0)},L=()=>{A==null||A(),b==null||b(!1)};return o.addEventListener("open",h),o.addEventListener("close",L),()=>{o.removeEventListener("open",h),o.removeEventListener("close",L)}},[g,A,b]),e.useEffect(()=>{var H,a;const o=t.current;if(!o)return;const h=(k,R)=>{const P=o.getAttribute(k);if(R==null){P!=null&&o.removeAttribute(k);return}P!==R&&o.setAttribute(k,R)},L=(k,R,P=void 0)=>{if(R==null){P!==void 0&&h(k,P?null:"false");return}R?h(k,""):h(k,"false")};h("anchor-id",r??null),h("placement",n&&n!=="top"?n:null),h("offset",typeof c=="number"&&Number.isFinite(c)?String(c):null),h("strategy",m&&m!=="fixed"?m:null),h("variant",i&&i!=="default"?i:null),h("tone",d&&d!=="brand"?d:null),h("radius",v?String(v):null),h("size",u&&u!=="md"?u:null),L("arrow",l),L("close-on-outside",y,!0),L("close-on-escape",p,!0),s&&r?(H=o.openFor)==null||H.call(o,r):s?o.setAttribute("open",""):s===!1?(a=o.close)==null||a.call(o):o.removeAttribute("open")},[s,r,n,c,m,l,i,d,v,u,y,p]),e.createElement("ui-selection-popup",{ref:t,...E},f)}function Ut(w){const{children:f,open:r,position:s,...n}=w,c=e.useRef(null);return e.useEffect(()=>{ee("ui-plugin-panel","PluginPanel")},[]),e.useEffect(()=>{const m=c.current;m&&(r?m.setAttribute("open",""):m.removeAttribute("open"),s&&m.setAttribute("position",s))},[r,s]),e.createElement("ui-plugin-panel",{ref:c,...n},f)}const Je=e.forwardRef(function(f,r){const{children:s,onSubmit:n,onInvalid:c,onValidate:m,onAutosave:l,onDirtyChange:i,novalidate:d,autosave:v,autosaveDelay:u,guardUnsaved:y,variant:p,tone:g,density:A,shape:b,elevation:E,gap:t,headless:o,loading:h,...L}=f,H=e.useRef(null);return e.useImperativeHandle(r,()=>H.current),e.useEffect(()=>{const a=H.current;if(!a)return;const k=T=>{const N=T.detail||{};n==null||n(N.values||{})},R=T=>{const N=T.detail||{};c==null||c(N.errors||{},N.values||{})},P=T=>{const N=T.detail||{};m==null||m({valid:!!N.valid,errors:N.errors||{}})},F=T=>{const N=T.detail||{};l==null||l(N.values||{})},B=T=>{const N=T.detail||{};i==null||i(!!N.dirty,N.values||{})};return a.addEventListener("submit",k),a.addEventListener("invalid",R),a.addEventListener("validate",P),a.addEventListener("autosave",F),a.addEventListener("dirty-change",B),()=>{a.removeEventListener("submit",k),a.removeEventListener("invalid",R),a.removeEventListener("validate",P),a.removeEventListener("autosave",F),a.removeEventListener("dirty-change",B)}},[n,c,m,l,i]),e.useEffect(()=>{const a=H.current;a&&(d?a.setAttribute("novalidate",""):a.removeAttribute("novalidate"),v?a.setAttribute("autosave",""):a.removeAttribute("autosave"),typeof u=="number"&&Number.isFinite(u)?a.setAttribute("autosave-delay",String(u)):a.removeAttribute("autosave-delay"),y?a.setAttribute("guard-unsaved",""):a.removeAttribute("guard-unsaved"),p&&p!=="default"?a.setAttribute("variant",p):a.removeAttribute("variant"),g&&g!=="default"?a.setAttribute("tone",g):a.removeAttribute("tone"),A&&A!=="default"?a.setAttribute("density",A):a.removeAttribute("density"),b&&b!=="default"?a.setAttribute("shape",b):a.removeAttribute("shape"),E&&E!=="default"?a.setAttribute("elevation",E):a.removeAttribute("elevation"),t?a.setAttribute("gap",t):a.removeAttribute("gap"),o?a.setAttribute("headless",""):a.removeAttribute("headless"),h?a.setAttribute("loading",""):a.removeAttribute("loading"))},[d,v,u,y,p,g,A,b,E,t,o,h]),e.createElement("ui-form",{ref:H,...L},s)});Je.displayName="Form";function Xt(){const w=e.useRef(null),f=e.useCallback(async()=>{const l=w.current;return l?await l.submit():!1},[]),r=e.useCallback(async()=>{const l=w.current;return l?await l.validate():{valid:!0,errors:{}}},[]),s=e.useCallback(()=>{var i;const l=w.current;return l?(i=l.getValues)==null?void 0:i.call(l):{}},[]),n=e.useCallback(l=>{var d;const i=w.current;return(d=i==null?void 0:i.reset)==null?void 0:d.call(i,l)},[]),c=e.useCallback(()=>{var i;const l=w.current;return l?typeof l.isDirty=="function"?!!l.isDirty():((i=l.hasAttribute)==null?void 0:i.call(l,"dirty"))||!1:!1},[]),m=e.useCallback(l=>{var d;const i=w.current;return(d=i==null?void 0:i.markClean)==null?void 0:d.call(i,l)},[]);return{ref:w,submit:f,validate:r,getValues:s,reset:n,isDirty:c,markClean:m}}function Yt(w){const{placement:f="bottom",offset:r=8,open:s,onOpen:n,onClose:c,role:m="menu"}=w||{},l=e.useRef(null),i=e.useRef(null),d=e.useRef(null),[v,u]=e.useState({top:0,left:0,placement:f}),y=typeof s<"u",[p,g]=e.useState(!!s),A=y?s:p,b=S=>{y||g(S),S?n&&n():c&&c()},E=()=>b(!A),t=()=>b(!0),o=()=>b(!1),h=e.useCallback(()=>{const S=l.current,x=i.current;if(!S||!x)return;const D=V.computePosition(S,x,{placement:f,offset:r});u({top:Math.round(D.top),left:Math.round(D.left),placement:D.placement,arrow:D.x||D.y?{x:D.x,y:D.y}:void 0})},[f,r]);e.useEffect(()=>{if(!A)return;const S=l.current,x=i.current;if(!S||!x)return;h();const D=()=>{d.current&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>h())},q=()=>{d.current&&cancelAnimationFrame(d.current),d.current=requestAnimationFrame(()=>h())};window.addEventListener("scroll",D,!0),window.addEventListener("resize",q);let $=null,j=null;try{typeof ResizeObserver<"u"&&($=new ResizeObserver(q),j=new ResizeObserver(q),$.observe(S),j.observe(x))}catch{$=j=null}return()=>{window.removeEventListener("scroll",D,!0),window.removeEventListener("resize",q),$&&$.disconnect(),j&&j.disconnect(),d.current&&cancelAnimationFrame(d.current)}},[A,h]);const L=e.useCallback(S=>{l.current=S},[]),H=e.useCallback(S=>{i.current=S},[]),a=e.useRef(`floating-${Math.random().toString(36).slice(2,9)}`),k=()=>i.current?Array.from(i.current.querySelectorAll('[role="menuitem"], .item, [data-menu-item]')).filter(Boolean):[],R=S=>{const x=k();if(!x.length)return;const D=Math.max(0,Math.min(x.length-1,S));try{x[D].focus()}catch{}},P=()=>R(0),F=()=>{const S=k();S.length&&R(S.length-1)},B=()=>{const S=k(),x=S.findIndex(D=>D===document.activeElement);R(x<0?0:(x+1)%S.length)},T=()=>{const S=k(),x=S.findIndex(D=>D===document.activeElement);R(x<=0?S.length-1:x-1)};return{referenceRef:L,floatingRef:H,coords:v,update:h,open:A,setOpen:b,toggle:E,openPopup:t,closePopup:o,getReferenceProps:(S={})=>({ref:L,"aria-haspopup":m,"aria-controls":a.current,"aria-expanded":A?"true":"false",onClick:x=>{S.onClick&&S.onClick(x),E()},onKeyDown:x=>{S.onKeyDown&&S.onKeyDown(x),x.key==="ArrowDown"&&(x.preventDefault(),t(),setTimeout(()=>P(),0))},...S}),getFloatingProps:(S={})=>({id:a.current,ref:H,role:m,tabIndex:-1,style:{position:"absolute",top:`${v.top}px`,left:`${v.left}px`},hidden:!A,onKeyDown:x=>{S.onKeyDown&&S.onKeyDown(x),x.key==="Escape"?(x.preventDefault(),o()):x.key==="ArrowDown"?(x.preventDefault(),B()):x.key==="ArrowUp"?(x.preventDefault(),T()):x.key==="Home"?(x.preventDefault(),P()):x.key==="End"&&(x.preventDefault(),F())},...S}),focusFirstItem:P,focusLastItem:F,focusNext:B,focusPrev:T}}function U(w){if(w!=null){if(typeof w=="object")try{return JSON.stringify(w)}catch{return}return String(w)}}function Zt(w){const{children:f,className:r,variant:s,tone:n,elevation:c,radius:m,interactive:l,headless:i,p:d,px:v,py:u,pt:y,pr:p,pb:g,pl:A,m:b,mx:E,my:t,mt:o,mr:h,mb:L,ml:H,width:a,w:k,minWidth:R,minW:P,maxWidth:F,maxW:B,height:T,h:N,minHeight:I,minH:S,maxHeight:x,maxH:D,display:q,position:$,inset:j,top:_,right:G,bottom:Q,left:M,flexBasis:J,flexGrow:Z,flexShrink:Y,gridArea:re,gridColumn:ie,gridColumnStart:C,gridColumnEnd:z,gridRow:le,gridRowStart:W,gridRowEnd:X,align:yt,bg:Lt,color:gt,...ht}=w,wt={className:r,...ht,p:U(d),px:U(v),py:U(u),pt:U(y),pr:U(p),pb:U(g),pl:U(A),m:U(b),mx:U(E),my:U(t),mt:U(o),mr:U(h),mb:U(L),ml:U(H),width:U(a),w:U(k),minwidth:U(R??P),maxwidth:U(F??B),height:U(T),h:U(N),minheight:U(I??S),maxheight:U(x??D),display:U(q),position:U($),inset:U(j),top:U(_),right:U(G),bottom:U(Q),left:U(M),flexbasis:U(J),flexgrow:U(Z),flexshrink:U(Y),gridarea:U(re),gridcolumn:U(ie),gridcolumnstart:U(C),gridcolumnend:U(z),gridrow:U(le),gridrowstart:U(W),gridrowend:U(X),align:U(yt),bg:U(Lt),color:U(gt),variant:s&&s!=="default"?s:void 0,tone:n&&n!=="default"?n:void 0,elevation:c&&c!=="default"?c:void 0,radius:m&&m!=="default"?m:void 0,interactive:l?"":void 0,headless:i?"":void 0};return e.createElement("ui-box",wt,f)}function te(w){if(w!=null){if(typeof w=="object")try{return JSON.stringify(w)}catch{return}return String(w)}}function zt(w){const{children:f,className:r,direction:s,align:n,justify:c,wrap:m,gap:l,rowGap:i,columnGap:d,display:v,headless:u,...y}=w,p={className:r,...y,direction:te(s),align:te(n),justify:te(c),wrap:te(m),gap:te(l),rowgap:te(i),columngap:te(d),display:te(v),headless:u?"":void 0};return e.createElement("ui-flex",p,f)}function O(w){if(w!=null){if(typeof w=="object")try{return JSON.stringify(w)}catch{return}return String(w)}}function Wt(w){const{children:f,className:r,columns:s,rows:n,gap:c,rowGap:m,columnGap:l,autoFlow:i,autoRows:d,autoColumns:v,align:u,justify:y,place:p,alignContent:g,justifyContent:A,placeContent:b,display:E,headless:t,...o}=w,h={className:r,...o,columns:O(s),rows:O(n),gap:O(c),rowgap:O(m),columngap:O(l),autoflow:O(i),autorows:O(d),autocolumns:O(v),align:O(u),justify:O(y),place:O(p),aligncontent:O(g),justifycontent:O(A),placecontent:O(b),display:O(E),headless:t?"":void 0};return e.createElement("ui-grid",h,f)}const je=e.forwardRef(function({size:f="medium",variant:r="default",tone:s="neutral",radius:n="md",density:c="comfortable",inset:m,children:l,...i},d){const v=e.useRef(null);return e.useImperativeHandle(d,()=>v.current),e.useEffect(()=>{const u=v.current;if(!u)return;const y=(g,A)=>{const b=u.getAttribute(g);if(A==null){b!=null&&u.removeAttribute(g);return}b!==A&&u.setAttribute(g,A)},p=(g,A)=>{A?u.hasAttribute(g)||u.setAttribute(g,""):u.hasAttribute(g)&&u.removeAttribute(g)};y("size",f!=="medium"?f:null),y("variant",r!=="default"?r:null),y("tone",s!=="neutral"?s:null),y("radius",n!=="md"?n:null),y("density",c!=="comfortable"?c:null),p("inset",m)},[f,r,s,n,c,m]),e.createElement("ui-section",{ref:v,...i},l)});je.displayName="Section";function Ot(w){const{children:f,size:r="md",...s}=w;return e.createElement("ui-container",{size:r,...s},f)}const Ge=e.forwardRef(function({children:f,collapsed:r,collapsible:s,rail:n,position:c,value:m,items:l,variant:i,size:d,density:v,tone:u,showIcons:y,showBadges:p,headless:g,onSelect:A,onChange:b,onToggle:E,onCollapseChange:t,...o},h){const L=e.useRef(null);return e.useImperativeHandle(h,()=>L.current),e.useEffect(()=>{const H=L.current;if(!H)return;const a=F=>{const B=F.detail;B&&(A==null||A(B))},k=F=>{const B=F.detail;B&&(b==null||b(B))},R=F=>{var T;const B=(T=F.detail)==null?void 0:T.collapsed;typeof B=="boolean"&&(E==null||E(B))},P=F=>{var T;const B=(T=F.detail)==null?void 0:T.collapsed;typeof B=="boolean"&&(t==null||t(B))};return H.addEventListener("select",a),H.addEventListener("change",k),H.addEventListener("toggle",R),H.addEventListener("collapse-change",P),()=>{H.removeEventListener("select",a),H.removeEventListener("change",k),H.removeEventListener("toggle",R),H.removeEventListener("collapse-change",P)}},[A,b,E,t]),e.useEffect(()=>{const H=L.current;if(!H)return;const a=(R,P)=>{const F=H.getAttribute(R);if(P==null){F!=null&&H.removeAttribute(R);return}F!==P&&H.setAttribute(R,P)},k=(R,P,F)=>{if(P==null){F!==void 0&&F===!1&&a(R,null);return}P?a(R,""):a(R,null)};if(k("collapsed",r),k("collapsible",s),k("rail",n),k("headless",g),a("position",c&&c!=="left"?c:null),a("value",m!=null&&m!==""?String(m):null),l&&l.length)try{a("items",JSON.stringify(l))}catch{a("items",null)}else a("items",null);a("variant",i&&i!=="surface"?i:null),a("size",d&&d!=="md"?d:null),a("density",v&&v!=="default"?v:null),a("tone",u&&u!=="default"?u:null),typeof y=="boolean"?a("show-icons",y?"true":"false"):a("show-icons",null),typeof p=="boolean"?a("show-badges",p?"true":"false"):a("show-badges",null)},[r,s,n,g,c,m,l,i,d,v,u,y,p]),e.createElement("ui-sidebar",{ref:L,...o},f)});Ge.displayName="Sidebar";const _e=e.forwardRef(function({children:f,separator:r,maxItems:s,onSelect:n,...c},m){const l=e.useRef(null);return e.useImperativeHandle(m,()=>l.current),e.useEffect(()=>{const i=l.current;if(!i||!n)return;const d=v=>{const u=v.detail;u&&n(u)};return i.addEventListener("select",d),()=>i.removeEventListener("select",d)},[n]),e.useEffect(()=>{const i=l.current;i&&(r!=null&&r!==""?i.setAttribute("separator",r):i.removeAttribute("separator"))},[r]),e.useEffect(()=>{const i=l.current;i&&(typeof s=="number"&&Number.isFinite(s)?i.setAttribute("max-items",String(s)):i.removeAttribute("max-items"))},[s]),e.createElement("ui-breadcrumb",{ref:l,...c},f)});_e.displayName="Breadcrumb";const Me=e.forwardRef(function({children:f,sticky:r,bordered:s,dense:n,showMenuButton:c,onMenuTrigger:m,...l},i){const d=e.useRef(null);return e.useImperativeHandle(i,()=>d.current),e.useEffect(()=>{const v=d.current;if(!v||!m)return;const u=()=>m();return v.addEventListener("menu-trigger",u),()=>v.removeEventListener("menu-trigger",u)},[m]),e.useEffect(()=>{const v=d.current;v&&(r?v.setAttribute("sticky",""):v.removeAttribute("sticky"))},[r]),e.useEffect(()=>{const v=d.current;v&&(s?v.setAttribute("bordered",""):v.removeAttribute("bordered"))},[s]),e.useEffect(()=>{const v=d.current;v&&(n?v.setAttribute("dense",""):v.removeAttribute("dense"))},[n]),e.useEffect(()=>{const v=d.current;v&&(c?v.setAttribute("show-menu-button",""):v.removeAttribute("show-menu-button"))},[c]),e.createElement("ui-app-header",{ref:d,...l},f)});Me.displayName="AppHeader";const Qe=e.forwardRef(function({children:f,open:r,side:s,variant:n,density:c,shape:m,elevation:l,tone:i,size:d,inset:v,dismissible:u,onOpen:y,onClose:p,onChange:g,...A},b){const E=e.useRef(null);return e.useImperativeHandle(b,()=>E.current),e.useEffect(()=>{const t=E.current;if(!t)return;const o=()=>y==null?void 0:y(),h=()=>p==null?void 0:p(),L=H=>{var k;const a=(k=H.detail)==null?void 0:k.open;typeof a=="boolean"&&(g==null||g(a))};return t.addEventListener("open",o),t.addEventListener("close",h),t.addEventListener("change",L),()=>{t.removeEventListener("open",o),t.removeEventListener("close",h),t.removeEventListener("change",L)}},[y,p,g]),e.useEffect(()=>{const t=E.current;t&&(r?t.setAttribute("open",""):t.removeAttribute("open"))},[r]),e.useEffect(()=>{const t=E.current;t&&(s?t.setAttribute("side",s):t.removeAttribute("side"))},[s]),e.useEffect(()=>{const t=E.current;t&&(u?t.setAttribute("dismissible",""):t.removeAttribute("dismissible"))},[u]),e.useEffect(()=>{const t=E.current;t&&(n&&n!=="default"?t.setAttribute("variant",n):t.removeAttribute("variant"))},[n]),e.useEffect(()=>{const t=E.current;t&&(c&&c!=="default"?t.setAttribute("density",c):t.removeAttribute("density"))},[c]),e.useEffect(()=>{const t=E.current;t&&(m&&m!=="default"?t.setAttribute("shape",m):t.removeAttribute("shape"))},[m]),e.useEffect(()=>{const t=E.current;t&&(l&&l!=="default"?t.setAttribute("elevation",l):t.removeAttribute("elevation"))},[l]),e.useEffect(()=>{const t=E.current;t&&(i&&i!=="default"&&i!=="brand"?t.setAttribute("tone",i):t.removeAttribute("tone"))},[i]),e.useEffect(()=>{const t=E.current;t&&(d&&d!=="default"?t.setAttribute("size",d):t.removeAttribute("size"))},[d]),e.useEffect(()=>{const t=E.current;t&&(v?t.setAttribute("inset",""):t.removeAttribute("inset"))},[v]),e.createElement("ui-drawer",{ref:E,...A},f)});Qe.displayName="Drawer";const Ie=e.forwardRef(function({children:f,mode:r,variant:s,density:n,maxWidth:c,sidebarSide:m,collapsed:l,headless:i,sidebarWidth:d,asideWidth:v,onLayoutChange:u,...y},p){const g=e.useRef(null);return e.useImperativeHandle(p,()=>g.current),e.useEffect(()=>{const A=g.current;if(!A)return;const b=()=>u==null?void 0:u();return A.addEventListener("layoutchange",b),()=>A.removeEventListener("layoutchange",b)},[u]),e.useEffect(()=>{const A=g.current;A&&(r&&r!=="dashboard"?A.setAttribute("mode",r):A.removeAttribute("mode"),s&&s!=="default"?A.setAttribute("variant",s):A.removeAttribute("variant"),n&&n!=="default"?A.setAttribute("density",n):A.removeAttribute("density"),c?A.setAttribute("max-width",c):A.removeAttribute("max-width"),m&&m!=="start"?A.setAttribute("sidebar-side",m):A.removeAttribute("sidebar-side"),l?A.setAttribute("collapsed",""):A.removeAttribute("collapsed"),i?A.setAttribute("headless",""):A.removeAttribute("headless"),d?A.setAttribute("sidebar-width",d):A.removeAttribute("sidebar-width"),v?A.setAttribute("aside-width",v):A.removeAttribute("aside-width"))},[r,s,n,c,m,l,i,d,v]),e.createElement("ui-layout",{ref:g,...y},f)});Ie.displayName="Layout";const Ke=e.createContext(null);function Vt(){try{const w=getComputedStyle(document.documentElement),f=w.getPropertyValue("--ui-color-primary").trim();return f?{colors:{primary:f||void 0,text:w.getPropertyValue("--ui-color-text").trim()||void 0,background:w.getPropertyValue("--ui-color-background").trim()||void 0}}:{}}catch{return{}}}function Ct({tokens:w,children:f,storageKey:r="editora.theme.tokens"}){const s=()=>{if(typeof window<"u"&&r)try{const l=localStorage.getItem(r);if(l)return JSON.parse(l)}catch{}if(w&&Object.keys(w).length)return{...V.defaultTokens,...w};if(typeof window<"u"){const l=Vt();if(l.colors&&l.colors.primary)return{...V.defaultTokens,...l}}return{...V.defaultTokens,...w||{}}},[n,c]=e.useState(()=>s());e.useEffect(()=>{w&&Object.keys(w).length&&c(l=>({...l,...w}))},[w]),e.useEffect(()=>{V.applyTheme(n);try{V.registerThemeHost(document.documentElement)}catch{}if(typeof window<"u"&&r){const l=JSON.stringify(n);let i;const d=()=>{try{localStorage.setItem(r,l)}catch{}};return window.requestIdleCallback?i=window.requestIdleCallback(d,{timeout:1e3}):i=window.setTimeout(d,250),()=>{try{window.cancelIdleCallback&&i?window.cancelIdleCallback(i):i&&clearTimeout(i)}catch{}}}},[n,r]);const m=l=>c(l);return e.createElement(Ke.Provider,{value:{tokens:n,setTokens:m}},f)}function er(){const w=e.useContext(Ke);if(!w)throw new Error("useTheme must be used within ThemeProvider");return w}function ne(w,f,r){if(r==null){w.removeAttribute(f);return}r?w.setAttribute(f,""):w.removeAttribute(f)}function ue(w,f,r,s){const n=r&&r!==s?r:void 0;if(!n){w.removeAttribute(f);return}w.setAttribute(f,n)}const Ue=K.forwardRef(function({checked:f,disabled:r,indeterminate:s,loading:n,headless:c,invalid:m,density:l,preset:i,onCheckedChange:d,onChange:v,onInput:u,children:y,...p},g){const A=K.useRef(null);K.useImperativeHandle(g,()=>A.current);const b=typeof window<"u"?K.useLayoutEffect:K.useEffect;K.useEffect(()=>{ee("ui-checkbox","Checkbox")},[]),b(()=>{const t=A.current;t&&(ne(t,"checked",f),ne(t,"disabled",r),ne(t,"indeterminate",s),ne(t,"loading",n),ne(t,"headless",c),ne(t,"invalid",m),ue(t,"density",l,"default"),ue(t,"preset",i,"default"))},[f,r,s,n,c,m,l,i]),K.useEffect(()=>{const t=A.current;if(!t||!d&&!v&&!u)return;const o=L=>{var a;const H=L;u==null||u(H),typeof((a=H.detail)==null?void 0:a.checked)=="boolean"&&(d==null||d(H.detail.checked,H.detail))},h=L=>{const H=L;v==null||v(H)};return t.addEventListener("input",o),t.addEventListener("change",h),()=>{t.removeEventListener("input",o),t.removeEventListener("change",h)}},[d,v,u]);const E={ref:A,...p,checked:f?"":void 0,disabled:r?"":void 0,indeterminate:s?"":void 0,loading:n?"":void 0,headless:c?"":void 0,invalid:m?"":void 0,density:l&&l!=="default"?l:void 0,preset:i&&i!=="default"?i:void 0};return K.createElement("ui-checkbox",E,y)});Ue.displayName="Checkbox";const Xe=e.forwardRef(function({value:f,disabled:r,required:s,name:n,orientation:c,variant:m,size:l,tone:i,options:d,onValueChange:v,children:u,...y},p){const g=e.useRef(null);return e.useImperativeHandle(p,()=>g.current),e.useEffect(()=>{const A=g.current;if(!A)return;const b=E=>{const t=E.detail;t&&(v==null||v(t))};return A.addEventListener("change",b),()=>A.removeEventListener("change",b)},[v]),e.useEffect(()=>{const A=g.current;if(!A)return;const b=(t,o)=>{const h=A.getAttribute(t);if(o==null){h!=null&&A.removeAttribute(t);return}h!==o&&A.setAttribute(t,o)},E=(t,o)=>{o?A.hasAttribute(t)||A.setAttribute(t,""):A.hasAttribute(t)&&A.removeAttribute(t)};b("value",f??null),E("disabled",r),E("required",s),b("name",n||null),b("orientation",c&&c!=="vertical"?c:null),b("variant",m&&m!=="default"?m:null),b("size",l&&l!=="md"?l:null),b("tone",i&&i!=="brand"?i:null),d&&d.length?b("options",JSON.stringify(d)):b("options",null)},[f,r,s,n,c,m,l,i,d]),e.createElement("ui-radio-group",{ref:g,...y},u)});Xe.displayName="RadioGroup";const Ye=e.forwardRef(function({children:f,checked:r,disabled:s,headless:n,loading:c,size:m,variant:l,tone:i,label:d,description:v,name:u,value:y,required:p,onInput:g,onChange:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=H=>{const a=H.detail;a&&(g==null||g(a))},L=H=>{const a=H.detail;a&&(A==null||A(a))};return o.addEventListener("input",h),o.addEventListener("change",L),()=>{o.removeEventListener("input",h),o.removeEventListener("change",L)}},[g,A]),e.useEffect(()=>{const o=t.current;if(!o)return;const h=(H,a)=>{const k=o.getAttribute(H);if(a==null){k!=null&&o.removeAttribute(H);return}k!==a&&o.setAttribute(H,a)},L=(H,a)=>{a?h(H,""):h(H,null)};L("checked",r),L("disabled",s),L("headless",n),L("loading",c),L("required",p),h("size",m&&m!=="md"?m:null),h("variant",l&&l!=="default"?l:null),h("tone",i&&i!=="brand"?i:null),h("label",d||null),h("description",v||null),h("name",u||null),h("value",y||null)},[r,s,n,c,p,m,l,i,d,v,u,y]),e.createElement("ui-switch",{ref:t,...b},f)});Ye.displayName="Switch";const Ze=e.forwardRef(function({children:f,pressed:r,disabled:s,loading:n,headless:c,size:m,variant:l,tone:i,name:d,value:v,required:u,iconOn:y,iconOff:p,onInput:g,onChange:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=H=>{const a=H.detail;a&&(g==null||g(a))},L=H=>{const a=H.detail;a&&(A==null||A(a))};return o.addEventListener("input",h),o.addEventListener("change",L),()=>{o.removeEventListener("input",h),o.removeEventListener("change",L)}},[g,A]),e.useEffect(()=>{const o=t.current;if(!o)return;const h=(H,a)=>{const k=o.getAttribute(H);if(a==null){k!=null&&o.removeAttribute(H);return}k!==a&&o.setAttribute(H,a)},L=(H,a)=>{a?h(H,""):h(H,null)};L("pressed",r),L("disabled",s),L("loading",n),L("headless",c),L("required",u),h("size",m&&m!=="md"?m:null),h("variant",l&&l!=="default"?l:null),h("tone",i&&i!=="brand"?i:null),h("name",d||null),h("value",v||null),h("icon-on",y||null),h("icon-off",p||null)},[r,s,n,c,u,m,l,i,d,v,y,p]),e.createElement("ui-toggle",{ref:t,...b},f)});Ze.displayName="Toggle";const ze=e.forwardRef(function({children:f,value:r,multiple:s,disabled:n,headless:c,orientation:m,variant:l,size:i,density:d,allowEmpty:v,required:u,activation:y,onInput:p,onChange:g,onValueChange:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=H=>{const a=H.detail;a&&(p==null||p(a),A==null||A(a))},L=H=>{const a=H.detail;a&&(g==null||g(a),A==null||A(a))};return o.addEventListener("input",h),o.addEventListener("change",L),()=>{o.removeEventListener("input",h),o.removeEventListener("change",L)}},[p,g,A]),e.useEffect(()=>{const o=t.current;if(!o)return;const h=(H,a)=>{const k=o.getAttribute(H);if(a==null){k!=null&&o.removeAttribute(H);return}k!==a&&o.setAttribute(H,a)},L=(H,a)=>{a?h(H,""):h(H,null)};L("multiple",s),L("disabled",n),L("headless",c),L("allow-empty",v),L("required",u),r==null?h("value",null):Array.isArray(r)?h("value",JSON.stringify(r)):h("value",String(r)),h("orientation",m&&m!=="horizontal"?m:null),h("variant",l&&l!=="default"?l:null),h("size",i&&i!=="md"?i:null),h("density",d&&d!=="default"?d:null),h("activation",y&&y!=="auto"?y:null)},[r,s,n,c,v,u,m,l,i,d,y]),e.createElement("ui-toggle-group",{ref:t,...b},f)});ze.displayName="ToggleGroup";function tr(w){if(w!=null){if(typeof w=="string")return w;if(!(!Number.isFinite(w)||w<=0))return Math.abs(w-16/9)<.01?"16/9":Math.abs(w-4/3)<.01?"4/3":Math.abs(w-1)<.01?"1/1":`${w}/1`}}const We=K.forwardRef(function({ratio:f,fit:r,children:s,...n},c){const m=K.useRef(null);return K.useImperativeHandle(c,()=>m.current),K.useEffect(()=>{ee("ui-aspect-ratio","AspectRatio")},[]),K.useEffect(()=>{const l=m.current;if(!l)return;const i=tr(f);i?l.setAttribute("ratio",i):l.removeAttribute("ratio"),r?l.setAttribute("fit",r):l.removeAttribute("fit")},[f,r]),K.createElement("ui-aspect-ratio",{ref:m,...n},s)});We.displayName="AspectRatio";function ce(w){const f=w.trim().split(/\s+/).filter(Boolean);return f.length===0?"?":f.length===1?f[0].slice(0,2).toUpperCase():`${f[0][0]||""}${f[1][0]||""}`.toUpperCase()}function rr(w){if(w!=null)return w==="lazy"||w==="eager"?w:w?"eager":"lazy"}function ir(w,f,r){return w&&w.trim()?w.trim().slice(0,2).toUpperCase():f&&f.trim()?ce(f):typeof r=="string"&&r.trim()?ce(r):"?"}const Oe=K.forwardRef(function({src:f,alt:r,initials:s,size:n,bg:c,color:m,radius:l,fontWeight:i,shape:d,status:v,ring:u,loading:y,children:p,...g},A){const b=K.useRef(null),E=K.useMemo(()=>ir(s,r,p),[s,r,p]);return K.useImperativeHandle(A,()=>b.current),K.useEffect(()=>{ee("ui-avatar","Avatar")},[]),K.useEffect(()=>{const t=b.current;if(!t)return;f?t.setAttribute("src",f):t.removeAttribute("src"),r?t.setAttribute("alt",r):t.removeAttribute("alt"),s?t.setAttribute("initials",s):t.removeAttribute("initials"),n!=null?t.setAttribute("size",String(n)):t.removeAttribute("size"),c?t.setAttribute("bg",c):t.removeAttribute("bg"),m?t.setAttribute("color",m):t.removeAttribute("color"),l?t.setAttribute("radius",l):t.removeAttribute("radius"),i!=null?t.setAttribute("fontweight",String(i)):t.removeAttribute("fontweight"),d?t.setAttribute("shape",d):t.removeAttribute("shape"),v?t.setAttribute("status",v):t.removeAttribute("status"),u==null?t.removeAttribute("ring"):u?t.setAttribute("ring",""):t.removeAttribute("ring");const o=rr(y);o?t.setAttribute("loading",o):t.removeAttribute("loading")},[f,r,s,n,c,m,l,i,d,v,u,y]),K.createElement("ui-avatar",{ref:b,...g},E)});Oe.displayName="Avatar";const Ve=e.forwardRef(function({present:f,headless:r,mode:s,size:n,variant:c,keepMounted:m,lazy:l,enterDuration:i,exitDuration:d,delay:v,onBeforeEnter:u,onEnter:y,onAfterEnter:p,onBeforeExit:g,onExit:A,onAfterExit:b,children:E,...t},o){const h=e.useRef(null);return e.useImperativeHandle(o,()=>h.current),e.useEffect(()=>{const L=h.current;if(!L)return;const H=T=>{const N=T.detail;return(N==null?void 0:N.state)||"hidden"},a=T=>u==null?void 0:u(H(T)),k=T=>y==null?void 0:y(H(T)),R=T=>p==null?void 0:p(H(T)),P=T=>g==null?void 0:g(H(T)),F=T=>A==null?void 0:A(H(T)),B=T=>b==null?void 0:b(H(T));return L.addEventListener("before-enter",a),L.addEventListener("enter",k),L.addEventListener("after-enter",R),L.addEventListener("before-exit",P),L.addEventListener("exit",F),L.addEventListener("after-exit",B),()=>{L.removeEventListener("before-enter",a),L.removeEventListener("enter",k),L.removeEventListener("after-enter",R),L.removeEventListener("before-exit",P),L.removeEventListener("exit",F),L.removeEventListener("after-exit",B)}},[u,y,p,g,A,b]),e.useEffect(()=>{const L=h.current;L&&(f?L.setAttribute("present",""):L.removeAttribute("present"),r?L.setAttribute("headless",""):L.removeAttribute("headless"),s&&s!=="fade"?L.setAttribute("mode",s):L.removeAttribute("mode"),n&&n!=="md"?L.setAttribute("size",n):L.removeAttribute("size"),c&&c!=="default"?L.setAttribute("variant",c):L.removeAttribute("variant"),m?L.setAttribute("keep-mounted",""):L.removeAttribute("keep-mounted"),l?L.setAttribute("lazy",""):L.removeAttribute("lazy"),typeof i=="number"?L.setAttribute("enter-duration",String(i)):L.removeAttribute("enter-duration"),typeof d=="number"?L.setAttribute("exit-duration",String(d)):L.removeAttribute("exit-duration"),typeof v=="number"?L.setAttribute("delay",String(v)):L.removeAttribute("delay"))},[f,r,s,n,c,m,l,i,d,v]),e.createElement("ui-presence",{ref:h,...t},E)});Ve.displayName="Presence";const Ce=e.forwardRef(function({value:f,buffer:r,max:s,min:n,indeterminate:c,striped:m,animated:l,showLabel:i,label:d,format:v,precision:u,size:y,variant:p,tone:g,shape:A,mode:b,onValueChange:E,onComplete:t,children:o,...h},L){const H=e.useRef(null);return e.useImperativeHandle(L,()=>H.current),e.useEffect(()=>{const a=H.current;if(!a)return;const k=P=>{const F=P.detail;F&&(E==null||E(F))},R=P=>{const F=P.detail;F&&(t==null||t(F))};return a.addEventListener("change",k),a.addEventListener("complete",R),()=>{a.removeEventListener("change",k),a.removeEventListener("complete",R)}},[E,t]),e.useEffect(()=>{const a=H.current;if(!a)return;const k=(P,F)=>{const B=a.getAttribute(P);if(F==null){B!=null&&a.removeAttribute(P);return}B!==F&&a.setAttribute(P,F)},R=(P,F)=>{F?a.hasAttribute(P)||a.setAttribute(P,""):a.hasAttribute(P)&&a.removeAttribute(P)};k("value",f!=null?String(f):null),k("buffer",r!=null?String(r):null),k("max",s!=null?String(s):null),k("min",n!=null?String(n):null),R("indeterminate",c),R("striped",m),R("animated",l),R("show-label",i),k("label",d!=null&&d!==""?d:null),k("format",v!=null&&v!=="percent"?v:null),k("precision",u!=null?String(u):null),k("size",y&&y!=="md"?y:null),k("variant",p&&p!=="default"?p:null),k("tone",g&&g!=="brand"?g:null),k("shape",A&&A!=="pill"?A:null),k("mode",b&&b!=="line"?b:null)},[f,r,s,n,c,m,l,i,d,v,u,y,p,g,A,b]),e.createElement("ui-progress",{ref:H,...h},o)});Ce.displayName="Progress";const et=e.forwardRef(function({target:f,headless:r,disabled:s,strategy:n,onMount:c,onUnmount:m,onSync:l,onTargetMissing:i,children:d,...v},u){const y=e.useRef(null);return e.useImperativeHandle(u,()=>y.current),e.useEffect(()=>{const p=y.current;if(!p)return;const g=t=>c==null?void 0:c(t.detail||{count:0}),A=t=>m==null?void 0:m(t.detail||{count:0}),b=t=>l==null?void 0:l(t.detail||{count:0}),E=t=>{const o=t.detail;o&&(i==null||i(o))};return p.addEventListener("mount",g),p.addEventListener("unmount",A),p.addEventListener("sync",b),p.addEventListener("target-missing",E),()=>{p.removeEventListener("mount",g),p.removeEventListener("unmount",A),p.removeEventListener("sync",b),p.removeEventListener("target-missing",E)}},[c,m,l,i]),e.useEffect(()=>{const p=y.current;p&&(f?p.setAttribute("target",f):p.removeAttribute("target"),n&&n!=="append"?p.setAttribute("strategy",n):p.removeAttribute("strategy"),r?p.setAttribute("headless",""):p.removeAttribute("headless"),s?p.setAttribute("disabled",""):p.removeAttribute("disabled"))},[f,n,r,s]),e.createElement("ui-portal",{ref:y,...v},d)});et.displayName="Portal";const tt=e.forwardRef(function({orientation:f,size:r,variant:s,tone:n,autoHide:c,shadows:m,onScrollChange:l,onReachStart:i,onReachEnd:d,children:v,...u},y){const p=e.useRef(null);return e.useImperativeHandle(y,()=>p.current),e.useEffect(()=>{const g=p.current;if(!g)return;const A=t=>{const o=t.detail;o&&(l==null||l(o))},b=()=>i==null?void 0:i(),E=()=>d==null?void 0:d();return g.addEventListener("scroll",A),g.addEventListener("reach-start",b),g.addEventListener("reach-end",E),()=>{g.removeEventListener("scroll",A),g.removeEventListener("reach-start",b),g.removeEventListener("reach-end",E)}},[l,i,d]),e.useEffect(()=>{const g=p.current;if(!g)return;const A=(E,t)=>{const o=g.getAttribute(E);if(t==null){o!=null&&g.removeAttribute(E);return}o!==t&&g.setAttribute(E,t)},b=(E,t)=>{const o=g.getAttribute(E);if(t==null){o!=null&&g.removeAttribute(E);return}const h=t?"true":"false";o!==h&&g.setAttribute(E,h)};A("orientation",f&&f!=="vertical"?f:null),A("size",r&&r!=="md"?r:null),A("variant",s&&s!=="default"?s:null),A("tone",n&&n!=="neutral"?n:null),b("auto-hide",c),b("shadows",m)},[f,r,s,n,c,m]),e.createElement("ui-scroll-area",{ref:p,...u},v)});tt.displayName="ScrollArea";const rt=K.forwardRef((w,f)=>K.createElement("ui-separator",{ref:f,...w}));rt.displayName="Separator";const it=e.forwardRef(function({children:f,name:r,fallback:s,required:n,inline:c,align:m,size:l,variant:i,tone:d,headless:v,onSlotChange:u,onMissing:y,onResolved:p,...g},A){const b=e.useRef(null);return e.useImperativeHandle(A,()=>b.current),e.useEffect(()=>{const E=b.current;if(!E)return;const t=L=>{const H=L.detail;H&&(u==null||u(H))},o=()=>y==null?void 0:y(),h=()=>p==null?void 0:p();return E.addEventListener("slotchange",t),E.addEventListener("missing",o),E.addEventListener("resolved",h),()=>{E.removeEventListener("slotchange",t),E.removeEventListener("missing",o),E.removeEventListener("resolved",h)}},[u,y,p]),e.useEffect(()=>{const E=b.current;if(!E)return;const t=(h,L)=>{const H=E.getAttribute(h);if(L==null){H!=null&&E.removeAttribute(h);return}H!==L&&E.setAttribute(h,L)},o=(h,L)=>{L?t(h,""):t(h,null)};t("name",r||null),t("fallback",s||null),o("required",n),typeof c=="boolean"?t("inline",c?"true":"false"):t("inline",null),t("align",m&&m!=="start"?m:null),t("size",l&&l!=="md"?l:null),t("variant",i&&i!=="plain"?i:null),t("tone",d&&d!=="brand"?d:null),o("headless",v)},[r,s,n,c,m,l,i,d,v]),e.createElement("ui-slot",{ref:b,...g},f)});it.displayName="Slot";const nt=e.forwardRef(function({children:f,orientation:r,variant:s,size:n,density:c,wrap:m,loop:l,headless:i,...d},v){const u=e.useRef(null);return e.useImperativeHandle(v,()=>u.current),e.useEffect(()=>{const y=u.current;if(!y)return;const p=(A,b)=>{const E=y.getAttribute(A);if(b==null){E!=null&&y.removeAttribute(A);return}E!==b&&y.setAttribute(A,b)},g=(A,b)=>{b?p(A,""):p(A,null)};p("orientation",r&&r!=="horizontal"?r:null),p("variant",s&&s!=="default"?s:null),p("size",n&&n!=="md"?n:null),p("density",c&&c!=="default"?c:null),g("wrap",m),typeof l=="boolean"?g("loop",l):p("loop",null),g("headless",i)},[r,s,n,c,m,l,i]),e.createElement("ui-toolbar",{ref:u,...d},f)});nt.displayName="Toolbar";const lt=K.forwardRef((w,f)=>K.createElement("ui-visually-hidden",{ref:f,...w}));lt.displayName="VisuallyHidden";function oe(w,f,r){if(r==null){w.removeAttribute(f);return}r?w.setAttribute(f,""):w.removeAttribute(f)}function fe(w){var f;return(f=w.detail)==null?void 0:f.open}const st=K.forwardRef(function({header:f,open:r,headless:s,onToggle:n,onChangeOpen:c,children:m,...l},i){const d=K.useRef(null);K.useImperativeHandle(i,()=>d.current),K.useEffect(()=>{ee("ui-collapsible","Collapsible")},[]),K.useEffect(()=>{const u=d.current;u&&(oe(u,"open",r),oe(u,"headless",s))},[r,s]),K.useEffect(()=>{const u=d.current;if(!u||!n&&!c)return;const y=g=>{const A=fe(g);typeof A=="boolean"&&(n==null||n(A))},p=g=>{const A=fe(g);typeof A=="boolean"&&(c==null||c(A))};return u.addEventListener("toggle",y),u.addEventListener("change",p),()=>{u.removeEventListener("toggle",y),u.removeEventListener("change",p)}},[n,c]);let v=null;return f!=null&&(typeof f=="string"||typeof f=="number"?v=K.createElement("span",{slot:"header"},f):K.isValidElement(f)?v=K.cloneElement(f,{slot:"header"}):v=K.createElement("span",{slot:"header"},f)),K.createElement("ui-collapsible",{ref:d,...l},v,m)});st.displayName="Collapsible";const ut=K.forwardRef((w,f)=>K.createElement("ui-pagination",{ref:f,...w}));ut.displayName="Pagination";function nr(w,f,r){if(r==null){w.removeAttribute(f);return}r?w.setAttribute(f,""):w.removeAttribute(f)}function ae(w){var f;return(f=w.detail)==null?void 0:f.open}const ct=K.forwardRef(function({multiple:f,collapsible:r,open:s,onToggle:n,onChangeOpen:c,children:m,...l},i){const d=K.useRef(null);return K.useImperativeHandle(i,()=>d.current),K.useEffect(()=>{ee("ui-accordion","Accordion")},[]),K.useEffect(()=>{const v=d.current;v&&(nr(v,"multiple",f),r==null?v.removeAttribute("collapsible"):v.setAttribute("collapsible",String(!!r)),s==null?v.removeAttribute("open"):v.setAttribute("open",Array.isArray(s)?JSON.stringify(s):String(s)))},[f,r,s]),K.useEffect(()=>{const v=d.current;if(!v||!n&&!c)return;const u=p=>{const g=ae(p);g!=null&&(n==null||n(g))},y=p=>{const g=ae(p);g!=null&&(c==null||c(g))};return v.addEventListener("toggle",u),v.addEventListener("change",y),()=>{v.removeEventListener("toggle",u),v.removeEventListener("change",y)}},[n,c]),K.createElement("ui-accordion",{ref:d,...l},m)});ct.displayName="Accordion";const ot=K.forwardRef(function({disabled:f,children:r,...s},n){const c={ref:n,"data-ui-accordion-item":"",...s};return f&&(c.disabled=!0),K.createElement("div",c,r)});ot.displayName="AccordionItem";const ft=K.forwardRef(function({type:f,children:r,...s},n){return K.createElement("button",{ref:n,type:f||"button","data-ui-accordion-trigger":"",...s},r)});ft.displayName="AccordionTrigger";const at=K.forwardRef(function({children:f,...r},s){return K.createElement("div",{ref:s,"data-ui-accordion-panel":"",...r},f)});at.displayName="AccordionPanel";const dt=K.forwardRef((w,f)=>K.createElement("ui-direction-provider",{ref:f,...w}));dt.displayName="DirectionProvider";const bt=e.forwardRef(function({children:f,open:r,delay:s,closeDelay:n,placement:c,offset:m,variant:l,tone:i,density:d,shape:v,elevation:u,headless:y,onOpen:p,onClose:g,onChange:A,...b},E){const t=e.useRef(null);return e.useImperativeHandle(E,()=>t.current),e.useEffect(()=>{const o=t.current;if(!o)return;const h=()=>p==null?void 0:p(),L=()=>g==null?void 0:g(),H=a=>{var R;const k=(R=a.detail)==null?void 0:R.open;typeof k=="boolean"&&(A==null||A(k))};return o.addEventListener("open",h),o.addEventListener("close",L),o.addEventListener("change",H),()=>{o.removeEventListener("open",h),o.removeEventListener("close",L),o.removeEventListener("change",H)}},[p,g,A]),e.useEffect(()=>{const o=t.current;!o||r==null||(r?o.setAttribute("open",""):o.removeAttribute("open"))},[r]),e.useEffect(()=>{const o=t.current;o&&(typeof s=="number"?o.setAttribute("delay",String(s)):o.removeAttribute("delay"),typeof n=="number"?o.setAttribute("close-delay",String(n)):o.removeAttribute("close-delay"),c?o.setAttribute("placement",c):o.removeAttribute("placement"),typeof m=="number"?o.setAttribute("offset",String(m)):o.removeAttribute("offset"),l&&l!=="default"?o.setAttribute("variant",l):o.removeAttribute("variant"),i&&i!=="default"?o.setAttribute("tone",i):o.removeAttribute("tone"),d&&d!=="default"?o.setAttribute("density",d):o.removeAttribute("density"),v&&v!=="default"?o.setAttribute("shape",v):o.removeAttribute("shape"),u&&u!=="default"?o.setAttribute("elevation",u):o.removeAttribute("elevation"),y?o.setAttribute("headless",""):o.removeAttribute("headless"))},[s,n,c,m,l,i,d,v,u,y]),e.createElement("ui-hover-card",{ref:t,...b},f)});bt.displayName="HoverCard";const mt=e.forwardRef(function({children:f,htmlFor:r,for:s,required:n,description:c,variant:m,tone:l,size:i,density:d,shape:v,disabled:u,headless:y,...p},g){const A=e.useRef(null);return e.useImperativeHandle(g,()=>A.current),e.useEffect(()=>{const b=A.current;if(!b)return;const E=r||s;E?b.setAttribute("for",E):b.removeAttribute("for"),n?b.setAttribute("required",""):b.removeAttribute("required"),c?b.setAttribute("description",c):b.removeAttribute("description"),m&&m!=="default"?b.setAttribute("variant",m):b.removeAttribute("variant"),l&&l!=="default"?b.setAttribute("tone",l):b.removeAttribute("tone"),i&&i!=="md"&&i!=="2"?b.setAttribute("size",i):b.removeAttribute("size"),d&&d!=="default"?b.setAttribute("density",d):b.removeAttribute("density"),v&&v!=="default"?b.setAttribute("shape",v):b.removeAttribute("shape"),u?b.setAttribute("disabled",""):b.removeAttribute("disabled"),y?b.setAttribute("headless",""):b.removeAttribute("headless")},[r,s,n,c,m,l,i,d,v,u,y]),e.createElement("ui-label",{ref:A,...p},f)});mt.displayName="Label";const lr=typeof window<"u"?e.useLayoutEffect:e.useEffect,vt=e.forwardRef(function({children:f,open:r,headless:s,dismissible:n,closeOnEsc:c,closeOnBackdrop:m,lockWhileLoading:l,roleType:i,size:d,state:v,initialFocus:u,dialogId:y,config:p,onOpen:g,onConfirm:A,onCancel:b,onDismiss:E,onClose:t,onChange:o,...h},L){const H=e.useRef(null);return e.useImperativeHandle(L,()=>H.current),e.useEffect(()=>{const a=H.current;if(!a)return;const k=N=>g==null?void 0:g(N.detail),R=N=>A==null?void 0:A(N.detail),P=N=>b==null?void 0:b(N.detail),F=N=>E==null?void 0:E(N.detail),B=N=>t==null?void 0:t(N.detail),T=N=>o==null?void 0:o(N.detail);return a.addEventListener("ui-open",k),a.addEventListener("ui-confirm",R),a.addEventListener("ui-cancel",P),a.addEventListener("ui-dismiss",F),a.addEventListener("ui-close",B),a.addEventListener("ui-change",T),()=>{a.removeEventListener("ui-open",k),a.removeEventListener("ui-confirm",R),a.removeEventListener("ui-cancel",P),a.removeEventListener("ui-dismiss",F),a.removeEventListener("ui-close",B),a.removeEventListener("ui-change",T)}},[g,A,b,E,t,o]),lr(()=>{const a=H.current;a&&(typeof r=="boolean"&&(r?a.setAttribute("open",""):a.removeAttribute("open")),s?a.setAttribute("headless",""):a.removeAttribute("headless"),typeof n=="boolean"?a.setAttribute("dismissible",String(n)):a.removeAttribute("dismissible"),typeof c=="boolean"?a.setAttribute("close-on-esc",String(c)):a.removeAttribute("close-on-esc"),typeof m=="boolean"?a.setAttribute("close-on-backdrop",String(m)):a.removeAttribute("close-on-backdrop"),typeof l=="boolean"?a.setAttribute("lock-while-loading",String(l)):a.removeAttribute("lock-while-loading"),i?a.setAttribute("role",i):a.removeAttribute("role"),d&&d!=="md"?a.setAttribute("size",d):a.removeAttribute("size"),v&&v!=="idle"?a.setAttribute("state",v):a.removeAttribute("state"),u?a.setAttribute("initial-focus",u):a.removeAttribute("initial-focus"),y&&(a.dialogId=y),p&&(a.config=p))},[r,s,n,c,m,l,i,d,v,u,y,p]),e.createElement("ui-alert-dialog",{ref:H,...h},f)});vt.displayName="AlertDialog";const At=e.createContext(null);function sr({children:w,hostId:f="ui-alert-dialog-react-host"}){const r=e.useRef(null);r.current||(r.current=V.createAlertDialogManager()),e.useEffect(()=>{var c;if(typeof document>"u")return;let n=document.getElementById(f);return n||(n=document.createElement("div"),n.id=f,n.setAttribute("data-ui-alert-dialog-react-host","true"),document.body.appendChild(n)),(c=r.current)==null||c.setContainer(n),()=>{var m;(m=r.current)==null||m.destroy("unmount"),r.current=null,n&&n.parentElement&&n.parentElement.removeChild(n)}},[f]);const s=e.useMemo(()=>({alert:(n={})=>{var c;return((c=r.current)==null?void 0:c.alert(n))??Promise.resolve({id:"",action:"dismiss"})},confirm:(n={})=>{var c;return((c=r.current)==null?void 0:c.confirm(n))??Promise.resolve({id:"",action:"dismiss"})},prompt:(n={})=>{var c;return((c=r.current)==null?void 0:c.prompt(n))??Promise.resolve({id:"",action:"dismiss",value:""})}}),[]);return e.createElement(At.Provider,{value:s},w)}function ur(){const w=e.useContext(At);if(!w)throw new Error("useAlertDialog must be used within <AlertDialogProvider>.");return w}const Et=e.forwardRef(function({children:f,value:r,disabled:s,required:n,invalid:c,headless:m,placeholder:l,name:i,label:d,description:v,error:u,size:y,variant:p,tone:g,density:A,radius:b,validation:E,onChange:t,onInput:o,onValueChange:h,...L},H){const a=e.useRef(null);return e.useImperativeHandle(H,()=>a.current),e.useEffect(()=>{const k=a.current;if(!k)return;const R=B=>{var T,N;return((T=B.detail)==null?void 0:T.value)??((N=B.target)==null?void 0:N.value)??""},P=B=>{o==null||o(R(B))},F=B=>{const T=R(B);t==null||t(T),h==null||h(T)};return k.addEventListener("input",P),k.addEventListener("change",F),()=>{k.removeEventListener("input",P),k.removeEventListener("change",F)}},[t,o,h]),e.useEffect(()=>{const k=a.current;if(!k)return;const R=(F,B)=>{const T=k.getAttribute(F);if(B==null){T!=null&&k.removeAttribute(F);return}T!==B&&k.setAttribute(F,B)},P=(F,B)=>{B?k.hasAttribute(F)||k.setAttribute(F,""):k.hasAttribute(F)&&k.removeAttribute(F)};R("value",r!=null?String(r):null),P("disabled",s),P("required",n),P("headless",m),P("invalid",c),R("placeholder",l||null),R("name",i||null),R("label",d||null),R("description",v||null),R("error",u||null),R("size",y&&y!=="md"&&y!=="2"?y:null),R("variant",p&&p!=="classic"?p:null),R("tone",g&&g!=="default"?g:null),R("density",A&&A!=="default"?A:null),R("radius",b?String(b):null),R("validation",E&&E!=="none"?E:null)},[r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E]),e.createElement("ui-select",{ref:a,...L},f)});Et.displayName="Select";const pt=e.forwardRef(function({children:f,value:r,valueStart:s,valueEnd:n,min:c,max:m,step:l,range:i,disabled:d,headless:v,orientation:u,size:y,variant:p,tone:g,showValue:A,format:b,label:E,description:t,marks:o,name:h,nameStart:L,nameEnd:H,onInput:a,onChange:k,onValueChange:R,...P},F){const B=e.useRef(null);return e.useImperativeHandle(F,()=>B.current),e.useEffect(()=>{const T=B.current;if(!T)return;const N=S=>{const x=S.detail;x&&(a==null||a(Number(x.value)),R==null||R(x))},I=S=>{const x=S.detail;x&&(k==null||k(Number(x.value)),R==null||R(x))};return T.addEventListener("input",N),T.addEventListener("change",I),()=>{T.removeEventListener("input",N),T.removeEventListener("change",I)}},[a,k,R]),e.useEffect(()=>{const T=B.current;if(!T)return;const N=(S,x)=>{const D=T.getAttribute(S);if(x==null){D!=null&&T.removeAttribute(S);return}D!==x&&T.setAttribute(S,x)},I=(S,x,D)=>{if(x==null){D!==void 0&&D===!1&&N(S,null);return}x?N(S,""):N(S,null)};if(N("value",typeof r=="number"&&Number.isFinite(r)?String(r):null),N("value-start",typeof s=="number"&&Number.isFinite(s)?String(s):null),N("value-end",typeof n=="number"&&Number.isFinite(n)?String(n):null),N("min",typeof c=="number"&&Number.isFinite(c)?String(c):null),N("max",typeof m=="number"&&Number.isFinite(m)?String(m):null),N("step",typeof l=="number"&&Number.isFinite(l)?String(l):null),I("range",i),I("disabled",d),I("headless",v),N("orientation",u&&u!=="horizontal"?u:null),N("size",y&&y!=="md"?y:null),N("variant",p&&p!=="default"?p:null),N("tone",g&&g!=="brand"?g:null),typeof A=="boolean"?N("show-value",A?"true":"false"):N("show-value",null),N("format",b||null),N("label",E||null),N("description",t||null),N("name",h||null),N("name-start",L||null),N("name-end",H||null),o&&o.length)try{N("marks",JSON.stringify(o))}catch{N("marks",null)}else N("marks",null)},[r,s,n,c,m,l,i,d,v,u,y,p,g,A,b,E,t,o,h,L,H]),e.createElement("ui-slider",{ref:B,...P},f)});pt.displayName="Slider";function cr(w){const{count:f,width:r,height:s,radius:n,gap:c,variant:m,animated:l,headless:i,...d}=w,v=e.useRef(null);return e.useEffect(()=>{const u=v.current;u&&(typeof f=="number"&&Number.isFinite(f)?u.setAttribute("count",String(f)):u.removeAttribute("count"),r?u.setAttribute("width",r):u.removeAttribute("width"),s?u.setAttribute("height",s):u.removeAttribute("height"),n?u.setAttribute("radius",n):u.removeAttribute("radius"),c?u.setAttribute("gap",c):u.removeAttribute("gap"),m?u.setAttribute("variant",m):u.removeAttribute("variant"),l?u.setAttribute("animated",""):u.removeAttribute("animated"),i?u.setAttribute("headless",""):u.removeAttribute("headless"))},[f,r,s,n,c,m,l,i]),e.createElement("ui-skeleton",{ref:v,...d})}exports.Accordion=ct;exports.AccordionItem=ot;exports.AccordionPanel=at;exports.AccordionTrigger=ft;exports.Alert=Nt;exports.AlertDialog=vt;exports.AlertDialogProvider=sr;exports.AppHeader=Me;exports.AspectRatio=We;exports.Avatar=Oe;exports.Badge=St;exports.BlockControls=$e;exports.Box=Zt;exports.Breadcrumb=_e;exports.Button=Ht;exports.Calendar=pe;exports.Chart=Ae;exports.Checkbox=Ue;exports.Collapsible=st;exports.ColorPicker=ye;exports.Combobox=Pt;exports.CommandPalette=Qt;exports.Container=Ot;exports.ContextMenu=It;exports.DataTable=xt;exports.DatePicker=Le;exports.DateRangePicker=ge;exports.DateRangeTimePicker=Re;exports.DateTimePicker=we;exports.Dialog=Se;exports.DialogProvider=$t;exports.DirectionProvider=dt;exports.Drawer=Qe;exports.Dropdown=be;exports.EmptyState=Ft;exports.Field=kt;exports.Flex=zt;exports.FloatingToolbar=Mt;exports.Form=Je;exports.Gantt=He;exports.Grid=Wt;exports.HoverCard=bt;exports.Icon=Be;exports.Input=me;exports.Label=mt;exports.Layout=Ie;exports.Menu=De;exports.Menubar=Bt;exports.NavigationMenu=Dt;exports.Pagination=ut;exports.PluginPanel=Ut;exports.Popover=Te;exports.Portal=et;exports.Presence=Ve;exports.Progress=Ce;exports.QuickActions=Pe;exports.RadioGroup=Xe;exports.ScrollArea=tt;exports.Section=je;exports.Select=Et;exports.SelectionPopup=Kt;exports.Separator=rt;exports.Sidebar=Ge;exports.Skeleton=cr;exports.Slider=pt;exports.Slot=it;exports.Stepper=Ne;exports.Switch=Ye;exports.Table=Tt;exports.Tabs=xe;exports.Textarea=ve;exports.ThemeProvider=Ct;exports.TimePicker=he;exports.Timeline=Ee;exports.Toast=qe;exports.ToastAPI=_t;exports.Toggle=Ze;exports.ToggleGroup=ze;exports.Toolbar=nt;exports.Tooltip=de;exports.VisuallyHidden=lt;exports.Wizard=ke;exports.toast=jt;exports.toastApi=Gt;exports.useAlertDialog=ur;exports.useDialog=Jt;exports.useFloating=Yt;exports.useForm=Xt;exports.useTheme=er;
|