superleap-code-editor 1.0.3 → 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 A, useEffect as Oe } from "react";
2
- import yr from "@monaco-editor/react";
3
- import { Tooltip as Pe, Button as te, Splitter as k, Alert as Er, Tree as br } from "antd";
4
- import { Alert as Hr, Button as Xr, Splitter as Zr, Tooltip as Qr, Tree as et } from "antd";
5
- import { IconFolderOpen as Ae, IconDatabase as xr, IconCode as Fr, IconHistory as Rr, IconFlask as wr, IconSettings as _r, IconPlus as jr, IconFile as Cr } 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 Tr() {
18
- if (ke) return L;
19
- ke = 1;
20
- var o = ne, t = Symbol.for("react.element"), a = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, d = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, b = { key: !0, ref: !0, __self: !0, __source: !0 };
21
- function x(F, m, j) {
22
- var u, R = {}, w = null, S = null;
23
- j !== void 0 && (w = "" + j), m.key !== void 0 && (w = "" + m.key), m.ref !== void 0 && (S = m.ref);
24
- for (u in m) i.call(m, u) && !b.hasOwnProperty(u) && (R[u] = m[u]);
25
- if (F && F.defaultProps) for (u in m = F.defaultProps, m) R[u] === void 0 && (R[u] = m[u]);
26
- return { $$typeof: t, type: F, key: w, ref: S, props: R, _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 = a, L.jsx = x, L.jsxs = x, L;
28
+ return $.Fragment = s, $.jsx = j, $.jsxs = j, $;
29
29
  }
30
- var W = {};
30
+ var L = {};
31
31
  /**
32
32
  * @license React
33
33
  * react-jsx-runtime.development.js
@@ -38,53 +38,53 @@ var W = {};
38
38
  * LICENSE file in the root directory of this source tree.
39
39
  */
40
40
  var Ie;
41
- function Sr() {
41
+ function Ut() {
42
42
  return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && (function() {
43
- var o = ne, t = Symbol.for("react.element"), a = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.provider"), F = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), j = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), B = Symbol.iterator, J = "@@iterator";
44
- function G(e) {
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 = B && e[B] || 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 = o.__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), s = 1; s < r; s++)
54
- n[s - 1] = arguments[s];
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 s = g.ReactDebugCurrentFrame, v = s.getStackAddendum();
61
- v !== "" && (r += "%s", n = n.concat([v]));
62
- var p = 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
- p.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, p);
65
+ p.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, p);
66
66
  }
67
67
  }
68
- var Be = !1, Me = !1, Ye = !1, ze = !1, Ve = !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 Ue(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === i || e === b || Ve || e === d || e === j || e === u || ze || e === S || Be || Me || Ye || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === R || e.$$typeof === x || e.$$typeof === F || e.$$typeof === m || // 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 qe(e, r, n) {
78
- var s = e.displayName;
79
- if (s)
80
- return s;
81
- var v = r.displayName || r.name || "";
82
- return v !== "" ? n + "(" + v + ")" : n;
77
+ function Ze(e, n, a) {
78
+ var l = e.displayName;
79
+ if (l)
80
+ return l;
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")
@@ -94,34 +94,34 @@ function Sr() {
94
94
  switch (e) {
95
95
  case i:
96
96
  return "Fragment";
97
- case a:
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 j:
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 F:
111
- var r = e;
112
- return oe(r) + ".Consumer";
113
- case x:
110
+ case w:
114
111
  var n = e;
115
- return oe(n._context) + ".Provider";
116
- case m:
117
- return qe(e, e.render, "ForwardRef");
118
- case R:
119
- var s = e.displayName || null;
120
- return s !== null ? s : O(e.type) || "Memo";
121
- case w: {
122
- var v = e, p = v._payload, f = v._init;
112
+ return ie(n) + ".Consumer";
113
+ case j:
114
+ var a = e;
115
+ return ie(a._context) + ".Provider";
116
+ case x:
117
+ return Ze(e, e.render, "ForwardRef");
118
+ case E:
119
+ var l = e.displayName || null;
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(p));
124
+ return T(f(p));
125
125
  } catch {
126
126
  return null;
127
127
  }
@@ -129,14 +129,14 @@ function Sr() {
129
129
  }
130
130
  return null;
131
131
  }
132
- var P = Object.assign, N = 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 Je() {
136
+ function Qe() {
137
137
  {
138
- if (N === 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 Sr() {
153
153
  groupEnd: e
154
154
  });
155
155
  }
156
- N++;
156
+ z++;
157
157
  }
158
158
  }
159
- function Ge() {
159
+ function et() {
160
160
  {
161
- if (N--, N === 0) {
161
+ if (z--, z === 0) {
162
162
  var e = {
163
163
  configurable: !0,
164
164
  enumerable: !0,
@@ -166,7 +166,7 @@ function Sr() {
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 Sr() {
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
- N < 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 K = g.ReactCurrentDispatcher, H;
195
- function M(e, r, n) {
194
+ var G = v.ReactCurrentDispatcher, K;
195
+ function B(e, n, a) {
196
196
  {
197
- if (H === void 0)
197
+ if (K === void 0)
198
198
  try {
199
199
  throw Error();
200
- } catch (v) {
201
- var s = v.stack.trim().match(/\n( *(at )?)/);
202
- H = s && s[1] || "";
200
+ } catch (m) {
201
+ var l = m.stack.trim().match(/\n( *(at )?)/);
202
+ K = l && l[1] || "";
203
203
  }
204
204
  return `
205
- ` + H + e;
205
+ ` + K + e;
206
206
  }
207
207
  }
208
- var X = !1, Y;
208
+ var X = !1, W;
209
209
  {
210
- var Ke = typeof WeakMap == "function" ? WeakMap : Map;
211
- Y = new Ke();
210
+ var tt = typeof WeakMap == "function" ? WeakMap : Map;
211
+ W = new tt();
212
212
  }
213
- function pe(e, r) {
213
+ function pe(e, n) {
214
214
  if (!e || X)
215
215
  return "";
216
216
  {
217
- var n = Y.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
- var s;
221
+ var l;
222
222
  X = !0;
223
- var v = Error.prepareStackTrace;
223
+ var m = Error.prepareStackTrace;
224
224
  Error.prepareStackTrace = void 0;
225
225
  var p;
226
- p = K.current, K.current = null, Je();
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 Sr() {
236
236
  }), typeof Reflect == "object" && Reflect.construct) {
237
237
  try {
238
238
  Reflect.construct(f, []);
239
- } catch (T) {
240
- s = 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
- s = 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
- s = T;
254
+ } catch (_) {
255
+ l = _;
256
256
  }
257
257
  e();
258
258
  }
259
- } catch (T) {
260
- if (T && s && typeof T.stack == "string") {
261
- for (var c = T.stack.split(`
262
- `), _ = s.stack.split(`
263
- `), y = c.length - 1, E = _.length - 1; y >= 1 && E >= 0 && c[y] !== _[E]; )
264
- E--;
265
- for (; y >= 1 && E >= 0; y--, E--)
266
- if (c[y] !== _[E]) {
267
- if (y !== 1 || E !== 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--, E--, E < 0 || c[y] !== _[E]) {
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" && Y.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 && E >= 0);
274
+ while (b >= 1 && y >= 0);
275
275
  break;
276
276
  }
277
277
  }
278
278
  } finally {
279
- X = !1, K.current = p, Ge(), Error.prepareStackTrace = v;
279
+ X = !1, G.current = p, et(), Error.prepareStackTrace = m;
280
280
  }
281
- var D = e ? e.displayName || e.name : "", Se = D ? M(D) : "";
282
- return typeof e == "function" && Y.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 He(e, r, n) {
284
+ function rt(e, n, a) {
285
285
  return pe(e, !1);
286
286
  }
287
- function Xe(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 z(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 pe(e, Xe(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 j:
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 m:
307
- return He(e.render);
308
- case R:
309
- return z(e.type, r, n);
310
- case w: {
311
- var s = e, v = s._payload, p = s._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 z(p(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, me = {}, 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 = z(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 Ze(e, r, n, s, v) {
328
+ function st(e, n, a, l, m) {
329
329
  {
330
- var p = Function.call.bind(V);
330
+ var p = Function.call.bind(Y);
331
331
  for (var f in e)
332
332
  if (p(e, f)) {
333
- var c = void 0;
333
+ var u = void 0;
334
334
  try {
335
335
  if (typeof e[f] != "function") {
336
- var _ = Error((s || "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 _.name = "Invariant Violation", _;
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, s, 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).", s || "React class", n, f, typeof c), U(null)), c instanceof Error && !(c.message in me) && (me[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 Qe = Array.isArray;
347
+ var at = Array.isArray;
348
348
  function Z(e) {
349
- return Qe(e);
349
+ return at(e);
350
350
  }
351
- function er(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 rr(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 Ee(e) {
368
- if (rr(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.", er(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, tr = {
371
+ var ye = v.ReactCurrentOwner, lt = {
372
372
  key: !0,
373
373
  ref: !0,
374
374
  __self: !0,
375
375
  __source: !0
376
- }, xe, Fe;
377
- function nr(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 ir(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 ar(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 or(e, r) {
396
+ function ft(e, n) {
397
397
  {
398
- var n = function() {
399
- xe || (xe = !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 sr(e, r) {
407
+ function mt(e, n) {
408
408
  {
409
- var n = function() {
410
- Fe || (Fe = !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 lr = function(e, r, n, s, v, p, 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
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
- value: s
440
- }), Object.defineProperty(c, "_source", {
439
+ value: l
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 cr(e, r, n, s, v) {
447
+ function pt(e, n, a, l, m) {
448
448
  {
449
- var p, f = {}, c = null, _ = null;
450
- n !== void 0 && (Ee(n), c = "" + n), ir(r) && (Ee(r.key), c = "" + r.key), nr(r) && (_ = r.ref, ar(r, v));
451
- for (p in r)
452
- V.call(r, p) && !tr.hasOwnProperty(p) && (f[p] = r[p]);
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 (p in y)
456
- f[p] === void 0 && (f[p] = y[p]);
454
+ var b = e.defaultProps;
455
+ for (p in b)
456
+ f[p] === void 0 && (f[p] = b[p]);
457
457
  }
458
- if (c || _) {
459
- var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
460
- c && or(f, E), _ && sr(f, E);
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 lr(e, c, _, v, s, be.current, f);
462
+ return ht(e, u, R, m, l, ye.current, f);
463
463
  }
464
464
  }
465
- var Q = g.ReactCurrentOwner, Re = g.ReactDebugCurrentFrame;
466
- function I(e) {
465
+ var Q = v.ReactCurrentOwner, Ee = v.ReactDebugCurrentFrame;
466
+ function k(e) {
467
467
  if (e) {
468
- var r = e._owner, n = z(e.type, e._source, r ? r.type : null);
469
- Re.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
- Re.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 we() {
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 ur(e) {
490
+ function xt(e) {
491
491
  return "";
492
492
  }
493
- var _e = {};
494
- function fr(e) {
493
+ var Ce = {};
494
+ function vt(e) {
495
495
  {
496
- var r = we();
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 je(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 = fr(r);
512
- if (_e[n])
511
+ var a = vt(n);
512
+ if (Ce[a])
513
513
  return;
514
- _e[n] = !0;
515
- var s = "";
516
- e && e._owner && e._owner !== Q.current && (s = " It was passed a child from " + O(e._owner.type) + "."), I(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, s), I(null);
514
+ Ce[a] = !0;
515
+ var l = "";
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 s = e[n];
526
- re(s) && je(s, 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 = G(e);
532
- if (typeof v == "function" && v !== e.entries)
533
- for (var p = v.call(e), f; !(f = p.next()).done; )
534
- re(f.value) && je(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 dr(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 === m || // 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 === R))
549
- n = r.propTypes;
548
+ n.$$typeof === E))
549
+ a = n.propTypes;
550
550
  else
551
551
  return;
552
- if (n) {
553
- var s = O(r);
554
- Ze(n, e.props, "prop", s, 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 vr(e) {
563
+ function bt(e) {
564
564
  {
565
- for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
566
- var s = r[n];
567
- if (s !== "children" && s !== "key") {
568
- I(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), I(null);
565
+ for (var n = Object.keys(e.props), a = 0; a < n.length; a++) {
566
+ var l = n[a];
567
+ if (l !== "children" && l !== "key") {
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 && (I(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), I(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, s, v, p) {
575
+ function _e(e, n, a, l, m, p) {
576
576
  {
577
- var f = Ue(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 _ = ur();
582
- _ ? c += _ : c += we();
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 E = cr(e, r, n, v, p);
587
- if (E == null)
588
- return E;
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)
592
- if (s)
593
- if (Z(C)) {
594
- for (var D = 0; D < C.length; D++)
595
- Ce(C[D], e);
596
- Object.freeze && Object.freeze(C);
590
+ var F = n.children;
591
+ if (F !== void 0)
592
+ if (l)
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 === i ? vr(E) : dr(E), E;
602
+ return e === i ? bt(y) : gt(y), y;
603
603
  }
604
604
  }
605
- function hr(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 mr = pr, gr = hr;
612
- W.Fragment = i, W.jsx = mr, W.jsxs = gr;
613
- })()), W;
611
+ var wt = jt, Et = yt;
612
+ L.Fragment = i, L.jsx = wt, L.jsxs = Et;
613
+ })()), L;
614
614
  }
615
- var De;
616
- function Or() {
617
- return De || (De = 1, process.env.NODE_ENV === "production" ? q.exports = Tr() : q.exports = Sr()), 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 l = Or();
620
- function Pr(o) {
621
- const [t, a] = $([]), [i, d] = $(null), [b, x] = $(""), [F, m] = $(!1), [j, u] = $(null), R = A(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
- m(!0), u(null);
624
- const g = await o.getFiles();
625
- if (a(g), !i && g.length > 0) {
626
- const h = Ne(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
- m(!1);
632
+ x(!1);
633
633
  }
634
- }, [o, i]), w = A(
635
- async (g) => {
634
+ }, [o, i]), C = A(
635
+ async (v) => {
636
636
  try {
637
- m(!0), u(null);
638
- const h = await o.getFileContent(g);
639
- x(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
- ), x("");
643
+ ), j("");
644
644
  } finally {
645
- m(!1);
645
+ x(!1);
646
646
  }
647
647
  },
648
648
  [o]
649
649
  ), S = A(
650
- async (g) => {
650
+ async (v) => {
651
651
  if (i)
652
652
  try {
653
- u(null), await o.updateFileContent(i, g), x(g), a(
654
- (h) => Le(h, i, { 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
662
  [i, o]
663
- ), B = A(
664
- (g) => {
665
- d(g), w(g);
663
+ ), M = A(
664
+ (v) => {
665
+ c(v), C(v);
666
666
  },
667
- [w]
668
- ), J = A(() => {
669
- R();
670
- }, [R]), G = A(
671
- (g) => $e(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
- R();
676
- }, [R]), Oe(() => {
677
- i && w(i);
678
- }, [i, w]), {
679
- files: t,
674
+ return Te(() => {
675
+ E();
676
+ }, [E]), Te(() => {
677
+ i && C(i);
678
+ }, [i, C]), {
679
+ files: r,
680
680
  activeFile: i,
681
- fileContent: b,
682
- loading: F,
683
- error: j,
684
- setActiveFile: B,
681
+ fileContent: g,
682
+ loading: w,
683
+ error: N,
684
+ setActiveFile: M,
685
685
  updateFileContent: S,
686
- refreshFiles: J,
687
- getFileById: G
686
+ refreshFiles: H,
687
+ getFileById: J
688
688
  };
689
689
  }
690
- function Ne(o) {
691
- for (const t of o) {
692
- if (t.type === "file")
693
- return t;
694
- if (t.children) {
695
- const a = Ne(t.children);
696
- if (a) return a;
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 $e(o, t) {
702
- for (const a of o) {
703
- if (a.id === t) return a;
704
- if (a.children) {
705
- const i = $e(a.children, t);
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
706
  if (i) return i;
707
707
  }
708
708
  }
709
709
  return null;
710
710
  }
711
- function Le(o, t, a) {
712
- return o.map((i) => i.id === t ? { ...i, ...a } : i.children ? {
711
+ function Ye(o, r, s) {
712
+ return o.map((i) => i.id === r ? { ...i, ...s } : i.children ? {
713
713
  ...i,
714
- children: Le(i.children, t, a)
714
+ children: Ye(i.children, r, s)
715
715
  } : i);
716
716
  }
717
- class kr {
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, a) {
735
- const i = this.findFileById(t);
736
- i && (i.content = a), console.log(`Updated file ${t} with content:`, a);
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 kr {
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 kr {
767
767
  }
768
768
  ];
769
769
  }
770
- findFileById(t) {
771
- const a = (i) => {
772
- for (const d of i) {
773
- if (d.id === t) return d;
774
- if (d.children) {
775
- const b = a(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 a(this.files);
781
+ return s(this.files);
782
782
  }
783
783
  }
784
- class Ir {
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, a) {
799
- if (t === "form-code") {
800
- this.config.codeContent = a;
801
- const i = this.files.find((d) => d.id === t);
802
- i && (i.content = a);
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,25 +820,25 @@ class Ir {
820
820
  }
821
821
  ];
822
822
  }
823
- findFileById(t) {
824
- return this.files.find((a) => a.id === t) || null;
823
+ findFileById(r) {
824
+ return this.files.find((s) => s.id === r) || null;
825
825
  }
826
826
  }
827
- class Dr {
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 a = this.findFileById(t);
838
- if (!a || !a.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 i = await fetch(a.metadata.url);
841
+ const i = await fetch(s.metadata.url);
842
842
  if (!i.ok)
843
843
  throw new Error(`Failed to fetch file: ${i.statusText}`);
844
844
  return await i.text();
@@ -846,58 +846,58 @@ class Dr {
846
846
  throw new Error(`Error fetching file content: ${i}`);
847
847
  }
848
848
  }
849
- async updateFileContent(t, a) {
850
- console.log(`Would save file ${t} content to backend:`, a);
851
- const i = this.findFileById(t);
852
- i && (i.content = a);
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, a) => ({
859
- id: `url-file-${a}`,
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((a) => a.id === t) || null;
870
+ findFileById(r) {
871
+ return this.files.find((s) => s.id === r) || null;
872
872
  }
873
873
  }
874
- function Ar(o) {
874
+ function Xt(o) {
875
875
  if (o.workflowConfig)
876
- return new kr(o.workflowConfig);
876
+ return new Jt(o.workflowConfig);
877
877
  if (o.formConfig)
878
- return new Ir(o.formConfig);
878
+ return new Gt(o.formConfig);
879
879
  if (o.urlConfig)
880
- return new Dr(o.urlConfig);
880
+ return new Kt(o.urlConfig);
881
881
  throw new Error("No valid configuration provided");
882
882
  }
883
- const Nr = ({
883
+ const Zt = ({
884
884
  value: o,
885
- onChange: t,
886
- language: a = "javascript",
885
+ onChange: r,
886
+ language: s = "javascript",
887
887
  filename: i,
888
- readOnly: d = !1,
889
- loading: b = !1
888
+ readOnly: c = !1,
889
+ loading: g = !1
890
890
  }) => {
891
- const x = (F) => {
892
- F !== void 0 && t(F);
891
+ const j = (w) => {
892
+ w !== void 0 && r(w);
893
893
  };
894
- return /* @__PURE__ */ l.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ l.jsx(
895
- yr,
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: a,
898
+ defaultLanguage: s,
899
899
  defaultValue: o,
900
- onChange: x,
900
+ onChange: j,
901
901
  theme: "vs-light",
902
902
  options: {
903
903
  minimap: {
@@ -910,154 +910,158 @@ const Nr = ({
910
910
  top: 16
911
911
  },
912
912
  scrollBeyondLastLine: !1,
913
- readOnly: d
913
+ readOnly: c
914
914
  }
915
915
  }
916
916
  ) });
917
- }, $r = ({
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 = ({
918
944
  activePanel: o,
919
- setActivePanel: t
945
+ setActivePanel: r,
946
+ allowedRoutes: s = ["explorer"]
920
947
  }) => {
921
- const a = [
922
- {
923
- id: "explorer",
924
- icon: Ae,
925
- label: "Files"
926
- },
927
- {
928
- id: "data",
929
- icon: xr,
930
- label: "Data"
931
- },
932
- {
933
- id: "functions",
934
- icon: Fr,
935
- label: "Functions"
936
- },
937
- {
938
- id: "versions",
939
- icon: Rr,
940
- label: "Versions"
941
- },
942
- {
943
- id: "tests",
944
- icon: wr,
945
- label: "Tests"
946
- }
947
- ];
948
- return /* @__PURE__ */ l.jsxs("div", { className: "w-14 border-r border-slate-200 bg-white flex flex-col gap-4 items-center py-4", children: [
949
- a.map((i) => {
950
- const d = i.icon;
951
- return /* @__PURE__ */ l.jsx(Pe, { title: i.label, placement: "right", children: /* @__PURE__ */ l.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: o === i.id ? "primary" : "text",
955
- icon: /* @__PURE__ */ l.jsx(d, { size: 16 }),
956
- onClick: () => t(i.id)
958
+ type: o === c.id ? "primary" : "text",
959
+ icon: /* @__PURE__ */ t.jsx(g, { size: 16 }),
960
+ onClick: () => r(c.id)
957
961
  }
958
- ) }, i.id);
962
+ ) }, c.id);
959
963
  }),
960
- /* @__PURE__ */ l.jsx("div", { className: "mt-auto", children: /* @__PURE__ */ l.jsx(Pe, { title: "Settings", placement: "right", children: /* @__PURE__ */ l.jsx(te, { type: "text", icon: /* @__PURE__ */ l.jsx(_r, { 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
- }, Lr = ({
966
+ }, tr = ({
963
967
  leftPanel: o,
964
- editor: t,
965
- rightPanel: a,
968
+ editor: r,
969
+ rightPanel: s,
966
970
  activePanel: i,
967
- setActivePanel: d
968
- }) => /* @__PURE__ */ l.jsxs("div", { className: "flex flex-1 overflow-hidden", children: [
969
- /* @__PURE__ */ l.jsx($r, { activePanel: i, setActivePanel: d }),
970
- /* @__PURE__ */ l.jsx("div", { className: "flex-1", children: a ? /* @__PURE__ */ l.jsxs(
971
- k,
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__ */ l.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__ */ l.jsx("div", { className: "h-full overflow-y-auto", children: o })
988
+ children: /* @__PURE__ */ t.jsx("div", { className: "h-full overflow-y-auto", children: o })
985
989
  }
986
990
  ),
987
- /* @__PURE__ */ l.jsx(k.Panel, { defaultSize: "50%", min: "30%", children: t }),
988
- /* @__PURE__ */ l.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__ */ l.jsx("div", { className: "h-full overflow-y-auto", children: a })
999
+ children: /* @__PURE__ */ t.jsx("div", { className: "h-full overflow-y-auto", children: s })
996
1000
  }
997
1001
  )
998
1002
  ]
999
1003
  }
1000
- ) : /* @__PURE__ */ l.jsxs(k, { style: { height: "100%" }, children: [
1001
- /* @__PURE__ */ l.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__ */ l.jsx("div", { className: "h-full overflow-y-auto", children: o })
1012
+ children: /* @__PURE__ */ t.jsx("div", { className: "h-full overflow-y-auto", children: o })
1009
1013
  }
1010
1014
  ),
1011
- /* @__PURE__ */ l.jsx(k.Panel, { defaultSize: "75%", min: "60%", children: t })
1015
+ /* @__PURE__ */ t.jsx(O.Panel, { defaultSize: "75%", min: "60%", children: r })
1012
1016
  ] }) })
1013
- ] }), Wr = ({
1017
+ ] }), rr = ({
1014
1018
  files: o,
1015
- activeFile: t,
1016
- onFileSelect: a,
1019
+ activeFile: r,
1020
+ onFileSelect: s,
1017
1021
  loading: i = !1,
1018
- error: d = null,
1019
- onRefresh: b
1022
+ error: c = null,
1023
+ onRefresh: g
1020
1024
  }) => {
1021
- const x = (j) => j.map((u) => ({
1022
- title: u.name,
1023
- key: u.id,
1024
- icon: u.type === "file" ? /* @__PURE__ */ l.jsx(Cr, { size: 16, className: "text-slate-500 flex" }) : /* @__PURE__ */ l.jsx(Ae, { size: 16, className: "text-slate-500 flex" }),
1025
- isLeaf: u.type === "file",
1026
- children: u.children ? x(u.children) : void 0,
1027
- metadata: u.metadata
1028
- })), F = x(o), m = (j, u) => {
1029
- u?.node.isLeaf && u.node.key && a(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__ */ l.jsxs("div", { className: "h-full", children: [
1032
- /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between p-4 border-b border-slate-200", children: [
1033
- /* @__PURE__ */ l.jsx("h2", { className: "font-medium text-sm", children: "Files" }),
1034
- /* @__PURE__ */ l.jsx("div", { className: "flex items-center gap-2", children: b && /* @__PURE__ */ l.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__ */ l.jsx(jr, { size: 16 }),
1039
- onClick: b,
1042
+ icon: /* @__PURE__ */ t.jsx(St, { size: 16 }),
1043
+ onClick: g,
1040
1044
  loading: i,
1041
1045
  title: "Refresh files"
1042
1046
  }
1043
1047
  ) })
1044
1048
  ] }),
1045
- /* @__PURE__ */ l.jsxs("div", { className: "p-2", children: [
1046
- d && /* @__PURE__ */ l.jsx(
1047
- Er,
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__ */ l.jsx(
1056
- br,
1059
+ /* @__PURE__ */ t.jsx(
1060
+ Ft,
1057
1061
  {
1058
- treeData: F,
1059
- onSelect: m,
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,116 +1070,523 @@ const Nr = ({
1066
1070
  )
1067
1071
  ] })
1068
1072
  ] });
1069
- }, ie = ({
1073
+ }, se = ({
1070
1074
  config: o,
1071
- rightPanel: t = !1
1075
+ rightPanel: r = !1
1072
1076
  }) => {
1073
- const a = ne.useMemo(
1074
- () => Ar(o),
1077
+ const s = ne.useMemo(
1078
+ () => Xt(o),
1075
1079
  [o]
1076
1080
  );
1077
1081
  console.log({ config: o });
1078
1082
  const {
1079
1083
  files: i,
1080
- activeFile: d,
1081
- fileContent: b,
1082
- loading: x,
1083
- error: F,
1084
- setActiveFile: m,
1085
- updateFileContent: j,
1086
- refreshFiles: u,
1087
- getFileById: R
1088
- } = Pr(a), w = d ? R(d) : null, S = w?.metadata?.language || "javascript";
1089
- return /* @__PURE__ */ l.jsx(
1090
- Lr,
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__ */ l.jsx(
1093
- Wr,
1096
+ leftPanel: /* @__PURE__ */ t.jsx(
1097
+ rr,
1094
1098
  {
1095
1099
  files: i,
1096
- activeFile: d,
1097
- onFileSelect: m,
1098
- loading: x,
1099
- error: F,
1100
- onRefresh: u
1100
+ activeFile: c,
1101
+ onFileSelect: x,
1102
+ loading: j,
1103
+ error: w,
1104
+ onRefresh: d
1101
1105
  }
1102
1106
  ),
1103
- editor: /* @__PURE__ */ l.jsx(
1104
- Nr,
1107
+ editor: /* @__PURE__ */ t.jsx(
1108
+ Zt,
1105
1109
  {
1106
- value: b,
1107
- onChange: j,
1110
+ value: g,
1111
+ onChange: N,
1108
1112
  language: S,
1109
- filename: w?.name,
1113
+ filename: C?.name,
1110
1114
  readOnly: o.settings?.readOnly,
1111
- loading: x
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
- }, Vr = ({
1124
+ }, or = ({
1121
1125
  functionId: o,
1122
- version: t,
1123
- versionList: a,
1126
+ version: r,
1127
+ versionList: s,
1124
1128
  fetchFunction: i,
1125
- fetchVersionList: d
1129
+ fetchVersionList: c
1126
1130
  }) => {
1127
- const b = {
1131
+ const g = {
1128
1132
  workflowConfig: {
1129
1133
  functionId: o,
1130
- version: t,
1131
- versionList: a,
1134
+ version: r,
1135
+ versionList: s,
1132
1136
  fetchFunction: i,
1133
- fetchVersionList: d
1137
+ fetchVersionList: c
1134
1138
  }
1135
1139
  };
1136
- return /* @__PURE__ */ l.jsx(ie, { config: b });
1137
- }, Ur = ({
1140
+ return /* @__PURE__ */ t.jsx(se, { config: g });
1141
+ }, lr = ({
1138
1142
  codeContent: o,
1139
- fileName: t = "code.js",
1140
- language: a = "javascript",
1143
+ fileName: r = "code.js",
1144
+ language: s = "javascript",
1141
1145
  readOnly: i = !1
1142
1146
  }) => {
1143
- const d = {
1147
+ const c = {
1144
1148
  formConfig: {
1145
1149
  codeContent: o,
1146
- fileName: t,
1147
- language: a
1150
+ fileName: r,
1151
+ language: s
1148
1152
  },
1149
1153
  settings: {
1150
1154
  readOnly: i
1151
1155
  }
1152
1156
  };
1153
- return /* @__PURE__ */ l.jsx(ie, { config: d });
1154
- }, qr = ({ fileUrls: o, rightPanel: t }) => {
1155
- const a = {
1157
+ return /* @__PURE__ */ t.jsx(se, { config: c });
1158
+ }, cr = ({ fileUrls: o, rightPanel: r }) => {
1159
+ const s = {
1156
1160
  urlConfig: {
1157
1161
  fileUrls: o
1158
1162
  }
1159
1163
  };
1160
- return /* @__PURE__ */ l.jsx(ie, { config: a, rightPanel: t });
1161
- }, Jr = "1.0.0";
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 })
1173
+ ] }),
1174
+ /* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-2", children: [
1175
+ /* @__PURE__ */ t.jsx(
1176
+ "button",
1177
+ {
1178
+ className: "p-1.5 hover:bg-slate-100 rounded-md text-slate-600",
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 })
1182
+ }
1183
+ ),
1184
+ /* @__PURE__ */ t.jsx(
1185
+ "button",
1186
+ {
1187
+ className: "p-1.5 hover:bg-slate-100 rounded-md text-slate-600",
1188
+ title: "Version History",
1189
+ children: /* @__PURE__ */ t.jsx($e, { size: 18 })
1190
+ }
1191
+ ),
1192
+ /* @__PURE__ */ t.jsx(
1193
+ "button",
1194
+ {
1195
+ className: "p-1.5 hover:bg-slate-100 rounded-md text-slate-600",
1196
+ title: "Run Code",
1197
+ children: /* @__PURE__ */ t.jsx(Me, { size: 18 })
1198
+ }
1199
+ ),
1200
+ /* @__PURE__ */ t.jsx(
1201
+ "button",
1202
+ {
1203
+ className: "p-1.5 hover:bg-slate-100 rounded-md text-slate-600",
1204
+ title: "Export",
1205
+ children: /* @__PURE__ */ t.jsx(It, { size: 18 })
1206
+ }
1207
+ ),
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" }),
1210
+ " Save"
1211
+ ] }),
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" }),
1214
+ " ",
1215
+ "Draft"
1216
+ ] })
1217
+ ] })
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";
1162
1567
  export {
1163
- Hr as Alert,
1164
- Xr as Button,
1165
- Nr as CodeEditor,
1166
- ie as CodeEditorWrapper,
1167
- Lr as EditorLayout,
1168
- Wr as FileExplorer,
1169
- Ur as FormCodeEditor,
1170
- Ir as FormFileProvider,
1171
- Zr as Splitter,
1172
- Qr as Tooltip,
1173
- et as Tree,
1174
- qr as URLCodeEditor,
1175
- Dr as URLFileProvider,
1176
- Jr as VERSION,
1177
- Vr as WorkflowCodeEditor,
1178
- kr as WorkflowFileProvider,
1179
- Ar as createFileProvider,
1180
- Pr 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
1181
1592
  };