@animaapp/anima-sdk-react 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,33 +1,33 @@
1
- var ln = Object.defineProperty, fn = Object.defineProperties;
2
- var dn = Object.getOwnPropertyDescriptors;
3
- var Tt = Object.getOwnPropertySymbols;
4
- var hn = Object.prototype.hasOwnProperty, pn = Object.prototype.propertyIsEnumerable;
5
- var Ct = (e, t, n) => t in e ? ln(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, D = (e, t) => {
6
- for (var n in t || (t = {}))
7
- hn.call(t, n) && Ct(e, n, t[n]);
8
- if (Tt)
9
- for (var n of Tt(t))
10
- pn.call(t, n) && Ct(e, n, t[n]);
1
+ var dn = Object.defineProperty, hn = Object.defineProperties;
2
+ var pn = Object.getOwnPropertyDescriptors;
3
+ var Ct = Object.getOwnPropertySymbols;
4
+ var En = Object.prototype.hasOwnProperty, mn = Object.prototype.propertyIsEnumerable;
5
+ var At = (e, n, t) => n in e ? dn(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, k = (e, n) => {
6
+ for (var t in n || (n = {}))
7
+ En.call(n, t) && At(e, t, n[t]);
8
+ if (Ct)
9
+ for (var t of Ct(n))
10
+ mn.call(n, t) && At(e, t, n[t]);
11
11
  return e;
12
- }, At = (e, t) => fn(e, dn(t));
13
- var oe = (e, t, n) => new Promise((r, s) => {
14
- var i = (d) => {
12
+ }, Ye = (e, n) => hn(e, pn(n));
13
+ var H = (e, n, t) => new Promise((r, o) => {
14
+ var u = (s) => {
15
15
  try {
16
- l(n.next(d));
17
- } catch (_) {
18
- s(_);
16
+ l(t.next(s));
17
+ } catch (i) {
18
+ o(i);
19
19
  }
20
- }, u = (d) => {
20
+ }, a = (s) => {
21
21
  try {
22
- l(n.throw(d));
23
- } catch (_) {
24
- s(_);
22
+ l(t.throw(s));
23
+ } catch (i) {
24
+ o(i);
25
25
  }
26
- }, l = (d) => d.done ? r(d.value) : Promise.resolve(d.value).then(i, u);
27
- l((n = n.apply(e, t)).next());
26
+ }, l = (s) => s.done ? r(s.value) : Promise.resolve(s.value).then(u, a);
27
+ l((t = t.apply(e, n)).next());
28
28
  });
29
- import Oe, { createContext as Bt, useState as nt, useRef as le, useEffect as Ht, useContext as zt, useCallback as Ve, useLayoutEffect as En, useMemo as Kt, useDebugValue as mn } from "react";
30
- import { CodegenError as Ye } from "@animaapp/anima-sdk";
29
+ import be, { createContext as Yt, useState as rt, useRef as ue, useEffect as Bt, useContext as Ht, useCallback as $e, useLayoutEffect as gn, useMemo as zt, useDebugValue as vn } from "react";
30
+ import { CodegenError as Be } from "@animaapp/anima-sdk";
31
31
  var Pe = { exports: {} }, Ce = {};
32
32
  /**
33
33
  * @license React
@@ -39,26 +39,26 @@ var Pe = { exports: {} }, Ce = {};
39
39
  * LICENSE file in the root directory of this source tree.
40
40
  */
41
41
  var Lt;
42
- function gn() {
42
+ function _n() {
43
43
  if (Lt) return Ce;
44
44
  Lt = 1;
45
- var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
46
- function n(r, s, i) {
47
- var u = null;
48
- if (i !== void 0 && (u = "" + i), s.key !== void 0 && (u = "" + s.key), "key" in s) {
49
- i = {};
50
- for (var l in s)
51
- l !== "key" && (i[l] = s[l]);
52
- } else i = s;
53
- return s = i.ref, {
45
+ var e = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
46
+ function t(r, o, u) {
47
+ var a = null;
48
+ if (u !== void 0 && (a = "" + u), o.key !== void 0 && (a = "" + o.key), "key" in o) {
49
+ u = {};
50
+ for (var l in o)
51
+ l !== "key" && (u[l] = o[l]);
52
+ } else u = o;
53
+ return o = u.ref, {
54
54
  $$typeof: e,
55
55
  type: r,
56
- key: u,
57
- ref: s !== void 0 ? s : null,
58
- props: i
56
+ key: a,
57
+ ref: o !== void 0 ? o : null,
58
+ props: u
59
59
  };
60
60
  }
61
- return Ce.Fragment = t, Ce.jsx = n, Ce.jsxs = n, Ce;
61
+ return Ce.Fragment = n, Ce.jsx = t, Ce.jsxs = t, Ce;
62
62
  }
63
63
  var Ae = {};
64
64
  /**
@@ -70,346 +70,346 @@ var Ae = {};
70
70
  * This source code is licensed under the MIT license found in the
71
71
  * LICENSE file in the root directory of this source tree.
72
72
  */
73
- var xt;
74
- function vn() {
75
- return xt || (xt = 1, process.env.NODE_ENV !== "production" && (function() {
76
- function e(a) {
77
- if (a == null) return null;
78
- if (typeof a == "function")
79
- return a.$$typeof === U ? null : a.displayName || a.name || null;
80
- if (typeof a == "string") return a;
81
- switch (a) {
82
- case c:
73
+ var Nt;
74
+ function Sn() {
75
+ return Nt || (Nt = 1, process.env.NODE_ENV !== "production" && (function() {
76
+ function e(c) {
77
+ if (c == null) return null;
78
+ if (typeof c == "function")
79
+ return c.$$typeof === G ? null : c.displayName || c.name || null;
80
+ if (typeof c == "string") return c;
81
+ switch (c) {
82
+ case d:
83
83
  return "Fragment";
84
- case o:
85
- return "Profiler";
86
84
  case f:
85
+ return "Profiler";
86
+ case g:
87
87
  return "StrictMode";
88
88
  case T:
89
89
  return "Suspense";
90
- case F:
90
+ case I:
91
91
  return "SuspenseList";
92
- case K:
92
+ case ae:
93
93
  return "Activity";
94
94
  }
95
- if (typeof a == "object")
96
- switch (typeof a.tag == "number" && console.error(
95
+ if (typeof c == "object")
96
+ switch (typeof c.tag == "number" && console.error(
97
97
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
98
- ), a.$$typeof) {
99
- case p:
98
+ ), c.$$typeof) {
99
+ case E:
100
100
  return "Portal";
101
- case k:
102
- return (a.displayName || "Context") + ".Provider";
103
- case g:
104
- return (a._context.displayName || "Context") + ".Consumer";
105
- case N:
106
- var v = a.render;
107
- return a = a.displayName, a || (a = v.displayName || v.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
108
- case $:
109
- return v = a.displayName || null, v !== null ? v : e(a.type) || "Memo";
110
- case b:
111
- v = a._payload, a = a._init;
101
+ case O:
102
+ return (c.displayName || "Context") + ".Provider";
103
+ case w:
104
+ return (c._context.displayName || "Context") + ".Consumer";
105
+ case M:
106
+ var _ = c.render;
107
+ return c = c.displayName, c || (c = _.displayName || _.name || "", c = c !== "" ? "ForwardRef(" + c + ")" : "ForwardRef"), c;
108
+ case q:
109
+ return _ = c.displayName || null, _ !== null ? _ : e(c.type) || "Memo";
110
+ case C:
111
+ _ = c._payload, c = c._init;
112
112
  try {
113
- return e(a(v));
114
- } catch (O) {
113
+ return e(c(_));
114
+ } catch (b) {
115
115
  }
116
116
  }
117
117
  return null;
118
118
  }
119
- function t(a) {
120
- return "" + a;
119
+ function n(c) {
120
+ return "" + c;
121
121
  }
122
- function n(a) {
122
+ function t(c) {
123
123
  try {
124
- t(a);
125
- var v = !1;
126
- } catch (H) {
127
- v = !0;
124
+ n(c);
125
+ var _ = !1;
126
+ } catch (Y) {
127
+ _ = !0;
128
128
  }
129
- if (v) {
130
- v = console;
131
- var O = v.error, I = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
132
- return O.call(
133
- v,
129
+ if (_) {
130
+ _ = console;
131
+ var b = _.error, x = typeof Symbol == "function" && Symbol.toStringTag && c[Symbol.toStringTag] || c.constructor.name || "Object";
132
+ return b.call(
133
+ _,
134
134
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
135
- I
136
- ), t(a);
135
+ x
136
+ ), n(c);
137
137
  }
138
138
  }
139
- function r(a) {
140
- if (a === c) return "<>";
141
- if (typeof a == "object" && a !== null && a.$$typeof === b)
139
+ function r(c) {
140
+ if (c === d) return "<>";
141
+ if (typeof c == "object" && c !== null && c.$$typeof === C)
142
142
  return "<...>";
143
143
  try {
144
- var v = e(a);
145
- return v ? "<" + v + ">" : "<...>";
146
- } catch (O) {
144
+ var _ = e(c);
145
+ return _ ? "<" + _ + ">" : "<...>";
146
+ } catch (b) {
147
147
  return "<...>";
148
148
  }
149
149
  }
150
- function s() {
151
- var a = B.A;
152
- return a === null ? null : a.getOwner();
150
+ function o() {
151
+ var c = X.A;
152
+ return c === null ? null : c.getOwner();
153
153
  }
154
- function i() {
154
+ function u() {
155
155
  return Error("react-stack-top-frame");
156
156
  }
157
- function u(a) {
158
- if (Q.call(a, "key")) {
159
- var v = Object.getOwnPropertyDescriptor(a, "key").get;
160
- if (v && v.isReactWarning) return !1;
157
+ function a(c) {
158
+ if (he.call(c, "key")) {
159
+ var _ = Object.getOwnPropertyDescriptor(c, "key").get;
160
+ if (_ && _.isReactWarning) return !1;
161
161
  }
162
- return a.key !== void 0;
162
+ return c.key !== void 0;
163
163
  }
164
- function l(a, v) {
165
- function O() {
166
- ce || (ce = !0, console.error(
164
+ function l(c, _) {
165
+ function b() {
166
+ ie || (ie = !0, console.error(
167
167
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
168
- v
168
+ _
169
169
  ));
170
170
  }
171
- O.isReactWarning = !0, Object.defineProperty(a, "key", {
172
- get: O,
171
+ b.isReactWarning = !0, Object.defineProperty(c, "key", {
172
+ get: b,
173
173
  configurable: !0
174
174
  });
175
175
  }
176
- function d() {
177
- var a = e(this.type);
178
- return ye[a] || (ye[a] = !0, console.error(
176
+ function s() {
177
+ var c = e(this.type);
178
+ return Re[c] || (Re[c] = !0, console.error(
179
179
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
180
- )), a = this.props.ref, a !== void 0 ? a : null;
180
+ )), c = this.props.ref, c !== void 0 ? c : null;
181
181
  }
182
- function _(a, v, O, I, H, G, Ee, me) {
183
- return O = G.ref, a = {
184
- $$typeof: h,
185
- type: a,
186
- key: v,
187
- props: G,
188
- _owner: H
189
- }, (O !== void 0 ? O : null) !== null ? Object.defineProperty(a, "ref", {
182
+ function i(c, _, b, x, Y, $, Ee, me) {
183
+ return b = $.ref, c = {
184
+ $$typeof: p,
185
+ type: c,
186
+ key: _,
187
+ props: $,
188
+ _owner: Y
189
+ }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(c, "ref", {
190
190
  enumerable: !1,
191
- get: d
192
- }) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
191
+ get: s
192
+ }) : Object.defineProperty(c, "ref", { enumerable: !1, value: null }), c._store = {}, Object.defineProperty(c._store, "validated", {
193
193
  configurable: !1,
194
194
  enumerable: !1,
195
195
  writable: !0,
196
196
  value: 0
197
- }), Object.defineProperty(a, "_debugInfo", {
197
+ }), Object.defineProperty(c, "_debugInfo", {
198
198
  configurable: !1,
199
199
  enumerable: !1,
200
200
  writable: !0,
201
201
  value: null
202
- }), Object.defineProperty(a, "_debugStack", {
202
+ }), Object.defineProperty(c, "_debugStack", {
203
203
  configurable: !1,
204
204
  enumerable: !1,
205
205
  writable: !0,
206
206
  value: Ee
207
- }), Object.defineProperty(a, "_debugTask", {
207
+ }), Object.defineProperty(c, "_debugTask", {
208
208
  configurable: !1,
209
209
  enumerable: !1,
210
210
  writable: !0,
211
211
  value: me
212
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
212
+ }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
213
213
  }
214
- function w(a, v, O, I, H, G, Ee, me) {
215
- var P = v.children;
214
+ function h(c, _, b, x, Y, $, Ee, me) {
215
+ var P = _.children;
216
216
  if (P !== void 0)
217
- if (I)
218
- if (q(P)) {
219
- for (I = 0; I < P.length; I++)
220
- m(P[I]);
217
+ if (x)
218
+ if (Q(P)) {
219
+ for (x = 0; x < P.length; x++)
220
+ m(P[x]);
221
221
  Object.freeze && Object.freeze(P);
222
222
  } else
223
223
  console.error(
224
224
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
225
225
  );
226
226
  else m(P);
227
- if (Q.call(v, "key")) {
228
- P = e(a);
229
- var ue = Object.keys(v).filter(function(je) {
230
- return je !== "key";
227
+ if (he.call(_, "key")) {
228
+ P = e(c);
229
+ var ce = Object.keys(_).filter(function(Me) {
230
+ return Me !== "key";
231
231
  });
232
- I = 0 < ue.length ? "{key: someKey, " + ue.join(": ..., ") + ": ...}" : "{key: someKey}", Te[P + I] || (ue = 0 < ue.length ? "{" + ue.join(": ..., ") + ": ...}" : "{}", console.error(
232
+ x = 0 < ce.length ? "{key: someKey, " + ce.join(": ..., ") + ": ...}" : "{key: someKey}", Te[P + x] || (ce = 0 < ce.length ? "{" + ce.join(": ..., ") + ": ...}" : "{}", console.error(
233
233
  `A props object containing a "key" prop is being spread into JSX:
234
234
  let props = %s;
235
235
  <%s {...props} />
236
236
  React keys must be passed directly to JSX without using spread:
237
237
  let props = %s;
238
238
  <%s key={someKey} {...props} />`,
239
- I,
239
+ x,
240
240
  P,
241
- ue,
241
+ ce,
242
242
  P
243
- ), Te[P + I] = !0);
243
+ ), Te[P + x] = !0);
244
244
  }
245
- if (P = null, O !== void 0 && (n(O), P = "" + O), u(v) && (n(v.key), P = "" + v.key), "key" in v) {
246
- O = {};
247
- for (var ne in v)
248
- ne !== "key" && (O[ne] = v[ne]);
249
- } else O = v;
245
+ if (P = null, b !== void 0 && (t(b), P = "" + b), a(_) && (t(_.key), P = "" + _.key), "key" in _) {
246
+ b = {};
247
+ for (var te in _)
248
+ te !== "key" && (b[te] = _[te]);
249
+ } else b = _;
250
250
  return P && l(
251
- O,
252
- typeof a == "function" ? a.displayName || a.name || "Unknown" : a
253
- ), _(
254
- a,
251
+ b,
252
+ typeof c == "function" ? c.displayName || c.name || "Unknown" : c
253
+ ), i(
254
+ c,
255
255
  P,
256
- G,
257
- H,
258
- s(),
259
- O,
256
+ $,
257
+ Y,
258
+ o(),
259
+ b,
260
260
  Ee,
261
261
  me
262
262
  );
263
263
  }
264
- function m(a) {
265
- typeof a == "object" && a !== null && a.$$typeof === h && a._store && (a._store.validated = 1);
264
+ function m(c) {
265
+ typeof c == "object" && c !== null && c.$$typeof === p && c._store && (c._store.validated = 1);
266
266
  }
267
- var E = Oe, h = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), f = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), g = Symbol.for("react.consumer"), k = Symbol.for("react.context"), N = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), K = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), B = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Q = Object.prototype.hasOwnProperty, q = Array.isArray, C = console.createTask ? console.createTask : function() {
267
+ var v = be, p = Symbol.for("react.transitional.element"), E = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), O = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), ae = Symbol.for("react.activity"), G = Symbol.for("react.client.reference"), X = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, he = Object.prototype.hasOwnProperty, Q = Array.isArray, D = console.createTask ? console.createTask : function() {
268
268
  return null;
269
269
  };
270
- E = {
271
- react_stack_bottom_frame: function(a) {
272
- return a();
270
+ v = {
271
+ react_stack_bottom_frame: function(c) {
272
+ return c();
273
273
  }
274
274
  };
275
- var ce, ye = {}, be = E.react_stack_bottom_frame.bind(
276
- E,
277
- i
278
- )(), te = C(r(i)), Te = {};
279
- Ae.Fragment = c, Ae.jsx = function(a, v, O, I, H) {
280
- var G = 1e4 > B.recentlyCreatedOwnerStacks++;
281
- return w(
282
- a,
283
- v,
284
- O,
275
+ var ie, Re = {}, Oe = v.react_stack_bottom_frame.bind(
276
+ v,
277
+ u
278
+ )(), ee = D(r(u)), Te = {};
279
+ Ae.Fragment = d, Ae.jsx = function(c, _, b, x, Y) {
280
+ var $ = 1e4 > X.recentlyCreatedOwnerStacks++;
281
+ return h(
282
+ c,
283
+ _,
284
+ b,
285
285
  !1,
286
- I,
287
- H,
288
- G ? Error("react-stack-top-frame") : be,
289
- G ? C(r(a)) : te
286
+ x,
287
+ Y,
288
+ $ ? Error("react-stack-top-frame") : Oe,
289
+ $ ? D(r(c)) : ee
290
290
  );
291
- }, Ae.jsxs = function(a, v, O, I, H) {
292
- var G = 1e4 > B.recentlyCreatedOwnerStacks++;
293
- return w(
294
- a,
295
- v,
296
- O,
291
+ }, Ae.jsxs = function(c, _, b, x, Y) {
292
+ var $ = 1e4 > X.recentlyCreatedOwnerStacks++;
293
+ return h(
294
+ c,
295
+ _,
296
+ b,
297
297
  !0,
298
- I,
299
- H,
300
- G ? Error("react-stack-top-frame") : be,
301
- G ? C(r(a)) : te
298
+ x,
299
+ Y,
300
+ $ ? Error("react-stack-top-frame") : Oe,
301
+ $ ? D(r(c)) : ee
302
302
  );
303
303
  };
304
304
  })()), Ae;
305
305
  }
306
- var Nt;
307
- function _n() {
308
- return Nt || (Nt = 1, process.env.NODE_ENV === "production" ? Pe.exports = gn() : Pe.exports = vn()), Pe.exports;
306
+ var xt;
307
+ function wn() {
308
+ return xt || (xt = 1, process.env.NODE_ENV === "production" ? Pe.exports = _n() : Pe.exports = Sn()), Pe.exports;
309
309
  }
310
- var Sn = _n();
311
- class It extends Error {
312
- constructor(t, n) {
313
- super(t), this.name = "ParseError", this.type = n.type, this.field = n.field, this.value = n.value, this.line = n.line;
310
+ var yn = wn();
311
+ class kt extends Error {
312
+ constructor(n, t) {
313
+ super(n), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
314
314
  }
315
315
  }
316
- function Be(e) {
316
+ function He(e) {
317
317
  }
318
- function wn(e) {
318
+ function bn(e) {
319
319
  if (typeof e == "function")
320
320
  throw new TypeError(
321
321
  "`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
322
322
  );
323
- const { onEvent: t = Be, onError: n = Be, onRetry: r = Be, onComment: s } = e;
324
- let i = "", u = !0, l, d = "", _ = "";
325
- function w(c) {
326
- const f = u ? c.replace(/^\xEF\xBB\xBF/, "") : c, [o, g] = Rn(`${i}${f}`);
327
- for (const k of o)
328
- m(k);
329
- i = g, u = !1;
323
+ const { onEvent: n = He, onError: t = He, onRetry: r = He, onComment: o } = e;
324
+ let u = "", a = !0, l, s = "", i = "";
325
+ function h(d) {
326
+ const g = a ? d.replace(/^\xEF\xBB\xBF/, "") : d, [f, w] = Rn(`${u}${g}`);
327
+ for (const O of f)
328
+ m(O);
329
+ u = w, a = !1;
330
330
  }
331
- function m(c) {
332
- if (c === "") {
333
- h();
331
+ function m(d) {
332
+ if (d === "") {
333
+ p();
334
334
  return;
335
335
  }
336
- if (c.startsWith(":")) {
337
- s && s(c.slice(c.startsWith(": ") ? 2 : 1));
336
+ if (d.startsWith(":")) {
337
+ o && o(d.slice(d.startsWith(": ") ? 2 : 1));
338
338
  return;
339
339
  }
340
- const f = c.indexOf(":");
341
- if (f !== -1) {
342
- const o = c.slice(0, f), g = c[f + 1] === " " ? 2 : 1, k = c.slice(f + g);
343
- E(o, k, c);
340
+ const g = d.indexOf(":");
341
+ if (g !== -1) {
342
+ const f = d.slice(0, g), w = d[g + 1] === " " ? 2 : 1, O = d.slice(g + w);
343
+ v(f, O, d);
344
344
  return;
345
345
  }
346
- E(c, "", c);
346
+ v(d, "", d);
347
347
  }
348
- function E(c, f, o) {
349
- switch (c) {
348
+ function v(d, g, f) {
349
+ switch (d) {
350
350
  case "event":
351
- _ = f;
351
+ i = g;
352
352
  break;
353
353
  case "data":
354
- d = `${d}${f}
354
+ s = `${s}${g}
355
355
  `;
356
356
  break;
357
357
  case "id":
358
- l = f.includes("\0") ? void 0 : f;
358
+ l = g.includes("\0") ? void 0 : g;
359
359
  break;
360
360
  case "retry":
361
- /^\d+$/.test(f) ? r(parseInt(f, 10)) : n(
362
- new It(`Invalid \`retry\` value: "${f}"`, {
361
+ /^\d+$/.test(g) ? r(parseInt(g, 10)) : t(
362
+ new kt(`Invalid \`retry\` value: "${g}"`, {
363
363
  type: "invalid-retry",
364
- value: f,
365
- line: o
364
+ value: g,
365
+ line: f
366
366
  })
367
367
  );
368
368
  break;
369
369
  default:
370
- n(
371
- new It(
372
- `Unknown field "${c.length > 20 ? `${c.slice(0, 20)}…` : c}"`,
373
- { type: "unknown-field", field: c, value: f, line: o }
370
+ t(
371
+ new kt(
372
+ `Unknown field "${d.length > 20 ? `${d.slice(0, 20)}…` : d}"`,
373
+ { type: "unknown-field", field: d, value: g, line: f }
374
374
  )
375
375
  );
376
376
  break;
377
377
  }
378
378
  }
379
- function h() {
380
- d.length > 0 && t({
379
+ function p() {
380
+ s.length > 0 && n({
381
381
  id: l,
382
- event: _ || void 0,
382
+ event: i || void 0,
383
383
  // If the data buffer's last character is a U+000A LINE FEED (LF) character,
384
384
  // then remove the last character from the data buffer.
385
- data: d.endsWith(`
386
- `) ? d.slice(0, -1) : d
387
- }), l = void 0, d = "", _ = "";
385
+ data: s.endsWith(`
386
+ `) ? s.slice(0, -1) : s
387
+ }), l = void 0, s = "", i = "";
388
388
  }
389
- function p(c = {}) {
390
- i && c.consume && m(i), u = !0, l = void 0, d = "", _ = "", i = "";
389
+ function E(d = {}) {
390
+ u && d.consume && m(u), a = !0, l = void 0, s = "", i = "", u = "";
391
391
  }
392
- return { feed: w, reset: p };
392
+ return { feed: h, reset: E };
393
393
  }
394
394
  function Rn(e) {
395
- const t = [];
396
- let n = "", r = 0;
395
+ const n = [];
396
+ let t = "", r = 0;
397
397
  for (; r < e.length; ) {
398
- const s = e.indexOf("\r", r), i = e.indexOf(`
398
+ const o = e.indexOf("\r", r), u = e.indexOf(`
399
399
  `, r);
400
- let u = -1;
401
- if (s !== -1 && i !== -1 ? u = Math.min(s, i) : s !== -1 ? s === e.length - 1 ? u = -1 : u = s : i !== -1 && (u = i), u === -1) {
402
- n = e.slice(r);
400
+ let a = -1;
401
+ if (o !== -1 && u !== -1 ? a = Math.min(o, u) : o !== -1 ? o === e.length - 1 ? a = -1 : a = o : u !== -1 && (a = u), a === -1) {
402
+ t = e.slice(r);
403
403
  break;
404
404
  } else {
405
- const l = e.slice(r, u);
406
- t.push(l), r = u + 1, e[r - 1] === "\r" && e[r] === `
405
+ const l = e.slice(r, a);
406
+ n.push(l), r = a + 1, e[r - 1] === "\r" && e[r] === `
407
407
  ` && r++;
408
408
  }
409
409
  }
410
- return [t, n];
410
+ return [n, t];
411
411
  }
412
- class kt extends Event {
412
+ class It extends Event {
413
413
  /**
414
414
  * Constructs a new `ErrorEvent` instance. This is typically not called directly,
415
415
  * but rather emitted by the `EventSource` object when an error occurs.
@@ -417,9 +417,9 @@ class kt extends Event {
417
417
  * @param type - The type of the event (should be "error")
418
418
  * @param errorEventInitDict - Optional properties to include in the error event
419
419
  */
420
- constructor(t, n) {
421
- var r, s;
422
- super(t), this.code = (r = n == null ? void 0 : n.code) != null ? r : void 0, this.message = (s = n == null ? void 0 : n.message) != null ? s : void 0;
420
+ constructor(n, t) {
421
+ var r, o;
422
+ super(n), this.code = (r = t == null ? void 0 : t.code) != null ? r : void 0, this.message = (o = t == null ? void 0 : t.message) != null ? o : void 0;
423
423
  }
424
424
  /**
425
425
  * Node.js "hides" the `message` and `code` properties of the `ErrorEvent` instance,
@@ -433,8 +433,8 @@ class kt extends Event {
433
433
  * @param inspect - The inspect function to use (prevents having to import it from `util`)
434
434
  * @returns A string representation of the error
435
435
  */
436
- [Symbol.for("nodejs.util.inspect.custom")](t, n, r) {
437
- return r(Dt(this), n);
436
+ [Symbol.for("nodejs.util.inspect.custom")](n, t, r) {
437
+ return r(Dt(this), t);
438
438
  }
439
439
  /**
440
440
  * Deno "hides" the `message` and `code` properties of the `ErrorEvent` instance,
@@ -447,13 +447,13 @@ class kt extends Event {
447
447
  * @param options - The options passed to `Deno.inspect`
448
448
  * @returns A string representation of the error
449
449
  */
450
- [Symbol.for("Deno.customInspect")](t, n) {
451
- return t(Dt(this), n);
450
+ [Symbol.for("Deno.customInspect")](n, t) {
451
+ return n(Dt(this), t);
452
452
  }
453
453
  }
454
454
  function On(e) {
455
- const t = globalThis.DOMException;
456
- return typeof t == "function" ? new t(e, "SyntaxError") : new SyntaxError(e);
455
+ const n = globalThis.DOMException;
456
+ return typeof n == "function" ? new n(e, "SyntaxError") : new SyntaxError(e);
457
457
  }
458
458
  function st(e) {
459
459
  return e instanceof Error ? "errors" in e && Array.isArray(e.errors) ? e.errors.map(st).join(", ") : "cause" in e && e.cause instanceof Error ? `${e}: ${st(e.cause)}` : e.message : `${e}`;
@@ -468,71 +468,71 @@ function Dt(e) {
468
468
  timeStamp: e.timeStamp
469
469
  };
470
470
  }
471
- var Xt = (e) => {
471
+ var Kt = (e) => {
472
472
  throw TypeError(e);
473
- }, _t = (e, t, n) => t.has(e) || Xt("Cannot " + n), S = (e, t, n) => (_t(e, t, "read from private field"), n ? n.call(e) : t.get(e)), j = (e, t, n) => t.has(e) ? Xt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), L = (e, t, n, r) => (_t(e, t, "write to private field"), t.set(e, n), n), ae = (e, t, n) => (_t(e, t, "access private method"), n), Y, pe, ve, $e, qe, Ne, we, Ie, fe, _e, Re, Se, Le, Z, rt, ot, at, jt, it, ct, xe, ut, lt;
474
- class Ue extends EventTarget {
475
- constructor(t, n) {
476
- var r, s;
477
- super(), j(this, Z), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, j(this, Y), j(this, pe), j(this, ve), j(this, $e), j(this, qe), j(this, Ne), j(this, we), j(this, Ie, null), j(this, fe), j(this, _e), j(this, Re, null), j(this, Se, null), j(this, Le, null), j(this, ot, (i) => oe(this, null, function* () {
478
- var u;
473
+ }, St = (e, n, t) => n.has(e) || Kt("Cannot " + t), S = (e, n, t) => (St(e, n, "read from private field"), t ? t.call(e) : n.get(e)), j = (e, n, t) => n.has(e) ? Kt("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, t), L = (e, n, t, r) => (St(e, n, "write to private field"), n.set(e, t), t), se = (e, n, t) => (St(e, n, "access private method"), t), J, pe, ve, Ue, Je, xe, we, ke, le, _e, ye, Se, Le, K, ot, at, it, jt, ct, ut, Ne, lt, ft;
474
+ class Ie extends EventTarget {
475
+ constructor(n, t) {
476
+ var r, o;
477
+ super(), j(this, K), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, j(this, J), j(this, pe), j(this, ve), j(this, Ue), j(this, Je), j(this, xe), j(this, we), j(this, ke, null), j(this, le), j(this, _e), j(this, ye, null), j(this, Se, null), j(this, Le, null), j(this, at, (u) => H(this, null, function* () {
478
+ var a;
479
479
  S(this, _e).reset();
480
- const { body: l, redirected: d, status: _, headers: w } = i;
481
- if (_ === 204) {
482
- ae(this, Z, xe).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
480
+ const { body: l, redirected: s, status: i, headers: h } = u;
481
+ if (i === 204) {
482
+ se(this, K, Ne).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
483
483
  return;
484
484
  }
485
- if (d ? L(this, ve, new URL(i.url)) : L(this, ve, void 0), _ !== 200) {
486
- ae(this, Z, xe).call(this, `Non-200 status code (${_})`, _);
485
+ if (s ? L(this, ve, new URL(u.url)) : L(this, ve, void 0), i !== 200) {
486
+ se(this, K, Ne).call(this, `Non-200 status code (${i})`, i);
487
487
  return;
488
488
  }
489
- if (!(w.get("content-type") || "").startsWith("text/event-stream")) {
490
- ae(this, Z, xe).call(this, 'Invalid content type, expected "text/event-stream"', _);
489
+ if (!(h.get("content-type") || "").startsWith("text/event-stream")) {
490
+ se(this, K, Ne).call(this, 'Invalid content type, expected "text/event-stream"', i);
491
491
  return;
492
492
  }
493
- if (S(this, Y) === this.CLOSED)
493
+ if (S(this, J) === this.CLOSED)
494
494
  return;
495
- L(this, Y, this.OPEN);
495
+ L(this, J, this.OPEN);
496
496
  const m = new Event("open");
497
- if ((u = S(this, Le)) == null || u.call(this, m), this.dispatchEvent(m), typeof l != "object" || !l || !("getReader" in l)) {
498
- ae(this, Z, xe).call(this, "Invalid response body, expected a web ReadableStream", _), this.close();
497
+ if ((a = S(this, Le)) == null || a.call(this, m), this.dispatchEvent(m), typeof l != "object" || !l || !("getReader" in l)) {
498
+ se(this, K, Ne).call(this, "Invalid response body, expected a web ReadableStream", i), this.close();
499
499
  return;
500
500
  }
501
- const E = new TextDecoder(), h = l.getReader();
502
- let p = !0;
501
+ const v = new TextDecoder(), p = l.getReader();
502
+ let E = !0;
503
503
  do {
504
- const { done: c, value: f } = yield h.read();
505
- f && S(this, _e).feed(E.decode(f, { stream: !c })), c && (p = !1, S(this, _e).reset(), ae(this, Z, ut).call(this));
506
- } while (p);
507
- })), j(this, at, (i) => {
508
- L(this, fe, void 0), !(i.name === "AbortError" || i.type === "aborted") && ae(this, Z, ut).call(this, st(i));
509
- }), j(this, it, (i) => {
510
- typeof i.id == "string" && L(this, Ie, i.id);
511
- const u = new MessageEvent(i.event || "message", {
512
- data: i.data,
504
+ const { done: d, value: g } = yield p.read();
505
+ g && S(this, _e).feed(v.decode(g, { stream: !d })), d && (E = !1, S(this, _e).reset(), se(this, K, lt).call(this));
506
+ } while (E);
507
+ })), j(this, it, (u) => {
508
+ L(this, le, void 0), !(u.name === "AbortError" || u.type === "aborted") && se(this, K, lt).call(this, st(u));
509
+ }), j(this, ct, (u) => {
510
+ typeof u.id == "string" && L(this, ke, u.id);
511
+ const a = new MessageEvent(u.event || "message", {
512
+ data: u.data,
513
513
  origin: S(this, ve) ? S(this, ve).origin : S(this, pe).origin,
514
- lastEventId: i.id || ""
514
+ lastEventId: u.id || ""
515
515
  });
516
- S(this, Se) && (!i.event || i.event === "message") && S(this, Se).call(this, u), this.dispatchEvent(u);
517
- }), j(this, ct, (i) => {
518
- L(this, Ne, i);
519
- }), j(this, lt, () => {
520
- L(this, we, void 0), S(this, Y) === this.CONNECTING && ae(this, Z, rt).call(this);
516
+ S(this, Se) && (!u.event || u.event === "message") && S(this, Se).call(this, a), this.dispatchEvent(a);
517
+ }), j(this, ut, (u) => {
518
+ L(this, xe, u);
519
+ }), j(this, ft, () => {
520
+ L(this, we, void 0), S(this, J) === this.CONNECTING && se(this, K, ot).call(this);
521
521
  });
522
522
  try {
523
- if (t instanceof URL)
524
- L(this, pe, t);
525
- else if (typeof t == "string")
526
- L(this, pe, new URL(t, yn()));
523
+ if (n instanceof URL)
524
+ L(this, pe, n);
525
+ else if (typeof n == "string")
526
+ L(this, pe, new URL(n, Tn()));
527
527
  else
528
528
  throw new Error("Invalid URL");
529
- } catch (i) {
529
+ } catch (u) {
530
530
  throw On("An invalid or illegal string was specified");
531
531
  }
532
- L(this, _e, wn({
533
- onEvent: S(this, it),
534
- onRetry: S(this, ct)
535
- })), L(this, Y, this.CONNECTING), L(this, Ne, 3e3), L(this, qe, (r = n == null ? void 0 : n.fetch) != null ? r : globalThis.fetch), L(this, $e, (s = n == null ? void 0 : n.withCredentials) != null ? s : !1), ae(this, Z, rt).call(this);
532
+ L(this, _e, bn({
533
+ onEvent: S(this, ct),
534
+ onRetry: S(this, ut)
535
+ })), L(this, J, this.CONNECTING), L(this, xe, 3e3), L(this, Je, (r = t == null ? void 0 : t.fetch) != null ? r : globalThis.fetch), L(this, Ue, (o = t == null ? void 0 : t.withCredentials) != null ? o : !1), se(this, K, ot).call(this);
536
536
  }
537
537
  /**
538
538
  * Returns the state of this EventSource object's connection. It can have the values described below.
@@ -545,7 +545,7 @@ class Ue extends EventTarget {
545
545
  * @public
546
546
  */
547
547
  get readyState() {
548
- return S(this, Y);
548
+ return S(this, J);
549
549
  }
550
550
  /**
551
551
  * Returns the URL providing the event stream.
@@ -563,36 +563,36 @@ class Ue extends EventTarget {
563
563
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
564
564
  */
565
565
  get withCredentials() {
566
- return S(this, $e);
566
+ return S(this, Ue);
567
567
  }
568
568
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
569
569
  get onerror() {
570
- return S(this, Re);
570
+ return S(this, ye);
571
571
  }
572
- set onerror(t) {
573
- L(this, Re, t);
572
+ set onerror(n) {
573
+ L(this, ye, n);
574
574
  }
575
575
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
576
576
  get onmessage() {
577
577
  return S(this, Se);
578
578
  }
579
- set onmessage(t) {
580
- L(this, Se, t);
579
+ set onmessage(n) {
580
+ L(this, Se, n);
581
581
  }
582
582
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
583
583
  get onopen() {
584
584
  return S(this, Le);
585
585
  }
586
- set onopen(t) {
587
- L(this, Le, t);
586
+ set onopen(n) {
587
+ L(this, Le, n);
588
588
  }
589
- addEventListener(t, n, r) {
590
- const s = n;
591
- super.addEventListener(t, s, r);
589
+ addEventListener(n, t, r) {
590
+ const o = t;
591
+ super.addEventListener(n, o, r);
592
592
  }
593
- removeEventListener(t, n, r) {
594
- const s = n;
595
- super.removeEventListener(t, s, r);
593
+ removeEventListener(n, t, r) {
594
+ const o = t;
595
+ super.removeEventListener(n, o, r);
596
596
  }
597
597
  /**
598
598
  * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
@@ -602,17 +602,17 @@ class Ue extends EventTarget {
602
602
  * @public
603
603
  */
604
604
  close() {
605
- S(this, we) && clearTimeout(S(this, we)), S(this, Y) !== this.CLOSED && (S(this, fe) && S(this, fe).abort(), L(this, Y, this.CLOSED), L(this, fe, void 0));
605
+ S(this, we) && clearTimeout(S(this, we)), S(this, J) !== this.CLOSED && (S(this, le) && S(this, le).abort(), L(this, J, this.CLOSED), L(this, le, void 0));
606
606
  }
607
607
  }
608
- Y = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), qe = /* @__PURE__ */ new WeakMap(), Ne = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), Ie = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakSet(), /**
608
+ J = /* @__PURE__ */ new WeakMap(), pe = /* @__PURE__ */ new WeakMap(), ve = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), Je = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), we = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), ye = /* @__PURE__ */ new WeakMap(), Se = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakSet(), /**
609
609
  * Connect to the given URL and start receiving events
610
610
  *
611
611
  * @internal
612
612
  */
613
- rt = function() {
614
- L(this, Y, this.CONNECTING), L(this, fe, new AbortController()), S(this, qe)(S(this, pe), ae(this, Z, jt).call(this)).then(S(this, ot)).catch(S(this, at));
615
- }, ot = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), /**
613
+ ot = function() {
614
+ L(this, J, this.CONNECTING), L(this, le, new AbortController()), S(this, Je)(S(this, pe), se(this, K, jt).call(this)).then(S(this, at)).catch(S(this, it));
615
+ }, at = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), /**
616
616
  * Get request options for the `fetch()` request
617
617
  *
618
618
  * @returns The request options
@@ -620,28 +620,28 @@ rt = function() {
620
620
  */
621
621
  jt = function() {
622
622
  var e;
623
- const t = {
623
+ const n = {
624
624
  // [spec] Let `corsAttributeState` be `Anonymous`…
625
625
  // [spec] …will have their mode set to "cors"…
626
626
  mode: "cors",
627
627
  redirect: "follow",
628
- headers: D({ Accept: "text/event-stream" }, S(this, Ie) ? { "Last-Event-ID": S(this, Ie) } : void 0),
628
+ headers: k({ Accept: "text/event-stream" }, S(this, ke) ? { "Last-Event-ID": S(this, ke) } : void 0),
629
629
  cache: "no-store",
630
- signal: (e = S(this, fe)) == null ? void 0 : e.signal
630
+ signal: (e = S(this, le)) == null ? void 0 : e.signal
631
631
  };
632
- return "window" in globalThis && (t.credentials = this.withCredentials ? "include" : "same-origin"), t;
633
- }, it = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), /**
632
+ return "window" in globalThis && (n.credentials = this.withCredentials ? "include" : "same-origin"), n;
633
+ }, ct = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), /**
634
634
  * Handles the process referred to in the EventSource specification as "failing a connection".
635
635
  *
636
636
  * @param error - The error causing the connection to fail
637
637
  * @param code - The HTTP status code, if available
638
638
  * @internal
639
639
  */
640
- xe = function(e, t) {
641
- var n;
642
- S(this, Y) !== this.CLOSED && L(this, Y, this.CLOSED);
643
- const r = new kt("error", { code: t, message: e });
644
- (n = S(this, Re)) == null || n.call(this, r), this.dispatchEvent(r);
640
+ Ne = function(e, n) {
641
+ var t;
642
+ S(this, J) !== this.CLOSED && L(this, J, this.CLOSED);
643
+ const r = new It("error", { code: n, message: e });
644
+ (t = S(this, ye)) == null || t.call(this, r), this.dispatchEvent(r);
645
645
  }, /**
646
646
  * Schedules a reconnection attempt against the EventSource endpoint.
647
647
  *
@@ -649,40 +649,40 @@ xe = function(e, t) {
649
649
  * @param code - The HTTP status code, if available
650
650
  * @internal
651
651
  */
652
- ut = function(e, t) {
653
- var n;
654
- if (S(this, Y) === this.CLOSED)
652
+ lt = function(e, n) {
653
+ var t;
654
+ if (S(this, J) === this.CLOSED)
655
655
  return;
656
- L(this, Y, this.CONNECTING);
657
- const r = new kt("error", { code: t, message: e });
658
- (n = S(this, Re)) == null || n.call(this, r), this.dispatchEvent(r), L(this, we, setTimeout(S(this, lt), S(this, Ne)));
659
- }, lt = /* @__PURE__ */ new WeakMap(), /**
656
+ L(this, J, this.CONNECTING);
657
+ const r = new It("error", { code: n, message: e });
658
+ (t = S(this, ye)) == null || t.call(this, r), this.dispatchEvent(r), L(this, we, setTimeout(S(this, ft), S(this, xe)));
659
+ }, ft = /* @__PURE__ */ new WeakMap(), /**
660
660
  * ReadyState representing an EventSource currently trying to connect
661
661
  *
662
662
  * @public
663
663
  */
664
- Ue.CONNECTING = 0, /**
664
+ Ie.CONNECTING = 0, /**
665
665
  * ReadyState representing an EventSource connection that is open (eg connected)
666
666
  *
667
667
  * @public
668
668
  */
669
- Ue.OPEN = 1, /**
669
+ Ie.OPEN = 1, /**
670
670
  * ReadyState representing an EventSource connection that is closed (eg disconnected)
671
671
  *
672
672
  * @public
673
673
  */
674
- Ue.CLOSED = 2;
675
- function yn() {
674
+ Ie.CLOSED = 2;
675
+ function Tn() {
676
676
  const e = "document" in globalThis ? globalThis.document : void 0;
677
677
  return e && typeof e == "object" && "baseURI" in e && typeof e.baseURI == "string" ? e.baseURI : void 0;
678
678
  }
679
- const bn = (e) => {
680
- let t = "";
681
- const n = new Uint8Array(e), r = n.byteLength;
682
- for (let s = 0; s < r; s++)
683
- t += String.fromCharCode(n[s]);
684
- return btoa(t);
685
- }, St = {
679
+ const Cn = (e) => {
680
+ let n = "";
681
+ const t = new Uint8Array(e), r = t.byteLength;
682
+ for (let o = 0; o < r; o++)
683
+ n += String.fromCharCode(t[o]);
684
+ return btoa(n);
685
+ }, wt = {
686
686
  status: "idle",
687
687
  error: null,
688
688
  result: null,
@@ -693,285 +693,362 @@ const bn = (e) => {
693
693
  uploadAssets: { status: "pending" }
694
694
  },
695
695
  jobSessionId: null,
696
- jobStatus: {}
697
- }, Pt = 10, Mt = (e) => "path" in e ? {
696
+ jobStatus: {},
697
+ jobType: null
698
+ }, Mt = 10, Xt = (e) => "path" in e ? {
698
699
  filePath: e.path.replace(/^\//, ""),
699
700
  referencePath: e.path === "/" ? "" : e.path
700
701
  // Workaround to avoid duplicated slashes in the URL. Ideally, the fix should be done in Codegen.
701
702
  } : {
702
703
  filePath: e.filePath.replace(/^\//, ""),
703
704
  referencePath: e.referencePath === "/" ? "" : e.referencePath
704
- }, Zt = (e, t, n, r) => oe(null, null, function* () {
705
- var _, w, m;
706
- const s = structuredClone(St);
707
- s.status = "pending", r(D({}, s));
708
- const i = structuredClone(n);
709
- if (((_ = n.assetsStorage) == null ? void 0 : _.strategy) === "local") {
710
- const { referencePath: E } = Mt(
711
- n.assetsStorage
712
- );
713
- n.assetsStorage = {
714
- strategy: "external",
715
- url: E
716
- };
717
- }
718
- let u;
719
- const l = new Ue(e, {
720
- fetch: (E, h) => (u = fetch(E, At(D({}, h), {
721
- method: t,
722
- body: JSON.stringify(n)
723
- })), u)
724
- }), d = new Promise((E, h) => {
725
- const p = {};
726
- l.addEventListener("start", (f) => {
727
- const o = JSON.parse(f.data);
728
- p.sessionId = o.sessionId, s.tasks.fetchDesign.status = "running", s.jobSessionId = o.sessionId, r(D({}, s));
729
- }), l.addEventListener("queueing", (f) => {
730
- const o = JSON.parse(f.data);
731
- s.jobSessionId = o.payload.sessionId, r(D({}, s));
732
- }), l.addEventListener("pre_codegen", (f) => {
705
+ }, Zt = ({
706
+ es: e,
707
+ lastFetchResponse: n,
708
+ stateUpdated: t
709
+ }) => {
710
+ const r = structuredClone(wt);
711
+ return r.status = "pending", t(k({}, r)), new Promise((o, u) => {
712
+ const a = {};
713
+ e.addEventListener("set_job_type", (s) => {
714
+ const i = JSON.parse(
715
+ s.data
716
+ );
717
+ r.jobType = i.payload.jobType, t(k({}, r));
718
+ }), e.addEventListener("start", (s) => {
719
+ const i = JSON.parse(s.data);
720
+ a.sessionId = i.sessionId, r.tasks.fetchDesign.status = "running", r.jobSessionId = i.sessionId, t(k({}, r));
721
+ }), e.addEventListener("queueing", (s) => {
722
+ const i = JSON.parse(s.data);
723
+ r.jobSessionId = i.payload.sessionId, t(k({}, r));
724
+ }), e.addEventListener("pre_codegen", (s) => {
733
725
  JSON.parse(
734
- f.data
735
- ).message === "Anima model built" && (s.tasks.fetchDesign.status = "finished", s.tasks.codeGeneration.status = "running", s.tasks.uploadAssets.status = "running", r(D({}, s)));
736
- }), l.addEventListener("figma_metadata", (f) => {
737
- const o = JSON.parse(
738
- f.data
726
+ s.data
727
+ ).message === "Anima model built" && (r.tasks.fetchDesign.status = "finished", r.tasks.codeGeneration.status = "running", r.tasks.uploadAssets.status = "running", t(k({}, r)));
728
+ }), e.addEventListener("figma_metadata", (s) => {
729
+ const i = JSON.parse(
730
+ s.data
739
731
  );
740
- p.figmaFileName = o.figmaFileName, p.figmaSelectedFrameName = o.figmaSelectedFrameName;
741
- }), l.addEventListener("aborted", () => {
742
- const f = new Ye({ name: "Aborted", reason: "Unknown" });
743
- s.status = "aborted", s.result = null, s.error = f, r(D({}, s)), E({
732
+ a.figmaFileName = i.figmaFileName, a.figmaSelectedFrameName = i.figmaSelectedFrameName;
733
+ }), e.addEventListener("aborted", () => {
734
+ const s = new Be({ name: "Aborted", reason: "Unknown" });
735
+ r.status = "aborted", r.result = null, r.error = s, t(k({}, r)), o({
744
736
  result: null,
745
- error: f
737
+ error: s
746
738
  });
747
- }), l.addEventListener("generating_code", (f) => {
748
- const o = JSON.parse(
749
- f.data
739
+ }), e.addEventListener("generating_code", (s) => {
740
+ const i = JSON.parse(
741
+ s.data
750
742
  );
751
- o.payload.status === "success" && (p.files = o.payload.files), s.tasks.codeGeneration.progress = o.payload.progress, s.tasks.codeGeneration.status = "running", r(D({}, s));
752
- }), l.addEventListener("progress_messages_updated", (f) => {
753
- const o = JSON.parse(
754
- f.data
743
+ i.payload.status === "success" && (a.files = i.payload.files), r.tasks.codeGeneration.progress = i.payload.progress, r.tasks.codeGeneration.status = "running", t(k({}, r));
744
+ }), e.addEventListener("progress_messages_updated", (s) => {
745
+ const i = JSON.parse(
746
+ s.data
755
747
  );
756
- s.progressMessages = o.payload.progressMessages, r(D({}, s));
757
- }), l.addEventListener("job_status_updated", (f) => {
758
- const o = JSON.parse(
759
- f.data
748
+ r.progressMessages = i.payload.progressMessages, t(k({}, r));
749
+ }), e.addEventListener("job_status_updated", (s) => {
750
+ const i = JSON.parse(
751
+ s.data
760
752
  );
761
- s.jobStatus = o.payload.jobStatus, r(D({}, s));
762
- }), l.addEventListener("codegen_completed", () => {
763
- s.tasks.codeGeneration.status = "finished", r(D({}, s));
764
- }), l.addEventListener("generation_completed", () => {
765
- s.tasks.codeGeneration.status = "finished", r(D({}, s));
766
- }), l.addEventListener("assets_uploaded", () => {
767
- s.tasks.uploadAssets.status = "finished", r(D({}, s));
768
- }), l.addEventListener("assets_list", (f) => {
769
- const o = JSON.parse(
770
- f.data
753
+ r.jobStatus = i.payload.jobStatus, t(k({}, r));
754
+ }), e.addEventListener("codegen_completed", () => {
755
+ r.tasks.codeGeneration.status = "finished", t(k({}, r));
756
+ }), e.addEventListener("generation_completed", () => {
757
+ r.tasks.codeGeneration.status = "finished", t(k({}, r));
758
+ }), e.addEventListener("assets_uploaded", () => {
759
+ r.tasks.uploadAssets.status = "finished", t(k({}, r));
760
+ }), e.addEventListener("assets_list", (s) => {
761
+ const i = JSON.parse(
762
+ s.data
771
763
  );
772
- p.assets = o.payload.assets;
764
+ a.assets = i.payload.assets;
773
765
  });
774
- let c = 0;
775
- l.addEventListener("error", (f) => oe(null, null, function* () {
776
- var F, $, b, K, U, B, Q;
777
- const o = yield u;
778
- if (!o.ok) {
779
- let q = "";
766
+ let l = 0;
767
+ e.addEventListener("error", (s) => H(null, null, function* () {
768
+ var E, d, g, f, w, O, M;
769
+ if (!n)
770
+ return;
771
+ const i = yield n;
772
+ if (!i.ok) {
773
+ let T = "";
780
774
  try {
781
- q = yield o.text();
782
- const C = JSON.parse(q);
783
- (F = C == null ? void 0 : C.payload) != null && F.message && (q = C.payload.message);
784
- } catch (C) {
775
+ T = yield i.text();
776
+ const I = JSON.parse(T);
777
+ (E = I == null ? void 0 : I.payload) != null && E.message && (T = I.payload.message);
778
+ } catch (I) {
785
779
  }
786
- h(
787
- new Ye({
780
+ u(
781
+ new Be({
788
782
  name: "Request failed",
789
783
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
790
- reason: q,
791
- status: o.status
784
+ reason: T,
785
+ status: i.status
792
786
  })
793
- ), l.close();
787
+ ), e.close();
794
788
  return;
795
789
  }
796
790
  console.warn(
797
- `Experienced error during code generation (attempt ${c + 1} / ${Pt})`,
798
- f
791
+ `Experienced error during code generation (attempt ${l + 1} / ${Mt})`,
792
+ s
799
793
  );
800
- let g, k = !1;
801
- if (f instanceof MessageEvent)
794
+ let h, m = !1;
795
+ if (s instanceof MessageEvent)
802
796
  try {
803
- g = JSON.parse(f.data);
804
- } catch (q) {
797
+ h = JSON.parse(s.data);
798
+ } catch (T) {
805
799
  }
806
- ((($ = g == null ? void 0 : g.payload) == null ? void 0 : $.name) === "Task Crashed" || ((b = g == null ? void 0 : g.payload) == null ? void 0 : b.name) === "TimeoutError" || ((K = g == null ? void 0 : g.payload) == null ? void 0 : K.name) === "Error" || ((U = g == null ? void 0 : g.payload) == null ? void 0 : U.name) === "Unknown error") && (k = !0);
807
- const N = new Ye({
808
- name: (B = g == null ? void 0 : g.payload.name) != null ? B : "Unknown error",
809
- reason: (Q = g == null ? void 0 : g.payload.message) != null ? Q : "Unknown",
810
- status: g == null ? void 0 : g.payload.status,
811
- detail: g == null ? void 0 : g.payload.detail
800
+ (((d = h == null ? void 0 : h.payload) == null ? void 0 : d.name) === "Task Crashed" || ((g = h == null ? void 0 : h.payload) == null ? void 0 : g.name) === "TimeoutError" || ((f = h == null ? void 0 : h.payload) == null ? void 0 : f.name) === "Error" || ((w = h == null ? void 0 : h.payload) == null ? void 0 : w.name) === "Unknown error") && (m = !0);
801
+ const v = new Be({
802
+ name: (O = h == null ? void 0 : h.payload.name) != null ? O : "Unknown error",
803
+ reason: (M = h == null ? void 0 : h.payload.message) != null ? M : "Unknown",
804
+ status: h == null ? void 0 : h.payload.status,
805
+ detail: h == null ? void 0 : h.payload.detail
812
806
  });
813
- c++;
814
- let T = !1;
815
- c > Pt ? (console.error("Experienced too many errors, terminating request"), T = !0) : k && (console.error("Experienced unrecoverable error, terminating request"), T = !0), T && (s.status = "error", s.error = N, r(D({}, s)), E({
807
+ l++;
808
+ let p = !1;
809
+ l > Mt ? (console.error("Experienced too many errors, terminating request"), p = !0) : m && (console.error("Experienced unrecoverable error, terminating request"), p = !0), p && (r.status = "error", r.error = v, t(k({}, r)), o({
816
810
  result: null,
817
- error: N
811
+ error: v
818
812
  }));
819
- })), l.addEventListener("done", (f) => {
820
- const o = JSON.parse(f.data);
821
- p.tokenUsage = o.payload.tokenUsage, p.sessionId = o.payload.sessionId, s.status = "success", s.result = p, r(D({}, s)), E({ result: p, error: null });
813
+ })), e.addEventListener("done", (s) => {
814
+ const i = JSON.parse(s.data);
815
+ a.tokenUsage = i.payload.tokenUsage, a.sessionId = i.payload.sessionId, r.status = "success", r.result = a, t(k({}, r)), o({ result: a, error: null });
822
816
  });
823
817
  });
818
+ }, Qt = (e, n, t, r) => H(null, null, function* () {
819
+ var l;
820
+ const o = structuredClone(t);
821
+ if (((l = t.assetsStorage) == null ? void 0 : l.strategy) === "local") {
822
+ const { referencePath: s } = Xt(
823
+ t.assetsStorage
824
+ );
825
+ t.assetsStorage = { strategy: "external", url: s };
826
+ }
827
+ let u;
828
+ const a = new Ie(e, {
829
+ fetch: (s, i) => (u = fetch(s, Ye(k({}, i), {
830
+ method: n,
831
+ body: JSON.stringify(t)
832
+ })), u)
833
+ });
824
834
  try {
825
- const { result: E, error: h } = yield d, p = structuredClone(E);
826
- if (((w = i.assetsStorage) == null ? void 0 : w.strategy) === "local" && ((m = p == null ? void 0 : p.assets) != null && m.length)) {
827
- const { filePath: c } = Mt(
828
- i.assetsStorage
829
- ), f = p.assets.map((g) => oe(null, null, function* () {
830
- const N = yield (yield fetch(g.url)).arrayBuffer();
835
+ const { result: s, error: i } = yield Zt({
836
+ es: a,
837
+ lastFetchResponse: u,
838
+ stateUpdated: r
839
+ });
840
+ if (i || !s)
841
+ return { result: null, error: i };
842
+ const h = structuredClone(s);
843
+ return en(h, o), { result: h, error: null };
844
+ } finally {
845
+ a.close();
846
+ }
847
+ }), An = (e, n, t) => H(null, null, function* () {
848
+ const r = structuredClone(n);
849
+ let o;
850
+ const u = new Ie(e, {
851
+ fetch: (a, l) => (o = fetch(a, Ye(k({}, l), {
852
+ method: "POST",
853
+ body: JSON.stringify(n)
854
+ })), o)
855
+ });
856
+ try {
857
+ const { result: a, error: l } = yield Zt({
858
+ es: u,
859
+ lastFetchResponse: o,
860
+ stateUpdated: t
861
+ });
862
+ if (l || !a)
863
+ return { result: null, error: l };
864
+ const s = structuredClone(a);
865
+ return en(s, r), { result: s, error: null };
866
+ } finally {
867
+ u.close();
868
+ }
869
+ }), en = (e, n) => H(null, null, function* () {
870
+ var t, r;
871
+ if (((t = n.assetsStorage) == null ? void 0 : t.strategy) === "local" && ((r = e.assets) != null && r.length)) {
872
+ const { filePath: o } = Xt(n.assetsStorage), u = e.assets.map(
873
+ (l) => H(null, null, function* () {
874
+ const i = yield (yield fetch(l.url)).arrayBuffer();
831
875
  return {
832
- assetName: g.name,
833
- base64: bn(N)
876
+ assetName: l.name,
877
+ base64: Cn(i)
878
+ };
879
+ })
880
+ ), a = yield Promise.allSettled(u);
881
+ for (const l of a)
882
+ if (l.status === "fulfilled") {
883
+ const { assetName: s, base64: i } = l.value, h = o ? `${o}/${s}` : s;
884
+ e.files[h] = {
885
+ content: i,
886
+ isBinary: !0
834
887
  };
835
- })), o = yield Promise.allSettled(f);
836
- for (const g of o) {
837
- const k = {};
838
- if (g.status === "fulfilled") {
839
- const { assetName: N, base64: T } = g.value;
840
- k[N] = T;
841
- const F = c ? `${c}/${N}` : N;
842
- p.files[F] = {
843
- content: T,
844
- isBinary: !0
845
- };
846
- }
847
888
  }
848
- }
849
- return h ? { result: null, error: h } : { result: p, error: h };
850
- } finally {
851
- l.close();
852
889
  }
853
890
  });
854
- class Tn extends Error {
855
- constructor(t, n) {
856
- super(t), this.name = "CreateJobError", this.cause = n;
891
+ class Ln extends Error {
892
+ constructor(n, t) {
893
+ super(n), this.name = "CreateJobError", this.cause = t;
894
+ }
895
+ }
896
+ class Nn extends Error {
897
+ constructor(n, t) {
898
+ super(n), this.name = "AttachJobError", this.cause = t;
857
899
  }
858
900
  }
859
- class Cn extends Error {
901
+ class xn extends Error {
860
902
  constructor() {
861
903
  super(""), this.name = "UnknownCodegenError";
862
904
  }
863
905
  }
864
- const Qt = Bt(null);
865
- function hs({ figmaRestApi: e, f2cUrl: t, l2cUrl: n, p2cUrl: r, children: s }) {
866
- const [i, u] = nt({ status: "idle" }), l = le(null), [d, _] = nt(St), w = {
867
- f2c: t,
868
- l2c: n,
906
+ const tn = Yt(null);
907
+ function gr({ figmaRestApi: e, f2cUrl: n, l2cUrl: t, p2cUrl: r, jobsUrl: o, children: u }) {
908
+ const [a, l] = rt({ status: "idle" }), s = ue(null), [i, h] = rt(wt), m = {
909
+ f2c: n,
910
+ l2c: t,
869
911
  p2c: r
870
- }, m = (E, h) => oe(null, null, function* () {
871
- var p;
872
- if (i.status === "pending")
912
+ }, v = (E, d) => H(null, null, function* () {
913
+ var g;
914
+ if (a.status === "pending")
873
915
  throw new Error("A job is already in progress");
874
- l.current = E;
916
+ s.current = E;
875
917
  try {
876
- const c = w[E], { result: f } = yield Zt(c, "POST", h, (o) => _(o));
877
- if (f) {
878
- const o = f.sessionId, g = f.files, k = f.assets;
879
- u((N) => ({
918
+ const f = m[E], { result: w } = yield Qt(f, "POST", d, (O) => h(O));
919
+ if (w) {
920
+ const O = w.sessionId, M = w.files, T = w.assets;
921
+ l((I) => ({
880
922
  status: "success",
881
923
  type: E,
882
- params: "params" in N ? N.params : {},
883
- sessionId: o,
884
- payload: d.jobStatus,
885
- assets: k,
886
- files: g,
887
- progressMessages: d.progressMessages
924
+ params: "params" in I ? I.params : {},
925
+ sessionId: O,
926
+ payload: i.jobStatus,
927
+ assets: T,
928
+ files: M,
929
+ progressMessages: i.progressMessages
888
930
  }));
889
931
  return;
890
932
  }
891
- } catch (c) {
892
- l.current = null;
893
- const f = c instanceof Error ? c.message : "Unknown error", o = new Tn(f, c);
894
- throw u({
933
+ } catch (f) {
934
+ s.current = null;
935
+ const w = f instanceof Error ? f.message : "Unknown error", O = new Ln(w, f);
936
+ throw l({
895
937
  status: "error",
896
938
  type: E,
897
- params: h,
898
- error: o,
899
- sessionId: (p = d.jobSessionId) != null ? p : null,
900
- payload: d.jobStatus,
901
- progressMessages: d.progressMessages
902
- }), o;
939
+ params: d,
940
+ error: O,
941
+ sessionId: (g = i.jobSessionId) != null ? g : null,
942
+ payload: i.jobStatus,
943
+ progressMessages: i.progressMessages
944
+ }), O;
945
+ }
946
+ }), p = (E, d) => H(null, null, function* () {
947
+ if (!o)
948
+ throw new Error("jobsUrl is required in order to attach to a job");
949
+ try {
950
+ const g = `${o}/${E}`, { result: f } = yield An(
951
+ g,
952
+ d,
953
+ (w) => h(w)
954
+ );
955
+ if (f) {
956
+ const w = f.files, O = f.assets;
957
+ l((M) => ({
958
+ status: "success",
959
+ type: i.jobType,
960
+ params: "params" in M ? M.params : {},
961
+ sessionId: E,
962
+ payload: i.jobStatus,
963
+ assets: O,
964
+ files: w,
965
+ progressMessages: i.progressMessages
966
+ }));
967
+ }
968
+ } catch (g) {
969
+ const f = g instanceof Error ? g.message : "Unknown error", w = new Nn(f, g);
970
+ throw l({
971
+ status: "error",
972
+ type: s.current,
973
+ params: {},
974
+ error: w,
975
+ sessionId: E,
976
+ payload: i.jobStatus,
977
+ progressMessages: i.progressMessages
978
+ }), w;
903
979
  }
904
980
  });
905
- return Ht(() => {
906
- var h;
907
- if (!l.current)
908
- return;
909
- const E = l.current;
910
- if (d.status === "error") {
911
- const p = (h = d.error) != null ? h : new Cn();
912
- u((c) => {
913
- var f;
914
- return {
915
- status: "error",
981
+ return Bt(() => {
982
+ var d, g;
983
+ const E = (d = s.current) != null ? d : i.jobType;
984
+ if (E) {
985
+ if (i.status === "error") {
986
+ const f = (g = i.error) != null ? g : new xn();
987
+ l((w) => {
988
+ var O;
989
+ return {
990
+ status: "error",
991
+ type: E,
992
+ params: "params" in w ? w.params : {},
993
+ error: f,
994
+ sessionId: (O = i.jobSessionId) != null ? O : null,
995
+ payload: i.jobStatus,
996
+ progressMessages: i.progressMessages
997
+ };
998
+ });
999
+ return;
1000
+ }
1001
+ if (i.status === "pending") {
1002
+ l((f) => ({
1003
+ status: "pending",
916
1004
  type: E,
917
- params: "params" in c ? c.params : {},
918
- error: p,
919
- sessionId: (f = d.jobSessionId) != null ? f : null,
920
- payload: d.jobStatus,
921
- progressMessages: d.progressMessages
922
- };
923
- });
924
- return;
925
- }
926
- if (d.status === "pending") {
927
- u((p) => ({
928
- status: "pending",
929
- type: E,
930
- params: "params" in p ? p.params : {},
931
- sessionId: d.jobSessionId,
932
- payload: d.jobStatus,
933
- progressMessages: d.progressMessages
934
- }));
935
- return;
1005
+ params: "params" in f ? f.params : {},
1006
+ sessionId: i.jobSessionId,
1007
+ payload: i.jobStatus,
1008
+ progressMessages: i.progressMessages
1009
+ }));
1010
+ return;
1011
+ }
936
1012
  }
937
- }, [d]), /* @__PURE__ */ Sn.jsx(
938
- Qt.Provider,
1013
+ }, [i]), /* @__PURE__ */ yn.jsx(
1014
+ tn.Provider,
939
1015
  {
940
1016
  value: {
941
- createJob: m,
942
- job: i,
1017
+ createJob: v,
1018
+ attachJob: p,
1019
+ job: a,
943
1020
  figmaRestApi: e
944
1021
  },
945
- children: s
1022
+ children: u
946
1023
  }
947
1024
  );
948
1025
  }
949
- function An() {
950
- const e = zt(Qt);
1026
+ function kn() {
1027
+ const e = Ht(tn);
951
1028
  if (!e)
952
1029
  throw new Error("useAnimaSDK must be used within AnimaSDKProvider");
953
1030
  return e;
954
1031
  }
955
- const ps = ({
1032
+ const vr = ({
956
1033
  url: e,
957
- method: t = "POST"
1034
+ method: n = "POST"
958
1035
  }) => {
959
- const [n, r] = nt(St);
1036
+ const [t, r] = rt(wt);
960
1037
  return {
961
- getCode: Ve(
962
- (i) => Zt(e, t, i, r),
963
- [e, t]
1038
+ getCode: $e(
1039
+ (u) => Qt(e, n, u, r),
1040
+ [e, n]
964
1041
  ),
965
- status: n.status,
966
- progressMessages: n.progressMessages,
967
- jobSessionId: n.jobSessionId,
968
- jobStatus: n.jobStatus,
969
- tasks: n.tasks,
970
- error: n.error,
971
- result: n.result
1042
+ status: t.status,
1043
+ progressMessages: t.progressMessages,
1044
+ jobSessionId: t.jobSessionId,
1045
+ jobStatus: t.jobStatus,
1046
+ tasks: t.tasks,
1047
+ error: t.error,
1048
+ result: t.result
972
1049
  };
973
1050
  };
974
- var Me = { exports: {} }, He = {};
1051
+ var We = { exports: {} }, ze = {};
975
1052
  /**
976
1053
  * @license React
977
1054
  * use-sync-external-store-shim.production.js
@@ -981,48 +1058,48 @@ var Me = { exports: {} }, He = {};
981
1058
  * This source code is licensed under the MIT license found in the
982
1059
  * LICENSE file in the root directory of this source tree.
983
1060
  */
984
- var Wt;
985
- function Ln() {
986
- if (Wt) return He;
987
- Wt = 1;
988
- var e = Oe;
989
- function t(m, E) {
990
- return m === E && (m !== 0 || 1 / m === 1 / E) || m !== m && E !== E;
1061
+ var Pt;
1062
+ function In() {
1063
+ if (Pt) return ze;
1064
+ Pt = 1;
1065
+ var e = be;
1066
+ function n(m, v) {
1067
+ return m === v && (m !== 0 || 1 / m === 1 / v) || m !== m && v !== v;
991
1068
  }
992
- var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, s = e.useEffect, i = e.useLayoutEffect, u = e.useDebugValue;
993
- function l(m, E) {
994
- var h = E(), p = r({ inst: { value: h, getSnapshot: E } }), c = p[0].inst, f = p[1];
995
- return i(
1069
+ var t = typeof Object.is == "function" ? Object.is : n, r = e.useState, o = e.useEffect, u = e.useLayoutEffect, a = e.useDebugValue;
1070
+ function l(m, v) {
1071
+ var p = v(), E = r({ inst: { value: p, getSnapshot: v } }), d = E[0].inst, g = E[1];
1072
+ return u(
996
1073
  function() {
997
- c.value = h, c.getSnapshot = E, d(c) && f({ inst: c });
1074
+ d.value = p, d.getSnapshot = v, s(d) && g({ inst: d });
998
1075
  },
999
- [m, h, E]
1000
- ), s(
1076
+ [m, p, v]
1077
+ ), o(
1001
1078
  function() {
1002
- return d(c) && f({ inst: c }), m(function() {
1003
- d(c) && f({ inst: c });
1079
+ return s(d) && g({ inst: d }), m(function() {
1080
+ s(d) && g({ inst: d });
1004
1081
  });
1005
1082
  },
1006
1083
  [m]
1007
- ), u(h), h;
1084
+ ), a(p), p;
1008
1085
  }
1009
- function d(m) {
1010
- var E = m.getSnapshot;
1086
+ function s(m) {
1087
+ var v = m.getSnapshot;
1011
1088
  m = m.value;
1012
1089
  try {
1013
- var h = E();
1014
- return !n(m, h);
1015
- } catch (p) {
1090
+ var p = v();
1091
+ return !t(m, p);
1092
+ } catch (E) {
1016
1093
  return !0;
1017
1094
  }
1018
1095
  }
1019
- function _(m, E) {
1020
- return E();
1096
+ function i(m, v) {
1097
+ return v();
1021
1098
  }
1022
- var w = typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined" ? _ : l;
1023
- return He.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : w, He;
1099
+ var h = typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined" ? i : l;
1100
+ return ze.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : h, ze;
1024
1101
  }
1025
- var ze = {};
1102
+ var Ke = {};
1026
1103
  /**
1027
1104
  * @license React
1028
1105
  * use-sync-external-store-shim.development.js
@@ -1032,251 +1109,251 @@ var ze = {};
1032
1109
  * This source code is licensed under the MIT license found in the
1033
1110
  * LICENSE file in the root directory of this source tree.
1034
1111
  */
1035
- var Ft;
1036
- function xn() {
1037
- return Ft || (Ft = 1, process.env.NODE_ENV !== "production" && (function() {
1038
- function e(h, p) {
1039
- return h === p && (h !== 0 || 1 / h === 1 / p) || h !== h && p !== p;
1112
+ var Wt;
1113
+ function Dn() {
1114
+ return Wt || (Wt = 1, process.env.NODE_ENV !== "production" && (function() {
1115
+ function e(p, E) {
1116
+ return p === E && (p !== 0 || 1 / p === 1 / E) || p !== p && E !== E;
1040
1117
  }
1041
- function t(h, p) {
1042
- w || s.startTransition === void 0 || (w = !0, console.error(
1118
+ function n(p, E) {
1119
+ h || o.startTransition === void 0 || (h = !0, console.error(
1043
1120
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
1044
1121
  ));
1045
- var c = p();
1122
+ var d = E();
1046
1123
  if (!m) {
1047
- var f = p();
1048
- i(c, f) || (console.error(
1124
+ var g = E();
1125
+ u(d, g) || (console.error(
1049
1126
  "The result of getSnapshot should be cached to avoid an infinite loop"
1050
1127
  ), m = !0);
1051
1128
  }
1052
- f = u({
1053
- inst: { value: c, getSnapshot: p }
1129
+ g = a({
1130
+ inst: { value: d, getSnapshot: E }
1054
1131
  });
1055
- var o = f[0].inst, g = f[1];
1056
- return d(
1132
+ var f = g[0].inst, w = g[1];
1133
+ return s(
1057
1134
  function() {
1058
- o.value = c, o.getSnapshot = p, n(o) && g({ inst: o });
1135
+ f.value = d, f.getSnapshot = E, t(f) && w({ inst: f });
1059
1136
  },
1060
- [h, c, p]
1137
+ [p, d, E]
1061
1138
  ), l(
1062
1139
  function() {
1063
- return n(o) && g({ inst: o }), h(function() {
1064
- n(o) && g({ inst: o });
1140
+ return t(f) && w({ inst: f }), p(function() {
1141
+ t(f) && w({ inst: f });
1065
1142
  });
1066
1143
  },
1067
- [h]
1068
- ), _(c), c;
1144
+ [p]
1145
+ ), i(d), d;
1069
1146
  }
1070
- function n(h) {
1071
- var p = h.getSnapshot;
1072
- h = h.value;
1147
+ function t(p) {
1148
+ var E = p.getSnapshot;
1149
+ p = p.value;
1073
1150
  try {
1074
- var c = p();
1075
- return !i(h, c);
1076
- } catch (f) {
1151
+ var d = E();
1152
+ return !u(p, d);
1153
+ } catch (g) {
1077
1154
  return !0;
1078
1155
  }
1079
1156
  }
1080
- function r(h, p) {
1081
- return p();
1157
+ function r(p, E) {
1158
+ return E();
1082
1159
  }
1083
1160
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ != "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1084
- var s = Oe, i = typeof Object.is == "function" ? Object.is : e, u = s.useState, l = s.useEffect, d = s.useLayoutEffect, _ = s.useDebugValue, w = !1, m = !1, E = typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined" ? r : t;
1085
- ze.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : E, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ != "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1086
- })()), ze;
1161
+ var o = be, u = typeof Object.is == "function" ? Object.is : e, a = o.useState, l = o.useEffect, s = o.useLayoutEffect, i = o.useDebugValue, h = !1, m = !1, v = typeof window == "undefined" || typeof window.document == "undefined" || typeof window.document.createElement == "undefined" ? r : n;
1162
+ Ke.useSyncExternalStore = o.useSyncExternalStore !== void 0 ? o.useSyncExternalStore : v, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ != "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1163
+ })()), Ke;
1087
1164
  }
1088
- var Vt;
1089
- function Nn() {
1090
- return Vt || (Vt = 1, process.env.NODE_ENV === "production" ? Me.exports = Ln() : Me.exports = xn()), Me.exports;
1165
+ var Ft;
1166
+ function jn() {
1167
+ return Ft || (Ft = 1, process.env.NODE_ENV === "production" ? We.exports = In() : We.exports = Dn()), We.exports;
1091
1168
  }
1092
- var In = Nn();
1093
- const en = 0, tn = 1, nn = 2, $t = 3;
1094
- var Ut = Object.prototype.hasOwnProperty;
1095
- function ft(e, t) {
1096
- var n, r;
1097
- if (e === t) return !0;
1098
- if (e && t && (n = e.constructor) === t.constructor) {
1099
- if (n === Date) return e.getTime() === t.getTime();
1100
- if (n === RegExp) return e.toString() === t.toString();
1101
- if (n === Array) {
1102
- if ((r = e.length) === t.length)
1103
- for (; r-- && ft(e[r], t[r]); ) ;
1169
+ var Mn = jn();
1170
+ const nn = 0, rn = 1, sn = 2, Vt = 3;
1171
+ var $t = Object.prototype.hasOwnProperty;
1172
+ function dt(e, n) {
1173
+ var t, r;
1174
+ if (e === n) return !0;
1175
+ if (e && n && (t = e.constructor) === n.constructor) {
1176
+ if (t === Date) return e.getTime() === n.getTime();
1177
+ if (t === RegExp) return e.toString() === n.toString();
1178
+ if (t === Array) {
1179
+ if ((r = e.length) === n.length)
1180
+ for (; r-- && dt(e[r], n[r]); ) ;
1104
1181
  return r === -1;
1105
1182
  }
1106
- if (!n || typeof e == "object") {
1183
+ if (!t || typeof e == "object") {
1107
1184
  r = 0;
1108
- for (n in e)
1109
- if (Ut.call(e, n) && ++r && !Ut.call(t, n) || !(n in t) || !ft(e[n], t[n])) return !1;
1110
- return Object.keys(t).length === r;
1185
+ for (t in e)
1186
+ if ($t.call(e, t) && ++r && !$t.call(n, t) || !(t in n) || !dt(e[t], n[t])) return !1;
1187
+ return Object.keys(n).length === r;
1111
1188
  }
1112
1189
  }
1113
- return e !== e && t !== t;
1190
+ return e !== e && n !== n;
1114
1191
  }
1115
- const ie = /* @__PURE__ */ new WeakMap(), de = () => {
1192
+ const oe = /* @__PURE__ */ new WeakMap(), fe = () => {
1116
1193
  }, V = (
1117
1194
  /*#__NOINLINE__*/
1118
- de()
1119
- ), dt = Object, R = (e) => e === V, ee = (e) => typeof e == "function", he = (e, t) => D(D({}, e), t), sn = (e) => ee(e.then), Ke = {}, We = {}, wt = "undefined", De = typeof window != wt, ht = typeof document != wt, kn = De && "Deno" in window, Dn = () => De && typeof window.requestAnimationFrame != wt, rn = (e, t) => {
1120
- const n = ie.get(e);
1195
+ fe()
1196
+ ), ht = Object, y = (e) => e === V, Z = (e) => typeof e == "function", de = (e, n) => k(k({}, e), n), on = (e) => Z(e.then), Xe = {}, Fe = {}, yt = "undefined", je = typeof window != yt, pt = typeof document != yt, Pn = je && "Deno" in window, Wn = () => je && typeof window.requestAnimationFrame != yt, an = (e, n) => {
1197
+ const t = oe.get(e);
1121
1198
  return [
1122
1199
  // Getter
1123
- () => !R(t) && e.get(t) || Ke,
1200
+ () => !y(n) && e.get(n) || Xe,
1124
1201
  // Setter
1125
1202
  (r) => {
1126
- if (!R(t)) {
1127
- const s = e.get(t);
1128
- t in We || (We[t] = s), n[5](t, he(s, r), s || Ke);
1203
+ if (!y(n)) {
1204
+ const o = e.get(n);
1205
+ n in Fe || (Fe[n] = o), t[5](n, de(o, r), o || Xe);
1129
1206
  }
1130
1207
  },
1131
1208
  // Subscriber
1132
- n[6],
1209
+ t[6],
1133
1210
  // Get server cache snapshot
1134
- () => !R(t) && t in We ? We[t] : !R(t) && e.get(t) || Ke
1211
+ () => !y(n) && n in Fe ? Fe[n] : !y(n) && e.get(n) || Xe
1135
1212
  ];
1136
1213
  };
1137
- let pt = !0;
1138
- const jn = () => pt, [Et, mt] = De && window.addEventListener ? [
1214
+ let Et = !0;
1215
+ const Fn = () => Et, [mt, gt] = je && window.addEventListener ? [
1139
1216
  window.addEventListener.bind(window),
1140
1217
  window.removeEventListener.bind(window)
1141
1218
  ] : [
1142
- de,
1143
- de
1144
- ], Pn = () => {
1145
- const e = ht && document.visibilityState;
1146
- return R(e) || e !== "hidden";
1147
- }, Mn = (e) => (ht && document.addEventListener("visibilitychange", e), Et("focus", e), () => {
1148
- ht && document.removeEventListener("visibilitychange", e), mt("focus", e);
1149
- }), Wn = (e) => {
1150
- const t = () => {
1151
- pt = !0, e();
1152
- }, n = () => {
1153
- pt = !1;
1219
+ fe,
1220
+ fe
1221
+ ], Vn = () => {
1222
+ const e = pt && document.visibilityState;
1223
+ return y(e) || e !== "hidden";
1224
+ }, $n = (e) => (pt && document.addEventListener("visibilitychange", e), mt("focus", e), () => {
1225
+ pt && document.removeEventListener("visibilitychange", e), gt("focus", e);
1226
+ }), Un = (e) => {
1227
+ const n = () => {
1228
+ Et = !0, e();
1229
+ }, t = () => {
1230
+ Et = !1;
1154
1231
  };
1155
- return Et("online", t), Et("offline", n), () => {
1156
- mt("online", t), mt("offline", n);
1232
+ return mt("online", n), mt("offline", t), () => {
1233
+ gt("online", n), gt("offline", t);
1157
1234
  };
1158
- }, Fn = {
1159
- isOnline: jn,
1160
- isVisible: Pn
1161
- }, Vn = {
1162
- initFocus: Mn,
1163
- initReconnect: Wn
1164
- }, qt = !Oe.useId, ke = !De || kn, $n = (e) => Dn() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Xe = ke ? Ht : En, Ze = typeof navigator != "undefined" && navigator.connection, Gt = !ke && Ze && ([
1235
+ }, Jn = {
1236
+ isOnline: Fn,
1237
+ isVisible: Vn
1238
+ }, qn = {
1239
+ initFocus: $n,
1240
+ initReconnect: Un
1241
+ }, Ut = !be.useId, De = !je || Pn, Gn = (e) => Wn() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Ze = De ? Bt : gn, Qe = typeof navigator != "undefined" && navigator.connection, Jt = !De && Qe && ([
1165
1242
  "slow-2g",
1166
1243
  "2g"
1167
- ].includes(Ze.effectiveType) || Ze.saveData), Fe = /* @__PURE__ */ new WeakMap(), Un = (e) => dt.prototype.toString.call(e), Qe = (e, t) => e === `[object ${t}]`;
1168
- let qn = 0;
1169
- const gt = (e) => {
1170
- const t = typeof e, n = Un(e), r = Qe(n, "Date"), s = Qe(n, "RegExp"), i = Qe(n, "Object");
1171
- let u, l;
1172
- if (dt(e) === e && !r && !s) {
1173
- if (u = Fe.get(e), u) return u;
1174
- if (u = ++qn + "~", Fe.set(e, u), Array.isArray(e)) {
1175
- for (u = "@", l = 0; l < e.length; l++)
1176
- u += gt(e[l]) + ",";
1177
- Fe.set(e, u);
1244
+ ].includes(Qe.effectiveType) || Qe.saveData), Ve = /* @__PURE__ */ new WeakMap(), Yn = (e) => ht.prototype.toString.call(e), et = (e, n) => e === `[object ${n}]`;
1245
+ let Bn = 0;
1246
+ const vt = (e) => {
1247
+ const n = typeof e, t = Yn(e), r = et(t, "Date"), o = et(t, "RegExp"), u = et(t, "Object");
1248
+ let a, l;
1249
+ if (ht(e) === e && !r && !o) {
1250
+ if (a = Ve.get(e), a) return a;
1251
+ if (a = ++Bn + "~", Ve.set(e, a), Array.isArray(e)) {
1252
+ for (a = "@", l = 0; l < e.length; l++)
1253
+ a += vt(e[l]) + ",";
1254
+ Ve.set(e, a);
1178
1255
  }
1179
- if (i) {
1180
- u = "#";
1181
- const d = dt.keys(e).sort();
1182
- for (; !R(l = d.pop()); )
1183
- R(e[l]) || (u += l + ":" + gt(e[l]) + ",");
1184
- Fe.set(e, u);
1256
+ if (u) {
1257
+ a = "#";
1258
+ const s = ht.keys(e).sort();
1259
+ for (; !y(l = s.pop()); )
1260
+ y(e[l]) || (a += l + ":" + vt(e[l]) + ",");
1261
+ Ve.set(e, a);
1185
1262
  }
1186
1263
  } else
1187
- u = r ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
1188
- return u;
1189
- }, Rt = (e) => {
1190
- if (ee(e))
1264
+ a = r ? e.toJSON() : n == "symbol" ? e.toString() : n == "string" ? JSON.stringify(e) : "" + e;
1265
+ return a;
1266
+ }, bt = (e) => {
1267
+ if (Z(e))
1191
1268
  try {
1192
1269
  e = e();
1193
- } catch (n) {
1270
+ } catch (t) {
1194
1271
  e = "";
1195
1272
  }
1196
- const t = e;
1197
- return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? gt(e) : "", [
1273
+ const n = e;
1274
+ return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? vt(e) : "", [
1198
1275
  e,
1199
- t
1276
+ n
1200
1277
  ];
1201
1278
  };
1202
- let Gn = 0;
1203
- const vt = () => ++Gn;
1204
- function on(...e) {
1205
- return oe(this, null, function* () {
1206
- const [t, n, r, s] = e, i = he({
1279
+ let Hn = 0;
1280
+ const _t = () => ++Hn;
1281
+ function cn(...e) {
1282
+ return H(this, null, function* () {
1283
+ const [n, t, r, o] = e, u = de({
1207
1284
  populateCache: !0,
1208
1285
  throwOnError: !0
1209
- }, typeof s == "boolean" ? {
1210
- revalidate: s
1211
- } : s || {});
1212
- let u = i.populateCache;
1213
- const l = i.rollbackOnError;
1214
- let d = i.optimisticData;
1215
- const _ = (E) => typeof l == "function" ? l(E) : l !== !1, w = i.throwOnError;
1216
- if (ee(n)) {
1217
- const E = n, h = [], p = t.keys();
1218
- for (const c of p)
1286
+ }, typeof o == "boolean" ? {
1287
+ revalidate: o
1288
+ } : o || {});
1289
+ let a = u.populateCache;
1290
+ const l = u.rollbackOnError;
1291
+ let s = u.optimisticData;
1292
+ const i = (v) => typeof l == "function" ? l(v) : l !== !1, h = u.throwOnError;
1293
+ if (Z(t)) {
1294
+ const v = t, p = [], E = n.keys();
1295
+ for (const d of E)
1219
1296
  // Skip the special useSWRInfinite and useSWRSubscription keys.
1220
- !/^\$(inf|sub)\$/.test(c) && E(t.get(c)._k) && h.push(c);
1221
- return Promise.all(h.map(m));
1297
+ !/^\$(inf|sub)\$/.test(d) && v(n.get(d)._k) && p.push(d);
1298
+ return Promise.all(p.map(m));
1222
1299
  }
1223
- return m(n);
1224
- function m(E) {
1225
- return oe(this, null, function* () {
1226
- const [h] = Rt(E);
1227
- if (!h) return;
1228
- const [p, c] = rn(t, h), [f, o, g, k] = ie.get(t), N = () => {
1229
- const C = f[h];
1230
- return (ee(i.revalidate) ? i.revalidate(p().data, E) : i.revalidate !== !1) && (delete g[h], delete k[h], C && C[0]) ? C[0](nn).then(() => p().data) : p().data;
1300
+ return m(t);
1301
+ function m(v) {
1302
+ return H(this, null, function* () {
1303
+ const [p] = bt(v);
1304
+ if (!p) return;
1305
+ const [E, d] = an(n, p), [g, f, w, O] = oe.get(n), M = () => {
1306
+ const D = g[p];
1307
+ return (Z(u.revalidate) ? u.revalidate(E().data, v) : u.revalidate !== !1) && (delete w[p], delete O[p], D && D[0]) ? D[0](sn).then(() => E().data) : E().data;
1231
1308
  };
1232
1309
  if (e.length < 3)
1233
- return N();
1234
- let T = r, F, $ = !1;
1235
- const b = vt();
1236
- o[h] = [
1237
- b,
1310
+ return M();
1311
+ let T = r, I, q = !1;
1312
+ const C = _t();
1313
+ f[p] = [
1314
+ C,
1238
1315
  0
1239
1316
  ];
1240
- const K = !R(d), U = p(), B = U.data, Q = U._c, q = R(Q) ? B : Q;
1241
- if (K && (d = ee(d) ? d(q, B) : d, c({
1242
- data: d,
1243
- _c: q
1244
- })), ee(T))
1317
+ const ae = !y(s), G = E(), X = G.data, he = G._c, Q = y(he) ? X : he;
1318
+ if (ae && (s = Z(s) ? s(Q, X) : s, d({
1319
+ data: s,
1320
+ _c: Q
1321
+ })), Z(T))
1245
1322
  try {
1246
- T = T(q);
1247
- } catch (C) {
1248
- F = C, $ = !0;
1323
+ T = T(Q);
1324
+ } catch (D) {
1325
+ I = D, q = !0;
1249
1326
  }
1250
- if (T && sn(T))
1251
- if (T = yield T.catch((C) => {
1252
- F = C, $ = !0;
1253
- }), b !== o[h][0]) {
1254
- if ($) throw F;
1327
+ if (T && on(T))
1328
+ if (T = yield T.catch((D) => {
1329
+ I = D, q = !0;
1330
+ }), C !== f[p][0]) {
1331
+ if (q) throw I;
1255
1332
  return T;
1256
- } else $ && K && _(F) && (u = !0, c({
1257
- data: q,
1333
+ } else q && ae && i(I) && (a = !0, d({
1334
+ data: Q,
1258
1335
  _c: V
1259
1336
  }));
1260
- if (u && !$)
1261
- if (ee(u)) {
1262
- const C = u(T, q);
1263
- c({
1264
- data: C,
1337
+ if (a && !q)
1338
+ if (Z(a)) {
1339
+ const D = a(T, Q);
1340
+ d({
1341
+ data: D,
1265
1342
  error: V,
1266
1343
  _c: V
1267
1344
  });
1268
1345
  } else
1269
- c({
1346
+ d({
1270
1347
  data: T,
1271
1348
  error: V,
1272
1349
  _c: V
1273
1350
  });
1274
- if (o[h][1] = vt(), Promise.resolve(N()).then(() => {
1275
- c({
1351
+ if (f[p][1] = _t(), Promise.resolve(M()).then(() => {
1352
+ d({
1276
1353
  _c: V
1277
1354
  });
1278
- }), $) {
1279
- if (w) throw F;
1355
+ }), q) {
1356
+ if (h) throw I;
1280
1357
  return;
1281
1358
  }
1282
1359
  return T;
@@ -1284,89 +1361,89 @@ function on(...e) {
1284
1361
  }
1285
1362
  });
1286
1363
  }
1287
- const Jt = (e, t) => {
1288
- for (const n in e)
1289
- e[n][0] && e[n][0](t);
1290
- }, Jn = (e, t) => {
1291
- if (!ie.has(e)) {
1292
- const n = he(Vn, t), r = /* @__PURE__ */ Object.create(null), s = on.bind(V, e);
1293
- let i = de;
1294
- const u = /* @__PURE__ */ Object.create(null), l = (w, m) => {
1295
- const E = u[w] || [];
1296
- return u[w] = E, E.push(m), () => E.splice(E.indexOf(m), 1);
1297
- }, d = (w, m, E) => {
1298
- e.set(w, m);
1299
- const h = u[w];
1300
- if (h)
1301
- for (const p of h)
1302
- p(m, E);
1303
- }, _ = () => {
1304
- if (!ie.has(e) && (ie.set(e, [
1364
+ const qt = (e, n) => {
1365
+ for (const t in e)
1366
+ e[t][0] && e[t][0](n);
1367
+ }, zn = (e, n) => {
1368
+ if (!oe.has(e)) {
1369
+ const t = de(qn, n), r = /* @__PURE__ */ Object.create(null), o = cn.bind(V, e);
1370
+ let u = fe;
1371
+ const a = /* @__PURE__ */ Object.create(null), l = (h, m) => {
1372
+ const v = a[h] || [];
1373
+ return a[h] = v, v.push(m), () => v.splice(v.indexOf(m), 1);
1374
+ }, s = (h, m, v) => {
1375
+ e.set(h, m);
1376
+ const p = a[h];
1377
+ if (p)
1378
+ for (const E of p)
1379
+ E(m, v);
1380
+ }, i = () => {
1381
+ if (!oe.has(e) && (oe.set(e, [
1305
1382
  r,
1306
1383
  /* @__PURE__ */ Object.create(null),
1307
1384
  /* @__PURE__ */ Object.create(null),
1308
1385
  /* @__PURE__ */ Object.create(null),
1386
+ o,
1309
1387
  s,
1310
- d,
1311
1388
  l
1312
- ]), !ke)) {
1313
- const w = n.initFocus(setTimeout.bind(V, Jt.bind(V, r, en))), m = n.initReconnect(setTimeout.bind(V, Jt.bind(V, r, tn)));
1314
- i = () => {
1315
- w && w(), m && m(), ie.delete(e);
1389
+ ]), !De)) {
1390
+ const h = t.initFocus(setTimeout.bind(V, qt.bind(V, r, nn))), m = t.initReconnect(setTimeout.bind(V, qt.bind(V, r, rn)));
1391
+ u = () => {
1392
+ h && h(), m && m(), oe.delete(e);
1316
1393
  };
1317
1394
  }
1318
1395
  };
1319
- return _(), [
1396
+ return i(), [
1320
1397
  e,
1321
- s,
1322
- _,
1323
- i
1398
+ o,
1399
+ i,
1400
+ u
1324
1401
  ];
1325
1402
  }
1326
1403
  return [
1327
1404
  e,
1328
- ie.get(e)[4]
1405
+ oe.get(e)[4]
1329
1406
  ];
1330
- }, Yn = (e, t, n, r, s) => {
1331
- const i = n.errorRetryCount, u = s.retryCount, l = ~~((Math.random() + 0.5) * (1 << (u < 8 ? u : 8))) * n.errorRetryInterval;
1332
- !R(i) && u > i || setTimeout(r, l, s);
1333
- }, Bn = ft, [an, Hn] = Jn(/* @__PURE__ */ new Map()), zn = he(
1407
+ }, Kn = (e, n, t, r, o) => {
1408
+ const u = t.errorRetryCount, a = o.retryCount, l = ~~((Math.random() + 0.5) * (1 << (a < 8 ? a : 8))) * t.errorRetryInterval;
1409
+ !y(u) && a > u || setTimeout(r, l, o);
1410
+ }, Xn = dt, [un, Zn] = zn(/* @__PURE__ */ new Map()), Qn = de(
1334
1411
  {
1335
1412
  // events
1336
- onLoadingSlow: de,
1337
- onSuccess: de,
1338
- onError: de,
1339
- onErrorRetry: Yn,
1340
- onDiscarded: de,
1413
+ onLoadingSlow: fe,
1414
+ onSuccess: fe,
1415
+ onError: fe,
1416
+ onErrorRetry: Kn,
1417
+ onDiscarded: fe,
1341
1418
  // switches
1342
1419
  revalidateOnFocus: !0,
1343
1420
  revalidateOnReconnect: !0,
1344
1421
  revalidateIfStale: !0,
1345
1422
  shouldRetryOnError: !0,
1346
1423
  // timeouts
1347
- errorRetryInterval: Gt ? 1e4 : 5e3,
1424
+ errorRetryInterval: Jt ? 1e4 : 5e3,
1348
1425
  focusThrottleInterval: 5 * 1e3,
1349
1426
  dedupingInterval: 2 * 1e3,
1350
- loadingTimeout: Gt ? 5e3 : 3e3,
1427
+ loadingTimeout: Jt ? 5e3 : 3e3,
1351
1428
  // providers
1352
- compare: Bn,
1429
+ compare: Xn,
1353
1430
  isPaused: () => !1,
1354
- cache: an,
1355
- mutate: Hn,
1431
+ cache: un,
1432
+ mutate: Zn,
1356
1433
  fallback: {}
1357
1434
  },
1358
1435
  // use web preset by default
1359
- Fn
1360
- ), Kn = (e, t) => {
1361
- const n = he(e, t);
1362
- if (t) {
1363
- const { use: r, fallback: s } = e, { use: i, fallback: u } = t;
1364
- r && i && (n.use = r.concat(i)), s && u && (n.fallback = he(s, u));
1436
+ Jn
1437
+ ), er = (e, n) => {
1438
+ const t = de(e, n);
1439
+ if (n) {
1440
+ const { use: r, fallback: o } = e, { use: u, fallback: a } = n;
1441
+ r && u && (t.use = r.concat(u)), o && a && (t.fallback = de(o, a));
1365
1442
  }
1366
- return n;
1367
- }, Xn = Bt({}), Zn = "$inf$", cn = De && window.__SWR_DEVTOOLS_USE__, Qn = cn ? window.__SWR_DEVTOOLS_USE__ : [], es = () => {
1368
- cn && (window.__SWR_DEVTOOLS_REACT__ = Oe);
1369
- }, ts = (e) => ee(e[1]) ? [
1443
+ return t;
1444
+ }, tr = Yt({}), nr = "$inf$", ln = je && window.__SWR_DEVTOOLS_USE__, rr = ln ? window.__SWR_DEVTOOLS_USE__ : [], sr = () => {
1445
+ ln && (window.__SWR_DEVTOOLS_REACT__ = be);
1446
+ }, or = (e) => Z(e[1]) ? [
1370
1447
  e[0],
1371
1448
  e[1],
1372
1449
  e[2] || {}
@@ -1374,33 +1451,33 @@ const Jt = (e, t) => {
1374
1451
  e[0],
1375
1452
  null,
1376
1453
  (e[1] === null ? e[2] : e[1]) || {}
1377
- ], ns = () => {
1378
- const e = zt(Xn);
1379
- return Kt(() => he(zn, e), [
1454
+ ], ar = () => {
1455
+ const e = Ht(tr);
1456
+ return zt(() => de(Qn, e), [
1380
1457
  e
1381
1458
  ]);
1382
- }, ss = (e) => (t, n, r) => e(t, n && ((...i) => {
1383
- const [u] = Rt(t), [, , , l] = ie.get(an);
1384
- if (u.startsWith(Zn))
1385
- return n(...i);
1386
- const d = l[u];
1387
- return R(d) ? n(...i) : (delete l[u], d);
1388
- }), r), rs = Qn.concat(ss), os = (e) => function(...n) {
1389
- const r = ns(), [s, i, u] = ts(n), l = Kn(r, u);
1390
- let d = e;
1391
- const { use: _ } = l, w = (_ || []).concat(rs);
1392
- for (let m = w.length; m--; )
1393
- d = w[m](d);
1394
- return d(s, i || l.fetcher || null, l);
1395
- }, as = (e, t, n) => {
1396
- const r = t[e] || (t[e] = []);
1397
- return r.push(n), () => {
1398
- const s = r.indexOf(n);
1399
- s >= 0 && (r[s] = r[r.length - 1], r.pop());
1459
+ }, ir = (e) => (n, t, r) => e(n, t && ((...u) => {
1460
+ const [a] = bt(n), [, , , l] = oe.get(un);
1461
+ if (a.startsWith(nr))
1462
+ return t(...u);
1463
+ const s = l[a];
1464
+ return y(s) ? t(...u) : (delete l[a], s);
1465
+ }), r), cr = rr.concat(ir), ur = (e) => function(...t) {
1466
+ const r = ar(), [o, u, a] = or(t), l = er(r, a);
1467
+ let s = e;
1468
+ const { use: i } = l, h = (i || []).concat(cr);
1469
+ for (let m = h.length; m--; )
1470
+ s = h[m](s);
1471
+ return s(o, u || l.fetcher || null, l);
1472
+ }, lr = (e, n, t) => {
1473
+ const r = n[e] || (n[e] = []);
1474
+ return r.push(t), () => {
1475
+ const o = r.indexOf(t);
1476
+ o >= 0 && (r[o] = r[r.length - 1], r.pop());
1400
1477
  };
1401
1478
  };
1402
- es();
1403
- const et = Oe.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
1479
+ sr();
1480
+ const tt = be.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
1404
1481
  // and emitting an error.
1405
1482
  // We assume that this is only for the `use(thenable)` case, not `use(context)`.
1406
1483
  // https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
@@ -1413,100 +1490,100 @@ const et = Oe.use || // This extra generic is to avoid TypeScript mixing up the
1413
1490
  case "rejected":
1414
1491
  throw e.reason;
1415
1492
  default:
1416
- throw e.status = "pending", e.then((t) => {
1417
- e.status = "fulfilled", e.value = t;
1418
- }, (t) => {
1419
- e.status = "rejected", e.reason = t;
1493
+ throw e.status = "pending", e.then((n) => {
1494
+ e.status = "fulfilled", e.value = n;
1495
+ }, (n) => {
1496
+ e.status = "rejected", e.reason = n;
1420
1497
  }), e;
1421
1498
  }
1422
- }), tt = {
1499
+ }), nt = {
1423
1500
  dedupe: !0
1424
- }, Yt = Promise.resolve(V), is = (e, t, n) => {
1425
- const { cache: r, compare: s, suspense: i, fallbackData: u, revalidateOnMount: l, revalidateIfStale: d, refreshInterval: _, refreshWhenHidden: w, refreshWhenOffline: m, keepPreviousData: E } = n, [h, p, c, f] = ie.get(r), [o, g] = Rt(e), k = le(!1), N = le(!1), T = le(o), F = le(t), $ = le(n), b = () => $.current, K = () => b().isVisible() && b().isOnline(), [U, B, Q, q] = rn(r, o), C = le({}).current, ce = R(u) ? R(n.fallback) ? V : n.fallback[o] : u, ye = (y, x) => {
1426
- for (const M in C) {
1427
- const A = M;
1501
+ }, Gt = Promise.resolve(V), fr = (e, n, t) => {
1502
+ const { cache: r, compare: o, suspense: u, fallbackData: a, revalidateOnMount: l, revalidateIfStale: s, refreshInterval: i, refreshWhenHidden: h, refreshWhenOffline: m, keepPreviousData: v } = t, [p, E, d, g] = oe.get(r), [f, w] = bt(e), O = ue(!1), M = ue(!1), T = ue(f), I = ue(n), q = ue(t), C = () => q.current, ae = () => C().isVisible() && C().isOnline(), [G, X, he, Q] = an(r, f), D = ue({}).current, ie = y(a) ? y(t.fallback) ? V : t.fallback[f] : a, Re = (R, N) => {
1503
+ for (const W in D) {
1504
+ const A = W;
1428
1505
  if (A === "data") {
1429
- if (!s(y[A], x[A]) && (!R(y[A]) || !s(G, x[A])))
1506
+ if (!o(R[A], N[A]) && (!y(R[A]) || !o($, N[A])))
1430
1507
  return !1;
1431
- } else if (x[A] !== y[A])
1508
+ } else if (N[A] !== R[A])
1432
1509
  return !1;
1433
1510
  }
1434
1511
  return !0;
1435
- }, be = Kt(() => {
1436
- const y = !o || !t ? !1 : R(l) ? b().isPaused() || i ? !1 : d !== !1 : l, x = (J) => {
1437
- const se = he(J);
1438
- return delete se._k, y ? D({
1512
+ }, Oe = zt(() => {
1513
+ const R = !f || !n ? !1 : y(l) ? C().isPaused() || u ? !1 : s !== !1 : l, N = (U) => {
1514
+ const ne = de(U);
1515
+ return delete ne._k, R ? k({
1439
1516
  isValidating: !0,
1440
1517
  isLoading: !0
1441
- }, se) : se;
1442
- }, M = U(), A = q(), X = x(M), ge = M === A ? X : x(A);
1443
- let W = X;
1518
+ }, ne) : ne;
1519
+ }, W = G(), A = Q(), z = N(W), ge = W === A ? z : N(A);
1520
+ let F = z;
1444
1521
  return [
1445
1522
  () => {
1446
- const J = x(U());
1447
- return ye(J, W) ? (W.data = J.data, W.isLoading = J.isLoading, W.isValidating = J.isValidating, W.error = J.error, W) : (W = J, J);
1523
+ const U = N(G());
1524
+ return Re(U, F) ? (F.data = U.data, F.isLoading = U.isLoading, F.isValidating = U.isValidating, F.error = U.error, F) : (F = U, U);
1448
1525
  },
1449
1526
  () => ge
1450
1527
  ];
1451
1528
  }, [
1452
1529
  r,
1453
- o
1454
- ]), te = In.useSyncExternalStore(Ve(
1455
- (y) => Q(o, (x, M) => {
1456
- ye(M, x) || y();
1530
+ f
1531
+ ]), ee = Mn.useSyncExternalStore($e(
1532
+ (R) => he(f, (N, W) => {
1533
+ Re(W, N) || R();
1457
1534
  }),
1458
1535
  // eslint-disable-next-line react-hooks/exhaustive-deps
1459
1536
  [
1460
1537
  r,
1461
- o
1538
+ f
1462
1539
  ]
1463
- ), be[0], be[1]), Te = !k.current, a = h[o] && h[o].length > 0, v = te.data, O = R(v) ? ce && sn(ce) ? et(ce) : ce : v, I = te.error, H = le(O), G = E ? R(v) ? R(H.current) ? O : H.current : v : O, Ee = a && !R(I) ? !1 : Te && !R(l) ? l : b().isPaused() ? !1 : i ? R(O) ? !1 : d : R(O) || d, me = !!(o && t && Te && Ee), P = R(te.isValidating) ? me : te.isValidating, ue = R(te.isLoading) ? me : te.isLoading, ne = Ve(
1464
- (y) => oe(null, null, function* () {
1465
- const x = F.current;
1466
- if (!o || !x || N.current || b().isPaused())
1540
+ ), Oe[0], Oe[1]), Te = !O.current, c = p[f] && p[f].length > 0, _ = ee.data, b = y(_) ? ie && on(ie) ? tt(ie) : ie : _, x = ee.error, Y = ue(b), $ = v ? y(_) ? y(Y.current) ? b : Y.current : _ : b, Ee = c && !y(x) ? !1 : Te && !y(l) ? l : C().isPaused() ? !1 : u ? y(b) ? !1 : s : y(b) || s, me = !!(f && n && Te && Ee), P = y(ee.isValidating) ? me : ee.isValidating, ce = y(ee.isLoading) ? me : ee.isLoading, te = $e(
1541
+ (R) => H(null, null, function* () {
1542
+ const N = I.current;
1543
+ if (!f || !N || M.current || C().isPaused())
1467
1544
  return !1;
1468
- let M, A, X = !0;
1469
- const ge = y || {}, W = !c[o] || !ge.dedupe, J = () => qt ? !N.current && o === T.current && k.current : o === T.current, se = {
1545
+ let W, A, z = !0;
1546
+ const ge = R || {}, F = !d[f] || !ge.dedupe, U = () => Ut ? !M.current && f === T.current && O.current : f === T.current, ne = {
1470
1547
  isValidating: !1,
1471
1548
  isLoading: !1
1549
+ }, Rt = () => {
1550
+ X(ne);
1472
1551
  }, Ot = () => {
1473
- B(se);
1474
- }, yt = () => {
1475
- const z = c[o];
1476
- z && z[1] === A && delete c[o];
1477
- }, bt = {
1552
+ const B = d[f];
1553
+ B && B[1] === A && delete d[f];
1554
+ }, Tt = {
1478
1555
  isValidating: !0
1479
1556
  };
1480
- R(U().data) && (bt.isLoading = !0);
1557
+ y(G().data) && (Tt.isLoading = !0);
1481
1558
  try {
1482
- if (W && (B(bt), n.loadingTimeout && R(U().data) && setTimeout(() => {
1483
- X && J() && b().onLoadingSlow(o, n);
1484
- }, n.loadingTimeout), c[o] = [
1485
- x(g),
1486
- vt()
1487
- ]), [M, A] = c[o], M = yield M, W && setTimeout(yt, n.dedupingInterval), !c[o] || c[o][1] !== A)
1488
- return W && J() && b().onDiscarded(o), !1;
1489
- se.error = V;
1490
- const z = p[o];
1491
- if (!R(z) && // case 1
1492
- (A <= z[0] || // case 2
1493
- A <= z[1] || // case 3
1494
- z[1] === 0))
1495
- return Ot(), W && J() && b().onDiscarded(o), !1;
1496
- const re = U().data;
1497
- se.data = s(re, M) ? re : M, W && J() && b().onSuccess(M, o, n);
1498
- } catch (z) {
1499
- yt();
1500
- const re = b(), { shouldRetryOnError: Ge } = re;
1501
- re.isPaused() || (se.error = z, W && J() && (re.onError(z, o, re), (Ge === !0 || ee(Ge) && Ge(z)) && (!b().revalidateOnFocus || !b().revalidateOnReconnect || K()) && re.onErrorRetry(z, o, re, (un) => {
1502
- const Je = h[o];
1503
- Je && Je[0] && Je[0]($t, un);
1559
+ if (F && (X(Tt), t.loadingTimeout && y(G().data) && setTimeout(() => {
1560
+ z && U() && C().onLoadingSlow(f, t);
1561
+ }, t.loadingTimeout), d[f] = [
1562
+ N(w),
1563
+ _t()
1564
+ ]), [W, A] = d[f], W = yield W, F && setTimeout(Ot, t.dedupingInterval), !d[f] || d[f][1] !== A)
1565
+ return F && U() && C().onDiscarded(f), !1;
1566
+ ne.error = V;
1567
+ const B = E[f];
1568
+ if (!y(B) && // case 1
1569
+ (A <= B[0] || // case 2
1570
+ A <= B[1] || // case 3
1571
+ B[1] === 0))
1572
+ return Rt(), F && U() && C().onDiscarded(f), !1;
1573
+ const re = G().data;
1574
+ ne.data = o(re, W) ? re : W, F && U() && C().onSuccess(W, f, t);
1575
+ } catch (B) {
1576
+ Ot();
1577
+ const re = C(), { shouldRetryOnError: qe } = re;
1578
+ re.isPaused() || (ne.error = B, F && U() && (re.onError(B, f, re), (qe === !0 || Z(qe) && qe(B)) && (!C().revalidateOnFocus || !C().revalidateOnReconnect || ae()) && re.onErrorRetry(B, f, re, (fn) => {
1579
+ const Ge = p[f];
1580
+ Ge && Ge[0] && Ge[0](Vt, fn);
1504
1581
  }, {
1505
1582
  retryCount: (ge.retryCount || 0) + 1,
1506
1583
  dedupe: !0
1507
1584
  })));
1508
1585
  }
1509
- return X = !1, Ot(), !0;
1586
+ return z = !1, Rt(), !0;
1510
1587
  }),
1511
1588
  // `setState` is immutable, and `eventsCallback`, `fnArg`, and
1512
1589
  // `keyValidating` are depending on `key`, so we can exclude them from
@@ -1520,94 +1597,94 @@ const et = Oe.use || // This extra generic is to avoid TypeScript mixing up the
1520
1597
  // even though it might cause unexpected behaviors.
1521
1598
  // eslint-disable-next-line react-hooks/exhaustive-deps
1522
1599
  [
1523
- o,
1600
+ f,
1524
1601
  r
1525
1602
  ]
1526
- ), je = Ve(
1603
+ ), Me = $e(
1527
1604
  // Use callback to make sure `keyRef.current` returns latest result every time
1528
- (...y) => on(r, T.current, ...y),
1605
+ (...R) => cn(r, T.current, ...R),
1529
1606
  // eslint-disable-next-line react-hooks/exhaustive-deps
1530
1607
  []
1531
1608
  );
1532
- if (Xe(() => {
1533
- F.current = t, $.current = n, R(v) || (H.current = v);
1534
- }), Xe(() => {
1535
- if (!o) return;
1536
- const y = ne.bind(V, tt);
1537
- let x = 0;
1538
- b().revalidateOnFocus && (x = Date.now() + b().focusThrottleInterval);
1539
- const A = as(o, h, (X, ge = {}) => {
1540
- if (X == en) {
1541
- const W = Date.now();
1542
- b().revalidateOnFocus && W > x && K() && (x = W + b().focusThrottleInterval, y());
1543
- } else if (X == tn)
1544
- b().revalidateOnReconnect && K() && y();
1609
+ if (Ze(() => {
1610
+ I.current = n, q.current = t, y(_) || (Y.current = _);
1611
+ }), Ze(() => {
1612
+ if (!f) return;
1613
+ const R = te.bind(V, nt);
1614
+ let N = 0;
1615
+ C().revalidateOnFocus && (N = Date.now() + C().focusThrottleInterval);
1616
+ const A = lr(f, p, (z, ge = {}) => {
1617
+ if (z == nn) {
1618
+ const F = Date.now();
1619
+ C().revalidateOnFocus && F > N && ae() && (N = F + C().focusThrottleInterval, R());
1620
+ } else if (z == rn)
1621
+ C().revalidateOnReconnect && ae() && R();
1545
1622
  else {
1546
- if (X == nn)
1547
- return ne();
1548
- if (X == $t)
1549
- return ne(ge);
1623
+ if (z == sn)
1624
+ return te();
1625
+ if (z == Vt)
1626
+ return te(ge);
1550
1627
  }
1551
1628
  });
1552
- return N.current = !1, T.current = o, k.current = !0, B({
1553
- _k: g
1554
- }), Ee && (c[o] || (R(O) || ke ? y() : $n(y))), () => {
1555
- N.current = !0, A();
1629
+ return M.current = !1, T.current = f, O.current = !0, X({
1630
+ _k: w
1631
+ }), Ee && (d[f] || (y(b) || De ? R() : Gn(R))), () => {
1632
+ M.current = !0, A();
1556
1633
  };
1557
1634
  }, [
1558
- o
1559
- ]), Xe(() => {
1560
- let y;
1561
- function x() {
1562
- const A = ee(_) ? _(U().data) : _;
1563
- A && y !== -1 && (y = setTimeout(M, A));
1635
+ f
1636
+ ]), Ze(() => {
1637
+ let R;
1638
+ function N() {
1639
+ const A = Z(i) ? i(G().data) : i;
1640
+ A && R !== -1 && (R = setTimeout(W, A));
1564
1641
  }
1565
- function M() {
1566
- !U().error && (w || b().isVisible()) && (m || b().isOnline()) ? ne(tt).then(x) : x();
1642
+ function W() {
1643
+ !G().error && (h || C().isVisible()) && (m || C().isOnline()) ? te(nt).then(N) : N();
1567
1644
  }
1568
- return x(), () => {
1569
- y && (clearTimeout(y), y = -1);
1645
+ return N(), () => {
1646
+ R && (clearTimeout(R), R = -1);
1570
1647
  };
1571
1648
  }, [
1572
- _,
1573
- w,
1649
+ i,
1650
+ h,
1574
1651
  m,
1575
- o
1576
- ]), mn(G), i) {
1577
- const y = o && R(O);
1578
- if (!qt && ke && y)
1652
+ f
1653
+ ]), vn($), u) {
1654
+ const R = f && y(b);
1655
+ if (!Ut && De && R)
1579
1656
  throw new Error("Fallback data is required when using Suspense in SSR.");
1580
- y && (F.current = t, $.current = n, N.current = !1);
1581
- const x = f[o], M = !R(x) && y ? je(x) : Yt;
1582
- if (et(M), !R(I) && y)
1583
- throw I;
1584
- const A = y ? ne(tt) : Yt;
1585
- !R(G) && y && (A.status = "fulfilled", A.value = !0), et(A);
1657
+ R && (I.current = n, q.current = t, M.current = !1);
1658
+ const N = g[f], W = !y(N) && R ? Me(N) : Gt;
1659
+ if (tt(W), !y(x) && R)
1660
+ throw x;
1661
+ const A = R ? te(nt) : Gt;
1662
+ !y($) && R && (A.status = "fulfilled", A.value = !0), tt(A);
1586
1663
  }
1587
1664
  return {
1588
- mutate: je,
1665
+ mutate: Me,
1589
1666
  get data() {
1590
- return C.data = !0, G;
1667
+ return D.data = !0, $;
1591
1668
  },
1592
1669
  get error() {
1593
- return C.error = !0, I;
1670
+ return D.error = !0, x;
1594
1671
  },
1595
1672
  get isValidating() {
1596
- return C.isValidating = !0, P;
1673
+ return D.isValidating = !0, P;
1597
1674
  },
1598
1675
  get isLoading() {
1599
- return C.isLoading = !0, ue;
1676
+ return D.isLoading = !0, ce;
1600
1677
  }
1601
1678
  };
1602
- }, cs = os(is), Es = ({
1679
+ }, dr = ur(fr), _r = ({
1603
1680
  fileKey: e,
1604
- authToken: t,
1605
- enabled: n = !0,
1681
+ authToken: n,
1682
+ enabled: t = !0,
1606
1683
  params: r = {}
1607
1684
  }) => {
1608
- const { figmaRestApi: s } = An(), i = !!(n && e && t), { data: u, isLoading: l, error: d } = cs(
1609
- ["useFigmaFile", e, t, r],
1610
- () => i ? s.withOptions(t ? { token: t } : {}).getFile({
1685
+ const { figmaRestApi: o } = kn(), u = !!(t && e && n), { data: a, isLoading: l, error: s } = dr(
1686
+ ["useFigmaFile", e, n, r],
1687
+ () => u ? o.withOptions(n ? { token: n } : {}).getFile({
1611
1688
  fileKey: e,
1612
1689
  depth: r.depth
1613
1690
  }) : null,
@@ -1618,18 +1695,19 @@ const et = Oe.use || // This extra generic is to avoid TypeScript mixing up the
1618
1695
  }
1619
1696
  );
1620
1697
  return {
1621
- data: u != null ? u : null,
1698
+ data: a != null ? a : null,
1622
1699
  isLoading: l,
1623
- error: d
1700
+ error: s
1624
1701
  };
1625
1702
  };
1626
1703
  export {
1627
- Qt as AnimaSdkContext,
1628
- hs as AnimaSdkProvider,
1629
- Tn as CreateJobError,
1630
- Cn as UnknownCodegenError,
1631
- ps as useAnimaCodegen,
1632
- An as useAnimaSDK,
1633
- Es as useFigmaFile
1704
+ tn as AnimaSdkContext,
1705
+ gr as AnimaSdkProvider,
1706
+ Nn as AttachJobError,
1707
+ Ln as CreateJobError,
1708
+ xn as UnknownCodegenError,
1709
+ vr as useAnimaCodegen,
1710
+ kn as useAnimaSDK,
1711
+ _r as useFigmaFile
1634
1712
  };
1635
1713
  //# sourceMappingURL=index.js.map