@notificationapi/react 1.4.1 → 1.5.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.
Files changed (44) hide show
  1. package/dist/assets/Badge.js +1 -1
  2. package/dist/assets/Box.js +13 -13
  3. package/dist/assets/Button.js +781 -0
  4. package/dist/assets/ButtonBase.js +409 -622
  5. package/dist/assets/DefaultPropsProvider.js +220 -215
  6. package/dist/assets/Divider.js +105 -154
  7. package/dist/assets/Grow.js +201 -0
  8. package/dist/assets/IconButton.js +1 -1
  9. package/dist/assets/List.js +142 -0
  10. package/dist/assets/Modal.js +1094 -0
  11. package/dist/assets/Notification.js +71 -71
  12. package/dist/assets/Paper.js +1 -1
  13. package/dist/assets/Popover.js +8 -6
  14. package/dist/assets/Portal.js +2 -2
  15. package/dist/assets/Stack.js +216 -0
  16. package/dist/assets/Typography.js +193 -117
  17. package/dist/assets/WebPushOptInMessage.js +40 -814
  18. package/dist/assets/createSvgIcon.js +5 -5
  19. package/dist/assets/dividerClasses.js +56 -0
  20. package/dist/assets/index.js +151 -0
  21. package/dist/assets/useTheme2.js +253 -11
  22. package/dist/assets/utils.js +4 -4
  23. package/dist/components/Notifications/Inbox.js +2927 -9
  24. package/dist/components/Notifications/InboxHeader.js +2146 -7
  25. package/dist/components/Notifications/NotificationFeed.js +13 -13
  26. package/dist/components/Notifications/NotificationLauncher.js +2 -2
  27. package/dist/components/Notifications/NotificationPopup.js +7 -7
  28. package/dist/components/Preferences/NotificationPreferencesPopup.js +608 -7
  29. package/dist/components/Preferences/PreferenceInput.js +1451 -6
  30. package/dist/components/Preferences/Preferences.js +368 -515
  31. package/dist/components/Preferences/index.js +1 -1
  32. package/dist/components/Provider/index.js +226 -202
  33. package/dist/components/Slack/SlackConnect.d.ts +12 -0
  34. package/dist/components/Slack/SlackConnect.js +4826 -0
  35. package/dist/components/Slack/index.d.ts +1 -0
  36. package/dist/components/Slack/index.js +4 -0
  37. package/dist/components/WebPush/WebPushOptInMessage.js +3 -2
  38. package/dist/main.d.ts +1 -0
  39. package/dist/main.js +5 -3
  40. package/package.json +4 -4
  41. package/dist/assets/Inbox.js +0 -3061
  42. package/dist/assets/InboxHeader.js +0 -2338
  43. package/dist/assets/NotificationPreferencesPopup.js +0 -1694
  44. package/dist/assets/PreferenceInput.js +0 -1657
@@ -1,1657 +0,0 @@
1
- import { jsx as d, jsxs as P, Fragment as ie } from "react/jsx-runtime";
2
- import { g as Oe, a as xe } from "./channelUtils.js";
3
- import { e as Te, T as _ } from "./Typography.js";
4
- import * as m from "react";
5
- import { y as Pe, w as $e, P as o, j as Ne, z as le, A as Q, B as Fe, D as Be, E as je, c as I, f as M, a as D, F as ce, g as L, s as v, v as oe, h as w, m as z, u as A, b as W, t as Ie, r as ze } from "./DefaultPropsProvider.js";
6
- import { c as Y } from "./createSimplePaletteValueFilter.js";
7
- import { B as Ee, r as H, u as Me } from "./ButtonBase.js";
8
- import { u as he, a as De, D as Ve } from "./Divider.js";
9
- import { u as Le } from "./resolveComponentProps.js";
10
- import { u as Ge } from "./useTheme2.js";
11
- import { c as be } from "./createSvgIcon.js";
12
- const qe = Pe();
13
- function Ue(e) {
14
- const {
15
- theme: t,
16
- name: r,
17
- props: n
18
- } = e;
19
- return !t || !t.components || !t.components[r] || !t.components[r].defaultProps ? n : $e(t.components[r].defaultProps, n);
20
- }
21
- function _e({
22
- props: e,
23
- name: t,
24
- defaultTheme: r,
25
- themeId: n
26
- }) {
27
- let s = Ge(r);
28
- return n && (s = s[n] || s), Ue({
29
- theme: s,
30
- name: t,
31
- props: e
32
- });
33
- }
34
- function Ae(...e) {
35
- return e.reduce((t, r) => r == null ? t : function(...s) {
36
- t.apply(this, s), r.apply(this, s);
37
- }, () => {
38
- });
39
- }
40
- const We = Ne(), He = qe("div", {
41
- name: "MuiStack",
42
- slot: "Root",
43
- overridesResolver: (e, t) => t.root
44
- });
45
- function Xe(e) {
46
- return _e({
47
- props: e,
48
- name: "MuiStack",
49
- defaultTheme: We
50
- });
51
- }
52
- function Ke(e, t) {
53
- const r = m.Children.toArray(e).filter(Boolean);
54
- return r.reduce((n, s, i) => (n.push(s), i < r.length - 1 && n.push(/* @__PURE__ */ m.cloneElement(t, {
55
- key: `separator-${i}`
56
- })), n), []);
57
- }
58
- const Ze = (e) => ({
59
- row: "Left",
60
- "row-reverse": "Right",
61
- column: "Top",
62
- "column-reverse": "Bottom"
63
- })[e], Je = ({
64
- ownerState: e,
65
- theme: t
66
- }) => {
67
- let r = {
68
- display: "flex",
69
- flexDirection: "column",
70
- ...le({
71
- theme: t
72
- }, Q({
73
- values: e.direction,
74
- breakpoints: t.breakpoints.values
75
- }), (n) => ({
76
- flexDirection: n
77
- }))
78
- };
79
- if (e.spacing) {
80
- const n = Fe(t), s = Object.keys(t.breakpoints.values).reduce((c, l) => ((typeof e.spacing == "object" && e.spacing[l] != null || typeof e.direction == "object" && e.direction[l] != null) && (c[l] = !0), c), {}), i = Q({
81
- values: e.direction,
82
- base: s
83
- }), p = Q({
84
- values: e.spacing,
85
- base: s
86
- });
87
- typeof i == "object" && Object.keys(i).forEach((c, l, u) => {
88
- if (!i[c]) {
89
- const h = l > 0 ? i[u[l - 1]] : "column";
90
- i[c] = h;
91
- }
92
- }), r = Be(r, le({
93
- theme: t
94
- }, p, (c, l) => e.useFlexGap ? {
95
- gap: ce(n, c)
96
- } : {
97
- // The useFlexGap={false} implement relies on each child to give up control of the margin.
98
- // We need to reset the margin to avoid double spacing.
99
- "& > :not(style):not(style)": {
100
- margin: 0
101
- },
102
- "& > :not(style) ~ :not(style)": {
103
- [`margin${Ze(l ? i[l] : e.direction)}`]: ce(n, c)
104
- }
105
- }));
106
- }
107
- return r = je(t.breakpoints, r), r;
108
- };
109
- function Qe(e = {}) {
110
- const {
111
- // This will allow adding custom styled fn (for example for custom sx style function)
112
- createStyledComponent: t = He,
113
- useThemeProps: r = Xe,
114
- componentName: n = "MuiStack"
115
- } = e, s = () => M({
116
- root: ["root"]
117
- }, (c) => D(n, c), {}), i = t(Je), p = /* @__PURE__ */ m.forwardRef(function(c, l) {
118
- const u = r(c), a = Te(u), {
119
- component: h = "div",
120
- direction: C = "column",
121
- spacing: k = 0,
122
- divider: O,
123
- children: y,
124
- className: x,
125
- useFlexGap: b = !1,
126
- ...T
127
- } = a, S = {
128
- direction: C,
129
- spacing: k,
130
- useFlexGap: b
131
- }, B = s();
132
- return /* @__PURE__ */ d(i, {
133
- as: h,
134
- ownerState: S,
135
- ref: l,
136
- className: I(B.root, x),
137
- ...T,
138
- children: O ? Ke(y, O) : y
139
- });
140
- });
141
- return process.env.NODE_ENV !== "production" && (p.propTypes = {
142
- children: o.node,
143
- direction: o.oneOfType([o.oneOf(["column-reverse", "column", "row-reverse", "row"]), o.arrayOf(o.oneOf(["column-reverse", "column", "row-reverse", "row"])), o.object]),
144
- divider: o.node,
145
- spacing: o.oneOfType([o.arrayOf(o.oneOfType([o.number, o.string])), o.number, o.object, o.string]),
146
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
147
- }), p;
148
- }
149
- function ye({
150
- props: e,
151
- states: t,
152
- muiFormControl: r
153
- }) {
154
- return t.reduce((n, s) => (n[s] = e[s], r && typeof e[s] > "u" && (n[s] = r[s]), n), {});
155
- }
156
- const ge = /* @__PURE__ */ m.createContext(void 0);
157
- process.env.NODE_ENV !== "production" && (ge.displayName = "FormControlContext");
158
- function X() {
159
- return m.useContext(ge);
160
- }
161
- function Ye(e) {
162
- return D("PrivateSwitchBase", e);
163
- }
164
- L("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
165
- const eo = (e) => {
166
- const {
167
- classes: t,
168
- checked: r,
169
- disabled: n,
170
- edge: s
171
- } = e, i = {
172
- root: ["root", r && "checked", n && "disabled", s && `edge${w(s)}`],
173
- input: ["input"]
174
- };
175
- return M(i, Ye, t);
176
- }, oo = v(Ee)({
177
- padding: 9,
178
- borderRadius: "50%",
179
- variants: [{
180
- props: {
181
- edge: "start",
182
- size: "small"
183
- },
184
- style: {
185
- marginLeft: -3
186
- }
187
- }, {
188
- props: ({
189
- edge: e,
190
- ownerState: t
191
- }) => e === "start" && t.size !== "small",
192
- style: {
193
- marginLeft: -12
194
- }
195
- }, {
196
- props: {
197
- edge: "end",
198
- size: "small"
199
- },
200
- style: {
201
- marginRight: -3
202
- }
203
- }, {
204
- props: ({
205
- edge: e,
206
- ownerState: t
207
- }) => e === "end" && t.size !== "small",
208
- style: {
209
- marginRight: -12
210
- }
211
- }]
212
- }), to = v("input", {
213
- shouldForwardProp: oe
214
- })({
215
- cursor: "inherit",
216
- position: "absolute",
217
- opacity: 0,
218
- width: "100%",
219
- height: "100%",
220
- top: 0,
221
- left: 0,
222
- margin: 0,
223
- padding: 0,
224
- zIndex: 1
225
- }), te = /* @__PURE__ */ m.forwardRef(function(t, r) {
226
- const {
227
- autoFocus: n,
228
- checked: s,
229
- checkedIcon: i,
230
- className: p,
231
- defaultChecked: f,
232
- disabled: c,
233
- disableFocusRipple: l = !1,
234
- edge: u = !1,
235
- icon: a,
236
- id: h,
237
- inputProps: C,
238
- inputRef: k,
239
- name: O,
240
- onBlur: y,
241
- onChange: x,
242
- onFocus: b,
243
- readOnly: T,
244
- required: S = !1,
245
- tabIndex: B,
246
- type: R,
247
- value: G,
248
- ...K
249
- } = t, [E, q] = he({
250
- controlled: s,
251
- default: !!f,
252
- name: "SwitchBase",
253
- state: "checked"
254
- }), $ = X(), Z = (F) => {
255
- b && b(F), $ && $.onFocus && $.onFocus(F);
256
- }, V = (F) => {
257
- y && y(F), $ && $.onBlur && $.onBlur(F);
258
- }, j = (F) => {
259
- if (F.nativeEvent.defaultPrevented)
260
- return;
261
- const ae = F.target.checked;
262
- q(ae), x && x(F, ae);
263
- };
264
- let N = c;
265
- $ && typeof N > "u" && (N = $.disabled);
266
- const Re = R === "checkbox" || R === "radio", J = {
267
- ...t,
268
- checked: E,
269
- disabled: N,
270
- disableFocusRipple: l,
271
- edge: u
272
- }, se = eo(J);
273
- return /* @__PURE__ */ P(oo, {
274
- component: "span",
275
- className: I(se.root, p),
276
- centerRipple: !0,
277
- focusRipple: !l,
278
- disabled: N,
279
- tabIndex: null,
280
- role: void 0,
281
- onFocus: Z,
282
- onBlur: V,
283
- ownerState: J,
284
- ref: r,
285
- ...K,
286
- children: [/* @__PURE__ */ d(to, {
287
- autoFocus: n,
288
- checked: s,
289
- defaultChecked: f,
290
- className: se.input,
291
- disabled: N,
292
- id: Re ? h : void 0,
293
- name: O,
294
- onChange: j,
295
- readOnly: T,
296
- ref: k,
297
- required: S,
298
- ownerState: J,
299
- tabIndex: B,
300
- type: R,
301
- ...R === "checkbox" && G === void 0 ? {} : {
302
- value: G
303
- },
304
- ...C
305
- }), E ? i : a]
306
- });
307
- });
308
- process.env.NODE_ENV !== "production" && (te.propTypes = {
309
- /**
310
- * If `true`, the `input` element is focused during the first mount.
311
- */
312
- autoFocus: o.bool,
313
- /**
314
- * If `true`, the component is checked.
315
- */
316
- checked: o.bool,
317
- /**
318
- * The icon to display when the component is checked.
319
- */
320
- checkedIcon: o.node.isRequired,
321
- /**
322
- * Override or extend the styles applied to the component.
323
- */
324
- classes: o.object,
325
- /**
326
- * @ignore
327
- */
328
- className: o.string,
329
- /**
330
- * @ignore
331
- */
332
- defaultChecked: o.bool,
333
- /**
334
- * If `true`, the component is disabled.
335
- */
336
- disabled: o.bool,
337
- /**
338
- * If `true`, the keyboard focus ripple is disabled.
339
- * @default false
340
- */
341
- disableFocusRipple: o.bool,
342
- /**
343
- * If given, uses a negative margin to counteract the padding on one
344
- * side (this is often helpful for aligning the left or right
345
- * side of the icon with content above or below, without ruining the border
346
- * size and shape).
347
- * @default false
348
- */
349
- edge: o.oneOf(["end", "start", !1]),
350
- /**
351
- * The icon to display when the component is unchecked.
352
- */
353
- icon: o.node.isRequired,
354
- /**
355
- * The id of the `input` element.
356
- */
357
- id: o.string,
358
- /**
359
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
360
- */
361
- inputProps: o.object,
362
- /**
363
- * Pass a ref to the `input` element.
364
- */
365
- inputRef: H,
366
- /*
367
- * @ignore
368
- */
369
- name: o.string,
370
- /**
371
- * @ignore
372
- */
373
- onBlur: o.func,
374
- /**
375
- * Callback fired when the state is changed.
376
- *
377
- * @param {object} event The event source of the callback.
378
- * You can pull out the new checked state by accessing `event.target.checked` (boolean).
379
- */
380
- onChange: o.func,
381
- /**
382
- * @ignore
383
- */
384
- onFocus: o.func,
385
- /**
386
- * It prevents the user from changing the value of the field
387
- * (not from interacting with the field).
388
- */
389
- readOnly: o.bool,
390
- /**
391
- * If `true`, the `input` element is required.
392
- */
393
- required: o.bool,
394
- /**
395
- * The system prop that allows defining system overrides as well as additional CSS styles.
396
- */
397
- sx: o.object,
398
- /**
399
- * @ignore
400
- */
401
- tabIndex: o.oneOfType([o.number, o.string]),
402
- /**
403
- * The input component prop `type`.
404
- */
405
- type: o.string.isRequired,
406
- /**
407
- * The value of the component.
408
- */
409
- value: o.any
410
- });
411
- function ro(e) {
412
- return D("MuiFormControlLabel", e);
413
- }
414
- const U = L("MuiFormControlLabel", ["root", "labelPlacementStart", "labelPlacementTop", "labelPlacementBottom", "disabled", "label", "error", "required", "asterisk"]), no = (e) => {
415
- const {
416
- classes: t,
417
- disabled: r,
418
- labelPlacement: n,
419
- error: s,
420
- required: i
421
- } = e, p = {
422
- root: ["root", r && "disabled", `labelPlacement${w(n)}`, s && "error", i && "required"],
423
- label: ["label", r && "disabled"],
424
- asterisk: ["asterisk", s && "error"]
425
- };
426
- return M(p, ro, t);
427
- }, so = v("label", {
428
- name: "MuiFormControlLabel",
429
- slot: "Root",
430
- overridesResolver: (e, t) => {
431
- const {
432
- ownerState: r
433
- } = e;
434
- return [{
435
- [`& .${U.label}`]: t.label
436
- }, t.root, t[`labelPlacement${w(r.labelPlacement)}`]];
437
- }
438
- })(z(({
439
- theme: e
440
- }) => ({
441
- display: "inline-flex",
442
- alignItems: "center",
443
- cursor: "pointer",
444
- // For correct alignment with the text.
445
- verticalAlign: "middle",
446
- WebkitTapHighlightColor: "transparent",
447
- marginLeft: -11,
448
- marginRight: 16,
449
- // used for row presentation of radio/checkbox
450
- [`&.${U.disabled}`]: {
451
- cursor: "default"
452
- },
453
- [`& .${U.label}`]: {
454
- [`&.${U.disabled}`]: {
455
- color: (e.vars || e).palette.text.disabled
456
- }
457
- },
458
- variants: [{
459
- props: {
460
- labelPlacement: "start"
461
- },
462
- style: {
463
- flexDirection: "row-reverse",
464
- marginRight: -11
465
- }
466
- }, {
467
- props: {
468
- labelPlacement: "top"
469
- },
470
- style: {
471
- flexDirection: "column-reverse"
472
- }
473
- }, {
474
- props: {
475
- labelPlacement: "bottom"
476
- },
477
- style: {
478
- flexDirection: "column"
479
- }
480
- }, {
481
- props: ({
482
- labelPlacement: t
483
- }) => t === "start" || t === "top" || t === "bottom",
484
- style: {
485
- marginLeft: 16
486
- // used for row presentation of radio/checkbox
487
- }
488
- }]
489
- }))), ao = v("span", {
490
- name: "MuiFormControlLabel",
491
- slot: "Asterisk",
492
- overridesResolver: (e, t) => t.asterisk
493
- })(z(({
494
- theme: e
495
- }) => ({
496
- [`&.${U.error}`]: {
497
- color: (e.vars || e).palette.error.main
498
- }
499
- }))), ve = /* @__PURE__ */ m.forwardRef(function(t, r) {
500
- const n = A({
501
- props: t,
502
- name: "MuiFormControlLabel"
503
- }), {
504
- checked: s,
505
- className: i,
506
- componentsProps: p = {},
507
- control: f,
508
- disabled: c,
509
- disableTypography: l,
510
- inputRef: u,
511
- label: a,
512
- labelPlacement: h = "end",
513
- name: C,
514
- onChange: k,
515
- required: O,
516
- slots: y = {},
517
- slotProps: x = {},
518
- value: b,
519
- ...T
520
- } = n, S = X(), B = c ?? f.props.disabled ?? (S == null ? void 0 : S.disabled), R = O ?? f.props.required, G = {
521
- disabled: B,
522
- required: R
523
- };
524
- ["checked", "name", "onChange", "value", "inputRef"].forEach((N) => {
525
- typeof f.props[N] > "u" && typeof n[N] < "u" && (G[N] = n[N]);
526
- });
527
- const K = ye({
528
- props: n,
529
- muiFormControl: S,
530
- states: ["error"]
531
- }), E = {
532
- ...n,
533
- disabled: B,
534
- labelPlacement: h,
535
- required: R,
536
- error: K.error
537
- }, q = no(E), $ = {
538
- slots: y,
539
- slotProps: {
540
- ...p,
541
- ...x
542
- }
543
- }, [Z, V] = Me("typography", {
544
- elementType: _,
545
- externalForwardedProps: $,
546
- ownerState: E
547
- });
548
- let j = a;
549
- return j != null && j.type !== _ && !l && (j = /* @__PURE__ */ d(Z, {
550
- component: "span",
551
- ...V,
552
- className: I(q.label, V == null ? void 0 : V.className),
553
- children: j
554
- })), /* @__PURE__ */ P(so, {
555
- className: I(q.root, i),
556
- ownerState: E,
557
- ref: r,
558
- ...T,
559
- children: [/* @__PURE__ */ m.cloneElement(f, G), R ? /* @__PURE__ */ P("div", {
560
- children: [j, /* @__PURE__ */ P(ao, {
561
- ownerState: E,
562
- "aria-hidden": !0,
563
- className: q.asterisk,
564
- children: [" ", "*"]
565
- })]
566
- }) : j]
567
- });
568
- });
569
- process.env.NODE_ENV !== "production" && (ve.propTypes = {
570
- // ┌────────────────────────────── Warning ──────────────────────────────┐
571
- // │ These PropTypes are generated from the TypeScript type definitions. │
572
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
573
- // └─────────────────────────────────────────────────────────────────────┘
574
- /**
575
- * If `true`, the component appears selected.
576
- */
577
- checked: o.bool,
578
- /**
579
- * Override or extend the styles applied to the component.
580
- */
581
- classes: o.object,
582
- /**
583
- * @ignore
584
- */
585
- className: o.string,
586
- /**
587
- * The props used for each slot inside.
588
- * @default {}
589
- * @deprecated use the `slotProps` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
590
- */
591
- componentsProps: o.shape({
592
- typography: o.object
593
- }),
594
- /**
595
- * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`.
596
- */
597
- control: o.element.isRequired,
598
- /**
599
- * If `true`, the control is disabled.
600
- */
601
- disabled: o.bool,
602
- /**
603
- * If `true`, the label is rendered as it is passed without an additional typography node.
604
- */
605
- disableTypography: o.bool,
606
- /**
607
- * Pass a ref to the `input` element.
608
- */
609
- inputRef: H,
610
- /**
611
- * A text or an element to be used in an enclosing label element.
612
- */
613
- label: o.node,
614
- /**
615
- * The position of the label.
616
- * @default 'end'
617
- */
618
- labelPlacement: o.oneOf(["bottom", "end", "start", "top"]),
619
- /**
620
- * @ignore
621
- */
622
- name: o.string,
623
- /**
624
- * Callback fired when the state is changed.
625
- *
626
- * @param {React.SyntheticEvent} event The event source of the callback.
627
- * You can pull out the new checked state by accessing `event.target.checked` (boolean).
628
- */
629
- onChange: o.func,
630
- /**
631
- * If `true`, the label will indicate that the `input` is required.
632
- */
633
- required: o.bool,
634
- /**
635
- * The props used for each slot inside.
636
- * @default {}
637
- */
638
- slotProps: o.shape({
639
- typography: o.oneOfType([o.func, o.object])
640
- }),
641
- /**
642
- * The components used for each slot inside.
643
- * @default {}
644
- */
645
- slots: o.shape({
646
- typography: o.elementType
647
- }),
648
- /**
649
- * The system prop that allows defining system overrides as well as additional CSS styles.
650
- */
651
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
652
- /**
653
- * The value of the component.
654
- */
655
- value: o.any
656
- });
657
- function io(e) {
658
- return D("MuiFormGroup", e);
659
- }
660
- L("MuiFormGroup", ["root", "row", "error"]);
661
- const lo = (e) => {
662
- const {
663
- classes: t,
664
- row: r,
665
- error: n
666
- } = e;
667
- return M({
668
- root: ["root", r && "row", n && "error"]
669
- }, io, t);
670
- }, co = v("div", {
671
- name: "MuiFormGroup",
672
- slot: "Root",
673
- overridesResolver: (e, t) => {
674
- const {
675
- ownerState: r
676
- } = e;
677
- return [t.root, r.row && t.row];
678
- }
679
- })({
680
- display: "flex",
681
- flexDirection: "column",
682
- flexWrap: "wrap",
683
- variants: [{
684
- props: {
685
- row: !0
686
- },
687
- style: {
688
- flexDirection: "row"
689
- }
690
- }]
691
- }), Ce = /* @__PURE__ */ m.forwardRef(function(t, r) {
692
- const n = A({
693
- props: t,
694
- name: "MuiFormGroup"
695
- }), {
696
- className: s,
697
- row: i = !1,
698
- ...p
699
- } = n, f = X(), c = ye({
700
- props: n,
701
- muiFormControl: f,
702
- states: ["error"]
703
- }), l = {
704
- ...n,
705
- row: i,
706
- error: c.error
707
- }, u = lo(l);
708
- return /* @__PURE__ */ d(co, {
709
- className: I(u.root, s),
710
- ownerState: l,
711
- ref: r,
712
- ...p
713
- });
714
- });
715
- process.env.NODE_ENV !== "production" && (Ce.propTypes = {
716
- // ┌────────────────────────────── Warning ──────────────────────────────┐
717
- // │ These PropTypes are generated from the TypeScript type definitions. │
718
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
719
- // └─────────────────────────────────────────────────────────────────────┘
720
- /**
721
- * The content of the component.
722
- */
723
- children: o.node,
724
- /**
725
- * Override or extend the styles applied to the component.
726
- */
727
- classes: o.object,
728
- /**
729
- * @ignore
730
- */
731
- className: o.string,
732
- /**
733
- * Display group of elements in a compact row.
734
- * @default false
735
- */
736
- row: o.bool,
737
- /**
738
- * The system prop that allows defining system overrides as well as additional CSS styles.
739
- */
740
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
741
- });
742
- const po = be(/* @__PURE__ */ d("path", {
743
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
744
- }), "RadioButtonUnchecked"), uo = be(/* @__PURE__ */ d("path", {
745
- d: "M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"
746
- }), "RadioButtonChecked"), fo = v("span", {
747
- shouldForwardProp: oe
748
- })({
749
- position: "relative",
750
- display: "flex"
751
- }), mo = v(po)({
752
- // Scale applied to prevent dot misalignment in Safari
753
- transform: "scale(1)"
754
- }), ho = v(uo)(z(({
755
- theme: e
756
- }) => ({
757
- left: 0,
758
- position: "absolute",
759
- transform: "scale(0)",
760
- transition: e.transitions.create("transform", {
761
- easing: e.transitions.easing.easeIn,
762
- duration: e.transitions.duration.shortest
763
- }),
764
- variants: [{
765
- props: {
766
- checked: !0
767
- },
768
- style: {
769
- transform: "scale(1)",
770
- transition: e.transitions.create("transform", {
771
- easing: e.transitions.easing.easeOut,
772
- duration: e.transitions.duration.shortest
773
- })
774
- }
775
- }]
776
- })));
777
- function re(e) {
778
- const {
779
- checked: t = !1,
780
- classes: r = {},
781
- fontSize: n
782
- } = e, s = {
783
- ...e,
784
- checked: t
785
- };
786
- return /* @__PURE__ */ P(fo, {
787
- className: r.root,
788
- ownerState: s,
789
- children: [/* @__PURE__ */ d(mo, {
790
- fontSize: n,
791
- className: r.background,
792
- ownerState: s
793
- }), /* @__PURE__ */ d(ho, {
794
- fontSize: n,
795
- className: r.dot,
796
- ownerState: s
797
- })]
798
- });
799
- }
800
- process.env.NODE_ENV !== "production" && (re.propTypes = {
801
- /**
802
- * If `true`, the component is checked.
803
- */
804
- checked: o.bool,
805
- /**
806
- * Override or extend the styles applied to the component.
807
- */
808
- classes: o.object,
809
- /**
810
- * The size of the component.
811
- * `small` is equivalent to the dense radio styling.
812
- */
813
- fontSize: o.oneOf(["small", "medium"])
814
- });
815
- const ne = /* @__PURE__ */ m.createContext(void 0);
816
- process.env.NODE_ENV !== "production" && (ne.displayName = "RadioGroupContext");
817
- function bo() {
818
- return m.useContext(ne);
819
- }
820
- function yo(e) {
821
- return D("MuiRadio", e);
822
- }
823
- const de = L("MuiRadio", ["root", "checked", "disabled", "colorPrimary", "colorSecondary", "sizeSmall"]), go = (e) => {
824
- const {
825
- classes: t,
826
- color: r,
827
- size: n
828
- } = e, s = {
829
- root: ["root", `color${w(r)}`, n !== "medium" && `size${w(n)}`]
830
- };
831
- return {
832
- ...t,
833
- ...M(s, yo, t)
834
- };
835
- }, vo = v(te, {
836
- shouldForwardProp: (e) => oe(e) || e === "classes",
837
- name: "MuiRadio",
838
- slot: "Root",
839
- overridesResolver: (e, t) => {
840
- const {
841
- ownerState: r
842
- } = e;
843
- return [t.root, r.size !== "medium" && t[`size${w(r.size)}`], t[`color${w(r.color)}`]];
844
- }
845
- })(z(({
846
- theme: e
847
- }) => ({
848
- color: (e.vars || e).palette.text.secondary,
849
- [`&.${de.disabled}`]: {
850
- color: (e.vars || e).palette.action.disabled
851
- },
852
- variants: [{
853
- props: {
854
- color: "default",
855
- disabled: !1,
856
- disableRipple: !1
857
- },
858
- style: {
859
- "&:hover": {
860
- backgroundColor: e.vars ? `rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})` : W(e.palette.action.active, e.palette.action.hoverOpacity)
861
- }
862
- }
863
- }, ...Object.entries(e.palette).filter(Y()).map(([t]) => ({
864
- props: {
865
- color: t,
866
- disabled: !1,
867
- disableRipple: !1
868
- },
869
- style: {
870
- "&:hover": {
871
- backgroundColor: e.vars ? `rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})` : W(e.palette[t].main, e.palette.action.hoverOpacity)
872
- }
873
- }
874
- })), ...Object.entries(e.palette).filter(Y()).map(([t]) => ({
875
- props: {
876
- color: t,
877
- disabled: !1
878
- },
879
- style: {
880
- [`&.${de.checked}`]: {
881
- color: (e.vars || e).palette[t].main
882
- }
883
- }
884
- })), {
885
- // Should be last to override other colors
886
- props: {
887
- disableRipple: !1
888
- },
889
- style: {
890
- // Reset on touch devices, it doesn't add specificity
891
- "&:hover": {
892
- "@media (hover: none)": {
893
- backgroundColor: "transparent"
894
- }
895
- }
896
- }
897
- }]
898
- })));
899
- function Co(e, t) {
900
- return typeof t == "object" && t !== null ? e === t : String(e) === String(t);
901
- }
902
- const pe = /* @__PURE__ */ d(re, {
903
- checked: !0
904
- }), ue = /* @__PURE__ */ d(re, {}), ke = /* @__PURE__ */ m.forwardRef(function(t, r) {
905
- const n = A({
906
- props: t,
907
- name: "MuiRadio"
908
- }), {
909
- checked: s,
910
- checkedIcon: i = pe,
911
- color: p = "primary",
912
- icon: f = ue,
913
- name: c,
914
- onChange: l,
915
- size: u = "medium",
916
- className: a,
917
- disabled: h,
918
- disableRipple: C = !1,
919
- ...k
920
- } = n, O = X();
921
- let y = h;
922
- O && typeof y > "u" && (y = O.disabled), y ?? (y = !1);
923
- const x = {
924
- ...n,
925
- disabled: y,
926
- disableRipple: C,
927
- color: p,
928
- size: u
929
- }, b = go(x), T = bo();
930
- let S = s;
931
- const B = Ae(l, T && T.onChange);
932
- let R = c;
933
- return T && (typeof S > "u" && (S = Co(T.value, n.value)), typeof R > "u" && (R = T.name)), /* @__PURE__ */ d(vo, {
934
- type: "radio",
935
- icon: /* @__PURE__ */ m.cloneElement(f, {
936
- fontSize: ue.props.fontSize ?? u
937
- }),
938
- checkedIcon: /* @__PURE__ */ m.cloneElement(i, {
939
- fontSize: pe.props.fontSize ?? u
940
- }),
941
- disabled: y,
942
- ownerState: x,
943
- classes: b,
944
- name: R,
945
- checked: S,
946
- onChange: B,
947
- ref: r,
948
- className: I(b.root, a),
949
- ...k
950
- });
951
- });
952
- process.env.NODE_ENV !== "production" && (ke.propTypes = {
953
- // ┌────────────────────────────── Warning ──────────────────────────────┐
954
- // │ These PropTypes are generated from the TypeScript type definitions. │
955
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
956
- // └─────────────────────────────────────────────────────────────────────┘
957
- /**
958
- * If `true`, the component is checked.
959
- */
960
- checked: o.bool,
961
- /**
962
- * The icon to display when the component is checked.
963
- * @default <RadioButtonIcon checked />
964
- */
965
- checkedIcon: o.node,
966
- /**
967
- * Override or extend the styles applied to the component.
968
- */
969
- classes: o.object,
970
- /**
971
- * @ignore
972
- */
973
- className: o.string,
974
- /**
975
- * The color of the component.
976
- * It supports both default and custom theme colors, which can be added as shown in the
977
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
978
- * @default 'primary'
979
- */
980
- color: o.oneOfType([o.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), o.string]),
981
- /**
982
- * If `true`, the component is disabled.
983
- */
984
- disabled: o.bool,
985
- /**
986
- * If `true`, the ripple effect is disabled.
987
- * @default false
988
- */
989
- disableRipple: o.bool,
990
- /**
991
- * The icon to display when the component is unchecked.
992
- * @default <RadioButtonIcon />
993
- */
994
- icon: o.node,
995
- /**
996
- * The id of the `input` element.
997
- */
998
- id: o.string,
999
- /**
1000
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
1001
- */
1002
- inputProps: o.object,
1003
- /**
1004
- * Pass a ref to the `input` element.
1005
- */
1006
- inputRef: H,
1007
- /**
1008
- * Name attribute of the `input` element.
1009
- */
1010
- name: o.string,
1011
- /**
1012
- * Callback fired when the state is changed.
1013
- *
1014
- * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
1015
- * You can pull out the new value by accessing `event.target.value` (string).
1016
- * You can pull out the new checked state by accessing `event.target.checked` (boolean).
1017
- */
1018
- onChange: o.func,
1019
- /**
1020
- * If `true`, the `input` element is required.
1021
- * @default false
1022
- */
1023
- required: o.bool,
1024
- /**
1025
- * The size of the component.
1026
- * `small` is equivalent to the dense radio styling.
1027
- * @default 'medium'
1028
- */
1029
- size: o.oneOfType([o.oneOf(["medium", "small"]), o.string]),
1030
- /**
1031
- * The system prop that allows defining system overrides as well as additional CSS styles.
1032
- */
1033
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
1034
- /**
1035
- * The value of the component. The DOM API casts this to a string.
1036
- */
1037
- value: o.any
1038
- });
1039
- function ko(e) {
1040
- return D("MuiRadioGroup", e);
1041
- }
1042
- L("MuiRadioGroup", ["root", "row", "error"]);
1043
- const wo = (e) => {
1044
- const {
1045
- classes: t,
1046
- row: r,
1047
- error: n
1048
- } = e;
1049
- return M({
1050
- root: ["root", r && "row", n && "error"]
1051
- }, ko, t);
1052
- }, we = /* @__PURE__ */ m.forwardRef(function(t, r) {
1053
- const {
1054
- // private
1055
- // eslint-disable-next-line react/prop-types
1056
- actions: n,
1057
- children: s,
1058
- className: i,
1059
- defaultValue: p,
1060
- name: f,
1061
- onChange: c,
1062
- value: l,
1063
- ...u
1064
- } = t, a = m.useRef(null), h = wo(t), [C, k] = he({
1065
- controlled: l,
1066
- default: p,
1067
- name: "RadioGroup"
1068
- });
1069
- m.useImperativeHandle(n, () => ({
1070
- focus: () => {
1071
- let b = a.current.querySelector("input:not(:disabled):checked");
1072
- b || (b = a.current.querySelector("input:not(:disabled)")), b && b.focus();
1073
- }
1074
- }), []);
1075
- const O = Le(r, a), y = De(f), x = m.useMemo(() => ({
1076
- name: y,
1077
- onChange(b) {
1078
- k(b.target.value), c && c(b, b.target.value);
1079
- },
1080
- value: C
1081
- }), [y, c, k, C]);
1082
- return /* @__PURE__ */ d(ne.Provider, {
1083
- value: x,
1084
- children: /* @__PURE__ */ d(Ce, {
1085
- role: "radiogroup",
1086
- ref: O,
1087
- className: I(h.root, i),
1088
- ...u,
1089
- children: s
1090
- })
1091
- });
1092
- });
1093
- process.env.NODE_ENV !== "production" && (we.propTypes = {
1094
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1095
- // │ These PropTypes are generated from the TypeScript type definitions. │
1096
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
1097
- // └─────────────────────────────────────────────────────────────────────┘
1098
- /**
1099
- * The content of the component.
1100
- */
1101
- children: o.node,
1102
- /**
1103
- * @ignore
1104
- */
1105
- className: o.string,
1106
- /**
1107
- * The default value. Use when the component is not controlled.
1108
- */
1109
- defaultValue: o.any,
1110
- /**
1111
- * The name used to reference the value of the control.
1112
- * If you don't provide this prop, it falls back to a randomly generated name.
1113
- */
1114
- name: o.string,
1115
- /**
1116
- * Callback fired when a radio button is selected.
1117
- *
1118
- * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
1119
- * @param {string} value The value of the selected radio button.
1120
- * You can pull out the new value by accessing `event.target.value` (string).
1121
- */
1122
- onChange: o.func,
1123
- /**
1124
- * Value of the selected radio button. The DOM API casts this to a string.
1125
- */
1126
- value: o.any
1127
- });
1128
- const Se = Qe({
1129
- createStyledComponent: v("div", {
1130
- name: "MuiStack",
1131
- slot: "Root",
1132
- overridesResolver: (e, t) => t.root
1133
- }),
1134
- useThemeProps: (e) => A({
1135
- props: e,
1136
- name: "MuiStack"
1137
- })
1138
- });
1139
- process.env.NODE_ENV !== "production" && (Se.propTypes = {
1140
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1141
- // │ These PropTypes are generated from the TypeScript type definitions. │
1142
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
1143
- // └─────────────────────────────────────────────────────────────────────┘
1144
- /**
1145
- * The content of the component.
1146
- */
1147
- children: o.node,
1148
- /**
1149
- * The component used for the root node.
1150
- * Either a string to use a HTML element or a component.
1151
- */
1152
- component: o.elementType,
1153
- /**
1154
- * Defines the `flex-direction` style property.
1155
- * It is applied for all screen sizes.
1156
- * @default 'column'
1157
- */
1158
- direction: o.oneOfType([o.oneOf(["column-reverse", "column", "row-reverse", "row"]), o.arrayOf(o.oneOf(["column-reverse", "column", "row-reverse", "row"])), o.object]),
1159
- /**
1160
- * Add an element between each child.
1161
- */
1162
- divider: o.node,
1163
- /**
1164
- * Defines the space between immediate children.
1165
- * @default 0
1166
- */
1167
- spacing: o.oneOfType([o.arrayOf(o.oneOfType([o.number, o.string])), o.number, o.object, o.string]),
1168
- /**
1169
- * The system prop, which allows defining system overrides as well as additional CSS styles.
1170
- */
1171
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
1172
- /**
1173
- * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
1174
- *
1175
- * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
1176
- * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
1177
- *
1178
- * To enable this flag globally, follow the [theme's default props](https://mui.com/material-ui/customization/theme-components/#default-props) configuration.
1179
- * @default false
1180
- */
1181
- useFlexGap: o.bool
1182
- });
1183
- function So(e) {
1184
- return D("MuiSwitch", e);
1185
- }
1186
- const g = L("MuiSwitch", ["root", "edgeStart", "edgeEnd", "switchBase", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium", "checked", "disabled", "input", "thumb", "track"]), Ro = (e) => {
1187
- const {
1188
- classes: t,
1189
- edge: r,
1190
- size: n,
1191
- color: s,
1192
- checked: i,
1193
- disabled: p
1194
- } = e, f = {
1195
- root: ["root", r && `edge${w(r)}`, `size${w(n)}`],
1196
- switchBase: ["switchBase", `color${w(s)}`, i && "checked", p && "disabled"],
1197
- thumb: ["thumb"],
1198
- track: ["track"],
1199
- input: ["input"]
1200
- }, c = M(f, So, t);
1201
- return {
1202
- ...t,
1203
- // forward the disabled and checked classes to the SwitchBase
1204
- ...c
1205
- };
1206
- }, Oo = v("span", {
1207
- name: "MuiSwitch",
1208
- slot: "Root",
1209
- overridesResolver: (e, t) => {
1210
- const {
1211
- ownerState: r
1212
- } = e;
1213
- return [t.root, r.edge && t[`edge${w(r.edge)}`], t[`size${w(r.size)}`]];
1214
- }
1215
- })({
1216
- display: "inline-flex",
1217
- width: 34 + 12 * 2,
1218
- height: 14 + 12 * 2,
1219
- overflow: "hidden",
1220
- padding: 12,
1221
- boxSizing: "border-box",
1222
- position: "relative",
1223
- flexShrink: 0,
1224
- zIndex: 0,
1225
- // Reset the stacking context.
1226
- verticalAlign: "middle",
1227
- // For correct alignment with the text.
1228
- "@media print": {
1229
- colorAdjust: "exact"
1230
- },
1231
- variants: [{
1232
- props: {
1233
- edge: "start"
1234
- },
1235
- style: {
1236
- marginLeft: -8
1237
- }
1238
- }, {
1239
- props: {
1240
- edge: "end"
1241
- },
1242
- style: {
1243
- marginRight: -8
1244
- }
1245
- }, {
1246
- props: {
1247
- size: "small"
1248
- },
1249
- style: {
1250
- width: 40,
1251
- height: 24,
1252
- padding: 7,
1253
- [`& .${g.thumb}`]: {
1254
- width: 16,
1255
- height: 16
1256
- },
1257
- [`& .${g.switchBase}`]: {
1258
- padding: 4,
1259
- [`&.${g.checked}`]: {
1260
- transform: "translateX(16px)"
1261
- }
1262
- }
1263
- }
1264
- }]
1265
- }), xo = v(te, {
1266
- name: "MuiSwitch",
1267
- slot: "SwitchBase",
1268
- overridesResolver: (e, t) => {
1269
- const {
1270
- ownerState: r
1271
- } = e;
1272
- return [t.switchBase, {
1273
- [`& .${g.input}`]: t.input
1274
- }, r.color !== "default" && t[`color${w(r.color)}`]];
1275
- }
1276
- })(z(({
1277
- theme: e
1278
- }) => ({
1279
- position: "absolute",
1280
- top: 0,
1281
- left: 0,
1282
- zIndex: 1,
1283
- // Render above the focus ripple.
1284
- color: e.vars ? e.vars.palette.Switch.defaultColor : `${e.palette.mode === "light" ? e.palette.common.white : e.palette.grey[300]}`,
1285
- transition: e.transitions.create(["left", "transform"], {
1286
- duration: e.transitions.duration.shortest
1287
- }),
1288
- [`&.${g.checked}`]: {
1289
- transform: "translateX(20px)"
1290
- },
1291
- [`&.${g.disabled}`]: {
1292
- color: e.vars ? e.vars.palette.Switch.defaultDisabledColor : `${e.palette.mode === "light" ? e.palette.grey[100] : e.palette.grey[600]}`
1293
- },
1294
- [`&.${g.checked} + .${g.track}`]: {
1295
- opacity: 0.5
1296
- },
1297
- [`&.${g.disabled} + .${g.track}`]: {
1298
- opacity: e.vars ? e.vars.opacity.switchTrackDisabled : `${e.palette.mode === "light" ? 0.12 : 0.2}`
1299
- },
1300
- [`& .${g.input}`]: {
1301
- left: "-100%",
1302
- width: "300%"
1303
- }
1304
- })), z(({
1305
- theme: e
1306
- }) => ({
1307
- "&:hover": {
1308
- backgroundColor: e.vars ? `rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})` : W(e.palette.action.active, e.palette.action.hoverOpacity),
1309
- // Reset on touch devices, it doesn't add specificity
1310
- "@media (hover: none)": {
1311
- backgroundColor: "transparent"
1312
- }
1313
- },
1314
- variants: [...Object.entries(e.palette).filter(Y(["light"])).map(([t]) => ({
1315
- props: {
1316
- color: t
1317
- },
1318
- style: {
1319
- [`&.${g.checked}`]: {
1320
- color: (e.vars || e).palette[t].main,
1321
- "&:hover": {
1322
- backgroundColor: e.vars ? `rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})` : W(e.palette[t].main, e.palette.action.hoverOpacity),
1323
- "@media (hover: none)": {
1324
- backgroundColor: "transparent"
1325
- }
1326
- },
1327
- [`&.${g.disabled}`]: {
1328
- color: e.vars ? e.vars.palette.Switch[`${t}DisabledColor`] : `${e.palette.mode === "light" ? Ie(e.palette[t].main, 0.62) : ze(e.palette[t].main, 0.55)}`
1329
- }
1330
- },
1331
- [`&.${g.checked} + .${g.track}`]: {
1332
- backgroundColor: (e.vars || e).palette[t].main
1333
- }
1334
- }
1335
- }))]
1336
- }))), To = v("span", {
1337
- name: "MuiSwitch",
1338
- slot: "Track",
1339
- overridesResolver: (e, t) => t.track
1340
- })(z(({
1341
- theme: e
1342
- }) => ({
1343
- height: "100%",
1344
- width: "100%",
1345
- borderRadius: 14 / 2,
1346
- zIndex: -1,
1347
- transition: e.transitions.create(["opacity", "background-color"], {
1348
- duration: e.transitions.duration.shortest
1349
- }),
1350
- backgroundColor: e.vars ? e.vars.palette.common.onBackground : `${e.palette.mode === "light" ? e.palette.common.black : e.palette.common.white}`,
1351
- opacity: e.vars ? e.vars.opacity.switchTrack : `${e.palette.mode === "light" ? 0.38 : 0.3}`
1352
- }))), Po = v("span", {
1353
- name: "MuiSwitch",
1354
- slot: "Thumb",
1355
- overridesResolver: (e, t) => t.thumb
1356
- })(z(({
1357
- theme: e
1358
- }) => ({
1359
- boxShadow: (e.vars || e).shadows[1],
1360
- backgroundColor: "currentColor",
1361
- width: 20,
1362
- height: 20,
1363
- borderRadius: "50%"
1364
- }))), ee = /* @__PURE__ */ m.forwardRef(function(t, r) {
1365
- const n = A({
1366
- props: t,
1367
- name: "MuiSwitch"
1368
- }), {
1369
- className: s,
1370
- color: i = "primary",
1371
- edge: p = !1,
1372
- size: f = "medium",
1373
- sx: c,
1374
- ...l
1375
- } = n, u = {
1376
- ...n,
1377
- color: i,
1378
- edge: p,
1379
- size: f
1380
- }, a = Ro(u), h = /* @__PURE__ */ d(Po, {
1381
- className: a.thumb,
1382
- ownerState: u
1383
- });
1384
- return /* @__PURE__ */ P(Oo, {
1385
- className: I(a.root, s),
1386
- sx: c,
1387
- ownerState: u,
1388
- children: [/* @__PURE__ */ d(xo, {
1389
- type: "checkbox",
1390
- icon: h,
1391
- checkedIcon: h,
1392
- ref: r,
1393
- ownerState: u,
1394
- ...l,
1395
- classes: {
1396
- ...a,
1397
- root: a.switchBase
1398
- }
1399
- }), /* @__PURE__ */ d(To, {
1400
- className: a.track,
1401
- ownerState: u
1402
- })]
1403
- });
1404
- });
1405
- process.env.NODE_ENV !== "production" && (ee.propTypes = {
1406
- // ┌────────────────────────────── Warning ──────────────────────────────┐
1407
- // │ These PropTypes are generated from the TypeScript type definitions. │
1408
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
1409
- // └─────────────────────────────────────────────────────────────────────┘
1410
- /**
1411
- * If `true`, the component is checked.
1412
- */
1413
- checked: o.bool,
1414
- /**
1415
- * The icon to display when the component is checked.
1416
- */
1417
- checkedIcon: o.node,
1418
- /**
1419
- * Override or extend the styles applied to the component.
1420
- */
1421
- classes: o.object,
1422
- /**
1423
- * @ignore
1424
- */
1425
- className: o.string,
1426
- /**
1427
- * The color of the component.
1428
- * It supports both default and custom theme colors, which can be added as shown in the
1429
- * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
1430
- * @default 'primary'
1431
- */
1432
- color: o.oneOfType([o.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), o.string]),
1433
- /**
1434
- * The default checked state. Use when the component is not controlled.
1435
- */
1436
- defaultChecked: o.bool,
1437
- /**
1438
- * If `true`, the component is disabled.
1439
- */
1440
- disabled: o.bool,
1441
- /**
1442
- * If `true`, the ripple effect is disabled.
1443
- * @default false
1444
- */
1445
- disableRipple: o.bool,
1446
- /**
1447
- * If given, uses a negative margin to counteract the padding on one
1448
- * side (this is often helpful for aligning the left or right
1449
- * side of the icon with content above or below, without ruining the border
1450
- * size and shape).
1451
- * @default false
1452
- */
1453
- edge: o.oneOf(["end", "start", !1]),
1454
- /**
1455
- * The icon to display when the component is unchecked.
1456
- */
1457
- icon: o.node,
1458
- /**
1459
- * The id of the `input` element.
1460
- */
1461
- id: o.string,
1462
- /**
1463
- * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
1464
- */
1465
- inputProps: o.object,
1466
- /**
1467
- * Pass a ref to the `input` element.
1468
- */
1469
- inputRef: H,
1470
- /**
1471
- * Callback fired when the state is changed.
1472
- *
1473
- * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
1474
- * You can pull out the new value by accessing `event.target.value` (string).
1475
- * You can pull out the new checked state by accessing `event.target.checked` (boolean).
1476
- */
1477
- onChange: o.func,
1478
- /**
1479
- * If `true`, the `input` element is required.
1480
- * @default false
1481
- */
1482
- required: o.bool,
1483
- /**
1484
- * The size of the component.
1485
- * `small` is equivalent to the dense switch styling.
1486
- * @default 'medium'
1487
- */
1488
- size: o.oneOfType([o.oneOf(["medium", "small"]), o.string]),
1489
- /**
1490
- * The system prop that allows defining system overrides as well as additional CSS styles.
1491
- */
1492
- sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
1493
- /**
1494
- * The value of the component. The DOM API casts this to a string.
1495
- * The browser uses "on" as the default value.
1496
- */
1497
- value: o.any
1498
- });
1499
- const $o = (e, t) => {
1500
- const r = [
1501
- "EMAIL",
1502
- "INAPP_WEB",
1503
- "SMS",
1504
- "CALL",
1505
- "PUSH",
1506
- "WEB_PUSH",
1507
- "SLACK"
1508
- ];
1509
- return r.indexOf(e) - r.indexOf(t);
1510
- }, fe = (e, t) => {
1511
- const r = ["off", "instant", "hourly", "daily", "weekly", "monthly"];
1512
- return r.indexOf(e) - r.indexOf(t);
1513
- }, me = (e) => ({
1514
- off: "Off",
1515
- instant: "Instant",
1516
- hourly: "Hourly",
1517
- daily: "Daily",
1518
- weekly: "Weekly",
1519
- monthly: "Monthly"
1520
- })[e], Lo = ({
1521
- notification: e,
1522
- preferences: t,
1523
- updateDelivery: r,
1524
- subNotificationId: n
1525
- }) => /* @__PURE__ */ d(ie, { children: e.channels.sort($o).map((s, i) => {
1526
- const p = t.find(
1527
- (a) => a.notificationId === e.notificationId && a.channel === s
1528
- );
1529
- if (!p)
1530
- return null;
1531
- const f = Oe(s), c = xe(s), l = Object.keys(
1532
- e.options[s]
1533
- ).filter(
1534
- (a) => a !== "defaultDeliveryOption" && a !== "defaultDeliverOption"
1535
- );
1536
- let u;
1537
- return l.length === 1 ? u = /* @__PURE__ */ d(_, { variant: "body1", children: me(p.delivery) }) : l.length === 2 && l.includes("off") ? u = /* @__PURE__ */ d(
1538
- ee,
1539
- {
1540
- checked: p.delivery !== "off",
1541
- onChange: (a, h) => {
1542
- if (h) {
1543
- const C = l.find((k) => k !== "off");
1544
- r(
1545
- e.notificationId,
1546
- s,
1547
- C,
1548
- n
1549
- );
1550
- } else
1551
- r(
1552
- e.notificationId,
1553
- s,
1554
- "off",
1555
- n
1556
- );
1557
- }
1558
- }
1559
- ) : u = /* @__PURE__ */ P(ie, { children: [
1560
- /* @__PURE__ */ d(
1561
- ee,
1562
- {
1563
- checked: p.delivery !== "off",
1564
- onChange: (a, h) => {
1565
- if (h) {
1566
- const C = l.sort(fe).find((k) => k !== "off");
1567
- r(
1568
- e.notificationId,
1569
- s,
1570
- C,
1571
- n
1572
- );
1573
- } else
1574
- r(
1575
- e.notificationId,
1576
- s,
1577
- "off",
1578
- n
1579
- );
1580
- }
1581
- }
1582
- ),
1583
- /* @__PURE__ */ d(
1584
- "div",
1585
- {
1586
- style: {
1587
- width: "100%",
1588
- marginTop: 8,
1589
- maxHeight: p.delivery !== "off" ? 1e3 : 0,
1590
- overflow: "hidden",
1591
- transition: "max-height 0.3s ease"
1592
- },
1593
- children: /* @__PURE__ */ P("div", { children: [
1594
- /* @__PURE__ */ d("div", { style: { marginTop: 20 }, children: /* @__PURE__ */ d(_, { variant: "body1", fontWeight: 600, children: "Choose frequency:" }) }),
1595
- /* @__PURE__ */ d(
1596
- we,
1597
- {
1598
- value: p.delivery,
1599
- onChange: (a) => {
1600
- r(
1601
- e.notificationId,
1602
- s,
1603
- a.target.value,
1604
- n
1605
- );
1606
- },
1607
- children: /* @__PURE__ */ d(Se, { direction: "column", style: { paddingTop: 10 }, children: l.filter((a) => a !== "off").sort(fe).map((a) => /* @__PURE__ */ d(
1608
- ve,
1609
- {
1610
- control: /* @__PURE__ */ d(ke, {}),
1611
- value: a,
1612
- label: me(a)
1613
- },
1614
- a
1615
- )) })
1616
- }
1617
- )
1618
- ] })
1619
- }
1620
- )
1621
- ] }), /* @__PURE__ */ P("div", { children: [
1622
- /* @__PURE__ */ P(
1623
- "div",
1624
- {
1625
- style: {
1626
- display: "flex",
1627
- justifyContent: "space-between",
1628
- flexWrap: "wrap",
1629
- marginTop: i === 0 ? 0 : 12,
1630
- marginBottom: i === e.channels.length - 1 ? 0 : 12
1631
- },
1632
- children: [
1633
- /* @__PURE__ */ P(
1634
- "div",
1635
- {
1636
- style: {
1637
- display: "flex",
1638
- alignItems: "center",
1639
- gap: 8
1640
- },
1641
- children: [
1642
- c,
1643
- /* @__PURE__ */ d(_, { variant: "body1", children: f })
1644
- ]
1645
- }
1646
- ),
1647
- u
1648
- ]
1649
- }
1650
- ),
1651
- i !== e.channels.length - 1 && /* @__PURE__ */ d(Ve, {})
1652
- ] }, s);
1653
- }) });
1654
- export {
1655
- Lo as P,
1656
- Ae as c
1657
- };