@purpurds/toggle 8.2.2 → 8.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/toggle.es.js CHANGED
@@ -1,25 +1,25 @@
1
- import { jsx as f, Fragment as K, jsxs as D } from "react/jsx-runtime";
1
+ import { jsx as g, jsxs as D } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
- import { useState as $, useCallback as O, useEffect as k, cloneElement as le, isValidElement as pe, useRef as P, forwardRef as de } from "react";
3
+ import { useState as $, useCallback as O, useEffect as k, cloneElement as ie, isValidElement as ue, useRef as P, forwardRef as ae } from "react";
4
4
  import "react-dom";
5
- function fe(e) {
5
+ function se(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
7
  }
8
- var q = { exports: {} };
8
+ var M = { exports: {} };
9
9
  /*!
10
10
  Copyright (c) 2018 Jed Watson.
11
11
  Licensed under the MIT License (MIT), see
12
12
  http://jedwatson.github.io/classnames
13
13
  */
14
- var B;
15
- function he() {
16
- return B || (B = 1, function(e) {
14
+ var j;
15
+ function ce() {
16
+ return j || (j = 1, (function(e) {
17
17
  (function() {
18
18
  var n = {}.hasOwnProperty;
19
19
  function t() {
20
- for (var r = "", a = 0; a < arguments.length; a++) {
21
- var u = arguments[a];
22
- u && (r = o(r, i.call(this, u)));
20
+ for (var r = "", u = 0; u < arguments.length; u++) {
21
+ var a = arguments[u];
22
+ a && (r = o(r, i.call(this, a)));
23
23
  }
24
24
  return r;
25
25
  }
@@ -32,20 +32,20 @@ function he() {
32
32
  return t.apply(this, r);
33
33
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
34
34
  return r.toString();
35
- var a = "";
36
- for (var u in r)
37
- n.call(r, u) && r[u] && (a = o(a, this && this[u] || u));
38
- return a;
35
+ var u = "";
36
+ for (var a in r)
37
+ n.call(r, a) && r[a] && (u = o(u, this && this[a] || a));
38
+ return u;
39
39
  }
40
- function o(r, a) {
41
- return a ? r ? r + " " + a : r + a : r;
40
+ function o(r, u) {
41
+ return u ? r ? r + " " + u : r + u : r;
42
42
  }
43
43
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
44
44
  })();
45
- }(q)), q.exports;
45
+ })(M)), M.exports;
46
46
  }
47
- var ge = he();
48
- const me = /* @__PURE__ */ fe(ge), ve = {
47
+ var le = ce();
48
+ const pe = /* @__PURE__ */ se(le), de = {
49
49
  "purpur-icon": "_purpur-icon_8u1lq_1",
50
50
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
51
51
  "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
@@ -53,87 +53,94 @@ const me = /* @__PURE__ */ fe(ge), ve = {
53
53
  "purpur-icon--md": "_purpur-icon--md_8u1lq_16",
54
54
  "purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
55
55
  "purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
56
- }, _e = me.bind(ve), X = "purpur-icon", be = "md", ye = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), we = ({ content: e = "", title: n } = {}) => {
56
+ }, fe = pe.bind(de), q = "purpur-icon", he = "md", ge = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), _e = ({ content: e = "", title: n } = {}) => {
57
57
  const t = [
58
58
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
59
59
  { name: "fill", value: "currentColor" },
60
60
  { name: "viewBox", value: "0 0 24 24" },
61
61
  n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
62
62
  ], i = n ? `<title>${n}</title>` : "";
63
- return `<svg ${ye(t)}>${i}${e}</svg>`;
64
- }, Se = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Q = ({ svg: e, allyTitle: n, className: t, size: i = be, ...o }) => {
65
- const r = we({
66
- content: Se(e.svg),
63
+ return `<svg ${ge(t)}>${i}${e}</svg>`;
64
+ }, me = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), G = ({ svg: e, allyTitle: n, className: t, size: i = he, ...o }) => {
65
+ const r = _e({
66
+ content: me(e.svg),
67
67
  title: n
68
- }), a = _e(t, X, `${X}--${i}`);
69
- return /* @__PURE__ */ f("span", { className: a, dangerouslySetInnerHTML: { __html: r }, ...o });
68
+ }), u = fe(t, q, `${q}--${i}`);
69
+ return /* @__PURE__ */ g("span", { className: u, dangerouslySetInnerHTML: { __html: r }, ...o });
70
70
  };
71
- Q.displayName = "Icon";
72
- const xe = {
71
+ G.displayName = "Icon";
72
+ const ve = {
73
73
  name: "checkmark-bold",
74
74
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M21.243 4.176a2 2 0 0 1 .324 2.81l-10.45 13.176a2.092 2.092 0 0 1-3.118.18l-5.413-5.413A2 2 0 1 1 5.414 12.1l3.9 3.9 9.118-11.5a2 2 0 0 1 2.81-.324Z" clip-rule="evenodd"/></svg>',
75
75
  keywords: ["checkmark-bold"],
76
76
  category: "utility"
77
77
  };
78
- function W(e, n) {
78
+ function B(e, n) {
79
79
  if (typeof e == "function")
80
80
  return e(n);
81
81
  e != null && (e.current = n);
82
82
  }
83
- function $e(...e) {
83
+ function be(...e) {
84
84
  return (n) => {
85
85
  let t = !1;
86
86
  const i = e.map((o) => {
87
- const r = W(o, n);
87
+ const r = B(o, n);
88
88
  return !t && typeof r == "function" && (t = !0), r;
89
89
  });
90
90
  if (t)
91
91
  return () => {
92
92
  for (let o = 0; o < i.length; o++) {
93
93
  const r = i[o];
94
- typeof r == "function" ? r() : W(e[o], null);
94
+ typeof r == "function" ? r() : B(e[o], null);
95
95
  }
96
96
  };
97
97
  };
98
98
  }
99
- var Y = s.forwardRef((e, n) => {
100
- const { children: t, ...i } = e, o = s.Children.toArray(t), r = o.find(Re);
101
- if (r) {
102
- const a = r.props.children, u = o.map((c) => c === r ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : c);
103
- return /* @__PURE__ */ f(A, { ...i, ref: n, children: s.isValidElement(a) ? s.cloneElement(a, void 0, u) : null });
104
- }
105
- return /* @__PURE__ */ f(A, { ...i, ref: n, children: t });
106
- });
107
- Y.displayName = "Slot";
108
- var A = s.forwardRef((e, n) => {
109
- const { children: t, ...i } = e;
110
- if (s.isValidElement(t)) {
111
- const o = ke(t), r = Pe(i, t.props);
112
- return t.type !== s.Fragment && (r.ref = n ? $e(n, o) : o), s.cloneElement(t, r);
113
- }
114
- return s.Children.count(t) > 1 ? s.Children.only(null) : null;
115
- });
116
- A.displayName = "SlotClone";
117
- var Ce = ({ children: e }) => /* @__PURE__ */ f(K, { children: e });
118
- function Re(e) {
119
- return s.isValidElement(e) && e.type === Ce;
120
- }
121
- function Pe(e, n) {
99
+ // @__NO_SIDE_EFFECTS__
100
+ function ye(e) {
101
+ const n = /* @__PURE__ */ we(e), t = s.forwardRef((i, o) => {
102
+ const { children: r, ...u } = i, a = s.Children.toArray(r), c = a.find(xe);
103
+ if (c) {
104
+ const l = c.props.children, f = a.map((p) => p === c ? s.Children.count(l) > 1 ? s.Children.only(null) : s.isValidElement(l) ? l.props.children : null : p);
105
+ return /* @__PURE__ */ g(n, { ...u, ref: o, children: s.isValidElement(l) ? s.cloneElement(l, void 0, f) : null });
106
+ }
107
+ return /* @__PURE__ */ g(n, { ...u, ref: o, children: r });
108
+ });
109
+ return t.displayName = `${e}.Slot`, t;
110
+ }
111
+ // @__NO_SIDE_EFFECTS__
112
+ function we(e) {
113
+ const n = s.forwardRef((t, i) => {
114
+ const { children: o, ...r } = t;
115
+ if (s.isValidElement(o)) {
116
+ const u = Ce(o), a = $e(r, o.props);
117
+ return o.type !== s.Fragment && (a.ref = i ? be(i, u) : u), s.cloneElement(o, a);
118
+ }
119
+ return s.Children.count(o) > 1 ? s.Children.only(null) : null;
120
+ });
121
+ return n.displayName = `${e}.SlotClone`, n;
122
+ }
123
+ var Se = Symbol("radix.slottable");
124
+ function xe(e) {
125
+ return s.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Se;
126
+ }
127
+ function $e(e, n) {
122
128
  const t = { ...n };
123
129
  for (const i in n) {
124
130
  const o = e[i], r = n[i];
125
- /^on[A-Z]/.test(i) ? o && r ? t[i] = (...a) => {
126
- r(...a), o(...a);
131
+ /^on[A-Z]/.test(i) ? o && r ? t[i] = (...u) => {
132
+ const a = r(...u);
133
+ return o(...u), a;
127
134
  } : o && (t[i] = o) : i === "style" ? t[i] = { ...o, ...r } : i === "className" && (t[i] = [o, r].filter(Boolean).join(" "));
128
135
  }
129
136
  return { ...e, ...t };
130
137
  }
131
- function ke(e) {
138
+ function Ce(e) {
132
139
  var n, t;
133
140
  let i = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, o = i && "isReactWarning" in i && i.isReactWarning;
134
141
  return o ? e.ref : (i = (t = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : t.get, o = i && "isReactWarning" in i && i.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
135
142
  }
136
- var Ee = [
143
+ var Re = [
137
144
  "a",
138
145
  "button",
139
146
  "div",
@@ -147,17 +154,18 @@ var Ee = [
147
154
  "nav",
148
155
  "ol",
149
156
  "p",
157
+ "select",
150
158
  "span",
151
159
  "svg",
152
160
  "ul"
153
- ], Ne = Ee.reduce((e, n) => {
154
- const t = s.forwardRef((i, o) => {
155
- const { asChild: r, ...a } = i, u = r ? Y : n;
156
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(u, { ...a, ref: o });
161
+ ], Pe = Re.reduce((e, n) => {
162
+ const t = /* @__PURE__ */ ye(`Primitive.${n}`), i = s.forwardRef((o, r) => {
163
+ const { asChild: u, ...a } = o, c = u ? t : n;
164
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ g(c, { ...a, ref: r });
157
165
  });
158
- return t.displayName = `Primitive.${n}`, { ...e, [n]: t };
159
- }, {}), ze = "Label", ee = s.forwardRef((e, n) => /* @__PURE__ */ f(
160
- Ne.label,
166
+ return i.displayName = `Primitive.${n}`, { ...e, [n]: i };
167
+ }, {}), ke = "Label", J = s.forwardRef((e, n) => /* @__PURE__ */ g(
168
+ Pe.label,
161
169
  {
162
170
  ...e,
163
171
  ref: n,
@@ -167,26 +175,26 @@ var Ee = [
167
175
  }
168
176
  }
169
177
  ));
170
- ee.displayName = ze;
171
- var De = ee;
172
- function Oe(e) {
178
+ J.displayName = ke;
179
+ var Ee = J;
180
+ function Ne(e) {
173
181
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
174
182
  }
175
- var L = { exports: {} };
183
+ var X = { exports: {} };
176
184
  /*!
177
185
  Copyright (c) 2018 Jed Watson.
178
186
  Licensed under the MIT License (MIT), see
179
187
  http://jedwatson.github.io/classnames
180
188
  */
181
- var V;
182
- function Ae() {
183
- return V || (V = 1, function(e) {
189
+ var L;
190
+ function ze() {
191
+ return L || (L = 1, (function(e) {
184
192
  (function() {
185
193
  var n = {}.hasOwnProperty;
186
194
  function t() {
187
- for (var r = "", a = 0; a < arguments.length; a++) {
188
- var u = arguments[a];
189
- u && (r = o(r, i.call(this, u)));
195
+ for (var r = "", u = 0; u < arguments.length; u++) {
196
+ var a = arguments[u];
197
+ a && (r = o(r, i.call(this, a)));
190
198
  }
191
199
  return r;
192
200
  }
@@ -199,54 +207,54 @@ function Ae() {
199
207
  return t.apply(this, r);
200
208
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
201
209
  return r.toString();
202
- var a = "";
203
- for (var u in r)
204
- n.call(r, u) && r[u] && (a = o(a, this && this[u] || u));
205
- return a;
210
+ var u = "";
211
+ for (var a in r)
212
+ n.call(r, a) && r[a] && (u = o(u, this && this[a] || a));
213
+ return u;
206
214
  }
207
- function o(r, a) {
208
- return a ? r ? r + " " + a : r + a : r;
215
+ function o(r, u) {
216
+ return u ? r ? r + " " + u : r + u : r;
209
217
  }
210
218
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
211
219
  })();
212
- }(L)), L.exports;
220
+ })(X)), X.exports;
213
221
  }
214
- var Me = Ae();
215
- const je = /* @__PURE__ */ Oe(Me), qe = {
222
+ var De = ze();
223
+ const Oe = /* @__PURE__ */ Ne(De), Ae = {
216
224
  "purpur-label": "_purpur-label_1x80u_1",
217
225
  "purpur-label--negative": "_purpur-label--negative_1x80u_8",
218
226
  "purpur-label--disabled": "_purpur-label--disabled_1x80u_11"
219
- }, Be = je.bind(qe), N = "purpur-label", Xe = ({
227
+ }, Me = Oe.bind(Ae), N = "purpur-label", je = ({
220
228
  children: e,
221
229
  className: n,
222
230
  disabled: t,
223
231
  negative: i = !1,
224
232
  ...o
225
233
  }) => {
226
- const r = Be(n, N, {
234
+ const r = Me(n, N, {
227
235
  [`${N}--disabled`]: t,
228
236
  [`${N}--negative`]: i
229
237
  });
230
- return /* @__PURE__ */ f(De, { className: r, ...o, children: e });
238
+ return /* @__PURE__ */ g(Ee, { className: r, ...o, children: e });
231
239
  };
232
- function We(e) {
240
+ function qe(e) {
233
241
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
234
242
  }
235
- var H = { exports: {} };
243
+ var W = { exports: {} };
236
244
  /*!
237
245
  Copyright (c) 2018 Jed Watson.
238
246
  Licensed under the MIT License (MIT), see
239
247
  http://jedwatson.github.io/classnames
240
248
  */
241
- var T;
242
- function Le() {
243
- return T || (T = 1, function(e) {
249
+ var I;
250
+ function Be() {
251
+ return I || (I = 1, (function(e) {
244
252
  (function() {
245
253
  var n = {}.hasOwnProperty;
246
254
  function t() {
247
- for (var r = "", a = 0; a < arguments.length; a++) {
248
- var u = arguments[a];
249
- u && (r = o(r, i.call(this, u)));
255
+ for (var r = "", u = 0; u < arguments.length; u++) {
256
+ var a = arguments[u];
257
+ a && (r = o(r, i.call(this, a)));
250
258
  }
251
259
  return r;
252
260
  }
@@ -259,20 +267,20 @@ function Le() {
259
267
  return t.apply(this, r);
260
268
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
261
269
  return r.toString();
262
- var a = "";
263
- for (var u in r)
264
- n.call(r, u) && r[u] && (a = o(a, this && this[u] || u));
265
- return a;
270
+ var u = "";
271
+ for (var a in r)
272
+ n.call(r, a) && r[a] && (u = o(u, this && this[a] || a));
273
+ return u;
266
274
  }
267
- function o(r, a) {
268
- return a ? r ? r + " " + a : r + a : r;
275
+ function o(r, u) {
276
+ return u ? r ? r + " " + u : r + u : r;
269
277
  }
270
278
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
271
279
  })();
272
- }(H)), H.exports;
280
+ })(W)), W.exports;
273
281
  }
274
- var Ve = Le();
275
- const He = /* @__PURE__ */ We(Ve), Te = {
282
+ var Xe = Be();
283
+ const Le = /* @__PURE__ */ qe(Xe), We = {
276
284
  "purpur-paragraph": "_purpur-paragraph_1rh57_1",
277
285
  "purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
278
286
  "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
@@ -287,88 +295,88 @@ const He = /* @__PURE__ */ We(Ve), Te = {
287
295
  "purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1rh57_60",
288
296
  "purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
289
297
  "purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
290
- }, Fe = He.bind(Te), Ie = {
298
+ }, Ie = Le.bind(We), Te = {
291
299
  PARAGRAPH100: "paragraph-100"
292
- }, R = "purpur-paragraph", re = ({
300
+ }, R = "purpur-paragraph", K = ({
293
301
  children: e,
294
302
  className: n,
295
303
  disabled: t,
296
304
  enableHyphenation: i = !1,
297
305
  negative: o = !1,
298
- variant: r = Ie.PARAGRAPH100,
299
- ...a
306
+ variant: r = Te.PARAGRAPH100,
307
+ ...u
300
308
  }) => {
301
- const u = Fe(n, R, `${R}--${r}`, {
309
+ const a = Ie(n, R, `${R}--${r}`, {
302
310
  [`${R}--hyphens`]: i,
303
311
  [`${R}--disabled`]: t,
304
312
  [`${R}--negative`]: o
305
313
  });
306
- return /* @__PURE__ */ f("p", { ...a, className: u, children: e });
314
+ return /* @__PURE__ */ g("p", { ...u, className: a, children: e });
307
315
  };
308
- re.displayName = "Paragraph";
309
- function Ue(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
316
+ K.displayName = "Paragraph";
317
+ function Ve(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
310
318
  return function(o) {
311
319
  if (e == null || e(o), t === !1 || !o.defaultPrevented)
312
320
  return n == null ? void 0 : n(o);
313
321
  };
314
322
  }
315
- function F(e, n) {
323
+ function T(e, n) {
316
324
  if (typeof e == "function")
317
325
  return e(n);
318
326
  e != null && (e.current = n);
319
327
  }
320
- function te(...e) {
328
+ function Q(...e) {
321
329
  return (n) => {
322
330
  let t = !1;
323
331
  const i = e.map((o) => {
324
- const r = F(o, n);
332
+ const r = T(o, n);
325
333
  return !t && typeof r == "function" && (t = !0), r;
326
334
  });
327
335
  if (t)
328
336
  return () => {
329
337
  for (let o = 0; o < i.length; o++) {
330
338
  const r = i[o];
331
- typeof r == "function" ? r() : F(e[o], null);
339
+ typeof r == "function" ? r() : T(e[o], null);
332
340
  }
333
341
  };
334
342
  };
335
343
  }
336
- function Ze(...e) {
337
- return s.useCallback(te(...e), e);
344
+ function He(...e) {
345
+ return s.useCallback(Q(...e), e);
338
346
  }
339
- function Ge(e, n = []) {
347
+ function Fe(e, n = []) {
340
348
  let t = [];
341
- function i(r, a) {
342
- const u = s.createContext(a), c = t.length;
343
- t = [...t, a];
344
- const l = (d) => {
345
- var _;
346
- const { scope: p, children: g, ...h } = d, m = ((_ = p == null ? void 0 : p[e]) == null ? void 0 : _[c]) || u, b = s.useMemo(() => h, Object.values(h));
347
- return /* @__PURE__ */ f(m.Provider, { value: b, children: g });
349
+ function i(r, u) {
350
+ const a = s.createContext(u), c = t.length;
351
+ t = [...t, u];
352
+ const l = (p) => {
353
+ var v;
354
+ const { scope: d, children: _, ...h } = p, m = ((v = d == null ? void 0 : d[e]) == null ? void 0 : v[c]) || a, b = s.useMemo(() => h, Object.values(h));
355
+ return /* @__PURE__ */ g(m.Provider, { value: b, children: _ });
348
356
  };
349
357
  l.displayName = r + "Provider";
350
- function v(d, p) {
358
+ function f(p, d) {
351
359
  var m;
352
- const g = ((m = p == null ? void 0 : p[e]) == null ? void 0 : m[c]) || u, h = s.useContext(g);
360
+ const _ = ((m = d == null ? void 0 : d[e]) == null ? void 0 : m[c]) || a, h = s.useContext(_);
353
361
  if (h) return h;
354
- if (a !== void 0) return a;
355
- throw new Error(`\`${d}\` must be used within \`${r}\``);
362
+ if (u !== void 0) return u;
363
+ throw new Error(`\`${p}\` must be used within \`${r}\``);
356
364
  }
357
- return [l, v];
365
+ return [l, f];
358
366
  }
359
367
  const o = () => {
360
- const r = t.map((a) => s.createContext(a));
361
- return function(u) {
362
- const c = (u == null ? void 0 : u[e]) || r;
368
+ const r = t.map((u) => s.createContext(u));
369
+ return function(a) {
370
+ const c = (a == null ? void 0 : a[e]) || r;
363
371
  return s.useMemo(
364
- () => ({ [`__scope${e}`]: { ...u, [e]: c } }),
365
- [u, c]
372
+ () => ({ [`__scope${e}`]: { ...a, [e]: c } }),
373
+ [a, c]
366
374
  );
367
375
  };
368
376
  };
369
- return o.scopeName = e, [i, Je(o, ...n)];
377
+ return o.scopeName = e, [i, Ue(o, ...n)];
370
378
  }
371
- function Je(...e) {
379
+ function Ue(...e) {
372
380
  const n = e[0];
373
381
  if (e.length === 1) return n;
374
382
  const t = () => {
@@ -377,16 +385,16 @@ function Je(...e) {
377
385
  scopeName: o.scopeName
378
386
  }));
379
387
  return function(r) {
380
- const a = i.reduce((u, { useScope: c, scopeName: l }) => {
381
- const d = c(r)[`__scope${l}`];
382
- return { ...u, ...d };
388
+ const u = i.reduce((a, { useScope: c, scopeName: l }) => {
389
+ const p = c(r)[`__scope${l}`];
390
+ return { ...a, ...p };
383
391
  }, {});
384
- return s.useMemo(() => ({ [`__scope${n.scopeName}`]: a }), [a]);
392
+ return s.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
385
393
  };
386
394
  };
387
395
  return t.scopeName = n.scopeName, t;
388
396
  }
389
- function ne(e) {
397
+ function Y(e) {
390
398
  const n = s.useRef(e);
391
399
  return s.useEffect(() => {
392
400
  n.current = e;
@@ -395,99 +403,105 @@ function ne(e) {
395
403
  return (i = n.current) == null ? void 0 : i.call(n, ...t);
396
404
  }, []);
397
405
  }
398
- function Ke({
406
+ function Ze({
399
407
  prop: e,
400
408
  defaultProp: n,
401
409
  onChange: t = () => {
402
410
  }
403
411
  }) {
404
- const [i, o] = Qe({ defaultProp: n, onChange: t }), r = e !== void 0, a = r ? e : i, u = ne(t), c = s.useCallback(
412
+ const [i, o] = Ge({ defaultProp: n, onChange: t }), r = e !== void 0, u = r ? e : i, a = Y(t), c = s.useCallback(
405
413
  (l) => {
406
414
  if (r) {
407
- const d = typeof l == "function" ? l(e) : l;
408
- d !== e && u(d);
415
+ const p = typeof l == "function" ? l(e) : l;
416
+ p !== e && a(p);
409
417
  } else
410
418
  o(l);
411
419
  },
412
- [r, e, o, u]
420
+ [r, e, o, a]
413
421
  );
414
- return [a, c];
422
+ return [u, c];
415
423
  }
416
- function Qe({
424
+ function Ge({
417
425
  defaultProp: e,
418
426
  onChange: n
419
427
  }) {
420
- const t = s.useState(e), [i] = t, o = s.useRef(i), r = ne(n);
428
+ const t = s.useState(e), [i] = t, o = s.useRef(i), r = Y(n);
421
429
  return s.useEffect(() => {
422
430
  o.current !== i && (r(i), o.current = i);
423
431
  }, [i, o, r]), t;
424
432
  }
425
- function Ye(e) {
433
+ function Je(e) {
426
434
  const n = s.useRef({ value: e, previous: e });
427
435
  return s.useMemo(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [e]);
428
436
  }
429
- var er = globalThis != null && globalThis.document ? s.useLayoutEffect : () => {
437
+ var Ke = globalThis != null && globalThis.document ? s.useLayoutEffect : () => {
430
438
  };
431
- function rr(e) {
439
+ function Qe(e) {
432
440
  const [n, t] = s.useState(void 0);
433
- return er(() => {
441
+ return Ke(() => {
434
442
  if (e) {
435
443
  t({ width: e.offsetWidth, height: e.offsetHeight });
436
444
  const i = new ResizeObserver((o) => {
437
445
  if (!Array.isArray(o) || !o.length)
438
446
  return;
439
447
  const r = o[0];
440
- let a, u;
448
+ let u, a;
441
449
  if ("borderBoxSize" in r) {
442
450
  const c = r.borderBoxSize, l = Array.isArray(c) ? c[0] : c;
443
- a = l.inlineSize, u = l.blockSize;
451
+ u = l.inlineSize, a = l.blockSize;
444
452
  } else
445
- a = e.offsetWidth, u = e.offsetHeight;
446
- t({ width: a, height: u });
453
+ u = e.offsetWidth, a = e.offsetHeight;
454
+ t({ width: u, height: a });
447
455
  });
448
456
  return i.observe(e, { box: "border-box" }), () => i.unobserve(e);
449
457
  } else
450
458
  t(void 0);
451
459
  }, [e]), n;
452
460
  }
453
- var oe = s.forwardRef((e, n) => {
454
- const { children: t, ...i } = e, o = s.Children.toArray(t), r = o.find(nr);
455
- if (r) {
456
- const a = r.props.children, u = o.map((c) => c === r ? s.Children.count(a) > 1 ? s.Children.only(null) : s.isValidElement(a) ? a.props.children : null : c);
457
- return /* @__PURE__ */ f(M, { ...i, ref: n, children: s.isValidElement(a) ? s.cloneElement(a, void 0, u) : null });
458
- }
459
- return /* @__PURE__ */ f(M, { ...i, ref: n, children: t });
460
- });
461
- oe.displayName = "Slot";
462
- var M = s.forwardRef((e, n) => {
463
- const { children: t, ...i } = e;
464
- if (s.isValidElement(t)) {
465
- const o = ir(t), r = or(i, t.props);
466
- return t.type !== s.Fragment && (r.ref = n ? te(n, o) : o), s.cloneElement(t, r);
467
- }
468
- return s.Children.count(t) > 1 ? s.Children.only(null) : null;
469
- });
470
- M.displayName = "SlotClone";
471
- var tr = ({ children: e }) => /* @__PURE__ */ f(K, { children: e });
472
- function nr(e) {
473
- return s.isValidElement(e) && e.type === tr;
474
- }
475
- function or(e, n) {
461
+ // @__NO_SIDE_EFFECTS__
462
+ function Ye(e) {
463
+ const n = /* @__PURE__ */ er(e), t = s.forwardRef((i, o) => {
464
+ const { children: r, ...u } = i, a = s.Children.toArray(r), c = a.find(tr);
465
+ if (c) {
466
+ const l = c.props.children, f = a.map((p) => p === c ? s.Children.count(l) > 1 ? s.Children.only(null) : s.isValidElement(l) ? l.props.children : null : p);
467
+ return /* @__PURE__ */ g(n, { ...u, ref: o, children: s.isValidElement(l) ? s.cloneElement(l, void 0, f) : null });
468
+ }
469
+ return /* @__PURE__ */ g(n, { ...u, ref: o, children: r });
470
+ });
471
+ return t.displayName = `${e}.Slot`, t;
472
+ }
473
+ // @__NO_SIDE_EFFECTS__
474
+ function er(e) {
475
+ const n = s.forwardRef((t, i) => {
476
+ const { children: o, ...r } = t;
477
+ if (s.isValidElement(o)) {
478
+ const u = or(o), a = nr(r, o.props);
479
+ return o.type !== s.Fragment && (a.ref = i ? Q(i, u) : u), s.cloneElement(o, a);
480
+ }
481
+ return s.Children.count(o) > 1 ? s.Children.only(null) : null;
482
+ });
483
+ return n.displayName = `${e}.SlotClone`, n;
484
+ }
485
+ var rr = Symbol("radix.slottable");
486
+ function tr(e) {
487
+ return s.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === rr;
488
+ }
489
+ function nr(e, n) {
476
490
  const t = { ...n };
477
491
  for (const i in n) {
478
492
  const o = e[i], r = n[i];
479
- /^on[A-Z]/.test(i) ? o && r ? t[i] = (...u) => {
480
- r(...u), o(...u);
493
+ /^on[A-Z]/.test(i) ? o && r ? t[i] = (...a) => {
494
+ r(...a), o(...a);
481
495
  } : o && (t[i] = o) : i === "style" ? t[i] = { ...o, ...r } : i === "className" && (t[i] = [o, r].filter(Boolean).join(" "));
482
496
  }
483
497
  return { ...e, ...t };
484
498
  }
485
- function ir(e) {
499
+ function or(e) {
486
500
  var i, o;
487
501
  let n = (i = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : i.get, t = n && "isReactWarning" in n && n.isReactWarning;
488
502
  return t ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
489
503
  }
490
- var ar = [
504
+ var ir = [
491
505
  "a",
492
506
  "button",
493
507
  "div",
@@ -504,74 +518,74 @@ var ar = [
504
518
  "span",
505
519
  "svg",
506
520
  "ul"
507
- ], ie = ar.reduce((e, n) => {
508
- const t = s.forwardRef((i, o) => {
509
- const { asChild: r, ...a } = i, u = r ? oe : n;
510
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(u, { ...a, ref: o });
521
+ ], ee = ir.reduce((e, n) => {
522
+ const t = /* @__PURE__ */ Ye(`Primitive.${n}`), i = s.forwardRef((o, r) => {
523
+ const { asChild: u, ...a } = o, c = u ? t : n;
524
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ g(c, { ...a, ref: r });
511
525
  });
512
- return t.displayName = `Primitive.${n}`, { ...e, [n]: t };
513
- }, {}), j = "Switch", [ur, Cr] = Ge(j), [sr, cr] = ur(j), ae = s.forwardRef(
526
+ return i.displayName = `Primitive.${n}`, { ...e, [n]: i };
527
+ }, {}), A = "Switch", [ur] = Fe(A), [ar, sr] = ur(A), re = s.forwardRef(
514
528
  (e, n) => {
515
529
  const {
516
530
  __scopeSwitch: t,
517
531
  name: i,
518
532
  checked: o,
519
533
  defaultChecked: r,
520
- required: a,
521
- disabled: u,
534
+ required: u,
535
+ disabled: a,
522
536
  value: c = "on",
523
537
  onCheckedChange: l,
524
- form: v,
525
- ...d
526
- } = e, [p, g] = s.useState(null), h = Ze(n, (y) => g(y)), m = s.useRef(!1), b = p ? v || !!p.closest("form") : !0, [_ = !1, x] = Ke({
538
+ form: f,
539
+ ...p
540
+ } = e, [d, _] = s.useState(null), h = He(n, (y) => _(y)), m = s.useRef(!1), b = d ? f || !!d.closest("form") : !0, [v = !1, x] = Ze({
527
541
  prop: o,
528
542
  defaultProp: r,
529
543
  onChange: l
530
544
  });
531
- return /* @__PURE__ */ D(sr, { scope: t, checked: _, disabled: u, children: [
532
- /* @__PURE__ */ f(
533
- ie.button,
545
+ return /* @__PURE__ */ D(ar, { scope: t, checked: v, disabled: a, children: [
546
+ /* @__PURE__ */ g(
547
+ ee.button,
534
548
  {
535
549
  type: "button",
536
550
  role: "switch",
537
- "aria-checked": _,
538
- "aria-required": a,
539
- "data-state": ce(_),
540
- "data-disabled": u ? "" : void 0,
541
- disabled: u,
551
+ "aria-checked": v,
552
+ "aria-required": u,
553
+ "data-state": oe(v),
554
+ "data-disabled": a ? "" : void 0,
555
+ disabled: a,
542
556
  value: c,
543
- ...d,
557
+ ...p,
544
558
  ref: h,
545
- onClick: Ue(e.onClick, (y) => {
559
+ onClick: Ve(e.onClick, (y) => {
546
560
  x((w) => !w), b && (m.current = y.isPropagationStopped(), m.current || y.stopPropagation());
547
561
  })
548
562
  }
549
563
  ),
550
- b && /* @__PURE__ */ f(
551
- lr,
564
+ b && /* @__PURE__ */ g(
565
+ cr,
552
566
  {
553
- control: p,
567
+ control: d,
554
568
  bubbles: !m.current,
555
569
  name: i,
556
570
  value: c,
557
- checked: _,
558
- required: a,
559
- disabled: u,
560
- form: v,
571
+ checked: v,
572
+ required: u,
573
+ disabled: a,
574
+ form: f,
561
575
  style: { transform: "translateX(-100%)" }
562
576
  }
563
577
  )
564
578
  ] });
565
579
  }
566
580
  );
567
- ae.displayName = j;
568
- var ue = "SwitchThumb", se = s.forwardRef(
581
+ re.displayName = A;
582
+ var te = "SwitchThumb", ne = s.forwardRef(
569
583
  (e, n) => {
570
- const { __scopeSwitch: t, ...i } = e, o = cr(ue, t);
571
- return /* @__PURE__ */ f(
572
- ie.span,
584
+ const { __scopeSwitch: t, ...i } = e, o = sr(te, t);
585
+ return /* @__PURE__ */ g(
586
+ ee.span,
573
587
  {
574
- "data-state": ce(o.checked),
588
+ "data-state": oe(o.checked),
575
589
  "data-disabled": o.disabled ? "" : void 0,
576
590
  ...i,
577
591
  ref: n
@@ -579,16 +593,16 @@ var ue = "SwitchThumb", se = s.forwardRef(
579
593
  );
580
594
  }
581
595
  );
582
- se.displayName = ue;
583
- var lr = (e) => {
584
- const { control: n, checked: t, bubbles: i = !0, ...o } = e, r = s.useRef(null), a = Ye(t), u = rr(n);
596
+ ne.displayName = te;
597
+ var cr = (e) => {
598
+ const { control: n, checked: t, bubbles: i = !0, ...o } = e, r = s.useRef(null), u = Je(t), a = Qe(n);
585
599
  return s.useEffect(() => {
586
- const c = r.current, l = window.HTMLInputElement.prototype, d = Object.getOwnPropertyDescriptor(l, "checked").set;
587
- if (a !== t && d) {
588
- const p = new Event("click", { bubbles: i });
589
- d.call(c, t), c.dispatchEvent(p);
600
+ const c = r.current, l = window.HTMLInputElement.prototype, p = Object.getOwnPropertyDescriptor(l, "checked").set;
601
+ if (u !== t && p) {
602
+ const d = new Event("click", { bubbles: i });
603
+ p.call(c, t), c.dispatchEvent(d);
590
604
  }
591
- }, [a, t, i]), /* @__PURE__ */ f(
605
+ }, [u, t, i]), /* @__PURE__ */ g(
592
606
  "input",
593
607
  {
594
608
  type: "checkbox",
@@ -599,7 +613,7 @@ var lr = (e) => {
599
613
  ref: r,
600
614
  style: {
601
615
  ...e.style,
602
- ...u,
616
+ ...a,
603
617
  position: "absolute",
604
618
  pointerEvents: "none",
605
619
  opacity: 0,
@@ -608,11 +622,11 @@ var lr = (e) => {
608
622
  }
609
623
  );
610
624
  };
611
- function ce(e) {
625
+ function oe(e) {
612
626
  return e ? "checked" : "unchecked";
613
627
  }
614
- var pr = ae, dr = se;
615
- function fr(e) {
628
+ var lr = re, pr = ne;
629
+ function dr(e) {
616
630
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
617
631
  }
618
632
  var z = { exports: {} };
@@ -621,15 +635,15 @@ var z = { exports: {} };
621
635
  Licensed under the MIT License (MIT), see
622
636
  http://jedwatson.github.io/classnames
623
637
  */
624
- var I;
625
- function hr() {
626
- return I || (I = 1, function(e) {
638
+ var V;
639
+ function fr() {
640
+ return V || (V = 1, (function(e) {
627
641
  (function() {
628
642
  var n = {}.hasOwnProperty;
629
643
  function t() {
630
- for (var r = "", a = 0; a < arguments.length; a++) {
631
- var u = arguments[a];
632
- u && (r = o(r, i.call(this, u)));
644
+ for (var r = "", u = 0; u < arguments.length; u++) {
645
+ var a = arguments[u];
646
+ a && (r = o(r, i.call(this, a)));
633
647
  }
634
648
  return r;
635
649
  }
@@ -642,117 +656,117 @@ function hr() {
642
656
  return t.apply(this, r);
643
657
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
644
658
  return r.toString();
645
- var a = "";
646
- for (var u in r)
647
- n.call(r, u) && r[u] && (a = o(a, this && this[u] || u));
648
- return a;
659
+ var u = "";
660
+ for (var a in r)
661
+ n.call(r, a) && r[a] && (u = o(u, this && this[a] || a));
662
+ return u;
649
663
  }
650
- function o(r, a) {
651
- return a ? r ? r + " " + a : r + a : r;
664
+ function o(r, u) {
665
+ return u ? r ? r + " " + u : r + u : r;
652
666
  }
653
667
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
654
668
  })();
655
- }(z)), z.exports;
669
+ })(z)), z.exports;
656
670
  }
657
- var gr = hr();
658
- const mr = /* @__PURE__ */ fr(gr), U = (e) => e && "touches" in e, vr = ({
671
+ var hr = fr();
672
+ const gr = /* @__PURE__ */ dr(hr), H = (e) => e && "touches" in e, _r = ({
659
673
  children: e,
660
674
  disabled: n,
661
675
  onStart: t,
662
676
  onDrag: i,
663
677
  onStop: o,
664
678
  bounds: r,
665
- position: a,
666
- style: u
679
+ position: u,
680
+ style: a
667
681
  }) => {
668
- const [c, l] = $(void 0), [v, d] = $(void 0), [p, g] = $(!1), h = (_) => {
682
+ const [c, l] = $(void 0), [f, p] = $(void 0), [d, _] = $(!1), h = (v) => {
669
683
  if (!n) {
670
- _.preventDefault();
671
- const x = U(_.nativeEvent) ? _.nativeEvent.touches[0].clientX : _.nativeEvent.clientX;
672
- d(x), t == null || t();
684
+ v.preventDefault();
685
+ const x = H(v.nativeEvent) ? v.nativeEvent.touches[0].clientX : v.nativeEvent.clientX;
686
+ p(x), t == null || t();
673
687
  }
674
688
  }, m = O(
675
- (_) => {
676
- if (typeof v != "number")
689
+ (v) => {
690
+ if (typeof f != "number")
677
691
  return;
678
- const y = (U(_) ? _.touches[0].clientX : _.clientX) - v;
692
+ const y = (H(v) ? v.touches[0].clientX : v.clientX) - f;
679
693
  if (!y)
680
694
  return;
681
- const w = a + y;
682
- !p && Math.abs(w) && g(!0);
695
+ const w = u + y;
696
+ !d && Math.abs(w) && _(!0);
683
697
  const E = w > r.right ? r.right : w < r.left ? r.left : w;
684
698
  l(E), i == null || i({ x: E });
685
699
  },
686
700
  // eslint-disable-next-line react-hooks/exhaustive-deps
687
- [i, l, p, v]
701
+ [i, l, d, f]
688
702
  ), b = O(() => {
689
- d(void 0), l(void 0), g(!1), o == null || o();
690
- }, [o, d]);
703
+ p(void 0), l(void 0), _(!1), o == null || o();
704
+ }, [o, p]);
691
705
  return k(() => (window.addEventListener("mousemove", m), window.addEventListener("touchmove", m), () => {
692
706
  window.removeEventListener("mousemove", m), window.removeEventListener("touchmove", m);
693
707
  }), [m]), k(() => (window.addEventListener("mouseup", b), window.addEventListener("touchend", b), () => {
694
708
  window.removeEventListener("mouseup", b), window.removeEventListener("touchend", b);
695
- }), [b]), pe(e) ? le(e, {
709
+ }), [b]), ue(e) ? ie(e, {
696
710
  onMouseDown: h,
697
711
  onTouchStart: h,
698
- style: { ...u, transform: `translateX(${p ? c : a}px)` }
712
+ style: { ...a, transform: `translateX(${d ? c : u}px)` }
699
713
  }) : null;
700
- }, Z = {
714
+ }, F = {
701
715
  width: void 0,
702
716
  height: void 0
703
717
  };
704
- function G(e) {
705
- const { ref: n, box: t = "content-box", round: i } = e, [{ width: o, height: r }, a] = $(Z), u = _r(), c = P({ ...Z }), l = P(void 0);
718
+ function U(e) {
719
+ const { ref: n, box: t = "content-box", round: i } = e, [{ width: o, height: r }, u] = $(F), a = mr(), c = P({ ...F }), l = P(void 0);
706
720
  return l.current = e.onResize, k(() => {
707
721
  if (!n.current || typeof window > "u" || !("ResizeObserver" in window))
708
722
  return;
709
- const v = new ResizeObserver(([d]) => {
710
- const p = t === "border-box" ? "borderBoxSize" : t === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", g = J(d, p, "inlineSize"), h = J(d, p, "blockSize");
711
- if (c.current.width !== g || c.current.height !== h) {
723
+ const f = new ResizeObserver(([p]) => {
724
+ const d = t === "border-box" ? "borderBoxSize" : t === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", _ = Z(p, d, "inlineSize"), h = Z(p, d, "blockSize");
725
+ if (c.current.width !== _ || c.current.height !== h) {
712
726
  const b = {
713
- width: g && i ? Math.round(g) : g,
727
+ width: _ && i ? Math.round(_) : _,
714
728
  height: h && i ? Math.round(h) : h
715
729
  };
716
- c.current.width = g, c.current.height = h, l.current ? l.current(b) : u() && a(b);
730
+ c.current.width = _, c.current.height = h, l.current ? l.current(b) : a() && u(b);
717
731
  }
718
732
  });
719
- return v.observe(n.current, { box: t }), () => {
720
- v.disconnect();
733
+ return f.observe(n.current, { box: t }), () => {
734
+ f.disconnect();
721
735
  };
722
- }, [t, n, u, i]), { width: o, height: r };
736
+ }, [t, n, a, i]), { width: o, height: r };
723
737
  }
724
- function J(e, n, t) {
738
+ function Z(e, n, t) {
725
739
  return e[n] ? Array.isArray(e[n]) ? e[n][0][t] : (
726
740
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
727
741
  // @ts-ignore Support Firefox's non-standard behavior
728
742
  e[n][t]
729
743
  ) : n === "contentBoxSize" ? e.contentRect[t === "inlineSize" ? "width" : "height"] : void 0;
730
744
  }
731
- function _r() {
745
+ function mr() {
732
746
  const e = P(!1);
733
747
  return k(() => (e.current = !0, () => {
734
748
  e.current = !1;
735
749
  }), []), O(() => e.current, []);
736
750
  }
737
- const br = ({ checked: e, onChange: n }) => {
738
- const t = P(null), i = P(null), [o, r] = $(void 0), [a, u] = $(!1), [c, l] = $(0), { height: v = 0 } = G({ ref: i, round: !0 }), { height: d = 0 } = G({ ref: t, round: !0 }), p = (d || 0) - v, g = v + p, h = p / 2, m = g / 2, b = typeof o == "number" && (e ? o < m : o > m);
751
+ const vr = ({ checked: e, onChange: n }) => {
752
+ const t = P(null), i = P(null), [o, r] = $(void 0), [u, a] = $(!1), [c, l] = $(0), { height: f = 0 } = U({ ref: i, round: !0 }), { height: p = 0 } = U({ ref: t, round: !0 }), d = (p || 0) - f, _ = f + d, h = d / 2, m = _ / 2, b = typeof o == "number" && (e ? o < m : o > m);
739
753
  return {
740
754
  trackRef: t,
741
755
  thumbRef: i,
742
- isDragging: a,
743
- bounds: { left: h, right: g },
744
- position: e ? g : h,
756
+ isDragging: u,
757
+ bounds: { left: h, right: _ },
758
+ position: e ? _ : h,
745
759
  onDrag: ({ x: w }) => {
746
- r(w), Math.abs((e ? g : h) - w) > 2 && u(!0);
760
+ r(w), Math.abs((e ? _ : h) - w) > 2 && a(!0);
747
761
  },
748
762
  onStop: () => {
749
- u(!1), a && l(Date.now()), b && (n == null || n(!e));
763
+ a(!1), u && l(Date.now()), b && (n == null || n(!e));
750
764
  },
751
765
  onChangeWithDrag: () => {
752
766
  Date.now() - c > 50 && (n == null || n(!e)), r(void 0);
753
767
  }
754
768
  };
755
- }, yr = {
769
+ }, br = {
756
770
  "purpur-toggle": "_purpur-toggle_zqs8u_1",
757
771
  "purpur-toggle__track": "_purpur-toggle__track_zqs8u_7",
758
772
  "purpur-toggle__checkmark-container": "_purpur-toggle__checkmark-container_zqs8u_45",
@@ -762,7 +776,7 @@ const br = ({ checked: e, onChange: n }) => {
762
776
  "purpur-toggle__label--right": "_purpur-toggle__label--right_zqs8u_110",
763
777
  "purpur-toggle__label--left": "_purpur-toggle__label--left_zqs8u_113",
764
778
  "purpur-toggle__container": "_purpur-toggle__container_zqs8u_116"
765
- }, C = mr.bind(yr), S = "purpur-toggle", wr = de(
779
+ }, C = gr.bind(br), S = "purpur-toggle", yr = ae(
766
780
  ({
767
781
  ["data-testid"]: e,
768
782
  className: n,
@@ -770,31 +784,31 @@ const br = ({ checked: e, onChange: n }) => {
770
784
  onChange: i,
771
785
  labelPosition: o = "right",
772
786
  checked: r,
773
- disableDrag: a,
774
- defaultChecked: u,
787
+ disableDrag: u,
788
+ defaultChecked: a,
775
789
  ...c
776
790
  }, l) => {
777
- const [v, d] = $(
778
- typeof r == "boolean" ? r : !!u
779
- ), p = !!(typeof r == "boolean" ? r : v), { thumbRef: g, trackRef: h, isDragging: m, onChangeWithDrag: b, ..._ } = br({
780
- checked: p,
791
+ const [f, p] = $(
792
+ typeof r == "boolean" ? r : !!a
793
+ ), d = !!(typeof r == "boolean" ? r : f), { thumbRef: _, trackRef: h, isDragging: m, onChangeWithDrag: b, ...v } = vr({
794
+ checked: d,
781
795
  onChange: (y) => {
782
- c.disabled || (i == null || i(y), d(y));
796
+ c.disabled || (i == null || i(y), p(y));
783
797
  }
784
- }), x = () => /* @__PURE__ */ f(
785
- Xe,
798
+ }), x = () => /* @__PURE__ */ g(
799
+ je,
786
800
  {
787
801
  htmlFor: c.id,
788
802
  "data-testid": e && `${e}-label`,
789
803
  disabled: c.disabled,
790
804
  className: C(`${S}__label`, `${S}__label--${o}`),
791
- children: /* @__PURE__ */ f(re, { disabled: c.disabled, children: t })
805
+ children: /* @__PURE__ */ g(K, { disabled: c.disabled, children: t })
792
806
  }
793
807
  );
794
808
  return /* @__PURE__ */ D("div", { className: C(n, `${S}__container`), children: [
795
809
  t && o === "left" && x(),
796
- /* @__PURE__ */ f(
797
- pr,
810
+ /* @__PURE__ */ g(
811
+ lr,
798
812
  {
799
813
  ...c,
800
814
  ref: l,
@@ -802,13 +816,13 @@ const br = ({ checked: e, onChange: n }) => {
802
816
  "data-testid": e,
803
817
  className: C(S),
804
818
  onCheckedChange: b,
805
- checked: p,
819
+ checked: d,
806
820
  children: /* @__PURE__ */ D("span", { ref: h, className: C(`${S}__track`), children: [
807
- /* @__PURE__ */ f("span", { className: C(`${S}__checkmark-container`), children: /* @__PURE__ */ f(Q, { className: C(`${S}__checkmark`), svg: xe, size: "xxs" }) }),
808
- /* @__PURE__ */ f(vr, { disabled: a, ..._, children: /* @__PURE__ */ f(
809
- dr,
821
+ /* @__PURE__ */ g("span", { className: C(`${S}__checkmark-container`), children: /* @__PURE__ */ g(G, { className: C(`${S}__checkmark`), svg: ve, size: "xxs" }) }),
822
+ /* @__PURE__ */ g(_r, { disabled: u, ...v, children: /* @__PURE__ */ g(
823
+ pr,
810
824
  {
811
- ref: g,
825
+ ref: _,
812
826
  "data-testid": e && `${e}-thumb`,
813
827
  className: C(`${S}__thumb`, {
814
828
  [`${S}__thumb--dragging`]: m
@@ -822,8 +836,8 @@ const br = ({ checked: e, onChange: n }) => {
822
836
  ] });
823
837
  }
824
838
  );
825
- wr.displayName = "Toggle";
839
+ yr.displayName = "Toggle";
826
840
  export {
827
- wr as Toggle
841
+ yr as Toggle
828
842
  };
829
843
  //# sourceMappingURL=toggle.es.js.map