@murabei-data-science/pumpwood-ui 1.3.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/LICENSE +21 -0
- package/README.md +145 -0
- package/dist/components.d.ts +1227 -0
- package/dist/components.esm.js +39 -0
- package/dist/components.js +40 -0
- package/dist/design-system.d.ts +391 -0
- package/dist/design-system.esm.js +26 -0
- package/dist/design-system.js +27 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +1599 -0
- package/dist/index.esm.js +39 -0
- package/dist/index.js +40 -0
- package/dist/types/components/AlertWithIcon/index.d.ts +12 -0
- package/dist/types/components/Auth/AuthenticatedView.d.ts +18 -0
- package/dist/types/components/Auth/LoginCard.d.ts +33 -0
- package/dist/types/components/Auth/LoginCardSSO.d.ts +31 -0
- package/dist/types/components/Auth/NotAuthenticatedView.d.ts +21 -0
- package/dist/types/components/Auth/index.d.ts +4 -0
- package/dist/types/components/AutoFormContent/index.d.ts +46 -0
- package/dist/types/components/Badge/index.d.ts +17 -0
- package/dist/types/components/Card/index.d.ts +23 -0
- package/dist/types/components/ClearButton/index.d.ts +3 -0
- package/dist/types/components/CombinedFilterTable/index.d.ts +9 -0
- package/dist/types/components/ConfirmationDialog/index.d.ts +71 -0
- package/dist/types/components/CustomBreadcrumb/index.d.ts +6 -0
- package/dist/types/components/DatePicker/index.d.ts +35 -0
- package/dist/types/components/DeleteDialog/index.d.ts +9 -0
- package/dist/types/components/DetailPage/AutoDetailContent.d.ts +27 -0
- package/dist/types/components/DetailPage/DetailPage.d.ts +24 -0
- package/dist/types/components/DetailPage/detail-utils.d.ts +24 -0
- package/dist/types/components/DetailPage/index.d.ts +3 -0
- package/dist/types/components/DownloadButton/index.d.ts +20 -0
- package/dist/types/components/Dropzone/index.d.ts +21 -0
- package/dist/types/components/EmptyContainer/index.d.ts +16 -0
- package/dist/types/components/ErrorBoundary/index.d.ts +10 -0
- package/dist/types/components/ErrorMessage/index.d.ts +4 -0
- package/dist/types/components/ErrorToast/index.d.ts +4 -0
- package/dist/types/components/FKSelect/index.d.ts +63 -0
- package/dist/types/components/FileDropzone/index.d.ts +22 -0
- package/dist/types/components/FilePreview/index.d.ts +13 -0
- package/dist/types/components/Filters/CreatedByUserFilter.d.ts +24 -0
- package/dist/types/components/Filters/DateRangeFilter.d.ts +23 -0
- package/dist/types/components/KeyValueContent/index.d.ts +3 -0
- package/dist/types/components/Loading/index.d.ts +2 -0
- package/dist/types/components/M2MTable/index.d.ts +35 -0
- package/dist/types/components/MarkdownEditor/index.d.ts +12 -0
- package/dist/types/components/MultiSelectDropdown/index.d.ts +14 -0
- package/dist/types/components/NoResult/index.d.ts +15 -0
- package/dist/types/components/Pagination/index.d.ts +12 -0
- package/dist/types/components/Select/FKSelectVariant.d.ts +52 -0
- package/dist/types/components/Select/index.d.ts +70 -0
- package/dist/types/components/Sidebar/NavigationSidebar.d.ts +45 -0
- package/dist/types/components/Sidebar/index.d.ts +157 -0
- package/dist/types/components/Sidebar/useSidebarCollapse.d.ts +18 -0
- package/dist/types/components/Stack/index.d.ts +28 -0
- package/dist/types/components/Table/index.d.ts +92 -0
- package/dist/types/components/TableSkeleton/index.d.ts +23 -0
- package/dist/types/components/TagInput/index.d.ts +13 -0
- package/dist/types/components/Text/index.d.ts +21 -0
- package/dist/types/components/TooltipComponent/index.d.ts +8 -0
- package/dist/types/components/index.d.ts +56 -0
- package/dist/types/components/ui/accordion.d.ts +7 -0
- package/dist/types/components/ui/alert-dialog.d.ts +33 -0
- package/dist/types/components/ui/alert.d.ts +8 -0
- package/dist/types/components/ui/badge.d.ts +18 -0
- package/dist/types/components/ui/breadcrumb.d.ts +11 -0
- package/dist/types/components/ui/button.d.ts +32 -0
- package/dist/types/components/ui/calendar.d.ts +21 -0
- package/dist/types/components/ui/card.d.ts +21 -0
- package/dist/types/components/ui/checkbox.d.ts +4 -0
- package/dist/types/components/ui/combobox.d.ts +33 -0
- package/dist/types/components/ui/command.d.ts +31 -0
- package/dist/types/components/ui/dialog.d.ts +32 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/types/components/ui/empty.d.ts +23 -0
- package/dist/types/components/ui/input.d.ts +15 -0
- package/dist/types/components/ui/label.d.ts +5 -0
- package/dist/types/components/ui/popover.d.ts +18 -0
- package/dist/types/components/ui/radio.d.ts +3 -0
- package/dist/types/components/ui/select.d.ts +13 -0
- package/dist/types/components/ui/skeleton.d.ts +11 -0
- package/dist/types/components/ui/spinner.d.ts +8 -0
- package/dist/types/components/ui/table.d.ts +29 -0
- package/dist/types/components/ui/tabs.d.ts +20 -0
- package/dist/types/components/ui/textarea.d.ts +3 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/design-system/Auth/AuthenticatedView.d.ts +18 -0
- package/dist/types/design-system/Auth/LoginCard.d.ts +33 -0
- package/dist/types/design-system/Auth/LoginCardSSO.d.ts +31 -0
- package/dist/types/design-system/Auth/NotAuthenticatedView.d.ts +21 -0
- package/dist/types/design-system/Auth/index.d.ts +4 -0
- package/dist/types/design-system/AutoFormContent/index.d.ts +46 -0
- package/dist/types/design-system/CombinedFilterTable/index.d.ts +9 -0
- package/dist/types/design-system/CustomBreadcrumb/index.d.ts +6 -0
- package/dist/types/design-system/DetailPage/AutoDetailContent.d.ts +27 -0
- package/dist/types/design-system/DetailPage/DetailPage.d.ts +24 -0
- package/dist/types/design-system/DetailPage/detail-utils.d.ts +24 -0
- package/dist/types/design-system/DetailPage/index.d.ts +3 -0
- package/dist/types/design-system/FilePreview/index.d.ts +13 -0
- package/dist/types/design-system/Filters/CreatedByUserFilter.d.ts +24 -0
- package/dist/types/design-system/Filters/DateRangeFilter.d.ts +23 -0
- package/dist/types/design-system/KeyValueContent/index.d.ts +3 -0
- package/dist/types/design-system/M2MTable/index.d.ts +35 -0
- package/dist/types/design-system/NavigationSidebar/index.d.ts +47 -0
- package/dist/types/design-system/index.d.ts +11 -0
- package/dist/types/index.d.ts +67 -0
- package/dist/types/lib/field-trigger.d.ts +5 -0
- package/dist/types/lib/fk-select-fetcher.d.ts +26 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/src/components/Badge/index.d.ts +17 -0
- package/dist/types/src/components/Card/index.d.ts +23 -0
- package/dist/types/src/components/CombinedFilterTable/index.d.ts +9 -0
- package/dist/types/src/components/ConfirmationDialog/index.d.ts +71 -0
- package/dist/types/src/components/Dropzone/index.d.ts +21 -0
- package/dist/types/src/components/EmptyContainer/index.d.ts +16 -0
- package/dist/types/src/components/FKSelect/index.d.ts +45 -0
- package/dist/types/src/components/FileDropzone/index.d.ts +22 -0
- package/dist/types/src/components/Filters/CreatedByUserFilter.d.ts +24 -0
- package/dist/types/src/components/Filters/DateRangeFilter.d.ts +23 -0
- package/dist/types/src/components/Sidebar/index.d.ts +115 -0
- package/dist/types/src/components/Stack/index.d.ts +22 -0
- package/dist/types/src/components/Table/index.d.ts +29 -0
- package/dist/types/src/components/Text/index.d.ts +21 -0
- package/dist/types/src/components/ui/alert-dialog.d.ts +33 -0
- package/dist/types/src/components/ui/badge.d.ts +18 -0
- package/dist/types/src/components/ui/button.d.ts +22 -0
- package/dist/types/src/components/ui/calendar.d.ts +21 -0
- package/dist/types/src/components/ui/card.d.ts +21 -0
- package/dist/types/src/components/ui/combobox.d.ts +28 -0
- package/dist/types/src/components/ui/command.d.ts +31 -0
- package/dist/types/src/components/ui/dialog.d.ts +32 -0
- package/dist/types/src/components/ui/empty.d.ts +23 -0
- package/dist/types/src/components/ui/popover.d.ts +18 -0
- package/dist/types/src/components/ui/table.d.ts +29 -0
- package/dist/types/src/components/ui/tabs.d.ts +20 -0
- package/dist/types/src/index.d.ts +21 -0
- package/dist/types/src/lib/utils.d.ts +2 -0
- package/dist/types/src/stories/Components/CombinedFilterTable.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/ConfirmationDialog.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/CreatedByUserFilter.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/DateRangeFilter.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/EmptyContainer.stories.d.ts +24 -0
- package/dist/types/src/stories/Components/FKSelect.stories.d.ts +8 -0
- package/dist/types/src/stories/Components/FileDropZone.stories.d.ts +9 -0
- package/dist/types/src/stories/Components/Sidebar.stories.d.ts +18 -0
- package/dist/types/src/stories/Components/Table.stories.d.ts +11 -0
- package/dist/types/src/stories/Components/Tabs.stories.d.ts +13 -0
- package/dist/types/src/stories/Elements/Badge.stories.d.ts +13 -0
- package/dist/types/src/stories/Elements/Button.stories.d.ts +13 -0
- package/dist/types/src/stories/Elements/Stack.stories.d.ts +9 -0
- package/dist/types/src/stories/Elements/Text.stories.d.ts +8 -0
- package/dist/types/stories/Components/CombinedFilterTable.stories.d.ts +8 -0
- package/dist/types/stories/Components/ConfirmationDialog.stories.d.ts +8 -0
- package/dist/types/stories/Components/CreatedByUserFilter.stories.d.ts +8 -0
- package/dist/types/stories/Components/DateRangeFilter.stories.d.ts +8 -0
- package/dist/types/stories/Components/EmptyContainer.stories.d.ts +24 -0
- package/dist/types/stories/Components/FKSelect.stories.d.ts +8 -0
- package/dist/types/stories/Components/FileDropZone.stories.d.ts +9 -0
- package/dist/types/stories/Components/Sidebar.stories.d.ts +18 -0
- package/dist/types/stories/Components/Table.stories.d.ts +11 -0
- package/dist/types/stories/Components/Tabs.stories.d.ts +13 -0
- package/dist/types/stories/Elements/Badge.stories.d.ts +13 -0
- package/dist/types/stories/Elements/Button.stories.d.ts +13 -0
- package/dist/types/stories/Elements/Stack.stories.d.ts +9 -0
- package/dist/types/stories/Elements/Text.stories.d.ts +8 -0
- package/package.json +119 -0
- package/tailwind.config.ts +91 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { ReactNode, ComponentType, ComponentPropsWithoutRef, ImgHTMLAttributes } from 'react';
|
|
4
|
+
import { FKFetcherParams } from 'pumpwood-ui-components/components';
|
|
5
|
+
import { LucideIcon } from 'lucide-react';
|
|
6
|
+
|
|
7
|
+
interface DateRangeFilterProps {
|
|
8
|
+
startDate?: Date;
|
|
9
|
+
endDate?: Date;
|
|
10
|
+
onStartDateChange: (date: Date | undefined) => void;
|
|
11
|
+
onEndDateChange: (date: Date | undefined) => void;
|
|
12
|
+
startLabel?: string;
|
|
13
|
+
endLabel?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A date range picker filter component.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <DateRangeFilter
|
|
22
|
+
* startDate={startDate}
|
|
23
|
+
* endDate={endDate}
|
|
24
|
+
* onStartDateChange={setStartDate}
|
|
25
|
+
* onEndDateChange={setEndDate}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
declare const DateRangeFilter: ({ startDate, endDate, onStartDateChange, onEndDateChange, startLabel, endLabel, className, }: DateRangeFilterProps) => react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
interface CreatedByUserFilterProps {
|
|
32
|
+
value: string | number | null;
|
|
33
|
+
onChange: (value: string | number, item?: any) => void;
|
|
34
|
+
fetcher: (params: {
|
|
35
|
+
search: string;
|
|
36
|
+
modelClass: string;
|
|
37
|
+
limit?: number;
|
|
38
|
+
offset?: number;
|
|
39
|
+
}) => Promise<any[]>;
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A filter component to select a user who created a resource.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <CreatedByUserFilter
|
|
48
|
+
* fetcher={fetchUsers}
|
|
49
|
+
* value={selectedUser}
|
|
50
|
+
* onChange={setSelectedUser}
|
|
51
|
+
* />
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare const CreatedByUserFilter: ({ value, onChange, fetcher, className, }: CreatedByUserFilterProps) => react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A demonstration component combining filters and a table.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <CombinedFilterTable />
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare const CombinedFilterTable: () => react_jsx_runtime.JSX.Element;
|
|
65
|
+
|
|
66
|
+
declare function KeyValueContent({ data }: {
|
|
67
|
+
data: Record<string, any>;
|
|
68
|
+
}): react_jsx_runtime.JSX.Element;
|
|
69
|
+
|
|
70
|
+
interface ILoginCardProps {
|
|
71
|
+
onLogin: (credentials: {
|
|
72
|
+
username: string;
|
|
73
|
+
password: string;
|
|
74
|
+
}) => Promise<{
|
|
75
|
+
error?: string | null;
|
|
76
|
+
}>;
|
|
77
|
+
onSuccess?: () => void;
|
|
78
|
+
onError?: (message: string, error: string) => void;
|
|
79
|
+
sessionExpired?: boolean;
|
|
80
|
+
sessionExpiredAlert?: {
|
|
81
|
+
icon: ReactNode;
|
|
82
|
+
title?: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
};
|
|
85
|
+
forgotPasswordHref?: string;
|
|
86
|
+
forgotPasswordLabel?: string;
|
|
87
|
+
usernameLabel?: string;
|
|
88
|
+
passwordLabel?: string;
|
|
89
|
+
submitLabel?: string;
|
|
90
|
+
loginErrorMessage?: string;
|
|
91
|
+
LinkComponent?: ComponentType<{
|
|
92
|
+
href: string;
|
|
93
|
+
className?: string;
|
|
94
|
+
children: ReactNode;
|
|
95
|
+
}>;
|
|
96
|
+
className?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Username and password login card.
|
|
100
|
+
*/
|
|
101
|
+
declare function LoginCard({ onLogin, onSuccess, onError, sessionExpired, sessionExpiredAlert, forgotPasswordHref, forgotPasswordLabel, usernameLabel, passwordLabel, submitLabel, loginErrorMessage, LinkComponent, className, }: ILoginCardProps): react_jsx_runtime.JSX.Element;
|
|
102
|
+
|
|
103
|
+
interface ILoginCardSSOProps {
|
|
104
|
+
onLoginSSO: (email: string) => Promise<{
|
|
105
|
+
redirect_url?: string | null;
|
|
106
|
+
error?: string | null;
|
|
107
|
+
}>;
|
|
108
|
+
onRedirect?: (url: string) => void;
|
|
109
|
+
onError?: (message: string, error: string) => void;
|
|
110
|
+
sessionExpired?: boolean;
|
|
111
|
+
sessionExpiredAlert?: {
|
|
112
|
+
icon: ReactNode;
|
|
113
|
+
title?: string;
|
|
114
|
+
description?: string;
|
|
115
|
+
};
|
|
116
|
+
forgotPasswordHref?: string;
|
|
117
|
+
forgotPasswordLabel?: string;
|
|
118
|
+
emailLabel?: string;
|
|
119
|
+
submitLabel?: string;
|
|
120
|
+
unauthorizedMessage?: string;
|
|
121
|
+
genericErrorMessage?: string;
|
|
122
|
+
LinkComponent?: ComponentType<{
|
|
123
|
+
href: string;
|
|
124
|
+
className?: string;
|
|
125
|
+
children: ReactNode;
|
|
126
|
+
}>;
|
|
127
|
+
className?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* SSO email login card.
|
|
131
|
+
*/
|
|
132
|
+
declare function LoginCardSSO({ onLoginSSO, onRedirect, onError, sessionExpired, sessionExpiredAlert, forgotPasswordHref, forgotPasswordLabel, emailLabel, submitLabel, unauthorizedMessage, genericErrorMessage, LinkComponent, className, }: ILoginCardSSOProps): react_jsx_runtime.JSX.Element;
|
|
133
|
+
|
|
134
|
+
interface IAuthenticatedViewProps {
|
|
135
|
+
redirectHref: string;
|
|
136
|
+
redirectDelayMs?: number;
|
|
137
|
+
onRedirect?: (href: string) => void;
|
|
138
|
+
title?: string;
|
|
139
|
+
fallbackLinkLabel?: string;
|
|
140
|
+
LinkComponent?: ComponentType<{
|
|
141
|
+
href: string;
|
|
142
|
+
className?: string;
|
|
143
|
+
children: ReactNode;
|
|
144
|
+
}>;
|
|
145
|
+
className?: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* OAuth success screen with auto-redirect.
|
|
149
|
+
*/
|
|
150
|
+
declare function AuthenticatedView({ redirectHref, redirectDelayMs, onRedirect, title, fallbackLinkLabel, LinkComponent, className, }: IAuthenticatedViewProps): react_jsx_runtime.JSX.Element;
|
|
151
|
+
|
|
152
|
+
interface INotAuthenticatedViewProps {
|
|
153
|
+
error: unknown;
|
|
154
|
+
loginHref: string;
|
|
155
|
+
title?: string;
|
|
156
|
+
description?: string;
|
|
157
|
+
fallbackLinkLabel?: string;
|
|
158
|
+
errorDetailsLabel?: string;
|
|
159
|
+
copyLabel?: string;
|
|
160
|
+
copiedLabel?: string;
|
|
161
|
+
LinkComponent?: ComponentType<{
|
|
162
|
+
href: string;
|
|
163
|
+
className?: string;
|
|
164
|
+
children: ReactNode;
|
|
165
|
+
}>;
|
|
166
|
+
className?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* OAuth error screen with expandable error details.
|
|
170
|
+
*/
|
|
171
|
+
declare function NotAuthenticatedView({ error, loginHref, title, description, fallbackLinkLabel, errorDetailsLabel, copyLabel, copiedLabel, LinkComponent, className, }: INotAuthenticatedViewProps): react_jsx_runtime.JSX.Element;
|
|
172
|
+
|
|
173
|
+
interface IDetailSection {
|
|
174
|
+
title: string;
|
|
175
|
+
fields: string[];
|
|
176
|
+
cols?: 2 | 3 | 4;
|
|
177
|
+
isFullWidth?: boolean;
|
|
178
|
+
}
|
|
179
|
+
interface IDetailFieldConfig {
|
|
180
|
+
exclude?: string[];
|
|
181
|
+
labels?: Record<string, string>;
|
|
182
|
+
formatters?: Record<string, (value: unknown) => string>;
|
|
183
|
+
sections?: IDetailSection[];
|
|
184
|
+
}
|
|
185
|
+
interface IFormatDetailValueOptions {
|
|
186
|
+
statusLabels?: Record<string, string>;
|
|
187
|
+
formatDate?: (date: string) => string;
|
|
188
|
+
booleanLabels?: {
|
|
189
|
+
true: string;
|
|
190
|
+
false: string;
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
declare const formatDetailLabel: (key: string, labels?: Record<string, string>) => string;
|
|
194
|
+
declare const formatDetailValue: (value: unknown, key: string, options?: IFormatDetailValueOptions) => string;
|
|
195
|
+
declare const getDetailFieldValue: (data: Record<string, unknown>, key: string) => unknown;
|
|
196
|
+
declare const FULL_WIDTH_DETAIL_FIELDS: string[];
|
|
197
|
+
|
|
198
|
+
interface IAutoDetailContentProps {
|
|
199
|
+
data: Record<string, any>;
|
|
200
|
+
config?: IDetailFieldConfig;
|
|
201
|
+
formatters?: {
|
|
202
|
+
key: string;
|
|
203
|
+
formatter: (value: unknown) => string;
|
|
204
|
+
}[];
|
|
205
|
+
wrapperElements?: {
|
|
206
|
+
keys: string[];
|
|
207
|
+
element: (props: {
|
|
208
|
+
key: string;
|
|
209
|
+
label: string;
|
|
210
|
+
fieldValue: unknown;
|
|
211
|
+
isFullWidth: boolean;
|
|
212
|
+
data: Record<string, any>;
|
|
213
|
+
}) => ReactNode;
|
|
214
|
+
}[];
|
|
215
|
+
statusLabels?: Record<string, string>;
|
|
216
|
+
formatDate?: (date: string) => string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Auto-render entity detail fields in configurable sections.
|
|
220
|
+
*/
|
|
221
|
+
declare function AutoDetailContent({ data, config, formatters, wrapperElements, statusLabels, formatDate, }: IAutoDetailContentProps): react_jsx_runtime.JSX.Element;
|
|
222
|
+
|
|
223
|
+
interface IDetailPageSection {
|
|
224
|
+
id?: string;
|
|
225
|
+
title: string;
|
|
226
|
+
content: ReactNode;
|
|
227
|
+
defaultOpen?: boolean;
|
|
228
|
+
}
|
|
229
|
+
interface IDetailPageProps {
|
|
230
|
+
title: string;
|
|
231
|
+
titleAddon?: ReactNode;
|
|
232
|
+
isLoading?: boolean;
|
|
233
|
+
error?: Error | null;
|
|
234
|
+
onBack?: () => void;
|
|
235
|
+
actions?: ReactNode;
|
|
236
|
+
sections?: IDetailPageSection[];
|
|
237
|
+
children?: ReactNode;
|
|
238
|
+
loadingComponent?: ReactNode;
|
|
239
|
+
errorComponent?: ReactNode;
|
|
240
|
+
backButtonLabel?: string;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Reusable detail page shell with header, loading/error states and sections.
|
|
244
|
+
*/
|
|
245
|
+
declare function DetailPage({ title, titleAddon, isLoading, error, onBack, actions, sections, children, loadingComponent, errorComponent, backButtonLabel, }: IDetailPageProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Interface representing a form field specification
|
|
249
|
+
*/
|
|
250
|
+
interface IFormField {
|
|
251
|
+
type: "text" | "number" | "password" | "email" | "textarea" | "checkbox" | "select" | "date" | "key-value";
|
|
252
|
+
label?: string;
|
|
253
|
+
placeholder?: string;
|
|
254
|
+
required?: boolean;
|
|
255
|
+
disabled?: boolean;
|
|
256
|
+
options?: {
|
|
257
|
+
label: string;
|
|
258
|
+
value: string;
|
|
259
|
+
}[];
|
|
260
|
+
className?: string;
|
|
261
|
+
cols?: 1 | 2 | 3 | 4;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Custom section grouping configuration similar to AutoDetailContent
|
|
265
|
+
*/
|
|
266
|
+
interface IFormSection {
|
|
267
|
+
title: string;
|
|
268
|
+
fields: string[];
|
|
269
|
+
cols?: 1 | 2 | 3 | 4;
|
|
270
|
+
isFullWidth?: boolean;
|
|
271
|
+
}
|
|
272
|
+
interface IAutoFormContentProps {
|
|
273
|
+
fields: Record<string, IFormField>;
|
|
274
|
+
values?: Record<string, any>;
|
|
275
|
+
defaultValue?: Record<string, any>;
|
|
276
|
+
onChange?: (values: Record<string, any>) => void;
|
|
277
|
+
errors?: Record<string, string>;
|
|
278
|
+
config?: {
|
|
279
|
+
exclude?: string[];
|
|
280
|
+
labels?: Record<string, string>;
|
|
281
|
+
sections?: IFormSection[];
|
|
282
|
+
};
|
|
283
|
+
customFields?: Record<string, (props: {
|
|
284
|
+
value: any;
|
|
285
|
+
onChange: (val: any) => void;
|
|
286
|
+
error?: string;
|
|
287
|
+
disabled?: boolean;
|
|
288
|
+
fieldKey: string;
|
|
289
|
+
}) => react.ReactNode>;
|
|
290
|
+
}
|
|
291
|
+
declare function AutoFormContent({ fields, values: externalValues, defaultValue, onChange, errors, config, customFields, }: IAutoFormContentProps): react_jsx_runtime.JSX.Element;
|
|
292
|
+
|
|
293
|
+
type M2MListFn = (modelClass: string, filterDict: Record<string, any>, fields: string[]) => Promise<[
|
|
294
|
+
Record<string, any>[] | null,
|
|
295
|
+
{
|
|
296
|
+
message?: string;
|
|
297
|
+
} | null
|
|
298
|
+
]>;
|
|
299
|
+
declare const M2MCreateDialog: ({ open, onOpenChange, targetModelClass, relationName, handleCreateNew, mutate, fkFetcher, }: {
|
|
300
|
+
open: boolean;
|
|
301
|
+
onOpenChange: (open: boolean) => void;
|
|
302
|
+
targetModelClass: string;
|
|
303
|
+
relationName: string;
|
|
304
|
+
handleCreateNew: (id: string) => void;
|
|
305
|
+
mutate: () => void;
|
|
306
|
+
fkFetcher: (params: FKFetcherParams) => Promise<any[]>;
|
|
307
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
308
|
+
interface IM2MTableProps extends Omit<ComponentPropsWithoutRef<"div">, "onChange"> {
|
|
309
|
+
modelClass: string;
|
|
310
|
+
targetModelClass: string;
|
|
311
|
+
filterDict: Record<string, any>;
|
|
312
|
+
targetField: string;
|
|
313
|
+
relationName: string;
|
|
314
|
+
displayFields: {
|
|
315
|
+
name: string;
|
|
316
|
+
field: string;
|
|
317
|
+
}[];
|
|
318
|
+
handleCreateNew: (id: string) => void;
|
|
319
|
+
handleDeleteItem: (id: string) => void;
|
|
320
|
+
fields: string[];
|
|
321
|
+
listFn: M2MListFn;
|
|
322
|
+
fkFetcher: (params: FKFetcherParams) => Promise<any[]>;
|
|
323
|
+
}
|
|
324
|
+
declare const M2MTable: ({ modelClass, targetModelClass, targetField, filterDict, relationName, fields, displayFields, handleCreateNew, handleDeleteItem, listFn, fkFetcher, }: IM2MTableProps) => react_jsx_runtime.JSX.Element;
|
|
325
|
+
|
|
326
|
+
interface ICustomBreadcrumbProps {
|
|
327
|
+
label: string;
|
|
328
|
+
steps?: string[];
|
|
329
|
+
}
|
|
330
|
+
declare function CustomBreadcrumb({ label, steps, }: ICustomBreadcrumbProps): react_jsx_runtime.JSX.Element;
|
|
331
|
+
|
|
332
|
+
type FileTypeCategory = "image" | "video" | "pdf" | "doc" | "excel" | "ppt" | "other";
|
|
333
|
+
interface FilePreviewProps {
|
|
334
|
+
fileUrl: string;
|
|
335
|
+
fileName: string;
|
|
336
|
+
isLoading?: boolean;
|
|
337
|
+
getFileType: (fileName: string) => FileTypeCategory;
|
|
338
|
+
ImageComponent?: ComponentType<ImgHTMLAttributes<HTMLImageElement> & {
|
|
339
|
+
fill?: boolean;
|
|
340
|
+
}>;
|
|
341
|
+
}
|
|
342
|
+
declare const FilePreview: ({ fileUrl, fileName, isLoading, getFileType, ImageComponent, }: FilePreviewProps) => react_jsx_runtime.JSX.Element;
|
|
343
|
+
|
|
344
|
+
interface INavigationSidebarSubLink {
|
|
345
|
+
title: string;
|
|
346
|
+
href: string;
|
|
347
|
+
}
|
|
348
|
+
interface INavigationSidebarLink {
|
|
349
|
+
title: string;
|
|
350
|
+
href?: string;
|
|
351
|
+
icon: string;
|
|
352
|
+
subItems?: INavigationSidebarSubLink[];
|
|
353
|
+
}
|
|
354
|
+
interface INavigationSidebarLogo {
|
|
355
|
+
src: string;
|
|
356
|
+
alt: string;
|
|
357
|
+
width?: number;
|
|
358
|
+
height?: number;
|
|
359
|
+
collapsedWidth?: number;
|
|
360
|
+
collapsedHeight?: number;
|
|
361
|
+
}
|
|
362
|
+
interface INavigationSidebarProps {
|
|
363
|
+
links: INavigationSidebarLink[];
|
|
364
|
+
iconMap: Record<string, LucideIcon>;
|
|
365
|
+
pathname: string;
|
|
366
|
+
isSidebarCollapsedFromQuery?: boolean;
|
|
367
|
+
logo: INavigationSidebarLogo;
|
|
368
|
+
onLogout: () => void | Promise<void>;
|
|
369
|
+
logoutIcon?: LucideIcon;
|
|
370
|
+
logoutLabel?: string;
|
|
371
|
+
LinkComponent?: ComponentType<{
|
|
372
|
+
href: any;
|
|
373
|
+
className?: string;
|
|
374
|
+
children: ReactNode;
|
|
375
|
+
title?: string;
|
|
376
|
+
}>;
|
|
377
|
+
ImageComponent?: ComponentType<{
|
|
378
|
+
src: string;
|
|
379
|
+
alt: string;
|
|
380
|
+
width: number;
|
|
381
|
+
height: number;
|
|
382
|
+
className?: string;
|
|
383
|
+
}>;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Configurable navigation sidebar with collapse, groups and logout.
|
|
387
|
+
*/
|
|
388
|
+
declare function NavigationSidebar({ links, iconMap, pathname, isSidebarCollapsedFromQuery, logo, onLogout, logoutIcon, logoutLabel, LinkComponent, ImageComponent, }: INavigationSidebarProps): react_jsx_runtime.JSX.Element;
|
|
389
|
+
|
|
390
|
+
export { AuthenticatedView, AutoDetailContent, AutoFormContent, CombinedFilterTable, CreatedByUserFilter, CustomBreadcrumb, DateRangeFilter, DetailPage, FULL_WIDTH_DETAIL_FIELDS, FilePreview, KeyValueContent, LoginCard, LoginCardSSO, M2MCreateDialog, M2MTable, NavigationSidebar, NotAuthenticatedView, formatDetailLabel, formatDetailValue, getDetailFieldValue };
|
|
391
|
+
export type { FileTypeCategory, IAuthenticatedViewProps, IAutoDetailContentProps, IAutoFormContentProps, IDetailFieldConfig, IDetailPageProps, IDetailPageSection, IDetailSection, IFormField, IFormSection, IFormatDetailValueOptions, ILoginCardProps, ILoginCardSSOProps, INavigationSidebarLink, INavigationSidebarLogo, INavigationSidebarProps, INavigationSidebarSubLink, INotAuthenticatedViewProps, M2MListFn };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{forwardRef as e,createElement as t,useState as r,useEffect as n,Fragment as o}from"react";import{Calendar as a}from"pumpwood-ui-components/components";import{Popover as i,PopoverTrigger as s,PopoverContent as l}from"pumpwood-ui-components/components";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";import{FKSelect as m}from"pumpwood-ui-components/components";import{PumpwoodTable as h}from"pumpwood-ui-components/components";import{EmptyContainer as p}from"pumpwood-ui-components/components";import{Button as f}from"pumpwood-ui-components/components";import{Stack as g,ErrorBoundary as b,Loading as w}from"pumpwood-ui-components/components";import{AlertWithIcon as y}from"pumpwood-ui-components/components";import{Card as x,CardHeader as v,CardContent as k,CardFooter as N}from"pumpwood-ui-components/components";import{Input as C}from"pumpwood-ui-components/components";import{Label as M}from"pumpwood-ui-components/components";import{Spinner as S}from"pumpwood-ui-components/components";import{Accordion as z,AccordionItem as j,AccordionTrigger as P,AccordionContent as D}from"pumpwood-ui-components/components";import{Checkbox as _}from"pumpwood-ui-components/components";import{Select as L,SelectTrigger as O,SelectValue as W,SelectContent as F,SelectItem as E}from"pumpwood-ui-components/components";import{Textarea as T}from"pumpwood-ui-components/components";import q from"swr";import{Dialog as A,DialogContent as H}from"pumpwood-ui-components/components";import{Table as I,TableHeader as G,TableRow as $,TableHead as Y,TableBody as B,TableCell as R}from"pumpwood-ui-components/components";import{DeleteDialog as V}from"pumpwood-ui-components/components";import{NoResult as Q}from"pumpwood-ui-components/components";import{Breadcrumb as U,BreadcrumbList as X,BreadcrumbItem as J,BreadcrumbPage as K,BreadcrumbSeparator as Z}from"pumpwood-ui-components/components";import{Sidebar as ee}from"pumpwood-ui-components/components";import{useSidebarCollapse as te}from"pumpwood-ui-components/components";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.562.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const re=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},ne=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),oe=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v0.562.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
var ae={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
|
|
15
|
+
/**
|
|
16
|
+
* @license lucide-react v0.562.0 - ISC
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the ISC license.
|
|
19
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/const ie=e(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:a="",children:i,iconNode:s,...l},c)=>t("svg",{ref:c,...ae,width:r,height:r,stroke:e,strokeWidth:o?24*Number(n)/Number(r):n,className:ne("lucide",a),...!i&&!oe(l)&&{"aria-hidden":"true"},...l},[...s.map(([e,r])=>t(e,r)),...Array.isArray(i)?i:[i]])),se=(r,n)=>{const o=e(({className:e,...o},a)=>{return t(ie,{ref:a,iconNode:n,className:ne(`lucide-${i=re(r),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${r}`,e),...o});var i});return o.displayName=re(r),o},le=se("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),ce=se("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),de=se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),ue=se("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),me=se("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]),he=se("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),pe=se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),fe=se("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]),ge=se("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),be=se("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]),we=se("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ye=6048e5,xe=Symbol.for("constructDateFrom");
|
|
21
|
+
/**
|
|
22
|
+
* @license lucide-react v0.562.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/function ve(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&xe in e?e[xe](t):e instanceof Date?new e.constructor(t):new Date(t)}function ke(e,t){return ve(t||e,e)}let Ne={};function Ce(){return Ne}function Me(e,t){const r=Ce(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=ke(e,t?.in),a=o.getDay(),i=(a<n?7:0)+a-n;return o.setDate(o.getDate()-i),o.setHours(0,0,0,0),o}function Se(e,t){return Me(e,{...t,weekStartsOn:1})}function ze(e,t){const r=ke(e,t?.in),n=r.getFullYear(),o=ve(r,0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);const a=Se(o),i=ve(r,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=Se(i);return r.getTime()>=a.getTime()?n+1:r.getTime()>=s.getTime()?n:n-1}function je(e){const t=ke(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Pe(e,t){const r=ke(e,t?.in);return r.setHours(0,0,0,0),r}function De(e,t,r){const[n,o]=function(e,...t){const r=ve.bind(null,t.find(e=>"object"==typeof e));return t.map(r)}(0,e,t),a=Pe(n),i=Pe(o),s=+a-je(a),l=+i-je(i);return Math.round((s-l)/864e5)}function _e(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+ke(e)));var t}const Le={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Oe(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const We={date:Oe({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Oe({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Oe({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Fe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Ee(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=r?.width?String(r.width):t;n=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=r?.width?String(r.width):e.defaultWidth;n=e.values[o]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function Te(e){return(t,r={})=>{const n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const i=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r;return}(s,e=>e.test(i)):function(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r;return}(s,e=>e.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=r.valueCallback?r.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}var qe;const Ae={code:"en-US",formatDistance:(e,t,r)=>{let n;const o=Le[e];return n="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:We,formatRelative:(e,t,r,n)=>Fe[e],localize:{ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Ee({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Ee({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ee({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Ee({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Ee({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(qe={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const r=e.match(qe.matchPattern);if(!r)return null;const n=r[0],o=e.match(qe.parsePattern);if(!o)return null;let a=qe.valueCallback?qe.valueCallback(o[0]):o[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(n.length)}}),era:Te({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Te({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Te({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Te({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Te({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function He(e,t){const r=ke(e,t?.in),n=De(r,function(e,t){const r=ke(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}(r));return n+1}function Ie(e,t){const r=ke(e,t?.in),n=+Se(r)-+function(e,t){const r=ze(e,t),n=ve(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Se(n)}(r);return Math.round(n/ye)+1}function Ge(e,t){const r=ke(e,t?.in),n=r.getFullYear(),o=Ce(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=ve(t?.in||e,0);i.setFullYear(n+1,0,a),i.setHours(0,0,0,0);const s=Me(i,t),l=ve(t?.in||e,0);l.setFullYear(n,0,a),l.setHours(0,0,0,0);const c=Me(l,t);return+r>=+s?n+1:+r>=+c?n:n-1}function $e(e,t){const r=ke(e,t?.in),n=+Me(r,t)-+function(e,t){const r=Ce(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=Ge(e,t),a=ve(t?.in||e,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),Me(a,t)}(r,t);return Math.round(n/ye)+1}function Ye(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Be={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Ye("yy"===t?n%100:n,t.length)},M(e,t){const r=e.getMonth();return"M"===t?String(r+1):Ye(r+1,2)},d:(e,t)=>Ye(e.getDate(),t.length),a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>Ye(e.getHours()%12||12,t.length),H:(e,t)=>Ye(e.getHours(),t.length),m:(e,t)=>Ye(e.getMinutes(),t.length),s:(e,t)=>Ye(e.getSeconds(),t.length),S(e,t){const r=t.length,n=e.getMilliseconds();return Ye(Math.trunc(n*Math.pow(10,r-3)),t.length)}},Re="midnight",Ve="noon",Qe="morning",Ue="afternoon",Xe="evening",Je="night",Ke={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){const t=e.getFullYear(),n=t>0?t:1-t;return r.ordinalNumber(n,{unit:"year"})}return Be.y(e,t)},Y:function(e,t,r,n){const o=Ge(e,n),a=o>0?o:1-o;if("YY"===t){return Ye(a%100,2)}return"Yo"===t?r.ordinalNumber(a,{unit:"year"}):Ye(a,t.length)},R:function(e,t){return Ye(ze(e),t.length)},u:function(e,t){return Ye(e.getFullYear(),t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Ye(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Ye(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return Be.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Ye(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const o=$e(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):Ye(o,t.length)},I:function(e,t,r){const n=Ie(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):Ye(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):Be.d(e,t)},D:function(e,t,r){const n=He(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):Ye(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Ye(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Ye(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return Ye(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let o;switch(o=12===n?Ve:0===n?Re:n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let o;switch(o=n>=17?Xe:n>=12?Ue:n>=4?Qe:Je,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return Be.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):Be.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):Ye(n,t.length)},k:function(e,t,r){let n=e.getHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):Ye(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):Be.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):Be.s(e,t)},S:function(e,t){return Be.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return et(n);case"XXXX":case"XX":return tt(n);default:return tt(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return et(n);case"xxxx":case"xx":return tt(n);default:return tt(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ze(n,":");default:return"GMT"+tt(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ze(n,":");default:return"GMT"+tt(n,":")}},t:function(e,t,r){return Ye(Math.trunc(+e/1e3),t.length)},T:function(e,t,r){return Ye(+e,t.length)}};function Ze(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),a=n%60;return 0===a?r+String(o):r+String(o)+t+Ye(a,2)}function et(e,t){if(e%60==0){return(e>0?"-":"+")+Ye(Math.abs(e)/60,2)}return tt(e,t)}function tt(e,t=""){const r=e>0?"-":"+",n=Math.abs(e);return r+Ye(Math.trunc(n/60),2)+t+Ye(n%60,2)}const rt=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},nt=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},ot={p:nt,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return rt(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",rt(n,t)).replace("{{time}}",nt(o,t))}},at=/^D+$/,it=/^Y+$/,st=["D","DD","YY","YYYY"];const lt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ct=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dt=/^'([^]*?)'?$/,ut=/''/g,mt=/[a-zA-Z]/;function ht(e,t,r){const n=Ce(),o=n.locale??Ae,a=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ke(e,r?.in);if(!_e(s))throw new RangeError("Invalid time value");let l=t.match(ct).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,ot[t])(e,o.formatLong)}return e}).join("").match(lt).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:pt(e)};if(Ke[t])return{isToken:!0,value:e};if(t.match(mt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});o.localize.preprocessor&&(l=o.localize.preprocessor(s,l));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return l.map(r=>{if(!r.isToken)return r.value;const n=r.value;(function(e){return it.test(e)}(n)||function(e){return at.test(e)}(n))&&function(e,t,r){const n=function(e,t,r){const n="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,r);if(console.warn(n),st.includes(e))throw new RangeError(n)}(n,t,String(e));return(0,Ke[n[0]])(s,n,o.localize,c)}).join("")}function pt(e){const t=e.match(dt);return t?t[1].replace(ut,"'"):e}const ft="flex h-10 w-full items-center rounded-md border border-input bg-background px-3 text-sm font-normal shadow-none hover:bg-[hsl(var(--hover-ring))] hover:border-[hsl(var(--focus-ring))] focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",gt="text-muted-foreground",bt="size-4 shrink-0 text-muted-foreground opacity-50";function wt(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=wt(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}const yt=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),xt="-",vt=[],kt=e=>{const t=Mt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return Ct(e);const r=e.split(xt),n=""===r[0]&&r.length>1?1:0;return Nt(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=n[e],o=r[e];return t?o?((e,t)=>{const r=new Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(o,t):t:o||vt}return r[e]||vt}}},Nt=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],o=r.nextPart.get(n);if(o){const r=Nt(e,t+1,o);if(r)return r}const a=r.validators;if(null===a)return;const i=0===t?e.join(xt):e.slice(t).join(xt),s=a.length;for(let e=0;e<s;e++){const t=a[e];if(t.validator(i))return t.classGroupId}},Ct=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?"arbitrary.."+n:void 0})(),Mt=e=>{const{theme:t,classGroups:r}=e;return St(r,t)},St=(e,t)=>{const r=yt();for(const n in e){const o=e[n];zt(o,r,n,t)}return r},zt=(e,t,r,n)=>{const o=e.length;for(let a=0;a<o;a++){const o=e[a];jt(o,t,r,n)}},jt=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?_t(e,t,r,n):Dt(e,t,r,n):Pt(e,t,r)},Pt=(e,t,r)=>{(""===e?t:Lt(t,e)).classGroupId=r},Dt=(e,t,r,n)=>{Ot(e)?zt(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},_t=(e,t,r,n)=>{const o=Object.entries(e),a=o.length;for(let e=0;e<a;e++){const[a,i]=o[e];zt(i,Lt(t,a),r,n)}},Lt=(e,t)=>{let r=e;const n=t.split(xt),o=n.length;for(let e=0;e<o;e++){const t=n[e];let o=r.nextPart.get(t);o||(o=yt(),r.nextPart.set(t,o)),r=o}return r},Ot=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Wt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(o,a)=>{r[o]=a,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(o(e,t),t):void 0},set(e,t){e in r?r[e]=t:o(e,t)}}},Ft=[],Et=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Tt=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,o=0,a=0;const i=e.length;for(let s=0;s<i;s++){const i=e[s];if(0===n&&0===o){if(":"===i){t.push(e.slice(a,s)),a=s+1;continue}if("/"===i){r=s;continue}}"["===i?n++:"]"===i?n--:"("===i?o++:")"===i&&o--}const s=0===t.length?e:e.slice(a);let l=s,c=!1;s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0);return Et(t,c,l,r&&r>a?r-a:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):Et(Ft,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},qt=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let n=[];for(let o=0;o<e.length;o++){const a=e[o],i="["===a[0],s=t.has(a);i||s?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(a)):n.push(a)}return n.length>0&&(n.sort(),r.push(...n)),r}},At=/\s+/,Ht=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ht(e[n]))&&(r&&(r+=" "),r+=t);return r},It=(e,...t)=>{let r,n,o,a;const i=e=>{const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:a}=t,i=[],s=e.trim().split(At);let l="";for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:d,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:h}=r(t);if(c){l=t+(l.length>0?" "+l:l);continue}let p=!!h,f=n(p?m.substring(0,h):m);if(!f){if(!p){l=t+(l.length>0?" "+l:l);continue}if(f=n(m),!f){l=t+(l.length>0?" "+l:l);continue}p=!1}const g=0===d.length?"":1===d.length?d[0]:a(d).join(":"),b=u?g+"!":g,w=b+f;if(i.indexOf(w)>-1)continue;i.push(w);const y=o(f,p);for(let e=0;e<y.length;++e){const t=y[e];i.push(b+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return o(e,a),a};return a=s=>{const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:Wt(e.cacheSize),parseClassName:Tt(e),sortModifiers:qt(e),...kt(e)}))(l),n=r.cache.get,o=r.cache.set,a=i,i(s)},(...e)=>a(((...e)=>{let t,r,n=0,o="";for(;n<e.length;)(t=e[n++])&&(r=Ht(t))&&(o&&(o+=" "),o+=r);return o})(...e))},Gt=[],$t=e=>{const t=t=>t[e]||Gt;return t.isThemeGetter=!0,t},Yt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Rt=/^\d+\/\d+$/,Vt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ut=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kt=e=>Rt.test(e),Zt=e=>!!e&&!Number.isNaN(Number(e)),er=e=>!!e&&Number.isInteger(Number(e)),tr=e=>e.endsWith("%")&&Zt(e.slice(0,-1)),rr=e=>Vt.test(e),nr=()=>!0,or=e=>Qt.test(e)&&!Ut.test(e),ar=()=>!1,ir=e=>Xt.test(e),sr=e=>Jt.test(e),lr=e=>!dr(e)&&!gr(e),cr=e=>Nr(e,zr,ar),dr=e=>Yt.test(e),ur=e=>Nr(e,jr,or),mr=e=>Nr(e,Pr,Zt),hr=e=>Nr(e,Mr,ar),pr=e=>Nr(e,Sr,sr),fr=e=>Nr(e,_r,ir),gr=e=>Bt.test(e),br=e=>Cr(e,jr),wr=e=>Cr(e,Dr),yr=e=>Cr(e,Mr),xr=e=>Cr(e,zr),vr=e=>Cr(e,Sr),kr=e=>Cr(e,_r,!0),Nr=(e,t,r)=>{const n=Yt.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},Cr=(e,t,r=!1)=>{const n=Bt.exec(e);return!!n&&(n[1]?t(n[1]):r)},Mr=e=>"position"===e||"percentage"===e,Sr=e=>"image"===e||"url"===e,zr=e=>"length"===e||"size"===e||"bg-size"===e,jr=e=>"length"===e,Pr=e=>"number"===e,Dr=e=>"family-name"===e,_r=e=>"shadow"===e,Lr=It(()=>{const e=$t("color"),t=$t("font"),r=$t("text"),n=$t("font-weight"),o=$t("tracking"),a=$t("leading"),i=$t("breakpoint"),s=$t("container"),l=$t("spacing"),c=$t("radius"),d=$t("shadow"),u=$t("inset-shadow"),m=$t("text-shadow"),h=$t("drop-shadow"),p=$t("blur"),f=$t("perspective"),g=$t("aspect"),b=$t("ease"),w=$t("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",gr,dr],x=()=>[gr,dr,l],v=()=>[Kt,"full","auto",...x()],k=()=>[er,"none","subgrid",gr,dr],N=()=>["auto",{span:["full",er,gr,dr]},er,gr,dr],C=()=>[er,"auto",gr,dr],M=()=>["auto","min","max","fr",gr,dr],S=()=>["auto",...x()],z=()=>[Kt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],j=()=>[e,gr,dr],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",yr,hr,{position:[gr,dr]}],D=()=>["auto","cover","contain",xr,cr,{size:[gr,dr]}],_=()=>[tr,br,ur],L=()=>["","none","full",c,gr,dr],O=()=>["",Zt,br,ur],W=()=>[Zt,tr,yr,hr],F=()=>["","none",p,gr,dr],E=()=>["none",Zt,gr,dr],T=()=>["none",Zt,gr,dr],q=()=>[Zt,gr,dr],A=()=>[Kt,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rr],breakpoint:[rr],color:[nr],container:[rr],"drop-shadow":[rr],ease:["in","out","in-out"],font:[lr],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rr],shadow:[rr],spacing:["px",Zt],text:[rr],"text-shadow":[rr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Kt,dr,gr,g]}],container:["container"],columns:[{columns:[Zt,dr,gr,s]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:v()}],"inset-x":[{"inset-x":v()}],"inset-y":[{"inset-y":v()}],start:[{start:v()}],end:[{end:v()}],top:[{top:v()}],right:[{right:v()}],bottom:[{bottom:v()}],left:[{left:v()}],visibility:["visible","invisible","collapse"],z:[{z:[er,"auto",gr,dr]}],basis:[{basis:[Kt,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Zt,Kt,"auto","initial","none",dr]}],grow:[{grow:["",Zt,gr,dr]}],shrink:[{shrink:["",Zt,gr,dr]}],order:[{order:[er,"first","last","none",gr,dr]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[s,"screen",...z()]}],"min-w":[{"min-w":[s,"screen","none",...z()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,br,ur]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,gr,mr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tr,dr]}],"font-family":[{font:[wr,dr,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,gr,dr]}],"line-clamp":[{"line-clamp":[Zt,"none",gr,mr]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",gr,dr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",gr,dr]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Zt,"from-font","auto",gr,ur]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[Zt,"auto",gr,dr]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gr,dr]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",gr,dr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},er,gr,dr],radial:["",gr,dr],conic:[er,gr,dr]},vr,pr]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:O()}],"border-w-x":[{"border-x":O()}],"border-w-y":[{"border-y":O()}],"border-w-s":[{"border-s":O()}],"border-w-e":[{"border-e":O()}],"border-w-t":[{"border-t":O()}],"border-w-r":[{"border-r":O()}],"border-w-b":[{"border-b":O()}],"border-w-l":[{"border-l":O()}],"divide-x":[{"divide-x":O()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":O()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Zt,gr,dr]}],"outline-w":[{outline:["",Zt,br,ur]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",d,kr,fr]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",u,kr,fr]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[Zt,ur]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":O()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",m,kr,fr]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[Zt,gr,dr]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Zt]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[gr,dr]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Zt]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",gr,dr]}],filter:[{filter:["","none",gr,dr]}],blur:[{blur:F()}],brightness:[{brightness:[Zt,gr,dr]}],contrast:[{contrast:[Zt,gr,dr]}],"drop-shadow":[{"drop-shadow":["","none",h,kr,fr]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",Zt,gr,dr]}],"hue-rotate":[{"hue-rotate":[Zt,gr,dr]}],invert:[{invert:["",Zt,gr,dr]}],saturate:[{saturate:[Zt,gr,dr]}],sepia:[{sepia:["",Zt,gr,dr]}],"backdrop-filter":[{"backdrop-filter":["","none",gr,dr]}],"backdrop-blur":[{"backdrop-blur":F()}],"backdrop-brightness":[{"backdrop-brightness":[Zt,gr,dr]}],"backdrop-contrast":[{"backdrop-contrast":[Zt,gr,dr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Zt,gr,dr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Zt,gr,dr]}],"backdrop-invert":[{"backdrop-invert":["",Zt,gr,dr]}],"backdrop-opacity":[{"backdrop-opacity":[Zt,gr,dr]}],"backdrop-saturate":[{"backdrop-saturate":[Zt,gr,dr]}],"backdrop-sepia":[{"backdrop-sepia":["",Zt,gr,dr]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",gr,dr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Zt,"initial",gr,dr]}],ease:[{ease:["linear","initial",b,gr,dr]}],delay:[{delay:[Zt,gr,dr]}],animate:[{animate:["none",w,gr,dr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,gr,dr]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:E()}],"rotate-x":[{"rotate-x":E()}],"rotate-y":[{"rotate-y":E()}],"rotate-z":[{"rotate-z":E()}],scale:[{scale:T()}],"scale-x":[{"scale-x":T()}],"scale-y":[{"scale-y":T()}],"scale-z":[{"scale-z":T()}],"scale-3d":["scale-3d"],skew:[{skew:q()}],"skew-x":[{"skew-x":q()}],"skew-y":[{"skew-y":q()}],transform:[{transform:[gr,dr,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:A()}],"translate-x":[{"translate-x":A()}],"translate-y":[{"translate-y":A()}],"translate-z":[{"translate-z":A()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",gr,dr]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",gr,dr]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[Zt,br,ur,mr]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Or(...e){return Lr(function(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=wt(e))&&(n&&(n+=" "),n+=t);return n}(e))}const Wr=({startDate:e,endDate:t,onStartDateChange:r,onEndDateChange:n,startLabel:o="Start date",endLabel:u="End date",className:m})=>c("div",{className:Or("flex flex-col gap-2",m),children:d("div",{className:"flex flex-row gap-2 items-center",children:[d(i,{children:[c(s,{asChild:!0,children:d("button",{type:"button",className:Or(ft,"justify-start text-left w-[240px]",!e&>),children:[c(ce,{className:Or("mr-2",bt)}),e?ht(e,"PPP"):o]})}),c(l,{className:"w-fit p-0",align:"start",children:c(a,{mode:"single",selected:e,onSelect:r,initialFocus:!0})})]}),d(i,{children:[c(s,{asChild:!0,children:d("button",{type:"button",className:Or(ft,"justify-start text-left w-[240px]",!t&>),children:[c(ce,{className:Or("mr-2",bt)}),t?ht(t,"PPP"):u]})}),c(l,{className:"w-fit p-0",align:"start",children:c(a,{mode:"single",selected:t,onSelect:n,initialFocus:!0})})]})]})}),Fr=({value:e,onChange:t,fetcher:r,className:n})=>c(m,{fetcher:r,modelClass:"User",className:Or("max-w-36 h-10",n),placeholder:"Creator user",emptyMessage:"No user found",labelName:"username",value:e,onChange:t}),Er=()=>{const[e,t]=r(),[n,o]=r(),[a,i]=r(null),s=[{pk:1,description:"Maintenance Task A",created_at:"2023-10-01",status:"Open",user_id:1,username:"admin"},{pk:2,description:"Inspection B",created_at:"2023-10-05",status:"Closed",user_id:2,username:"jdoe"},{pk:3,description:"Repair C",created_at:"2023-10-10",status:"In Progress",user_id:1,username:"admin"},{pk:4,description:"Log Analysis",created_at:"2023-10-15",status:"Open",user_id:3,username:"guest"},{pk:5,description:"System Update",created_at:"2023-11-01",status:"Pending",user_id:2,username:"jdoe"}],l=s.filter(t=>{let r=!0;const o=new Date(t.created_at);return e&&o<e&&(r=!1),n&&o>n&&(r=!1),a&&t.user_id!==Number(a)&&(r=!1),r});return d("div",{className:"flex flex-col gap-6 p-4 border rounded-lg bg-white",children:[c("h2",{className:"text-xl font-bold",children:"Combined Filter & Table Demo"}),d("div",{className:"flex flex-wrap gap-4 items-end",children:[c(Wr,{startDate:e,endDate:n,onStartDateChange:t,onEndDateChange:o}),c(Fr,{fetcher:async({search:e,modelClass:t,limit:r,offset:n})=>{await new Promise(e=>setTimeout(e,300));const o=[{pk:1,username:"admin"},{pk:2,username:"jdoe"},{pk:3,username:"guest"}];return e?o.filter(t=>t.username.toLowerCase().includes(e.toLowerCase())):o},value:a,onChange:e=>i(e)}),c(f,{variant:"outline",className:"h-full",onClick:()=>{t(void 0),o(void 0),i(null)},children:"Clear Filters"})]}),c("div",{className:"border rounded-md overflow-hidden",children:d(h.Root,{children:[c(h.Header,{children:d(h.Row,{children:[c(h.Head,{children:"ID"}),c(h.Head,{children:"Description"}),c(h.Head,{children:"Created At"}),c(h.Head,{children:"Created By"}),c(h.Head,{children:"Status"})]})}),c(h.Body,{children:l.length>0?l.map(e=>d(h.Row,{children:[c(h.Cell,{children:e.pk}),c(h.Cell,{children:e.description}),c(h.Cell,{children:ht(new Date(e.created_at),"PPP")}),c(h.Cell,{children:e.username}),c(h.Cell,{children:e.status})]},e.pk)):c(h.Row,{children:c(h.Cell,{colSpan:5,children:c(p,{title:"No results found",description:"No data was found for the selected filters."})})})})]})}),d("div",{className:"text-xs text-gray-400",children:["Showing ",l.length," of ",s.length," records."]})]})};function Tr({data:e}){return c(g,{direction:"row",gap:2,className:"flex-wrap",children:Object.entries(e).map(([e,t])=>c(g,{direction:"row",gap:1,className:"bg-muted px-3 py-1.5 rounded-md text-sm",children:d("span",{className:"font-medium text-foreground",children:[e," : ",String(t)]})},e))})}const qr=({href:e,className:t,children:r})=>c("a",{href:e,className:t,children:r});function Ar({onLogin:e,onSuccess:t,onError:n,sessionExpired:o=!1,sessionExpiredAlert:a,forgotPasswordHref:i="/",forgotPasswordLabel:s="Esqueci a senha",usernameLabel:l="Usuario",passwordLabel:u="Senha",submitLabel:m="Entrar",loginErrorMessage:h="Login error!",LinkComponent:p=qr,className:b}){const[w,S]=r(""),[z,j]=r(""),[P,D]=r(!1);return d(g,{gap:4,children:[o&&a?.icon&&c(y,{variant:"destructive",icon:a.icon,title:a.title??"Sessão expirada",description:a.description??"Faça login novamente para continuar"}),d(x,{className:b??"bg-white w-[400px] h-[457px] rounded-[30px] shadow-lg",children:[c(v,{className:"items-center"}),c(k,{children:c("form",{onSubmit:e=>e.preventDefault(),children:d("div",{className:"grid w-full items-center gap-4 mt-6",children:[d(g,{gap:4,children:[c(M,{className:"text-primary",htmlFor:"username",children:l}),c(C,{id:"username",type:"text",placeholder:"Seu nome de usuário",value:w,onChange:e=>S(e.target.value)})]}),d(g,{gap:4,children:[c(M,{className:"text-primary",htmlFor:"password",children:u}),c(C,{id:"password",type:"password",placeholder:"Sua senha de acesso",value:z,onChange:e=>j(e.target.value)})]})]})})}),c(N,{className:"justify-center items-center",children:d(g,{gap:4,className:"justify-center items-center mt-10",children:[c(f,{className:"w-full",onClick:async()=>{D(!0);try{const{error:r}=await e({username:w,password:z});if(r)return void n?.(h,String(r));t?.()}finally{D(!1)}},disabled:P,children:m}),c(p,{href:i,className:"text-primary text-xs",children:s})]})})]})]})}const Hr=({href:e,className:t,children:r})=>c("a",{href:e,className:t,children:r});function Ir({onLoginSSO:e,onRedirect:t,onError:n,sessionExpired:o=!1,sessionExpiredAlert:a,forgotPasswordHref:i="/",forgotPasswordLabel:s="Esqueci a senha",emailLabel:l="Email",submitLabel:u="Entrar com SSO",unauthorizedMessage:m="Usuario nao autorizado",genericErrorMessage:h="Erro ao fazer login",LinkComponent:p=Hr,className:b}){const[w,S]=r(""),[z,j]=r(!1);return d(g,{gap:4,children:[o&&a?.icon&&c(y,{variant:"destructive",icon:a.icon,title:a.title??"Sessão expirada",description:a.description??"Faça login novamente para continuar"}),d(x,{className:b??"bg-white w-[400px] h-[457px] rounded-[30px] shadow-lg",children:[c(v,{className:"items-center mt-4"}),c(k,{children:c("form",{onSubmit:async r=>{r.preventDefault(),j(!0);try{const{redirect_url:r,error:o}=await e(w);if(r)return void t?.(r);const a=o?.includes("401")?m:h;n?.(a,String(o))}finally{j(!1)}},children:d("div",{className:"grid w-full items-center gap-4 mt-6",children:[d(g,{gap:4,children:[c(M,{className:"text-primary",htmlFor:"email",children:l}),c(C,{id:"email",type:"email",placeholder:"Seu email de acesso",value:w,onChange:e=>S(e.target.value),pattern:"^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,4}$",required:!0})]}),c(f,{className:"w-full",type:"submit",disabled:z,children:u})]})})}),c(N,{className:"flex-col justify-center items-center",children:c(g,{gap:4,className:"justify-start items-center mb-7",children:c(p,{href:i,className:"text-primary text-xs",children:s})})})]})]})}const Gr=({href:e,className:t,children:r})=>c("a",{href:e,className:t,children:r});function $r({redirectHref:e,redirectDelayMs:t=3e3,onRedirect:r,title:o="Autenticado com sucesso! Redirecionado automaticamente",fallbackLinkLabel:a="Caso nao seja redirecionado automaticamente, clique aqui",LinkComponent:i=Gr,className:s}){return n(()=>{const n=setTimeout(()=>{r?.(e)},t);return()=>clearTimeout(n)},[e,t,r]),c("div",{className:"flex justify-center items-center h-screen",children:d(x,{className:s??"bg-white w-[400px] h-[457px] rounded-[30px] shadow-lg",children:[c(v,{className:"items-center mt-4"}),d(k,{className:"flex flex-col gap-4",children:[c(S,{}),c("h4",{className:"text-center",children:o}),c(i,{href:e,className:"w-full text-sm underline text-accent text-center",children:a})]})]})})}const Yr=({href:e,className:t,children:r})=>c("a",{href:e,className:t,children:r});function Br({error:e,loginHref:t,title:n="Erro ao autenticar!",description:o="Verifique suas informações de SSO ou converse com o administrador do sistema.",fallbackLinkLabel:a="Caso não seja redirecionado automaticamente, clique aqui",errorDetailsLabel:i="Detalhes para os Nerds",copyLabel:s="Copiar",copiedLabel:l="Copiado!",LinkComponent:m=Yr,className:h}){const[p,f]=r(!1),b="string"==typeof e?e:JSON.stringify(e,null,2);return c(g,{className:"justify-center items-center h-screen",children:d(x,{className:h??"w-[400px] h-[457px] rounded-[30px] shadow-lg bg-red-50",children:[c(v,{className:"items-center"}),d(k,{className:"flex flex-col items-center gap-2",children:[c(ue,{size:48,className:"text-red-700"}),c("h4",{className:"text-center",children:n}),c("p",{className:"text-sm text-center",children:o}),c(m,{href:t,className:"w-full text-sm underline text-accent text-center",children:a}),c(z,{type:"single",collapsible:!0,className:"w-full",children:d(j,{value:"error-details",children:[c(P,{children:i}),d(D,{className:"max-w-80",children:[c("div",{className:"flex justify-end mb-1",children:c("button",{type:"button",onClick:async()=>{if(e)try{await navigator.clipboard.writeText("string"==typeof e?e:JSON.stringify(e,null,2)),f(!0),setTimeout(()=>f(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},className:"text-xs text-accent hover:underline flex items-center gap-1",children:d(u,p?{children:[c(de,{size:14,className:"text-green-600"})," ",l]}:{children:[c(me,{size:14})," ",s]})})}),c("div",{className:"max-h-24 overflow-y-auto overflow-x-hidden",children:c("pre",{className:"bg-gray-100 p-4 rounded-md",children:c("code",{className:"text-sm text-red-600 dark:text-red-400 whitespace-pre-wrap break-words",children:b})})})]})]})})]})]})})}const Rr={created_at:"Criado em",start_processing_at:"Início do Processamento",finished_processing_at:"Fim do Processamento",field_delimiter:"Delimitador de Campo",decimal_delimiter:"Delimitador Decimal",ignore_locked:"Ignorar Bloqueados",lock_data:"Bloquear Dados",origin:"Origem",format_type:"Tipo de Formato",process_status:"Status",description:"Descrição",row_permission:"Row Permission",created_by:"Created By",modeling_unit:"Modeling Unit",attribute:"Attribute",geoarea:"Geoarea"},Vr=e=>{if(!e)return"";return new Date(e).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})},Qr=(e,t)=>({...Rr,...t}[e]||e.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")),Ur=(e,t,r={})=>{if(null==e||""===e)return"N/A";if("process_status"===t&&r.statusLabels)return r.statusLabels[String(e)]??String(e);if(t.endsWith("_at")||t.includes("date")||t.includes("_time")){return(r.formatDate??Vr)(String(e))||"N/A"}if("boolean"==typeof e){const t=r.booleanLabels??{true:"Sim",false:"Não"};return e?t.true:t.false}return"object"==typeof e?"N/A":String(e)},Xr=(e,t)=>{const r=e[t];return r&&"object"==typeof r&&null!==r&&"__display_field__"in r?r.__display_field__:r},Jr=["description","notes"],Kr=[{title:"Informações Gerais",fields:["description","row_permission","origin","created_by","process_status","msg"],cols:4},{title:"Datas de Processamento",fields:["created_at","start_processing_at","finished_processing_at"],cols:3},{title:"Proteção dos Dados",fields:["ignore_locked","lock_data"],cols:4},{title:"Carregamento Manual",fields:["format_type","field_delimiter","decimal_delimiter","modeling_unit","attribute","geoarea"],cols:4}];function Zr({data:e,config:t,formatters:r,wrapperElements:n,statusLabels:o,formatDate:a}){const i=t?.sections||Kr,s={statusLabels:o,formatDate:a},l=o=>{if(!(o in e))return null;const a=t?.labels?.[o]||Qr(o,t?.labels),i=(r||[]).find(e=>e.key===o)?.formatter||t?.formatters?.[o],l=Xr(e,o),u=i?i(l):Ur(l,o,s),m=Jr.includes(o),h=n?.find(e=>e.keys.includes(o));if(h?.element){const t=h.element({key:o,label:a,fieldValue:l,isFullWidth:m,data:e});return c(g,{direction:"col",className:m?"col-span-full min-w-0":"min-w-0",children:t},o)}return d(g,{direction:"col",className:m?"col-span-full min-w-0":"min-w-0",children:[c("p",{className:"text-sm font-medium text-muted-foreground",children:a}),c("p",{className:"text-base break-words whitespace-pre-wrap",children:u})]},o)},u=e.results;return d(g,{direction:"col",gap:6,children:[i.map(t=>{const r=t.fields.filter(t=>t in e);return 0===r.length?null:t.isFullWidth?d(g,{direction:"col",gap:3,children:[c("h3",{className:"text-sm font-semibold text-foreground",children:t.title}),c("div",{className:"grid grid-cols-1 sm:grid-cols-1 lg:grid-cols-1 xl:grid-cols-1 gap-x-6 gap-y-4",children:r.map(e=>l(e))})]},t.title):d(g,{direction:"col",gap:3,children:[c("h3",{className:"text-sm font-semibold text-foreground",children:t.title}),c("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-x-6 gap-y-4",children:r.map(e=>l(e))})]},t.title)}),Boolean(e.dimensions&&"object"==typeof e.dimensions&&Object.keys(e.dimensions).length>0)&&d(g,{direction:"col",gap:3,children:[c("h3",{className:"text-sm font-semibold text-foreground",children:"Tags"}),c(Tr,{data:e.dimensions})]}),Boolean(e.extra_info&&"object"==typeof e.extra_info&&Object.keys(e.extra_info).length>0)&&d(g,{direction:"col",gap:3,children:[c("h3",{className:"text-sm font-semibold text-foreground",children:"Informações Extras"}),c(Tr,{data:e.extra_info})]}),u?.processing_results&&c(z,{type:"single",collapsible:!0,children:d(j,{value:"processing-results",className:"border-b-0",children:[c(P,{className:"text-sm font-semibold text-foreground hover:no-underline py-2",children:"Resultados do Processamento"}),c(D,{children:d(g,{direction:"col",gap:4,children:[c("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-6",children:[{label:"Adicionados",value:u.processing_results.count__added,color:"text-green-600"},{label:"Atualizados",value:u.processing_results.count__updated,color:"text-blue-600"},{label:"Sem Alteração",value:u.processing_results.count__no_change,color:"text-gray-600"}].map(e=>d(g,{direction:"col",children:[c("p",{className:"text-sm font-medium text-muted-foreground",children:e.label}),c("p",{className:`text-2xl font-bold ${e.color}`,children:e.value})]},e.label))}),u.processing_results.details&&u.processing_results.details.length>0&&d(g,{direction:"col",gap:2,children:[c("p",{className:"text-sm font-medium text-muted-foreground",children:"Detalhes"}),c(g,{direction:"col",gap:2,children:u.processing_results.details.map((e,r)=>{const n=`detail-${r}-${Object.values(e).join("-")}`;return c(g,{className:"border rounded-lg p-3",children:c(g,{className:"grid grid-cols-4 gap-2",children:Object.entries(e).map(([e,r])=>d(g,{direction:"col",children:[c("p",{className:"text-xs text-muted-foreground",children:Qr(e,t?.labels)}),c("p",{className:"text-sm font-medium",children:Ur(r,e,s)})]},e))})},n)})})]})]})})]})})]})}function en({title:e,titleAddon:t,isLoading:r=!1,error:n=null,onBack:o,actions:a,sections:i=[],children:s,loadingComponent:l,errorComponent:u,backButtonLabel:m="Voltar"}){return r?l??c(g,{className:"justify-center items-center p-8",children:c(S,{})}):n?u??c(g,{className:"justify-center items-center p-8",children:c("p",{className:"text-destructive",children:n.message})}):d(g,{direction:"col",gap:4,children:[d(g,{direction:"row",gap:4,className:"justify-between items-center",children:[d(g,{direction:"row",gap:4,className:"items-center",children:[o&&c(f,{variant:"ghost",size:"icon",onClick:o,title:m,children:c(le,{className:"size-4"})}),c("h1",{className:"text-2xl font-semibold text-surface-secondary",children:e}),t]}),a&&c(g,{direction:"row",gap:2,children:a})]}),i.map((e,t)=>{const r=e.id??`section-${t}`;return c(z,{type:"single",collapsible:!0,defaultValue:e.defaultOpen?r:void 0,className:"w-full",children:d(j,{value:r,className:"border-b",children:[c(P,{className:"hover:no-underline text-base font-normal text-surface-secondary",children:e.title}),c(D,{className:"pt-4",children:e.content})]})},r)}),s]})}const tn=L,rn={description:"Descrição",code:"Código",notes:"Notas",force_temperature:"Temperatura Forçada",dimensions:"Tags",extra_info:"Informações extras"},nn=(e,t)=>t?.[e]?t[e]:rn[e]?rn[e]:e.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ");function on({value:e={},onChange:t,name:n,placeholderKey:o="Chave",placeholderValue:a="Valor",disabled:i=!1}){const[s,l]=r({key:"",value:""});return d(g,{direction:"col",gap:2,children:[d("div",{className:"flex gap-2",children:[c(C,{type:"text",name:`${n}_key`,placeholder:o,value:s.key,disabled:i,onChange:e=>l(t=>({...t,key:e.target.value})),className:"flex-1"}),c(C,{type:"text",name:`${n}_value`,placeholder:a,value:s.value,disabled:i,onChange:e=>l(t=>({...t,value:e.target.value})),className:"flex-1"}),c(f,{type:"button",variant:"default",className:"px-4 py-2 shrink-0",id:`${n}_add`,onClick:()=>{const e=s.key.trim(),r=s.value.trim();e&&(t(t=>({...t&&"object"==typeof t?t:{},[e]:r})),l({key:"",value:""}))},disabled:i||!s.key.trim(),children:"Adicionar"})]}),Object.entries(e).length>0&&c(g,{direction:"row",gap:2,className:"flex-wrap",children:Object.entries(e).map(([e,r])=>d(g,{direction:"row",gap:1,className:"bg-muted px-3 py-1.5 rounded-md text-sm",children:[d("span",{className:"font-medium text-foreground",children:[e," : ",String(r)]}),!i&&c("button",{type:"button",onClick:()=>{return r=e,void t(e=>{const t={...e&&"object"==typeof e?e:{}};return delete t[r],t});var r},className:"rounded-full p-0 hover:bg-muted-foreground/20 hover:text-destructive hover:backgro transition-colors",children:"×"})]},e))})]})}function an({fields:e,values:t,defaultValue:o={},onChange:a,errors:i={},config:s,customFields:l}){const[m,h]=r(o),p=t??m,f=(e,t)=>{a?a(r=>{const n=r&&"object"==typeof r?r:p,o=n[e],a="function"==typeof t?t(o):t;return{...n,[e]:a}}):h(r=>{const n=r[e],o="function"==typeof t?t(n):t;return{...r,[e]:o}})};n(()=>{Object.keys(o).length>0&&0===Object.keys(p).length&&h(o)},[o,p]);const b=Object.keys(e).filter(e=>!s?.exclude?.includes(e)),w=(e,t)=>{const r=p[e]??"",n=i[e],o=t.disabled;if(l?.[e])return l[e]({value:r,onChange:t=>f(e,t),error:n,disabled:o,fieldKey:e});switch(t.type){case"textarea":return c(T,{id:e,name:e,placeholder:t.placeholder,value:r,onChange:t=>f(e,t.target.value),required:t.required,disabled:o,className:Or("min-h-[120px] w-full",n&&"border-destructive")});case"checkbox":return d("div",{className:"flex items-center gap-2 py-2",children:[c(_,{id:e,name:e,checked:!!r,onCheckedChange:t=>f(e,!!t),disabled:o}),c("label",{htmlFor:e,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:nn(e,s?.labels)})]});case"select":return d(tn,{name:e,value:r,onValueChange:t=>f(e,t),disabled:o,children:[c(O,{"data-testid":`${e}-select-trigger`,children:c(W,{placeholder:t.placeholder||"Selecione..."})}),c(F,{children:t.options?.map(t=>c(E,{"data-testid":`${e}-select-item-${t.value}`,value:t.value,children:t.label},t.value))})]},r?"loaded":"empty");case"key-value":return d(u,{children:[c(on,{value:r||{},name:e,onChange:t=>f(e,t),placeholderKey:"Chave",placeholderValue:"Valor",disabled:o}),c("input",{type:"hidden",name:e,value:JSON.stringify(r||{})})]});case"number":return c(C,{type:"number",id:e,name:e,placeholder:t.placeholder,value:r,onChange:t=>{const r=""===t.target.value?"":Number(t.target.value);f(e,r)},required:t.required,disabled:o,className:Or("w-full",n&&"border-destructive")});case"date":return c(C,{type:"date",id:e,name:e,placeholder:t.placeholder,value:r,onChange:t=>f(e,t.target.value),required:t.required,disabled:o,className:Or("w-full",n&&"border-destructive")});default:return c(C,{type:t.type,id:e,name:e,placeholder:t.placeholder,value:r,onChange:t=>f(e,t.target.value),required:t.required,disabled:o,className:Or("w-full",n&&"border-destructive")})}};return c(g,{direction:"col",gap:6,className:"w-full",children:(s?.sections||[{title:"Dados do Formulário",fields:b,cols:1}]).map(t=>{const r=t.fields.filter(t=>t in e&&!s?.exclude?.includes(t));if(0===r.length)return null;const n=1===t.cols?"grid-cols-1":2===t.cols?"grid-cols-1 sm:grid-cols-2":3===t.cols?"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3":"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4";return d(g,{direction:"col",gap:3,className:"w-full",children:[c("h3",{className:"text-sm font-semibold text-foreground",children:t.title}),c("div",{className:Or("grid gap-x-6 gap-y-4 w-full",n),children:r.map(r=>{const n=e[r],o=t.isFullWidth||"textarea"===n.type||"key-value"===n.type||4===n.cols,a=i[r],l="checkbox"!==n.type;return d(g,{direction:"col",gap:1.5,className:Or(o?"col-span-full":"",n.className),children:[l&&d("label",{htmlFor:r,className:"text-fontcolor-secondary font-bold text-sm",children:[nn(r,s?.labels),n.required&&c("span",{className:"text-destructive ml-0.5",children:"*"})]}),w(r,n),a&&c("span",{className:"text-xs text-destructive font-medium mt-0.5",children:a})]},r)})})]},t.title)})})}const sn=({open:e,onOpenChange:t,targetModelClass:n,relationName:o,handleCreateNew:a,mutate:i,fkFetcher:s})=>{const[l,u]=r("");return c(A,{open:e,onOpenChange:t,children:c(H,{className:"max-w-3xl centered p-0 border-none bg-transparent shadow-none",children:c(g,{gap:3,direction:"row",className:"w-full items-center justify-center",children:d("div",{className:"flex flex-col gap-4 p-6 border border-gray-200 bg-white rounded-lg shadow-sm",children:[c(m,{fetcher:s,modelClass:n,labelName:"description",placeholder:`Selecione um(a) ${o.toLocaleLowerCase()}`,emptyMessage:`Nenhum(a) ${o.toLocaleLowerCase()} encontrado(a)`,value:l,onChange:e=>{u(String(e))}}),c(f,{onClick:async()=>{await a(l),t(!1),u(""),i()},children:"Salvar"}),c(f,{variant:"secondary",onClick:()=>{t(!1),u("")},children:"Cancelar"})]})})})})},ln=({modelClass:e,targetModelClass:t,targetField:n,filterDict:o,relationName:a,fields:i,displayFields:s,handleCreateNew:l,handleDeleteItem:u,listFn:m,fkFetcher:h})=>{const[p,w]=r(!1),[y,x]=r(!1),v=e?{modelClass:e,filterDict:o,fields:i}:null,{data:k,error:N,mutate:C}=q(v,async({modelClass:e,fields:t})=>{const[r,a]=await m(e,o,[...t,"pk"]);if(a&&console.error("==> ERROR m2m table: ",a),n&&Array.isArray(r)&&r.length>0){return r?.map(e=>({...e[n],m2m:e.pk}))??[]}return[]},{revalidateOnFocus:!1,revalidateOnReconnect:!0,errorRetryCount:3,errorRetryInterval:1e3}),[M,S]=r(null);return d(b,{hasError:!!N,children:[c(z,{type:"multiple",className:"w-full",children:d(j,{value:"details",className:"border-b",children:[d(P,{className:"text-base font-normal text-surface-secondary hover:no-underline",children:[a," (",k?.length||0,")"]}),d(D,{className:"px-4 pt-4",children:[c(g,{direction:"row",className:"justify-end mb-4",children:d(f,{onClick:()=>w(!0),children:["Adicionar ",a.toLowerCase()]})}),k&&k.length>0?d(I,{className:"table-auto w-full",children:[c(G,{className:"sticky top-0 bg-primary text-white z-10",children:d($,{children:[c(Y,{className:"px-2 py-4",children:"Id"},"pk"),s.map(e=>c(Y,{className:"px-2 py-2",children:e.name},e.field)),c(Y,{className:"px-2 py-4 text-end",children:c("div",{className:"mr-6",children:"Opções"})})]})}),d(B,{children:[k?.map((e,t)=>d($,{className:"cursor-pointer hover:bg-secondary",children:[c(R,{className:"px-2",children:e.pk??"N/A"},"pk"),s.map(t=>c(R,{className:"px-2",children:e[t.field]??"N/A"},t.field)),c(R,{className:"px-2 justify-end flex",children:c(f,{variant:"ghost",size:"icon",className:"border text-muted-foreground mr-6",onClick:()=>{S(e.m2m),x(!0)},children:c(we,{className:"size-4"})})})]},t)),c($,{children:c(R,{colSpan:s.length,className:"text-center py-6"})})]})]}):c(Q,{})]})]})}),c(sn,{open:p,onOpenChange:w,targetModelClass:t,relationName:a,handleCreateNew:l,mutate:C,fkFetcher:h}),c(V,{handleDelete:async()=>{M&&(await u(M),x(!1),S(null),C())},openDialog:y,setOpenDialog:x,count:1})]})};function cn({label:e,steps:t=[]}){return c(U,{className:"mb-6",children:d(X,{children:[c(J,{children:c(K,{className:"text-primary font-medium",children:e})}),t.map(e=>d(o,{children:[c(Z,{}),c(J,{children:c(K,{className:"text-muted-foreground",children:e})})]},`step-fragment-${e}`))]})})}const dn=(e,t)=>{const r=document.createElement("a");r.href=e,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r)},un=({fileUrl:e,fileName:t,isLoading:r=!1,getFileType:n,ImageComponent:o})=>{if(r)return c(g,{direction:"col",className:"bg-secondary border border-border rounded-lg min-h-[600px] items-center justify-center",children:c(w,{})});if(!e||!t)return d(g,{direction:"col",className:"bg-secondary border border-border rounded-lg min-h-[600px] items-center justify-center",children:[c(ge,{className:"w-16 h-16 text-muted-foreground"}),c("p",{className:"text-sm text-muted-foreground mt-4",children:"No file available"})]});const a=n(t);return c(g,{direction:"col",className:"bg-secondary border border-border rounded-lg min-h-[600px] h-full overflow-hidden relative",children:(()=>{switch(a){case"image":return c(g,{direction:"col",className:"w-full h-full items-center justify-center relative",children:o?c(o,{src:e,alt:t,fill:!0,className:"object-contain"}):c("img",{src:e,alt:t,className:"max-w-full max-h-full object-contain"})});case"video":return c(g,{direction:"col",className:"w-full h-full items-center justify-center relative",children:d("video",{src:e,controls:!0,className:"w-full h-full object-contain",children:[c("track",{kind:"captions"}),"Your browser does not support the video tag."]})});case"pdf":return c(g,{direction:"col",className:"w-full h-full items-center justify-center relative",children:c("iframe",{src:e,className:"w-full h-full border-0",title:t})});case"doc":case"excel":case"ppt":return d(g,{direction:"col",gap:4,className:"items-center justify-center h-full p-8",children:[c(pe,{className:"w-20 h-20 text-muted-foreground"}),d(g,{direction:"col",gap:1,className:"text-center",children:[c("p",{className:"text-sm font-medium text-foreground",children:t}),d("p",{className:"text-xs text-muted-foreground uppercase",children:[a," Document"]})]}),d(f,{variant:"outline",size:"default",className:"mt-4",onClick:()=>dn(e,t),children:[c(he,{className:"w-4 h-4 mr-2"}),"Download"]})]});default:return d(g,{direction:"col",gap:4,className:"items-center justify-center h-full p-8",children:[c(fe,{className:"w-16 h-16 text-muted-foreground"}),c("p",{className:"text-sm text-muted-foreground",children:t}),d(f,{variant:"outline",size:"sm",onClick:()=>dn(e,t),children:[c(he,{className:"w-4 h-4 mr-2"}),"Download"]})]})}})()})};function mn({links:e,iconMap:t,pathname:r,isSidebarCollapsedFromQuery:o=!1,logo:a,onLogout:i,logoutIcon:s=be,logoutLabel:l="Logout",LinkComponent:u,ImageComponent:m}){const h=r.split("/")[2]??"",{isCollapsed:p,isCollapsing:f,expandedItems:b,setExpandedItems:w,toggleCollapse:y,toggleExpanded:x,handleTransitionEnd:v,setExpandedOnCollapse:k}=te({initialCollapsed:o,onPersist:e=>{const t=new URLSearchParams;t.set("sidebar-collapsed",String(e)),window.history.replaceState({},"",`${window.location.pathname}?${t}`)}});n(()=>{if(!o){const t={};e.forEach(e=>{if(e.subItems){e.subItems.some(e=>r===e.href)&&(t[e.title]=!0)}}),w(t)}},[o,e,r,w]);return d(ee.Root,{isCollapsed:p,isCollapsing:f,onToggleCollapse:()=>{p||k(),y()},onTransitionEnd:v,className:"h-full",children:[d(g,{className:"w-full shrink-0 items-center gap-1 mb-2",children:[c(ee.Toggle,{}),c(ee.Logo,{src:a.src,width:a.width,height:a.height,collapsedWidth:a.collapsedWidth,collapsedHeight:a.collapsedHeight,alt:a.alt,ImageComponent:m})]}),c(ee.Content,{className:"mt-6",children:e.map(e=>{const n=t[e.icon];if(!!e.subItems?.length){const t=e.subItems?.some(e=>r===e.href||h===e.href.split("/")[2]);return c(ee.NavGroup,{icon:n,title:e.title,isExpanded:!!b[e.title],isActive:!!t,onToggle:()=>x(e.title),children:e.subItems?.map(e=>{const t=r===e.href;return c(ee.NavSubLink,{title:e.title,href:{pathname:e.href,query:{"sidebar-collapsed":p}},active:t,LinkComponent:u},e.href)})},e.title)}const o=e.href?.split("/")[2]??"";return c(ee.Link,{icon:n,href:{pathname:e.href,query:{"sidebar-collapsed":p}},active:h===o,LinkComponent:u,children:e.title},e.href)})}),c(ee.Footer,{children:c(ee.Action,{icon:s,label:l,onClick:async()=>{await i()}})})]})}export{$r as AuthenticatedView,Zr as AutoDetailContent,an as AutoFormContent,Er as CombinedFilterTable,Fr as CreatedByUserFilter,cn as CustomBreadcrumb,Wr as DateRangeFilter,en as DetailPage,Jr as FULL_WIDTH_DETAIL_FIELDS,un as FilePreview,Tr as KeyValueContent,Ar as LoginCard,Ir as LoginCardSSO,sn as M2MCreateDialog,ln as M2MTable,mn as NavigationSidebar,Br as NotAuthenticatedView,Qr as formatDetailLabel,Ur as formatDetailValue,Xr as getDetailFieldValue};
|