@bfrs/agentic-components 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,54 +1,48 @@
1
- import { jsxs as c, jsx as t, Fragment as Ae } from "react/jsx-runtime";
2
- import { Root as Ie, Portal as De, Overlay as It, Content as Dt, Title as Vt, Description as Wt } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
- import { Root as Bt, Trigger as Ot, Portal as Ht, Content as Lt } from "../../../node_modules/@radix-ui/react-popover/dist/index.js";
4
- import { BookmarkSimple as Et } from "../../../node_modules/@phosphor-icons/react/dist/csr/BookmarkSimple.es.js";
5
- import { CaretDown as Pt } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
6
- import { DotsThreeVertical as Ve } from "../../../node_modules/@phosphor-icons/react/dist/csr/DotsThreeVertical.es.js";
7
- import { Info as Ft } from "../../../node_modules/@phosphor-icons/react/dist/csr/Info.es.js";
8
- import { PencilSimple as jt } from "../../../node_modules/@phosphor-icons/react/dist/csr/PencilSimple.es.js";
9
- import { Star as K } from "../../../node_modules/@phosphor-icons/react/dist/csr/Star.es.js";
10
- import { Trash as Nt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Trash.es.js";
11
- import { useRef as A, useMemo as le, useState as p, useId as $t, useEffect as N, useCallback as $ } from "react";
1
+ import { jsxs as c, jsx as t, Fragment as We } from "react/jsx-runtime";
2
+ import { Root as Pe, Portal as Be, Overlay as Wt, Content as Pt, Title as Bt, Description as Lt } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
+ import { Root as Ot, Trigger as Ht, Portal as Et, Content as Ft } from "../../../node_modules/@radix-ui/react-popover/dist/index.js";
4
+ import { BookmarkSimple as jt } from "../../../node_modules/@phosphor-icons/react/dist/csr/BookmarkSimple.es.js";
5
+ import { CaretDown as Nt } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
6
+ import { DotsThreeVertical as Le } from "../../../node_modules/@phosphor-icons/react/dist/csr/DotsThreeVertical.es.js";
7
+ import { Info as Kt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Info.es.js";
8
+ import { PencilSimple as Mt } from "../../../node_modules/@phosphor-icons/react/dist/csr/PencilSimple.es.js";
9
+ import { Star as q } from "../../../node_modules/@phosphor-icons/react/dist/csr/Star.es.js";
10
+ import { Trash as $t } from "../../../node_modules/@phosphor-icons/react/dist/csr/Trash.es.js";
11
+ import { useRef as y, useMemo as se, useState as m, useId as qt, useEffect as M, useCallback as $ } from "react";
12
12
  import i from "@emotion/styled";
13
- import { IconButton as We, Button as M } from "../../primitives/Button/Button.js";
14
- import { twRing as de, twTransform as Ke, kfContentIn as Kt, kfOverlayIn as Mt, kfModalContentIn as qt } from "../../../lib/emotionTw.js";
15
- import { floatingCollisionPadding as Yt } from "../../ui/overlays/overlayPositioning.js";
16
- import { createTableViewSelectorStore as Gt, isReservedViewName as Be } from "./viewStore.js";
17
- import { BfrsPortalScope as ce } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
18
- import { Tooltip as Jt } from "../../ui/overlays/Tooltip/Tooltip.js";
19
- import { ActionMenu as Oe } from "../../navigation/ActionMenu/ActionMenu.js";
13
+ import { IconButton as Oe, Button as Y } from "../../primitives/Button/Button.js";
14
+ import { twRing as fe, twTransform as Ge, kfContentIn as Yt, kfOverlayIn as Gt, kfModalContentIn as Jt } from "../../../lib/emotionTw.js";
15
+ import { floatingCollisionPadding as Qt } from "../../ui/overlays/overlayPositioning.js";
16
+ import { createTableViewSelectorStore as Xt, isReservedViewName as He } from "./viewStore.js";
17
+ import { BfrsPortalScope as de } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
18
+ import { Tooltip as Zt } from "../../ui/overlays/Tooltip/Tooltip.js";
19
+ import { ActionMenu as Ee } from "../../navigation/ActionMenu/ActionMenu.js";
20
20
  const D = {
21
21
  "--tw-text-opacity": "1",
22
22
  color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
23
- }, V = {
23
+ }, W = {
24
24
  "--tw-text-opacity": "1",
25
25
  color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
26
- }, ue = {
26
+ }, pe = {
27
27
  "--tw-bg-opacity": "1",
28
28
  backgroundColor: "hsl(var(--bfrs-color-surface-card) / var(--tw-bg-opacity, 1))"
29
- }, Me = {
29
+ }, me = {
30
30
  "--tw-bg-opacity": "1",
31
31
  backgroundColor: "hsl(var(--bfrs-color-primary-soft) / var(--tw-bg-opacity, 1))"
32
- }, Qt = {
33
- "--tw-bg-opacity": "1",
34
- backgroundColor: "hsl(var(--bfrs-color-surface-muted) / var(--tw-bg-opacity, 1))"
35
- }, Xt = {
36
- "--tw-bg-opacity": "1",
37
- backgroundColor: "hsl(var(--bfrs-color-primary-border) / var(--tw-bg-opacity, 1))"
38
- }, Zt = {
32
+ }, Ut = {
39
33
  backgroundColor: "#F6F9F6"
40
- }, me = {
34
+ }, he = {
41
35
  "--tw-border-opacity": "1",
42
36
  borderColor: "hsl(var(--bfrs-color-border) / var(--tw-border-opacity, 1))"
43
- }, Ut = /* @__PURE__ */ i("div", {
37
+ }, er = /* @__PURE__ */ i("div", {
44
38
  label: "AgenticTableViewSelector-root"
45
39
  })({
46
40
  display: "inline-flex",
47
41
  minWidth: "0px"
48
- }), er = /* @__PURE__ */ i("button", {
42
+ }), tr = /* @__PURE__ */ i("button", {
49
43
  label: "AgenticTableViewSelector-trigger",
50
- shouldForwardProp: (o) => o !== "ownerState"
51
- })(({ ownerState: o }) => [
44
+ shouldForwardProp: (n) => n !== "ownerState"
45
+ })(({ ownerState: n }) => [
52
46
  {
53
47
  display: "inline-flex",
54
48
  minWidth: "0px",
@@ -58,7 +52,7 @@ const D = {
58
52
  gap: ".5rem",
59
53
  borderRadius: "7px",
60
54
  borderWidth: "1px",
61
- ...Zt,
55
+ ...Ut,
62
56
  paddingLeft: ".75rem",
63
57
  paddingRight: ".75rem",
64
58
  fontSize: "12px",
@@ -70,14 +64,14 @@ const D = {
70
64
  transitionProperty: "color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",
71
65
  transitionTimingFunction: "cubic-bezier(0,0,.2,1)",
72
66
  transitionDuration: ".15s",
73
- "&:hover": Me,
74
- "&:focus-visible": de("2px", "hsl(var(--bfrs-color-border-focus) / .25)"),
67
+ "&:hover": me,
68
+ "&:focus-visible": fe("2px", "hsl(var(--bfrs-color-border-focus) / .25)"),
75
69
  "&:disabled": {
76
70
  pointerEvents: "none",
77
71
  opacity: ".55"
78
72
  }
79
73
  },
80
- o.size === "sm" ? { height: "1.75rem" } : { height: "2.25rem" },
74
+ n.size === "sm" ? { height: "1.75rem" } : { height: "2.25rem" },
81
75
  // Stays highlighted once a view is selected, not just while the popover is
82
76
  // open — matches the data-filled convention every other Select-like
83
77
  // trigger in the library already follows (Select, MultiSelect,
@@ -85,14 +79,14 @@ const D = {
85
79
  // "Default" is a real selection, not an empty trigger, so it carries the same
86
80
  // emphasized border as a named view. border-focus is the ink colour (#29343D
87
81
  // in light) and flips light in dark mode — a literal black would not.
88
- o.open || o.filled || o.defaultSelected ? {
82
+ n.open || n.filled || n.defaultSelected ? {
89
83
  "--tw-border-opacity": "1",
90
84
  borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))"
91
- } : me,
85
+ } : he,
92
86
  // Default is a selected, built-in view. It must use the same primary text
93
87
  // colour as a selected saved view; only a genuinely empty trigger is muted.
94
- o.empty && !o.defaultSelected && V
95
- ]), tr = /* @__PURE__ */ i("span", {
88
+ n.empty && !n.defaultSelected && W
89
+ ]), rr = /* @__PURE__ */ i("span", {
96
90
  label: "AgenticTableViewSelector-triggerLabel"
97
91
  })({
98
92
  minWidth: "0px",
@@ -100,25 +94,25 @@ const D = {
100
94
  overflow: "hidden",
101
95
  textOverflow: "ellipsis",
102
96
  whiteSpace: "nowrap"
103
- }), se = /* @__PURE__ */ i(K, {
97
+ }), ue = /* @__PURE__ */ i(q, {
104
98
  label: "AgenticTableViewSelector-primaryStar"
105
99
  })({
106
100
  flexShrink: 0,
107
101
  "--tw-text-opacity": "1",
108
102
  color: "hsl(var(--bfrs-color-warning) / var(--tw-text-opacity, 1))"
109
- }), rr = /* @__PURE__ */ i(Pt, {
103
+ }), nr = /* @__PURE__ */ i(Nt, {
110
104
  label: "AgenticTableViewSelector-caret",
111
- shouldForwardProp: (o) => o !== "ownerState"
112
- })(({ ownerState: o }) => [
105
+ shouldForwardProp: (n) => n !== "ownerState"
106
+ })(({ ownerState: n }) => [
113
107
  {
114
108
  flexShrink: 0,
115
- ...V,
109
+ ...W,
116
110
  transitionProperty: "transform",
117
111
  transitionTimingFunction: "cubic-bezier(.4,0,.2,1)",
118
112
  transitionDuration: ".15s"
119
113
  },
120
- o.open && Ke({ "--tw-rotate": "180deg" })
121
- ]), or = /* @__PURE__ */ i(Lt, {
114
+ n.open && Ge({ "--tw-rotate": "180deg" })
115
+ ]), ir = /* @__PURE__ */ i(Ft, {
122
116
  label: "AgenticTableViewSelector-content"
123
117
  })({
124
118
  zIndex: 1e3,
@@ -126,16 +120,16 @@ const D = {
126
120
  overflow: "hidden",
127
121
  borderRadius: "var(--bfrs-radius-lg)",
128
122
  borderWidth: "1px",
129
- ...me,
130
- ...ue,
123
+ ...he,
124
+ ...pe,
131
125
  "--tw-shadow": "var(--bfrs-shadow-elevated)",
132
126
  "--tw-shadow-colored": "var(--bfrs-shadow-elevated)",
133
127
  boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
134
128
  outline: "2px solid transparent",
135
129
  outlineOffset: "2px",
136
- ...Kt,
130
+ ...Yt,
137
131
  animation: "bfrs-bfrs-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
138
- }), ir = /* @__PURE__ */ i("div", {
132
+ }), or = /* @__PURE__ */ i("div", {
139
133
  label: "AgenticTableViewSelector-header"
140
134
  })({
141
135
  display: "flex",
@@ -150,8 +144,8 @@ const D = {
150
144
  fontWeight: 700,
151
145
  letterSpacing: ".08em",
152
146
  textTransform: "uppercase",
153
- ...V
154
- }), nr = /* @__PURE__ */ i("span", {
147
+ ...W
148
+ }), ar = /* @__PURE__ */ i("span", {
155
149
  label: "AgenticTableViewSelector-headerInfo"
156
150
  })({
157
151
  display: "inline-flex",
@@ -165,12 +159,12 @@ const D = {
165
159
  // either or it renders offset from the cap height.
166
160
  letterSpacing: "normal",
167
161
  cursor: "default",
168
- ...V,
162
+ ...W,
169
163
  "&:hover": {
170
164
  "--tw-text-opacity": "1",
171
165
  color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
172
166
  }
173
- }), ar = /* @__PURE__ */ i("div", {
167
+ }), lr = /* @__PURE__ */ i("div", {
174
168
  label: "AgenticTableViewSelector-list"
175
169
  })({
176
170
  display: "flex",
@@ -178,7 +172,7 @@ const D = {
178
172
  flexDirection: "column",
179
173
  overflowY: "auto",
180
174
  paddingBottom: ".25rem"
181
- }), qe = /* @__PURE__ */ i("div", {
175
+ }), Je = /* @__PURE__ */ i("div", {
182
176
  label: "AgenticTableViewSelector-row"
183
177
  })({
184
178
  display: "flex",
@@ -187,7 +181,7 @@ const D = {
187
181
  gap: ".375rem",
188
182
  paddingLeft: ".5rem",
189
183
  paddingRight: ".625rem"
190
- }), lr = /* @__PURE__ */ i(qe, {
184
+ }), cr = /* @__PURE__ */ i(Je, {
191
185
  label: "AgenticTableViewSelector-defaultRow"
192
186
  })({
193
187
  marginLeft: ".5rem",
@@ -196,7 +190,7 @@ const D = {
196
190
  borderRadius: "var(--bfrs-radius-sm)",
197
191
  paddingLeft: ".125rem",
198
192
  paddingRight: ".125rem"
199
- }), cr = /* @__PURE__ */ i("div", {
193
+ }), sr = /* @__PURE__ */ i("div", {
200
194
  label: "AgenticTableViewSelector-defaultDivider"
201
195
  })({
202
196
  height: "1px",
@@ -206,10 +200,13 @@ const D = {
206
200
  marginBottom: ".25rem",
207
201
  "--tw-bg-opacity": "1",
208
202
  backgroundColor: "hsl(var(--bfrs-color-border-strong) / var(--tw-bg-opacity, 1))"
209
- }), He = /* @__PURE__ */ i("button", {
203
+ }), Fe = /* @__PURE__ */ i("button", {
210
204
  label: "AgenticTableViewSelector-viewButton",
211
- shouldForwardProp: (o) => o !== "ownerState"
212
- })(({ ownerState: o }) => [
205
+ shouldForwardProp: (n) => n !== "ownerState"
206
+ })(({ ownerState: n }) => [
207
+ // Rows mirror a Select option in every state (Select/SearchableSelect/
208
+ // MultiSelect): transparent at rest, `primary-soft` on hover and while
209
+ // pressed, and `primary-soft` + bold once selected.
213
210
  {
214
211
  display: "flex",
215
212
  minWidth: "0px",
@@ -225,19 +222,18 @@ const D = {
225
222
  textAlign: "left",
226
223
  fontSize: "12px",
227
224
  lineHeight: "1rem",
228
- fontWeight: 500,
225
+ fontWeight: 400,
229
226
  ...D,
230
227
  outline: "2px solid transparent",
231
228
  outlineOffset: "2px",
232
- "&:focus-visible": de("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
229
+ "&:hover": me,
230
+ "&:focus-visible": fe("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
233
231
  },
234
- !o.neutral && { "&:hover": Me },
235
- o.selected && {
236
- ...Qt,
237
- fontWeight: 700,
238
- "&:hover": Xt
232
+ n.selected && {
233
+ ...me,
234
+ fontWeight: 700
239
235
  }
240
- ]), Le = /* @__PURE__ */ i("span", {
236
+ ]), je = /* @__PURE__ */ i("span", {
241
237
  label: "AgenticTableViewSelector-name"
242
238
  })({
243
239
  minWidth: "0px",
@@ -245,7 +241,7 @@ const D = {
245
241
  overflow: "hidden",
246
242
  textOverflow: "ellipsis",
247
243
  whiteSpace: "nowrap"
248
- }), Ee = /* @__PURE__ */ i("div", {
244
+ }), Ne = /* @__PURE__ */ i("div", {
249
245
  label: "AgenticTableViewSelector-empty"
250
246
  })({
251
247
  paddingLeft: ".75rem",
@@ -254,17 +250,17 @@ const D = {
254
250
  paddingBottom: ".75rem",
255
251
  fontSize: ".75rem",
256
252
  lineHeight: "1rem",
257
- ...V
258
- }), Pe = /* @__PURE__ */ i(It, {
253
+ ...W
254
+ }), Ke = /* @__PURE__ */ i(Wt, {
259
255
  label: "AgenticTableViewSelector-renameOverlay"
260
256
  })({
261
257
  position: "fixed",
262
258
  inset: 0,
263
259
  zIndex: 1050,
264
260
  backgroundColor: "hsl(var(--bfrs-color-text-primary) / .45)",
265
- ...Mt,
261
+ ...Gt,
266
262
  animation: "bfrs-bfrs-overlay-in var(--bfrs-motion-fast) var(--bfrs-ease-out)"
267
- }), Fe = /* @__PURE__ */ i(Dt, {
263
+ }), Me = /* @__PURE__ */ i(Pt, {
268
264
  label: "AgenticTableViewSelector-renameContent"
269
265
  })({
270
266
  position: "fixed",
@@ -277,8 +273,8 @@ const D = {
277
273
  overflow: "auto",
278
274
  borderRadius: "var(--bfrs-radius-lg)",
279
275
  borderWidth: "1px",
280
- ...me,
281
- ...ue,
276
+ ...he,
277
+ ...pe,
282
278
  padding: "1.25rem",
283
279
  ...D,
284
280
  "--tw-shadow": "var(--bfrs-shadow-overlay)",
@@ -286,24 +282,24 @@ const D = {
286
282
  boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
287
283
  outline: "2px solid transparent",
288
284
  outlineOffset: "2px",
289
- ...Ke({ "--tw-translate-x": "-50%", "--tw-translate-y": "-50%" }),
290
- ...qt,
285
+ ...Ge({ "--tw-translate-x": "-50%", "--tw-translate-y": "-50%" }),
286
+ ...Jt,
291
287
  animation: "bfrs-bfrs-modal-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
292
- }), je = /* @__PURE__ */ i(Vt, {
288
+ }), $e = /* @__PURE__ */ i(Bt, {
293
289
  label: "AgenticTableViewSelector-renameTitle"
294
290
  })({
295
291
  fontSize: "1.125rem",
296
292
  lineHeight: "1.5rem",
297
293
  fontWeight: 700,
298
294
  ...D
299
- }), Ne = /* @__PURE__ */ i(Wt, {
295
+ }), qe = /* @__PURE__ */ i(Lt, {
300
296
  label: "AgenticTableViewSelector-renameDescription"
301
297
  })({
302
298
  marginTop: ".25rem",
303
299
  fontSize: ".75rem",
304
300
  lineHeight: "1.25rem",
305
- ...V
306
- }), sr = /* @__PURE__ */ i("label", {
301
+ ...W
302
+ }), dr = /* @__PURE__ */ i("label", {
307
303
  label: "AgenticTableViewSelector-renameLabel"
308
304
  })({
309
305
  display: "block",
@@ -312,7 +308,7 @@ const D = {
312
308
  lineHeight: "1rem",
313
309
  fontWeight: 700,
314
310
  ...D
315
- }), dr = /* @__PURE__ */ i("input", {
311
+ }), ur = /* @__PURE__ */ i("input", {
316
312
  label: "AgenticTableViewSelector-renameInput"
317
313
  })({
318
314
  marginTop: ".5rem",
@@ -322,7 +318,7 @@ const D = {
322
318
  borderWidth: "1.5px",
323
319
  "--tw-border-opacity": "1",
324
320
  borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))",
325
- ...ue,
321
+ ...pe,
326
322
  paddingLeft: ".75rem",
327
323
  paddingRight: ".75rem",
328
324
  fontSize: ".875rem",
@@ -331,15 +327,15 @@ const D = {
331
327
  ...D,
332
328
  outline: "2px solid transparent",
333
329
  outlineOffset: "2px",
334
- "&:focus-visible": de("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
335
- }), $e = /* @__PURE__ */ i("div", {
330
+ "&:focus-visible": fe("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
331
+ }), Ye = /* @__PURE__ */ i("div", {
336
332
  label: "AgenticTableViewSelector-renameFooter"
337
333
  })({
338
334
  marginTop: "1.5rem",
339
335
  display: "flex",
340
336
  justifyContent: "flex-end",
341
337
  gap: ".625rem"
342
- }), ur = /* @__PURE__ */ i(M, {
338
+ }), mr = /* @__PURE__ */ i(Y, {
343
339
  label: "AgenticTableViewSelector-renameSubmitButton"
344
340
  })({
345
341
  "&&:disabled": {
@@ -350,7 +346,7 @@ const D = {
350
346
  "--tw-text-opacity": "1",
351
347
  color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
352
348
  }
353
- }), mr = /* @__PURE__ */ i("p", {
349
+ }), fr = /* @__PURE__ */ i("p", {
354
350
  label: "AgenticTableViewSelector-renameFieldError"
355
351
  })({
356
352
  marginTop: ".375rem",
@@ -359,337 +355,348 @@ const D = {
359
355
  "--tw-text-opacity": "1",
360
356
  color: "hsl(var(--bfrs-color-danger) / var(--tw-text-opacity, 1))"
361
357
  });
362
- function I(o, n) {
363
- return n ? o.find((r) => r.view_id === n) ?? null : null;
358
+ function V(n, o) {
359
+ return o ? n.find((r) => r.view_id === o) ?? null : null;
364
360
  }
365
- function fr(o, n, r) {
366
- var h;
367
- const S = [], x = /* @__PURE__ */ new Set(), T = n ?? ((h = o.find((s) => s.is_default)) == null ? void 0 : h.view_id) ?? null, b = (s) => {
361
+ function pr(n, o, r) {
362
+ var _;
363
+ const S = [], x = /* @__PURE__ */ new Set(), T = o ?? ((_ = n.find((s) => s.is_default)) == null ? void 0 : _.view_id) ?? null, p = (s) => {
368
364
  if (!s || x.has(s)) return;
369
- const u = I(o, s);
370
- u && (S.push(u), x.add(u.view_id));
365
+ const h = V(n, s);
366
+ h && (S.push(h), x.add(h.view_id));
371
367
  };
372
- b(T), b(r);
373
- for (const s of o)
368
+ p(T), p(r);
369
+ for (const s of n)
374
370
  x.has(s.view_id) || (S.push(s), x.add(s.view_id));
375
371
  return S;
376
372
  }
377
- function pr(o) {
378
- return o ? [
373
+ const hr = /* @__PURE__ */ new Set(["true", "1"]);
374
+ function br() {
375
+ if (typeof window > "u") return !1;
376
+ const n = new URLSearchParams(window.location.search).get("skip_primary_view");
377
+ return n !== null && hr.has(n.trim().toLowerCase());
378
+ }
379
+ function gr(n) {
380
+ return n ? [
379
381
  "api",
380
- o.viewType && o.tab ? "scoped" : "local",
381
- o.saveEndpoint || o.endpoint ? "remote-save" : "local-save"
382
+ n.viewType && n.tab ? "scoped" : "local",
383
+ n.saveEndpoint || n.endpoint ? "remote-save" : "local-save"
382
384
  ].join(":") : "none";
383
385
  }
384
- function br(o) {
385
- const n = () => o.current;
386
+ function wr(n) {
387
+ const o = () => n.current;
386
388
  return {
387
389
  get baseUrl() {
388
390
  var r;
389
- return (r = n()) == null ? void 0 : r.baseUrl;
391
+ return (r = o()) == null ? void 0 : r.baseUrl;
390
392
  },
391
393
  get endpoint() {
392
394
  var r;
393
- return (r = n()) == null ? void 0 : r.endpoint;
395
+ return (r = o()) == null ? void 0 : r.endpoint;
394
396
  },
395
397
  get saveEndpoint() {
396
398
  var r;
397
- return (r = n()) == null ? void 0 : r.saveEndpoint;
399
+ return (r = o()) == null ? void 0 : r.saveEndpoint;
398
400
  },
399
401
  get listEndpoint() {
400
402
  var r;
401
- return (r = n()) == null ? void 0 : r.listEndpoint;
403
+ return (r = o()) == null ? void 0 : r.listEndpoint;
402
404
  },
403
405
  get updateEndpoint() {
404
406
  var r;
405
- return (r = n()) == null ? void 0 : r.updateEndpoint;
407
+ return (r = o()) == null ? void 0 : r.updateEndpoint;
406
408
  },
407
409
  get deleteEndpoint() {
408
410
  var r;
409
- return (r = n()) == null ? void 0 : r.deleteEndpoint;
411
+ return (r = o()) == null ? void 0 : r.deleteEndpoint;
410
412
  },
411
413
  get viewType() {
412
414
  var r;
413
- return (r = n()) == null ? void 0 : r.viewType;
415
+ return (r = o()) == null ? void 0 : r.viewType;
414
416
  },
415
417
  get tab() {
416
418
  var r;
417
- return (r = n()) == null ? void 0 : r.tab;
419
+ return (r = o()) == null ? void 0 : r.tab;
418
420
  },
419
421
  get token() {
420
422
  var r;
421
- return (r = n()) == null ? void 0 : r.token;
423
+ return (r = o()) == null ? void 0 : r.token;
422
424
  },
423
425
  get headers() {
424
426
  var r;
425
- return (r = n()) == null ? void 0 : r.headers;
427
+ return (r = o()) == null ? void 0 : r.headers;
426
428
  },
427
429
  get credentials() {
428
430
  var r;
429
- return (r = n()) == null ? void 0 : r.credentials;
431
+ return (r = o()) == null ? void 0 : r.credentials;
430
432
  },
431
433
  get fetcher() {
432
434
  var r;
433
- return (r = n()) == null ? void 0 : r.fetcher;
435
+ return (r = o()) == null ? void 0 : r.fetcher;
434
436
  }
435
437
  };
436
438
  }
437
- function Or({
438
- screenName: o,
439
- store: n,
439
+ function Hr({
440
+ screenName: n,
441
+ store: o,
440
442
  saveApi: r,
441
443
  value: S,
442
444
  defaultValue: x,
443
- selectPrimaryByDefault: T = !0,
444
- onValueChange: b,
445
- onViewSelect: h,
446
- onPrimaryViewChange: s,
447
- onUnsetPrimaryView: u,
448
- onRenameView: q,
449
- onDeleteView: Y,
450
- onResetSavedFilters: _,
451
- onError: L,
452
- triggerLabel: Ye,
453
- placeholder: Ge = "Views",
454
- viewsLabel: Je = "VIEWS",
455
- primaryHintLabel: fe = "Set a view as primary to load it automatically. With no primary view, the table opens in its default state.",
456
- emptyLabel: Qe = "No saved views",
457
- loadingLabel: Xe = "Loading views",
458
- defaultViewLabel: pe = "Default",
459
- setPrimaryLabel: be = "Set as Primary View",
460
- unsetPrimaryLabel: Ze = "Unset as Primary",
461
- renameLabel: Ue = "Rename",
462
- deleteLabel: et = "Delete",
463
- renameTitle: tt = "Rename view",
464
- renameDescription: he = "Update the saved view name.",
465
- renameInputLabel: rt = "View name",
466
- renameCancelLabel: ot = "Cancel",
467
- renameSaveLabel: it = "Save",
468
- deleteTitle: nt = "Delete view",
469
- deleteDescription: at,
470
- deleteCancelLabel: lt = "Cancel",
471
- deleteConfirmLabel: ct = "Delete",
472
- size: st = "sm",
473
- disabled: dt = !1,
474
- className: ut,
475
- triggerClassName: mt,
476
- contentClassName: ft,
477
- actionMenuClassName: ge
445
+ onValueChange: T,
446
+ onViewSelect: p,
447
+ onPrimaryViewChange: _,
448
+ onUnsetPrimaryView: s,
449
+ onRenameView: h,
450
+ onDeleteView: G,
451
+ onResetSavedFilters: R,
452
+ onError: H,
453
+ triggerLabel: Qe,
454
+ placeholder: Xe = "Views",
455
+ viewsLabel: Ze = "VIEWS",
456
+ primaryHintLabel: be = "Set a view as primary to load it automatically. With no primary view, the table opens in its default state.",
457
+ emptyLabel: Ue = "No saved views",
458
+ loadingLabel: et = "Loading views",
459
+ defaultViewLabel: ge = "Default",
460
+ setPrimaryLabel: we = "Set as Primary View",
461
+ unsetPrimaryLabel: tt = "Unset as Primary",
462
+ renameLabel: rt = "Rename",
463
+ deleteLabel: nt = "Delete",
464
+ renameTitle: it = "Rename view",
465
+ renameDescription: ve = "Update the saved view name.",
466
+ renameInputLabel: ot = "View name",
467
+ renameCancelLabel: at = "Cancel",
468
+ renameSaveLabel: lt = "Save",
469
+ deleteTitle: ct = "Delete view",
470
+ deleteDescription: st,
471
+ deleteCancelLabel: dt = "Cancel",
472
+ deleteConfirmLabel: ut = "Delete",
473
+ size: mt = "sm",
474
+ disabled: ft = !1,
475
+ className: pt,
476
+ triggerClassName: ht,
477
+ contentClassName: bt,
478
+ actionMenuClassName: ye
478
479
  }) {
479
- const ve = A(r);
480
- ve.current = r;
481
- const we = pr(r), G = le(
482
- () => we === "none" ? void 0 : br(ve),
483
- [we]
484
- ), m = le(
485
- () => n ?? Gt(o, G ? { saveApi: G } : void 0),
486
- [o, n, G]
487
- ), E = S !== void 0, [J, Q] = p(!1), [R, pt] = p([]), [W, bt] = p(null), [ht, ye] = p(x ?? null), [Se, xe] = p(!1), [P, Te] = p(null), [B, X] = p(""), [g, _e] = p(null), O = S ?? ht, H = A(O), F = A(E), Z = A(!1), v = A(!1), C = A(null), Re = $t();
488
- N(() => {
489
- H.current = O, O && (v.current = !1);
490
- }, [O]), N(() => {
491
- F.current = E;
492
- }, [E]), N(() => {
493
- C.current = null, Z.current = !1, v.current = !1;
494
- }, [m, o]);
480
+ const Se = y(r);
481
+ Se.current = r;
482
+ const xe = gr(r), J = se(
483
+ () => xe === "none" ? void 0 : wr(Se),
484
+ [xe]
485
+ ), u = se(
486
+ () => o ?? Xt(n, J ? { saveApi: J } : void 0),
487
+ [n, o, J]
488
+ ), Q = S !== void 0, E = !br(), [X, Z] = m(!1), [A, gt] = m([]), [P, wt] = m(null), [vt, Te] = m(x ?? null), [_e, Re] = m(!1), [F, Ae] = m(null), [B, U] = m(""), [b, ke] = m(null), [Ce, j] = m(null), k = y(!1), L = S ?? vt, O = y(L), ee = y(Q), te = y(!1), g = y(!1), C = y(null), ze = qt();
489
+ M(() => {
490
+ O.current = L, L && (g.current = !1);
491
+ }, [L]), M(() => {
492
+ ee.current = Q;
493
+ }, [Q]), M(() => {
494
+ C.current = null, te.current = !1, g.current = !1;
495
+ }, [u, n]);
495
496
  const w = $(
496
497
  (e) => {
497
- L == null || L(e);
498
+ H == null || H(e);
498
499
  },
499
- [L]
500
+ [H]
500
501
  ), f = $(
501
502
  (e) => {
502
- e && (v.current = !1), F.current || ye((e == null ? void 0 : e.view_id) ?? null), b == null || b((e == null ? void 0 : e.view_id) ?? null, e), e && (h == null || h(e));
503
+ e && (g.current = !1), ee.current || Te((e == null ? void 0 : e.view_id) ?? null), T == null || T((e == null ? void 0 : e.view_id) ?? null, e), e && (p == null || p(e));
503
504
  },
504
- [b, h]
505
- ), U = $(
505
+ [T, p]
506
+ ), re = $(
506
507
  (e) => {
507
508
  f(e);
508
509
  },
509
510
  [f]
510
- ), y = $(
511
+ ), v = $(
511
512
  async (e) => {
512
- var ke;
513
+ var Ve;
513
514
  const a = e === void 0 ? "__default__" : e ?? "__none__";
514
- if (((ke = C.current) == null ? void 0 : ke.key) === a) return C.current.promise;
515
+ if (((Ve = C.current) == null ? void 0 : Ve.key) === a) return C.current.promise;
515
516
  const d = { key: a, promise: Promise.resolve(null) };
516
517
  return C.current = d, d.promise = (async () => {
517
- xe(!0);
518
+ Re(!0);
518
519
  try {
519
- const k = await m.list(), z = k.find((At) => At.is_default) ?? null, kt = e !== void 0 ? e : H.current, ze = I(k, kt), zt = !v.current && (e !== void 0 || T || !F.current), ae = ze || !zt ? null : I(k, z == null ? void 0 : z.view_id), j = ze ?? ae ?? null;
520
- return pt(k), bt((z == null ? void 0 : z.view_id) ?? null), F.current || ye((j == null ? void 0 : j.view_id) ?? null), T && ae && e === void 0 && !H.current && !Z.current && (Z.current = !0, U(ae)), j;
521
- } catch (k) {
522
- return w(k), null;
520
+ const z = await u.list(), I = z.find((Dt) => Dt.is_default) ?? null, It = e !== void 0 ? e : O.current, De = V(z, It), Vt = E && !g.current, ce = De || !Vt ? null : V(z, I == null ? void 0 : I.view_id), K = De ?? ce ?? null;
521
+ return gt(z), wt((I == null ? void 0 : I.view_id) ?? null), ee.current || Te((K == null ? void 0 : K.view_id) ?? null), E && ce && e === void 0 && !O.current && !te.current && (te.current = !0, re(ce)), K;
522
+ } catch (z) {
523
+ return w(z), null;
523
524
  } finally {
524
- xe(!1), C.current === d && (C.current = null);
525
+ Re(!1), C.current === d && (C.current = null);
525
526
  }
526
527
  })(), d.promise;
527
528
  },
528
- [U, w, m, T, f]
529
+ [E, re, w, u, f]
529
530
  );
530
- N(() => {
531
+ M(() => {
531
532
  const e = () => {
532
- y();
533
+ v();
533
534
  };
534
- return e(), m.subscribe(e);
535
- }, [y, m]);
536
- const l = I(R, O) ?? (!v.current && (T || !E) ? I(R, W) : null), gt = le(
537
- () => fr(R, W, l == null ? void 0 : l.view_id),
538
- [W, l == null ? void 0 : l.view_id, R]
539
- ), ee = !l, te = W === null, vt = Ye ?? (l == null ? void 0 : l.name) ?? (ee ? pe : Ge), re = R.length > 0, wt = (e) => {
540
- Q(!1), U(e);
541
- }, yt = (e) => {
542
- m.setPrimary(e.view_id).then(async (a) => {
543
- const d = await y(e.view_id);
544
- f(d ?? a), s == null || s(a);
535
+ return e(), u.subscribe(e);
536
+ }, [v, u]);
537
+ const l = V(A, L) ?? (E && !g.current ? V(A, P) : null), yt = se(
538
+ () => pr(A, P, l == null ? void 0 : l.view_id),
539
+ [P, l == null ? void 0 : l.view_id, A]
540
+ ), N = !l, ne = P === null, St = Qe ?? (l == null ? void 0 : l.name) ?? (N ? ge : Xe), ie = A.length > 0, xt = (e) => {
541
+ Z(!1), re(e);
542
+ }, Tt = (e) => {
543
+ u.setPrimary(e.view_id).then(async (a) => {
544
+ const d = await v(e.view_id);
545
+ f(d ?? a), _ == null || _(a);
545
546
  }).catch(w);
546
- }, St = (e) => {
547
- m.unsetPrimary(e.view_id).then(async (a) => {
548
- const d = await y(e.view_id);
549
- f(d ?? a), u == null || u(a);
547
+ }, _t = (e) => {
548
+ u.unsetPrimary(e.view_id).then(async (a) => {
549
+ const d = await v(e.view_id);
550
+ f(d ?? a), s == null || s(a);
550
551
  }).catch(w);
551
- }, oe = () => _e(null), xt = (e) => {
552
- const a = H.current === e.view_id;
553
- m.remove(e.view_id).then(async () => {
554
- const d = await y(a ? null : H.current);
555
- a && f(d), Y == null || Y(e.view_id);
556
- }).catch(w).finally(oe);
557
- }, Tt = () => {
558
- g && xt(g);
559
- }, Ce = () => {
560
- v.current = !0, f(null), _ == null || _(), Q(!1);
561
- }, _t = () => {
562
- const e = I(R, W);
552
+ }, oe = () => ke(null), Rt = (e) => {
553
+ if (k.current) return;
554
+ k.current = !0, j("delete");
555
+ const a = O.current === e.view_id;
556
+ u.remove(e.view_id).then(async () => {
557
+ const d = await v(a ? null : O.current);
558
+ a && f(d), G == null || G(e.view_id);
559
+ }).catch(w).finally(() => {
560
+ k.current = !1, j(null), oe();
561
+ });
562
+ }, At = () => {
563
+ b && Rt(b);
564
+ }, Ie = () => {
565
+ g.current = !0, f(null), R == null || R(), Z(!1);
566
+ }, kt = () => {
567
+ const e = V(A, P);
563
568
  if (!e) {
564
- Ce();
569
+ Ie();
565
570
  return;
566
571
  }
567
- m.unsetPrimary(e.view_id).then(async (a) => {
568
- v.current = !0, await y(null), f(null), _ == null || _(), u == null || u(a);
572
+ u.unsetPrimary(e.view_id).then(async (a) => {
573
+ g.current = !0, await v(null), f(null), R == null || R(), s == null || s(a);
569
574
  }).catch(w);
570
- }, Rt = (e) => {
571
- Te(e), X(e.name);
572
- }, ie = () => {
573
- Te(null), X("");
574
575
  }, Ct = (e) => {
576
+ Ae(e), U(e.name);
577
+ }, ae = () => {
578
+ Ae(null), U("");
579
+ }, zt = (e) => {
575
580
  e.preventDefault();
576
581
  const a = B.trim();
577
- !P || !a || Be(a) || m.rename(P.view_id, a).then(async (d) => {
578
- await y(P.view_id), q == null || q(d), ie();
579
- }).catch(w);
580
- }, ne = Be(B);
581
- return re ? /* @__PURE__ */ c(Ut, { className: ut, children: [
582
- /* @__PURE__ */ c(Bt, { open: J, onOpenChange: Q, children: [
583
- /* @__PURE__ */ t(Ot, { asChild: !0, children: /* @__PURE__ */ c(
584
- er,
582
+ !F || !a || He(a) || k.current || (k.current = !0, j("rename"), u.rename(F.view_id, a).then(async (d) => {
583
+ await v(F.view_id), h == null || h(d), ae();
584
+ }).catch(w).finally(() => {
585
+ k.current = !1, j(null);
586
+ }));
587
+ }, le = He(B);
588
+ return ie ? /* @__PURE__ */ c(er, { className: pt, children: [
589
+ /* @__PURE__ */ c(Ot, { open: X, onOpenChange: Z, children: [
590
+ /* @__PURE__ */ t(Ht, { asChild: !0, children: /* @__PURE__ */ c(
591
+ tr,
585
592
  {
586
593
  type: "button",
587
594
  "aria-label": "Saved views",
588
- className: mt,
589
- disabled: dt,
595
+ className: ht,
596
+ disabled: ft,
590
597
  "data-filled": l ? "" : void 0,
591
- ownerState: { open: J, empty: !l, filled: !!l, defaultSelected: ee, size: st },
598
+ ownerState: { open: X, empty: !l, filled: !!l, defaultSelected: N, size: mt },
592
599
  children: [
593
- /* @__PURE__ */ t(Et, { size: 13 }),
594
- /* @__PURE__ */ t(tr, { children: vt }),
595
- l != null && l.is_default || ee && te ? /* @__PURE__ */ t(se, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null,
596
- /* @__PURE__ */ t(rr, { size: 13, ownerState: { open: J } })
600
+ /* @__PURE__ */ t(jt, { size: 13 }),
601
+ /* @__PURE__ */ t(rr, { children: St }),
602
+ l != null && l.is_default || N && ne ? /* @__PURE__ */ t(ue, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null,
603
+ /* @__PURE__ */ t(nr, { size: 13, ownerState: { open: X } })
597
604
  ]
598
605
  }
599
606
  ) }),
600
- /* @__PURE__ */ t(Ht, { children: /* @__PURE__ */ t(ce, { children: /* @__PURE__ */ c(
601
- or,
607
+ /* @__PURE__ */ t(Et, { children: /* @__PURE__ */ t(de, { children: /* @__PURE__ */ c(
608
+ ir,
602
609
  {
603
610
  align: "start",
604
611
  sideOffset: 8,
605
- collisionPadding: Yt,
606
- className: ft,
612
+ collisionPadding: Qt,
613
+ className: bt,
607
614
  children: [
608
- /* @__PURE__ */ c(ir, { children: [
609
- Je,
610
- fe ? /* @__PURE__ */ t(Jt, { content: fe, side: "right", variant: "white", children: /* @__PURE__ */ t(nr, { role: "img", "aria-label": "About primary views", children: /* @__PURE__ */ t(Ft, { size: 13, weight: "fill", "aria-hidden": "true" }) }) }) : null
615
+ /* @__PURE__ */ c(or, { children: [
616
+ Ze,
617
+ be ? /* @__PURE__ */ t(Zt, { content: be, side: "right", variant: "white", children: /* @__PURE__ */ t(ar, { role: "img", "aria-label": "About primary views", children: /* @__PURE__ */ t(Kt, { size: 13, weight: "fill", "aria-hidden": "true" }) }) }) : null
611
618
  ] }),
612
- /* @__PURE__ */ c(ar, { children: [
613
- Se && !re ? /* @__PURE__ */ t(Ee, { children: Xe }) : null,
614
- !Se && !re ? /* @__PURE__ */ t(Ee, { children: Qe }) : null,
615
- /* @__PURE__ */ c(lr, { "data-default-view-surface": !0, children: [
616
- /* @__PURE__ */ c(He, { type: "button", ownerState: { selected: !1, neutral: !0 }, onClick: Ce, children: [
617
- /* @__PURE__ */ t(Le, { children: pe }),
618
- te ? /* @__PURE__ */ t(se, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
619
+ /* @__PURE__ */ c(lr, { children: [
620
+ _e && !ie ? /* @__PURE__ */ t(Ne, { children: et }) : null,
621
+ !_e && !ie ? /* @__PURE__ */ t(Ne, { children: Ue }) : null,
622
+ /* @__PURE__ */ c(cr, { "data-default-view-surface": !0, children: [
623
+ /* @__PURE__ */ c(Fe, { type: "button", ownerState: { selected: N }, onClick: Ie, children: [
624
+ /* @__PURE__ */ t(je, { children: ge }),
625
+ ne ? /* @__PURE__ */ t(ue, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
619
626
  ] }),
620
627
  /* @__PURE__ */ t(
621
- Oe,
628
+ Ee,
622
629
  {
623
630
  align: "start",
624
631
  side: "right",
625
632
  size: "sm",
626
- className: ge,
633
+ className: ye,
627
634
  trigger: /* @__PURE__ */ t(
628
- We,
635
+ Oe,
629
636
  {
630
637
  variant: "secondary",
631
638
  size: "sm",
632
- icon: /* @__PURE__ */ t(Ve, { size: 14, weight: "bold" }),
639
+ icon: /* @__PURE__ */ t(Le, { size: 14, weight: "bold" }),
633
640
  "aria-label": "View actions for Default"
634
641
  }
635
642
  ),
636
643
  items: [
637
644
  {
638
- label: be,
639
- icon: /* @__PURE__ */ t(K, { size: 16 }),
640
- disabled: te,
641
- onSelect: _t
645
+ label: we,
646
+ icon: /* @__PURE__ */ t(q, { size: 16 }),
647
+ disabled: ne,
648
+ onSelect: kt
642
649
  }
643
650
  ]
644
651
  }
645
652
  )
646
653
  ] }),
647
- /* @__PURE__ */ t(cr, { role: "separator", "data-default-view-divider": !0 }),
648
- gt.map((e) => {
654
+ /* @__PURE__ */ t(sr, { role: "separator", "data-default-view-divider": !0 }),
655
+ yt.map((e) => {
649
656
  const a = (l == null ? void 0 : l.view_id) === e.view_id;
650
- return /* @__PURE__ */ c(qe, { children: [
651
- /* @__PURE__ */ c(He, { type: "button", ownerState: { selected: a }, onClick: () => wt(e), children: [
652
- /* @__PURE__ */ t(Le, { children: e.name }),
653
- e.is_default ? /* @__PURE__ */ t(se, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
657
+ return /* @__PURE__ */ c(Je, { children: [
658
+ /* @__PURE__ */ c(Fe, { type: "button", ownerState: { selected: a }, onClick: () => xt(e), children: [
659
+ /* @__PURE__ */ t(je, { children: e.name }),
660
+ e.is_default ? /* @__PURE__ */ t(ue, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
654
661
  ] }),
655
662
  /* @__PURE__ */ t(
656
- Oe,
663
+ Ee,
657
664
  {
658
665
  align: "start",
659
666
  side: "right",
660
667
  size: "sm",
661
- className: ge,
668
+ className: ye,
662
669
  trigger: /* @__PURE__ */ t(
663
- We,
670
+ Oe,
664
671
  {
665
672
  variant: "secondary",
666
673
  size: "sm",
667
- icon: /* @__PURE__ */ t(Ve, { size: 14, weight: "bold" }),
674
+ icon: /* @__PURE__ */ t(Le, { size: 14, weight: "bold" }),
668
675
  "aria-label": `View actions for ${e.name}`
669
676
  }
670
677
  ),
671
678
  items: [
672
679
  ...e.is_system_defined ? [] : [
673
680
  e.is_default ? {
674
- label: Ze,
675
- icon: /* @__PURE__ */ t(K, { size: 16 }),
676
- onSelect: () => St(e)
681
+ label: tt,
682
+ icon: /* @__PURE__ */ t(q, { size: 16 }),
683
+ onSelect: () => _t(e)
677
684
  } : {
678
- label: be,
679
- icon: /* @__PURE__ */ t(K, { size: 16 }),
680
- onSelect: () => yt(e)
685
+ label: we,
686
+ icon: /* @__PURE__ */ t(q, { size: 16 }),
687
+ onSelect: () => Tt(e)
681
688
  }
682
689
  ],
683
690
  {
684
- label: Ue,
685
- icon: /* @__PURE__ */ t(jt, { size: 16 }),
686
- onSelect: () => Rt(e)
691
+ label: rt,
692
+ icon: /* @__PURE__ */ t(Mt, { size: 16 }),
693
+ onSelect: () => Ct(e)
687
694
  },
688
695
  {
689
- label: et,
690
- icon: /* @__PURE__ */ t(Nt, { size: 16 }),
696
+ label: nt,
697
+ icon: /* @__PURE__ */ t($t, { size: 16 }),
691
698
  destructive: !0,
692
- onSelect: () => _e(e)
699
+ onSelect: () => ke(e)
693
700
  }
694
701
  ]
695
702
  }
@@ -701,59 +708,67 @@ function Or({
701
708
  }
702
709
  ) }) })
703
710
  ] }),
704
- /* @__PURE__ */ t(Ie, { open: !!P, onOpenChange: (e) => {
705
- e || ie();
706
- }, children: /* @__PURE__ */ t(De, { children: /* @__PURE__ */ c(ce, { children: [
707
- /* @__PURE__ */ t(Pe, {}),
708
- /* @__PURE__ */ t(Fe, { children: /* @__PURE__ */ c("form", { onSubmit: Ct, children: [
709
- /* @__PURE__ */ t(je, { children: tt }),
710
- he ? /* @__PURE__ */ t(Ne, { children: he }) : null,
711
- /* @__PURE__ */ t(sr, { htmlFor: Re, children: rt }),
711
+ /* @__PURE__ */ t(Pe, { open: !!F, onOpenChange: (e) => {
712
+ e || ae();
713
+ }, children: /* @__PURE__ */ t(Be, { children: /* @__PURE__ */ c(de, { children: [
714
+ /* @__PURE__ */ t(Ke, {}),
715
+ /* @__PURE__ */ t(Me, { children: /* @__PURE__ */ c("form", { onSubmit: zt, children: [
716
+ /* @__PURE__ */ t($e, { children: it }),
717
+ ve ? /* @__PURE__ */ t(qe, { children: ve }) : null,
718
+ /* @__PURE__ */ t(dr, { htmlFor: ze, children: ot }),
712
719
  /* @__PURE__ */ t(
713
- dr,
720
+ ur,
714
721
  {
715
- id: Re,
722
+ id: ze,
716
723
  autoFocus: !0,
717
724
  value: B,
718
- onChange: (e) => X(e.currentTarget.value),
719
- "aria-invalid": ne
725
+ onChange: (e) => U(e.currentTarget.value),
726
+ "aria-invalid": le
720
727
  }
721
728
  ),
722
- ne ? /* @__PURE__ */ c(mr, { children: [
729
+ le ? /* @__PURE__ */ c(fr, { children: [
723
730
  "“",
724
731
  B.trim(),
725
732
  "” is reserved. Choose a different name."
726
733
  ] }) : null,
727
- /* @__PURE__ */ c($e, { children: [
728
- /* @__PURE__ */ t(M, { type: "button", variant: "secondary", onClick: ie, children: ot }),
729
- /* @__PURE__ */ t(ur, { type: "submit", disabled: B.trim().length === 0 || ne, children: it })
734
+ /* @__PURE__ */ c(Ye, { children: [
735
+ /* @__PURE__ */ t(Y, { type: "button", variant: "secondary", onClick: ae, children: at }),
736
+ /* @__PURE__ */ t(
737
+ mr,
738
+ {
739
+ type: "submit",
740
+ loading: Ce === "rename",
741
+ disabled: B.trim().length === 0 || le,
742
+ children: lt
743
+ }
744
+ )
730
745
  ] })
731
746
  ] }) })
732
747
  ] }) }) }),
733
- /* @__PURE__ */ t(Ie, { open: !!g, onOpenChange: (e) => {
748
+ /* @__PURE__ */ t(Pe, { open: !!b, onOpenChange: (e) => {
734
749
  e || oe();
735
- }, children: /* @__PURE__ */ t(De, { children: /* @__PURE__ */ c(ce, { children: [
736
- /* @__PURE__ */ t(Pe, {}),
737
- /* @__PURE__ */ c(Fe, { children: [
738
- /* @__PURE__ */ t(je, { children: nt }),
739
- /* @__PURE__ */ t(Ne, { children: at ?? /* @__PURE__ */ c(Ae, { children: [
750
+ }, children: /* @__PURE__ */ t(Be, { children: /* @__PURE__ */ c(de, { children: [
751
+ /* @__PURE__ */ t(Ke, {}),
752
+ /* @__PURE__ */ c(Me, { children: [
753
+ /* @__PURE__ */ t($e, { children: ct }),
754
+ /* @__PURE__ */ t(qe, { children: st ?? /* @__PURE__ */ c(We, { children: [
740
755
  "Are you sure you want to delete",
741
- g != null && g.name ? /* @__PURE__ */ c(Ae, { children: [
756
+ b != null && b.name ? /* @__PURE__ */ c(We, { children: [
742
757
  " “",
743
- /* @__PURE__ */ t("strong", { children: g.name }),
758
+ /* @__PURE__ */ t("strong", { children: b.name }),
744
759
  "”"
745
760
  ] }) : " this view",
746
761
  "? This can’t be undone."
747
762
  ] }) }),
748
- /* @__PURE__ */ c($e, { children: [
749
- /* @__PURE__ */ t(M, { type: "button", variant: "secondary", onClick: oe, children: lt }),
750
- /* @__PURE__ */ t(M, { type: "button", variant: "danger", onClick: Tt, children: ct })
763
+ /* @__PURE__ */ c(Ye, { children: [
764
+ /* @__PURE__ */ t(Y, { type: "button", variant: "secondary", onClick: oe, children: dt }),
765
+ /* @__PURE__ */ t(Y, { type: "button", variant: "danger", onClick: At, loading: Ce === "delete", children: ut })
751
766
  ] })
752
767
  ] })
753
768
  ] }) }) })
754
769
  ] }) : null;
755
770
  }
756
771
  export {
757
- Or as TableViewSelector
772
+ Hr as TableViewSelector
758
773
  };
759
774
  //# sourceMappingURL=TableViewSelector.js.map