@granularjs/ui 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/granular-ui.js +9462 -0
- package/dist/granular-ui.js.map +7 -0
- package/dist/granular-ui.min.js +308 -67
- package/dist/granular-ui.min.js.map +4 -4
- package/package.json +1 -1
- package/src/components/Autocomplete.js +179 -0
- package/src/components/DateInput.js +1 -3
- package/src/components/List.js +7 -7
- package/src/components/Pagination.js +2 -1
- package/src/components/ProgressRing.js +41 -7
- package/src/components/Radio.js +32 -3
- package/src/components/RadioGroup.js +24 -4
- package/src/components/RangePicker.js +66 -26
- package/src/components/Select.js +3 -1
- package/src/components/SelectSearch.js +2 -34
- package/src/components/Slider.js +15 -4
- package/src/components/Stepper.js +4 -3
- package/src/components/Switch.js +32 -4
- package/src/components/SwitchGroup.js +20 -4
- package/src/components/Table.js +38 -13
- package/src/components/Timeline.js +373 -17
- package/src/components/Toast.js +18 -6
- package/src/components/ToastStack.js +9 -15
- package/src/index.js +1 -0
- package/src/theme/icons.js +2 -1
- package/src/theme/styles.js +294 -53
- package/types/components/Autocomplete.d.ts +1 -0
- package/types/components/RadioGroup.d.ts +1 -0
- package/types/components/SwitchGroup.d.ts +1 -0
- package/types/index.d.ts +1 -0
- package/types/theme/icons.d.ts +1 -0
package/dist/granular-ui.min.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var
|
|
1
|
+
var jt="granular-ui-styles",sa=new URL("./fonts/Poppins-400.ttf",import.meta.url).href,ua=new URL("./fonts/Poppins-500.ttf",import.meta.url).href,ga=new URL("./fonts/Poppins-600.ttf",import.meta.url).href,la=new URL("./fonts/Poppins-700.ttf",import.meta.url).href,ca=new URL("./fonts/Arimo-400.ttf",import.meta.url).href,pa=new URL("./fonts/Arimo-500.ttf",import.meta.url).href,da=new URL("./fonts/Arimo-600.ttf",import.meta.url).href,ma=new URL("./fonts/Arimo-700.ttf",import.meta.url).href,fa=new URL("./fonts/Inter-400.woff2",import.meta.url).href,ha=new URL("./fonts/Inter-500.woff2",import.meta.url).href,va=new URL("./fonts/Inter-600.woff2",import.meta.url).href,ba=new URL("./fonts/Inter-700.woff2",import.meta.url).href,xa=`
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: 'Poppins';
|
|
4
4
|
font-style: normal;
|
|
5
5
|
font-weight: 400;
|
|
6
6
|
font-display: swap;
|
|
7
|
-
src: url('${
|
|
7
|
+
src: url('${sa}') format('truetype');
|
|
8
8
|
}
|
|
9
9
|
@font-face {
|
|
10
10
|
font-family: 'Poppins';
|
|
11
11
|
font-style: normal;
|
|
12
12
|
font-weight: 500;
|
|
13
13
|
font-display: swap;
|
|
14
|
-
src: url('${
|
|
14
|
+
src: url('${ua}') format('truetype');
|
|
15
15
|
}
|
|
16
16
|
@font-face {
|
|
17
17
|
font-family: 'Poppins';
|
|
18
18
|
font-style: normal;
|
|
19
19
|
font-weight: 600;
|
|
20
20
|
font-display: swap;
|
|
21
|
-
src: url('${
|
|
21
|
+
src: url('${ga}') format('truetype');
|
|
22
22
|
}
|
|
23
23
|
@font-face {
|
|
24
24
|
font-family: 'Poppins';
|
|
25
25
|
font-style: normal;
|
|
26
26
|
font-weight: 700;
|
|
27
27
|
font-display: swap;
|
|
28
|
-
src: url('${
|
|
28
|
+
src: url('${la}') format('truetype');
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
@font-face {
|
|
@@ -33,28 +33,28 @@ var zr="granular-ui-styles",It=new URL("./fonts/Poppins-400.ttf",import.meta.url
|
|
|
33
33
|
font-style: normal;
|
|
34
34
|
font-weight: 400;
|
|
35
35
|
font-display: swap;
|
|
36
|
-
src: url('${
|
|
36
|
+
src: url('${ca}') format('truetype');
|
|
37
37
|
}
|
|
38
38
|
@font-face {
|
|
39
39
|
font-family: 'Arimo';
|
|
40
40
|
font-style: normal;
|
|
41
41
|
font-weight: 500;
|
|
42
42
|
font-display: swap;
|
|
43
|
-
src: url('${
|
|
43
|
+
src: url('${pa}') format('truetype');
|
|
44
44
|
}
|
|
45
45
|
@font-face {
|
|
46
46
|
font-family: 'Arimo';
|
|
47
47
|
font-style: normal;
|
|
48
48
|
font-weight: 600;
|
|
49
49
|
font-display: swap;
|
|
50
|
-
src: url('${
|
|
50
|
+
src: url('${da}') format('truetype');
|
|
51
51
|
}
|
|
52
52
|
@font-face {
|
|
53
53
|
font-family: 'Arimo';
|
|
54
54
|
font-style: normal;
|
|
55
55
|
font-weight: 700;
|
|
56
56
|
font-display: swap;
|
|
57
|
-
src: url('${
|
|
57
|
+
src: url('${ma}') format('truetype');
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
@font-face {
|
|
@@ -62,28 +62,28 @@ var zr="granular-ui-styles",It=new URL("./fonts/Poppins-400.ttf",import.meta.url
|
|
|
62
62
|
font-style: normal;
|
|
63
63
|
font-weight: 400;
|
|
64
64
|
font-display: swap;
|
|
65
|
-
src: url('${
|
|
65
|
+
src: url('${fa}') format('woff2');
|
|
66
66
|
}
|
|
67
67
|
@font-face {
|
|
68
68
|
font-family: 'Inter';
|
|
69
69
|
font-style: normal;
|
|
70
70
|
font-weight: 500;
|
|
71
71
|
font-display: swap;
|
|
72
|
-
src: url('${
|
|
72
|
+
src: url('${ha}') format('woff2');
|
|
73
73
|
}
|
|
74
74
|
@font-face {
|
|
75
75
|
font-family: 'Inter';
|
|
76
76
|
font-style: normal;
|
|
77
77
|
font-weight: 600;
|
|
78
78
|
font-display: swap;
|
|
79
|
-
src: url('${
|
|
79
|
+
src: url('${va}') format('woff2');
|
|
80
80
|
}
|
|
81
81
|
@font-face {
|
|
82
82
|
font-family: 'Inter';
|
|
83
83
|
font-style: normal;
|
|
84
84
|
font-weight: 700;
|
|
85
85
|
font-display: swap;
|
|
86
|
-
src: url('${
|
|
86
|
+
src: url('${ba}') format('woff2');
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
:root {
|
|
@@ -95,6 +95,7 @@ var zr="granular-ui-styles",It=new URL("./fonts/Poppins-400.ttf",import.meta.url
|
|
|
95
95
|
--g-ui-gray-100: #f2f4f7;
|
|
96
96
|
--g-ui-gray-200: #e4e7ec;
|
|
97
97
|
--g-ui-gray-300: #cdd1d9;
|
|
98
|
+
--g-ui-gray-350: #b2b7c3;
|
|
98
99
|
--g-ui-gray-400: #98a2b3;
|
|
99
100
|
--g-ui-gray-500: #667085;
|
|
100
101
|
--g-ui-gray-600: #475467;
|
|
@@ -492,7 +493,7 @@ var zr="granular-ui-styles",It=new URL("./fonts/Poppins-400.ttf",import.meta.url
|
|
|
492
493
|
--g-ui-text: var(--g-ui-fg);
|
|
493
494
|
--g-ui-muted: var(--g-ui-fg-muted);
|
|
494
495
|
|
|
495
|
-
--g-ui-border: var(--g-ui-gray-
|
|
496
|
+
--g-ui-border: var(--g-ui-gray-350);
|
|
496
497
|
--g-ui-border-subtle: var(--g-ui-gray-100);
|
|
497
498
|
--g-ui-border-muted: var(--g-ui-gray-200);
|
|
498
499
|
--g-ui-border-emphasized: var(--g-ui-gray-300);
|
|
@@ -617,7 +618,7 @@ var zr="granular-ui-styles",It=new URL("./fonts/Poppins-400.ttf",import.meta.url
|
|
|
617
618
|
--g-ui-shadow-xl: 0px 20px 24px -4px rgba(16, 24, 40, 0.08), 0px 8px 8px -4px rgba(16, 24, 40, 0.03);
|
|
618
619
|
--g-ui-shadow-2xl: 0px 24px 48px -12px rgba(16, 24, 40, 0.18);
|
|
619
620
|
}
|
|
620
|
-
|
|
621
|
+
|
|
621
622
|
* {
|
|
622
623
|
box-sizing: border-box;
|
|
623
624
|
margin: 0;
|
|
@@ -723,34 +724,34 @@ body {
|
|
|
723
724
|
box-shadow: none;
|
|
724
725
|
border: 1px solid var(--g-ui-border);
|
|
725
726
|
}
|
|
726
|
-
.g-ui-card-border-default { border: 1px solid var(--g-ui-border); }
|
|
727
|
-
.g-ui-card-border-none { border: none; }
|
|
728
|
-
.g-ui-card-border-light { border: 1px solid var(--g-ui-border-light); }
|
|
729
|
-
.g-ui-card-border-dark { border: 1px solid var(--g-ui-border-dark); }
|
|
730
|
-
.g-ui-card-border-primary { border: 1px solid var(--g-ui-primary); }
|
|
731
|
-
.g-ui-card-border-success { border: 1px solid var(--g-ui-success); }
|
|
732
|
-
.g-ui-card-border-danger { border: 1px solid var(--g-ui-danger); }
|
|
733
|
-
.g-ui-card-border-warning { border: 1px solid var(--g-ui-warning); }
|
|
734
|
-
.g-ui-card-border-info { border: 1px solid var(--g-ui-info); }
|
|
735
|
-
.g-ui-card-border-subtle { border: 1px solid var(--g-ui-border-subtle); }
|
|
736
|
-
.g-ui-card-border-emphasized { border: 1px solid var(--g-ui-border-emphasized); }
|
|
737
|
-
.g-ui-card-border-inverted { border: 1px solid var(--g-ui-border-inverted); }
|
|
738
|
-
.g-ui-card-border-error { border: 1px solid var(--g-ui-border-error); }
|
|
739
|
-
.g-ui-card-border-warning { border: 1px solid var(--g-ui-border-warning); }
|
|
740
|
-
.g-ui-card-border-success { border: 1px solid var(--g-ui-border-success); }
|
|
741
|
-
.g-ui-card-border-info { border: 1px solid var(--g-ui-border-info); }
|
|
742
|
-
|
|
743
|
-
.g-ui-card-padding-xs { padding: var(--g-ui-space-10); }
|
|
744
|
-
.g-ui-card-padding-sm { padding: var(--g-ui-space-14); }
|
|
745
|
-
.g-ui-card-padding-md { padding: var(--g-ui-space-18); }
|
|
746
|
-
.g-ui-card-padding-lg { padding: var(--g-ui-space-24); }
|
|
747
|
-
.g-ui-card-radius-sm { border-radius: 8px; }
|
|
748
|
-
.g-ui-card-radius-md { border-radius: 10px; }
|
|
749
|
-
.g-ui-card-radius-lg { border-radius: 14px; }
|
|
750
|
-
.g-ui-card-shadow-none { box-shadow: none; }
|
|
751
|
-
.g-ui-card-shadow-sm { box-shadow: var(--g-ui-shadow-sm); }
|
|
752
|
-
.g-ui-card-shadow-md { box-shadow: var(--g-ui-shadow-md); }
|
|
753
|
-
.g-ui-card-shadow-lg { box-shadow: var(--g-ui-shadow-lg); }
|
|
727
|
+
body .g-ui-card-border-default { border: 1px solid var(--g-ui-border); }
|
|
728
|
+
body .g-ui-card-border-none { border: none; }
|
|
729
|
+
body .g-ui-card-border-light { border: 1px solid var(--g-ui-border-light); }
|
|
730
|
+
body .g-ui-card-border-dark { border: 1px solid var(--g-ui-border-dark); }
|
|
731
|
+
body .g-ui-card-border-primary { border: 1px solid var(--g-ui-primary); }
|
|
732
|
+
body .g-ui-card-border-success { border: 1px solid var(--g-ui-success); }
|
|
733
|
+
body .g-ui-card-border-danger { border: 1px solid var(--g-ui-danger); }
|
|
734
|
+
body .g-ui-card-border-warning { border: 1px solid var(--g-ui-warning); }
|
|
735
|
+
body .g-ui-card-border-info { border: 1px solid var(--g-ui-info); }
|
|
736
|
+
body .g-ui-card-border-subtle { border: 1px solid var(--g-ui-border-subtle); }
|
|
737
|
+
body .g-ui-card-border-emphasized { border: 1px solid var(--g-ui-border-emphasized); }
|
|
738
|
+
body .g-ui-card-border-inverted { border: 1px solid var(--g-ui-border-inverted); }
|
|
739
|
+
body .g-ui-card-border-error { border: 1px solid var(--g-ui-border-error); }
|
|
740
|
+
body .g-ui-card-border-warning { border: 1px solid var(--g-ui-border-warning); }
|
|
741
|
+
body .g-ui-card-border-success { border: 1px solid var(--g-ui-border-success); }
|
|
742
|
+
body .g-ui-card-border-info { border: 1px solid var(--g-ui-border-info); }
|
|
743
|
+
|
|
744
|
+
body .g-ui-card-padding-xs { padding: var(--g-ui-space-10); }
|
|
745
|
+
body .g-ui-card-padding-sm { padding: var(--g-ui-space-14); }
|
|
746
|
+
body .g-ui-card-padding-md { padding: var(--g-ui-space-18); }
|
|
747
|
+
body .g-ui-card-padding-lg { padding: var(--g-ui-space-24); }
|
|
748
|
+
body .g-ui-card-radius-sm { border-radius: 8px; }
|
|
749
|
+
body .g-ui-card-radius-md { border-radius: 10px; }
|
|
750
|
+
body .g-ui-card-radius-lg { border-radius: 14px; }
|
|
751
|
+
body .g-ui-card-shadow-none { box-shadow: none; }
|
|
752
|
+
body .g-ui-card-shadow-sm { box-shadow: var(--g-ui-shadow-sm); }
|
|
753
|
+
body .g-ui-card-shadow-md { box-shadow: var(--g-ui-shadow-md); }
|
|
754
|
+
body .g-ui-card-shadow-lg { box-shadow: var(--g-ui-shadow-lg); }
|
|
754
755
|
.g-ui-card-title {
|
|
755
756
|
margin-bottom: var(--g-ui-space-8);
|
|
756
757
|
font-weight: 600;
|
|
@@ -1195,6 +1196,12 @@ body {
|
|
|
1195
1196
|
.g-ui-select-caret {
|
|
1196
1197
|
color: var(--g-ui-muted);
|
|
1197
1198
|
font-size: 12px;
|
|
1199
|
+
display: inline-flex;
|
|
1200
|
+
align-items: center;
|
|
1201
|
+
justify-content: center;
|
|
1202
|
+
}
|
|
1203
|
+
.g-ui-select-caret svg{
|
|
1204
|
+
fill: var(--g-ui-muted);
|
|
1198
1205
|
}
|
|
1199
1206
|
.g-ui-select-dropdown {
|
|
1200
1207
|
position: absolute;
|
|
@@ -1306,18 +1313,18 @@ body {
|
|
|
1306
1313
|
font-size: 13px;
|
|
1307
1314
|
}
|
|
1308
1315
|
.g-ui-table-with-border {
|
|
1309
|
-
border: 1px solid var(--g-ui-border
|
|
1316
|
+
border: 1px solid var(--g-ui-border);
|
|
1317
|
+
outline: 1px solid var(--g-ui-border);
|
|
1310
1318
|
border-radius: var(--g-ui-radius);
|
|
1311
1319
|
overflow: hidden;
|
|
1312
1320
|
}
|
|
1313
1321
|
.g-ui-table th,
|
|
1314
1322
|
.g-ui-table td {
|
|
1315
|
-
border-bottom: 1px solid var(--g-ui-border-muted);
|
|
1316
1323
|
padding: var(--g-ui-space-10) var(--g-ui-space-12);
|
|
1317
1324
|
text-align: left;
|
|
1318
1325
|
}
|
|
1319
1326
|
.g-ui-table th {
|
|
1320
|
-
font-weight:
|
|
1327
|
+
font-weight: 800;
|
|
1321
1328
|
color: var(--g-ui-muted);
|
|
1322
1329
|
}
|
|
1323
1330
|
.g-ui-table-column-borders th,
|
|
@@ -1328,6 +1335,13 @@ body {
|
|
|
1328
1335
|
.g-ui-table-column-borders td:last-child {
|
|
1329
1336
|
border-right: 0;
|
|
1330
1337
|
}
|
|
1338
|
+
.g-ui-table-row-borders th,
|
|
1339
|
+
.g-ui-table-row-borders td {
|
|
1340
|
+
border-bottom: 1px solid var(--g-ui-border);
|
|
1341
|
+
}
|
|
1342
|
+
.g-ui-table-row-borders tbody tr:last-child td {
|
|
1343
|
+
border-bottom: 0;
|
|
1344
|
+
}
|
|
1331
1345
|
.g-ui-table-striped tbody tr:nth-child(odd) { background: var(--g-ui-bg-subtle); }
|
|
1332
1346
|
.g-ui-table-hover tbody tr:hover { background: var(--g-ui-bg-muted); }
|
|
1333
1347
|
|
|
@@ -1489,7 +1503,7 @@ body {
|
|
|
1489
1503
|
margin-left: auto;
|
|
1490
1504
|
border: 0;
|
|
1491
1505
|
background: transparent;
|
|
1492
|
-
color: var(--g-ui-muted);
|
|
1506
|
+
color: var(--g-ui-fg-muted);
|
|
1493
1507
|
cursor: pointer;
|
|
1494
1508
|
display: flex;
|
|
1495
1509
|
align-items: center;
|
|
@@ -1507,6 +1521,7 @@ body {
|
|
|
1507
1521
|
.g-ui-notification-close svg{
|
|
1508
1522
|
width: 24px;
|
|
1509
1523
|
height: 24px;
|
|
1524
|
+
fill: var(--g-ui-fg-muted);
|
|
1510
1525
|
}
|
|
1511
1526
|
|
|
1512
1527
|
.g-ui-notification-title { font-weight: 500; font-size: 13px; line-height: 1.35; }
|
|
@@ -1569,6 +1584,7 @@ body {
|
|
|
1569
1584
|
border-radius: 10px;
|
|
1570
1585
|
}
|
|
1571
1586
|
|
|
1587
|
+
|
|
1572
1588
|
.g-ui-textarea {
|
|
1573
1589
|
min-height: 120px;
|
|
1574
1590
|
resize: vertical;
|
|
@@ -1590,24 +1606,25 @@ body {
|
|
|
1590
1606
|
.g-ui-number-field-controls {
|
|
1591
1607
|
display: flex;
|
|
1592
1608
|
flex-direction: column;
|
|
1593
|
-
gap: var(--g-ui-space-2);
|
|
1594
1609
|
margin-left: auto;
|
|
1610
|
+
width: 30px;
|
|
1595
1611
|
}
|
|
1596
1612
|
.g-ui-number-field-control {
|
|
1597
|
-
width:
|
|
1598
|
-
height:
|
|
1599
|
-
border-radius: 6px;
|
|
1613
|
+
width: 100%;
|
|
1614
|
+
height: 20px;
|
|
1600
1615
|
display: inline-flex;
|
|
1601
1616
|
align-items: center;
|
|
1602
1617
|
justify-content: center;
|
|
1603
|
-
|
|
1604
|
-
background: var(--g-ui-bg);
|
|
1618
|
+
background: transparent;
|
|
1605
1619
|
color: var(--g-ui-text);
|
|
1606
1620
|
cursor: pointer;
|
|
1607
1621
|
user-select: none;
|
|
1608
1622
|
font-size: 12px;
|
|
1609
1623
|
line-height: 1;
|
|
1610
1624
|
}
|
|
1625
|
+
.g-ui-number-field-control:first-child {
|
|
1626
|
+
border-bottom: 1px solid var(--g-ui-border);
|
|
1627
|
+
}
|
|
1611
1628
|
.g-ui-number-field-control:hover {
|
|
1612
1629
|
background: var(--g-ui-bg-subtle);
|
|
1613
1630
|
}
|
|
@@ -1778,6 +1795,8 @@ body {
|
|
|
1778
1795
|
align-self: flex-start;
|
|
1779
1796
|
justify-self: end;
|
|
1780
1797
|
color: currentColor;
|
|
1798
|
+
position: relative;
|
|
1799
|
+
left: 3px;
|
|
1781
1800
|
}
|
|
1782
1801
|
.g-ui-list-unordered > li:not(.g-ui-list-nested-item)::before {
|
|
1783
1802
|
content: '\u2022';
|
|
@@ -1875,10 +1894,10 @@ body {
|
|
|
1875
1894
|
.g-ui-slider {
|
|
1876
1895
|
width: 100%;
|
|
1877
1896
|
--g-ui-slider-size: 8px;
|
|
1878
|
-
height: calc(var(--g-ui-slider-size) * 2);
|
|
1879
|
-
padding: 0 var(--g-ui-
|
|
1880
|
-
display: flex;
|
|
1881
|
-
align-items: center;
|
|
1897
|
+
/* height: calc(var(--g-ui-slider-size) * 2); */
|
|
1898
|
+
padding: 0 var(--g-ui-space-10);
|
|
1899
|
+
/* display: flex; */
|
|
1900
|
+
/* align-items: center; */
|
|
1882
1901
|
position: relative;
|
|
1883
1902
|
}
|
|
1884
1903
|
.g-ui-range-slider {
|
|
@@ -1918,13 +1937,16 @@ body {
|
|
|
1918
1937
|
}
|
|
1919
1938
|
.g-ui-slider-marks {
|
|
1920
1939
|
position: absolute;
|
|
1921
|
-
top: calc(100%
|
|
1940
|
+
top: calc(100% - var(--g-ui-space-8));
|
|
1922
1941
|
left:10px;
|
|
1923
1942
|
right:15px;
|
|
1924
|
-
height:
|
|
1943
|
+
height: 12px;
|
|
1925
1944
|
box-sizing: border-box;
|
|
1926
1945
|
padding: 0 var(--g-ui-slider-size);
|
|
1927
1946
|
}
|
|
1947
|
+
.g-ui-slider-marks-placeholder {
|
|
1948
|
+
height: 18px;
|
|
1949
|
+
}
|
|
1928
1950
|
.g-ui-slider-mark {
|
|
1929
1951
|
position: absolute;
|
|
1930
1952
|
top: 0;
|
|
@@ -2095,6 +2117,46 @@ body {
|
|
|
2095
2117
|
display: flex;
|
|
2096
2118
|
flex-direction: column;
|
|
2097
2119
|
gap: 0;
|
|
2120
|
+
position: relative;
|
|
2121
|
+
}
|
|
2122
|
+
.g-ui-timeline[data-active-color="primary"] { --g-ui-timeline-active-color: var(--g-ui-primary); }
|
|
2123
|
+
.g-ui-timeline[data-active-color="success"] { --g-ui-timeline-active-color: var(--g-ui-success); }
|
|
2124
|
+
.g-ui-timeline[data-active-color="danger"] { --g-ui-timeline-active-color: var(--g-ui-danger); }
|
|
2125
|
+
.g-ui-timeline[data-active-color="error"] { --g-ui-timeline-active-color: var(--g-ui-danger); }
|
|
2126
|
+
.g-ui-timeline[data-active-color="warning"] { --g-ui-timeline-active-color: var(--g-ui-warning); }
|
|
2127
|
+
.g-ui-timeline[data-active-color="info"] { --g-ui-timeline-active-color: var(--g-ui-info); }
|
|
2128
|
+
.g-ui-timeline-track-segment {
|
|
2129
|
+
position: absolute;
|
|
2130
|
+
left: var(--g-ui-timeline-track-offset, 12px);
|
|
2131
|
+
width: var(--g-ui-timeline-line-width, 4px);
|
|
2132
|
+
background: var(--g-ui-border-muted);
|
|
2133
|
+
border-radius: 2px;
|
|
2134
|
+
z-index: 0;
|
|
2135
|
+
pointer-events: none;
|
|
2136
|
+
overflow: hidden;
|
|
2137
|
+
}
|
|
2138
|
+
.g-ui-timeline-track-segment .g-ui-timeline-track-fill {
|
|
2139
|
+
position: absolute;
|
|
2140
|
+
left: 0;
|
|
2141
|
+
top: 0;
|
|
2142
|
+
width: 100%;
|
|
2143
|
+
height: 0%;
|
|
2144
|
+
min-height: 0;
|
|
2145
|
+
background: var(--g-ui-timeline-active-color, var(--g-ui-primary));
|
|
2146
|
+
border-radius: inherit;
|
|
2147
|
+
transition: height 0.25s ease;
|
|
2148
|
+
z-index: 1;
|
|
2149
|
+
}
|
|
2150
|
+
.g-ui-timeline-reverse .g-ui-timeline-track-fill {
|
|
2151
|
+
top: auto;
|
|
2152
|
+
bottom: 0;
|
|
2153
|
+
}
|
|
2154
|
+
.g-ui-timeline-align-right .g-ui-timeline-track-segment {
|
|
2155
|
+
left: auto;
|
|
2156
|
+
right: var(--g-ui-timeline-track-offset, 12px);
|
|
2157
|
+
}
|
|
2158
|
+
.g-ui-timeline-has-track .g-ui-timeline-item::before {
|
|
2159
|
+
display: none;
|
|
2098
2160
|
}
|
|
2099
2161
|
.g-ui-timeline-item {
|
|
2100
2162
|
display: grid;
|
|
@@ -2103,6 +2165,32 @@ body {
|
|
|
2103
2165
|
align-items: start;
|
|
2104
2166
|
position: relative;
|
|
2105
2167
|
padding-bottom: var(--g-ui-space-24);
|
|
2168
|
+
z-index: 1;
|
|
2169
|
+
}
|
|
2170
|
+
.g-ui-timeline-item .g-ui-timeline-dot {
|
|
2171
|
+
justify-self: center;
|
|
2172
|
+
}
|
|
2173
|
+
.g-ui-timeline-align-right {
|
|
2174
|
+
width: max-content;
|
|
2175
|
+
max-width: 100%;
|
|
2176
|
+
}
|
|
2177
|
+
.g-ui-timeline-align-right .g-ui-timeline-item {
|
|
2178
|
+
grid-template-columns: auto 28px;
|
|
2179
|
+
max-width: 100%;
|
|
2180
|
+
}
|
|
2181
|
+
.g-ui-timeline-align-right .g-ui-timeline-item .g-ui-timeline-dot {
|
|
2182
|
+
order: 2;
|
|
2183
|
+
justify-self: center;
|
|
2184
|
+
}
|
|
2185
|
+
.g-ui-timeline-align-right .g-ui-timeline-item .g-ui-timeline-content {
|
|
2186
|
+
order: 1;
|
|
2187
|
+
justify-self: end;
|
|
2188
|
+
text-align: right;
|
|
2189
|
+
min-width: 0;
|
|
2190
|
+
}
|
|
2191
|
+
.g-ui-timeline-align-right .g-ui-timeline-item::before {
|
|
2192
|
+
left: auto;
|
|
2193
|
+
right: var(--g-ui-timeline-track-offset, 12px);
|
|
2106
2194
|
}
|
|
2107
2195
|
.g-ui-timeline-item:last-child {
|
|
2108
2196
|
padding-bottom: 0;
|
|
@@ -2110,24 +2198,100 @@ body {
|
|
|
2110
2198
|
.g-ui-timeline-item::before {
|
|
2111
2199
|
content: '';
|
|
2112
2200
|
position: absolute;
|
|
2113
|
-
left:
|
|
2114
|
-
top:
|
|
2201
|
+
left: var(--g-ui-timeline-track-offset, 12px);
|
|
2202
|
+
top: var(--g-ui-timeline-pin-half, 10px);
|
|
2115
2203
|
bottom: 0;
|
|
2116
|
-
width: 4px;
|
|
2204
|
+
width: var(--g-ui-timeline-line-width, 4px);
|
|
2117
2205
|
background: var(--g-ui-border-muted);
|
|
2118
2206
|
}
|
|
2119
2207
|
.g-ui-timeline-item:last-child::before {
|
|
2120
2208
|
display: none;
|
|
2209
|
+
}
|
|
2210
|
+
.g-ui-dot-wrapper {
|
|
2211
|
+
|
|
2121
2212
|
}
|
|
2122
2213
|
.g-ui-timeline-dot {
|
|
2123
2214
|
width: 20px;
|
|
2124
2215
|
height: 20px;
|
|
2125
2216
|
border-radius: 50%;
|
|
2126
2217
|
background: var(--g-ui-bg);
|
|
2127
|
-
border: 4px solid var(--g-ui-
|
|
2218
|
+
border: 4px solid var(--g-ui-border-muted);
|
|
2128
2219
|
margin-top: 0;
|
|
2129
2220
|
position: relative;
|
|
2130
2221
|
z-index: 1;
|
|
2222
|
+
transition: border-color 0.2s ease, background 0.2s ease;
|
|
2223
|
+
display: flex;
|
|
2224
|
+
align-items: center;
|
|
2225
|
+
justify-content: center;
|
|
2226
|
+
}
|
|
2227
|
+
.g-ui-timeline-pin-size-xs .g-ui-timeline-dot { width: 12px; height: 12px; border-width: 2px; }
|
|
2228
|
+
.g-ui-timeline-pin-size-sm .g-ui-timeline-dot { width: 16px; height: 16px; border-width: 3px; }
|
|
2229
|
+
.g-ui-timeline-pin-size-md .g-ui-timeline-dot { width: 20px; height: 20px; border-width: 4px; }
|
|
2230
|
+
.g-ui-timeline-pin-size-lg .g-ui-timeline-dot { width: 24px; height: 24px; border-width: 4px; }
|
|
2231
|
+
.g-ui-timeline-pin-size-xl .g-ui-timeline-dot { width: 28px; height: 28px; border-width: 4px; }
|
|
2232
|
+
.g-ui-timeline-pin-radius-xs .g-ui-timeline-dot { border-radius: 2px; }
|
|
2233
|
+
.g-ui-timeline-pin-radius-sm .g-ui-timeline-dot { border-radius: 4px; }
|
|
2234
|
+
.g-ui-timeline-pin-radius-md .g-ui-timeline-dot { border-radius: 50%; }
|
|
2235
|
+
.g-ui-timeline-pin-radius-lg .g-ui-timeline-dot { border-radius: 50%; }
|
|
2236
|
+
.g-ui-timeline-pin-radius-xl .g-ui-timeline-dot { border-radius: 50%; }
|
|
2237
|
+
.g-ui-timeline-dot-inner {
|
|
2238
|
+
width: 100%;
|
|
2239
|
+
height: 100%;
|
|
2240
|
+
border-radius: inherit;
|
|
2241
|
+
background: inherit;
|
|
2242
|
+
position: absolute;
|
|
2243
|
+
inset: 0;
|
|
2244
|
+
}
|
|
2245
|
+
.g-ui-timeline-pin-mode-icon .g-ui-timeline-dot,
|
|
2246
|
+
.g-ui-timeline-pin-mode-image .g-ui-timeline-dot,
|
|
2247
|
+
.g-ui-timeline-pin-mode-custom .g-ui-timeline-dot {
|
|
2248
|
+
display: flex;
|
|
2249
|
+
align-items: center;
|
|
2250
|
+
justify-content: center;
|
|
2251
|
+
}
|
|
2252
|
+
.g-ui-timeline-pin-mode-icon .g-ui-timeline-dot .g-ui-timeline-pin-icon,
|
|
2253
|
+
.g-ui-timeline-pin-mode-image .g-ui-timeline-dot .g-ui-timeline-pin-image,
|
|
2254
|
+
.g-ui-timeline-pin-mode-custom .g-ui-timeline-dot > *:not(.g-ui-timeline-dot-inner) {
|
|
2255
|
+
position: relative;
|
|
2256
|
+
z-index: 1;
|
|
2257
|
+
}
|
|
2258
|
+
.g-ui-timeline-pin-mode-icon .g-ui-timeline-dot .g-ui-timeline-pin-icon {
|
|
2259
|
+
font-size: 12px;
|
|
2260
|
+
line-height: 1;
|
|
2261
|
+
color: inherit;
|
|
2262
|
+
}
|
|
2263
|
+
.g-ui-timeline-pin-size-sm .g-ui-timeline-pin-mode-icon .g-ui-timeline-dot .g-ui-timeline-pin-icon { font-size: 10px; }
|
|
2264
|
+
.g-ui-timeline-pin-size-lg .g-ui-timeline-dot .g-ui-timeline-pin-icon { font-size: 14px; }
|
|
2265
|
+
.g-ui-timeline-pin-size-xl .g-ui-timeline-dot .g-ui-timeline-pin-icon { font-size: 16px; }
|
|
2266
|
+
.g-ui-timeline-pin-mode-icon .g-ui-timeline-dot .g-ui-timeline-dot-inner,
|
|
2267
|
+
.g-ui-timeline-pin-mode-image .g-ui-timeline-dot .g-ui-timeline-dot-inner,
|
|
2268
|
+
.g-ui-timeline-pin-mode-custom .g-ui-timeline-dot .g-ui-timeline-dot-inner {
|
|
2269
|
+
display: none;
|
|
2270
|
+
}
|
|
2271
|
+
.g-ui-timeline-pin-mode-image .g-ui-timeline-dot .g-ui-timeline-pin-image {
|
|
2272
|
+
width: 100%;
|
|
2273
|
+
height: 100%;
|
|
2274
|
+
object-fit: cover;
|
|
2275
|
+
border-radius: inherit;
|
|
2276
|
+
}
|
|
2277
|
+
.g-ui-timeline-item-completed .g-ui-timeline-dot {
|
|
2278
|
+
border-color: var(--g-ui-timeline-active-color, var(--g-ui-primary));
|
|
2279
|
+
background: var(--g-ui-timeline-active-color, var(--g-ui-primary));
|
|
2280
|
+
}
|
|
2281
|
+
.g-ui-timeline-item-active .g-ui-timeline-dot {
|
|
2282
|
+
border-color: var(--g-ui-timeline-active-color, var(--g-ui-primary));
|
|
2283
|
+
background: var(--g-ui-bg);
|
|
2284
|
+
box-shadow: 0 0 0 2px var(--g-ui-bg), 0 0 0 4px var(--g-ui-timeline-active-color, var(--g-ui-primary));
|
|
2285
|
+
}
|
|
2286
|
+
.g-ui-timeline-item-future .g-ui-timeline-dot {
|
|
2287
|
+
border-color: var(--g-ui-border-muted);
|
|
2288
|
+
background: var(--g-ui-bg);
|
|
2289
|
+
}
|
|
2290
|
+
.g-ui-timeline-clickable .g-ui-timeline-item {
|
|
2291
|
+
cursor: pointer;
|
|
2292
|
+
}
|
|
2293
|
+
.g-ui-timeline-clickable .g-ui-timeline-item:hover .g-ui-timeline-dot {
|
|
2294
|
+
border-color: var(--g-ui-primary-muted, var(--g-ui-timeline-active-color));
|
|
2131
2295
|
}
|
|
2132
2296
|
.g-ui-timeline-content {
|
|
2133
2297
|
display: flex;
|
|
@@ -2933,16 +3097,43 @@ body {
|
|
|
2933
3097
|
}
|
|
2934
3098
|
|
|
2935
3099
|
.g-ui-progress-ring {
|
|
3100
|
+
position: relative;
|
|
2936
3101
|
width: 48px;
|
|
2937
3102
|
height: 48px;
|
|
2938
3103
|
border-radius: 50%;
|
|
3104
|
+
flex-shrink: 0;
|
|
3105
|
+
}
|
|
3106
|
+
.g-ui-progress-ring-hole {
|
|
3107
|
+
position: absolute;
|
|
3108
|
+
inset: 8px;
|
|
3109
|
+
border-radius: 50%;
|
|
3110
|
+
background: var(--g-ui-bg);
|
|
3111
|
+
}
|
|
3112
|
+
.g-ui-progress-ring-primary { --g-ui-progress-ring-fill: var(--g-ui-primary); }
|
|
3113
|
+
.g-ui-progress-ring-success { --g-ui-progress-ring-fill: var(--g-ui-success); }
|
|
3114
|
+
.g-ui-progress-ring-danger { --g-ui-progress-ring-fill: var(--g-ui-danger); }
|
|
3115
|
+
.g-ui-progress-ring-warning { --g-ui-progress-ring-fill: var(--g-ui-warning); }
|
|
3116
|
+
.g-ui-progress-ring:not(.g-ui-progress-ring-indeterminate) {
|
|
3117
|
+
background: conic-gradient(
|
|
3118
|
+
var(--g-ui-progress-ring-fill, var(--g-ui-primary)) 0deg calc(var(--g-ui-progress-ring-value, 0) * 3.6deg),
|
|
3119
|
+
var(--g-ui-border-muted) calc(var(--g-ui-progress-ring-value, 0) * 3.6deg) 360deg
|
|
3120
|
+
);
|
|
3121
|
+
}
|
|
3122
|
+
.g-ui-progress-ring-indeterminate {
|
|
2939
3123
|
border: 4px solid var(--g-ui-border-muted);
|
|
2940
|
-
border-top-color: var(--g-ui-primary);
|
|
3124
|
+
border-top-color: var(--g-ui-progress-ring-fill, var(--g-ui-primary));
|
|
2941
3125
|
animation: g-ui-spin 1s linear infinite;
|
|
2942
3126
|
}
|
|
3127
|
+
.g-ui-progress-ring-indeterminate .g-ui-progress-ring-hole {
|
|
3128
|
+
inset: 4px;
|
|
3129
|
+
}
|
|
2943
3130
|
.g-ui-progress-ring-size-sm { width: 32px; height: 32px; }
|
|
3131
|
+
.g-ui-progress-ring-size-sm .g-ui-progress-ring-hole { inset: 6px; }
|
|
3132
|
+
.g-ui-progress-ring-size-sm.g-ui-progress-ring-indeterminate .g-ui-progress-ring-hole { inset: 3px; }
|
|
2944
3133
|
.g-ui-progress-ring-size-md { width: 48px; height: 48px; }
|
|
2945
3134
|
.g-ui-progress-ring-size-lg { width: 64px; height: 64px; }
|
|
3135
|
+
.g-ui-progress-ring-size-lg .g-ui-progress-ring-hole { inset: 10px; }
|
|
3136
|
+
.g-ui-progress-ring-size-lg.g-ui-progress-ring-indeterminate .g-ui-progress-ring-hole { inset: 5px; }
|
|
2946
3137
|
|
|
2947
3138
|
.g-ui-toast-close {
|
|
2948
3139
|
margin-left: auto;
|
|
@@ -2951,6 +3142,11 @@ body {
|
|
|
2951
3142
|
color: var(--g-ui-muted);
|
|
2952
3143
|
cursor: pointer;
|
|
2953
3144
|
}
|
|
3145
|
+
.g-ui-toast-close svg {
|
|
3146
|
+
width: 16px;
|
|
3147
|
+
height: 16px;
|
|
3148
|
+
fill: var(--g-ui-muted);
|
|
3149
|
+
}
|
|
2954
3150
|
|
|
2955
3151
|
.g-ui-toast-row {
|
|
2956
3152
|
display: flex;
|
|
@@ -2958,6 +3154,43 @@ body {
|
|
|
2958
3154
|
gap: var(--g-ui-space-8);
|
|
2959
3155
|
}
|
|
2960
3156
|
|
|
3157
|
+
.g-ui-autocomplete {
|
|
3158
|
+
position: relative;
|
|
3159
|
+
width: 100%;
|
|
3160
|
+
}
|
|
3161
|
+
.g-ui-autocomplete-dropdown {
|
|
3162
|
+
position: absolute;
|
|
3163
|
+
top: calc(100% + var(--g-ui-space-4));
|
|
3164
|
+
left: 0;
|
|
3165
|
+
right: 0;
|
|
3166
|
+
z-index: 100;
|
|
3167
|
+
border: 1px solid var(--g-ui-border-muted);
|
|
3168
|
+
border-radius: var(--g-ui-radius);
|
|
3169
|
+
background: var(--g-ui-bg-panel);
|
|
3170
|
+
box-shadow: var(--g-ui-shadow-md);
|
|
3171
|
+
}
|
|
3172
|
+
.g-ui-autocomplete-list {
|
|
3173
|
+
overflow: auto;
|
|
3174
|
+
padding: var(--g-ui-space-4);
|
|
3175
|
+
}
|
|
3176
|
+
.g-ui-autocomplete-item {
|
|
3177
|
+
padding: var(--g-ui-space-6) var(--g-ui-space-8);
|
|
3178
|
+
border-radius: var(--g-ui-radius);
|
|
3179
|
+
cursor: pointer;
|
|
3180
|
+
font-size: var(--g-ui-font-size-sm);
|
|
3181
|
+
}
|
|
3182
|
+
.g-ui-autocomplete-item:hover {
|
|
3183
|
+
background: var(--g-ui-bg-subtle);
|
|
3184
|
+
}
|
|
3185
|
+
.g-ui-autocomplete-item-active {
|
|
3186
|
+
background: var(--g-ui-primary-subtle);
|
|
3187
|
+
color: var(--g-ui-primary);
|
|
3188
|
+
}
|
|
3189
|
+
.g-ui-autocomplete-disabled {
|
|
3190
|
+
pointer-events: none;
|
|
3191
|
+
opacity: 0.7;
|
|
3192
|
+
}
|
|
3193
|
+
|
|
2961
3194
|
.g-ui-select-search {
|
|
2962
3195
|
display: flex;
|
|
2963
3196
|
flex-direction: column;
|
|
@@ -2975,6 +3208,7 @@ body {
|
|
|
2975
3208
|
justify-content: center;
|
|
2976
3209
|
color: var(--g-ui-muted);
|
|
2977
3210
|
font-size: 16px;
|
|
3211
|
+
fill: var(--g-ui-muted);
|
|
2978
3212
|
}
|
|
2979
3213
|
.g-ui-search-input-left-section svg {
|
|
2980
3214
|
width: 100%;
|
|
@@ -3019,8 +3253,15 @@ body {
|
|
|
3019
3253
|
|
|
3020
3254
|
.g-ui-range-picker {
|
|
3021
3255
|
display: grid;
|
|
3022
|
-
grid-template-columns: 1fr 1fr;
|
|
3023
|
-
gap: var(--g-ui-space-
|
|
3256
|
+
grid-template-columns: 1fr auto 1fr;
|
|
3257
|
+
gap: var(--g-ui-space-8);
|
|
3258
|
+
align-items: center;
|
|
3259
|
+
}
|
|
3260
|
+
.g-ui-range-picker-separator {
|
|
3261
|
+
color: var(--g-ui-fg-muted);
|
|
3262
|
+
font-size: var(--g-ui-font-size-sm);
|
|
3263
|
+
line-height: 1;
|
|
3264
|
+
flex-shrink: 0;
|
|
3024
3265
|
}
|
|
3025
3266
|
|
|
3026
3267
|
.g-ui-toast-auto {
|
|
@@ -3878,5 +4119,5 @@ body {
|
|
|
3878
4119
|
@keyframes g-ui-spin { to { transform: rotate(360deg); } }
|
|
3879
4120
|
@keyframes g-ui-bounce { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(-5px); opacity: 1; } }
|
|
3880
4121
|
@keyframes g-ui-bars { 0%, 100% { transform: scaleY(.6); } 50% { transform: scaleY(1.2); } }
|
|
3881
|
-
`;function Nr(){if(typeof document>"u"||document.getElementById(zr))return;let e=document.createElement("style");e.id=zr,e.textContent=Gt,document.head.appendChild(e)}var Zt=new Set(["--g-ui-bg","--g-ui-bg-subtle","--g-ui-bg-muted","--g-ui-bg-emphasized","--g-ui-bg-inverted","--g-ui-bg-panel","--g-ui-fg","--g-ui-fg-muted","--g-ui-fg-subtle","--g-ui-fg-inverted","--g-ui-border","--g-ui-border-subtle","--g-ui-border-emphasized","--g-ui-border-inverted","--g-ui-primary","--g-ui-primary-hover","--g-ui-primary-active","--g-ui-primary-subtle","--g-ui-primary-muted","--g-ui-primary-emphasized","--g-ui-success","--g-ui-success-hover","--g-ui-success-active","--g-ui-success-subtle","--g-ui-success-muted","--g-ui-danger","--g-ui-danger-hover","--g-ui-danger-active","--g-ui-danger-subtle","--g-ui-danger-muted","--g-ui-warning","--g-ui-warning-hover","--g-ui-warning-active","--g-ui-warning-subtle","--g-ui-warning-muted","--g-ui-info","--g-ui-info-hover","--g-ui-info-active","--g-ui-info-subtle","--g-ui-info-muted","--g-ui-shadow-xs","--g-ui-shadow-sm","--g-ui-shadow-md","--g-ui-shadow-lg","--g-ui-shadow-xl","--g-ui-shadow-2xl","--g-ui-radius","--g-ui-font","--g-ui-surface","--g-ui-text","--g-ui-muted","--g-ui-primary-strong","--g-ui-shadow"]);function Ut(e={},i=document?.documentElement){if(i)for(let[r,t]of Object.entries(e)){let a=r.startsWith("--")?r:`--g-ui-${r}`;Zt.has(a)&&i.style.setProperty(a,String(t))}}function Xt(e="dark",i=document?.documentElement){i&&(i.classList.remove("g-ui-theme-dark","g-ui-theme-light"),i.classList.add(e==="light"?"g-ui-theme-light":"g-ui-theme-dark"))}function _t(e=document?.documentElement){return e.classList.contains("g-ui-theme-light")?"light":"dark"}import{Renderer as Cr,isSignal as Sr,isState as Dr,isStatePath as Pr,isComputed as Mr,resolve as Le,computed as Kt,after as Ai,concat as Qt}from"@granularjs/core";function Fi(e){return Sr(e)||Dr(e)||Pr(e)||Mr(e)}function o(...e){return Qt(...e,{separator:" ",filterFalsy:!0})}function Tr(e){if(!(e==null||e===""))return typeof e=="number"?`${e}px`:e}function s(e,i){let r={},t=[],a=n=>!!n&&typeof n=="object"&&!Array.isArray(n)&&!Cr.isRenderable(n)&&!Cr.isDomNode(n)&&!Sr(n)&&!Dr(n)&&!Pr(n)&&!Mr(n);for(let n of e)a(n)?Object.assign(r,n):t.push(n);if(i&&typeof i=="object")for(let n of Object.keys(i))r[n]===void 0&&(r[n]=i[n]);return{props:Kt(r),rawProps:r,children:t}}function c(e){return Le(e)}function be(e){return!!Le(e)}function k(e,i,r){let t=a=>{let n=Le(a),u=n==null||n===""?r:n;return u==null||u===""?"":`${e}${u}`};return Fi(i)?Ai(i).compute(a=>t(a)):t(i)}function W(e,i){return Fi(i)?Ai(i).compute(r=>Le(r)?e:""):Le(i)?e:""}function de(e,i,r){let t=a=>i[a]||null;return Fi(e)?Ai(e).compute(a=>t(Le(a??r))):t(Le(e??r))}import{Button as Jt,Span as ji,when as Ei,after as ea}from"@granularjs/core";function Ri(...e){let{props:i,children:r}=s(e,{variant:"filled",size:"md",justify:"center"}),{variant:t,color:a,size:n,fullWidth:u,loading:g,leftSection:d,rightSection:v,className:m,disabled:h,justify:x,...l}=i,y=ea(h,g).compute(([z,B])=>z||B);return Jt({...l,disabled:y,className:o("g-ui-button",k("g-ui-button-variant-",t,"filled"),k("g-ui-button-color-",a,"primary"),k("g-ui-justify-",x,"center"),k("g-ui-button-size-",n,"md"),W("g-ui-button-full",u),W("g-ui-button-loading",g),m)},Ei(d,()=>ji({className:"g-ui-button-section-left"},d)),Ei(g,()=>ji("Loading..."),()=>r),Ei(v,()=>ji({className:"g-ui-button-section-right"},v)))}import{Span as ia}from"@granularjs/core";function Hi(...e){let{props:i,children:r}=s(e,{size:"md"}),{size:t,weight:a,color:n,dimmed:u,align:g,ellipsis:d,decoration:v,className:m,style:h,...x}=i,l=de(a,{bold:"g-ui-text-weight-700",semibold:"g-ui-text-weight-600",medium:"g-ui-text-weight-500",700:"g-ui-text-weight-700",600:"g-ui-text-weight-600",500:"g-ui-text-weight-500",400:"g-ui-text-weight-400"}),y=de(n,{primary:"g-ui-text-primary",success:"g-ui-text-success",danger:"g-ui-text-danger",muted:"g-ui-text-dimmed"}),z=de(g,{center:"g-ui-text-align-center",right:"g-ui-text-align-right",left:"g-ui-text-align-left"}),B=de(v,{underline:"g-ui-text-decoration-underline","line-through":"g-ui-text-decoration-line-through",overline:"g-ui-text-decoration-overline",none:"g-ui-text-decoration-none"});return ia({...x,style:h,className:o("g-ui-text",k("g-ui-text-size-",t,"md"),W("g-ui-text-dimmed",u),W("g-ui-text-ellipsis",d),l,y,z,B,m)},r)}import{H1 as ra,H2 as Vr,H3 as ta,H4 as aa,H5 as oa,H6 as na}from"@granularjs/core";var sa={1:ra,2:Vr,3:ta,4:aa,5:oa,6:na};function ua(...e){let{props:i,children:r}=s(e,{order:2}),{order:t,className:a,style:n,...u}=i,g=c(t)||2;return(sa[g]||Vr)({...u,className:o("g-ui-title",k("g-ui-title-order-",t,2),a)},r)}import{Div as ga}from"@granularjs/core";function la(...e){let{props:i,children:r}=s(e,{size:"md"}),{size:t,fluid:a,className:n,style:u,...g}=i;return ga({...g,style:u,className:o("g-ui-container",W("g-ui-container-fluid",a),k("g-ui-container-size-",t,"md"),n)},r)}import{Div as ca}from"@granularjs/core";function pa(...e){let{props:i,children:r}=s(e,{gap:"md"}),{gap:t,align:a,justify:n,className:u,style:g,...d}=i,v=de(n,{between:"g-ui-justify-between",center:"g-ui-justify-center",end:"g-ui-justify-end",start:"g-ui-justify-start"});return ca({...d,style:g,className:o("g-ui-stack",k("g-ui-gap-",t,"md"),k("g-ui-align-",a),v,u)},r)}import{Div as da}from"@granularjs/core";function ma(...e){let{props:i,children:r}=s(e,{gap:"md",align:"center"}),{gap:t,align:a,justify:n,position:u,noWrap:g,className:d,style:v,...m}=i,h=de(u,{apart:"g-ui-justify-between",center:"g-ui-justify-center",right:"g-ui-justify-end",left:"g-ui-justify-start"});return da({...m,style:v,className:o("g-ui-group",k("g-ui-gap-",t,"md"),k("g-ui-align-",a,"center"),k("g-ui-justify-",n,"none"),h,W("g-ui-no-wrap",g),d)},r)}import{Div as pi,list as fa,when as Oi,after as Lr}from"@granularjs/core";function va(...e){let{props:i,children:r}=s(e,{padding:"md",radius:"md",shadow:"none",border:"default"}),{title:t,content:a,actions:n,border:u,padding:g,radius:d,shadow:v,className:m,style:h,...x}=i;return pi({style:h},Oi(t,()=>pi({className:"g-ui-card-title"},t)),Oi(a,()=>pi({className:"g-ui-card-content"},a)),{className:o("g-ui-card",k("g-ui-card-border-",u,"md"),k("g-ui-card-padding-",g,"md"),k("g-ui-card-radius-",d,"md"),k("g-ui-card-shadow-",v,"md"),m),...x},r,Oi(n,()=>pi({className:"g-ui-card-actions"},fa(n,l=>Ri({className:"g-ui-card-action",onClick:y=>l.get().onClick?.(y),leftSection:l.leftSection,rightSection:l.rightSection,size:Lr(l.size).compute(y=>y||"sm"),variant:Lr(l.variant).compute(y=>y||"outline"),...l.get().props||{}},l.label)))))}import{Span as ha}from"@granularjs/core";function ba(...e){let{props:i,children:r}=s(e,{variant:"filled",size:"md"}),{variant:t,size:a,className:n,dot:u,style:g,...d}=i,v=de(t,{dot:"g-ui-badge-dot"});return ha({...d,className:o("g-ui-badge",k("g-ui-badge-variant-",t,"filled"),k("g-ui-badge-size-",a,"md"),W("g-ui-badge-dot",u),v,n)},r)}import{Div as Ue,Input as xa,Textarea as wa,Label as ya,Span as ka,when as Xe,state as za,after as Na,isState as Ca}from"@granularjs/core";function ge(...e){let{props:i,rawProps:r}=s(e,{size:"md"}),{label:t,description:a,error:n,size:u,leftSection:g,rightSection:d,className:v,inputClassName:m,multiline:h,value:x,...l}=i,{value:y,node:z,onChange:B,onInput:L,onFocus:D,onBlur:F,onKeyDown:N,onKeyUp:w,onClick:b}=r,f=Ca(y)&&!B&&!L,S=f?y:za(c(x)??"");Na(x).change(ae=>{f||S.set(c(ae)??"")});let V=ae=>{let K=ae?.target?.value??"";K!==x.get()&&(S.set(K),B?.(ae),L?.(ae))},I=be(h),X=I?wa:xa,te=o(m,I&&"g-ui-textarea"),re=X({...l,node:z,value:S,onInput:V,onChange:V,onFocus:D,onBlur:F,onKeyDown:N,onKeyUp:w,onClick:b,className:o("g-ui-input",te)});return Ue({className:o("g-ui-text-input",v)},Xe(t,()=>ya({className:"g-ui-text-input-label"},t)),Xe(a,()=>ka({className:"g-ui-text-input-description"},a)),Ue({className:o("g-ui-input-wrapper",W("g-ui-input-multiline",h),k("g-ui-input-size-",u,"md"),W("g-ui-input-error",n))},Xe(g,()=>Ue({className:"g-ui-input-section"},g)),re,Xe(d,()=>Ue({className:"g-ui-input-section"},d))),Xe(n,()=>Ue({className:"g-ui-text-input-error-text"},n)))}function qi(...e){let{props:i}=s(e,{size:"md"}),{size:r,leftSection:t,rightSection:a,className:n,...u}=i;return ge({...u,size:r,className:n,leftSection:t,rightSection:a,multiline:!0})}import{Div as $r,Span as Ir,after as $e,state as Sa}from"@granularjs/core";function Yi(...e){let{props:i,rawProps:r}=s(e,{size:"md",step:1,allowDecimal:!0,allowNegative:!0,clampBehavior:"blur",hideControls:!1,decimalSeparator:".",thousandSeparator:"",format:null,prefix:"",suffix:""}),{value:t,min:a,max:n,step:u,size:g,allowDecimal:d,allowNegative:v,decimalSeparator:m,thousandSeparator:h,decimalScale:x,clampBehavior:l,hideControls:y,format:z,locale:B,currency:L,formatOptions:D,prefix:F,suffix:N,leftSection:w,rightSection:b,className:f,onChange:S,onInput:V,...I}=i,{onChange:X,onInput:te,onBlur:re,onFocus:ae,onKeyDown:K}=r,ne=M=>{X?.(M.target?.value??""),te?.(M.target?.value??"")},me=ne,ie=Sa(""),T=M=>String(M??"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=()=>{if(!!!c(d))return 0;let P=c(x);if(P!=null&&P!==""&&Number.isFinite(Number(P)))return Math.max(0,Number(P));let E=c(z);return E==="currency"||E==="percent"?2:0},C=M=>{let P=c(m)??".",E=c(h)??"",O=String(M??"");if(E&&(O=O.split(E).join("")),!O||O==="-"||O===P||O.endsWith(P))return null;let _=O.replace(P,"."),Z=Number(_);return Number.isFinite(Z)?Z:null},G=M=>{let P=c(h)??"";return P?M.replace(/\B(?=(\d{3})+(?!\d))/g,P):M},H=M=>{let P=c(m)??".",E=R(),O=Number(M);if(!Number.isFinite(O))return"";let _=O<0?"-":"",Z=Math.abs(O),[Y,U=""]=String(Z).split("."),ee=G(Y);if(E>0){let fe=U.slice(0,E).padEnd(E,"0");return`${_}${ee}${P}${fe}`}return`${_}${ee}`},se=(M,P)=>{try{let E=c(B),O=c(L)??"USD",_=c(D)??{},Z=R(),Y=P==="currency"?"currency":"decimal";return new Intl.NumberFormat(E,{style:Y,currency:O,...Z>0?{minimumFractionDigits:Z,maximumFractionDigits:Z}:{maximumFractionDigits:0},..._}).format(M)}catch{return H(M)}},ue=M=>{let P=M,E=c(a),O=c(n);return E!=null&&Number.isFinite(Number(E))&&(P=Math.max(P,Number(E))),O!=null&&Number.isFinite(Number(O))&&(P=Math.min(P,Number(O))),!c(v)&&P<0&&(P=0),P},he=()=>{let M=c(N)??"",P=c(z);return!M&&P==="percent"?"%":M},ze=(M,P,E)=>{let O=c(F)??"",_=he(),Z=String(M??"").replace(/\u00A0/g," "),Y=String(O??"").replace(/\u00A0/g," "),U=String(_??"").replace(/\u00A0/g," "),ee=Y&&Z.startsWith(Y),fe=U&&Z.endsWith(U);return`${P??""}${ee?"":O}${M}${fe?"":_}`},Se=(M,P)=>{let E=R(),O=c(m)??".",Z=String(M??"").replace(/\D/g,"")||"0",Y=E>0?Z.padStart(E+1,"0"):Z,ee=(E>0?Y.slice(0,-E):Y).replace(/^0+(?=\d)/,"")||"0",fe=E>0?Y.slice(-E):"",Te=E>0?`${ee}${O}${fe}`:ee;return`${P??""}${Te}`},Ve=M=>{let P=c(F)??"",E=he(),O=String(M??""),_=String(P??"").replace(/\u00A0/g," "),Z=String(E??"").replace(/\u00A0/g," ");return _&&O.replace(/\u00A0/g," ").startsWith(_)&&(O=O.slice(P.length)),Z&&O.replace(/\u00A0/g," ").endsWith(Z)&&(O=O.slice(0,-E.length)),O},li=M=>{let P=!!c(v),E=Ve(M),O=P&&E.includes("-")?"-":"",_=E.replace(/\D/g,""),Z=Se(_,O);if(c(l)==="strict"){let Y=C(Z);if(Y!=null){let U=ue(Y);Z=`${U<0?"-":""}${H(Math.abs(U))}`}}return Z},Vi=M=>{if(M==null||M==="")return Se("","");if(typeof M=="number"&&Number.isFinite(M)){let U=c(l)==="strict"?ue(M):M;return`${U<0?"-":""}${H(Math.abs(U))}`}let P=Ve(M),E=c(m)??".",_=!!c(v)&&String(P).includes("-")?"-":"",Z=String(P??"").replace(new RegExp(`[^0-9${T(E)}]`,"g"),""),Y=C(`${_}${Z}`);if(Y!=null){let U=c(l)==="strict"?ue(Y):Y;return`${U<0?"-":""}${H(Math.abs(U))}`}return li(M)},Ne,Ze=M=>{let P=c(M);if(P===void 0)return;let E=Vi(P);E!==ie.get()&&(Ne=E,ie.set(E))};Ze(t),$e(t).change(M=>{Ze(M)}),$e(ie).change(M=>{if(M===Ne){Ne=void 0;return}Ne=void 0;let P=C(M);if(P==null){ne?.(M??"");return}ne?.(P)});let Li=$e(b).compute(M=>M!=null&&M!==!1),$i=$e(y,Li).compute(([M,P])=>!c(M)&&!P),ci=$e(d).compute(M=>c(M)?"decimal":"numeric"),Ii=$e(z,F,N,d,v,m,h,x,l,a,n,B,L,D).compute(()=>({mode:"both",format:M=>{let P=li(M),E=c(z),_=!!c(v)&&P.startsWith("-")?"-":"",Z=C(P),Y=P.replace(_,"");if(Z!=null){let U=Math.abs(Z);if(typeof E=="function")try{Y=E(U)}catch{Y=H(U)}else if(E==="currency")Y=se(U,"currency");else if(E==="decimal"){let ee=c(B),fe=c(D);Y=ee||fe?se(U,"decimal"):H(U)}else Y=H(U)}return{value:P,raw:P,visual:ze(Y,_,E)}}})),p=M=>{let P=C(ie.get()),E=Number(c(u)??1),_=ue((P??0)+E*M);ie.set(H(_))},A=M=>{if(!M||typeof M.setSelectionRange!="function")return;let P=()=>{try{let E=String(M.value??"").length;M.setSelectionRange(E,E)}catch{}};typeof requestAnimationFrame=="function"?requestAnimationFrame(P):P()},oe=M=>{me?.(M);let P=M?.target;P&&A(P)},q=M=>{if(re?.(M),c(l)!=="blur")return;let P=C(ie.get());if(P==null)return;let E=ue(P);ie.set(H(E))},J=M=>{ae?.(M),A(M?.target)},pe=M=>{K?.(M);let P=M?.target;if(!P)return;let E=c(F)??"",O=he();O&&typeof P.selectionEnd=="number"&&(P.selectionEnd=Math.min(P.selectionEnd,String(P.value??"").length-O.length)),E&&typeof P.selectionStart=="number"&&(P.selectionStart=Math.max(P.selectionStart,E.length))},Q=$r({className:"g-ui-number-field-controls"},Ir({className:"g-ui-number-field-control",onClick:()=>p(1)},"+"),Ir({className:"g-ui-number-field-control",onClick:()=>p(-1)},"\u2212")),Ce=$r({className:"g-ui-number-field-controls-wrapper"},Q),De=$e($i,b).compute(([M,P])=>M?Ce:P);return ge({...I,size:g,className:o("g-ui-number-field",f),leftSection:w,rightSection:De,type:"text",inputMode:ci,inputClassName:o("g-ui-input-number"),value:ie,format:Ii,onInput:oe,onBlur:q,onFocus:J,onKeyDown:pe})}function Da(...e){return Yi(...e)}import{Div as vi,Button as Pa,portal as Ma,when as Wi,after as Ta}from"@granularjs/core";var di='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>',mi='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>',fi='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M379.33-244 154-469.33 201.67-517l177.66 177.67 378.34-378.34L805.33-670l-426 426Z"/></svg>',Br='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M240-446.67v-66.66h480v66.66H240Z"/></svg>',Re='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M312-265.33 265.33-312l168-168-168-167L312-693.67l168 168 167-168L693.67-647l-168 167 168 168L647-265.33l-167-168-168 168Z"/></svg>',Ar='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>',Fr='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg>',jr='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h357l-80 80H200v560h560v-278l80-80v358q0 33-23.5 56.5T760-120H200Zm280-360v-80h240v80H480Zm0 160v-80h320v80H480Zm0 160v-80h320v80H480ZM360-360v-80h80v80h-80Zm0 160v-80h80v80h-80Zm0 160v-80h80v80h-80Zm160-320h280l-36-37 37-37v74H520Zm-160 0h80v-80h-80v80ZM120-600v-160l160-160h160l-80 80H200v240h-80Zm80-240v-80 80Z"/></svg>',Er='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"/></svg>',Rr='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Z"/></svg>';function _e(...e){let{props:i,rawProps:r,children:t}=s(e,{size:"md",centered:!0,overlay:"normal"}),{opened:a,title:n,size:u,centered:g,overlay:d,position:v,className:m,style:h}=i,{onClose:x}=r,l=Ta(v,g).compute(([y,z])=>`g-ui-modal-position-${y??(z===!1?"top-center":"center")}`);return Wi(a,()=>Ma(vi({className:o("g-ui-modal-overlay",k("g-ui-modal-overlay-",d,"normal"),l),onClick:y=>{y.target===y.currentTarget&&x?.()}},vi({className:o("g-ui-modal",k("g-ui-modal-size-",u,"md"),m)},vi({className:"g-ui-modal-header"},Wi(n,()=>vi({className:"g-ui-modal-title"},n)),Wi(x,()=>Pa({type:"button",className:"g-ui-button g-ui-button-variant-subtle g-ui-button-size-xs g-ui-modal-close",onClick:x,innerHTML:Re}))),t))))}import{Div as hi,Span as Gi,after as Hr,when as Or}from"@granularjs/core";function Ke(...e){let{props:i}=s(e,{variant:"spinner",size:"md"}),{variant:r,size:t,className:a}=i,n=Hr(r).compute(g=>g==="dots"),u=Hr(r).compute(g=>g==="bars");return Or(n,()=>hi({className:o("g-ui-loading g-ui-dots",k("g-ui-loading-size-",t,"md"),a)}),()=>Or(u,()=>hi({className:o("g-ui-loading g-ui-bars",k("g-ui-loading-size-",t,"md"),a)},Gi(""),Gi(""),Gi("")),()=>hi({className:o("g-ui-loading",k("g-ui-loading-size-",t,"md"),a)},hi({className:"g-ui-spinner"}))))}import{Div as Zi,Input as Va,Label as La,Span as qr,when as Ui,state as $a,after as Ia}from"@granularjs/core";function Xi(...e){let{props:i,rawProps:r}=s(e,{size:"md"}),{checked:t,label:a,description:n,size:u,indeterminate:g,className:d,style:v,inputProps:m,...h}=i,{onChange:x}=r,l=$a(be(t));Ia(t).change(z=>{z!=null&&(l.set(!!z),x?.(z))});let y=La({className:"g-ui-checkbox-control"},Va({type:"checkbox",indeterminate:g,checked:l,className:o("g-ui-checkbox-input",k("g-ui-checkbox-size-",u,"md"),m?.className),...h}),Ui(l,()=>Zi({className:"g-ui-checkbox-checked",innerHTML:fi}),()=>{if(!l.get()&&g.get())return Zi({className:"g-ui-checkbox-indeterminate",innerHTML:Br})}),Ui(a,()=>qr({className:"g-ui-checkbox-label"},a)));return Zi({className:o("g-ui-checkbox",k("g-ui-checkbox-size-",u,"md"),d)},y,Ui(n,()=>qr({className:"g-ui-checkbox-description"},n)))}import{Input as Ba,Label as Aa,Span as Fa,when as ja}from"@granularjs/core";function Ea(...e){let{props:i}=s(e,{size:"md"}),{label:r,size:t,className:a,style:n,inputProps:u,...g}=i;return Aa({className:o("g-ui-switch",k("g-ui-switch-size-",t,"md"),a)},Ba({type:"checkbox",className:o("g-ui-switch-input",k("g-ui-switch-size-",t,"md"),u?.className),...g}),ja(r,()=>Fa({className:"g-ui-switch-label"},r)))}import{Div as Ie,Span as Yr,when as _i,state as Wr,after as bi}from"@granularjs/core";function Ra(...e){let{props:i,rawProps:r}=s(e,{data:[],size:"md"}),{data:t,value:a,size:n,leftSection:u,rightSection:g,placeholder:d,className:v,...m}=i,{onChange:h}=r,x=Wr(!1),l=Wr(c(a)??"");bi(a).change(L=>{let D=c(L);D!==void 0&&l.set(D??"")});let y=L=>{l.set(L),h?.(L),x.set(!1)},z=bi(l).compute(L=>L?"":"g-ui-select-placeholder"),B=bi(l).compute(L=>{let F=(c(t)??[]).find(N=>N.value===L);return L?F?.label??"":d??""});return Ie({...m,className:o("g-ui-select-root",v)},Ie({className:o("g-ui-input-wrapper",k("g-ui-input-size-",n,"md"))},_i(u,()=>Ie({className:"g-ui-input-section"},u)),Ie({className:o("g-ui-select",z),onClick:()=>x.set(!x.get())},Yr({className:"g-ui-select-value"},B)),_i(g,()=>Ie({className:"g-ui-input-section"},g),()=>Yr({className:"g-ui-select-caret"},"\u25BE"))),_i(x,()=>Ie({className:"g-ui-select-dropdown"},(c(t)??[]).map(L=>Ie({className:o("g-ui-select-item",bi(l).compute(D=>D===L.value?"g-ui-select-item-active":"")),onClick:()=>y(L.value)},L.label)))))}import{Button as Ha,Div as He,state as Pe,after as Qe,list as Oa,when as qa}from"@granularjs/core";function Ya(...e){let{props:i,rawProps:r}=s(e,{tabs:[],orientation:"horizontal",variant:"default",sticky:!0}),{value:t,tabs:a,orientation:n,variant:u,sticky:g,className:d,style:v}=i,{onChange:m}=r,h=Pe(c(t)??c(a)?.[0]?.value??""),x=Pe(),l=Pe(),y=Pe(0),z=Pe(0),B=Pe(0),L=Pe(0),D=Pe(!1),F=Pe(0),N=!1,w=null,b=!1,f=new Set;Qe(t).change(C=>{let G=c(C);G!=null&&h.set(G)});let S=C=>{h.set(C),m?.(C)},V=C=>{let G=[],H=C?.parentElement;for(;H;){let se=getComputedStyle(H),ue=`${se.overflow}${se.overflowY}${se.overflowX}`;/(auto|scroll)/.test(ue)&&G.push(H),H=H.parentElement}return G},I=C=>V(C)[0]??null,X=C=>C?C.getBoundingClientRect().top:0,te=C=>C?C.scrollTop:window.scrollY||window.pageYOffset||0,re=(C,G)=>C>G?"down":C<G?"up":"none",ae=(C,G,H,se)=>C==="down"&&G<H?!0:C==="up"&&G>=H?!1:se,K=()=>{let C=x.get(),G=l.get();if(!C||!G)return;if(!be(g)){D.set(!1),y.set(0);return}if(typeof window>"u")return;let H=C.getBoundingClientRect(),se=G.getBoundingClientRect(),ue=I(C),he=X(ue),ze=te(ue),Se=re(ze,F.get());F.set(ze);let Ve=ae(Se,H.top,he,D.get());y.set(se.height),z.set(H.left),B.set(H.width),L.set(he),Ve!==D.get()&&D.set(Ve)},ne=()=>{w==null&&(w=requestAnimationFrame(()=>{w=null,K()}))},me=C=>{!C||f.has(C)||(f.add(C),C.addEventListener("scroll",ne,{passive:!0}))},ie=()=>{if(N)return;let C=x.get(),G=l.get();!C||!G||typeof window>"u"||(N=!0,K(),me(window),window.addEventListener("resize",ne),V(C).forEach(me))};Qe(l,x,g).change(ie),!b&&typeof window<"u"&&(b=!0,setTimeout(()=>ie(),0));let T=Qe(D,z,B,L).compute(C=>{let[G,H,se,ue]=C;return G?{position:"fixed",top:`${ue}px`,left:`${H}px`,width:`${se}px`,background:"var(--g-ui-surface)",zIndex:100}:{position:"static",top:"auto",left:"auto",width:"auto",zIndex:"auto",background:"transparent"}}),R=Qe(D,y).compute(C=>{let[G,H]=C;return{height:G?`${H}px`:"0px"}});return He(He({className:o("g-ui-tabs",de(n,{vertical:"g-ui-tabs-vertical"}),k("g-ui-tabs-variant-",u,"default"),i.className??d)},He({node:x}),He({style:R}),He({node:l,className:"g-ui-tabs-list",style:T},Oa(a,C=>Ha({className:Qe(h,C.value).compute(([G,H])=>o("g-ui-tabs-tab",H===G&&"g-ui-tabs-tab-active")),onClick:()=>S(C.get().value)},C.label))),He({className:"g-ui-tabs-panel"},qa(h,()=>a.get()?.find(C=>C.value===h.get())?.content??null))))}import{Table as Wa,Thead as Ga,Tbody as Za,Tr as Gr,Th as Ua,Td as Zr}from"@granularjs/core";function Xa(...e){let{props:i}=s(e,{headers:[],rows:[]}),{headers:r,rows:t,striped:a,highlightOnHover:n,withBorder:u,withColumnBorders:g,className:d,style:v,...m}=i;return Wa({...m,className:o("g-ui-table",W("g-ui-table-striped",a),W("g-ui-table-hover",n),W("g-ui-table-with-border",u),W("g-ui-table-column-borders",g),d)},r.length?Ga(Gr(r.map(h=>Ua(h)))):null,Za(t.map(h=>Gr(Array.isArray(h)?h.map(x=>Zr(x)):Object.values(h).map(x=>Zr(x))))))}import{Div as Ki}from"@granularjs/core";import{state as _a,when as Ka,after as Qa}from"@granularjs/core";function Ja(...e){let{props:i,children:r}=s(e,{opened:!1}),{opened:t,className:a,...n}=i,u=_a(be(t));Qa(t).change(m=>{u.set(be(m))});let g=()=>{u.set(!u.get())},d=r[0],v=r[1];return Ki({...n,className:o("g-ui-accordion",a)},Ki({className:"g-ui-accordion-header",onClick:g},d),Ka(u,()=>Ki({className:"g-ui-accordion-content"},v)))}import{Span as Ur}from"@granularjs/core";function eo(...e){let{props:i,children:r}=s(e),{label:t,className:a,style:n}=i;return Ur({className:o("g-ui-tooltip",a)},r,Ur({className:"g-ui-tooltip-content"},t))}import{Div as Je,when as io,after as ro,state as ei,portal as to}from"@granularjs/core";var Qi=ei({currentOpenState:null});function ao(...e){let i=ei(),r=ei(),t=ei({}),{props:a,rawProps:n,children:u}=s(e,{position:"right"}),{opened:g,content:d,position:v,className:m,...h}=a,{onChange:x}=n,l=ei(c(g)??!1);ro(g).change(N=>{let w=c(N);w!=null&&(l.set(!!w),w&&y())});let y=()=>{Qi.get().currentOpenState!==l&&(Qi.get().currentOpenState?.set(!1),Qi.set().currentOpenState=l)};g.get()&&y();let z=N=>{let b=String(N??"right").toLowerCase().split("-").filter(Boolean);if(b.length===1){let V=b[0];return V==="top"||V==="bottom"?{placement:V,align:"center"}:V==="left"||V==="right"?{placement:"bottom",align:V}:V==="center"?{placement:"bottom",align:"center"}:{placement:"bottom",align:"right"}}let[f,S]=b;return f==="top"||f==="bottom"?{placement:f,align:S||"center"}:f==="left"||f==="right"?{placement:f,align:S||"center"}:{placement:"bottom",align:"right"}},B=()=>{let N=i.get(),w=r.get();if(!N||!w||typeof window>"u")return;let b=N.getBoundingClientRect(),f=w.getBoundingClientRect(),S=c(v)??"right",V=getComputedStyle(document.documentElement).getPropertyValue("--g-ui-space-20"),I=Number.parseFloat(V)||20,X=window.innerWidth||0,te=window.innerHeight||0,re=Math.max(I,X-f.width-I),ae=Math.max(I,te-f.height-I),{placement:K,align:ne}=z(S),me=8,ie=b.bottom+me,T=b.left;K==="top"||K==="bottom"?(ie=K==="top"?b.top-f.height-me:b.bottom+me,ne==="center"?T=b.left+b.width/2-f.width/2:ne==="right"?T=b.right-f.width:T=b.left):(K==="left"||K==="right")&&(T=K==="left"?b.left-f.width-me:b.right+me,ne==="center"?ie=b.top+b.height/2-f.height/2:ne==="bottom"?ie=b.bottom-f.height:ie=b.top),T=Math.max(I,Math.min(T,re)),ie=Math.max(I,Math.min(ie,ae)),t.set({top:`${ie}px`,left:`${T}px`})},L=N=>{l.set(N),x?.(N),N&&(y(),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>B()):setTimeout(()=>B(),0))},D=()=>L(!l.get()),F=()=>L(!1);return Je({...h,node:i,className:o("g-ui-menu",m)},Je({onClick:D},u),io(l,()=>to(Je(Je({className:"g-ui-menu-overlay",onClick:F}),Je({className:"g-ui-menu-dropdown",node:r,style:t},d)))))}import{Div as Xr,portal as oo,when as no}from"@granularjs/core";function so(...e){let{props:i,children:r}=s(e,{position:"right",size:"md",overlay:"normal",shadowed:!0}),{opened:t,onClose:a,position:n,size:u,overlay:g,shadowed:d,className:v,style:m}=i;return no(t,()=>oo(Xr({className:o("g-ui-drawer-overlay",k("g-ui-drawer-overlay-",g,"normal")),onClick:a},Xr({className:o("g-ui-drawer",de(d,{true:"g-ui-drawer-shadowed"},!0),k("g-ui-drawer-",n,"right"),k("g-ui-drawer-size-",u,"md"),v),onClick:h=>h.stopPropagation()},r))))}import{Button as uo,Div as Ji,Span as _r,when as xi,after as Kr}from"@granularjs/core";function er(...e){let{props:i,rawProps:r,children:t}=s(e,{color:"blue",withCloseButton:!0}),{title:a,color:n,icon:u,loading:g,withCloseButton:d,withBorder:v,className:m,style:h}=i,{onClose:x}=r,l=Kr(u,g).compute(([z,B])=>!z&&!!B),y=Kr(u,g).compute(([z,B])=>!!z||!!B);return Ji({className:o("g-ui-notification",[v,"g-ui-notification-bordered"],[n,z=>`g-ui-notification-${z}`],[y,"g-ui-notification-with-icon"],m)},xi(u,()=>_r({className:"g-ui-notification-icon"},u)),xi(l,()=>Ke({size:"sm",className:"g-ui-notification-loader"})),Ji({className:"g-ui-notification-body"},xi(a,()=>Ji({className:"g-ui-notification-title"},a)),t),xi(d,()=>uo({type:"button",className:"g-ui-notification-close",onClick:()=>x?.()},_r({innerHTML:Re}))))}import{Div as go,when as lo}from"@granularjs/core";function co(...e){let{props:i}=s(e,{labelPosition:"center"}),{label:r,labelPosition:t,vertical:a,className:n,...u}=i;return go({...u,className:o("g-ui-divider",W("label",r),k("g-ui-divider-label-",t,"center"),W("g-ui-divider-vertical",a),n)},lo(r,()=>Hi({className:"g-ui-divider-label-text",size:"sm"},r)))}import{Div as po}from"@granularjs/core";function mo(...e){let{props:i,children:r}=s(e,{padding:"md",radius:"md",shadow:"none"}),{padding:t,radius:a,shadow:n,className:u,...g}=i;return po({...g,className:o("g-ui-paper",[t,d=>`g-ui-card-padding-${d}`],[a,d=>`g-ui-card-radius-${d}`],[n,d=>`g-ui-card-shadow-${d}`],u)},r)}import{Button as fo,Div as ir,Span as vo,after as Qr,when as rr}from"@granularjs/core";function ho(...e){let{props:i,rawProps:r,children:t}=s(e,{color:"blue"}),{title:a,color:n,icon:u,withCloseButton:g,className:d,...v}=i,{onClose:m}=r,h=Qr(a,g).compute(([l,y])=>l||y),x=Qr(u).compute(l=>l!==void 0);return ir({...v,className:o("g-ui-alert",[n,l=>`g-ui-alert-${l}`],d)},ir({className:"g-ui-alert-header"},rr(u,()=>vo({className:"g-ui-alert-icon"},u)),rr(a,()=>ir({className:"g-ui-alert-title"},a)),rr(g,()=>fo({type:"button",className:"g-ui-alert-close",onClick:()=>m?.()},"\xD7"))),t)}import{Div as bo,Img as xo,when as wo}from"@granularjs/core";function yo(...e){let{props:i,children:r}=s(e,{size:"md",alt:""}),{src:t,size:a,alt:n,className:u,...g}=i;return bo({...g,className:o("g-ui-avatar",[a,d=>`g-ui-avatar-size-${d}`],u)},wo(t,()=>xo({className:"g-ui-avatar-img",src:t,alt:n}),()=>r))}import{Span as ko}from"@granularjs/core";function zo(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return ko({...a,className:o("g-ui-kbd",t)},r)}import{Code as No}from"@granularjs/core";function Co(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return No({...a,className:o("g-ui-code",t)},r)}import{Blockquote as So}from"@granularjs/core";function Do(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return So({...a,className:o("g-ui-blockquote",t)},r)}import{Div as Po}from"@granularjs/core";function Mo(...e){let{props:i,children:r}=s(e,{cols:3,gap:"md"}),{cols:t,gap:a,className:n,...u}=i;return Po({...u,className:o("g-ui-grid",[a,g=>`g-ui-gap-${g}`],[t,g=>`g-ui-grid-cols-${g}`],n)},r)}import{Ul as To,Ol as Vo,Li as tr,Div as wi,Span as ar,after as or,when as Be,isSignal as Lo,isState as $o,isStatePath as Io,isComputed as Bo}from"@granularjs/core";function Jr(...e){let{props:i,children:r}=s(e,{type:"none",size:"md"}),{type:t,size:a,withPadding:n,className:u,...g}=i,d=de(t,{ordered:"g-ui-list-ordered",unordered:"g-ui-list-unordered",none:"g-ui-list-none"}),v=or(t).compute(z=>z==="ordered"),m=z=>z&&typeof z=="object"&&typeof z.tagName=="string"&&(z.tagName.toLowerCase()==="ul"||z.tagName.toLowerCase()==="ol"),h=z=>z&&typeof z=="object"&&typeof z.tagName=="string"&&z.tagName.toLowerCase()==="li",x=z=>{console.log("INFO ABOUT ITEM",z,typeof z,typeof z?.tagName,z?.tagName?.toLowerCase());let B=L=>L?.nodeType==="granular-list-node"?L:L==null||L===!1?null:Array.isArray(L)?L.map(D=>B(D)):h(L)?L:m(L)?tr({className:"g-ui-list-nested-item"},L):tr(ar({className:"g-ui-list-item-shell"},L));return Lo(z)||$o(z)||Io(z)||Bo(z)?or(z).compute(L=>B(L)):B(z)},l=Be(r,()=>r.map(z=>x(z))),y={...g,className:o("g-ui-list",k("g-ui-list-size-",a,"md"),W("g-ui-list-with-padding",n),d,u)};return Be(v,()=>Vo(y,l),()=>To(y,l))}function Ao(...e){let{props:i,children:r}=s(e,{withBorder:!1}),{leftSection:t,rightSection:a,title:n,body:u,withBorder:g,className:d,...v}=i,m=or(n,u).compute(([h,x])=>!!h||!!x);return tr({...v,className:o("g-ui-list-item",W("g-ui-list-item-border",g),d)},wi({className:"g-ui-list-item-shell"},Be(t,()=>ar({className:"g-ui-list-item-section g-ui-list-item-section-left"},t)),Be(m,()=>wi({className:"g-ui-list-item-content"},Be(n,()=>wi({className:"g-ui-list-item-title"},n)),Be(u,()=>wi({className:"g-ui-list-item-body"},u))),()=>r),Be(a,()=>ar({className:"g-ui-list-item-section g-ui-list-item-section-right"},a))))}Jr.Item=Ao;import{A as Fo}from"@granularjs/core";function jo(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return Fo({...a,className:o("g-ui-anchor",t)},r)}import{Img as Eo}from"@granularjs/core";function Ro(...e){let{props:i}=s(e),{className:r,...t}=i;return Eo({...t,className:o("g-ui-image",r)})}import{Span as Ho}from"@granularjs/core";function ye(...e){let{props:i,children:r}=s(e,{size:"md"});return Ho({...i,className:o("g-ui-icon",k("g-ui-icon-size-",i.size,"md"),k("g-ui-icon-color-",i.color),i.className)},...r)}import{Div as et}from"@granularjs/core";function Oo(...e){let{props:i}=s(e,{value:0,color:"primary",size:"md"}),{value:r,color:t,size:a,className:n,...u}=i;return et({...u,className:o("g-ui-progress",k("g-ui-progress-size-",a,"md"),[r,g=>{let d=Math.max(0,Math.min(100,Number(g)||0));return`g-ui-progress-${Math.round(d/5)*5}`}],[t,g=>g?`g-ui-progress-${g}`:""],n)},et({className:"g-ui-progress-bar"}))}import{Div as Ae,after as yi,state as qo,when as Yo}from"@granularjs/core";function Wo(...e){let{props:i,rawProps:r}=s(e,{size:"md",min:0,max:100,step:1}),{onChange:t}=r,{value:a,marks:n,size:u,min:g,max:d,step:v,disabled:m,className:h,...x}=i,l=qo(c(a??g));yi(a).change(N=>{N!=null&&l.set(c(N))});let y=()=>{let N=Number(c(g)),w=Number(c(d));return!Number.isFinite(N)||!Number.isFinite(w)?{minValue:0,maxValue:100}:{minValue:Math.min(N,w),maxValue:Math.max(N,w)}},z=()=>{let N=Number(c(v));return Number.isFinite(N)&&N>0?N:1},B=N=>{let{minValue:w,maxValue:b}=y(),f=z(),S=Math.max(w,Math.min(b,Number(N))),V=Math.round((S-w)/f)*f+w;V!==l.get()&&(l.set(V),t?.(V))},L=yi(l).compute(N=>{let{minValue:w,maxValue:b}=y(),f=b-w;if(f<=0)return 0;let S=(Number(N??w)-w)/f*100;return Math.max(0,Math.min(100,S))}),D=(N,w)=>{let b=w?.();if(!b||b.width===0)return;let S=Math.min(Math.max(N.clientX-b.left,0),b.width)/b.width,{minValue:V,maxValue:I}=y();B(V+S*(I-V))},F=N=>{if(be(m))return;N.preventDefault?.();let w=N.currentTarget,b=()=>w.getBoundingClientRect();w.setPointerCapture?.(N.pointerId),D(N,b);let f=V=>D(V,b),S=()=>{w.releasePointerCapture?.(N.pointerId),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",S)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",S)};return Ae({...x,className:o("g-ui-slider",k("g-ui-slider-size-",u,"md"),W("g-ui-slider-disabled",m),h)},Ae({className:"g-ui-slider-track",onPointerDown:F},Ae({className:"g-ui-slider-bar",style:yi(L).compute(N=>({width:`${N}%`}))}),Ae({className:"g-ui-slider-thumb",style:yi(L).compute(N=>({left:`${N}%`}))})),Yo(n,()=>Ae({className:"g-ui-slider-marks"},n.map(N=>nr({mark:N,getBounds:y})))))}var nr=({mark:e,getBounds:i})=>{let{minValue:r,maxValue:t}=i(),a=t-r,n=e.value??e,u=e.label??String(e.value)??n,g=Number(n),d=0;return a>0&&(d=(g-r)/a*100),Ae({className:"g-ui-slider-mark",style:{left:`${Math.max(0,Math.min(100,d))}%`}},Ae({className:"g-ui-slider-mark-label"},u))};import{Div as Go,after as Zo}from"@granularjs/core";function Uo(...e){let{props:i}=s(e,{height:"md",width:"full"}),{height:r,width:t,className:a,...n}=i,u=Zo(r,t).compute(([g,d])=>{let v={};return isNaN(g)||(v.height=`${g}px`),isNaN(d)||(v.width=`${d}px`),v});return Go({...n,style:{width:u.width,height:u.height,...n.style||{}},className:o("g-ui-skeleton",[r,g=>`g-ui-skeleton-h-${g}`],[t,g=>`g-ui-skeleton-w-${g}`],a)})}import{Button as Xo,after as it,state as _o}from"@granularjs/core";function Ko(...e){let{props:i,rawProps:r,children:t}=s(e,{size:"md",variant:"filled",color:"primary"}),{checked:a,size:n,variant:u,color:g,className:d,...v}=i,{onChange:m}=r,h=_o(!!a);it(a).change(l=>{l!=null&&h.set(!!l)});let x=l=>{h.set(l),m?.(l)};return Xo({...v,type:"button",className:o("g-ui-chip",k("g-ui-chip-size-",n,"md"),k("g-ui-chip-variant-",u,"filled"),k("g-ui-chip-color-",g,"primary"),it(h).compute(l=>l?"g-ui-chip-active":""),d),onClick:()=>x(!h.get())},t)}import{Div as sr,after as rt,state as Qo,list as Jo}from"@granularjs/core";function en(...e){let{props:i,rawProps:r}=s(e,{data:[],size:"sm"}),{value:t,data:a,size:n,scroll:u,className:g,...d}=i,{onChange:v}=r,m=Qo(c(t));rt(t).change(x=>{let l=c(x);l!=null&&m.set(l)});let h=x=>{m.set(x),v?.(x)};return sr({...d,className:o(u&&"g-ui-segmented-scroll")},sr({className:o("g-ui-segmented",k("g-ui-segmented-size-",n,"sm"),g)},Jo(a,(x=>sr({className:o("g-ui-segmented-item",rt(m).compute(l=>x.get().value===l?"g-ui-segmented-active":"")),onClick:()=>h(x.get().value)},x.label)))))}import{Button as ur,Div as rn,state as tn,after as ki}from"@granularjs/core";function an(...e){let{props:i,rawProps:r}=s(e,{total:1,size:"md"}),{page:t,total:a,size:n,className:u,...g}=i,{onChange:d}=r,v=tn(c(t??1));ki(t).change(l=>{let y=c(l);y!=null&&v.set(y)});let m=l=>{let y=Number(c(a))||1,z=Math.max(1,Math.min(y,l));v.set(z),d?.(z)},h=[],x=Number(c(a))||1;for(let l=1;l<=x;l+=1)h.push(l);return rn({...g,className:o("g-ui-pagination",k("g-ui-pagination-size-",n,"md"),i.className??u)},ur({className:"g-ui-pagination-item",onClick:()=>m((v.get?.()??v)-1),disabled:ki(v).compute(l=>l<=1)},"<"),h.map(l=>ur({className:ki(v).compute(y=>o("g-ui-pagination-item",l===y&&"g-ui-pagination-item-active")),onClick:()=>m(l)},String(l))),ur({className:"g-ui-pagination-item",onClick:()=>m((v.get?.()??v)+1),disabled:ki(v).compute(l=>l>=a)},">"))}import{Div as on,Input as nn,Label as sn,Span as tt,when as at}from"@granularjs/core";function un(...e){let{props:i}=s(e,{size:"md"}),{label:r,description:t,size:a,className:n,inputProps:u,...g}=i,d=sn({className:"g-ui-radio-control"},nn({type:"radio",className:o("g-ui-radio-input",k("g-ui-radio-size-",a,"md"),u?.className),...g}),at(r,()=>tt({className:"g-ui-radio-label"},r)));return on({className:o("g-ui-radio",k("g-ui-radio-size-",a,"md"),n)},d,at(t,()=>tt({className:"g-ui-radio-description"},t)))}import{Div as gn}from"@granularjs/core";function ln(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return gn({...a,className:o("g-ui-stack g-ui-gap-sm",t)},r)}import{Nav as cn,Span as pn}from"@granularjs/core";function dn(...e){let{props:i,children:r}=s(e,{separator:"/"}),{separator:t,className:a,...n}=i,u=[];Array.isArray(r)?u.push(...r):u.push(r);let g=u.filter(Boolean),d=[];return g.forEach((v,m)=>{d.push(v),m<g.length-1&&d.push(pn({className:"g-ui-breadcrumbs-separator"},t))}),cn({...n,className:o("g-ui-breadcrumbs",a)},d)}import{Div as mn}from"@granularjs/core";function fn(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return mn({...a,className:o("g-ui-center",t)},r)}import{Div as vn}from"@granularjs/core";function hn(...e){let{props:i}=s(e,{size:"md"}),{size:r,className:t,...a}=i;return vn({...a,className:o("g-ui-space",[r,n=>`g-ui-space-${n}`],t)})}import{Div as bn,when as xn}from"@granularjs/core";function wn(...e){let{props:i,children:r}=s(e),{opened:t,className:a,...n}=i;return xn(t,()=>bn({...n,className:o("g-ui-collapse",a)},r))}import{Button as yn}from"@granularjs/core";function Fe(...e){let{props:i,children:r}=s(e,{size:"md",variant:"filled"}),{size:t,variant:a,color:n,className:u,...g}=i;return yn({...g,type:"button",className:o("g-ui-action-icon",k("g-ui-action-icon-size-",t,"md"),k("g-ui-action-icon-color-",n,"primary"),k("g-ui-action-icon-",a,"filled"),u)},r)}import{Div as gr,when as kn,after as zn,state as Nn}from"@granularjs/core";function lr(...e){let{props:i,rawProps:r,children:t}=s(e,{position:"left"}),{opened:a,position:n,content:u,className:g,...d}=i,{onChange:v}=r,m=Nn(c(a)??!1);zn(a).change(x=>{let l=c(x);l!=null&&m.set(!!l)});let h=x=>{m.set(x),v?.(x)};return gr({...d,className:o("g-ui-popover",i.className??g)},gr({onClick:()=>h(!m.get())},t),kn(m,()=>gr({className:o("g-ui-popover-dropdown",n==="right"&&"g-ui-popover-right",n==="center"&&"g-ui-popover-center")},u)))}import{Div as ot}from"@granularjs/core";function Cn(...e){let{props:i,children:r}=s(e,{position:"left"}),{position:t,content:a,className:n,...u}=i;return ot({...u,className:o("g-ui-hover-card",n)},r,ot({className:o("g-ui-hover-card-dropdown",[t,g=>g==="right"?"g-ui-hover-card-right":""],[t,g=>g==="center"?"g-ui-hover-card-center":""])},a))}import{Div as Sn}from"@granularjs/core";function Dn(...e){let{props:i,children:r}=s(e,{position:"bottom-right"}),{position:t,className:a,...n}=i;return Sn({...n,className:o("g-ui-affix",[t,u=>`g-ui-affix-${u}`],a)},r)}import{Fieldset as Pn,Legend as Mn,when as Tn}from"@granularjs/core";function Vn(...e){let{props:i,children:r}=s(e),{legend:t,className:a,...n}=i;return Pn({...n,className:o("g-ui-fieldset",a)},Tn(t,()=>Mn({className:"g-ui-legend"},t)),r)}import{Div as Ln}from"@granularjs/core";function $n(...e){let{props:i,children:r}=s(e,{position:"sticky"}),{position:t,className:a,...n}=i;return Ln({...n,className:o("g-ui-appbar",k("g-ui-appbar-",t,"sticky"),a)},r)}import{Div as cr,portal as In,after as zi,state as nt,when as st}from"@granularjs/core";function Bn(...e){let{props:i,children:r}=s(e,{position:"left",size:"md",blur:!0,fixed:!1,minWidth:"button"});return st(i.fixed,()=>Fn(i,r),()=>An(i,r))}var An=(e,i)=>{let{open:r,onClose:t,position:a,size:n,blur:u,fixed:g,minWidth:d,className:v,...m}=e,h=nt(!1),x=nt(!1),l=220,y=L=>{if(L){h.set(!0),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>x.set(!0)):setTimeout(()=>x.set(!0),0);return}x.set(!1),setTimeout(()=>h.set(!1),l)};y(!!r.get()),zi(r).change(L=>y(!!L));let z=zi(x,u).compute(L=>{let[D,F]=L;return o("g-ui-sidebar-overlay",D&&"g-ui-sidebar-overlay-open",!F&&"g-ui-sidebar-overlay-noblur")}),B=zi(n,a,x,v).compute(L=>{let[D,F,N,w]=L,b=F==="right"?"g-ui-sidebar-drawer-right g-ui-sidebar-position-right":"g-ui-sidebar-drawer-left";return o("g-ui-sidebar","g-ui-sidebar-drawer",`g-ui-sidebar-size-${D}`,b,N&&"g-ui-sidebar-drawer-open",c(w))});return st(h,()=>In(cr({className:z,onClick:t},cr({className:B,onClick:L=>L.stopPropagation()},i))))},Fn=(e,i)=>{let{open:r,position:t,size:a,minWidth:n,className:u,...g}=e,d=zi(a,t,r,n,u).compute(v=>{let[m,h,x,l,y]=v,z=l||"button",B=null;return z==="button"?B="g-ui-sidebar-min-button":z==="xs"?B="g-ui-sidebar-min-xs":z==="sm"?B="g-ui-sidebar-min-sm":z==="md"&&(B="g-ui-sidebar-min-md"),o("g-ui-sidebar g-ui-sidebar-fixed",`g-ui-sidebar-size-${m||"md"}`,B,x&&"g-ui-sidebar-fixed-open",y)});return cr({...g,className:d},i)};import{Div as Oe,when as ut}from"@granularjs/core";function jn(...e){let{props:i}=s(e,{items:[]}),{items:r,className:t,...a}=i;return Oe({...a,className:o("g-ui-timeline",t)},r.map(n=>Oe({className:"g-ui-timeline-item"},Oe({className:"g-ui-timeline-dot"}),Oe({className:"g-ui-timeline-content"},ut(n.title,()=>Oe({className:"g-ui-timeline-title"},n.title)),ut(n.description,()=>Oe({className:"g-ui-timeline-desc"},n.description)),n.content))))}import{Div as Ni}from"@granularjs/core";function En(...e){let{props:i}=s(e,{active:0,items:[]}),{active:r,items:t,className:a,...n}=i;return Ni({...n,className:o("g-ui-stepper",a)},t.map((u,g)=>Ni({className:o("g-ui-stepper-item",[r,d=>g===d?"g-ui-stepper-active":""])},Ni({className:"g-ui-stepper-index"},String(g+1)),Ni({className:"g-ui-stepper-label"},u.label))))}import{Span as gt,after as lt,state as Rn}from"@granularjs/core";function Hn(...e){let{props:i,rawProps:r}=s(e,{value:0,max:5,size:"md"}),{value:t,max:a,size:n,className:u,...g}=i,{onChange:d}=r,v=Rn(c(t));lt(t).change(l=>{let y=c(l);y!=null&&v.set(y)});let m=l=>{v.set(l),d?.(l)},h=[],x=Number(c(a))||0;for(let l=1;l<=x;l+=1)h.push(l);return gt({...g,className:o("g-ui-rating",k("g-ui-rating-size-",n,"md"),i.className??u)},h.map(l=>gt({className:o("g-ui-rating-item",lt(v).compute(y=>l<=y?"g-ui-rating-item-active":"")),onClick:()=>m(l)},"\u2605")))}import{Span as On}from"@granularjs/core";function qn(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return On({...a,className:o("g-ui-tag",t)},r)}import{Button as ct,Div as qe,state as pt,after as Ci}from"@granularjs/core";var Yn=["S","M","T","W","T","F","S"];function ii(...e){let{props:i,rawProps:r}=s(e,{size:"md"}),{value:t,className:a,size:n,...u}=i,{onChange:g}=r,d=D=>{let F=c(D);if(F instanceof Date)return F;if(F==null)return null;let N=new Date(F);return Number.isNaN(N.getTime())?null:N},v=pt(d(t)??new Date),m=pt(new Date(v.get()));Ci(t).change(D=>{let F=d(D);F!=null&&(v.set(F),m.set(new Date(F)))});let h=(D,F,N)=>{let w=new Date(D,F+1,0).getDate();return new Date(D,F,Math.min(N,w))},x=D=>{let F=m.get(),N=h(F.getFullYear(),F.getMonth(),D);v.set(N),m.set(N),g?.(N)},l=D=>{let F=m.get(),N=h(F.getFullYear(),F.getMonth()+D,F.getDate());m.set(N)},y=D=>{let F=m.get(),N=h(F.getFullYear()+D,F.getMonth(),F.getDate());m.set(N)},z=Ci(m).compute(D=>D.toLocaleString("default",{month:"long"})),B=Ci(m).compute(D=>String(D.getFullYear())),L=Ci(m,v).compute(([D,F])=>{let N=D.getFullYear(),w=D.getMonth(),f=new Date(N,w,1).getDay(),S=new Date(N,w+1,0).getDate(),V=[];for(let I=0;I<f;I+=1)V.push({muted:!0,label:""});for(let I=1;I<=S;I+=1)V.push({label:I});return[...Yn.map(I=>qe({className:"g-ui-calendar-cell g-ui-calendar-cell-muted"},I)),...V.map(I=>qe({className:o("g-ui-calendar-cell",I.muted&&"g-ui-calendar-cell-muted",I.label&&F.getFullYear()===N&&F.getMonth()===w&&I.label===F.getDate()&&"g-ui-calendar-cell-active"),onClick:()=>I.label&&x(I.label)},I.label))]});return qe({...u,className:o("g-ui-calendar",a,k("g-ui-calendar-size-",n,"md"))},qe({className:"g-ui-calendar-header"},Fe({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>l(-1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:mi})),qe({className:"g-ui-calendar-title-group"},ct({type:"button",className:"g-ui-calendar-title-button",onClick:()=>l(1)},z),ct({type:"button",className:"g-ui-calendar-title-button",onClick:()=>y(1)},B)),Fe({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>l(1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:di}))),qe({className:"g-ui-calendar-grid"},L))}import{Div as ri,Span as Ye,Input as Wn,when as pr,after as ke,state as Si}from"@granularjs/core";function Gn(...e){let{props:i,rawProps:r}=s(e,{data:[],size:"md",searchable:!0}),{value:t,data:a,size:n,className:u,placeholder:g,searchable:d,...v}=i,{onChange:m,onSearchChange:h}=r,x=Si(c(t)??[]),l=Si(""),y=Si(!1),z=Si(null),B=f=>(c(f)??[]).map(V=>typeof V=="string"?{value:V,label:V}:V&&typeof V=="object"?V:{value:String(V),label:String(V)});ke(t).change(f=>{let S=c(f);S!=null&&x.set(S)});let L=null;ke(y).change(f=>{if(L&&(L(),L=null),!f)return;let S=V=>{let I=z.get();I&&(I.contains(V.target)||y.set(!1))};document.addEventListener("mousedown",S),L=()=>document.removeEventListener("mousedown",S)}),ke(l).change(f=>{h?.(f)});let D=f=>{let S=x.get()??[],V=S.includes(f)?S.filter(I=>I!==f):S.concat(f);x.set(V),m?.(V)},F=ke(a).compute(f=>B(f)),N=ke(F,l).compute(([f,S])=>{let V=String(c(S)??"").toLowerCase().trim();return V?f.filter(I=>String(I.label??"").toLowerCase().includes(V)):f}),w=ke(x,l).compute(([f,S])=>{let V=c(f)??[],I=String(c(S)??"");return!V.length&&!I}),b=ke(d).compute(f=>!!f);return ri({...v,node:z,className:o("g-ui-select-multi-root",u)},ri({className:o("g-ui-select-multi",k("g-ui-select-multi-size-",n,"md")),onClick:()=>y.set(!0)},ke(F,x).compute(([f,S])=>(c(S)??[]).map(I=>{let te=(f??[]).find(re=>re.value===I)?.label??I;return Ye({className:"g-ui-select-tag"},Ye({className:"g-ui-select-tag-label",onClick:re=>{re?.stopPropagation?.()}},te),Ye({className:"g-ui-select-tag-remove",innerHTML:Re,onClick:re=>{re?.stopPropagation?.(),D(I)}}))})),pr(w,()=>Ye({className:"g-ui-select-multi-placeholder"},g??"Select...")),pr(b,()=>Wn({className:"g-ui-select-multi-input",value:l,onInput:f=>l.set(f.target?.value??""),onFocus:()=>y.set(!0)}))),pr(y,()=>ri({className:"g-ui-select-dropdown"},ke(N).compute(f=>f.length?f.map(S=>ri({className:o("g-ui-select-item",S.disabled&&"g-ui-select-item-disabled",ke(x).compute(V=>(c(V)??[]).includes(S.value)?"g-ui-select-item-active":"")),onClick:()=>{S.disabled||D(S.value)}},Ye({className:"g-ui-select-item-check",innerHTML:ke(x).compute(V=>(c(V)??[]).includes(S.value)?fi:"")}),Ye({className:"g-ui-select-item-label"},S.label))):ri({className:"g-ui-select-item"},"Nothing found")))))}import{Div as ti,when as dt}from"@granularjs/core";function Zn(...e){let{props:i}=s(e,{items:[]}),{items:r,className:t,onClose:a,timeout:n,...u}=i;return ti({...u,className:o("g-ui-toast-stack",t)},r.map(g=>ti({className:o("g-ui-toast",[n,"g-ui-toast-auto"])},ti({className:"g-ui-toast-row"},dt(g.title,()=>ti({className:"g-ui-toast-title"},g.title)),dt(a,()=>ti({className:"g-ui-toast-close",onClick:()=>a(g)},"\xD7"))),g.message)))}function Un(...e){let{props:i}=s(e);return ii(i)}import{Div as Xn,after as _n}from"@granularjs/core";function Kn(...e){let{props:i,rawProps:r}=s(e,{items:[],position:"top-right"}),{items:t,position:a,className:n,...u}=i,{onRemove:g}=r,d=new Map,v=(h,x)=>h?.id??h?.key??x,m=_n(t).compute(h=>{let x=c(h)??[],l=new Set;x.forEach((y,z)=>{let B=v(y,z);if(l.add(B),y?.autoClose&&!d.has(B)){let L=setTimeout(()=>{d.delete(B),g?.(y)},y.autoClose);d.set(B,L)}});for(let[y,z]of d.entries())l.has(y)||(clearTimeout(z),d.delete(y));return x.map((y,z)=>er({key:v(y,z),title:y.title,color:y.color,icon:y.icon,loading:y.loading,withCloseButton:y.withCloseButton,withBorder:y.withBorder,onClose:()=>{y.onClose?.(),g?.(y)}},y.message??y.body??y.content??y.text))});return Xn({...u,className:o("g-ui-notifications",k("g-ui-notifications-position-",a,"top-right"),n)},m)}import{Div as We,after as ai,state as Qn,when as Jn}from"@granularjs/core";function es(...e){let{props:i,rawProps:r}=s(e,{min:0,max:100,step:1,size:"md"}),{value:t,marks:a,min:n,max:u,step:g,size:d,disabled:v,className:m,...h}=i,{onChange:x}=r,l=Qn(c(t??[n,u])),y=()=>{let w=Number(c(n)),b=Number(c(u));return!Number.isFinite(w)||!Number.isFinite(b)?{minValue:0,maxValue:100}:{minValue:Math.min(w,b),maxValue:Math.max(w,b)}},z=()=>{let w=Number(c(g));return Number.isFinite(w)&&w>0?w:1},B=w=>{let{minValue:b,maxValue:f}=y(),S=z(),V=[b,f];Array.isArray(w)&&(V=w);let I=Math.max(b,Math.min(f,Number(V[0]))),X=Math.max(b,Math.min(f,Number(V[1]))),te=Math.round(Math.min(I,X)/S)*S,re=Math.round(Math.max(I,X)/S)*S;return[te,re]};ai(t).change(w=>{w!=null&&l.set(B(w))});let L=w=>{let b=B(w);b?.[0]===l.get()?.[0]&&b?.[1]===l.get()?.[1]||(l.set(b),x?.(b))},D=ai(l).compute(w=>{let{minValue:b,maxValue:f}=y(),S=f-b,[V,I]=B(w);if(S<=0)return{lowPct:0,highPct:0};let X=(V-b)/S*100,te=(I-b)/S*100;return{lowPct:Math.max(0,Math.min(100,X)),highPct:Math.max(0,Math.min(100,te))}}),F=(w,b,f)=>{let S=b?.();if(!S||S.width===0)return;let I=Math.min(Math.max(w.clientX-S.left,0),S.width)/S.width,{minValue:X,maxValue:te}=y(),re=X+I*(te-X),ae=l;typeof l.get=="function"&&(ae=l.get());let[K,ne]=B(ae);L(f==="low"?[re,ne]:[K,re])},N=(w,b,f)=>{if(be(v))return;w.preventDefault?.();let S=f||w.currentTarget,V=()=>S.getBoundingClientRect(),I=V(),X=D;typeof D.get=="function"&&(X=D.get());let{lowPct:te,highPct:re}=X,ae=(w.clientX-I.left)/I.width*100,K=b;if(!K){let ie=Math.abs(ae-te)<=Math.abs(ae-re);K="high",ie&&(K="low")}S.setPointerCapture?.(w.pointerId),F(w,V,K);let ne=ie=>F(ie,V,K),me=()=>{S.releasePointerCapture?.(w.pointerId),window.removeEventListener("pointermove",ne),window.removeEventListener("pointerup",me)};window.addEventListener("pointermove",ne),window.addEventListener("pointerup",me)};return We({...h,className:o("g-ui-range-slider",k("g-ui-slider-size-",d,"md"),W("g-ui-slider-disabled",v),i.className??m)},We({className:"g-ui-slider-track",onPointerDown:w=>N(w)},We({className:"g-ui-slider-bar",style:ai(D).compute(({lowPct:w,highPct:b})=>({left:`${w}%`,width:`${Math.max(0,b-w)}%`}))}),We({className:"g-ui-slider-thumb",style:ai(D).compute(({lowPct:w})=>({left:`${w}%`})),onPointerDown:w=>{w.stopPropagation?.(),N(w,"low",w.currentTarget.parentElement)}}),We({className:"g-ui-slider-thumb",style:ai(D).compute(({highPct:w})=>({left:`${w}%`})),onPointerDown:w=>{w.stopPropagation?.(),N(w,"high",w.currentTarget.parentElement)}})),Jn(a,()=>We({className:"g-ui-slider-marks"},a.map(w=>nr({mark:w,getBounds:y})))))}import{state as dr,after as mt}from"@granularjs/core";function is(...e){let{props:i,rawProps:r}=s(e,{size:"md",format:{pattern:"dddd-dd-dd"}}),{value:t,size:a,calendarSize:n,leftSection:u,rightSection:g,className:d,format:v,minDate:m,maxDate:h,...x}=i,{onChange:l}=r,y=b=>{let f=c(b);if(f instanceof Date)return f;if(f==null||f==="")return null;let S=new Date(f);return Number.isNaN(S.getTime())?null:S},z=(b,f)=>b&&f&&b.getFullYear()===f.getFullYear()&&b.getMonth()===f.getMonth()&&b.getDate()===f.getDate(),B=b=>{if(!b)return"";let f=String(b.getFullYear()).padStart(4,"0"),S=String(b.getMonth()+1).padStart(2,"0"),V=String(b.getDate()).padStart(2,"0");return`${f}-${S}-${V}`},L=b=>{let f=String(b??"").replace(/\D/g,"");if(f.length<8)return null;let S=Number(f.slice(0,4)),V=Number(f.slice(4,6)),I=Number(f.slice(6,8));if(!S||!V||!I)return null;let X=new Date(S,V-1,I);if(X.getFullYear()!==S||X.getMonth()!==V-1||X.getDate()!==I)return null;let te=y(m);if(te&&X<te)return null;let re=y(h);return re&&X>re?null:X},D=dr(y(t)),F=dr(B(D.get())),N=dr(!1);mt(t).change(b=>{if(t.get()==b)return;let f=y(b);if(f==null){D.set(null),F.set("");return}D.set(f),F.set(B(f))}),mt(F).change(b=>{let f=L(b);console.log("parsed",f),console.log("currentDate",D.get()),f&&(z(f,D.get())||(D.set(f),l?.(f)))});let w=b=>{b&&(z(b,D.get())||(D.set(b),F.set(B(b)),l?.(b),N.set(!1)))};return lr({opened:N,onChange:b=>N.set(!!b),content:ii({size:k("",n,"xs"),value:D,onChange:w}),className:"g-ui-date-input-popover"},ge({...x,size:a,className:o("g-ui-dateinput",d),leftSection:u,rightSection:g,type:"text",inputMode:"numeric",format:v,value:F,onChange:b=>F.set(b)}))}import{Div as mr,when as rs,after as ts,state as as}from"@granularjs/core";function os(...e){let{props:i,rawProps:r,children:t}=s(e),{opened:a,content:n,className:u,...g}=i,{onChange:d}=r,v=as(c(a)??!1);ts(a).change(h=>{let x=c(h);x!=null&&v.set(!!x)});let m=h=>{v.set(h),d?.(h)};return mr({...g,className:o("g-ui-popper",u)},mr({onClick:()=>m(!v.get())},t),rs(v,()=>mr({className:"g-ui-popper-dropdown"},n)))}import{Button as ns,after as ft,when as ss,state as us}from"@granularjs/core";function gs(...e){let{props:i,rawProps:r}=s(e,{size:"md"}),{size:t,className:a,rightSection:n,...u}=i,{onChange:g}=r,d=us(!1),v=ft(d).compute(h=>h?"text":"password"),m=ft(n).compute(h=>h??ns({className:"g-ui-password-toggle",onClick:()=>d.set(!d.get())},ss(d,()=>"Hide",()=>"Show")));return ge({...u,size:t,className:a,onChange:g,rightSection:m,type:v})}import{Div as ls}from"@granularjs/core";function cs(...e){let{props:i}=s(e,{size:"md"}),{size:r,className:t,...a}=i;return ge({...a,size:r,className:t,leftSection:ls({className:"g-ui-search-input-left-section",innerHTML:Ar}),type:"text",inputMode:"search"})}import{Button as ps,after as ds,when as vt}from"@granularjs/core";import{state as ms}from"@granularjs/core";function fs(...e){let{props:i,children:r}=s(e,{value:"",timeout:1500}),{value:t,timeout:a,className:n,...u}=i,g=ms(!1),d=ds(g).compute(m=>o("g-ui-copy-button",m&&"g-ui-copy-button-done",n));return ps({...u,className:d,onClick:async()=>{try{await navigator.clipboard.writeText(String(t)),g.set(!0),setTimeout(()=>g.set(!1),a)}catch{}},type:"button"},vt(r?.length,()=>r,()=>vt(g,()=>"Copied",()=>"Copy")))}import{Div as vs}from"@granularjs/core";function hs(...e){let{props:i}=s(e,{size:"md"}),{size:r,className:t,...a}=i;return vs({...a,className:o("g-ui-progress-ring",[r,n=>`g-ui-progress-ring-size-${n}`],t)})}import{Div as fr,Button as bs,when as ht}from"@granularjs/core";function xs(...e){let{props:i,children:r}=s(e),{title:t,onClose:a,className:n,...u}=i;return fr({...u,className:o("g-ui-toast",n)},fr({className:"g-ui-toast-row"},ht(t,()=>fr({className:"g-ui-toast-title"},t)),ht(a,()=>bs({className:"g-ui-toast-close",onClick:a},"\xD7"))),r)}import{Div as vr}from"@granularjs/core";import{state as ws}from"@granularjs/core";function ys(...e){let{props:i,rawProps:r}=s(e,{data:[]}),{data:t,className:a,...n}=i,{onChange:u}=r,g=ws(""),d=t.filter(v=>String(v.label||"").toLowerCase().includes(String(g.get()).toLowerCase()));return vr({...n,className:o("g-ui-select-search",a)},ge({inputClassName:"g-ui-select-search-input",placeholder:"Search...",value:g,onInput:v=>g.set(v?.target?.value??"")}),vr({className:"g-ui-select-search-list"},d.map(v=>vr({className:"g-ui-select-search-item",onClick:()=>u?.(v.value)},v.label))))}import{Div as ks}from"@granularjs/core";function zs(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return ks({...a,className:o("g-ui-switch-group",t)},r)}import{Div as Ns,state as Cs,after as hr}from"@granularjs/core";function Ss(...e){let{props:i,rawProps:r}=s(e,{size:"md"}),{value:t,size:a,className:n,...u}=i,{onChange:g}=r,d=Cs(c(t)??["",""]);hr(t).change(m=>{let h=c(m);h!=null&&d.set(h)});let v=m=>{d.set(m),g?.(m)};return Ns({...u,className:o("g-ui-range-picker",i.className??n)},ge({size:a,type:"text",inputMode:"numeric",value:hr(d).compute(m=>m?.[0]??""),onInput:m=>{let h=d.get()??["",""];v([m.target.value,h[1]])}}),ge({size:a,type:"text",inputMode:"numeric",value:hr(d).compute(m=>m?.[1]??""),onInput:m=>{let h=d.get()??["",""];v([h[0],m.target.value])}}))}import{Div as Ds}from"@granularjs/core";function Ps(...e){let{props:i,children:r}=s(e,{align:"center",direction:"row"}),{direction:t,wrap:a,align:n,justify:u,gap:g,className:d,...v}=i;return Ds({...v,className:o("g-ui-flex",[t,m=>m==="column"?"g-ui-flex-column":"g-ui-flex-row"],[a,"g-ui-flex-wrap"],[n,m=>m&&`g-ui-align-${m}`],[u,m=>m&&`g-ui-justify-${m}`],[g,m=>m&&`g-ui-gap-${m}`],d)},r)}import{A as Ms,Div as oi,Span as bt,when as ni,after as xt,state as Ts}from"@granularjs/core";function Vs(...e){let{props:i,rawProps:r,children:t}=s(e,{variant:"subtle",childrenOffset:24}),{label:a,description:n,leftSection:u,rightSection:g,active:d,disabled:v,variant:m,childrenOffset:h,opened:x,defaultOpened:l,className:y,padding:z,...B}=i,{onClick:L,onChange:D}=r,F=t.length>0,N=Ts(c(x)??c(l)??!1);xt(x).change(f=>{let S=c(f);S!=null&&N.set(!!S)});let w=xt(h).compute(f=>({paddingLeft:Tr(c(f??24))??"24px"})),b=f=>{if(c(v)){f?.preventDefault?.();return}if(F){let S=!N.get();N.set(S),D?.(S)}L?.(f)};return oi({className:o("g-ui-navlink-root",y)},Ms({...B,className:o("g-ui-navlink",k("g-ui-navlink-variant-",m,"subtle"),W("g-ui-navlink-active",d),W("g-ui-navlink-disabled",v),k("g-ui-navlink-padding-",z,"md")),onClick:b},ni(u,()=>bt({className:"g-ui-navlink-section g-ui-navlink-left"},u)),oi({className:"g-ui-navlink-body"},ni(a,()=>oi({className:"g-ui-navlink-label"},a)),ni(n,()=>oi({className:"g-ui-navlink-description"},n))),ni(g,()=>bt({className:"g-ui-navlink-section g-ui-navlink-right"},g))),F?ni(N,()=>oi({className:"g-ui-navlink-children",style:w},t)):null)}import{Div as wt,when as Ls}from"@granularjs/core";function $s(...e){let{props:i,children:r}=s(e,{show:!0,position:"top-right",color:"danger",size:"md"}),{show:t,position:a,color:n,size:u,className:g,...d}=i;return wt({...d,className:o("g-ui-indicator",k("g-ui-indicator-position-",a,"top-right"),k("g-ui-indicator-color-",n,"danger"),k("g-ui-indicator-size-",u,"md"),g)},r,Ls(t,()=>wt({className:"g-ui-indicator-badge"})))}import{Span as Di}from"@granularjs/core";function Is(...e){let{props:i}=s(e),{opened:r,className:t,...a}=i;return Di({...a,className:o("g-ui-burger",[r,"g-ui-burger-open"],t)},Di(""),Di(""),Di(""))}import{Div as Bs,when as As}from"@granularjs/core";function Fs(...e){let{props:i}=s(e),{visible:r,...t}=i;return As(r,()=>Bs({...t,className:"g-ui-loading-overlay"},Ke({})))}import{Div as js}from"@granularjs/core";function Es(...e){let{props:i,children:r}=s(e,{gap:"md"}),{className:t,gap:a,...n}=i;return js({...n,className:o("g-ui-grid-system",[a,u=>`g-ui-gap-${u}`],t)},r)}import{Div as Rs}from"@granularjs/core";function Hs(...e){let{props:i,children:r}=s(e,{span:12}),{span:t,className:a,...n}=i;return Rs({...n,className:o([t,u=>`g-ui-col-span-${u}`],a)},r)}import{Div as Os}from"@granularjs/core";function qs(...e){let{props:i,children:r}=s(e,{size:"md"}),{size:t,className:a,...n}=i;return Os({...n,className:o("g-ui-scroll-area",[t,u=>`g-ui-scroll-area-${u}`],a)},r)}import{Div as yt,Input as Ys,after as Me,state as br,when as kt,list as Ws}from"@granularjs/core";function Gs(...e){let{props:i,rawProps:r}=s(e,{length:4,size:"md",type:"alphanumeric",mask:!1,placeholder:"\u25CB",disabled:!1,error:!1,oneTimeCode:!1}),{length:t,value:a,size:n,type:u,mask:g,placeholder:d,disabled:v,error:m,oneTimeCode:h,className:x}=i,{onChange:l,onComplete:y}=r,z=br(c(t)??4),B=()=>z.get();Me(t).change(T=>{let R=c(T)??4,C=z.get();if(R===C)return;z.set(R);let G=D.get(),H=L.get();D.set(Array.from({length:R},(se,ue)=>G[ue]??"")),L.set(Array.from({length:R},(se,ue)=>H[ue]??null))});let L=br(Array.from({length:B()},()=>null)),D=br(Array.from({length:B()},(T,R)=>{let C=c(a);return typeof C=="string"||Array.isArray(C)?C[R]??"":""}));Me(a).change(T=>{if(T==null)return;let R=B();typeof T=="string"?D.set(Array.from({length:R},(C,G)=>T[G]??"")):Array.isArray(T)&&D.set(Array.from({length:R},(C,G)=>T[G]??""))});let F=()=>D.get().join(""),N=T=>{D.set(T);let R=T.join("");l?.(R),T.every(C=>C!=="")&&T.length===B()&&y?.(R)},w=T=>{let R=B(),C=L.get();T>=0&&T<R&&C[T]&&(C[T].focus(),C[T].select())},b=()=>{let T=c(u);return T==="number"?/^[0-9]$/:T instanceof RegExp?T:/^[a-zA-Z0-9]$/},f=(T,R)=>{let C=R.target.value,G=b();if(C.length>1){S(T,C);return}if(C&&!G.test(C)){R.target.value=D.get()[T]??"";return}let H=D.get().slice();H[T]=C,N(H),C&&T<B()-1&&w(T+1)},S=(T,R)=>{let C=b(),G=R.split("").filter(he=>C.test(he)),H=D.get().slice(),se=B();G.forEach((he,ze)=>{let Se=T+ze;Se<se&&(H[Se]=he)}),N(H);let ue=H.findIndex((he,ze)=>ze>=T&&he==="");ue>=0?w(ue):w(Math.min(T+G.length,se-1))},V=(T,R)=>{if(R.key==="Backspace"){let C=D.get().slice();C[T]===""&&T>0?(R.preventDefault(),C[T-1]="",N(C),w(T-1)):C[T]!==""&&(C[T]="",N(C))}else R.key==="ArrowLeft"&&T>0?(R.preventDefault(),w(T-1)):R.key==="ArrowRight"&&T<B()-1&&(R.preventDefault(),w(T+1))},I=(T,R)=>{R.target.select()},X=()=>{let T=D.get(),R=T.findIndex(C=>C==="");R>=0?w(R):w(T.length-1)},te=Me(g).compute(T=>c(T)?"password":"text"),re=Me(u).compute(T=>c(T)==="number"?"numeric":"text"),ae=Me(h).compute(T=>c(T)?"one-time-code":"off"),K=Me(v).compute(T=>!!c(T)),ne=Me(m).compute(T=>!!c(T)),me=Me(z).compute(T=>Array.from({length:T},(R,C)=>C)),ie=T=>Ys({className:o("g-ui-pin-input-field",kt(ne,()=>"g-ui-pin-input-error")),type:te,inputMode:re,autocomplete:ae,maxLength:2,placeholder:kt(K,()=>"",()=>d),disabled:K,value:Me(D,T).compute(([R,C])=>R[C]??""),node:L[T.get()],onInput:R=>f(T.get(),R),onChange:R=>f(T.get(),R),onKeyDown:R=>V(T.get(),R),onFocus:R=>I(T.get(),R)});return yt({className:o("g-ui-pin-input",k("g-ui-input-size-",n,"md"),x),onClick:X},yt({className:"g-ui-pin-input-wrapper"},Ws(me,ie)))}import{Div as Zs}from"@granularjs/core";function Us(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return Zs({...a,className:o("g-ui-checkbox-group",t)},r)}import{Div as Xs}from"@granularjs/core";function _s(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return Xs({...a,className:o("g-ui-avatar-group",t)},r)}import{Div as Ks}from"@granularjs/core";function Qs(...e){let{props:i,children:r}=s(e),{className:t,...a}=i;return Ks({...a,className:o("g-ui-badge-group",t)},r)}import{Div as Pi,Span as Js,after as si,context as zt}from"@granularjs/core";var eu=zt([]),Nt=zt({sort:null,onSort:null});function xr(...e){let{props:i,rawProps:r,children:t}=s(e,{sizes:[],sort:null,stickyHeader:!1}),{className:a,sizes:n,sort:u,stickyHeader:g,...d}=i,{onSort:v}=r,m=eu.scope(n.get());si(n).change(x=>m.set(x));let h=Nt.scope({sort:u.get(),onSort:v||null});return si(u).change(x=>h.set().sort=x),m.serve(h.serve(Pi({className:o("g-ui-grid-table",W("g-ui-grid-table-sticky",g),a),style:{gridTemplateColumns:si(m).compute(x=>Array.isArray(x)?x.join(" "):"")},...d},t)))}xr.GridRow=(...e)=>{let{props:i,children:r}=s(e,{}),{className:t,header:a,...n}=i;return Pi({className:o("g-ui-grid-table-row",W("g-ui-grid-table-row-header",a),t),...n},...r)};xr.GridCell=function(...e){let{props:i,rawProps:r,children:t}=s(e,{}),{className:a,sort:n,...u}=i,g=r.sort;if(g){let d=Nt.state(),v=si(d.sort).compute(h=>h?.key===g?h.direction:null),m=()=>{let h=d.get().sort,x;h?.key===g?x=h.direction==="asc"?{key:g,direction:"desc"}:null:x={key:g,direction:"asc"},d.set().sort=x;let{onSort:l}=d.get();l&&l(x)};return Pi({className:o("g-ui-grid-table-cell","g-ui-grid-table-cell-sortable",a),onClick:m,...u},t,Js({className:"g-ui-grid-table-sort-icon"},si(v).compute(h=>h==="asc"?" \u2191":h==="desc"?" \u2193":"")))}return Pi({className:o("g-ui-grid-table-cell",a),...u},t)};import{Button as iu,Div as ru,Span as Ct,when as St}from"@granularjs/core";function Dt(...e){let{props:i,children:r}=s(e,{grow:!0}),{grow:t,className:a,...n}=i;return ru({...n,className:o("g-ui-bottombar",W("g-ui-bottombar-grow",t),a)},r)}Dt.Action=function(...i){let{props:r,rawProps:t,children:a}=s(i,{variant:"subtle"}),{icon:n,label:u,active:g,disabled:d,variant:v,className:m,...h}=r,{onClick:x}=t;return iu({...h,className:o("g-ui-bottombar-action",k("g-ui-bottombar-action-variant-",v,"subtle"),W("g-ui-bottombar-action-active",g),W("g-ui-bottombar-action-disabled",d),m),onClick:x,disabled:d},St(n,()=>Ct({className:"g-ui-bottombar-action-icon"},n)),St(u,()=>Ct({className:"g-ui-bottombar-action-label"},u)),a)};import{Div as j,Button as je,state as le,after as xe,when as ce,Input as Mi,Label as ui,Span as Ee}from"@granularjs/core";var tu=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],au=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"}];function Ti(e){if(e instanceof Date)return e;if(e==null)return null;let i=new Date(e);return Number.isNaN(i.getTime())?null:i}function Tt(e){let i=Ti(e.start),r=Ti(e.end);return!i||!r?null:{...e,id:e.id??`${i.getTime()}-${e.title??"event"}`,title:e.title??"",start:i,end:r,allDay:!!e.allDay,description:e.description??"",location:e.location??"",attendees:Array.isArray(e.attendees)?e.attendees:[],color:e.color??null}}function Vt(e,i,r){let t=Ti(i).getTime(),a=Ti(r).getTime();return e.map(Tt).filter(Boolean).filter(n=>n.end.getTime()>t&&n.start.getTime()<a)}function Pt(e,i){let r=new Date(i);r.setHours(0,0,0,0);let t=r.getTime();r.setHours(23,59,59,999);let a=r.getTime();return Vt(e,t,a)}function wr(e,i){let r=new Date(e),a=(r.getDay()-i+7)%7;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Ge(e,i="default"){return e.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})}function gi(e,i="default"){return e.toLocaleDateString(i,{weekday:"short",month:"short",day:"numeric"})}function ou(e,i="default"){return e.toLocaleDateString(i,{month:"long",year:"numeric"})}function nu(e,i="default"){let r=new Date(e);return r.setDate(r.getDate()+6),`${e.toLocaleDateString(i,{month:"short",day:"numeric"})} \u2013 ${r.toLocaleDateString(i,{month:"short",day:"numeric",year:"numeric"})}`}function Mt(e,i,r,t){let a=new Date(e).setHours(r,0,0,0),n=new Date(e).setHours(t,0,0,0),u=(t-r)*60,g=Math.max(e.getTime(),a),v=(Math.min(i.getTime(),n)-g)/6e4,m=(g-a)/6e4/u*100,h=v/u*100;return{top:m,height:h}}function su(...e){let{props:i,rawProps:r}=s(e,{defaultView:"month",firstDayOfWeek:0,locale:"default",hourSlotDuration:30,minTime:6,maxTime:22,eventCreationColorOptions:[]}),{events:t=[],defaultView:a,firstDayOfWeek:n,locale:u,hourSlotDuration:g,minTime:d,maxTime:v,eventCreationColorOptions:m,className:h,...x}=i,{onCreateEventRequest:l,onViewEventRequest:y,onUpdateEventRequest:z,onRemoveEventRequest:B,eventCreationEmailLookup:L,eventCreationLocationsCallback:D,eventCreationCalendarsCallback:F,onSlotClick:N,onDateRangeChange:w}=r,b=le(c(a)??"month"),f=le(new Date),S=le(null),V=le(null),I=le({title:"",start:null,end:null,allDay:!1,description:"",location:"",attendees:[],color:null}),X=xe(t).compute(p=>Array.isArray(p)?p:[]),te=f.get(),re=wr(te,c(n)??0),ae=c(d)??6,K=c(v)??22,ne=c(g)??30,me=()=>{let p=new Date(f.get());b.get()==="month"?p.setMonth(p.getMonth()-1):b.get()==="week"?p.setDate(p.getDate()-7):p.setDate(p.getDate()-1),f.set(p),w?.({start:p,end:p,view:b.get()})},ie=()=>{let p=new Date(f.get());b.get()==="month"?p.setMonth(p.getMonth()+1):b.get()==="week"?p.setDate(p.getDate()+7):p.setDate(p.getDate()+1),f.set(p),w?.({start:p,end:p,view:b.get()})},T=()=>{let p=new Date;f.set(p),w?.({start:p,end:p,view:b.get()})},R=(p,A,oe=!1)=>{let q=p?new Date(p):new Date(f.get()),J=A?new Date(A):new Date(q.getTime()+3600*1e3);oe&&(q.setHours(0,0,0,0),J.setHours(23,59,59,999)),I.set({title:"",start:q,end:J,allDay:oe,description:"",location:"",attendees:[],color:null}),S.set("create")},C=p=>{V.set(Tt(p)),S.set("view"),y?.(p)},G=()=>{let p=V.get();p&&(I.set({title:p.title,start:new Date(p.start),end:new Date(p.end),allDay:p.allDay,description:p.description??"",location:p.location??"",attendees:[...p.attendees||[]],color:p.color??null}),S.set("edit"))},H=()=>{S.set(null),V.set(null)},se=(p,A,oe)=>{if(N){N({date:p,hour:A,allDay:oe});return}let q=new Date(p);if(oe){q.setHours(0,0,0,0);let J=new Date(q);J.setHours(23,59,59,999),R(q,J,!0)}else{q.setHours(A,0,0,0);let J=new Date(q.getTime()+ne*60*1e3);R(q,J,!1)}},ue=()=>{let p=I.get();!p.start||!p.end||l?.({title:p.title,start:p.start,end:p.end,allDay:p.allDay,description:p.description,location:p.location,attendees:p.attendees,color:p.color},()=>{H()})},he=()=>{let p=V.get(),A=I.get();!p||!A.start||!A.end||z?.(p,{title:A.title,start:A.start,end:A.end,allDay:A.allDay,description:A.description,location:A.location,attendees:A.attendees,color:A.color},()=>H())},ze=()=>{let p=V.get();p&&B?.(p,()=>H())},Se=xe(b,f).compute(([p,A])=>p==="month"?ou(A,c(u)):p==="week"?nu(wr(A,c(n)??0),c(u)):gi(A,c(u))),Ve=j({className:"g-ui-event-calendar-header"},j({className:"g-ui-event-calendar-nav-group"},Fe({size:"sm",variant:"subtle",onClick:me,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:mi})),Fe({size:"sm",variant:"subtle",onClick:ie,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:di})),je({type:"button",variant:"subtle",size:"sm",className:"g-ui-event-calendar-today",onClick:T},ye({size:"sm",className:"g-ui-event-calendar-today-icon",innerHTML:Rr}),"Today")),j({className:"g-ui-event-calendar-title"},Se),j({className:"g-ui-event-calendar-actions"},au.map(p=>j({className:o("g-ui-event-calendar-view-option",xe(b).compute(A=>A===p.value?"g-ui-event-calendar-view-option-active":"")),onClick:()=>{b.set(p.value),w?.({start:f.get(),end:f.get(),view:p.value})}},p.label)),je({type:"button",variant:"filled",size:"sm",className:"g-ui-event-calendar-create-btn",onClick:()=>R(f.get(),null,!1)},ye({size:"sm",innerHTML:Fr}),"Create"))),li=xe(f,X,n).compute(([p,A,oe])=>{let q=p.getFullYear(),J=p.getMonth(),Q=(new Date(q,J,1).getDay()-(oe??0)+7)%7,Ce=new Date(q,J+1,0).getDate(),De=new Date(q,J,0).getDate(),M=[],P=1,E=1,O=Math.ceil((Q+Ce)/7)*7,_=[];for(let Z=0;Z<O;Z+=1){let Y,U,ee;Z<Q?(Y=De-Q+Z+1,ee=new Date(q,J-1,Y),U=!1):P<=Ce?(Y=P,ee=new Date(q,J,Y),U=!0,P+=1):(Y=E,ee=new Date(q,J+1,Y),U=!1,E+=1);let fe=Pt(A,ee),Te=ee.getDate()===new Date().getDate()&&ee.getMonth()===new Date().getMonth()&&ee.getFullYear()===new Date().getFullYear();_.push(j({key:ee.getTime(),className:o("g-ui-event-calendar-month-cell",!U&&"g-ui-event-calendar-month-cell-outside",Te&&"g-ui-event-calendar-month-cell-today")},j({className:"g-ui-event-calendar-month-cell-header",onClick:()=>se(ee,0,!0)},Ee({className:"g-ui-event-calendar-month-cell-day"},ee.getDate())),j({className:"g-ui-event-calendar-month-cell-events"},fe.slice(0,3).map(we=>j({key:we.id,className:"g-ui-event-calendar-month-event",style:we.color?{borderLeftColor:we.color,backgroundColor:`${we.color}20`}:{},onClick:Bi=>{Bi.stopPropagation(),C(we)}},we.title||"(No title)")),ce(fe.length>3,()=>j({className:"g-ui-event-calendar-month-more",onClick:we=>{we.stopPropagation(),C(fe[3])}},`+${fe.length-3} more`)))))}return _}),Vi=j({className:"g-ui-event-calendar-month"},j({className:"g-ui-event-calendar-weekdays"},tu.map(p=>j({key:p,className:"g-ui-event-calendar-weekday"},p))),j({className:"g-ui-event-calendar-month-grid"},li)),Ne=[];for(let p=ae;p<K;p+=1)for(let A=0;A<60;A+=ne)Ne.push(p+A/60);let Ze=xe(f,n).compute(([p,A])=>{let oe=wr(p,A??0),q=[];for(let J=0;J<7;J+=1){let pe=new Date(oe);pe.setDate(pe.getDate()+J),q.push(pe)}return q}),Li=j({className:"g-ui-event-calendar-week"},xe(Ze).compute(p=>j({className:"g-ui-event-calendar-week-days"},j({className:"g-ui-event-calendar-week-time-col"},""),(p||[]).map(A=>j({key:A.getTime(),className:"g-ui-event-calendar-week-day-col"},j({className:"g-ui-event-calendar-week-day-header"},gi(A,c(u))))))),j({className:"g-ui-event-calendar-week-body"},j({className:"g-ui-event-calendar-week-time-col"},Ne.map(p=>{let A=Math.floor(p),oe=(p-A)*60,q=`${A<=12?A:A-12}:${oe===0?"00":oe} ${A<12?"AM":"PM"}`;return j({key:p,className:"g-ui-event-calendar-week-slot-label"},q)})),xe(Ze,X).compute(([p,A])=>{if(!p||!p.length)return null;let oe=p[0],q=new Date(p[6]);q.setHours(23,59,59,999);let J=Vt(A,oe,q);return j({className:"g-ui-event-calendar-week-grid-cols"},p.map(pe=>j({key:pe.getTime(),className:"g-ui-event-calendar-week-day-col g-ui-event-calendar-week-day-col-body"},Ne.map(Q=>j({key:Q,className:"g-ui-event-calendar-week-slot",onClick:()=>se(pe,Q,!1)})),J.filter(Q=>!Q.allDay&&Q.start.getDate()===pe.getDate()&&Q.start.getMonth()===pe.getMonth()&&Q.start.getFullYear()===pe.getFullYear()).map(Q=>{let{top:Ce,height:De}=Mt(Q.start,Q.end,ae,K);return j({key:Q.id,className:"g-ui-event-calendar-week-event",style:{top:`${Ce}%`,height:`${De}%`,borderLeftColor:Q.color||"var(--g-ui-primary)"},onClick:M=>{M.stopPropagation(),C(Q)}},j({className:"g-ui-event-calendar-week-event-title"},Q.title||"(No title)"),ce(!Q.allDay,()=>Ee({className:"g-ui-event-calendar-week-event-time"},`${Ge(Q.start,c(u))} \u2013 ${Ge(Q.end,c(u))}`)))}))))}))),$i=j({className:"g-ui-event-calendar-day"},j({className:"g-ui-event-calendar-day-body"},j({className:"g-ui-event-calendar-day-time-col"},Ne.map(p=>{let A=Math.floor(p),oe=(p-A)*60,q=`${A<=12?A:A-12}:${oe===0?"00":oe} ${A<12?"AM":"PM"}`;return j({key:p,className:"g-ui-event-calendar-day-slot-label"},q)})),j({className:"g-ui-event-calendar-day-slots"},Ne.map(p=>j({key:p,className:"g-ui-event-calendar-day-slot",onClick:()=>se(f.get(),p,!1)})),xe(X,f).compute(([p,A])=>A?Pt(p,A).filter(q=>!q.allDay).map(q=>{let{top:J,height:pe}=Mt(q.start,q.end,ae,K);return j({key:q.id,className:"g-ui-event-calendar-day-event",style:{top:`${J}%`,height:`${pe}%`,borderLeftColor:q.color||"var(--g-ui-primary)"},onClick:Q=>{Q.stopPropagation(),C(q)}},j({className:"g-ui-event-calendar-day-event-title"},q.title||"(No title)"),Ee({className:"g-ui-event-calendar-day-event-time"},`${Ge(q.start,c(u))} \u2013 ${Ge(q.end,c(u))}`))}):[])))),ci=p=>{let A=I.get(),oe=new Date,q=A.start||oe,J=A.end||new Date(oe.getTime()+3600*1e3),pe=le(A.title),Q=le(q.toISOString().slice(0,10)),Ce=le(!A.allDay&&q?q.toTimeString().slice(0,5):"09:00"),De=le(J.toISOString().slice(0,10)),M=le(!A.allDay&&J?J.toTimeString().slice(0,5):"10:00"),P=le(A.allDay),E=le(A.description),O=le(A.location),_=le(A.attendees||[]),Z=le(""),Y=le([]),U=le([]),ee=le(""),fe=Array.isArray(m)?m:[],Te=le(A.color),we=()=>{let $=new Date(Q.get()+"T"+(P.get()?"00:00:00":Ce.get()+":00")),ve=new Date(De.get()+"T"+(P.get()?"23:59:59":M.get()+":00"));I.set({title:pe.get(),start:$,end:ve,allDay:P.get(),description:E.get(),location:O.get(),attendees:_.get(),color:Te.get()})},Bi=$=>{if(Z.set($),!L||!$.trim()){Y.set([]);return}Promise.resolve(L($.trim())).then(ve=>Y.set(Array.isArray(ve)?ve:[])).catch(()=>Y.set([]))},Lt=$=>{let ve=_.get();ve.some(kr=>(kr.email||kr.id)===($.email||$.id))||(_.set([...ve,{id:$.id,email:$.email??$.label,label:$.label}]),Z.set(""),Y.set([]))},$t=$=>{let ve=[..._.get()];ve.splice($,1),_.set(ve)},yr=()=>{D&&Promise.resolve(D(ee.get())).then($=>U.set(Array.isArray($)?$:[])).catch(()=>U.set([]))};return j({className:"g-ui-event-calendar-form"},j({className:"g-ui-event-calendar-form-row"},ge({label:"Title",placeholder:"Event title",value:pe,onInput:$=>pe.set($?.target?.value??"")})),j({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},Xi({label:"All day",checked:P,onChange:$=>P.set($)})),j({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},j({className:"g-ui-event-calendar-form-field"},ui({className:"g-ui-event-calendar-form-label"},"Start"),Mi({type:"date",className:"g-ui-input g-ui-input-size-md",value:Q,onInput:$=>Q.set($?.target?.value??"")}),ce(!P,()=>Mi({type:"time",className:"g-ui-input g-ui-input-size-md",value:Ce,onInput:$=>Ce.set($?.target?.value??"")}))),j({className:"g-ui-event-calendar-form-field"},ui({className:"g-ui-event-calendar-form-label"},"End"),Mi({type:"date",className:"g-ui-input g-ui-input-size-md",value:De,onInput:$=>De.set($?.target?.value??"")}),ce(!P,()=>Mi({type:"time",className:"g-ui-input g-ui-input-size-md",value:M,onInput:$=>M.set($?.target?.value??"")})))),ce(D,()=>j({className:"g-ui-event-calendar-form-row"},ui({className:"g-ui-event-calendar-form-label"},"Location"),ge({placeholder:"Search or type location",value:ee,onInput:$=>{ee.set($?.target?.value??""),yr()},onFocus:yr}),ce(xe(U).compute($=>$&&$.length>0),()=>j({className:"g-ui-event-calendar-form-suggestions"},U.get().map($=>j({key:$.id??$.label,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>{O.set($.label??$.id),ee.set(""),U.set([])}},$.label??$.id)))),ce(xe(O).compute($=>!!$),()=>Ee({className:"g-ui-event-calendar-form-chip"},O)))),ce(L,()=>j({className:"g-ui-event-calendar-form-row"},ui({className:"g-ui-event-calendar-form-label"},"Add guests"),ge({placeholder:"Type email to search",value:Z,onInput:$=>Bi($?.target?.value??"")}),j({className:"g-ui-event-calendar-form-chips"},_.get().map(($,ve)=>Ee({key:($.email||$.id)+ve,className:"g-ui-event-calendar-form-chip g-ui-event-calendar-form-chip-removable",onClick:()=>$t(ve)},$.label||$.email||$.id," \xD7"))),ce(xe(Y).compute($=>$&&$.length>0),()=>j({className:"g-ui-event-calendar-form-suggestions"},Y.get().map($=>j({key:$.id??$.email,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>Lt($)},$.label??$.email??$.id)))))),j({className:"g-ui-event-calendar-form-row"},qi({label:"Description",placeholder:"Add description",value:E,onInput:$=>E.set($?.target?.value??"")})),ce(fe.length>0,()=>j({className:"g-ui-event-calendar-form-row"},ui({className:"g-ui-event-calendar-form-label"},"Color"),j({className:"g-ui-event-calendar-form-colors"},fe.map($=>j({key:$.value??$.id??$,className:o("g-ui-event-calendar-form-color-swatch",xe(Te).compute(ve=>ve===($.value??$.id??$)?"g-ui-event-calendar-form-color-swatch-active":"")),style:{backgroundColor:$.color??$.value??$},onClick:()=>Te.set($.value??$.id??$)}))))),j({className:"g-ui-event-calendar-form-actions"},je({variant:"subtle",onClick:H},"Cancel"),je({variant:"filled",onClick:()=>{we(),p?he():ue()}},p?"Save":"Create")))},Ii=()=>{let p=V.get();return p?j({className:"g-ui-event-calendar-view-modal"},j({className:"g-ui-event-calendar-view-modal-title"},p.title||"(No title)"),j({className:"g-ui-event-calendar-view-modal-meta"},p.allDay?Ee({className:"g-ui-event-calendar-view-modal-date"},gi(p.start,c(u))+(p.start.getTime()!==p.end.getTime()?` \u2013 ${gi(p.end,c(u))}`:"")):Ee({className:"g-ui-event-calendar-view-modal-date"},`${gi(p.start,c(u))} \xB7 ${Ge(p.start,c(u))} \u2013 ${Ge(p.end,c(u))}`)),ce(p.location,()=>j({className:"g-ui-event-calendar-view-modal-field"},"Location: ",p.location)),ce(p.description,()=>j({className:"g-ui-event-calendar-view-modal-field"},p.description)),ce(p.attendees?.length,()=>j({className:"g-ui-event-calendar-view-modal-field"},"Guests: ",p.attendees.map(A=>A.label||A.email||A.id).join(", "))),j({className:"g-ui-event-calendar-view-modal-actions"},je({variant:"subtle",size:"sm",onClick:G},ye({size:"sm",innerHTML:jr})," Edit"),je({variant:"subtle",size:"sm",onClick:ze,className:"g-ui-event-calendar-view-modal-delete"},ye({size:"sm",innerHTML:Er})," Delete"),je({variant:"filled",size:"sm",onClick:H},"Close"))):null};return j({...x,className:o("g-ui-event-calendar",h)},Ve,ce(b,p=>p==="month",()=>Vi),ce(b,p=>p==="week",()=>Li),ce(b,p=>p==="day",()=>$i),ce(S,p=>p==="create",()=>_e({opened:!0,title:"New event",size:"lg",onClose:H},ci(!1))),ce(S,p=>p==="view",()=>_e({opened:!0,title:"Event",size:"md",onClose:H},Ii())),ce(S,p=>p==="edit",()=>_e({opened:!0,title:"Edit event",size:"lg",onClose:H},ci(!0))))}import{state as uu}from"@granularjs/core";function gu(e=!1){let i=uu(!!e);return[i,{open:()=>i.set(!0),close:()=>i.set(!1),toggle:()=>i.set(!i.get())}]}Nr();export{Ja as Accordion,Fe as ActionIcon,Dn as Affix,ho as Alert,jo as Anchor,$n as AppBar,yo as Avatar,_s as AvatarGroup,ba as Badge,Qs as BadgeGroup,Do as Blockquote,Dt as BottomBar,dn as Breadcrumbs,Is as Burger,Ri as Button,ii as Calendar,va as Card,fn as Center,Xi as Checkbox,Us as CheckboxGroup,Ko as Chip,Co as Code,Hs as Col,wn as Collapse,la as Container,fs as CopyButton,is as DateInput,Un as DatePicker,co as Divider,so as Drawer,su as EventCalendar,Vn as Fieldset,Ps as Flex,Es as Grid,xr as GridTable,ma as Group,Cn as HoverCard,ye as Icon,Ro as Image,$s as Indicator,zo as Kbd,Jr as List,Ke as Loading,Fs as LoadingOverlay,ao as Menu,_e as Modal,Gn as MultiSelect,Vs as NavLink,er as Notification,Kn as Notifications,Yi as NumberField,Da as NumberInput,an as Pagination,mo as Paper,gs as PasswordInput,Gs as PinInput,lr as Popover,os as Popper,Oo as Progress,hs as ProgressRing,un as Radio,ln as RadioGroup,Ss as RangePicker,es as RangeSlider,Hn as Rating,qs as ScrollArea,cs as SearchInput,en as SegmentedControl,Ra as Select,ys as SelectSearch,Bn as Sidebar,Mo as SimpleGrid,Uo as Skeleton,Wo as Slider,hn as Space,pa as Stack,En as Stepper,Ea as Switch,zs as SwitchGroup,Xa as Table,Ya as Tabs,qn as Tag,Hi as Text,ge as TextInput,qi as Textarea,jn as Timeline,ua as Title,xs as Toast,Zn as ToastStack,eo as Tooltip,W as classFlag,de as classMap,k as classVar,o as cx,_t as getThemeMode,Xt as setThemeMode,Ut as setThemeVars,s as splitPropsChildren,gu as useDisclosure};
|
|
4122
|
+
`;function Rt(){if(typeof document>"u"||document.getElementById(jt))return;let e=document.createElement("style");e.id=jt,e.textContent=xa,document.head.appendChild(e)}var wa=new Set(["--g-ui-bg","--g-ui-bg-subtle","--g-ui-bg-muted","--g-ui-bg-emphasized","--g-ui-bg-inverted","--g-ui-bg-panel","--g-ui-fg","--g-ui-fg-muted","--g-ui-fg-subtle","--g-ui-fg-inverted","--g-ui-border","--g-ui-border-subtle","--g-ui-border-emphasized","--g-ui-border-inverted","--g-ui-primary","--g-ui-primary-hover","--g-ui-primary-active","--g-ui-primary-subtle","--g-ui-primary-muted","--g-ui-primary-emphasized","--g-ui-success","--g-ui-success-hover","--g-ui-success-active","--g-ui-success-subtle","--g-ui-success-muted","--g-ui-danger","--g-ui-danger-hover","--g-ui-danger-active","--g-ui-danger-subtle","--g-ui-danger-muted","--g-ui-warning","--g-ui-warning-hover","--g-ui-warning-active","--g-ui-warning-subtle","--g-ui-warning-muted","--g-ui-info","--g-ui-info-hover","--g-ui-info-active","--g-ui-info-subtle","--g-ui-info-muted","--g-ui-shadow-xs","--g-ui-shadow-sm","--g-ui-shadow-md","--g-ui-shadow-lg","--g-ui-shadow-xl","--g-ui-shadow-2xl","--g-ui-radius","--g-ui-font","--g-ui-surface","--g-ui-text","--g-ui-muted","--g-ui-primary-strong","--g-ui-shadow"]);function ya(e={},i=document?.documentElement){if(i)for(let[t,r]of Object.entries(e)){let a=t.startsWith("--")?t:`--g-ui-${t}`;wa.has(a)&&i.style.setProperty(a,String(r))}}function ka(e="dark",i=document?.documentElement){i&&(i.classList.remove("g-ui-theme-dark","g-ui-theme-light"),i.classList.add(e==="light"?"g-ui-theme-light":"g-ui-theme-dark"))}function za(e=document?.documentElement){return e.classList.contains("g-ui-theme-light")?"light":"dark"}import{Renderer as Ht,isSignal as Wt,isState as Ot,isStatePath as qt,isComputed as Yt,resolve as Ee,computed as Na,after as qi,concat as Ca}from"@granularjs/core";function Yi(e){return Wt(e)||Ot(e)||qt(e)||Yt(e)}function s(...e){return Ca(...e,{separator:" ",filterFalsy:!0})}function Gt(e){if(!(e==null||e===""))return typeof e=="number"?`${e}px`:e}function g(e,i){let t={},r=[],a=o=>!!o&&typeof o=="object"&&!Array.isArray(o)&&!Ht.isRenderable(o)&&!Ht.isDomNode(o)&&!Wt(o)&&!Ot(o)&&!qt(o)&&!Yt(o);for(let o of e)a(o)?Object.assign(t,o):r.push(o);if(i&&typeof i=="object")for(let o of Object.keys(i))t[o]===void 0&&(t[o]=i[o]);return{props:Na(t),rawProps:t,children:r}}function m(e){return Ee(e)}function ke(e){return!!Ee(e)}function N(e,i,t){let r=a=>{let o=Ee(a),n=o==null||o===""?t:o;return n==null||n===""?"":`${e}${n}`};return Yi(i)?qi(i).compute(a=>r(a)):r(i)}function U(e,i){return Yi(i)?qi(i).compute(t=>Ee(t)?e:""):Ee(i)?e:""}function he(e,i,t){let r=a=>i[a]||null;return Yi(e)?qi(e).compute(a=>r(Ee(a??t))):r(Ee(e??t))}import{Button as Sa,Span as Gi,when as _i,after as Da}from"@granularjs/core";function Zi(...e){let{props:i,children:t}=g(e,{variant:"filled",size:"md",justify:"center"}),{variant:r,color:a,size:o,fullWidth:n,loading:u,leftSection:c,rightSection:d,className:p,disabled:w,justify:f,...l}=i,b=Da(w,u).compute(([z,$])=>z||$);return Sa({...l,disabled:b,className:s("g-ui-button",N("g-ui-button-variant-",r,"filled"),N("g-ui-button-color-",a,"primary"),N("g-ui-justify-",f,"center"),N("g-ui-button-size-",o,"md"),U("g-ui-button-full",n),U("g-ui-button-loading",u),p)},_i(c,()=>Gi({className:"g-ui-button-section-left"},c)),_i(u,()=>Gi("Loading..."),()=>t),_i(d,()=>Gi({className:"g-ui-button-section-right"},d)))}import{Span as Pa}from"@granularjs/core";function Ui(...e){let{props:i,children:t}=g(e,{size:"md"}),{size:r,weight:a,color:o,dimmed:n,align:u,ellipsis:c,decoration:d,className:p,style:w,...f}=i,l=he(a,{bold:"g-ui-text-weight-700",semibold:"g-ui-text-weight-600",medium:"g-ui-text-weight-500",700:"g-ui-text-weight-700",600:"g-ui-text-weight-600",500:"g-ui-text-weight-500",400:"g-ui-text-weight-400"}),b=he(o,{primary:"g-ui-text-primary",success:"g-ui-text-success",danger:"g-ui-text-danger",muted:"g-ui-text-dimmed"}),z=he(u,{center:"g-ui-text-align-center",right:"g-ui-text-align-right",left:"g-ui-text-align-left"}),$=he(d,{underline:"g-ui-text-decoration-underline","line-through":"g-ui-text-decoration-line-through",overline:"g-ui-text-decoration-overline",none:"g-ui-text-decoration-none"});return Pa({...f,style:w,className:s("g-ui-text",N("g-ui-text-size-",r,"md"),U("g-ui-text-dimmed",n),U("g-ui-text-ellipsis",c),l,b,z,$,p)},t)}import{H1 as Ma,H2 as _t,H3 as Ta,H4 as Va,H5 as La,H6 as Ia}from"@granularjs/core";var $a={1:Ma,2:_t,3:Ta,4:Va,5:La,6:Ia};function Aa(...e){let{props:i,children:t}=g(e,{order:2}),{order:r,className:a,style:o,...n}=i,u=m(r)||2;return($a[u]||_t)({...n,className:s("g-ui-title",N("g-ui-title-order-",r,2),a)},t)}import{Div as Ba}from"@granularjs/core";function Fa(...e){let{props:i,children:t}=g(e,{size:"md"}),{size:r,fluid:a,className:o,style:n,...u}=i;return Ba({...u,style:n,className:s("g-ui-container",U("g-ui-container-fluid",a),N("g-ui-container-size-",r,"md"),o)},t)}import{Div as Ea}from"@granularjs/core";function ja(...e){let{props:i,children:t}=g(e,{gap:"md"}),{gap:r,align:a,justify:o,className:n,style:u,...c}=i,d=he(o,{between:"g-ui-justify-between",center:"g-ui-justify-center",end:"g-ui-justify-end",start:"g-ui-justify-start"});return Ea({...c,style:u,className:s("g-ui-stack",N("g-ui-gap-",r,"md"),N("g-ui-align-",a),d,n)},t)}import{Div as Ra}from"@granularjs/core";function Ha(...e){let{props:i,children:t}=g(e,{gap:"md",align:"center"}),{gap:r,align:a,justify:o,position:n,noWrap:u,className:c,style:d,...p}=i,w=he(n,{apart:"g-ui-justify-between",center:"g-ui-justify-center",right:"g-ui-justify-end",left:"g-ui-justify-start"});return Ra({...p,style:d,className:s("g-ui-group",N("g-ui-gap-",r,"md"),N("g-ui-align-",a,"center"),N("g-ui-justify-",o,"none"),w,U("g-ui-no-wrap",u),c)},t)}import{Div as bi,list as Wa,when as Xi,after as Zt}from"@granularjs/core";function Oa(...e){let{props:i,children:t}=g(e,{padding:"md",radius:"md",shadow:"none",border:"default"}),{title:r,content:a,actions:o,border:n,padding:u,radius:c,shadow:d,className:p,style:w,...f}=i;return bi({style:w},Xi(r,()=>bi({className:"g-ui-card-title"},r)),Xi(a,()=>bi({className:"g-ui-card-content"},a)),{className:s("g-ui-card",N("g-ui-card-border-",n,"md"),N("g-ui-card-padding-",u,"md"),N("g-ui-card-radius-",c,"md"),N("g-ui-card-shadow-",d,"md"),p),...f},t,Xi(o,()=>bi({className:"g-ui-card-actions"},Wa(o,l=>Zi({className:"g-ui-card-action",onClick:b=>l.get().onClick?.(b),leftSection:l.leftSection,rightSection:l.rightSection,size:Zt(l.size).compute(b=>b||"sm"),variant:Zt(l.variant).compute(b=>b||"outline"),...l.get().props||{}},l.label)))))}import{Span as qa}from"@granularjs/core";function Ya(...e){let{props:i,children:t}=g(e,{variant:"filled",size:"md"}),{variant:r,size:a,className:o,dot:n,style:u,...c}=i,d=he(r,{dot:"g-ui-badge-dot"});return qa({...c,className:s("g-ui-badge",N("g-ui-badge-variant-",r,"filled"),N("g-ui-badge-size-",a,"md"),U("g-ui-badge-dot",n),d,o)},t)}import{Div as ii,Input as Ga,Textarea as _a,Label as Za,Span as Ua,when as ti,state as Xa,after as Ka,isState as Qa}from"@granularjs/core";function be(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{label:r,description:a,error:o,size:n,leftSection:u,rightSection:c,className:d,inputClassName:p,multiline:w,value:f,...l}=i,{value:b,node:z,onChange:$,onInput:D,onFocus:C,onBlur:P,onKeyDown:L,onKeyUp:y,onClick:k}=t,h=Qa(b)&&!$&&!D,S=h?b:Xa(m(f)??"");Ka(f).change(E=>{h||S.set(m(E)??"")});let V=E=>{let G=E?.target?.value??"";G!==f.get()&&(S.set(G),$?.(E),D?.(E))},A=ke(w),Q=A?_a:Ga,se=s(p,A&&"g-ui-textarea"),te=Q({...l,node:z,value:S,onInput:V,onChange:V,onFocus:C,onBlur:P,onKeyDown:L,onKeyUp:y,onClick:k,className:s("g-ui-input",se)});return ii({className:s("g-ui-text-input",d)},ti(r,()=>Za({className:"g-ui-text-input-label"},r)),ti(a,()=>Ua({className:"g-ui-text-input-description"},a)),ii({className:s("g-ui-input-wrapper",U("g-ui-input-multiline",w),N("g-ui-input-size-",n,"md"),U("g-ui-input-error",o))},ti(u,()=>ii({className:"g-ui-input-section"},u)),te,ti(c,()=>ii({className:"g-ui-input-section"},c))),ti(o,()=>ii({className:"g-ui-text-input-error-text"},o)))}function Ki(...e){let{props:i}=g(e,{size:"md"}),{size:t,leftSection:r,rightSection:a,className:o,...n}=i;return be({...n,size:t,className:o,leftSection:r,rightSection:a,multiline:!0})}import{Div as Ut,Span as Xt,after as je,state as Ja}from"@granularjs/core";function Qi(...e){let{props:i,rawProps:t}=g(e,{size:"md",step:1,allowDecimal:!0,allowNegative:!0,clampBehavior:"blur",hideControls:!1,decimalSeparator:".",thousandSeparator:"",format:null,prefix:"",suffix:""}),{value:r,min:a,max:o,step:n,size:u,allowDecimal:c,allowNegative:d,decimalSeparator:p,thousandSeparator:w,decimalScale:f,clampBehavior:l,hideControls:b,format:z,locale:$,currency:D,formatOptions:C,prefix:P,suffix:L,leftSection:y,rightSection:k,className:h,onChange:S,onInput:V,...A}=i,{onChange:Q,onInput:se,onBlur:te,onFocus:E,onKeyDown:G}=t,J=I=>{Q?.(I.target?.value??""),se?.(I.target?.value??"")},re=J,X=Ja(""),M=I=>String(I??"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),j=()=>{if(!!!m(c))return 0;let T=m(f);if(T!=null&&T!==""&&Number.isFinite(Number(T)))return Math.max(0,Number(T));let O=m(z);return O==="currency"||O==="percent"?2:0},x=I=>{let T=m(p)??".",O=m(w)??"",_=String(I??"");if(O&&(_=_.split(O).join("")),!_||_==="-"||_===T||_.endsWith(T))return null;let ae=_.replace(T,"."),ee=Number(ae);return Number.isFinite(ee)?ee:null},B=I=>{let T=m(w)??"";return T?I.replace(/\B(?=(\d{3})+(?!\d))/g,T):I},R=I=>{let T=m(p)??".",O=j(),_=Number(I);if(!Number.isFinite(_))return"";let ae=_<0?"-":"",ee=Math.abs(_),[K,ie=""]=String(ee).split("."),le=B(K);if(O>0){let xe=ie.slice(0,O).padEnd(O,"0");return`${ae}${le}${T}${xe}`}return`${ae}${le}`},q=(I,T)=>{try{let O=m($),_=m(D)??"USD",ae=m(C)??{},ee=j(),K=T==="currency"?"currency":"decimal";return new Intl.NumberFormat(O,{style:K,currency:_,...ee>0?{minimumFractionDigits:ee,maximumFractionDigits:ee}:{maximumFractionDigits:0},...ae}).format(I)}catch{return R(I)}},Y=I=>{let T=I,O=m(a),_=m(o);return O!=null&&Number.isFinite(Number(O))&&(T=Math.max(T,Number(O))),_!=null&&Number.isFinite(Number(_))&&(T=Math.min(T,Number(_))),!m(d)&&T<0&&(T=0),T},oe=()=>{let I=m(L)??"",T=m(z);return!I&&T==="percent"?"%":I},ve=(I,T,O)=>{let _=m(P)??"",ae=oe(),ee=String(I??"").replace(/\u00A0/g," "),K=String(_??"").replace(/\u00A0/g," "),ie=String(ae??"").replace(/\u00A0/g," "),le=K&&ee.startsWith(K),xe=ie&&ee.endsWith(ie);return`${T??""}${le?"":_}${I}${xe?"":ae}`},ze=(I,T)=>{let O=j(),_=m(p)??".",ee=String(I??"").replace(/\D/g,"")||"0",K=O>0?ee.padStart(O+1,"0"):ee,le=(O>0?K.slice(0,-O):K).replace(/^0+(?=\d)/,"")||"0",xe=O>0?K.slice(-O):"",Ae=O>0?`${le}${_}${xe}`:le;return`${T??""}${Ae}`},Pe=I=>{let T=m(P)??"",O=oe(),_=String(I??""),ae=String(T??"").replace(/\u00A0/g," "),ee=String(O??"").replace(/\u00A0/g," ");return ae&&_.replace(/\u00A0/g," ").startsWith(ae)&&(_=_.slice(T.length)),ee&&_.replace(/\u00A0/g," ").endsWith(ee)&&(_=_.slice(0,-O.length)),_},_e=I=>{let T=!!m(d),O=Pe(I),_=T&&O.includes("-")?"-":"",ae=O.replace(/\D/g,""),ee=ze(ae,_);if(m(l)==="strict"){let K=x(ee);if(K!=null){let ie=Y(K);ee=`${ie<0?"-":""}${R(Math.abs(ie))}`}}return ee},Ze=I=>{if(I==null||I==="")return ze("","");if(typeof I=="number"&&Number.isFinite(I)){let ie=m(l)==="strict"?Y(I):I;return`${ie<0?"-":""}${R(Math.abs(ie))}`}let T=Pe(I),O=m(p)??".",ae=!!m(d)&&String(T).includes("-")?"-":"",ee=String(T??"").replace(new RegExp(`[^0-9${M(O)}]`,"g"),""),K=x(`${ae}${ee}`);if(K!=null){let ie=m(l)==="strict"?Y(K):K;return`${ie<0?"-":""}${R(Math.abs(ie))}`}return _e(I)},Me,ei=I=>{let T=m(I);if(T===void 0)return;let O=Ze(T);O!==X.get()&&(Me=O,X.set(O))};ei(r),je(r).change(I=>{ei(I)}),je(X).change(I=>{if(I===Me){Me=void 0;return}Me=void 0;let T=x(I);if(T==null){J?.(I??"");return}J?.(T)});let Ri=je(k).compute(I=>I!=null&&I!==!1),Hi=je(b,Ri).compute(([I,T])=>!m(I)&&!T),vi=je(c).compute(I=>m(I)?"decimal":"numeric"),Wi=je(z,P,L,c,d,p,w,f,l,a,o,$,D,C).compute(()=>({mode:"both",format:I=>{let T=_e(I),O=m(z),ae=!!m(d)&&T.startsWith("-")?"-":"",ee=x(T),K=T.replace(ae,"");if(ee!=null){let ie=Math.abs(ee);if(typeof O=="function")try{K=O(ie)}catch{K=R(ie)}else if(O==="currency")K=q(ie,"currency");else if(O==="decimal"){let le=m($),xe=m(C);K=le||xe?q(ie,"decimal"):R(ie)}else K=R(ie)}return{value:T,raw:T,visual:ve(K,ae,O)}}})),v=I=>{let T=x(X.get()),O=Number(m(n)??1),ae=Y((T??0)+O*I);X.set(R(ae))},H=I=>{if(!I||typeof I.setSelectionRange!="function")return;let T=()=>{try{let O=String(I.value??"").length;I.setSelectionRange(O,O)}catch{}};typeof requestAnimationFrame=="function"?requestAnimationFrame(T):T()},ce=I=>{re?.(I);let T=I?.target;T&&H(T)},Z=I=>{if(te?.(I),m(l)!=="blur")return;let T=x(X.get());if(T==null)return;let O=Y(T);X.set(R(O))},ge=I=>{E?.(I),H(I?.target)},fe=I=>{G?.(I);let T=I?.target;if(!T)return;let O=m(P)??"",_=oe();_&&typeof T.selectionEnd=="number"&&(T.selectionEnd=Math.min(T.selectionEnd,String(T.value??"").length-_.length)),O&&typeof T.selectionStart=="number"&&(T.selectionStart=Math.max(T.selectionStart,O.length))},ue=Ut({className:"g-ui-number-field-controls"},Xt({className:"g-ui-number-field-control",onClick:()=>v(1)},"+"),Xt({className:"g-ui-number-field-control",onClick:()=>v(-1)},"\u2212")),Te=Ut({className:"g-ui-number-field-controls-wrapper"},ue),Ve=je(Hi,k).compute(([I,T])=>I?Te:T);return be({...A,size:u,className:s("g-ui-number-field",h),leftSection:y,rightSection:Ve,type:"text",inputMode:vi,inputClassName:s("g-ui-input-number"),value:X,format:Wi,onInput:ce,onBlur:Z,onFocus:ge,onKeyDown:fe})}function eo(...e){return Qi(...e)}import{Div as ki,Button as io,portal as to,when as Ji,after as ro}from"@granularjs/core";var xi='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>',wi='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>',yi='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M379.33-244 154-469.33 201.67-517l177.66 177.67 378.34-378.34L805.33-670l-426 426Z"/></svg>',Kt='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M240-446.67v-66.66h480v66.66H240Z"/></svg>',Be='<svg xmlns="http://www.w3.org/2000/svg" height="40px" viewBox="0 -960 960 960" width="40px" fill="#1f1f1f"><path d="M312-265.33 265.33-312l168-168-168-167L312-693.67l168 168 167-168L693.67-647l-168 167 168 168L647-265.33l-167-168-168 168Z"/></svg>',Qt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>',Jt='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg>',er='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h357l-80 80H200v560h560v-278l80-80v358q0 33-23.5 56.5T760-120H200Zm280-360v-80h240v80H480Zm0 160v-80h320v80H480Zm0 160v-80h320v80H480ZM360-360v-80h80v80h-80Zm0 160v-80h80v80h-80Zm0 160v-80h80v80h-80Zm160-320h280l-36-37 37-37v74H520Zm-160 0h80v-80h-80v80ZM120-600v-160l160-160h160l-80 80H200v240h-80Zm80-240v-80 80Z"/></svg>',ir='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"/></svg>',tr='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Z"/></svg>',rr='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"/></svg>';function ri(...e){let{props:i,rawProps:t,children:r}=g(e,{size:"md",centered:!0,overlay:"normal"}),{opened:a,title:o,size:n,centered:u,overlay:c,position:d,className:p,style:w}=i,{onClose:f}=t,l=ro(d,u).compute(([b,z])=>`g-ui-modal-position-${b??(z===!1?"top-center":"center")}`);return Ji(a,()=>to(ki({className:s("g-ui-modal-overlay",N("g-ui-modal-overlay-",c,"normal"),l),onClick:b=>{b.target===b.currentTarget&&f?.()}},ki({className:s("g-ui-modal",N("g-ui-modal-size-",n,"md"),p)},ki({className:"g-ui-modal-header"},Ji(o,()=>ki({className:"g-ui-modal-title"},o)),Ji(f,()=>io({type:"button",className:"g-ui-button g-ui-button-variant-subtle g-ui-button-size-xs g-ui-modal-close",onClick:f,innerHTML:Be}))),r))))}import{Div as zi,Span as et,after as ar,when as or}from"@granularjs/core";function ai(...e){let{props:i}=g(e,{variant:"spinner",size:"md"}),{variant:t,size:r,className:a}=i,o=ar(t).compute(u=>u==="dots"),n=ar(t).compute(u=>u==="bars");return or(o,()=>zi({className:s("g-ui-loading g-ui-dots",N("g-ui-loading-size-",r,"md"),a)}),()=>or(n,()=>zi({className:s("g-ui-loading g-ui-bars",N("g-ui-loading-size-",r,"md"),a)},et(""),et(""),et("")),()=>zi({className:s("g-ui-loading",N("g-ui-loading-size-",r,"md"),a)},zi({className:"g-ui-spinner"}))))}import{Div as it,Input as ao,Label as oo,Span as nr,when as tt,state as no,after as so}from"@granularjs/core";function rt(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{checked:r,label:a,description:o,size:n,indeterminate:u,className:c,style:d,inputProps:p,...w}=i,{onChange:f}=t,l=no(ke(r));so(r).change(z=>{z!=null&&(l.set(!!z),f?.(z))});let b=oo({className:"g-ui-checkbox-control"},ao({type:"checkbox",indeterminate:u,checked:l,className:s("g-ui-checkbox-input",N("g-ui-checkbox-size-",n,"md"),p?.className),...w}),tt(l,()=>it({className:"g-ui-checkbox-checked",innerHTML:yi}),()=>{if(!l.get()&&u.get())return it({className:"g-ui-checkbox-indeterminate",innerHTML:Kt})}),tt(a,()=>nr({className:"g-ui-checkbox-label"},a)));return it({className:s("g-ui-checkbox",N("g-ui-checkbox-size-",n,"md"),c)},b,tt(o,()=>nr({className:"g-ui-checkbox-description"},o)))}import{Input as co,Label as po,Span as mo,when as fo,after as ot,state as ho}from"@granularjs/core";import{Div as uo,context as go,after as sr}from"@granularjs/core";var at=go({name:null,selected:null});function lo(...e){let{props:i,rawProps:t,children:r}=g(e),{className:a,name:o,selected:n,onChange:u,...c}=i,{onChange:d}=t,p=at.scope({name:o?.get(),selected:n?.get()});return sr(p.selected).change(w=>{d?.(w)}),sr(n).change(w=>{w!==p.selected.get()&&(p.set().selected=w)}),p.serve(uo({...c,className:s("g-ui-switch-group",a)},r))}function vo(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{label:r,size:a,className:o,style:n,inputProps:u,checked:c,value:d,...p}=i,{onChange:w}=t,f=ho(c),l=at.state(),b=ot(l).compute(z=>({name:z.name,type:z.name?"radio":"checkbox"}));return ot(l.selected).change(z=>{f.set(z===d.get())}),ot(f).change(z=>{if(w?.(z),!z)return;let $=l.get().selected;l.set().selected=d.get()}),po({className:s("g-ui-switch",N("g-ui-switch-size-",a,"md"),o)},co({type:b.type,name:b.name,value:d,checked:f,className:s("g-ui-switch-input",N("g-ui-switch-size-",a,"md"),u?.className),...p}),fo(r,()=>mo({className:"g-ui-switch-label"},r)))}import{Div as Re,Span as ur,when as nt,state as gr,after as Ni}from"@granularjs/core";import{Span as bo}from"@granularjs/core";function ye(...e){let{props:i,children:t}=g(e,{size:"md"});return bo({...i,className:s("g-ui-icon",N("g-ui-icon-size-",i.size,"md"),N("g-ui-icon-color-",i.color),i.className)},...t)}function xo(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"md"}),{data:r,value:a,size:o,leftSection:n,rightSection:u,placeholder:c,className:d,...p}=i,{onChange:w}=t,f=gr(!1),l=gr(m(a)??"");Ni(a).change(D=>{let C=m(D);C!==void 0&&l.set(C??"")});let b=D=>{l.set(D),w?.(D),f.set(!1)},z=Ni(l).compute(D=>D?"":"g-ui-select-placeholder"),$=Ni(l).compute(D=>{let P=(m(r)??[]).find(L=>L.value===D);return D?P?.label??"":c??""});return Re({...p,className:s("g-ui-select-root",d)},Re({className:s("g-ui-input-wrapper",N("g-ui-input-size-",o,"md"))},nt(n,()=>Re({className:"g-ui-input-section"},n)),Re({className:s("g-ui-select",z),onClick:()=>f.set(!f.get())},ur({className:"g-ui-select-value"},$)),nt(u,()=>Re({className:"g-ui-input-section"},u),()=>ur({className:"g-ui-select-caret"},ye({innerHTML:rr})))),nt(f,()=>Re({className:"g-ui-select-dropdown"},(m(r)??[]).map(D=>Re({className:s("g-ui-select-item",Ni(l).compute(C=>C===D.value?"g-ui-select-item-active":"")),onClick:()=>b(D.value)},D.label)))))}import{Button as wo,Div as Ue,state as Le,after as oi,list as yo,when as ko}from"@granularjs/core";function zo(...e){let{props:i,rawProps:t}=g(e,{tabs:[],orientation:"horizontal",variant:"default",sticky:!0}),{value:r,tabs:a,orientation:o,variant:n,sticky:u,className:c,style:d}=i,{onChange:p}=t,w=Le(m(r)??m(a)?.[0]?.value??""),f=Le(),l=Le(),b=Le(0),z=Le(0),$=Le(0),D=Le(0),C=Le(!1),P=Le(0),L=!1,y=null,k=!1,h=new Set;oi(r).change(x=>{let B=m(x);B!=null&&w.set(B)});let S=x=>{w.set(x),p?.(x)},V=x=>{let B=[],R=x?.parentElement;for(;R;){let q=getComputedStyle(R),Y=`${q.overflow}${q.overflowY}${q.overflowX}`;/(auto|scroll)/.test(Y)&&B.push(R),R=R.parentElement}return B},A=x=>V(x)[0]??null,Q=x=>x?x.getBoundingClientRect().top:0,se=x=>x?x.scrollTop:window.scrollY||window.pageYOffset||0,te=(x,B)=>x>B?"down":x<B?"up":"none",E=(x,B,R,q)=>x==="down"&&B<R?!0:x==="up"&&B>=R?!1:q,G=()=>{let x=f.get(),B=l.get();if(!x||!B)return;if(!ke(u)){C.set(!1),b.set(0);return}if(typeof window>"u")return;let R=x.getBoundingClientRect(),q=B.getBoundingClientRect(),Y=A(x),oe=Q(Y),ve=se(Y),ze=te(ve,P.get());P.set(ve);let Pe=E(ze,R.top,oe,C.get());b.set(q.height),z.set(R.left),$.set(R.width),D.set(oe),Pe!==C.get()&&C.set(Pe)},J=()=>{y==null&&(y=requestAnimationFrame(()=>{y=null,G()}))},re=x=>{!x||h.has(x)||(h.add(x),x.addEventListener("scroll",J,{passive:!0}))},X=()=>{if(L)return;let x=f.get(),B=l.get();!x||!B||typeof window>"u"||(L=!0,G(),re(window),window.addEventListener("resize",J),V(x).forEach(re))};oi(l,f,u).change(X),!k&&typeof window<"u"&&(k=!0,setTimeout(()=>X(),0));let M=oi(C,z,$,D).compute(x=>{let[B,R,q,Y]=x;return B?{position:"fixed",top:`${Y}px`,left:`${R}px`,width:`${q}px`,background:"var(--g-ui-surface)",zIndex:100}:{position:"static",top:"auto",left:"auto",width:"auto",zIndex:"auto",background:"transparent"}}),j=oi(C,b).compute(x=>{let[B,R]=x;return{height:B?`${R}px`:"0px"}});return Ue(Ue({className:s("g-ui-tabs",he(o,{vertical:"g-ui-tabs-vertical"}),N("g-ui-tabs-variant-",n,"default"),i.className??c)},Ue({node:f}),Ue({style:j}),Ue({node:l,className:"g-ui-tabs-list",style:M},yo(a,x=>wo({className:oi(w,x.value).compute(([B,R])=>s("g-ui-tabs-tab",R===B&&"g-ui-tabs-tab-active")),onClick:()=>S(x.get().value)},x.label))),Ue({className:"g-ui-tabs-panel"},ko(w,()=>a.get()?.find(x=>x.value===w.get())?.content??null))))}import{Table as No,Thead as Co,Tbody as So,Tr as Do,Th as Po,Td as Mo,list as cr,when as pr,after as st}from"@granularjs/core";function To(...e){let{props:i}=g(e,{headers:[],rows:[]}),{headers:t,rows:r,striped:a,highlightOnHover:o,withBorder:n,withColumnBorders:u,withRowBorders:c,className:d,style:p,...w}=i,f=st(t).compute(l=>l.length>0);return No({...w,className:s("g-ui-table",U("g-ui-table-striped",a),U("g-ui-table-hover",o),U("g-ui-table-with-border",n),U("g-ui-table-column-borders",u),U("g-ui-table-row-borders",c),d)},pr(f,()=>Co(lr(t,!0))),So(cr(r,l=>lr(l,!1))))}var lr=(e,i)=>{let t=st(e).compute(o=>Array.isArray(o)),r=o=>{let n=st(o).compute(u=>Object.values(u));return a(n)},a=o=>cr(o,n=>i?Lo(n):Vo(n));return Do(pr(t,()=>a(e),()=>r(e)))},Vo=e=>Mo(e),Lo=e=>Po(e);import{Div as ut}from"@granularjs/core";import{state as Io,when as $o,after as Ao}from"@granularjs/core";function Bo(...e){let{props:i,children:t}=g(e,{opened:!1}),{opened:r,className:a,...o}=i,n=Io(ke(r));Ao(r).change(p=>{n.set(ke(p))});let u=()=>{n.set(!n.get())},c=t[0],d=t[1];return ut({...o,className:s("g-ui-accordion",a)},ut({className:"g-ui-accordion-header",onClick:u},c),$o(n,()=>ut({className:"g-ui-accordion-content"},d)))}import{Span as dr}from"@granularjs/core";function Fo(...e){let{props:i,children:t}=g(e),{label:r,className:a,style:o}=i;return dr({className:s("g-ui-tooltip",a)},t,dr({className:"g-ui-tooltip-content"},r))}import{Div as ni,when as Eo,after as jo,state as si,portal as Ro}from"@granularjs/core";var gt=si({currentOpenState:null});function Ho(...e){let i=si(),t=si(),r=si({}),{props:a,rawProps:o,children:n}=g(e,{position:"right"}),{opened:u,content:c,position:d,className:p,...w}=a,{onChange:f}=o,l=si(m(u)??!1);jo(u).change(L=>{let y=m(L);y!=null&&(l.set(!!y),y&&b())});let b=()=>{gt.get().currentOpenState!==l&&(gt.get().currentOpenState?.set(!1),gt.set().currentOpenState=l)};u.get()&&b();let z=L=>{let k=String(L??"right").toLowerCase().split("-").filter(Boolean);if(k.length===1){let V=k[0];return V==="top"||V==="bottom"?{placement:V,align:"center"}:V==="left"||V==="right"?{placement:"bottom",align:V}:V==="center"?{placement:"bottom",align:"center"}:{placement:"bottom",align:"right"}}let[h,S]=k;return h==="top"||h==="bottom"?{placement:h,align:S||"center"}:h==="left"||h==="right"?{placement:h,align:S||"center"}:{placement:"bottom",align:"right"}},$=()=>{let L=i.get(),y=t.get();if(!L||!y||typeof window>"u")return;let k=L.getBoundingClientRect(),h=y.getBoundingClientRect(),S=m(d)??"right",V=getComputedStyle(document.documentElement).getPropertyValue("--g-ui-space-20"),A=Number.parseFloat(V)||20,Q=window.innerWidth||0,se=window.innerHeight||0,te=Math.max(A,Q-h.width-A),E=Math.max(A,se-h.height-A),{placement:G,align:J}=z(S),re=8,X=k.bottom+re,M=k.left;G==="top"||G==="bottom"?(X=G==="top"?k.top-h.height-re:k.bottom+re,J==="center"?M=k.left+k.width/2-h.width/2:J==="right"?M=k.right-h.width:M=k.left):(G==="left"||G==="right")&&(M=G==="left"?k.left-h.width-re:k.right+re,J==="center"?X=k.top+k.height/2-h.height/2:J==="bottom"?X=k.bottom-h.height:X=k.top),M=Math.max(A,Math.min(M,te)),X=Math.max(A,Math.min(X,E)),r.set({top:`${X}px`,left:`${M}px`})},D=L=>{l.set(L),f?.(L),L&&(b(),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>$()):setTimeout(()=>$(),0))},C=()=>D(!l.get()),P=()=>D(!1);return ni({...w,node:i,className:s("g-ui-menu",p)},ni({onClick:C},n),Eo(l,()=>Ro(ni(ni({className:"g-ui-menu-overlay",onClick:P}),ni({className:"g-ui-menu-dropdown",node:t,style:r},c)))))}import{Div as mr,portal as Wo,when as Oo}from"@granularjs/core";function qo(...e){let{props:i,children:t}=g(e,{position:"right",size:"md",overlay:"normal",shadowed:!0}),{opened:r,onClose:a,position:o,size:n,overlay:u,shadowed:c,className:d,style:p}=i;return Oo(r,()=>Wo(mr({className:s("g-ui-drawer-overlay",N("g-ui-drawer-overlay-",u,"normal")),onClick:a},mr({className:s("g-ui-drawer",he(c,{true:"g-ui-drawer-shadowed"},!0),N("g-ui-drawer-",o,"right"),N("g-ui-drawer-size-",n,"md"),d),onClick:w=>w.stopPropagation()},t))))}import{Button as Yo,Div as lt,Span as fr,when as Ci,after as hr}from"@granularjs/core";function ct(...e){let{props:i,rawProps:t,children:r}=g(e,{color:"blue",withCloseButton:!0}),{title:a,color:o,icon:n,loading:u,withCloseButton:c,withBorder:d,className:p,style:w}=i,{onClose:f}=t,l=hr(n,u).compute(([z,$])=>!z&&!!$),b=hr(n,u).compute(([z,$])=>!!z||!!$);return lt({className:s("g-ui-notification",[d,"g-ui-notification-bordered"],[o,z=>`g-ui-notification-${z}`],[b,"g-ui-notification-with-icon"],p)},Ci(n,()=>fr({className:"g-ui-notification-icon"},n)),Ci(l,()=>ai({size:"sm",className:"g-ui-notification-loader"})),lt({className:"g-ui-notification-body"},Ci(a,()=>lt({className:"g-ui-notification-title"},a)),r),Ci(c,()=>Yo({type:"button",className:"g-ui-notification-close",onClick:()=>f?.()},fr({innerHTML:Be}))))}import{Div as Go,when as _o}from"@granularjs/core";function Zo(...e){let{props:i}=g(e,{labelPosition:"center"}),{label:t,labelPosition:r,vertical:a,className:o,...n}=i;return Go({...n,className:s("g-ui-divider",U("label",t),N("g-ui-divider-label-",r,"center"),U("g-ui-divider-vertical",a),o)},_o(t,()=>Ui({className:"g-ui-divider-label-text",size:"sm"},t)))}import{Div as Uo}from"@granularjs/core";function Xo(...e){let{props:i,children:t}=g(e,{padding:"md",radius:"md",shadow:"none"}),{padding:r,radius:a,shadow:o,className:n,...u}=i;return Uo({...u,className:s("g-ui-paper",[r,c=>`g-ui-card-padding-${c}`],[a,c=>`g-ui-card-radius-${c}`],[o,c=>`g-ui-card-shadow-${c}`],n)},t)}import{Button as Ko,Div as pt,Span as Qo,after as vr,when as dt}from"@granularjs/core";function Jo(...e){let{props:i,rawProps:t,children:r}=g(e,{color:"blue"}),{title:a,color:o,icon:n,withCloseButton:u,className:c,...d}=i,{onClose:p}=t,w=vr(a,u).compute(([l,b])=>l||b),f=vr(n).compute(l=>l!==void 0);return pt({...d,className:s("g-ui-alert",[o,l=>`g-ui-alert-${l}`],c)},pt({className:"g-ui-alert-header"},dt(n,()=>Qo({className:"g-ui-alert-icon"},n)),dt(a,()=>pt({className:"g-ui-alert-title"},a)),dt(u,()=>Ko({type:"button",className:"g-ui-alert-close",onClick:()=>p?.()},"\xD7"))),r)}import{Div as en,Img as tn,when as rn}from"@granularjs/core";function an(...e){let{props:i,children:t}=g(e,{size:"md",alt:""}),{src:r,size:a,alt:o,className:n,...u}=i;return en({...u,className:s("g-ui-avatar",[a,c=>`g-ui-avatar-size-${c}`],n)},rn(r,()=>tn({className:"g-ui-avatar-img",src:r,alt:o}),()=>t))}import{Span as on}from"@granularjs/core";function nn(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return on({...a,className:s("g-ui-kbd",r)},t)}import{Code as sn}from"@granularjs/core";function un(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return sn({...a,className:s("g-ui-code",r)},t)}import{Blockquote as gn}from"@granularjs/core";function ln(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return gn({...a,className:s("g-ui-blockquote",r)},t)}import{Div as cn}from"@granularjs/core";function pn(...e){let{props:i,children:t}=g(e,{cols:3,gap:"md"}),{cols:r,gap:a,className:o,...n}=i;return cn({...n,className:s("g-ui-grid",[a,u=>`g-ui-gap-${u}`],[r,u=>`g-ui-grid-cols-${u}`],o)},t)}import{Ul as dn,Ol as mn,Li as mt,Div as Si,Span as ft,after as ht,when as He,isSignal as fn,isState as hn,isStatePath as vn,isComputed as bn}from"@granularjs/core";function br(...e){let{props:i,children:t}=g(e,{type:"none",size:"md"}),{type:r,size:a,withPadding:o,className:n,...u}=i,c=he(r,{ordered:"g-ui-list-ordered",unordered:"g-ui-list-unordered",none:"g-ui-list-none"}),d=ht(r).compute(z=>z==="ordered"),p=z=>z&&typeof z=="object"&&typeof z.tagName=="string"&&(z.tagName.toLowerCase()==="ul"||z.tagName.toLowerCase()==="ol"),w=z=>z&&typeof z=="object"&&typeof z.tagName=="string"&&z.tagName.toLowerCase()==="li",f=z=>{let $=D=>D?.nodeType==="granular-list-node"?D:D==null||D===!1?null:Array.isArray(D)?D.map(C=>$(C)):w(D)?D:p(D)?mt({className:"g-ui-list-nested-item"},D):mt(ft({className:"g-ui-list-item-shell"},D));return fn(z)||hn(z)||vn(z)||bn(z)?ht(z).compute(D=>$(D)):$(z)},l=He(t,()=>t.map(z=>f(z))),b={...u,className:s("g-ui-list",N("g-ui-list-size-",a,"md"),U("g-ui-list-with-padding",o),c,n)};return He(d,()=>mn(b,l),()=>dn(b,l))}function xn(...e){let{props:i,children:t}=g(e,{withBorder:!1}),{leftSection:r,rightSection:a,title:o,body:n,withBorder:u,className:c,verticalPadding:d,horizontalPadding:p,...w}=i,f=ht(o,n).compute(([l,b])=>!!l||!!b);return mt({...w,className:s("g-ui-list-item",U("g-ui-list-item-border",u),N("g-ui-list-item-vertical-padding-",d,"md"),N("g-ui-list-item-horizontal-padding-",p,"md"),c)},Si({className:"g-ui-list-item-shell"},He(r,()=>ft({className:"g-ui-list-item-section g-ui-list-item-section-left"},r)),He(f,()=>Si({className:"g-ui-list-item-content"},He(o,()=>Si({className:"g-ui-list-item-title"},o)),He(n,()=>Si({className:"g-ui-list-item-body"},n))),()=>t),He(a,()=>ft({className:"g-ui-list-item-section g-ui-list-item-section-right"},a))))}br.Item=xn;import{A as wn}from"@granularjs/core";function yn(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return wn({...a,className:s("g-ui-anchor",r)},t)}import{Img as kn}from"@granularjs/core";function zn(...e){let{props:i}=g(e),{className:t,...r}=i;return kn({...r,className:s("g-ui-image",t)})}import{Div as xr}from"@granularjs/core";function Nn(...e){let{props:i}=g(e,{value:0,color:"primary",size:"md"}),{value:t,color:r,size:a,className:o,...n}=i;return xr({...n,className:s("g-ui-progress",N("g-ui-progress-size-",a,"md"),[t,u=>{let c=Math.max(0,Math.min(100,Number(u)||0));return`g-ui-progress-${Math.round(c/5)*5}`}],[r,u=>u?`g-ui-progress-${u}`:""],o)},xr({className:"g-ui-progress-bar"}))}import{Div as Fe,after as We,state as Cn,when as wr,list as Sn}from"@granularjs/core";function Dn(...e){let{props:i,rawProps:t}=g(e,{size:"md",min:0,max:100,step:1}),{onChange:r}=t,{value:a,marks:o,size:n,min:u,max:c,step:d,disabled:p,className:w,...f}=i,l=Cn(m(a??u)),b=We(o).compute(y=>y&&y.length>0);We(a).change(y=>{y!=null&&l.set(m(y))});let z=()=>{let y=Number(m(u)),k=Number(m(c));return!Number.isFinite(y)||!Number.isFinite(k)?{minValue:0,maxValue:100}:{minValue:Math.min(y,k),maxValue:Math.max(y,k)}},$=()=>{let y=Number(m(d));return Number.isFinite(y)&&y>0?y:1},D=y=>{let{minValue:k,maxValue:h}=z(),S=$(),V=Math.max(k,Math.min(h,Number(y))),A=Math.round((V-k)/S)*S+k;A!==l.get()&&(l.set(A),r?.(A))},C=We(l).compute(y=>{let{minValue:k,maxValue:h}=z(),S=h-k;if(S<=0)return 0;let V=(Number(y??k)-k)/S*100;return Math.max(0,Math.min(100,V))}),P=(y,k)=>{let h=k?.();if(!h||h.width===0)return;let V=Math.min(Math.max(y.clientX-h.left,0),h.width)/h.width,{minValue:A,maxValue:Q}=z();D(A+V*(Q-A))},L=y=>{if(ke(p))return;y.preventDefault?.();let k=y.currentTarget,h=()=>k.getBoundingClientRect();k.setPointerCapture?.(y.pointerId),P(y,h);let S=A=>P(A,h),V=()=>{k.releasePointerCapture?.(y.pointerId),window.removeEventListener("pointermove",S),window.removeEventListener("pointerup",V)};window.addEventListener("pointermove",S),window.addEventListener("pointerup",V)};return Fe({...f,className:s("g-ui-slider",N("g-ui-slider-size-",n,"md"),U("g-ui-slider-disabled",p),w)},Fe({className:"g-ui-slider-track",onPointerDown:L},Fe({className:"g-ui-slider-bar",style:We(C).compute(y=>({width:`${y}%`}))}),Fe({className:"g-ui-slider-thumb",style:We(C).compute(y=>({left:`${y}%`}))})),wr(b,()=>Fe({className:"g-ui-slider-marks-placeholder"})),wr(o,()=>Fe({className:"g-ui-slider-marks"},Sn(o,y=>vt({mark:y,getBounds:z})))))}var vt=({mark:e,getBounds:i})=>{let{minValue:t,maxValue:r}=i(),a=r-t,o=We(e).compute(d=>d.value??d),n=We(e).compute(d=>d.label??String(d.value)??o),u=Number(o),c=0;return a>0&&(c=(u-t)/a*100),Fe({className:"g-ui-slider-mark",style:{left:`${Math.max(0,Math.min(100,c))}%`}},Fe({className:"g-ui-slider-mark-label"},n))};import{Div as Pn,after as Mn}from"@granularjs/core";function Tn(...e){let{props:i}=g(e,{height:"md",width:"full"}),{height:t,width:r,className:a,...o}=i,n=Mn(t,r).compute(([u,c])=>{let d={};return isNaN(u)||(d.height=`${u}px`),isNaN(c)||(d.width=`${c}px`),d});return Pn({...o,style:{width:n.width,height:n.height,...o.style||{}},className:s("g-ui-skeleton",[t,u=>`g-ui-skeleton-h-${u}`],[r,u=>`g-ui-skeleton-w-${u}`],a)})}import{Button as Vn,after as yr,state as Ln}from"@granularjs/core";function In(...e){let{props:i,rawProps:t,children:r}=g(e,{size:"md",variant:"filled",color:"primary"}),{checked:a,size:o,variant:n,color:u,className:c,...d}=i,{onChange:p}=t,w=Ln(!!a);yr(a).change(l=>{l!=null&&w.set(!!l)});let f=l=>{w.set(l),p?.(l)};return Vn({...d,type:"button",className:s("g-ui-chip",N("g-ui-chip-size-",o,"md"),N("g-ui-chip-variant-",n,"filled"),N("g-ui-chip-color-",u,"primary"),yr(w).compute(l=>l?"g-ui-chip-active":""),c),onClick:()=>f(!w.get())},r)}import{Div as bt,after as kr,state as $n,list as An}from"@granularjs/core";function Bn(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"sm"}),{value:r,data:a,size:o,scroll:n,className:u,...c}=i,{onChange:d}=t,p=$n(m(r));kr(r).change(f=>{let l=m(f);l!=null&&p.set(l)});let w=f=>{p.set(f),d?.(f)};return bt({...c,className:s(n&&"g-ui-segmented-scroll")},bt({className:s("g-ui-segmented",N("g-ui-segmented-size-",o,"sm"),u)},An(a,(f=>bt({className:s("g-ui-segmented-item",kr(p).compute(l=>f.get().value===l?"g-ui-segmented-active":"")),onClick:()=>w(f.get().value)},f.label)))))}import{Button as xt,Div as Fn,state as En,after as Di}from"@granularjs/core";function jn(...e){let{props:i,rawProps:t}=g(e,{total:1,size:"md"}),{page:r,total:a,size:o,className:n,...u}=i,{onChange:c}=t,d=En(m(r)??1);Di(r).change(l=>{let b=m(l);b!=null&&d.set(b)});let p=l=>{let b=Number(m(a))||1,z=Math.max(1,Math.min(b,l));d.set(z),c?.(z)},w=[],f=Number(m(a))||1;for(let l=1;l<=f;l+=1)w.push(l);return Fn({...u,className:s("g-ui-pagination",N("g-ui-pagination-size-",o,"md"),i.className??n)},xt({className:"g-ui-pagination-item",onClick:()=>p((d.get?.()??d)-1),disabled:Di(d).compute(l=>l<=1)},"<"),w.map(l=>xt({className:Di(d).compute(b=>s("g-ui-pagination-item",l===b&&"g-ui-pagination-item-active")),onClick:()=>p(l)},String(l))),xt({className:"g-ui-pagination-item",onClick:()=>p((d.get?.()??d)+1),disabled:Di(d).compute(l=>l>=a)},">"))}import{Div as On,Input as qn,Label as Yn,Span as zr,when as Nr,after as kt,state as Gn}from"@granularjs/core";import{Div as Rn,context as Hn,after as wt}from"@granularjs/core";var yt=Hn({name:"",selected:null});function Wn(...e){let{props:i,children:t,rawProps:r}=g(e),{className:a,name:o,selected:n,onChange:u,...c}=i,{onChange:d}=r,p=yt.scope({name:o?.get(),selected:n?.get()});return console.log("selected?.get()",n?.get()),wt(o).change(w=>{p.set().name=w}),wt(n).change(w=>{w!==p.selected.get()&&(p.set().selected=w)}),wt(p.selected).change(w=>{d?.(w)}),p.serve(Rn({...c,className:s("g-ui-stack g-ui-gap-sm",a)},t))}function _n(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{label:r,name:a,value:o,checked:n,description:u,size:c,className:d,inputProps:p,...w}=i,{onChange:f}=t,l=Gn(n?.get()??!1),b=yt.state(),z=kt(b.name,a).compute(([D,C])=>D||C);kt(n,b.selected).change(D=>{let[C,P]=D;b.get().name?l.set(P===o.get()):l.set(C)}),kt(l).change(D=>{f?.(D),D&&b.get().name&&(b.set().selected=o.get())});let $=Yn({className:"g-ui-radio-control"},qn({type:"radio",name:z,value:o,checked:l,className:s("g-ui-radio-input",N("g-ui-radio-size-",c,"md"),p?.className),...w}),Nr(r,()=>zr({className:"g-ui-radio-label"},r)));return On({className:s("g-ui-radio",N("g-ui-radio-size-",c,"md"),d)},$,Nr(u,()=>zr({className:"g-ui-radio-description"},u)))}import{Nav as Zn,Span as Un}from"@granularjs/core";function Xn(...e){let{props:i,children:t}=g(e,{separator:"/"}),{separator:r,className:a,...o}=i,n=[];Array.isArray(t)?n.push(...t):n.push(t);let u=n.filter(Boolean),c=[];return u.forEach((d,p)=>{c.push(d),p<u.length-1&&c.push(Un({className:"g-ui-breadcrumbs-separator"},r))}),Zn({...o,className:s("g-ui-breadcrumbs",a)},c)}import{Div as Kn}from"@granularjs/core";function Qn(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Kn({...a,className:s("g-ui-center",r)},t)}import{Div as Jn}from"@granularjs/core";function es(...e){let{props:i}=g(e,{size:"md"}),{size:t,className:r,...a}=i;return Jn({...a,className:s("g-ui-space",[t,o=>`g-ui-space-${o}`],r)})}import{Div as is,when as ts}from"@granularjs/core";function rs(...e){let{props:i,children:t}=g(e),{opened:r,className:a,...o}=i;return ts(r,()=>is({...o,className:s("g-ui-collapse",a)},t))}import{Button as as}from"@granularjs/core";function Oe(...e){let{props:i,children:t}=g(e,{size:"md",variant:"filled"}),{size:r,variant:a,color:o,className:n,...u}=i;return as({...u,type:"button",className:s("g-ui-action-icon",N("g-ui-action-icon-size-",r,"md"),N("g-ui-action-icon-color-",o,"primary"),N("g-ui-action-icon-",a,"filled"),n)},t)}import{Div as zt,when as os,after as ns,state as ss}from"@granularjs/core";function Nt(...e){let{props:i,rawProps:t,children:r}=g(e,{position:"left"}),{opened:a,position:o,content:n,className:u,...c}=i,{onChange:d}=t,p=ss(m(a)??!1);ns(a).change(f=>{let l=m(f);l!=null&&p.set(!!l)});let w=f=>{p.set(f),d?.(f)};return zt({...c,className:s("g-ui-popover",i.className??u)},zt({onClick:()=>w(!p.get())},r),os(p,()=>zt({className:s("g-ui-popover-dropdown",o==="right"&&"g-ui-popover-right",o==="center"&&"g-ui-popover-center")},n)))}import{Div as Cr}from"@granularjs/core";function us(...e){let{props:i,children:t}=g(e,{position:"left"}),{position:r,content:a,className:o,...n}=i;return Cr({...n,className:s("g-ui-hover-card",o)},t,Cr({className:s("g-ui-hover-card-dropdown",[r,u=>u==="right"?"g-ui-hover-card-right":""],[r,u=>u==="center"?"g-ui-hover-card-center":""])},a))}import{Div as gs}from"@granularjs/core";function ls(...e){let{props:i,children:t}=g(e,{position:"bottom-right"}),{position:r,className:a,...o}=i;return gs({...o,className:s("g-ui-affix",[r,n=>`g-ui-affix-${n}`],a)},t)}import{Fieldset as cs,Legend as ps,when as ds}from"@granularjs/core";function ms(...e){let{props:i,children:t}=g(e),{legend:r,className:a,...o}=i;return cs({...o,className:s("g-ui-fieldset",a)},ds(r,()=>ps({className:"g-ui-legend"},r)),t)}import{Div as fs}from"@granularjs/core";function hs(...e){let{props:i,children:t}=g(e,{position:"sticky"}),{position:r,className:a,...o}=i;return fs({...o,className:s("g-ui-appbar",N("g-ui-appbar-",r,"sticky"),a)},t)}import{Div as Ct,portal as vs,after as Pi,state as Sr,when as Dr}from"@granularjs/core";function bs(...e){let{props:i,children:t}=g(e,{position:"left",size:"md",blur:!0,fixed:!1,minWidth:"button"});return Dr(i.fixed,()=>ws(i,t),()=>xs(i,t))}var xs=(e,i)=>{let{open:t,onClose:r,position:a,size:o,blur:n,fixed:u,minWidth:c,className:d,...p}=e,w=Sr(!1),f=Sr(!1),l=220,b=D=>{if(D){w.set(!0),typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>f.set(!0)):setTimeout(()=>f.set(!0),0);return}f.set(!1),setTimeout(()=>w.set(!1),l)};b(!!t.get()),Pi(t).change(D=>b(!!D));let z=Pi(f,n).compute(D=>{let[C,P]=D;return s("g-ui-sidebar-overlay",C&&"g-ui-sidebar-overlay-open",!P&&"g-ui-sidebar-overlay-noblur")}),$=Pi(o,a,f,d).compute(D=>{let[C,P,L,y]=D,k=P==="right"?"g-ui-sidebar-drawer-right g-ui-sidebar-position-right":"g-ui-sidebar-drawer-left";return s("g-ui-sidebar","g-ui-sidebar-drawer",`g-ui-sidebar-size-${C}`,k,L&&"g-ui-sidebar-drawer-open",m(y))});return Dr(w,()=>vs(Ct({className:z,onClick:r},Ct({className:$,onClick:D=>D.stopPropagation()},i))))},ws=(e,i)=>{let{open:t,position:r,size:a,minWidth:o,className:n,...u}=e,c=Pi(a,r,t,o,n).compute(d=>{let[p,w,f,l,b]=d,z=l||"button",$=null;return z==="button"?$="g-ui-sidebar-min-button":z==="xs"?$="g-ui-sidebar-min-xs":z==="sm"?$="g-ui-sidebar-min-sm":z==="md"&&($="g-ui-sidebar-min-md"),s("g-ui-sidebar g-ui-sidebar-fixed",`g-ui-sidebar-size-${p||"md"}`,$,f&&"g-ui-sidebar-fixed-open",b)});return Ct({...u,className:c},i)};import{Div as Ne,when as Mi,list as Pr,after as ne,resolve as pe,state as ys,Img as ks,Span as zs}from"@granularjs/core";var Mr={xs:6,sm:8,md:10,lg:12,xl:14},Ns={xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px"},Cs={xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px"},Ss=14;function Ds(e){if(e==null||e==="")return"var(--g-ui-primary)";let i=String(e).trim();return i.startsWith("#")?i:`var(--g-ui-${i})`}function Ps(e){return(e??[]).map(t=>{if(t==null)return 1;let r=Number(t.weight);return Number.isFinite(r)&&r>=0?r:1})}function Ti(e){let i=(e??[]).length;if(i<2)return{totalWeight:0,cumulativeWeights:[0]};let r=Ps(e).slice(0,i-1),a=r.reduce((n,u)=>n+u,0),o=[0];for(let n=0;n<r.length;n++)o.push(o[n]+r[n]);return{totalWeight:a,cumulativeWeights:o}}function Tr(e,i,t,r){if(r<1||t<=0)return 0;let a=Math.max(0,Math.min(100,e));for(let o=r-1;o>=0;o--){let n=i[o]/t*100;if(a>=n)return o}return 0}function Ms(e,i,t,r,a,o,n){let u=e,c=(n??[]).length;if(c===0)return{activeStep:0,progressPct:0};if(u==="step")return{activeStep:Math.max(0,Math.min(c-1,Math.floor(i??0))),progressPct:0};if(u==="percent"){let d=Math.max(0,Math.min(100,Number(t)||0)),p=Ti(n);return{activeStep:Tr(d,p.cumulativeWeights,p.totalWeight,c),progressPct:d}}if(u==="time"){let d=Number(r)||0,p=a,w=o,f=0;if(Array.isArray(p)&&p.length>=c?f=p.slice(0,c).reduce((C,P)=>C+(Number(P)||0),0):typeof w=="number"&&w>0&&(f=w),f<=0)return{activeStep:0,progressPct:0};let l=f/c,b=0;if(Array.isArray(p)&&p.length>=c){let C=0;for(let P=0;P<c;P++){if(C+=Number(p[P])||0,d<C){b=P;break}b=P}}else b=Math.min(c-1,Math.floor(d/l));let z=Math.min(100,d/f*100),$=Ti(n);return{activeStep:Tr(z,$.cumulativeWeights,$.totalWeight,c),progressPct:z}}return{activeStep:0,progressPct:0}}function Ts(e,i,t,r,a,o){if(a<2||r<0||r>=a-1)return 0;if(e==="step")return i>r?100:0;let{totalWeight:n,cumulativeWeights:u}=o??Ti([]);if(n<=0)return 0;let c=u[r]/n*100,d=u[r+1]/n*100;if(t<=c)return 0;if(t>=d)return 100;let p=d-c;return p<=0?0:(t-c)/p*100}var Vs=0;function Ls(e){let i=document.getElementById(e);if(!i)return[];let t=i.querySelectorAll(".g-ui-timeline-item");if(t.length<2)return[];let r=i.dataset.pinSize||"md",a=Mr[r]??Mr.md,o=[];for(let n=0;n<t.length-1;n++){let u=t[n].offsetTop+a,c=t[n+1].offsetTop-t[n].offsetTop;o.push({top:u,height:c})}return o}function Is(...e){let{props:i,rawProps:t}=g(e,{items:[],mode:"step",active:0,progress:0,elapsedMs:0,stepDurationsMs:null,totalDurationMs:null,clickable:!1,pinRadius:"md",reverseActive:!1,lineWidth:"md",pinSize:"md",activeColor:"primary",align:"left",pinMode:"default"}),{items:r,mode:a,active:o,progress:n,elapsedMs:u,stepDurationsMs:c,totalDurationMs:d,clickable:p,pinRadius:w,reverseActive:f,lineWidth:l,pinSize:b,activeColor:z,align:$,pinMode:D,className:C,...P}=i,{onChange:L}=t,y=ne(z).compute(E=>Ds(pe(E))),k=`g-ui-timeline-${++Vs}`,h=ys([]),S=ne(a,o,n,u,c,d,r).compute(E=>{let[G,J,re,X,M,j,x]=E;return Ms(G,J,re,X,M,j,x)}),V=ne(h,f).compute(([E,G])=>{if(!pe(G)||!E?.length)return null;let J=E[0],re=0;for(let X of E)re+=X.height;return{top:J.top,height:re}}),A=ne(S).compute(E=>E?.progressPct!=null?`${Math.max(0,Math.min(100,E.progressPct))}%`:"0%"),Q=ne(a).compute(E=>{let G=pe(E);return G==="time"||G==="percent"||G==="step"}),se=ne(a).compute(E=>pe(E));function te(){setTimeout(()=>{let E=Ls(k);E.length&&h.set(E)},0)}return ne(r).change(()=>te()),ne(b).change(()=>te()),te(),Ne({...P,id:k,"data-pin-size":ne(b).compute(E=>pe(E)??"md"),"data-active-color":ne(z).compute(E=>{let G=pe(E);if(G==null||typeof G!="string")return"primary";let J=String(G).trim();return J.startsWith("#")?"custom":J||"primary"}),style:ne(z,l,b).compute(([E,G,J])=>{let re={"--g-ui-timeline-line-width":Ns[pe(G)]??"4px","--g-ui-timeline-track-offset":`calc(${Ss}px - var(--g-ui-timeline-line-width) / 2)`,"--g-ui-timeline-pin-half":Cs[pe(J)]??"10px"},X=pe(E);return X&&String(X).trim().startsWith("#")&&(re["--g-ui-timeline-active-color"]=String(X).trim()),re}),className:s("g-ui-timeline",ne(a).compute(E=>E?`g-ui-timeline-mode-${pe(E)}`:""),ne(Q).compute(E=>E?"g-ui-timeline-has-track":""),ne(p).compute(E=>pe(E)?"g-ui-timeline-clickable":""),ne(f).compute(E=>pe(E)?"g-ui-timeline-reverse":""),ne($).compute(E=>pe(E)==="right"?"g-ui-timeline-align-right":""),N("g-ui-timeline-pin-radius-",w,"md"),N("g-ui-timeline-line-width-",l,"md"),N("g-ui-timeline-pin-size-",b,"md"),ne(D).compute(E=>E?`g-ui-timeline-pin-mode-${pe(E)}`:""),C)},Mi(Q,()=>ne(f).compute(E=>pe(E)?Ne({className:"g-ui-timeline-track-segment g-ui-timeline-track-reverse",style:ne(V).compute(G=>G?{top:`${G.top}px`,height:`${G.height}px`}:{})},Ne({className:"g-ui-timeline-track-fill",style:ne(A).compute(G=>G?{height:G}:{height:"0%"})})):Pr(h,(G,J)=>{let re=ne(G).compute(j=>j?{top:`${j.top}px`,height:`${j.height}px`}:{}),X=ne(S,J,r,se).compute(([j,x,B,R])=>{let q=B??[],Y=q.length,oe=Ti(q);return Ts(R,j?.activeStep??0,j?.progressPct??0,pe(x)??0,Y,oe)}),M=ne(X).compute(j=>`${Math.max(0,Math.min(100,j))}%`);return Ne({className:"g-ui-timeline-track-segment",style:ne(re).compute(j=>j)},Ne({className:"g-ui-timeline-track-fill",style:ne(M).compute(j=>j?{height:j}:{height:"0%"})}))}))),Pr(r,(E,G)=>{let J=ne(S,G,r,f).compute(([q,Y,oe,ve])=>{let ze=q?.activeStep??0,Pe=pe(Y)??0,_e=(oe??[]).length,Ze=pe(ve)?_e-1-Pe:Pe;return Ze<ze?"completed":Ze===ze?"active":"future"}),re=ne(J).compute(q=>q?`g-ui-timeline-item-${q}`:""),X=pe(p)&&typeof L=="function"?()=>{let q=pe(G);typeof q=="number"&&L(q)}:void 0,M=ne(D).compute(q=>pe(q)??"default"),j=ne(M,E).compute(([q,Y])=>{let oe=q??"default";return oe==="icon"&&(Y?.icon!=null||Y?.pinIcon!=null)?zs({className:"g-ui-timeline-pin-icon material-symbols-outlined"},Y.icon??Y.pinIcon??""):oe==="image"&&(Y?.image!=null||Y?.pinImage!=null||Y?.src!=null)?ks({className:"g-ui-timeline-pin-image",src:Y.image??Y.pinImage??Y.src,alt:Y.pinImageAlt??""}):oe==="custom"&&Y?.pinContent!=null?Y.pinContent:null}),x=ne(M,E).compute(([q,Y])=>{let oe=q??"default";return oe==="icon"?Y?.icon!=null||Y?.pinIcon!=null:oe==="image"?Y?.image!=null||Y?.pinImage!=null||Y?.src!=null:oe==="custom"?Y?.pinContent!=null:!1}),B=Ne({className:"g-ui-timeline-dot"},Ne({className:"g-ui-timeline-dot-inner"}),Mi(x,()=>j)),R=Ne({className:"g-ui-timeline-content"},Mi(E.title,()=>Ne({className:"g-ui-timeline-title"},E.title)),Mi(E.description,()=>Ne({className:"g-ui-timeline-desc"},E.description)),E.content);return Ne({className:s("g-ui-timeline-item",re),style:ne(y).compute(q=>q?{"--g-ui-timeline-active-color":q}:void 0),onClick:X,role:X?"button":void 0,tabIndex:X?0:void 0},Ne({className:"g-ui-dot-wrapper"},B),R)}))}import{Div as Vi,list as $s}from"@granularjs/core";function As(...e){let{props:i}=g(e,{active:0,items:[]}),{active:t,items:r,className:a,...o}=i;return Vi({...o,className:s("g-ui-stepper",a)},$s(r,(n,u)=>Vi({className:s("g-ui-stepper-item",[t,c=>(console.log("value",c,"idx",u),u.get()===c?"g-ui-stepper-active":"")])},Vi({className:"g-ui-stepper-index"},String(u+1)),Vi({className:"g-ui-stepper-label"},n.label))))}import{Span as Vr,after as Lr,state as Bs}from"@granularjs/core";function Fs(...e){let{props:i,rawProps:t}=g(e,{value:0,max:5,size:"md"}),{value:r,max:a,size:o,className:n,...u}=i,{onChange:c}=t,d=Bs(m(r));Lr(r).change(l=>{let b=m(l);b!=null&&d.set(b)});let p=l=>{d.set(l),c?.(l)},w=[],f=Number(m(a))||0;for(let l=1;l<=f;l+=1)w.push(l);return Vr({...u,className:s("g-ui-rating",N("g-ui-rating-size-",o,"md"),i.className??n)},w.map(l=>Vr({className:s("g-ui-rating-item",Lr(d).compute(b=>l<=b?"g-ui-rating-item-active":"")),onClick:()=>p(l)},"\u2605")))}import{Span as Es}from"@granularjs/core";function js(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Es({...a,className:s("g-ui-tag",r)},t)}import{Button as Ir,Div as Xe,state as $r,after as Li}from"@granularjs/core";var Rs=["S","M","T","W","T","F","S"];function ui(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{value:r,className:a,size:o,...n}=i,{onChange:u}=t,c=C=>{let P=m(C);if(P instanceof Date)return P;if(P==null)return null;let L=new Date(P);return Number.isNaN(L.getTime())?null:L},d=$r(c(r)??new Date),p=$r(new Date(d.get()));Li(r).change(C=>{let P=c(C);P!=null&&(d.set(P),p.set(new Date(P)))});let w=(C,P,L)=>{let y=new Date(C,P+1,0).getDate();return new Date(C,P,Math.min(L,y))},f=C=>{let P=p.get(),L=w(P.getFullYear(),P.getMonth(),C);d.set(L),p.set(L),u?.(L)},l=C=>{let P=p.get(),L=w(P.getFullYear(),P.getMonth()+C,P.getDate());p.set(L)},b=C=>{let P=p.get(),L=w(P.getFullYear()+C,P.getMonth(),P.getDate());p.set(L)},z=Li(p).compute(C=>C.toLocaleString("default",{month:"long"})),$=Li(p).compute(C=>String(C.getFullYear())),D=Li(p,d).compute(([C,P])=>{let L=C.getFullYear(),y=C.getMonth(),h=new Date(L,y,1).getDay(),S=new Date(L,y+1,0).getDate(),V=[];for(let A=0;A<h;A+=1)V.push({muted:!0,label:""});for(let A=1;A<=S;A+=1)V.push({label:A});return[...Rs.map(A=>Xe({className:"g-ui-calendar-cell g-ui-calendar-cell-muted"},A)),...V.map(A=>Xe({className:s("g-ui-calendar-cell",A.muted&&"g-ui-calendar-cell-muted",A.label&&P.getFullYear()===L&&P.getMonth()===y&&A.label===P.getDate()&&"g-ui-calendar-cell-active"),onClick:()=>A.label&&f(A.label)},A.label))]});return Xe({...n,className:s("g-ui-calendar",a,N("g-ui-calendar-size-",o,"md"))},Xe({className:"g-ui-calendar-header"},Oe({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>l(-1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:wi})),Xe({className:"g-ui-calendar-title-group"},Ir({type:"button",className:"g-ui-calendar-title-button",onClick:()=>l(1)},z),Ir({type:"button",className:"g-ui-calendar-title-button",onClick:()=>b(1)},$)),Oe({size:"xs",variant:"subtle",className:"g-ui-calendar-nav",onClick:()=>l(1)},ye({size:"sm",className:"g-ui-calendar-nav-icon",innerHTML:xi}))),Xe({className:"g-ui-calendar-grid"},D))}import{Div as gi,Span as Ke,Input as Hs,when as St,after as De,state as Ii}from"@granularjs/core";function Ws(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"md",searchable:!0}),{value:r,data:a,size:o,className:n,placeholder:u,searchable:c,...d}=i,{onChange:p,onSearchChange:w}=t,f=Ii(m(r)??[]),l=Ii(""),b=Ii(!1),z=Ii(null),$=h=>(m(h)??[]).map(V=>typeof V=="string"?{value:V,label:V}:V&&typeof V=="object"?V:{value:String(V),label:String(V)});De(r).change(h=>{let S=m(h);S!=null&&f.set(S)});let D=null;De(b).change(h=>{if(D&&(D(),D=null),!h)return;let S=V=>{let A=z.get();A&&(A.contains(V.target)||b.set(!1))};document.addEventListener("mousedown",S),D=()=>document.removeEventListener("mousedown",S)}),De(l).change(h=>{w?.(h)});let C=h=>{let S=f.get()??[],V=S.includes(h)?S.filter(A=>A!==h):S.concat(h);f.set(V),p?.(V)},P=De(a).compute(h=>$(h)),L=De(P,l).compute(([h,S])=>{let V=String(m(S)??"").toLowerCase().trim();return V?h.filter(A=>String(A.label??"").toLowerCase().includes(V)):h}),y=De(f,l).compute(([h,S])=>{let V=m(h)??[],A=String(m(S)??"");return!V.length&&!A}),k=De(c).compute(h=>!!h);return gi({...d,node:z,className:s("g-ui-select-multi-root",n)},gi({className:s("g-ui-select-multi",N("g-ui-select-multi-size-",o,"md")),onClick:()=>b.set(!0)},De(P,f).compute(([h,S])=>(m(S)??[]).map(A=>{let se=(h??[]).find(te=>te.value===A)?.label??A;return Ke({className:"g-ui-select-tag"},Ke({className:"g-ui-select-tag-label",onClick:te=>{te?.stopPropagation?.()}},se),Ke({className:"g-ui-select-tag-remove",innerHTML:Be,onClick:te=>{te?.stopPropagation?.(),C(A)}}))})),St(y,()=>Ke({className:"g-ui-select-multi-placeholder"},u??"Select...")),St(k,()=>Hs({className:"g-ui-select-multi-input",value:l,onInput:h=>l.set(h.target?.value??""),onFocus:()=>b.set(!0)}))),St(b,()=>gi({className:"g-ui-select-dropdown"},De(L).compute(h=>h.length?h.map(S=>gi({className:s("g-ui-select-item",S.disabled&&"g-ui-select-item-disabled",De(f).compute(V=>(m(V)??[]).includes(S.value)?"g-ui-select-item-active":"")),onClick:()=>{S.disabled||C(S.value)}},Ke({className:"g-ui-select-item-check",innerHTML:De(f).compute(V=>(m(V)??[]).includes(S.value)?yi:"")}),Ke({className:"g-ui-select-item-label"},S.label))):gi({className:"g-ui-select-item"},"Nothing found")))))}import{Div as Ys,list as Gs,portal as _s}from"@granularjs/core";import{Div as Dt,Button as Os,when as Ar,state as qs}from"@granularjs/core";function Pt(...e){let{props:i,rawProps:t,children:r}=g(e),{title:a,className:o,...n}=i,{onClose:u}=t,c=qs(!0),d=()=>{c.set(!1),u?.(),console.log("close")};return Ar(c,()=>Dt({...n,className:s("g-ui-toast",o)},Dt({className:"g-ui-toast-row"},Ar(a,()=>Dt({className:"g-ui-toast-title"},a)),Os({className:"g-ui-toast-close",onClick:d},ye({innerHTML:Be}))),r))}function Zs(...e){let{props:i,rawProps:t}=g(e,{items:[]}),{items:r,className:a,timeout:o,...n}=i,{onClose:u}=t;return _s(Ys({...n,className:s("g-ui-toast-stack",a)},Gs(r,c=>Pt({title:c.title,onClose:()=>u?.(c)},c.message))))}function Us(...e){let{props:i}=g(e);return ui(i)}import{Div as Xs,after as Ks}from"@granularjs/core";function Qs(...e){let{props:i,rawProps:t}=g(e,{items:[],position:"top-right"}),{items:r,position:a,className:o,...n}=i,{onRemove:u}=t,c=new Map,d=(w,f)=>w?.id??w?.key??f,p=Ks(r).compute(w=>{let f=m(w)??[],l=new Set;f.forEach((b,z)=>{let $=d(b,z);if(l.add($),b?.autoClose&&!c.has($)){let D=setTimeout(()=>{c.delete($),u?.(b)},b.autoClose);c.set($,D)}});for(let[b,z]of c.entries())l.has(b)||(clearTimeout(z),c.delete(b));return f.map((b,z)=>ct({key:d(b,z),title:b.title,color:b.color,icon:b.icon,loading:b.loading,withCloseButton:b.withCloseButton,withBorder:b.withBorder,onClose:()=>{b.onClose?.(),u?.(b)}},b.message??b.body??b.content??b.text))});return Xs({...n,className:s("g-ui-notifications",N("g-ui-notifications-position-",a,"top-right"),o)},p)}import{Div as Qe,after as li,state as Js,when as eu}from"@granularjs/core";function iu(...e){let{props:i,rawProps:t}=g(e,{min:0,max:100,step:1,size:"md"}),{value:r,marks:a,min:o,max:n,step:u,size:c,disabled:d,className:p,...w}=i,{onChange:f}=t,l=Js(m(r??[o,n])),b=()=>{let y=Number(m(o)),k=Number(m(n));return!Number.isFinite(y)||!Number.isFinite(k)?{minValue:0,maxValue:100}:{minValue:Math.min(y,k),maxValue:Math.max(y,k)}},z=()=>{let y=Number(m(u));return Number.isFinite(y)&&y>0?y:1},$=y=>{let{minValue:k,maxValue:h}=b(),S=z(),V=[k,h];Array.isArray(y)&&(V=y);let A=Math.max(k,Math.min(h,Number(V[0]))),Q=Math.max(k,Math.min(h,Number(V[1]))),se=Math.round(Math.min(A,Q)/S)*S,te=Math.round(Math.max(A,Q)/S)*S;return[se,te]};li(r).change(y=>{y!=null&&l.set($(y))});let D=y=>{let k=$(y);k?.[0]===l.get()?.[0]&&k?.[1]===l.get()?.[1]||(l.set(k),f?.(k))},C=li(l).compute(y=>{let{minValue:k,maxValue:h}=b(),S=h-k,[V,A]=$(y);if(S<=0)return{lowPct:0,highPct:0};let Q=(V-k)/S*100,se=(A-k)/S*100;return{lowPct:Math.max(0,Math.min(100,Q)),highPct:Math.max(0,Math.min(100,se))}}),P=(y,k,h)=>{let S=k?.();if(!S||S.width===0)return;let A=Math.min(Math.max(y.clientX-S.left,0),S.width)/S.width,{minValue:Q,maxValue:se}=b(),te=Q+A*(se-Q),E=l;typeof l.get=="function"&&(E=l.get());let[G,J]=$(E);D(h==="low"?[te,J]:[G,te])},L=(y,k,h)=>{if(ke(d))return;y.preventDefault?.();let S=h||y.currentTarget,V=()=>S.getBoundingClientRect(),A=V(),Q=C;typeof C.get=="function"&&(Q=C.get());let{lowPct:se,highPct:te}=Q,E=(y.clientX-A.left)/A.width*100,G=k;if(!G){let X=Math.abs(E-se)<=Math.abs(E-te);G="high",X&&(G="low")}S.setPointerCapture?.(y.pointerId),P(y,V,G);let J=X=>P(X,V,G),re=()=>{S.releasePointerCapture?.(y.pointerId),window.removeEventListener("pointermove",J),window.removeEventListener("pointerup",re)};window.addEventListener("pointermove",J),window.addEventListener("pointerup",re)};return Qe({...w,className:s("g-ui-range-slider",N("g-ui-slider-size-",c,"md"),U("g-ui-slider-disabled",d),i.className??p)},Qe({className:"g-ui-slider-track",onPointerDown:y=>L(y)},Qe({className:"g-ui-slider-bar",style:li(C).compute(({lowPct:y,highPct:k})=>({left:`${y}%`,width:`${Math.max(0,k-y)}%`}))}),Qe({className:"g-ui-slider-thumb",style:li(C).compute(({lowPct:y})=>({left:`${y}%`})),onPointerDown:y=>{y.stopPropagation?.(),L(y,"low",y.currentTarget.parentElement)}}),Qe({className:"g-ui-slider-thumb",style:li(C).compute(({highPct:y})=>({left:`${y}%`})),onPointerDown:y=>{y.stopPropagation?.(),L(y,"high",y.currentTarget.parentElement)}})),eu(a,()=>Qe({className:"g-ui-slider-marks"},a.map(y=>vt({mark:y,getBounds:b})))))}import{state as Mt,after as Br}from"@granularjs/core";function $i(...e){let{props:i,rawProps:t}=g(e,{size:"md",format:{pattern:"dddd-dd-dd"}}),{value:r,size:a,calendarSize:o,leftSection:n,rightSection:u,className:c,format:d,minDate:p,maxDate:w,...f}=i,{onChange:l}=t,b=k=>{let h=m(k);if(h instanceof Date)return h;if(h==null||h==="")return null;let S=new Date(h);return Number.isNaN(S.getTime())?null:S},z=(k,h)=>k&&h&&k.getFullYear()===h.getFullYear()&&k.getMonth()===h.getMonth()&&k.getDate()===h.getDate(),$=k=>{if(!k)return"";let h=String(k.getFullYear()).padStart(4,"0"),S=String(k.getMonth()+1).padStart(2,"0"),V=String(k.getDate()).padStart(2,"0");return`${h}-${S}-${V}`},D=k=>{let h=String(k??"").replace(/\D/g,"");if(h.length<8)return null;let S=Number(h.slice(0,4)),V=Number(h.slice(4,6)),A=Number(h.slice(6,8));if(!S||!V||!A)return null;let Q=new Date(S,V-1,A);if(Q.getFullYear()!==S||Q.getMonth()!==V-1||Q.getDate()!==A)return null;let se=b(p);if(se&&Q<se)return null;let te=b(w);return te&&Q>te?null:Q},C=Mt(b(r)),P=Mt($(C.get())),L=Mt(!1);Br(r).change(k=>{let h=b(k);if(!z(h,C.get())){if(h==null){C.set(null),P.set("");return}C.set(h),P.set($(h))}}),Br(P).change(k=>{let h=D(k);h&&(z(h,C.get())||(C.set(h),l?.(h)))});let y=k=>{k&&(z(k,C.get())||(C.set(k),P.set($(k)),l?.(k),L.set(!1)))};return Nt({opened:L,onChange:k=>L.set(!!k),content:ui({size:N("",o,"xs"),value:C,onChange:y}),className:"g-ui-date-input-popover"},be({...f,size:a,className:s("g-ui-dateinput",c),leftSection:n,rightSection:u,type:"text",inputMode:"numeric",format:d,value:P,onChange:k=>P.set(k)}))}import{Div as Tt,when as tu,after as ru,state as au}from"@granularjs/core";function ou(...e){let{props:i,rawProps:t,children:r}=g(e),{opened:a,content:o,className:n,...u}=i,{onChange:c}=t,d=au(m(a)??!1);ru(a).change(w=>{let f=m(w);f!=null&&d.set(!!f)});let p=w=>{d.set(w),c?.(w)};return Tt({...u,className:s("g-ui-popper",n)},Tt({onClick:()=>p(!d.get())},r),tu(d,()=>Tt({className:"g-ui-popper-dropdown"},o)))}import{Button as nu,after as Fr,when as su,state as uu}from"@granularjs/core";function gu(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{size:r,className:a,rightSection:o,...n}=i,{onChange:u}=t,c=uu(!1),d=Fr(c).compute(w=>w?"text":"password"),p=Fr(o).compute(w=>w??nu({className:"g-ui-password-toggle",onClick:()=>c.set(!c.get())},su(c,()=>"Hide",()=>"Show")));return be({...n,size:r,className:a,onChange:u,rightSection:p,type:d})}import{Div as lu}from"@granularjs/core";function cu(...e){let{props:i}=g(e,{size:"md"}),{size:t,className:r,...a}=i;return be({...a,size:t,className:r,leftSection:lu({className:"g-ui-search-input-left-section",innerHTML:Qt}),type:"text",inputMode:"search"})}import{Button as pu,after as du,when as Er}from"@granularjs/core";import{state as mu}from"@granularjs/core";function fu(...e){let{props:i,children:t}=g(e,{value:"",timeout:1500}),{value:r,timeout:a,className:o,...n}=i,u=mu(!1),c=du(u).compute(p=>s("g-ui-copy-button",p&&"g-ui-copy-button-done",o));return pu({...n,className:c,onClick:async()=>{try{await navigator.clipboard.writeText(String(r)),u.set(!0),setTimeout(()=>u.set(!1),a)}catch{}},type:"button"},Er(t?.length,()=>t,()=>Er(u,()=>"Copied",()=>"Copy")))}import{Div as jr,after as ci,resolve as hu}from"@granularjs/core";function Rr(e){let i=Number(e);return Number.isNaN(i)?0:Math.max(0,Math.min(100,i))}function vu(...e){let{props:i}=g(e,{size:"md",value:null,color:"primary"}),{size:t,value:r,color:a,className:o,...n}=i,u=ci(r).compute(f=>f!=null&&f!==""),c=ci(r).compute(f=>Rr(f)),d=ci(c,u).compute(([f,l])=>{if(!l)return{};let b=Number(f),z=Number.isNaN(b)?0:Math.max(0,Math.min(360,b*3.6));return{background:`conic-gradient(var(--g-ui-progress-ring-fill, var(--g-ui-primary)) 0deg ${z}deg, var(--g-ui-border-muted) ${z}deg 360deg)`}}),p=ci(u).compute(f=>f?"":"g-ui-progress-ring-indeterminate"),w=ci(u,r).compute(([f,l])=>f?Rr(l):void 0);return jr({...n,className:s("g-ui-progress-ring",N("g-ui-progress-ring-",a,"primary"),[t,f=>`g-ui-progress-ring-size-${hu(f)??"md"}`],p,o),style:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":w},jr({className:"g-ui-progress-ring-hole"}))}import{Div as Ai,state as Lt,after as qe,list as xu,when as wu}from"@granularjs/core";import{Div as bu}from"@granularjs/core";function Vt(...e){let{props:i,children:t}=g(e,{size:"md"}),{size:r,className:a,...o}=i;return bu({...o,className:s("g-ui-scroll-area",[r,n=>`g-ui-scroll-area-${n}`],a)},t)}function Ie(e,i){if(i==null||i==="")return e;let t=String(i).trim().split("."),r=e;for(let a of t)r=r?.[a];return r}function yu(e,i,t){let r=t(i);return String(r??"").toLowerCase().includes(String(e??"").toLowerCase())}function It(...e){let{props:i,rawProps:t}=g(e,{data:[],size:"md",valuePath:"value",labelPath:"label"}),{data:r,value:a,size:o,valuePath:n,labelPath:u,filter:c,placeholder:d,label:p,description:w,error:f,leftSection:l,rightSection:b,className:z,inputClassName:$,disabled:D,...C}=i,{onChange:P,renderItem:L}=t,y=Lt(!1),k=Lt(""),h=Lt(m(a));qe(a).change(x=>{let B=m(x);B!==h.get()&&h.set(B)});let S=qe(r).compute(x=>Array.isArray(x)?x:[]),V=qe(S,h,n).compute(([x,B,R])=>{if(B==null)return null;let q=Y=>R==null||R===""?Y:Ie(Y,R);return x.find(Y=>q(Y)===B)??null}),A=qe(V,y,k,u).compute(([x,B,R,q])=>{let Y=oe=>q==null||q===""?String(oe??""):String(Ie(oe,q)??"");return B?R??"":x?Y(x):""}),Q=qe(S,k,c,u).compute(([x,B,R,q])=>{let Y=ve=>q==null||q===""?String(ve??""):String(Ie(ve,q)??""),oe=m(R)??yu;return x.filter(ve=>oe(B,ve,Y))}),se=x=>{let B=m(n),R=B==null||B===""?x:Ie(x,B);h.set(R),k.set(""),y.set(!1),P?.(R)},te=()=>{if(m(D))return;y.set(!0);let x=V.get(),B=m(u),R=q=>B==null||B===""?String(q??""):String(Ie(q,B)??"");k.set(x?R(x):"")},E=()=>{y.set(!1);let x=V.get(),B=m(u),R=q=>B==null||B===""?String(q??""):String(Ie(q,B)??"");k.set(x?R(x):"")},{onChange:G,...J}=C,re={...J,size:o,label:p,description:w,error:f,leftSection:l,rightSection:b,placeholder:m(d)??void 0,disabled:D,value:A,onInput:x=>k.set(x?.target?.value??""),onFocus:te,onClick:te,onBlur:()=>setTimeout(()=>E(),150)},X=x=>{let B=m(n);return B==null||B===""?x:Ie(x,B)},M=x=>qe(h,n).compute(([B,R])=>(Y=>R==null||R===""?Y:Ie(Y,R))(x)===B?"g-ui-autocomplete-item-active":""),j=x=>{if(L&&typeof L=="function"){let B=L(x);if(B!=null)return Ai({className:s("g-ui-autocomplete-item",M(x)),onClick:()=>se(x),role:"option"},B)}return Ai({className:s("g-ui-autocomplete-item",M(x)),onClick:()=>se(x),role:"option"},qe(u).compute(B=>B==null||B===""?String(x??""):String(Ie(x,B)??"")))};return Ai({className:s("g-ui-autocomplete",z,U("g-ui-autocomplete-disabled",D))},be({...re,className:s("g-ui-autocomplete-input-wrapper",re.className),inputClassName:s("g-ui-autocomplete-input",$)}),wu(y,()=>Ai({className:"g-ui-autocomplete-dropdown",role:"listbox"},Vt({className:"g-ui-autocomplete-list",style:{maxHeight:"240px"}},xu(Q,x=>j(x))))))}function ku(...e){return It(...e)}import{Div as zu,Span as Nu,state as Hr,after as Cu}from"@granularjs/core";function Wr(e){let i=m(e);if(i instanceof Date)return i;if(i==null||i==="")return null;let t=new Date(i);return Number.isNaN(t.getTime())?null:t}function Or(e){let i=m(e);if(i==null)return[null,null];let t=Array.isArray(i)?i:[i];return[Wr(t[0]),Wr(t[1])]}function qr(e,i){return!e||!i?e===i:e.getFullYear()===i.getFullYear()&&e.getMonth()===i.getMonth()&&e.getDate()===i.getDate()}function Su(...e){let{props:i,rawProps:t}=g(e,{size:"md"}),{value:r,size:a,minDate:o,maxDate:n,className:u,placeholderMin:c,placeholderMax:d,...p}=i,{onChange:w}=t,[f,l]=Or(r),b=Hr(f),z=Hr(l);Cu(r).change(P=>{let[L,y]=Or(P);qr(L,b.get())&&qr(y,z.get())||(b.set(L),z.set(y))});let $=()=>{let P=b.get(),L=z.get();w?.([P??null,L??null])},D=P=>{let L=z.get();P&&L&&P>L&&z.set(P),b.set(P),$()},C=P=>{let L=b.get();P&&L&&P<L&&b.set(P),z.set(P),$()};return zu({...p,className:s("g-ui-range-picker",i.className??u)},$i({...p,size:a,value:b,onChange:D,maxDate:z,placeholder:m(c)??void 0}),Nu({className:"g-ui-range-picker-separator"},"\u2013"),$i({...p,size:a,value:z,onChange:C,minDate:b,placeholder:m(d)??void 0}))}import{Div as Du}from"@granularjs/core";function Pu(...e){let{props:i,children:t}=g(e,{align:"center",direction:"row"}),{direction:r,wrap:a,align:o,justify:n,gap:u,className:c,...d}=i;return Du({...d,className:s("g-ui-flex",[r,p=>p==="column"?"g-ui-flex-column":"g-ui-flex-row"],[a,"g-ui-flex-wrap"],[o,p=>p&&`g-ui-align-${p}`],[n,p=>p&&`g-ui-justify-${p}`],[u,p=>p&&`g-ui-gap-${p}`],c)},t)}import{A as Mu,Div as pi,Span as Yr,when as di,after as Gr,state as Tu}from"@granularjs/core";function Vu(...e){let{props:i,rawProps:t,children:r}=g(e,{variant:"subtle",childrenOffset:24}),{label:a,description:o,leftSection:n,rightSection:u,active:c,disabled:d,variant:p,childrenOffset:w,opened:f,defaultOpened:l,className:b,padding:z,...$}=i,{onClick:D,onChange:C}=t,P=r.length>0,L=Tu(m(f)??m(l)??!1);Gr(f).change(h=>{let S=m(h);S!=null&&L.set(!!S)});let y=Gr(w).compute(h=>({paddingLeft:Gt(m(h??24))??"24px"})),k=h=>{if(m(d)){h?.preventDefault?.();return}if(P){let S=!L.get();L.set(S),C?.(S)}D?.(h)};return pi({className:s("g-ui-navlink-root",b)},Mu({...$,className:s("g-ui-navlink",N("g-ui-navlink-variant-",p,"subtle"),U("g-ui-navlink-active",c),U("g-ui-navlink-disabled",d),N("g-ui-navlink-padding-",z,"md")),onClick:k},di(n,()=>Yr({className:"g-ui-navlink-section g-ui-navlink-left"},n)),pi({className:"g-ui-navlink-body"},di(a,()=>pi({className:"g-ui-navlink-label"},a)),di(o,()=>pi({className:"g-ui-navlink-description"},o))),di(u,()=>Yr({className:"g-ui-navlink-section g-ui-navlink-right"},u))),P?di(L,()=>pi({className:"g-ui-navlink-children",style:y},r)):null)}import{Div as _r,when as Lu}from"@granularjs/core";function Iu(...e){let{props:i,children:t}=g(e,{show:!0,position:"top-right",color:"danger",size:"md"}),{show:r,position:a,color:o,size:n,className:u,...c}=i;return _r({...c,className:s("g-ui-indicator",N("g-ui-indicator-position-",a,"top-right"),N("g-ui-indicator-color-",o,"danger"),N("g-ui-indicator-size-",n,"md"),u)},t,Lu(r,()=>_r({className:"g-ui-indicator-badge"})))}import{Span as Bi}from"@granularjs/core";function $u(...e){let{props:i}=g(e),{opened:t,className:r,...a}=i;return Bi({...a,className:s("g-ui-burger",[t,"g-ui-burger-open"],r)},Bi(""),Bi(""),Bi(""))}import{Div as Au,when as Bu}from"@granularjs/core";function Fu(...e){let{props:i}=g(e),{visible:t,...r}=i;return Bu(t,()=>Au({...r,className:"g-ui-loading-overlay"},ai({})))}import{Div as Eu}from"@granularjs/core";function ju(...e){let{props:i,children:t}=g(e,{gap:"md"}),{className:r,gap:a,...o}=i;return Eu({...o,className:s("g-ui-grid-system",[a,n=>`g-ui-gap-${n}`],r)},t)}import{Div as Ru}from"@granularjs/core";function Hu(...e){let{props:i,children:t}=g(e,{span:12}),{span:r,className:a,...o}=i;return Ru({...o,className:s([r,n=>`g-ui-col-span-${n}`],a)},t)}import{Div as Zr,Input as Wu,after as $e,state as $t,when as Ur,list as Ou}from"@granularjs/core";function qu(...e){let{props:i,rawProps:t}=g(e,{length:4,size:"md",type:"alphanumeric",mask:!1,placeholder:"\u25CB",disabled:!1,error:!1,oneTimeCode:!1}),{length:r,value:a,size:o,type:n,mask:u,placeholder:c,disabled:d,error:p,oneTimeCode:w,className:f}=i,{onChange:l,onComplete:b}=t,z=$t(m(r)??4),$=()=>z.get();$e(r).change(M=>{let j=m(M)??4,x=z.get();if(j===x)return;z.set(j);let B=C.get(),R=D.get();C.set(Array.from({length:j},(q,Y)=>B[Y]??"")),D.set(Array.from({length:j},(q,Y)=>R[Y]??null))});let D=$t(Array.from({length:$()},()=>null)),C=$t(Array.from({length:$()},(M,j)=>{let x=m(a);return typeof x=="string"||Array.isArray(x)?x[j]??"":""}));$e(a).change(M=>{if(M==null)return;let j=$();typeof M=="string"?C.set(Array.from({length:j},(x,B)=>M[B]??"")):Array.isArray(M)&&C.set(Array.from({length:j},(x,B)=>M[B]??""))});let P=()=>C.get().join(""),L=M=>{C.set(M);let j=M.join("");l?.(j),M.every(x=>x!=="")&&M.length===$()&&b?.(j)},y=M=>{let j=$(),x=D.get();M>=0&&M<j&&x[M]&&(x[M].focus(),x[M].select())},k=()=>{let M=m(n);return M==="number"?/^[0-9]$/:M instanceof RegExp?M:/^[a-zA-Z0-9]$/},h=(M,j)=>{let x=j.target.value,B=k();if(x.length>1){S(M,x);return}if(x&&!B.test(x)){j.target.value=C.get()[M]??"";return}let R=C.get().slice();R[M]=x,L(R),x&&M<$()-1&&y(M+1)},S=(M,j)=>{let x=k(),B=j.split("").filter(oe=>x.test(oe)),R=C.get().slice(),q=$();B.forEach((oe,ve)=>{let ze=M+ve;ze<q&&(R[ze]=oe)}),L(R);let Y=R.findIndex((oe,ve)=>ve>=M&&oe==="");Y>=0?y(Y):y(Math.min(M+B.length,q-1))},V=(M,j)=>{if(j.key==="Backspace"){let x=C.get().slice();x[M]===""&&M>0?(j.preventDefault(),x[M-1]="",L(x),y(M-1)):x[M]!==""&&(x[M]="",L(x))}else j.key==="ArrowLeft"&&M>0?(j.preventDefault(),y(M-1)):j.key==="ArrowRight"&&M<$()-1&&(j.preventDefault(),y(M+1))},A=(M,j)=>{j.target.select()},Q=()=>{let M=C.get(),j=M.findIndex(x=>x==="");j>=0?y(j):y(M.length-1)},se=$e(u).compute(M=>m(M)?"password":"text"),te=$e(n).compute(M=>m(M)==="number"?"numeric":"text"),E=$e(w).compute(M=>m(M)?"one-time-code":"off"),G=$e(d).compute(M=>!!m(M)),J=$e(p).compute(M=>!!m(M)),re=$e(z).compute(M=>Array.from({length:M},(j,x)=>x)),X=M=>Wu({className:s("g-ui-pin-input-field",Ur(J,()=>"g-ui-pin-input-error")),type:se,inputMode:te,autocomplete:E,maxLength:2,placeholder:Ur(G,()=>"",()=>c),disabled:G,value:$e(C,M).compute(([j,x])=>j[x]??""),node:D[M.get()],onInput:j=>h(M.get(),j),onChange:j=>h(M.get(),j),onKeyDown:j=>V(M.get(),j),onFocus:j=>A(M.get(),j)});return Zr({className:s("g-ui-pin-input",N("g-ui-input-size-",o,"md"),f),onClick:Q},Zr({className:"g-ui-pin-input-wrapper"},Ou(re,X)))}import{Div as Yu}from"@granularjs/core";function Gu(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Yu({...a,className:s("g-ui-checkbox-group",r)},t)}import{Div as _u}from"@granularjs/core";function Zu(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return _u({...a,className:s("g-ui-avatar-group",r)},t)}import{Div as Uu}from"@granularjs/core";function Xu(...e){let{props:i,children:t}=g(e),{className:r,...a}=i;return Uu({...a,className:s("g-ui-badge-group",r)},t)}import{Div as Fi,Span as Ku,after as mi,context as Xr}from"@granularjs/core";var Qu=Xr([]),Kr=Xr({sort:null,onSort:null});function At(...e){let{props:i,rawProps:t,children:r}=g(e,{sizes:[],sort:null,stickyHeader:!1}),{className:a,sizes:o,sort:n,stickyHeader:u,...c}=i,{onSort:d}=t,p=Qu.scope(o.get());mi(o).change(f=>p.set(f));let w=Kr.scope({sort:n.get(),onSort:d||null});return mi(n).change(f=>w.set().sort=f),p.serve(w.serve(Fi({className:s("g-ui-grid-table",U("g-ui-grid-table-sticky",u),a),style:{gridTemplateColumns:mi(p).compute(f=>Array.isArray(f)?f.join(" "):"")},...c},r)))}At.GridRow=(...e)=>{let{props:i,children:t}=g(e,{}),{className:r,header:a,...o}=i;return Fi({className:s("g-ui-grid-table-row",U("g-ui-grid-table-row-header",a),r),...o},...t)};At.GridCell=function(...e){let{props:i,rawProps:t,children:r}=g(e,{}),{className:a,sort:o,...n}=i,u=t.sort;if(u){let c=Kr.state(),d=mi(c.sort).compute(w=>w?.key===u?w.direction:null),p=()=>{let w=c.get().sort,f;w?.key===u?f=w.direction==="asc"?{key:u,direction:"desc"}:null:f={key:u,direction:"asc"},c.set().sort=f;let{onSort:l}=c.get();l&&l(f)};return Fi({className:s("g-ui-grid-table-cell","g-ui-grid-table-cell-sortable",a),onClick:p,...n},r,Ku({className:"g-ui-grid-table-sort-icon"},mi(d).compute(w=>w==="asc"?" \u2191":w==="desc"?" \u2193":"")))}return Fi({className:s("g-ui-grid-table-cell",a),...n},r)};import{Button as Ju,Div as eg,Span as Qr,when as Jr}from"@granularjs/core";function ea(...e){let{props:i,children:t}=g(e,{grow:!0}),{grow:r,className:a,...o}=i;return eg({...o,className:s("g-ui-bottombar",U("g-ui-bottombar-grow",r),a)},t)}ea.Action=function(...i){let{props:t,rawProps:r,children:a}=g(i,{variant:"subtle"}),{icon:o,label:n,active:u,disabled:c,variant:d,className:p,...w}=t,{onClick:f}=r;return Ju({...w,className:s("g-ui-bottombar-action",N("g-ui-bottombar-action-variant-",d,"subtle"),U("g-ui-bottombar-action-active",u),U("g-ui-bottombar-action-disabled",c),p),onClick:f,disabled:c},Jr(o,()=>Qr({className:"g-ui-bottombar-action-icon"},o)),Jr(n,()=>Qr({className:"g-ui-bottombar-action-label"},n)),a)};import{Div as W,Button as Ye,state as de,after as Ce,when as me,Input as Ei,Label as fi,Span as Ge}from"@granularjs/core";var ig=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tg=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"}];function ji(e){if(e instanceof Date)return e;if(e==null)return null;let i=new Date(e);return Number.isNaN(i.getTime())?null:i}function ra(e){let i=ji(e.start),t=ji(e.end);return!i||!t?null:{...e,id:e.id??`${i.getTime()}-${e.title??"event"}`,title:e.title??"",start:i,end:t,allDay:!!e.allDay,description:e.description??"",location:e.location??"",attendees:Array.isArray(e.attendees)?e.attendees:[],color:e.color??null}}function aa(e,i,t){let r=ji(i).getTime(),a=ji(t).getTime();return e.map(ra).filter(Boolean).filter(o=>o.end.getTime()>r&&o.start.getTime()<a)}function ia(e,i){let t=new Date(i);t.setHours(0,0,0,0);let r=t.getTime();t.setHours(23,59,59,999);let a=t.getTime();return aa(e,r,a)}function Bt(e,i){let t=new Date(e),a=(t.getDay()-i+7)%7;return t.setDate(t.getDate()-a),t.setHours(0,0,0,0),t}function Je(e,i="default"){return e.toLocaleTimeString(i,{hour:"numeric",minute:"2-digit",hour12:!0})}function hi(e,i="default"){return e.toLocaleDateString(i,{weekday:"short",month:"short",day:"numeric"})}function rg(e,i="default"){return e.toLocaleDateString(i,{month:"long",year:"numeric"})}function ag(e,i="default"){let t=new Date(e);return t.setDate(t.getDate()+6),`${e.toLocaleDateString(i,{month:"short",day:"numeric"})} \u2013 ${t.toLocaleDateString(i,{month:"short",day:"numeric",year:"numeric"})}`}function ta(e,i,t,r){let a=new Date(e).setHours(t,0,0,0),o=new Date(e).setHours(r,0,0,0),n=(r-t)*60,u=Math.max(e.getTime(),a),d=(Math.min(i.getTime(),o)-u)/6e4,p=(u-a)/6e4/n*100,w=d/n*100;return{top:p,height:w}}function og(...e){let{props:i,rawProps:t}=g(e,{defaultView:"month",firstDayOfWeek:0,locale:"default",hourSlotDuration:30,minTime:6,maxTime:22,eventCreationColorOptions:[]}),{events:r=[],defaultView:a,firstDayOfWeek:o,locale:n,hourSlotDuration:u,minTime:c,maxTime:d,eventCreationColorOptions:p,className:w,...f}=i,{onCreateEventRequest:l,onViewEventRequest:b,onUpdateEventRequest:z,onRemoveEventRequest:$,eventCreationEmailLookup:D,eventCreationLocationsCallback:C,eventCreationCalendarsCallback:P,onSlotClick:L,onDateRangeChange:y}=t,k=de(m(a)??"month"),h=de(new Date),S=de(null),V=de(null),A=de({title:"",start:null,end:null,allDay:!1,description:"",location:"",attendees:[],color:null}),Q=Ce(r).compute(v=>Array.isArray(v)?v:[]),se=h.get(),te=Bt(se,m(o)??0),E=m(c)??6,G=m(d)??22,J=m(u)??30,re=()=>{let v=new Date(h.get());k.get()==="month"?v.setMonth(v.getMonth()-1):k.get()==="week"?v.setDate(v.getDate()-7):v.setDate(v.getDate()-1),h.set(v),y?.({start:v,end:v,view:k.get()})},X=()=>{let v=new Date(h.get());k.get()==="month"?v.setMonth(v.getMonth()+1):k.get()==="week"?v.setDate(v.getDate()+7):v.setDate(v.getDate()+1),h.set(v),y?.({start:v,end:v,view:k.get()})},M=()=>{let v=new Date;h.set(v),y?.({start:v,end:v,view:k.get()})},j=(v,H,ce=!1)=>{let Z=v?new Date(v):new Date(h.get()),ge=H?new Date(H):new Date(Z.getTime()+3600*1e3);ce&&(Z.setHours(0,0,0,0),ge.setHours(23,59,59,999)),A.set({title:"",start:Z,end:ge,allDay:ce,description:"",location:"",attendees:[],color:null}),S.set("create")},x=v=>{V.set(ra(v)),S.set("view"),b?.(v)},B=()=>{let v=V.get();v&&(A.set({title:v.title,start:new Date(v.start),end:new Date(v.end),allDay:v.allDay,description:v.description??"",location:v.location??"",attendees:[...v.attendees||[]],color:v.color??null}),S.set("edit"))},R=()=>{S.set(null),V.set(null)},q=(v,H,ce)=>{if(L){L({date:v,hour:H,allDay:ce});return}let Z=new Date(v);if(ce){Z.setHours(0,0,0,0);let ge=new Date(Z);ge.setHours(23,59,59,999),j(Z,ge,!0)}else{Z.setHours(H,0,0,0);let ge=new Date(Z.getTime()+J*60*1e3);j(Z,ge,!1)}},Y=()=>{let v=A.get();!v.start||!v.end||l?.({title:v.title,start:v.start,end:v.end,allDay:v.allDay,description:v.description,location:v.location,attendees:v.attendees,color:v.color},()=>{R()})},oe=()=>{let v=V.get(),H=A.get();!v||!H.start||!H.end||z?.(v,{title:H.title,start:H.start,end:H.end,allDay:H.allDay,description:H.description,location:H.location,attendees:H.attendees,color:H.color},()=>R())},ve=()=>{let v=V.get();v&&$?.(v,()=>R())},ze=Ce(k,h).compute(([v,H])=>v==="month"?rg(H,m(n)):v==="week"?ag(Bt(H,m(o)??0),m(n)):hi(H,m(n))),Pe=W({className:"g-ui-event-calendar-header"},W({className:"g-ui-event-calendar-nav-group"},Oe({size:"sm",variant:"subtle",onClick:re,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:wi})),Oe({size:"sm",variant:"subtle",onClick:X,className:"g-ui-event-calendar-nav"},ye({size:"sm",innerHTML:xi})),Ye({type:"button",variant:"subtle",size:"sm",className:"g-ui-event-calendar-today",onClick:M},ye({size:"sm",className:"g-ui-event-calendar-today-icon",innerHTML:tr}),"Today")),W({className:"g-ui-event-calendar-title"},ze),W({className:"g-ui-event-calendar-actions"},tg.map(v=>W({className:s("g-ui-event-calendar-view-option",Ce(k).compute(H=>H===v.value?"g-ui-event-calendar-view-option-active":"")),onClick:()=>{k.set(v.value),y?.({start:h.get(),end:h.get(),view:v.value})}},v.label)),Ye({type:"button",variant:"filled",size:"sm",className:"g-ui-event-calendar-create-btn",onClick:()=>j(h.get(),null,!1)},ye({size:"sm",innerHTML:Jt}),"Create"))),_e=Ce(h,Q,o).compute(([v,H,ce])=>{let Z=v.getFullYear(),ge=v.getMonth(),ue=(new Date(Z,ge,1).getDay()-(ce??0)+7)%7,Te=new Date(Z,ge+1,0).getDate(),Ve=new Date(Z,ge,0).getDate(),I=[],T=1,O=1,_=Math.ceil((ue+Te)/7)*7,ae=[];for(let ee=0;ee<_;ee+=1){let K,ie,le;ee<ue?(K=Ve-ue+ee+1,le=new Date(Z,ge-1,K),ie=!1):T<=Te?(K=T,le=new Date(Z,ge,K),ie=!0,T+=1):(K=O,le=new Date(Z,ge+1,K),ie=!1,O+=1);let xe=ia(H,le),Ae=le.getDate()===new Date().getDate()&&le.getMonth()===new Date().getMonth()&&le.getFullYear()===new Date().getFullYear();ae.push(W({key:le.getTime(),className:s("g-ui-event-calendar-month-cell",!ie&&"g-ui-event-calendar-month-cell-outside",Ae&&"g-ui-event-calendar-month-cell-today")},W({className:"g-ui-event-calendar-month-cell-header",onClick:()=>q(le,0,!0)},Ge({className:"g-ui-event-calendar-month-cell-day"},le.getDate())),W({className:"g-ui-event-calendar-month-cell-events"},xe.slice(0,3).map(Se=>W({key:Se.id,className:"g-ui-event-calendar-month-event",style:Se.color?{borderLeftColor:Se.color,backgroundColor:`${Se.color}20`}:{},onClick:Oi=>{Oi.stopPropagation(),x(Se)}},Se.title||"(No title)")),me(xe.length>3,()=>W({className:"g-ui-event-calendar-month-more",onClick:Se=>{Se.stopPropagation(),x(xe[3])}},`+${xe.length-3} more`)))))}return ae}),Ze=W({className:"g-ui-event-calendar-month"},W({className:"g-ui-event-calendar-weekdays"},ig.map(v=>W({key:v,className:"g-ui-event-calendar-weekday"},v))),W({className:"g-ui-event-calendar-month-grid"},_e)),Me=[];for(let v=E;v<G;v+=1)for(let H=0;H<60;H+=J)Me.push(v+H/60);let ei=Ce(h,o).compute(([v,H])=>{let ce=Bt(v,H??0),Z=[];for(let ge=0;ge<7;ge+=1){let fe=new Date(ce);fe.setDate(fe.getDate()+ge),Z.push(fe)}return Z}),Ri=W({className:"g-ui-event-calendar-week"},Ce(ei).compute(v=>W({className:"g-ui-event-calendar-week-days"},W({className:"g-ui-event-calendar-week-time-col"},""),(v||[]).map(H=>W({key:H.getTime(),className:"g-ui-event-calendar-week-day-col"},W({className:"g-ui-event-calendar-week-day-header"},hi(H,m(n))))))),W({className:"g-ui-event-calendar-week-body"},W({className:"g-ui-event-calendar-week-time-col"},Me.map(v=>{let H=Math.floor(v),ce=(v-H)*60,Z=`${H<=12?H:H-12}:${ce===0?"00":ce} ${H<12?"AM":"PM"}`;return W({key:v,className:"g-ui-event-calendar-week-slot-label"},Z)})),Ce(ei,Q).compute(([v,H])=>{if(!v||!v.length)return null;let ce=v[0],Z=new Date(v[6]);Z.setHours(23,59,59,999);let ge=aa(H,ce,Z);return W({className:"g-ui-event-calendar-week-grid-cols"},v.map(fe=>W({key:fe.getTime(),className:"g-ui-event-calendar-week-day-col g-ui-event-calendar-week-day-col-body"},Me.map(ue=>W({key:ue,className:"g-ui-event-calendar-week-slot",onClick:()=>q(fe,ue,!1)})),ge.filter(ue=>!ue.allDay&&ue.start.getDate()===fe.getDate()&&ue.start.getMonth()===fe.getMonth()&&ue.start.getFullYear()===fe.getFullYear()).map(ue=>{let{top:Te,height:Ve}=ta(ue.start,ue.end,E,G);return W({key:ue.id,className:"g-ui-event-calendar-week-event",style:{top:`${Te}%`,height:`${Ve}%`,borderLeftColor:ue.color||"var(--g-ui-primary)"},onClick:I=>{I.stopPropagation(),x(ue)}},W({className:"g-ui-event-calendar-week-event-title"},ue.title||"(No title)"),me(!ue.allDay,()=>Ge({className:"g-ui-event-calendar-week-event-time"},`${Je(ue.start,m(n))} \u2013 ${Je(ue.end,m(n))}`)))}))))}))),Hi=W({className:"g-ui-event-calendar-day"},W({className:"g-ui-event-calendar-day-body"},W({className:"g-ui-event-calendar-day-time-col"},Me.map(v=>{let H=Math.floor(v),ce=(v-H)*60,Z=`${H<=12?H:H-12}:${ce===0?"00":ce} ${H<12?"AM":"PM"}`;return W({key:v,className:"g-ui-event-calendar-day-slot-label"},Z)})),W({className:"g-ui-event-calendar-day-slots"},Me.map(v=>W({key:v,className:"g-ui-event-calendar-day-slot",onClick:()=>q(h.get(),v,!1)})),Ce(Q,h).compute(([v,H])=>H?ia(v,H).filter(Z=>!Z.allDay).map(Z=>{let{top:ge,height:fe}=ta(Z.start,Z.end,E,G);return W({key:Z.id,className:"g-ui-event-calendar-day-event",style:{top:`${ge}%`,height:`${fe}%`,borderLeftColor:Z.color||"var(--g-ui-primary)"},onClick:ue=>{ue.stopPropagation(),x(Z)}},W({className:"g-ui-event-calendar-day-event-title"},Z.title||"(No title)"),Ge({className:"g-ui-event-calendar-day-event-time"},`${Je(Z.start,m(n))} \u2013 ${Je(Z.end,m(n))}`))}):[])))),vi=v=>{let H=A.get(),ce=new Date,Z=H.start||ce,ge=H.end||new Date(ce.getTime()+3600*1e3),fe=de(H.title),ue=de(Z.toISOString().slice(0,10)),Te=de(!H.allDay&&Z?Z.toTimeString().slice(0,5):"09:00"),Ve=de(ge.toISOString().slice(0,10)),I=de(!H.allDay&&ge?ge.toTimeString().slice(0,5):"10:00"),T=de(H.allDay),O=de(H.description),_=de(H.location),ae=de(H.attendees||[]),ee=de(""),K=de([]),ie=de([]),le=de(""),xe=Array.isArray(p)?p:[],Ae=de(H.color),Se=()=>{let F=new Date(ue.get()+"T"+(T.get()?"00:00:00":Te.get()+":00")),we=new Date(Ve.get()+"T"+(T.get()?"23:59:59":I.get()+":00"));A.set({title:fe.get(),start:F,end:we,allDay:T.get(),description:O.get(),location:_.get(),attendees:ae.get(),color:Ae.get()})},Oi=F=>{if(ee.set(F),!D||!F.trim()){K.set([]);return}Promise.resolve(D(F.trim())).then(we=>K.set(Array.isArray(we)?we:[])).catch(()=>K.set([]))},oa=F=>{let we=ae.get();we.some(Et=>(Et.email||Et.id)===(F.email||F.id))||(ae.set([...we,{id:F.id,email:F.email??F.label,label:F.label}]),ee.set(""),K.set([]))},na=F=>{let we=[...ae.get()];we.splice(F,1),ae.set(we)},Ft=()=>{C&&Promise.resolve(C(le.get())).then(F=>ie.set(Array.isArray(F)?F:[])).catch(()=>ie.set([]))};return W({className:"g-ui-event-calendar-form"},W({className:"g-ui-event-calendar-form-row"},be({label:"Title",placeholder:"Event title",value:fe,onInput:F=>fe.set(F?.target?.value??"")})),W({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},rt({label:"All day",checked:T,onChange:F=>T.set(F)})),W({className:"g-ui-event-calendar-form-row g-ui-event-calendar-form-row-inline"},W({className:"g-ui-event-calendar-form-field"},fi({className:"g-ui-event-calendar-form-label"},"Start"),Ei({type:"date",className:"g-ui-input g-ui-input-size-md",value:ue,onInput:F=>ue.set(F?.target?.value??"")}),me(!T,()=>Ei({type:"time",className:"g-ui-input g-ui-input-size-md",value:Te,onInput:F=>Te.set(F?.target?.value??"")}))),W({className:"g-ui-event-calendar-form-field"},fi({className:"g-ui-event-calendar-form-label"},"End"),Ei({type:"date",className:"g-ui-input g-ui-input-size-md",value:Ve,onInput:F=>Ve.set(F?.target?.value??"")}),me(!T,()=>Ei({type:"time",className:"g-ui-input g-ui-input-size-md",value:I,onInput:F=>I.set(F?.target?.value??"")})))),me(C,()=>W({className:"g-ui-event-calendar-form-row"},fi({className:"g-ui-event-calendar-form-label"},"Location"),be({placeholder:"Search or type location",value:le,onInput:F=>{le.set(F?.target?.value??""),Ft()},onFocus:Ft}),me(Ce(ie).compute(F=>F&&F.length>0),()=>W({className:"g-ui-event-calendar-form-suggestions"},ie.get().map(F=>W({key:F.id??F.label,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>{_.set(F.label??F.id),le.set(""),ie.set([])}},F.label??F.id)))),me(Ce(_).compute(F=>!!F),()=>Ge({className:"g-ui-event-calendar-form-chip"},_)))),me(D,()=>W({className:"g-ui-event-calendar-form-row"},fi({className:"g-ui-event-calendar-form-label"},"Add guests"),be({placeholder:"Type email to search",value:ee,onInput:F=>Oi(F?.target?.value??"")}),W({className:"g-ui-event-calendar-form-chips"},ae.get().map((F,we)=>Ge({key:(F.email||F.id)+we,className:"g-ui-event-calendar-form-chip g-ui-event-calendar-form-chip-removable",onClick:()=>na(we)},F.label||F.email||F.id," \xD7"))),me(Ce(K).compute(F=>F&&F.length>0),()=>W({className:"g-ui-event-calendar-form-suggestions"},K.get().map(F=>W({key:F.id??F.email,className:"g-ui-event-calendar-form-suggestion-item",onClick:()=>oa(F)},F.label??F.email??F.id)))))),W({className:"g-ui-event-calendar-form-row"},Ki({label:"Description",placeholder:"Add description",value:O,onInput:F=>O.set(F?.target?.value??"")})),me(xe.length>0,()=>W({className:"g-ui-event-calendar-form-row"},fi({className:"g-ui-event-calendar-form-label"},"Color"),W({className:"g-ui-event-calendar-form-colors"},xe.map(F=>W({key:F.value??F.id??F,className:s("g-ui-event-calendar-form-color-swatch",Ce(Ae).compute(we=>we===(F.value??F.id??F)?"g-ui-event-calendar-form-color-swatch-active":"")),style:{backgroundColor:F.color??F.value??F},onClick:()=>Ae.set(F.value??F.id??F)}))))),W({className:"g-ui-event-calendar-form-actions"},Ye({variant:"subtle",onClick:R},"Cancel"),Ye({variant:"filled",onClick:()=>{Se(),v?oe():Y()}},v?"Save":"Create")))},Wi=()=>{let v=V.get();return v?W({className:"g-ui-event-calendar-view-modal"},W({className:"g-ui-event-calendar-view-modal-title"},v.title||"(No title)"),W({className:"g-ui-event-calendar-view-modal-meta"},v.allDay?Ge({className:"g-ui-event-calendar-view-modal-date"},hi(v.start,m(n))+(v.start.getTime()!==v.end.getTime()?` \u2013 ${hi(v.end,m(n))}`:"")):Ge({className:"g-ui-event-calendar-view-modal-date"},`${hi(v.start,m(n))} \xB7 ${Je(v.start,m(n))} \u2013 ${Je(v.end,m(n))}`)),me(v.location,()=>W({className:"g-ui-event-calendar-view-modal-field"},"Location: ",v.location)),me(v.description,()=>W({className:"g-ui-event-calendar-view-modal-field"},v.description)),me(v.attendees?.length,()=>W({className:"g-ui-event-calendar-view-modal-field"},"Guests: ",v.attendees.map(H=>H.label||H.email||H.id).join(", "))),W({className:"g-ui-event-calendar-view-modal-actions"},Ye({variant:"subtle",size:"sm",onClick:B},ye({size:"sm",innerHTML:er})," Edit"),Ye({variant:"subtle",size:"sm",onClick:ve,className:"g-ui-event-calendar-view-modal-delete"},ye({size:"sm",innerHTML:ir})," Delete"),Ye({variant:"filled",size:"sm",onClick:R},"Close"))):null};return W({...f,className:s("g-ui-event-calendar",w)},Pe,me(k,v=>v==="month",()=>Ze),me(k,v=>v==="week",()=>Ri),me(k,v=>v==="day",()=>Hi),me(S,v=>v==="create",()=>ri({opened:!0,title:"New event",size:"lg",onClose:R},vi(!1))),me(S,v=>v==="view",()=>ri({opened:!0,title:"Event",size:"md",onClose:R},Wi())),me(S,v=>v==="edit",()=>ri({opened:!0,title:"Edit event",size:"lg",onClose:R},vi(!0))))}import{state as ng}from"@granularjs/core";function sg(e=!1){let i=ng(!!e);return[i,{open:()=>i.set(!0),close:()=>i.set(!1),toggle:()=>i.set(!i.get())}]}Rt();export{Bo as Accordion,Oe as ActionIcon,ls as Affix,Jo as Alert,yn as Anchor,hs as AppBar,It as Autocomplete,an as Avatar,Zu as AvatarGroup,Ya as Badge,Xu as BadgeGroup,ln as Blockquote,ea as BottomBar,Xn as Breadcrumbs,$u as Burger,Zi as Button,ui as Calendar,Oa as Card,Qn as Center,rt as Checkbox,Gu as CheckboxGroup,In as Chip,un as Code,Hu as Col,rs as Collapse,Fa as Container,fu as CopyButton,$i as DateInput,Us as DatePicker,Zo as Divider,qo as Drawer,og as EventCalendar,ms as Fieldset,Pu as Flex,ju as Grid,At as GridTable,Ha as Group,us as HoverCard,ye as Icon,zn as Image,Iu as Indicator,nn as Kbd,br as List,ai as Loading,Fu as LoadingOverlay,Ho as Menu,ri as Modal,Ws as MultiSelect,Vu as NavLink,ct as Notification,Qs as Notifications,Qi as NumberField,eo as NumberInput,jn as Pagination,Xo as Paper,gu as PasswordInput,qu as PinInput,Nt as Popover,ou as Popper,Nn as Progress,vu as ProgressRing,_n as Radio,Wn as RadioGroup,Su as RangePicker,iu as RangeSlider,Fs as Rating,Vt as ScrollArea,cu as SearchInput,Bn as SegmentedControl,xo as Select,ku as SelectSearch,bs as Sidebar,pn as SimpleGrid,Tn as Skeleton,Dn as Slider,es as Space,ja as Stack,As as Stepper,vo as Switch,lo as SwitchGroup,To as Table,zo as Tabs,js as Tag,Ui as Text,be as TextInput,Ki as Textarea,Is as Timeline,Aa as Title,Pt as Toast,Zs as ToastStack,Fo as Tooltip,U as classFlag,he as classMap,N as classVar,s as cx,za as getThemeMode,ka as setThemeMode,ya as setThemeVars,g as splitPropsChildren,sg as useDisclosure};
|
|
3882
4123
|
//# sourceMappingURL=granular-ui.min.js.map
|