superleap-code-editor 1.0.4 → 1.0.5

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.esm.js CHANGED
@@ -1,9 +1,9 @@
1
- import ne, { useState as $, useCallback as D, useEffect as Oe } from "react";
2
- import xr from "@monaco-editor/react";
3
- import { Tooltip as Pe, Button as te, Splitter as k, Alert as br, Tree as Er } from "antd";
4
- import { Alert as tt, Button as nt, Splitter as it, Tooltip as at, Tree as ot } from "antd";
5
- import { IconFolderOpen as De, IconDatabase as jr, IconCode as Fr, IconHistory as Ae, IconFlask as Rr, IconSettings as wr, IconPlus as _r, IconFile as Cr, IconEyeOff as Tr, IconEye as Sr, IconPlayerPlay as Or, IconDownload as Pr, IconDeviceFloppy as kr } from "@tabler/icons-react";
6
- var q = { exports: {} }, L = {};
1
+ import ne, { useState as I, useCallback as A, useEffect as Te, useMemo as Nt } from "react";
2
+ import Ct from "@monaco-editor/react";
3
+ import { Tooltip as Pe, Button as re, Splitter as O, Alert as Rt, Tree as Ft } from "antd";
4
+ import { Alert as br, Button as yr, Splitter as jr, Tooltip as wr, Tree as Er } from "antd";
5
+ import { IconFolderOpen as De, IconDatabase as Ae, IconCode as ze, IconHistory as $e, IconFlask as _t, IconSettings as Le, IconPlus as St, IconFile as Tt, IconEyeOff as Pt, IconEye as Ot, IconPlayerPlay as Me, IconDownload as It, IconDeviceFloppy as kt, IconSearch as Be, IconChevronRight as Dt, IconBook as At, IconRefresh as zt, IconAlertTriangle as $t, IconCircleCheck as Lt, IconCircleX as Mt, IconUser as Bt, IconClock as Wt, IconRotate as Vt } from "@tabler/icons-react";
6
+ var q = { exports: {} }, $ = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.min.js
@@ -13,21 +13,21 @@ var q = { exports: {} }, L = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var ke;
17
- function Nr() {
18
- if (ke) return L;
19
- ke = 1;
20
- var s = ne, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, d = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, b = { key: !0, ref: !0, __self: !0, __source: !0 };
21
- function E(j, p, _) {
22
- var u, F = {}, R = null, S = null;
23
- _ !== void 0 && (R = "" + _), p.key !== void 0 && (R = "" + p.key), p.ref !== void 0 && (S = p.ref);
24
- for (u in p) a.call(p, u) && !b.hasOwnProperty(u) && (F[u] = p[u]);
25
- if (j && j.defaultProps) for (u in p = j.defaultProps, p) F[u] === void 0 && (F[u] = p[u]);
26
- return { $$typeof: t, type: j, key: R, ref: S, props: F, _owner: d.current };
16
+ var Oe;
17
+ function Yt() {
18
+ if (Oe) return $;
19
+ Oe = 1;
20
+ var o = ne, r = Symbol.for("react.element"), s = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, c = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
21
+ function j(w, x, N) {
22
+ var d, E = {}, C = null, S = null;
23
+ N !== void 0 && (C = "" + N), x.key !== void 0 && (C = "" + x.key), x.ref !== void 0 && (S = x.ref);
24
+ for (d in x) i.call(x, d) && !g.hasOwnProperty(d) && (E[d] = x[d]);
25
+ if (w && w.defaultProps) for (d in x = w.defaultProps, x) E[d] === void 0 && (E[d] = x[d]);
26
+ return { $$typeof: r, type: w, key: C, ref: S, props: E, _owner: c.current };
27
27
  }
28
- return L.Fragment = i, L.jsx = E, L.jsxs = E, L;
28
+ return $.Fragment = s, $.jsx = j, $.jsxs = j, $;
29
29
  }
30
- var z = {};
30
+ var L = {};
31
31
  /**
32
32
  * @license React
33
33
  * react-jsx-runtime.development.js
@@ -37,54 +37,54 @@ var z = {};
37
37
  * This source code is licensed under the MIT license found in the
38
38
  * LICENSE file in the root directory of this source tree.
39
39
  */
40
- var Ne;
41
- function Ir() {
42
- return Ne || (Ne = 1, process.env.NODE_ENV !== "production" && (function() {
43
- var s = ne, t = Symbol.for("react.element"), i = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), E = Symbol.for("react.provider"), j = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), W = Symbol.iterator, J = "@@iterator";
44
- function H(e) {
40
+ var Ie;
41
+ function Ut() {
42
+ return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && (function() {
43
+ var o = ne, r = Symbol.for("react.element"), s = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), w = Symbol.for("react.context"), x = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), M = Symbol.iterator, H = "@@iterator";
44
+ function J(e) {
45
45
  if (e === null || typeof e != "object")
46
46
  return null;
47
- var r = W && e[W] || e[J];
48
- return typeof r == "function" ? r : null;
47
+ var n = M && e[M] || e[H];
48
+ return typeof n == "function" ? n : null;
49
49
  }
50
- var g = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
50
+ var v = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
51
  function h(e) {
52
52
  {
53
- for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), l = 1; l < r; l++)
54
- n[l - 1] = arguments[l];
55
- We("error", e, n);
53
+ for (var n = arguments.length, a = new Array(n > 1 ? n - 1 : 0), l = 1; l < n; l++)
54
+ a[l - 1] = arguments[l];
55
+ Ue("error", e, a);
56
56
  }
57
57
  }
58
- function We(e, r, n) {
58
+ function Ue(e, n, a) {
59
59
  {
60
- var l = g.ReactDebugCurrentFrame, v = l.getStackAddendum();
61
- v !== "" && (r += "%s", n = n.concat([v]));
62
- var m = n.map(function(f) {
60
+ var l = v.ReactDebugCurrentFrame, m = l.getStackAddendum();
61
+ m !== "" && (n += "%s", a = a.concat([m]));
62
+ var p = a.map(function(f) {
63
63
  return String(f);
64
64
  });
65
- m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m);
65
+ p.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, p);
66
66
  }
67
67
  }
68
- var Me = !1, Be = !1, Ye = !1, Ve = !1, Ue = !1, ae;
68
+ var qe = !1, He = !1, Je = !1, Ge = !1, Ke = !1, ae;
69
69
  ae = Symbol.for("react.module.reference");
70
- function qe(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === a || e === b || Ue || e === d || e === _ || e === u || Ve || e === S || Me || Be || Ye || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === F || e.$$typeof === E || e.$$typeof === j || e.$$typeof === p || // This needs to include all possible module reference object
70
+ function Xe(e) {
71
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === g || Ke || e === c || e === N || e === d || Ge || e === S || qe || He || Je || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === E || e.$$typeof === j || e.$$typeof === w || e.$$typeof === x || // This needs to include all possible module reference object
72
72
  // types supported by any Flight configuration anywhere since
73
73
  // we don't know which Flight build this will end up being used
74
74
  // with.
75
75
  e.$$typeof === ae || e.getModuleId !== void 0));
76
76
  }
77
- function Je(e, r, n) {
77
+ function Ze(e, n, a) {
78
78
  var l = e.displayName;
79
79
  if (l)
80
80
  return l;
81
- var v = r.displayName || r.name || "";
82
- return v !== "" ? n + "(" + v + ")" : n;
81
+ var m = n.displayName || n.name || "";
82
+ return m !== "" ? a + "(" + m + ")" : a;
83
83
  }
84
- function oe(e) {
84
+ function ie(e) {
85
85
  return e.displayName || "Context";
86
86
  }
87
- function O(e) {
87
+ function T(e) {
88
88
  if (e == null)
89
89
  return null;
90
90
  if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
@@ -92,36 +92,36 @@ function Ir() {
92
92
  if (typeof e == "string")
93
93
  return e;
94
94
  switch (e) {
95
- case a:
96
- return "Fragment";
97
95
  case i:
96
+ return "Fragment";
97
+ case s:
98
98
  return "Portal";
99
- case b:
99
+ case g:
100
100
  return "Profiler";
101
- case d:
101
+ case c:
102
102
  return "StrictMode";
103
- case _:
103
+ case N:
104
104
  return "Suspense";
105
- case u:
105
+ case d:
106
106
  return "SuspenseList";
107
107
  }
108
108
  if (typeof e == "object")
109
109
  switch (e.$$typeof) {
110
+ case w:
111
+ var n = e;
112
+ return ie(n) + ".Consumer";
110
113
  case j:
111
- var r = e;
112
- return oe(r) + ".Consumer";
114
+ var a = e;
115
+ return ie(a._context) + ".Provider";
116
+ case x:
117
+ return Ze(e, e.render, "ForwardRef");
113
118
  case E:
114
- var n = e;
115
- return oe(n._context) + ".Provider";
116
- case p:
117
- return Je(e, e.render, "ForwardRef");
118
- case F:
119
119
  var l = e.displayName || null;
120
- return l !== null ? l : O(e.type) || "Memo";
121
- case R: {
122
- var v = e, m = v._payload, f = v._init;
120
+ return l !== null ? l : T(e.type) || "Memo";
121
+ case C: {
122
+ var m = e, p = m._payload, f = m._init;
123
123
  try {
124
- return O(f(m));
124
+ return T(f(p));
125
125
  } catch {
126
126
  return null;
127
127
  }
@@ -129,14 +129,14 @@ function Ir() {
129
129
  }
130
130
  return null;
131
131
  }
132
- var P = Object.assign, A = 0, se, le, ce, ue, fe, de, ve;
132
+ var P = Object.assign, z = 0, oe, le, ce, de, ue, fe, me;
133
133
  function he() {
134
134
  }
135
135
  he.__reactDisabledLog = !0;
136
- function He() {
136
+ function Qe() {
137
137
  {
138
- if (A === 0) {
139
- se = console.log, le = console.info, ce = console.warn, ue = console.error, fe = console.group, de = console.groupCollapsed, ve = console.groupEnd;
138
+ if (z === 0) {
139
+ oe = console.log, le = console.info, ce = console.warn, de = console.error, ue = console.group, fe = console.groupCollapsed, me = console.groupEnd;
140
140
  var e = {
141
141
  configurable: !0,
142
142
  enumerable: !0,
@@ -153,12 +153,12 @@ function Ir() {
153
153
  groupEnd: e
154
154
  });
155
155
  }
156
- A++;
156
+ z++;
157
157
  }
158
158
  }
159
- function Ge() {
159
+ function et() {
160
160
  {
161
- if (A--, A === 0) {
161
+ if (z--, z === 0) {
162
162
  var e = {
163
163
  configurable: !0,
164
164
  enumerable: !0,
@@ -166,7 +166,7 @@ function Ir() {
166
166
  };
167
167
  Object.defineProperties(console, {
168
168
  log: P({}, e, {
169
- value: se
169
+ value: oe
170
170
  }),
171
171
  info: P({}, e, {
172
172
  value: le
@@ -175,57 +175,57 @@ function Ir() {
175
175
  value: ce
176
176
  }),
177
177
  error: P({}, e, {
178
- value: ue
178
+ value: de
179
179
  }),
180
180
  group: P({}, e, {
181
- value: fe
181
+ value: ue
182
182
  }),
183
183
  groupCollapsed: P({}, e, {
184
- value: de
184
+ value: fe
185
185
  }),
186
186
  groupEnd: P({}, e, {
187
- value: ve
187
+ value: me
188
188
  })
189
189
  });
190
190
  }
191
- A < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
+ z < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
192
  }
193
193
  }
194
- var G = g.ReactCurrentDispatcher, K;
195
- function M(e, r, n) {
194
+ var G = v.ReactCurrentDispatcher, K;
195
+ function B(e, n, a) {
196
196
  {
197
197
  if (K === void 0)
198
198
  try {
199
199
  throw Error();
200
- } catch (v) {
201
- var l = v.stack.trim().match(/\n( *(at )?)/);
200
+ } catch (m) {
201
+ var l = m.stack.trim().match(/\n( *(at )?)/);
202
202
  K = l && l[1] || "";
203
203
  }
204
204
  return `
205
205
  ` + K + e;
206
206
  }
207
207
  }
208
- var X = !1, B;
208
+ var X = !1, W;
209
209
  {
210
- var Ke = typeof WeakMap == "function" ? WeakMap : Map;
211
- B = new Ke();
210
+ var tt = typeof WeakMap == "function" ? WeakMap : Map;
211
+ W = new tt();
212
212
  }
213
- function me(e, r) {
213
+ function pe(e, n) {
214
214
  if (!e || X)
215
215
  return "";
216
216
  {
217
- var n = B.get(e);
218
- if (n !== void 0)
219
- return n;
217
+ var a = W.get(e);
218
+ if (a !== void 0)
219
+ return a;
220
220
  }
221
221
  var l;
222
222
  X = !0;
223
- var v = Error.prepareStackTrace;
223
+ var m = Error.prepareStackTrace;
224
224
  Error.prepareStackTrace = void 0;
225
- var m;
226
- m = G.current, G.current = null, He();
225
+ var p;
226
+ p = G.current, G.current = null, Qe();
227
227
  try {
228
- if (r) {
228
+ if (n) {
229
229
  var f = function() {
230
230
  throw Error();
231
231
  };
@@ -236,249 +236,249 @@ function Ir() {
236
236
  }), typeof Reflect == "object" && Reflect.construct) {
237
237
  try {
238
238
  Reflect.construct(f, []);
239
- } catch (T) {
240
- l = T;
239
+ } catch (_) {
240
+ l = _;
241
241
  }
242
242
  Reflect.construct(e, [], f);
243
243
  } else {
244
244
  try {
245
245
  f.call();
246
- } catch (T) {
247
- l = T;
246
+ } catch (_) {
247
+ l = _;
248
248
  }
249
249
  e.call(f.prototype);
250
250
  }
251
251
  } else {
252
252
  try {
253
253
  throw Error();
254
- } catch (T) {
255
- l = T;
254
+ } catch (_) {
255
+ l = _;
256
256
  }
257
257
  e();
258
258
  }
259
- } catch (T) {
260
- if (T && l && typeof T.stack == "string") {
261
- for (var c = T.stack.split(`
262
- `), w = l.stack.split(`
263
- `), y = c.length - 1, x = w.length - 1; y >= 1 && x >= 0 && c[y] !== w[x]; )
264
- x--;
265
- for (; y >= 1 && x >= 0; y--, x--)
266
- if (c[y] !== w[x]) {
267
- if (y !== 1 || x !== 1)
259
+ } catch (_) {
260
+ if (_ && l && typeof _.stack == "string") {
261
+ for (var u = _.stack.split(`
262
+ `), R = l.stack.split(`
263
+ `), b = u.length - 1, y = R.length - 1; b >= 1 && y >= 0 && u[b] !== R[y]; )
264
+ y--;
265
+ for (; b >= 1 && y >= 0; b--, y--)
266
+ if (u[b] !== R[y]) {
267
+ if (b !== 1 || y !== 1)
268
268
  do
269
- if (y--, x--, x < 0 || c[y] !== w[x]) {
270
- var C = `
271
- ` + c[y].replace(" at new ", " at ");
272
- return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && B.set(e, C), C;
269
+ if (b--, y--, y < 0 || u[b] !== R[y]) {
270
+ var F = `
271
+ ` + u[b].replace(" at new ", " at ");
272
+ return e.displayName && F.includes("<anonymous>") && (F = F.replace("<anonymous>", e.displayName)), typeof e == "function" && W.set(e, F), F;
273
273
  }
274
- while (y >= 1 && x >= 0);
274
+ while (b >= 1 && y >= 0);
275
275
  break;
276
276
  }
277
277
  }
278
278
  } finally {
279
- X = !1, G.current = m, Ge(), Error.prepareStackTrace = v;
279
+ X = !1, G.current = p, et(), Error.prepareStackTrace = m;
280
280
  }
281
- var I = e ? e.displayName || e.name : "", Se = I ? M(I) : "";
282
- return typeof e == "function" && B.set(e, Se), Se;
281
+ var D = e ? e.displayName || e.name : "", Se = D ? B(D) : "";
282
+ return typeof e == "function" && W.set(e, Se), Se;
283
283
  }
284
- function Xe(e, r, n) {
285
- return me(e, !1);
284
+ function rt(e, n, a) {
285
+ return pe(e, !1);
286
286
  }
287
- function Ze(e) {
288
- var r = e.prototype;
289
- return !!(r && r.isReactComponent);
287
+ function nt(e) {
288
+ var n = e.prototype;
289
+ return !!(n && n.isReactComponent);
290
290
  }
291
- function Y(e, r, n) {
291
+ function V(e, n, a) {
292
292
  if (e == null)
293
293
  return "";
294
294
  if (typeof e == "function")
295
- return me(e, Ze(e));
295
+ return pe(e, nt(e));
296
296
  if (typeof e == "string")
297
- return M(e);
297
+ return B(e);
298
298
  switch (e) {
299
- case _:
300
- return M("Suspense");
301
- case u:
302
- return M("SuspenseList");
299
+ case N:
300
+ return B("Suspense");
301
+ case d:
302
+ return B("SuspenseList");
303
303
  }
304
304
  if (typeof e == "object")
305
305
  switch (e.$$typeof) {
306
- case p:
307
- return Xe(e.render);
308
- case F:
309
- return Y(e.type, r, n);
310
- case R: {
311
- var l = e, v = l._payload, m = l._init;
306
+ case x:
307
+ return rt(e.render);
308
+ case E:
309
+ return V(e.type, n, a);
310
+ case C: {
311
+ var l = e, m = l._payload, p = l._init;
312
312
  try {
313
- return Y(m(v), r, n);
313
+ return V(p(m), n, a);
314
314
  } catch {
315
315
  }
316
316
  }
317
317
  }
318
318
  return "";
319
319
  }
320
- var V = Object.prototype.hasOwnProperty, pe = {}, ge = g.ReactDebugCurrentFrame;
320
+ var Y = Object.prototype.hasOwnProperty, xe = {}, ve = v.ReactDebugCurrentFrame;
321
321
  function U(e) {
322
322
  if (e) {
323
- var r = e._owner, n = Y(e.type, e._source, r ? r.type : null);
324
- ge.setExtraStackFrame(n);
323
+ var n = e._owner, a = V(e.type, e._source, n ? n.type : null);
324
+ ve.setExtraStackFrame(a);
325
325
  } else
326
- ge.setExtraStackFrame(null);
326
+ ve.setExtraStackFrame(null);
327
327
  }
328
- function Qe(e, r, n, l, v) {
328
+ function st(e, n, a, l, m) {
329
329
  {
330
- var m = Function.call.bind(V);
330
+ var p = Function.call.bind(Y);
331
331
  for (var f in e)
332
- if (m(e, f)) {
333
- var c = void 0;
332
+ if (p(e, f)) {
333
+ var u = void 0;
334
334
  try {
335
335
  if (typeof e[f] != "function") {
336
- var w = Error((l || "React class") + ": " + n + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
- throw w.name = "Invariant Violation", w;
336
+ var R = Error((l || "React class") + ": " + a + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw R.name = "Invariant Violation", R;
338
338
  }
339
- c = e[f](r, f, l, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (y) {
341
- c = y;
339
+ u = e[f](n, f, l, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (b) {
341
+ u = b;
342
342
  }
343
- c && !(c instanceof Error) && (U(v), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", l || "React class", n, f, typeof c), U(null)), c instanceof Error && !(c.message in pe) && (pe[c.message] = !0, U(v), h("Failed %s type: %s", n, c.message), U(null));
343
+ u && !(u instanceof Error) && (U(m), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", l || "React class", a, f, typeof u), U(null)), u instanceof Error && !(u.message in xe) && (xe[u.message] = !0, U(m), h("Failed %s type: %s", a, u.message), U(null));
344
344
  }
345
345
  }
346
346
  }
347
- var er = Array.isArray;
347
+ var at = Array.isArray;
348
348
  function Z(e) {
349
- return er(e);
349
+ return at(e);
350
350
  }
351
- function rr(e) {
351
+ function it(e) {
352
352
  {
353
- var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
- return n;
353
+ var n = typeof Symbol == "function" && Symbol.toStringTag, a = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
+ return a;
355
355
  }
356
356
  }
357
- function tr(e) {
357
+ function ot(e) {
358
358
  try {
359
- return ye(e), !1;
359
+ return ge(e), !1;
360
360
  } catch {
361
361
  return !0;
362
362
  }
363
363
  }
364
- function ye(e) {
364
+ function ge(e) {
365
365
  return "" + e;
366
366
  }
367
- function xe(e) {
368
- if (tr(e))
369
- return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rr(e)), ye(e);
367
+ function be(e) {
368
+ if (ot(e))
369
+ return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", it(e)), ge(e);
370
370
  }
371
- var be = g.ReactCurrentOwner, nr = {
371
+ var ye = v.ReactCurrentOwner, lt = {
372
372
  key: !0,
373
373
  ref: !0,
374
374
  __self: !0,
375
375
  __source: !0
376
- }, Ee, je;
377
- function ir(e) {
378
- if (V.call(e, "ref")) {
379
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
380
- if (r && r.isReactWarning)
376
+ }, je, we;
377
+ function ct(e) {
378
+ if (Y.call(e, "ref")) {
379
+ var n = Object.getOwnPropertyDescriptor(e, "ref").get;
380
+ if (n && n.isReactWarning)
381
381
  return !1;
382
382
  }
383
383
  return e.ref !== void 0;
384
384
  }
385
- function ar(e) {
386
- if (V.call(e, "key")) {
387
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
388
- if (r && r.isReactWarning)
385
+ function dt(e) {
386
+ if (Y.call(e, "key")) {
387
+ var n = Object.getOwnPropertyDescriptor(e, "key").get;
388
+ if (n && n.isReactWarning)
389
389
  return !1;
390
390
  }
391
391
  return e.key !== void 0;
392
392
  }
393
- function or(e, r) {
394
- typeof e.ref == "string" && be.current;
393
+ function ut(e, n) {
394
+ typeof e.ref == "string" && ye.current;
395
395
  }
396
- function sr(e, r) {
396
+ function ft(e, n) {
397
397
  {
398
- var n = function() {
399
- Ee || (Ee = !0, h("%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://reactjs.org/link/special-props)", r));
398
+ var a = function() {
399
+ je || (je = !0, h("%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://reactjs.org/link/special-props)", n));
400
400
  };
401
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
402
- get: n,
401
+ a.isReactWarning = !0, Object.defineProperty(e, "key", {
402
+ get: a,
403
403
  configurable: !0
404
404
  });
405
405
  }
406
406
  }
407
- function lr(e, r) {
407
+ function mt(e, n) {
408
408
  {
409
- var n = function() {
410
- je || (je = !0, h("%s: `ref` 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://reactjs.org/link/special-props)", r));
409
+ var a = function() {
410
+ we || (we = !0, h("%s: `ref` 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://reactjs.org/link/special-props)", n));
411
411
  };
412
- n.isReactWarning = !0, Object.defineProperty(e, "ref", {
413
- get: n,
412
+ a.isReactWarning = !0, Object.defineProperty(e, "ref", {
413
+ get: a,
414
414
  configurable: !0
415
415
  });
416
416
  }
417
417
  }
418
- var cr = function(e, r, n, l, v, m, f) {
419
- var c = {
418
+ var ht = function(e, n, a, l, m, p, f) {
419
+ var u = {
420
420
  // This tag allows us to uniquely identify this as a React Element
421
- $$typeof: t,
421
+ $$typeof: r,
422
422
  // Built-in properties that belong on the element
423
423
  type: e,
424
- key: r,
425
- ref: n,
424
+ key: n,
425
+ ref: a,
426
426
  props: f,
427
427
  // Record the component responsible for creating this element.
428
- _owner: m
428
+ _owner: p
429
429
  };
430
- return c._store = {}, Object.defineProperty(c._store, "validated", {
430
+ return u._store = {}, Object.defineProperty(u._store, "validated", {
431
431
  configurable: !1,
432
432
  enumerable: !1,
433
433
  writable: !0,
434
434
  value: !1
435
- }), Object.defineProperty(c, "_self", {
435
+ }), Object.defineProperty(u, "_self", {
436
436
  configurable: !1,
437
437
  enumerable: !1,
438
438
  writable: !1,
439
439
  value: l
440
- }), Object.defineProperty(c, "_source", {
440
+ }), Object.defineProperty(u, "_source", {
441
441
  configurable: !1,
442
442
  enumerable: !1,
443
443
  writable: !1,
444
- value: v
445
- }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
444
+ value: m
445
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
446
446
  };
447
- function ur(e, r, n, l, v) {
447
+ function pt(e, n, a, l, m) {
448
448
  {
449
- var m, f = {}, c = null, w = null;
450
- n !== void 0 && (xe(n), c = "" + n), ar(r) && (xe(r.key), c = "" + r.key), ir(r) && (w = r.ref, or(r, v));
451
- for (m in r)
452
- V.call(r, m) && !nr.hasOwnProperty(m) && (f[m] = r[m]);
449
+ var p, f = {}, u = null, R = null;
450
+ a !== void 0 && (be(a), u = "" + a), dt(n) && (be(n.key), u = "" + n.key), ct(n) && (R = n.ref, ut(n, m));
451
+ for (p in n)
452
+ Y.call(n, p) && !lt.hasOwnProperty(p) && (f[p] = n[p]);
453
453
  if (e && e.defaultProps) {
454
- var y = e.defaultProps;
455
- for (m in y)
456
- f[m] === void 0 && (f[m] = y[m]);
454
+ var b = e.defaultProps;
455
+ for (p in b)
456
+ f[p] === void 0 && (f[p] = b[p]);
457
457
  }
458
- if (c || w) {
459
- var x = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
460
- c && sr(f, x), w && lr(f, x);
458
+ if (u || R) {
459
+ var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
460
+ u && ft(f, y), R && mt(f, y);
461
461
  }
462
- return cr(e, c, w, v, l, be.current, f);
462
+ return ht(e, u, R, m, l, ye.current, f);
463
463
  }
464
464
  }
465
- var Q = g.ReactCurrentOwner, Fe = g.ReactDebugCurrentFrame;
466
- function N(e) {
465
+ var Q = v.ReactCurrentOwner, Ee = v.ReactDebugCurrentFrame;
466
+ function k(e) {
467
467
  if (e) {
468
- var r = e._owner, n = Y(e.type, e._source, r ? r.type : null);
469
- Fe.setExtraStackFrame(n);
468
+ var n = e._owner, a = V(e.type, e._source, n ? n.type : null);
469
+ Ee.setExtraStackFrame(a);
470
470
  } else
471
- Fe.setExtraStackFrame(null);
471
+ Ee.setExtraStackFrame(null);
472
472
  }
473
473
  var ee;
474
474
  ee = !1;
475
- function re(e) {
476
- return typeof e == "object" && e !== null && e.$$typeof === t;
475
+ function te(e) {
476
+ return typeof e == "object" && e !== null && e.$$typeof === r;
477
477
  }
478
- function Re() {
478
+ function Ne() {
479
479
  {
480
480
  if (Q.current) {
481
- var e = O(Q.current.type);
481
+ var e = T(Q.current.type);
482
482
  if (e)
483
483
  return `
484
484
 
@@ -487,256 +487,256 @@ Check the render method of \`` + e + "`.";
487
487
  return "";
488
488
  }
489
489
  }
490
- function fr(e) {
490
+ function xt(e) {
491
491
  return "";
492
492
  }
493
- var we = {};
494
- function dr(e) {
493
+ var Ce = {};
494
+ function vt(e) {
495
495
  {
496
- var r = Re();
497
- if (!r) {
498
- var n = typeof e == "string" ? e : e.displayName || e.name;
499
- n && (r = `
496
+ var n = Ne();
497
+ if (!n) {
498
+ var a = typeof e == "string" ? e : e.displayName || e.name;
499
+ a && (n = `
500
500
 
501
- Check the top-level render call using <` + n + ">.");
501
+ Check the top-level render call using <` + a + ">.");
502
502
  }
503
- return r;
503
+ return n;
504
504
  }
505
505
  }
506
- function _e(e, r) {
506
+ function Re(e, n) {
507
507
  {
508
508
  if (!e._store || e._store.validated || e.key != null)
509
509
  return;
510
510
  e._store.validated = !0;
511
- var n = dr(r);
512
- if (we[n])
511
+ var a = vt(n);
512
+ if (Ce[a])
513
513
  return;
514
- we[n] = !0;
514
+ Ce[a] = !0;
515
515
  var l = "";
516
- e && e._owner && e._owner !== Q.current && (l = " It was passed a child from " + O(e._owner.type) + "."), N(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, l), N(null);
516
+ e && e._owner && e._owner !== Q.current && (l = " It was passed a child from " + T(e._owner.type) + "."), k(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, l), k(null);
517
517
  }
518
518
  }
519
- function Ce(e, r) {
519
+ function Fe(e, n) {
520
520
  {
521
521
  if (typeof e != "object")
522
522
  return;
523
523
  if (Z(e))
524
- for (var n = 0; n < e.length; n++) {
525
- var l = e[n];
526
- re(l) && _e(l, r);
524
+ for (var a = 0; a < e.length; a++) {
525
+ var l = e[a];
526
+ te(l) && Re(l, n);
527
527
  }
528
- else if (re(e))
528
+ else if (te(e))
529
529
  e._store && (e._store.validated = !0);
530
530
  else if (e) {
531
- var v = H(e);
532
- if (typeof v == "function" && v !== e.entries)
533
- for (var m = v.call(e), f; !(f = m.next()).done; )
534
- re(f.value) && _e(f.value, r);
531
+ var m = J(e);
532
+ if (typeof m == "function" && m !== e.entries)
533
+ for (var p = m.call(e), f; !(f = p.next()).done; )
534
+ te(f.value) && Re(f.value, n);
535
535
  }
536
536
  }
537
537
  }
538
- function vr(e) {
538
+ function gt(e) {
539
539
  {
540
- var r = e.type;
541
- if (r == null || typeof r == "string")
540
+ var n = e.type;
541
+ if (n == null || typeof n == "string")
542
542
  return;
543
- var n;
544
- if (typeof r == "function")
545
- n = r.propTypes;
546
- else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
543
+ var a;
544
+ if (typeof n == "function")
545
+ a = n.propTypes;
546
+ else if (typeof n == "object" && (n.$$typeof === x || // Note: Memo only checks outer props here.
547
547
  // Inner props are checked in the reconciler.
548
- r.$$typeof === F))
549
- n = r.propTypes;
548
+ n.$$typeof === E))
549
+ a = n.propTypes;
550
550
  else
551
551
  return;
552
- if (n) {
553
- var l = O(r);
554
- Qe(n, e.props, "prop", l, e);
555
- } else if (r.PropTypes !== void 0 && !ee) {
552
+ if (a) {
553
+ var l = T(n);
554
+ st(a, e.props, "prop", l, e);
555
+ } else if (n.PropTypes !== void 0 && !ee) {
556
556
  ee = !0;
557
- var v = O(r);
558
- h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown");
557
+ var m = T(n);
558
+ h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
559
559
  }
560
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
560
+ typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
561
561
  }
562
562
  }
563
- function hr(e) {
563
+ function bt(e) {
564
564
  {
565
- for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
566
- var l = r[n];
565
+ for (var n = Object.keys(e.props), a = 0; a < n.length; a++) {
566
+ var l = n[a];
567
567
  if (l !== "children" && l !== "key") {
568
- N(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), N(null);
568
+ k(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), k(null);
569
569
  break;
570
570
  }
571
571
  }
572
- e.ref !== null && (N(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), N(null));
572
+ e.ref !== null && (k(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
573
573
  }
574
574
  }
575
- function Te(e, r, n, l, v, m) {
575
+ function _e(e, n, a, l, m, p) {
576
576
  {
577
- var f = qe(e);
577
+ var f = Xe(e);
578
578
  if (!f) {
579
- var c = "";
580
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (c += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
581
- var w = fr();
582
- w ? c += w : c += Re();
583
- var y;
584
- e === null ? y = "null" : Z(e) ? y = "array" : e !== void 0 && e.$$typeof === t ? (y = "<" + (O(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, c);
579
+ var u = "";
580
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (u += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
581
+ var R = xt();
582
+ R ? u += R : u += Ne();
583
+ var b;
584
+ e === null ? b = "null" : Z(e) ? b = "array" : e !== void 0 && e.$$typeof === r ? (b = "<" + (T(e.type) || "Unknown") + " />", u = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, u);
585
585
  }
586
- var x = ur(e, r, n, v, m);
587
- if (x == null)
588
- return x;
586
+ var y = pt(e, n, a, m, p);
587
+ if (y == null)
588
+ return y;
589
589
  if (f) {
590
- var C = r.children;
591
- if (C !== void 0)
590
+ var F = n.children;
591
+ if (F !== void 0)
592
592
  if (l)
593
- if (Z(C)) {
594
- for (var I = 0; I < C.length; I++)
595
- Ce(C[I], e);
596
- Object.freeze && Object.freeze(C);
593
+ if (Z(F)) {
594
+ for (var D = 0; D < F.length; D++)
595
+ Fe(F[D], e);
596
+ Object.freeze && Object.freeze(F);
597
597
  } else
598
598
  h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
599
599
  else
600
- Ce(C, e);
600
+ Fe(F, e);
601
601
  }
602
- return e === a ? hr(x) : vr(x), x;
602
+ return e === i ? bt(y) : gt(y), y;
603
603
  }
604
604
  }
605
- function mr(e, r, n) {
606
- return Te(e, r, n, !0);
605
+ function yt(e, n, a) {
606
+ return _e(e, n, a, !0);
607
607
  }
608
- function pr(e, r, n) {
609
- return Te(e, r, n, !1);
608
+ function jt(e, n, a) {
609
+ return _e(e, n, a, !1);
610
610
  }
611
- var gr = pr, yr = mr;
612
- z.Fragment = a, z.jsx = gr, z.jsxs = yr;
613
- })()), z;
611
+ var wt = jt, Et = yt;
612
+ L.Fragment = i, L.jsx = wt, L.jsxs = Et;
613
+ })()), L;
614
614
  }
615
- var Ie;
616
- function Dr() {
617
- return Ie || (Ie = 1, process.env.NODE_ENV === "production" ? q.exports = Nr() : q.exports = Ir()), q.exports;
615
+ var ke;
616
+ function qt() {
617
+ return ke || (ke = 1, process.env.NODE_ENV === "production" ? q.exports = Yt() : q.exports = Ut()), q.exports;
618
618
  }
619
- var o = Dr();
620
- function Ar(s) {
621
- const [t, i] = $([]), [a, d] = $(null), [b, E] = $(""), [j, p] = $(!1), [_, u] = $(null), F = D(async () => {
619
+ var t = qt();
620
+ function Ht(o) {
621
+ const [r, s] = I([]), [i, c] = I(null), [g, j] = I(""), [w, x] = I(!1), [N, d] = I(null), E = A(async () => {
622
622
  try {
623
- p(!0), u(null);
624
- const g = await s.getFiles();
625
- if (i(g), !a && g.length > 0) {
626
- const h = $e(g);
627
- h && d(h.id);
623
+ x(!0), d(null);
624
+ const v = await o.getFiles();
625
+ if (s(v), !i && v.length > 0) {
626
+ const h = We(v);
627
+ h && c(h.id);
628
628
  }
629
- } catch (g) {
630
- u(g instanceof Error ? g.message : "Failed to load files");
629
+ } catch (v) {
630
+ d(v instanceof Error ? v.message : "Failed to load files");
631
631
  } finally {
632
- p(!1);
632
+ x(!1);
633
633
  }
634
- }, [s, a]), R = D(
635
- async (g) => {
634
+ }, [o, i]), C = A(
635
+ async (v) => {
636
636
  try {
637
- p(!0), u(null);
638
- const h = await s.getFileContent(g);
639
- E(h);
637
+ x(!0), d(null);
638
+ const h = await o.getFileContent(v);
639
+ j(h);
640
640
  } catch (h) {
641
- u(
641
+ d(
642
642
  h instanceof Error ? h.message : "Failed to load file content"
643
- ), E("");
643
+ ), j("");
644
644
  } finally {
645
- p(!1);
645
+ x(!1);
646
646
  }
647
647
  },
648
- [s]
649
- ), S = D(
650
- async (g) => {
651
- if (a)
648
+ [o]
649
+ ), S = A(
650
+ async (v) => {
651
+ if (i)
652
652
  try {
653
- u(null), await s.updateFileContent(a, g), E(g), i(
654
- (h) => ze(h, a, { content: g })
653
+ d(null), await o.updateFileContent(i, v), j(v), s(
654
+ (h) => Ye(h, i, { content: v })
655
655
  );
656
656
  } catch (h) {
657
- u(
657
+ d(
658
658
  h instanceof Error ? h.message : "Failed to update file content"
659
659
  );
660
660
  }
661
661
  },
662
- [a, s]
663
- ), W = D(
664
- (g) => {
665
- d(g), R(g);
662
+ [i, o]
663
+ ), M = A(
664
+ (v) => {
665
+ c(v), C(v);
666
666
  },
667
- [R]
668
- ), J = D(() => {
669
- F();
670
- }, [F]), H = D(
671
- (g) => Le(t, g),
672
- [t]
667
+ [C]
668
+ ), H = A(() => {
669
+ E();
670
+ }, [E]), J = A(
671
+ (v) => Ve(r, v),
672
+ [r]
673
673
  );
674
- return Oe(() => {
675
- F();
676
- }, [F]), Oe(() => {
677
- a && R(a);
678
- }, [a, R]), {
679
- files: t,
680
- activeFile: a,
681
- fileContent: b,
682
- loading: j,
683
- error: _,
684
- setActiveFile: W,
674
+ return Te(() => {
675
+ E();
676
+ }, [E]), Te(() => {
677
+ i && C(i);
678
+ }, [i, C]), {
679
+ files: r,
680
+ activeFile: i,
681
+ fileContent: g,
682
+ loading: w,
683
+ error: N,
684
+ setActiveFile: M,
685
685
  updateFileContent: S,
686
- refreshFiles: J,
687
- getFileById: H
686
+ refreshFiles: H,
687
+ getFileById: J
688
688
  };
689
689
  }
690
- function $e(s) {
691
- for (const t of s) {
692
- if (t.type === "file")
693
- return t;
694
- if (t.children) {
695
- const i = $e(t.children);
696
- if (i) return i;
690
+ function We(o) {
691
+ for (const r of o) {
692
+ if (r.type === "file")
693
+ return r;
694
+ if (r.children) {
695
+ const s = We(r.children);
696
+ if (s) return s;
697
697
  }
698
698
  }
699
699
  return null;
700
700
  }
701
- function Le(s, t) {
702
- for (const i of s) {
703
- if (i.id === t) return i;
704
- if (i.children) {
705
- const a = Le(i.children, t);
706
- if (a) return a;
701
+ function Ve(o, r) {
702
+ for (const s of o) {
703
+ if (s.id === r) return s;
704
+ if (s.children) {
705
+ const i = Ve(s.children, r);
706
+ if (i) return i;
707
707
  }
708
708
  }
709
709
  return null;
710
710
  }
711
- function ze(s, t, i) {
712
- return s.map((a) => a.id === t ? { ...a, ...i } : a.children ? {
713
- ...a,
714
- children: ze(a.children, t, i)
715
- } : a);
711
+ function Ye(o, r, s) {
712
+ return o.map((i) => i.id === r ? { ...i, ...s } : i.children ? {
713
+ ...i,
714
+ children: Ye(i.children, r, s)
715
+ } : i);
716
716
  }
717
- class $r {
717
+ class Jt {
718
718
  config;
719
719
  files = [];
720
- constructor(t) {
721
- this.config = t;
720
+ constructor(r) {
721
+ this.config = r;
722
722
  }
723
723
  async getFiles() {
724
724
  return this.files.length === 0 && await this.loadFiles(), this.files;
725
725
  }
726
- async getFileContent(t) {
727
- if (t === "main-function")
726
+ async getFileContent(r) {
727
+ if (r === "main-function")
728
728
  return await this.config.fetchFunction(
729
729
  this.config.functionId,
730
730
  this.config.version
731
731
  );
732
- throw new Error(`File ${t} not found`);
732
+ throw new Error(`File ${r} not found`);
733
733
  }
734
- async updateFileContent(t, i) {
735
- const a = this.findFileById(t);
736
- a && (a.content = i), console.log(`Updated file ${t} with content:`, i);
734
+ async updateFileContent(r, s) {
735
+ const i = this.findFileById(r);
736
+ i && (i.content = s), console.log(`Updated file ${r} with content:`, s);
737
737
  }
738
- async getFileMetadata(t) {
739
- return this.findFileById(t)?.metadata || {};
738
+ async getFileMetadata(r) {
739
+ return this.findFileById(r)?.metadata || {};
740
740
  }
741
741
  async loadFiles() {
742
742
  this.files = [
@@ -755,11 +755,11 @@ class $r {
755
755
  name: "versions",
756
756
  type: "folder",
757
757
  path: "/versions",
758
- children: this.config.versionList.map((t) => ({
759
- id: `version-${t}`,
760
- name: `v${t}.js`,
758
+ children: this.config.versionList.map((r) => ({
759
+ id: `version-${r}`,
760
+ name: `v${r}.js`,
761
761
  type: "file",
762
- path: `/versions/v${t}.js`,
762
+ path: `/versions/v${r}.js`,
763
763
  metadata: {
764
764
  language: "javascript"
765
765
  }
@@ -767,43 +767,43 @@ class $r {
767
767
  }
768
768
  ];
769
769
  }
770
- findFileById(t) {
771
- const i = (a) => {
772
- for (const d of a) {
773
- if (d.id === t) return d;
774
- if (d.children) {
775
- const b = i(d.children);
776
- if (b) return b;
770
+ findFileById(r) {
771
+ const s = (i) => {
772
+ for (const c of i) {
773
+ if (c.id === r) return c;
774
+ if (c.children) {
775
+ const g = s(c.children);
776
+ if (g) return g;
777
777
  }
778
778
  }
779
779
  return null;
780
780
  };
781
- return i(this.files);
781
+ return s(this.files);
782
782
  }
783
783
  }
784
- class Lr {
784
+ class Gt {
785
785
  config;
786
786
  files = [];
787
- constructor(t) {
788
- this.config = t, this.initializeFiles();
787
+ constructor(r) {
788
+ this.config = r, this.initializeFiles();
789
789
  }
790
790
  async getFiles() {
791
791
  return this.files;
792
792
  }
793
- async getFileContent(t) {
794
- if (t === "form-code")
793
+ async getFileContent(r) {
794
+ if (r === "form-code")
795
795
  return this.config.codeContent;
796
- throw new Error(`File ${t} not found`);
796
+ throw new Error(`File ${r} not found`);
797
797
  }
798
- async updateFileContent(t, i) {
799
- if (t === "form-code") {
800
- this.config.codeContent = i;
801
- const a = this.files.find((d) => d.id === t);
802
- a && (a.content = i);
798
+ async updateFileContent(r, s) {
799
+ if (r === "form-code") {
800
+ this.config.codeContent = s;
801
+ const i = this.files.find((c) => c.id === r);
802
+ i && (i.content = s);
803
803
  }
804
804
  }
805
- async getFileMetadata(t) {
806
- return this.findFileById(t)?.metadata || {};
805
+ async getFileMetadata(r) {
806
+ return this.findFileById(r)?.metadata || {};
807
807
  }
808
808
  initializeFiles() {
809
809
  this.files = [
@@ -820,84 +820,84 @@ class Lr {
820
820
  }
821
821
  ];
822
822
  }
823
- findFileById(t) {
824
- return this.files.find((i) => i.id === t) || null;
823
+ findFileById(r) {
824
+ return this.files.find((s) => s.id === r) || null;
825
825
  }
826
826
  }
827
- class zr {
827
+ class Kt {
828
828
  config;
829
829
  files = [];
830
- constructor(t) {
831
- this.config = t, this.initializeFiles();
830
+ constructor(r) {
831
+ this.config = r, this.initializeFiles();
832
832
  }
833
833
  async getFiles() {
834
834
  return this.files;
835
835
  }
836
- async getFileContent(t) {
837
- const i = this.findFileById(t);
838
- if (!i || !i.metadata?.url)
839
- throw new Error(`File ${t} not found`);
836
+ async getFileContent(r) {
837
+ const s = this.findFileById(r);
838
+ if (!s || !s.metadata?.url)
839
+ throw new Error(`File ${r} not found`);
840
840
  try {
841
- const a = await fetch(i.metadata.url);
842
- if (!a.ok)
843
- throw new Error(`Failed to fetch file: ${a.statusText}`);
844
- return await a.text();
845
- } catch (a) {
846
- throw new Error(`Error fetching file content: ${a}`);
841
+ const i = await fetch(s.metadata.url);
842
+ if (!i.ok)
843
+ throw new Error(`Failed to fetch file: ${i.statusText}`);
844
+ return await i.text();
845
+ } catch (i) {
846
+ throw new Error(`Error fetching file content: ${i}`);
847
847
  }
848
848
  }
849
- async updateFileContent(t, i) {
850
- console.log(`Would save file ${t} content to backend:`, i);
851
- const a = this.findFileById(t);
852
- a && (a.content = i);
849
+ async updateFileContent(r, s) {
850
+ console.log(`Would save file ${r} content to backend:`, s);
851
+ const i = this.findFileById(r);
852
+ i && (i.content = s);
853
853
  }
854
- async getFileMetadata(t) {
855
- return this.findFileById(t)?.metadata || {};
854
+ async getFileMetadata(r) {
855
+ return this.findFileById(r)?.metadata || {};
856
856
  }
857
857
  initializeFiles() {
858
- this.files = this.config.fileUrls.map((t, i) => ({
859
- id: `url-file-${i}`,
860
- name: t.name,
858
+ this.files = this.config.fileUrls.map((r, s) => ({
859
+ id: `url-file-${s}`,
860
+ name: r.name,
861
861
  type: "file",
862
- path: `/${t.name}`,
862
+ path: `/${r.name}`,
863
863
  metadata: {
864
- language: t.type,
865
- url: t.url,
864
+ language: r.type,
865
+ url: r.url,
866
866
  lastModified: /* @__PURE__ */ new Date()
867
867
  }
868
868
  }));
869
869
  }
870
- findFileById(t) {
871
- return this.files.find((i) => i.id === t) || null;
870
+ findFileById(r) {
871
+ return this.files.find((s) => s.id === r) || null;
872
872
  }
873
873
  }
874
- function Wr(s) {
875
- if (s.workflowConfig)
876
- return new $r(s.workflowConfig);
877
- if (s.formConfig)
878
- return new Lr(s.formConfig);
879
- if (s.urlConfig)
880
- return new zr(s.urlConfig);
874
+ function Xt(o) {
875
+ if (o.workflowConfig)
876
+ return new Jt(o.workflowConfig);
877
+ if (o.formConfig)
878
+ return new Gt(o.formConfig);
879
+ if (o.urlConfig)
880
+ return new Kt(o.urlConfig);
881
881
  throw new Error("No valid configuration provided");
882
882
  }
883
- const Mr = ({
884
- value: s,
885
- onChange: t,
886
- language: i = "javascript",
887
- filename: a,
888
- readOnly: d = !1,
889
- loading: b = !1
883
+ const Zt = ({
884
+ value: o,
885
+ onChange: r,
886
+ language: s = "javascript",
887
+ filename: i,
888
+ readOnly: c = !1,
889
+ loading: g = !1
890
890
  }) => {
891
- const E = (j) => {
892
- j !== void 0 && t(j);
891
+ const j = (w) => {
892
+ w !== void 0 && r(w);
893
893
  };
894
- return /* @__PURE__ */ o.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ o.jsx(
895
- xr,
894
+ return /* @__PURE__ */ t.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ t.jsx(
895
+ Ct,
896
896
  {
897
897
  height: "100%",
898
- defaultLanguage: i,
899
- defaultValue: s,
900
- onChange: E,
898
+ defaultLanguage: s,
899
+ defaultValue: o,
900
+ onChange: j,
901
901
  theme: "vs-light",
902
902
  options: {
903
903
  minimap: {
@@ -910,154 +910,158 @@ const Mr = ({
910
910
  top: 16
911
911
  },
912
912
  scrollBeyondLastLine: !1,
913
- readOnly: d
913
+ readOnly: c
914
914
  }
915
915
  }
916
916
  ) });
917
- }, Br = ({
918
- activePanel: s,
919
- setActivePanel: t
917
+ }, Qt = [
918
+ {
919
+ id: "explorer",
920
+ icon: De,
921
+ label: "Files"
922
+ },
923
+ {
924
+ id: "data",
925
+ icon: Ae,
926
+ label: "Data"
927
+ },
928
+ {
929
+ id: "functions",
930
+ icon: ze,
931
+ label: "Functions"
932
+ },
933
+ {
934
+ id: "versions",
935
+ icon: $e,
936
+ label: "Versions"
937
+ },
938
+ {
939
+ id: "tests",
940
+ icon: _t,
941
+ label: "Tests"
942
+ }
943
+ ], er = ({
944
+ activePanel: o,
945
+ setActivePanel: r,
946
+ allowedRoutes: s = ["explorer"]
920
947
  }) => {
921
- const i = [
922
- {
923
- id: "explorer",
924
- icon: De,
925
- label: "Files"
926
- },
927
- {
928
- id: "data",
929
- icon: jr,
930
- label: "Data"
931
- },
932
- {
933
- id: "functions",
934
- icon: Fr,
935
- label: "Functions"
936
- },
937
- {
938
- id: "versions",
939
- icon: Ae,
940
- label: "Versions"
941
- },
942
- {
943
- id: "tests",
944
- icon: Rr,
945
- label: "Tests"
946
- }
947
- ];
948
- return /* @__PURE__ */ o.jsxs("div", { className: "w-14 border-r border-slate-200 bg-white flex flex-col gap-4 items-center py-4", children: [
949
- i.map((a) => {
950
- const d = a.icon;
951
- return /* @__PURE__ */ o.jsx(Pe, { title: a.label, placement: "right", children: /* @__PURE__ */ o.jsx(
952
- te,
948
+ const i = Nt(
949
+ () => Qt.filter((c) => s.includes(c.id)),
950
+ [s]
951
+ );
952
+ return /* @__PURE__ */ t.jsxs("div", { className: "w-14 border-r border-slate-200 bg-white flex flex-col gap-4 items-center py-4", children: [
953
+ i.map((c) => {
954
+ const g = c.icon;
955
+ return /* @__PURE__ */ t.jsx(Pe, { title: c.label, placement: "right", children: /* @__PURE__ */ t.jsx(
956
+ re,
953
957
  {
954
- type: s === a.id ? "primary" : "text",
955
- icon: /* @__PURE__ */ o.jsx(d, { size: 16 }),
956
- onClick: () => t(a.id)
958
+ type: o === c.id ? "primary" : "text",
959
+ icon: /* @__PURE__ */ t.jsx(g, { size: 16 }),
960
+ onClick: () => r(c.id)
957
961
  }
958
- ) }, a.id);
962
+ ) }, c.id);
959
963
  }),
960
- /* @__PURE__ */ o.jsx("div", { className: "mt-auto", children: /* @__PURE__ */ o.jsx(Pe, { title: "Settings", placement: "right", children: /* @__PURE__ */ o.jsx(te, { type: "text", icon: /* @__PURE__ */ o.jsx(wr, { size: 20 }) }) }) })
964
+ /* @__PURE__ */ t.jsx("div", { className: "mt-auto", children: /* @__PURE__ */ t.jsx(Pe, { title: "Settings", placement: "right", children: /* @__PURE__ */ t.jsx(re, { type: "text", icon: /* @__PURE__ */ t.jsx(Le, { size: 20 }) }) }) })
961
965
  ] });
962
- }, Yr = ({
963
- leftPanel: s,
964
- editor: t,
965
- rightPanel: i,
966
- activePanel: a,
967
- setActivePanel: d
968
- }) => /* @__PURE__ */ o.jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
969
- /* @__PURE__ */ o.jsx(Br, { activePanel: a, setActivePanel: d }),
970
- /* @__PURE__ */ o.jsx("div", { className: "flex-1", children: i ? /* @__PURE__ */ o.jsxs(
971
- k,
966
+ }, tr = ({
967
+ leftPanel: o,
968
+ editor: r,
969
+ rightPanel: s,
970
+ activePanel: i,
971
+ setActivePanel: c
972
+ }) => /* @__PURE__ */ t.jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
973
+ /* @__PURE__ */ t.jsx(er, { activePanel: i, setActivePanel: c }),
974
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1", children: s ? /* @__PURE__ */ t.jsxs(
975
+ O,
972
976
  {
973
977
  style: { height: "100%" },
974
- onResize: (b) => console.log(b),
978
+ onResize: (g) => console.log(g),
975
979
  children: [
976
- /* @__PURE__ */ o.jsx(
977
- k.Panel,
980
+ /* @__PURE__ */ t.jsx(
981
+ O.Panel,
978
982
  {
979
983
  defaultSize: "25%",
980
984
  min: "15%",
981
985
  max: "40%",
982
986
  className: "bg-white border-r border-slate-200",
983
987
  collapsible: !0,
984
- children: /* @__PURE__ */ o.jsx("div", { className: "h-full overflow-y-auto", children: s })
988
+ children: /* @__PURE__ */ t.jsx("div", { className: "h-full overflow-y-auto", children: o })
985
989
  }
986
990
  ),
987
- /* @__PURE__ */ o.jsx(k.Panel, { defaultSize: "50%", min: "30%", children: t }),
988
- /* @__PURE__ */ o.jsx(
989
- k.Panel,
991
+ /* @__PURE__ */ t.jsx(O.Panel, { defaultSize: "50%", min: "30%", children: r }),
992
+ /* @__PURE__ */ t.jsx(
993
+ O.Panel,
990
994
  {
991
995
  defaultSize: "25%",
992
996
  min: "20%",
993
997
  max: "50%",
994
998
  className: "bg-white border-l border-slate-200",
995
- children: /* @__PURE__ */ o.jsx("div", { className: "h-full overflow-y-auto", children: i })
999
+ children: /* @__PURE__ */ t.jsx("div", { className: "h-full overflow-y-auto", children: s })
996
1000
  }
997
1001
  )
998
1002
  ]
999
1003
  }
1000
- ) : /* @__PURE__ */ o.jsxs(k, { style: { height: "100%" }, children: [
1001
- /* @__PURE__ */ o.jsx(
1002
- k.Panel,
1004
+ ) : /* @__PURE__ */ t.jsxs(O, { style: { height: "100%" }, children: [
1005
+ /* @__PURE__ */ t.jsx(
1006
+ O.Panel,
1003
1007
  {
1004
1008
  defaultSize: "25%",
1005
1009
  min: "15%",
1006
1010
  max: "40%",
1007
1011
  className: "bg-white border-r border-slate-200",
1008
- children: /* @__PURE__ */ o.jsx("div", { className: "h-full overflow-y-auto", children: s })
1012
+ children: /* @__PURE__ */ t.jsx("div", { className: "h-full overflow-y-auto", children: o })
1009
1013
  }
1010
1014
  ),
1011
- /* @__PURE__ */ o.jsx(k.Panel, { defaultSize: "75%", min: "60%", children: t })
1015
+ /* @__PURE__ */ t.jsx(O.Panel, { defaultSize: "75%", min: "60%", children: r })
1012
1016
  ] }) })
1013
- ] }), Vr = ({
1014
- files: s,
1015
- activeFile: t,
1016
- onFileSelect: i,
1017
- loading: a = !1,
1018
- error: d = null,
1019
- onRefresh: b
1017
+ ] }), rr = ({
1018
+ files: o,
1019
+ activeFile: r,
1020
+ onFileSelect: s,
1021
+ loading: i = !1,
1022
+ error: c = null,
1023
+ onRefresh: g
1020
1024
  }) => {
1021
- const E = (_) => _.map((u) => ({
1022
- title: u.name,
1023
- key: u.id,
1024
- icon: u.type === "file" ? /* @__PURE__ */ o.jsx(Cr, { size: 16, className: "text-slate-500 flex" }) : /* @__PURE__ */ o.jsx(De, { size: 16, className: "text-slate-500 flex" }),
1025
- isLeaf: u.type === "file",
1026
- children: u.children ? E(u.children) : void 0,
1027
- metadata: u.metadata
1028
- })), j = E(s), p = (_, u) => {
1029
- u?.node.isLeaf && u.node.key && i(u.node.key);
1025
+ const j = (N) => N.map((d) => ({
1026
+ title: d.name,
1027
+ key: d.id,
1028
+ icon: d.type === "file" ? /* @__PURE__ */ t.jsx(Tt, { size: 16, className: "text-slate-500 flex" }) : /* @__PURE__ */ t.jsx(De, { size: 16, className: "text-slate-500 flex" }),
1029
+ isLeaf: d.type === "file",
1030
+ children: d.children ? j(d.children) : void 0,
1031
+ metadata: d.metadata
1032
+ })), w = j(o), x = (N, d) => {
1033
+ d?.node.isLeaf && d.node.key && s(d.node.key);
1030
1034
  };
1031
- return /* @__PURE__ */ o.jsxs("div", { className: "h-full", children: [
1032
- /* @__PURE__ */ o.jsxs("div", { className: "flex items-center justify-between p-4 border-b border-slate-200", children: [
1033
- /* @__PURE__ */ o.jsx("h2", { className: "font-medium text-sm", children: "Files" }),
1034
- /* @__PURE__ */ o.jsx("div", { className: "flex items-center gap-2", children: b && /* @__PURE__ */ o.jsx(
1035
- te,
1035
+ return /* @__PURE__ */ t.jsxs("div", { className: "h-full", children: [
1036
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between p-4 border-b border-slate-200", children: [
1037
+ /* @__PURE__ */ t.jsx("h2", { className: "font-medium text-sm", children: "Files" }),
1038
+ /* @__PURE__ */ t.jsx("div", { className: "flex items-center gap-2", children: g && /* @__PURE__ */ t.jsx(
1039
+ re,
1036
1040
  {
1037
1041
  type: "text",
1038
- icon: /* @__PURE__ */ o.jsx(_r, { size: 16 }),
1039
- onClick: b,
1040
- loading: a,
1042
+ icon: /* @__PURE__ */ t.jsx(St, { size: 16 }),
1043
+ onClick: g,
1044
+ loading: i,
1041
1045
  title: "Refresh files"
1042
1046
  }
1043
1047
  ) })
1044
1048
  ] }),
1045
- /* @__PURE__ */ o.jsxs("div", { className: "p-2", children: [
1046
- d && /* @__PURE__ */ o.jsx(
1047
- br,
1049
+ /* @__PURE__ */ t.jsxs("div", { className: "p-2", children: [
1050
+ c && /* @__PURE__ */ t.jsx(
1051
+ Rt,
1048
1052
  {
1049
1053
  message: "Error loading files",
1050
- description: d,
1054
+ description: c,
1051
1055
  type: "error",
1052
1056
  className: "mb-2"
1053
1057
  }
1054
1058
  ),
1055
- /* @__PURE__ */ o.jsx(
1056
- Er,
1059
+ /* @__PURE__ */ t.jsx(
1060
+ Ft,
1057
1061
  {
1058
- treeData: j,
1059
- onSelect: p,
1060
- selectedKeys: t ? [t] : [],
1062
+ treeData: w,
1063
+ onSelect: x,
1064
+ selectedKeys: r ? [r] : [],
1061
1065
  showIcon: !0,
1062
1066
  defaultExpandAll: !0,
1063
1067
  showLine: !0,
@@ -1066,170 +1070,523 @@ const Mr = ({
1066
1070
  )
1067
1071
  ] })
1068
1072
  ] });
1069
- }, ie = ({
1070
- config: s,
1071
- rightPanel: t = !1
1073
+ }, se = ({
1074
+ config: o,
1075
+ rightPanel: r = !1
1072
1076
  }) => {
1073
- const i = ne.useMemo(
1074
- () => Wr(s),
1075
- [s]
1077
+ const s = ne.useMemo(
1078
+ () => Xt(o),
1079
+ [o]
1076
1080
  );
1077
- console.log({ config: s });
1081
+ console.log({ config: o });
1078
1082
  const {
1079
- files: a,
1080
- activeFile: d,
1081
- fileContent: b,
1082
- loading: E,
1083
- error: j,
1084
- setActiveFile: p,
1085
- updateFileContent: _,
1086
- refreshFiles: u,
1087
- getFileById: F
1088
- } = Ar(i), R = d ? F(d) : null, S = R?.metadata?.language || "javascript";
1089
- return /* @__PURE__ */ o.jsx(
1090
- Yr,
1083
+ files: i,
1084
+ activeFile: c,
1085
+ fileContent: g,
1086
+ loading: j,
1087
+ error: w,
1088
+ setActiveFile: x,
1089
+ updateFileContent: N,
1090
+ refreshFiles: d,
1091
+ getFileById: E
1092
+ } = Ht(s), C = c ? E(c) : null, S = C?.metadata?.language || "javascript";
1093
+ return /* @__PURE__ */ t.jsx(
1094
+ tr,
1091
1095
  {
1092
- leftPanel: /* @__PURE__ */ o.jsx(
1093
- Vr,
1096
+ leftPanel: /* @__PURE__ */ t.jsx(
1097
+ rr,
1094
1098
  {
1095
- files: a,
1096
- activeFile: d,
1097
- onFileSelect: p,
1098
- loading: E,
1099
- error: j,
1100
- onRefresh: u
1099
+ files: i,
1100
+ activeFile: c,
1101
+ onFileSelect: x,
1102
+ loading: j,
1103
+ error: w,
1104
+ onRefresh: d
1101
1105
  }
1102
1106
  ),
1103
- editor: /* @__PURE__ */ o.jsx(
1104
- Mr,
1107
+ editor: /* @__PURE__ */ t.jsx(
1108
+ Zt,
1105
1109
  {
1106
- value: b,
1107
- onChange: _,
1110
+ value: g,
1111
+ onChange: N,
1108
1112
  language: S,
1109
- filename: R?.name,
1110
- readOnly: s.settings?.readOnly,
1111
- loading: E
1113
+ filename: C?.name,
1114
+ readOnly: o.settings?.readOnly,
1115
+ loading: j
1112
1116
  }
1113
1117
  ),
1114
- rightPanel: t,
1118
+ rightPanel: r,
1115
1119
  activePanel: "explorer",
1116
1120
  setActivePanel: () => {
1117
1121
  }
1118
1122
  }
1119
1123
  );
1120
- }, Gr = ({
1121
- functionId: s,
1122
- version: t,
1123
- versionList: i,
1124
- fetchFunction: a,
1125
- fetchVersionList: d
1124
+ }, or = ({
1125
+ functionId: o,
1126
+ version: r,
1127
+ versionList: s,
1128
+ fetchFunction: i,
1129
+ fetchVersionList: c
1126
1130
  }) => {
1127
- const b = {
1131
+ const g = {
1128
1132
  workflowConfig: {
1129
- functionId: s,
1130
- version: t,
1131
- versionList: i,
1132
- fetchFunction: a,
1133
- fetchVersionList: d
1133
+ functionId: o,
1134
+ version: r,
1135
+ versionList: s,
1136
+ fetchFunction: i,
1137
+ fetchVersionList: c
1134
1138
  }
1135
1139
  };
1136
- return /* @__PURE__ */ o.jsx(ie, { config: b });
1137
- }, Kr = ({
1138
- codeContent: s,
1139
- fileName: t = "code.js",
1140
- language: i = "javascript",
1141
- readOnly: a = !1
1140
+ return /* @__PURE__ */ t.jsx(se, { config: g });
1141
+ }, lr = ({
1142
+ codeContent: o,
1143
+ fileName: r = "code.js",
1144
+ language: s = "javascript",
1145
+ readOnly: i = !1
1142
1146
  }) => {
1143
- const d = {
1147
+ const c = {
1144
1148
  formConfig: {
1145
- codeContent: s,
1146
- fileName: t,
1147
- language: i
1149
+ codeContent: o,
1150
+ fileName: r,
1151
+ language: s
1148
1152
  },
1149
1153
  settings: {
1150
- readOnly: a
1154
+ readOnly: i
1151
1155
  }
1152
1156
  };
1153
- return /* @__PURE__ */ o.jsx(ie, { config: d });
1154
- }, Xr = ({ fileUrls: s, rightPanel: t }) => {
1155
- const i = {
1157
+ return /* @__PURE__ */ t.jsx(se, { config: c });
1158
+ }, cr = ({ fileUrls: o, rightPanel: r }) => {
1159
+ const s = {
1156
1160
  urlConfig: {
1157
- fileUrls: s
1161
+ fileUrls: o
1158
1162
  }
1159
1163
  };
1160
- return /* @__PURE__ */ o.jsx(ie, { config: i, rightPanel: t });
1161
- }, Zr = ({
1162
- activeFile: s,
1163
- showPreview: t,
1164
- setShowPreview: i
1165
- }) => /* @__PURE__ */ o.jsxs("div", { className: "h-14 border-b border-slate-200 bg-white px-4 flex items-center justify-between", children: [
1166
- /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
1167
- /* @__PURE__ */ o.jsx("h1", { className: "text-lg font-semibold text-slate-900 mr-4", children: "CRM Code Editor" }),
1168
- /* @__PURE__ */ o.jsx("span", { className: "text-sm text-slate-500 px-2 py-1 bg-slate-100 rounded-md", children: s })
1164
+ return /* @__PURE__ */ t.jsx(se, { config: s, rightPanel: r });
1165
+ }, dr = ({
1166
+ activeFile: o,
1167
+ showPreview: r,
1168
+ setShowPreview: s
1169
+ }) => /* @__PURE__ */ t.jsxs("div", { className: "h-14 border-b border-slate-200 bg-white px-4 flex items-center justify-between", children: [
1170
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1171
+ /* @__PURE__ */ t.jsx("h1", { className: "text-lg font-semibold text-slate-900 mr-4", children: "CRM Code Editor" }),
1172
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm text-slate-500 px-2 py-1 bg-slate-100 rounded-md", children: o })
1169
1173
  ] }),
1170
- /* @__PURE__ */ o.jsxs("div", { className: "flex items-center space-x-2", children: [
1171
- /* @__PURE__ */ o.jsx(
1174
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
1175
+ /* @__PURE__ */ t.jsx(
1172
1176
  "button",
1173
1177
  {
1174
1178
  className: "p-1.5 hover:bg-slate-100 rounded-md text-slate-600",
1175
- onClick: () => i(!t),
1176
- title: t ? "Hide Preview" : "Show Preview",
1177
- children: t ? /* @__PURE__ */ o.jsx(Tr, { size: 18 }) : /* @__PURE__ */ o.jsx(Sr, { size: 18 })
1179
+ onClick: () => s(!r),
1180
+ title: r ? "Hide Preview" : "Show Preview",
1181
+ children: r ? /* @__PURE__ */ t.jsx(Pt, { size: 18 }) : /* @__PURE__ */ t.jsx(Ot, { size: 18 })
1178
1182
  }
1179
1183
  ),
1180
- /* @__PURE__ */ o.jsx(
1184
+ /* @__PURE__ */ t.jsx(
1181
1185
  "button",
1182
1186
  {
1183
1187
  className: "p-1.5 hover:bg-slate-100 rounded-md text-slate-600",
1184
1188
  title: "Version History",
1185
- children: /* @__PURE__ */ o.jsx(Ae, { size: 18 })
1189
+ children: /* @__PURE__ */ t.jsx($e, { size: 18 })
1186
1190
  }
1187
1191
  ),
1188
- /* @__PURE__ */ o.jsx(
1192
+ /* @__PURE__ */ t.jsx(
1189
1193
  "button",
1190
1194
  {
1191
1195
  className: "p-1.5 hover:bg-slate-100 rounded-md text-slate-600",
1192
1196
  title: "Run Code",
1193
- children: /* @__PURE__ */ o.jsx(Or, { size: 18 })
1197
+ children: /* @__PURE__ */ t.jsx(Me, { size: 18 })
1194
1198
  }
1195
1199
  ),
1196
- /* @__PURE__ */ o.jsx(
1200
+ /* @__PURE__ */ t.jsx(
1197
1201
  "button",
1198
1202
  {
1199
1203
  className: "p-1.5 hover:bg-slate-100 rounded-md text-slate-600",
1200
1204
  title: "Export",
1201
- children: /* @__PURE__ */ o.jsx(Pr, { size: 18 })
1205
+ children: /* @__PURE__ */ t.jsx(It, { size: 18 })
1202
1206
  }
1203
1207
  ),
1204
- /* @__PURE__ */ o.jsxs("button", { className: "ml-2 px-3 py-1.5 bg-slate-900 text-white rounded-md flex items-center text-sm hover:bg-slate-800", children: [
1205
- /* @__PURE__ */ o.jsx(kr, { size: 16, className: "mr-1.5" }),
1208
+ /* @__PURE__ */ t.jsxs("button", { className: "ml-2 px-3 py-1.5 bg-slate-900 text-white rounded-md flex items-center text-sm hover:bg-slate-800", children: [
1209
+ /* @__PURE__ */ t.jsx(kt, { size: 16, className: "mr-1.5" }),
1206
1210
  " Save"
1207
1211
  ] }),
1208
- /* @__PURE__ */ o.jsxs("div", { className: "ml-2 px-3 py-1.5 bg-emerald-100 text-emerald-800 rounded-md flex items-center text-sm", children: [
1209
- /* @__PURE__ */ o.jsx("span", { className: "w-2 h-2 bg-emerald-500 rounded-full mr-1.5" }),
1212
+ /* @__PURE__ */ t.jsxs("div", { className: "ml-2 px-3 py-1.5 bg-emerald-100 text-emerald-800 rounded-md flex items-center text-sm", children: [
1213
+ /* @__PURE__ */ t.jsx("span", { className: "w-2 h-2 bg-emerald-500 rounded-full mr-1.5" }),
1210
1214
  " ",
1211
1215
  "Draft"
1212
1216
  ] })
1213
1217
  ] })
1214
- ] }), Qr = "1.0.0";
1218
+ ] }), ur = () => {
1219
+ const o = [
1220
+ {
1221
+ name: "Lead",
1222
+ fields: ["id", "name", "email", "phone", "status", "createdAt"],
1223
+ expanded: !0
1224
+ },
1225
+ {
1226
+ name: "Contact",
1227
+ fields: ["id", "firstName", "lastName", "email", "phone"],
1228
+ expanded: !1
1229
+ },
1230
+ {
1231
+ name: "Account",
1232
+ fields: ["id", "name", "industry", "website", "employees"],
1233
+ expanded: !1
1234
+ },
1235
+ {
1236
+ name: "Opportunity",
1237
+ fields: ["id", "name", "amount", "stage", "closeDate"],
1238
+ expanded: !1
1239
+ }
1240
+ ];
1241
+ return /* @__PURE__ */ t.jsxs("div", { className: "h-full", children: [
1242
+ /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between p-4 border-b border-slate-200", children: /* @__PURE__ */ t.jsx("h2", { className: "font-medium text-sm", children: "Data Explorer" }) }),
1243
+ /* @__PURE__ */ t.jsxs("div", { className: "p-3", children: [
1244
+ /* @__PURE__ */ t.jsxs("div", { className: "relative mb-3", children: [
1245
+ /* @__PURE__ */ t.jsx(
1246
+ Be,
1247
+ {
1248
+ size: 16,
1249
+ className: "absolute left-2.5 top-2.5 text-slate-400"
1250
+ }
1251
+ ),
1252
+ /* @__PURE__ */ t.jsx(
1253
+ "input",
1254
+ {
1255
+ type: "text",
1256
+ placeholder: "Search objects...",
1257
+ className: "w-full pl-8 pr-3 py-2 text-sm border border-slate-200 rounded-md focus:outline-none focus:ring-2 focus:ring-slate-300"
1258
+ }
1259
+ )
1260
+ ] }),
1261
+ /* @__PURE__ */ t.jsx("div", { children: o.map((r) => /* @__PURE__ */ t.jsxs("div", { className: "mb-1", children: [
1262
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center p-2 hover:bg-slate-50 rounded-md cursor-pointer", children: [
1263
+ /* @__PURE__ */ t.jsx(
1264
+ Dt,
1265
+ {
1266
+ size: 16,
1267
+ className: `mr-1 text-slate-400 transition-transform ${r.expanded ? "rotate-90" : ""}`
1268
+ }
1269
+ ),
1270
+ /* @__PURE__ */ t.jsx(Ae, { size: 16, className: "mr-2 text-slate-500" }),
1271
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium", children: r.name })
1272
+ ] }),
1273
+ r.expanded && /* @__PURE__ */ t.jsx("div", { className: "ml-7 border-l border-slate-200 pl-2", children: r.fields.map((s) => /* @__PURE__ */ t.jsx(
1274
+ "div",
1275
+ {
1276
+ className: "flex items-center p-1.5 hover:bg-slate-50 rounded-md cursor-pointer",
1277
+ children: /* @__PURE__ */ t.jsx("span", { className: "text-xs text-slate-600", children: s })
1278
+ },
1279
+ s
1280
+ )) })
1281
+ ] }, r.name)) })
1282
+ ] })
1283
+ ] });
1284
+ }, fr = () => {
1285
+ const o = [
1286
+ {
1287
+ name: "formatCurrency",
1288
+ description: "Format a number as currency",
1289
+ category: "Formatting"
1290
+ },
1291
+ {
1292
+ name: "calculateDiscount",
1293
+ description: "Calculate discount based on amount",
1294
+ category: "Calculations"
1295
+ },
1296
+ {
1297
+ name: "getLeadData",
1298
+ description: "Fetch lead data from CRM",
1299
+ category: "Data Access"
1300
+ },
1301
+ {
1302
+ name: "updateContact",
1303
+ description: "Update contact information",
1304
+ category: "Data Modification"
1305
+ },
1306
+ {
1307
+ name: "sendEmail",
1308
+ description: "Send an email to a contact",
1309
+ category: "Communication"
1310
+ },
1311
+ {
1312
+ name: "validateEmail",
1313
+ description: "Validate email format",
1314
+ category: "Validation"
1315
+ }
1316
+ ];
1317
+ return /* @__PURE__ */ t.jsxs("div", { className: "h-full", children: [
1318
+ /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between p-4 border-b border-slate-200", children: /* @__PURE__ */ t.jsx("h2", { className: "font-medium text-sm", children: "Function Library" }) }),
1319
+ /* @__PURE__ */ t.jsxs("div", { className: "p-3", children: [
1320
+ /* @__PURE__ */ t.jsxs("div", { className: "relative mb-3", children: [
1321
+ /* @__PURE__ */ t.jsx(
1322
+ Be,
1323
+ {
1324
+ size: 16,
1325
+ className: "absolute left-2.5 top-2.5 text-slate-400"
1326
+ }
1327
+ ),
1328
+ /* @__PURE__ */ t.jsx(
1329
+ "input",
1330
+ {
1331
+ type: "text",
1332
+ placeholder: "Search functions...",
1333
+ className: "w-full pl-8 pr-3 py-2 text-sm border border-slate-200 rounded-md focus:outline-none focus:ring-2 focus:ring-slate-300"
1334
+ }
1335
+ )
1336
+ ] }),
1337
+ /* @__PURE__ */ t.jsx("div", { children: o.map((r) => /* @__PURE__ */ t.jsxs(
1338
+ "div",
1339
+ {
1340
+ className: "p-2 border border-slate-200 rounded-md mb-2 hover:bg-slate-50 cursor-pointer",
1341
+ children: [
1342
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between", children: [
1343
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1344
+ /* @__PURE__ */ t.jsx(ze, { size: 16, className: "mr-2 text-slate-500" }),
1345
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium", children: r.name })
1346
+ ] }),
1347
+ /* @__PURE__ */ t.jsx("span", { className: "text-xs bg-slate-100 px-2 py-0.5 rounded text-slate-600", children: r.category })
1348
+ ] }),
1349
+ /* @__PURE__ */ t.jsx("p", { className: "text-xs text-slate-500 mt-1", children: r.description })
1350
+ ]
1351
+ },
1352
+ r.name
1353
+ )) }),
1354
+ /* @__PURE__ */ t.jsxs("div", { className: "mt-4 p-3 bg-slate-50 rounded-md border border-slate-200 flex items-center", children: [
1355
+ /* @__PURE__ */ t.jsx(At, { size: 16, className: "text-slate-500 mr-2" }),
1356
+ /* @__PURE__ */ t.jsx("span", { className: "text-xs text-slate-600", children: "Browse documentation for more functions and examples" })
1357
+ ] })
1358
+ ] })
1359
+ ] });
1360
+ }, mr = ({ code: o }) => {
1361
+ const [r, s] = I(null), [i, c] = I(!1), g = "body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; padding: 1rem; }", w = ((d) => d.replace(
1362
+ /import\s+.*axios.*from\s+['"]axios['"];?/g,
1363
+ "// Axios imports removed for preview"
1364
+ ).replace(/axios\./g, "/* axios. */").replace(/fetch\(/g, "/* fetch( */"))(o), x = `
1365
+ <!DOCTYPE html>
1366
+ <html>
1367
+ <head>
1368
+ <style>${g}</style>
1369
+ </head>
1370
+ <body>
1371
+ <div id="root"></div>
1372
+ <script>
1373
+ try {
1374
+ // Disable network requests in the preview
1375
+ window.fetch = function() {
1376
+ console.log('Network requests are disabled in preview');
1377
+ return Promise.reject(new Error('Network requests are disabled in preview'));
1378
+ };
1379
+ const preview = () => {
1380
+ const output = document.getElementById('root');
1381
+ output.innerHTML = '<div style="padding: 20px;">Preview will appear here</div>';
1382
+ if (${w.includes("console.log")}) {
1383
+ output.innerHTML += '<div style="padding: 10px; background: #f0f0f0; border-radius: 4px; margin-top: 10px;">Console output would appear here</div>';
1384
+ }
1385
+ };
1386
+ preview();
1387
+ } catch (e) {
1388
+ document.getElementById('root').innerHTML = '<div style="color: red; padding: 20px;">Error: ' + e.message + '</div>';
1389
+ }
1390
+ <\/script>
1391
+ </body>
1392
+ </html>
1393
+ `, N = () => {
1394
+ c(!0), s(null), setTimeout(() => c(!1), 300);
1395
+ };
1396
+ return /* @__PURE__ */ t.jsxs("div", { className: "h-full flex flex-col", children: [
1397
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between p-4 border-b border-slate-200", children: [
1398
+ /* @__PURE__ */ t.jsx("h2", { className: "font-medium text-sm", children: "Preview" }),
1399
+ /* @__PURE__ */ t.jsx(
1400
+ "button",
1401
+ {
1402
+ className: "p-1 hover:bg-slate-100 rounded-md",
1403
+ onClick: N,
1404
+ children: /* @__PURE__ */ t.jsx(zt, { size: 16, className: i ? "animate-spin" : "" })
1405
+ }
1406
+ )
1407
+ ] }),
1408
+ /* @__PURE__ */ t.jsx("div", { className: "flex-1 bg-white overflow-auto", children: r ? /* @__PURE__ */ t.jsxs("div", { className: "p-4 bg-red-50 border border-red-200 rounded-md flex items-start", children: [
1409
+ /* @__PURE__ */ t.jsx($t, { size: 16, className: "text-red-500 mr-2 mt-0.5" }),
1410
+ /* @__PURE__ */ t.jsxs("div", { children: [
1411
+ /* @__PURE__ */ t.jsx("p", { className: "text-sm font-medium text-red-800", children: "Preview Error" }),
1412
+ /* @__PURE__ */ t.jsx("p", { className: "text-xs text-red-600", children: r })
1413
+ ] })
1414
+ ] }) : /* @__PURE__ */ t.jsx(
1415
+ "iframe",
1416
+ {
1417
+ title: "Preview",
1418
+ className: "w-full h-full",
1419
+ srcDoc: x,
1420
+ sandbox: "allow-scripts",
1421
+ onError: () => s("Failed to load preview")
1422
+ }
1423
+ ) })
1424
+ ] });
1425
+ }, hr = () => {
1426
+ const o = [
1427
+ {
1428
+ id: "1",
1429
+ name: "Should format currency correctly",
1430
+ status: "passed",
1431
+ duration: "12ms"
1432
+ },
1433
+ {
1434
+ id: "2",
1435
+ name: "Should calculate discount",
1436
+ status: "passed",
1437
+ duration: "8ms"
1438
+ },
1439
+ {
1440
+ id: "3",
1441
+ name: "Should validate email format",
1442
+ status: "failed",
1443
+ duration: "5ms",
1444
+ error: "Expected true but received false"
1445
+ },
1446
+ {
1447
+ id: "4",
1448
+ name: "Should handle empty input",
1449
+ status: "passed",
1450
+ duration: "3ms"
1451
+ }
1452
+ ];
1453
+ return /* @__PURE__ */ t.jsxs("div", { className: "h-full", children: [
1454
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between p-4 border-b border-slate-200", children: [
1455
+ /* @__PURE__ */ t.jsx("h2", { className: "font-medium text-sm", children: "Test Runner" }),
1456
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1457
+ /* @__PURE__ */ t.jsx("button", { className: "p-1 hover:bg-slate-100 rounded-md mr-1", children: /* @__PURE__ */ t.jsx(Le, { size: 14 }) }),
1458
+ /* @__PURE__ */ t.jsxs("button", { className: "bg-slate-900 text-white text-xs px-2 py-1 rounded-md flex items-center", children: [
1459
+ /* @__PURE__ */ t.jsx(Me, { size: 12, className: "mr-1" }),
1460
+ " Run Tests"
1461
+ ] })
1462
+ ] })
1463
+ ] }),
1464
+ /* @__PURE__ */ t.jsxs("div", { className: "p-3", children: [
1465
+ /* @__PURE__ */ t.jsxs("div", { className: "mb-3 p-2 bg-slate-50 rounded-md border border-slate-200", children: [
1466
+ /* @__PURE__ */ t.jsxs("div", { className: "flex justify-between items-center", children: [
1467
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium", children: "Test Summary" }),
1468
+ /* @__PURE__ */ t.jsx("span", { className: "text-xs", children: "3 passed, 1 failed, 4 total" })
1469
+ ] }),
1470
+ /* @__PURE__ */ t.jsx("div", { className: "w-full h-2 bg-slate-200 rounded-full mt-2 overflow-hidden", children: /* @__PURE__ */ t.jsx(
1471
+ "div",
1472
+ {
1473
+ className: "h-full bg-emerald-500",
1474
+ style: {
1475
+ width: "75%"
1476
+ }
1477
+ }
1478
+ ) })
1479
+ ] }),
1480
+ /* @__PURE__ */ t.jsx("div", { children: o.map((r) => /* @__PURE__ */ t.jsxs(
1481
+ "div",
1482
+ {
1483
+ className: `p-2 mb-2 rounded-md ${r.status === "failed" ? "bg-red-50 border border-red-100" : "bg-slate-50 border border-slate-200"}`,
1484
+ children: [
1485
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between", children: [
1486
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center", children: [
1487
+ r.status === "passed" ? /* @__PURE__ */ t.jsx(
1488
+ Lt,
1489
+ {
1490
+ size: 16,
1491
+ className: "text-emerald-500 mr-2"
1492
+ }
1493
+ ) : /* @__PURE__ */ t.jsx(Mt, { size: 16, className: "text-red-500 mr-2" }),
1494
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: r.name })
1495
+ ] }),
1496
+ /* @__PURE__ */ t.jsx("span", { className: "text-xs text-slate-500", children: r.duration })
1497
+ ] }),
1498
+ r.error && /* @__PURE__ */ t.jsx("div", { className: "mt-2 text-xs text-red-600 bg-red-50 p-2 rounded", children: r.error })
1499
+ ]
1500
+ },
1501
+ r.id
1502
+ )) }),
1503
+ /* @__PURE__ */ t.jsx("div", { className: "mt-4", children: /* @__PURE__ */ t.jsx("button", { className: "w-full py-2 border border-dashed border-slate-300 rounded-md text-sm text-slate-500 hover:bg-slate-50", children: "+ Add New Test Case" }) })
1504
+ ] })
1505
+ ] });
1506
+ }, pr = () => {
1507
+ const o = [
1508
+ {
1509
+ id: "v1",
1510
+ name: "Initial version",
1511
+ author: "John Doe",
1512
+ timestamp: "Today, 2:30 PM",
1513
+ current: !0
1514
+ },
1515
+ {
1516
+ id: "v2",
1517
+ name: "Added form validation",
1518
+ author: "John Doe",
1519
+ timestamp: "Today, 1:15 PM",
1520
+ current: !1
1521
+ },
1522
+ {
1523
+ id: "v3",
1524
+ name: "Fixed API integration",
1525
+ author: "Sarah Smith",
1526
+ timestamp: "Yesterday, 4:45 PM",
1527
+ current: !1
1528
+ },
1529
+ {
1530
+ id: "v4",
1531
+ name: "Initial setup",
1532
+ author: "Sarah Smith",
1533
+ timestamp: "Yesterday, 11:30 AM",
1534
+ current: !1
1535
+ }
1536
+ ];
1537
+ return /* @__PURE__ */ t.jsxs("div", { className: "h-full", children: [
1538
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between p-4 border-b border-slate-200", children: [
1539
+ /* @__PURE__ */ t.jsx("h2", { className: "font-medium text-sm", children: "Version History" }),
1540
+ /* @__PURE__ */ t.jsx("button", { className: "text-xs text-slate-500 hover:text-slate-800", children: "Save Version" })
1541
+ ] }),
1542
+ /* @__PURE__ */ t.jsx("div", { className: "p-2", children: o.map((r) => /* @__PURE__ */ t.jsxs(
1543
+ "div",
1544
+ {
1545
+ className: `p-3 mb-2 rounded-md ${r.current ? "bg-slate-100 border border-slate-200" : "hover:bg-slate-50 cursor-pointer"}`,
1546
+ children: [
1547
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between", children: [
1548
+ /* @__PURE__ */ t.jsx("span", { className: "text-sm font-medium", children: r.name }),
1549
+ r.current && /* @__PURE__ */ t.jsx("span", { className: "text-xs bg-emerald-100 text-emerald-800 px-2 py-0.5 rounded", children: "Current" })
1550
+ ] }),
1551
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center mt-1 text-xs text-slate-500", children: [
1552
+ /* @__PURE__ */ t.jsx(Bt, { size: 12, className: "mr-1" }),
1553
+ /* @__PURE__ */ t.jsx("span", { className: "mr-3", children: r.author }),
1554
+ /* @__PURE__ */ t.jsx(Wt, { size: 12, className: "mr-1" }),
1555
+ /* @__PURE__ */ t.jsx("span", { children: r.timestamp })
1556
+ ] }),
1557
+ !r.current && /* @__PURE__ */ t.jsx("div", { className: "mt-2", children: /* @__PURE__ */ t.jsxs("button", { className: "text-xs flex items-center text-slate-600 hover:text-slate-900", children: [
1558
+ /* @__PURE__ */ t.jsx(Vt, { size: 12, className: "mr-1" }),
1559
+ " Restore this version"
1560
+ ] }) })
1561
+ ]
1562
+ },
1563
+ r.id
1564
+ )) })
1565
+ ] });
1566
+ }, xr = "1.0.0";
1215
1567
  export {
1216
- tt as Alert,
1217
- nt as Button,
1218
- Mr as CodeEditor,
1219
- ie as CodeEditorWrapper,
1220
- Yr as EditorLayout,
1221
- Vr as FileExplorer,
1222
- Kr as FormCodeEditor,
1223
- Lr as FormFileProvider,
1224
- Zr as Header,
1225
- it as Splitter,
1226
- at as Tooltip,
1227
- ot as Tree,
1228
- Xr as URLCodeEditor,
1229
- zr as URLFileProvider,
1230
- Qr as VERSION,
1231
- Gr as WorkflowCodeEditor,
1232
- $r as WorkflowFileProvider,
1233
- Wr as createFileProvider,
1234
- Ar as useFileManager
1568
+ br as Alert,
1569
+ yr as Button,
1570
+ Zt as CodeEditor,
1571
+ se as CodeEditorWrapper,
1572
+ ur as DataExplorer,
1573
+ tr as EditorLayout,
1574
+ rr as FileExplorer,
1575
+ lr as FormCodeEditor,
1576
+ Gt as FormFileProvider,
1577
+ fr as FunctionLibrary,
1578
+ dr as Header,
1579
+ mr as PreviewPanel,
1580
+ jr as Splitter,
1581
+ hr as TestRunner,
1582
+ wr as Tooltip,
1583
+ Er as Tree,
1584
+ cr as URLCodeEditor,
1585
+ Kt as URLFileProvider,
1586
+ xr as VERSION,
1587
+ pr as VersionHistory,
1588
+ or as WorkflowCodeEditor,
1589
+ Jt as WorkflowFileProvider,
1590
+ Xt as createFileProvider,
1591
+ Ht as useFileManager
1235
1592
  };