x-block-lib 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,930 @@
1
+ import { B as ge } from "./blockly-ByC0ID0H.js";
2
+ import { getCurrentInstance as oe, inject as re, hasInjectionContext as _e, ref as O, watch as ne, reactive as Ee, markRaw as V, effectScope as ve, isRef as A, isReactive as z, toRef as B, toRaw as Ne, nextTick as J, computed as ae, getCurrentScope as Oe, onScopeDispose as Ce, toRefs as Z } from "vue";
3
+ const {
4
+ ASTNode: Ge,
5
+ BasicCursor: He,
6
+ Block: qe,
7
+ BlockSvg: Xe,
8
+ Blocks: Ye,
9
+ COLLAPSED_FIELD_NAME: Je,
10
+ COLLAPSED_INPUT_NAME: Ze,
11
+ COLLAPSE_CHARS: Qe,
12
+ CodeGenerator: Ke,
13
+ CollapsibleToolboxCategory: et,
14
+ ComponentManager: tt,
15
+ Connection: ot,
16
+ ConnectionChecker: rt,
17
+ ConnectionDB: nt,
18
+ ConnectionType: at,
19
+ ContextMenu: st,
20
+ ContextMenuItems: ct,
21
+ ContextMenuRegistry: it,
22
+ Css: lt,
23
+ Cursor: ut,
24
+ DELETE_VARIABLE_ID: dt,
25
+ DeleteArea: ft,
26
+ DragTarget: mt,
27
+ DropDownDiv: yt,
28
+ Events: ht,
29
+ Extensions: pt,
30
+ Field: bt,
31
+ FieldCheckbox: gt,
32
+ FieldDropdown: _t,
33
+ FieldImage: Et,
34
+ FieldLabel: vt,
35
+ FieldLabelSerializable: Nt,
36
+ FieldNumber: Ot,
37
+ FieldTextInput: Ct,
38
+ FieldVariable: kt,
39
+ Flyout: Tt,
40
+ FlyoutButton: Pt,
41
+ FlyoutMetricsManager: St,
42
+ Generator: Dt,
43
+ Gesture: Vt,
44
+ Grid: wt,
45
+ HorizontalFlyout: xt,
46
+ INPUT_VALUE: At,
47
+ Input: Mt,
48
+ InsertionMarkerManager: It,
49
+ InsertionMarkerPreviewer: jt,
50
+ Marker: Rt,
51
+ MarkerManager: Lt,
52
+ Menu: Bt,
53
+ MenuItem: Ft,
54
+ MetricsManager: $t,
55
+ Msg: Ut,
56
+ NEXT_STATEMENT: Wt,
57
+ Names: zt,
58
+ OPPOSITE_TYPE: Gt,
59
+ OUTPUT_VALUE: Ht,
60
+ Options: qt,
61
+ PREVIOUS_STATEMENT: Xt,
62
+ PROCEDURE_CATEGORY_NAME: Yt,
63
+ Procedures: Jt,
64
+ RENAME_VARIABLE_ID: Zt,
65
+ RenderedConnection: Qt,
66
+ Scrollbar: Kt,
67
+ ScrollbarPair: eo,
68
+ ShortcutItems: to,
69
+ ShortcutRegistry: oo,
70
+ TOOLBOX_AT_BOTTOM: ro,
71
+ TOOLBOX_AT_LEFT: no,
72
+ TOOLBOX_AT_RIGHT: ao,
73
+ TOOLBOX_AT_TOP: so,
74
+ TabNavigateCursor: co,
75
+ Theme: se,
76
+ ThemeManager: io,
77
+ Themes: R,
78
+ Toolbox: lo,
79
+ ToolboxCategory: uo,
80
+ ToolboxItem: fo,
81
+ ToolboxSeparator: mo,
82
+ Tooltip: yo,
83
+ Touch: ho,
84
+ Trashcan: po,
85
+ UnattachedFieldError: bo,
86
+ VARIABLE_CATEGORY_NAME: go,
87
+ VARIABLE_DYNAMIC_CATEGORY_NAME: _o,
88
+ VERSION: Eo,
89
+ VariableMap: vo,
90
+ VariableModel: No,
91
+ Variables: Oo,
92
+ VariablesDynamic: Co,
93
+ VerticalFlyout: ko,
94
+ WidgetDiv: To,
95
+ Workspace: Po,
96
+ WorkspaceAudio: So,
97
+ WorkspaceDragger: Do,
98
+ WorkspaceSvg: Vo,
99
+ Xml: wo,
100
+ ZoomControls: xo,
101
+ blockAnimations: Ao,
102
+ blockRendering: Mo,
103
+ browserEvents: Io,
104
+ bubbles: jo,
105
+ bumpObjects: Ro,
106
+ clipboard: Lo,
107
+ comments: Bo,
108
+ common: Fo,
109
+ config: $o,
110
+ constants: Uo,
111
+ defineBlocksWithJsonArray: Wo,
112
+ dialog: ce,
113
+ dragging: zo,
114
+ fieldRegistry: Go,
115
+ geras: Ho,
116
+ getMainWorkspace: ke,
117
+ getSelected: qo,
118
+ hasBubble: Xo,
119
+ hideChaff: Yo,
120
+ icons: Jo,
121
+ inject: Zo,
122
+ inputs: Qo,
123
+ isCopyable: Ko,
124
+ isDeletable: er,
125
+ isDraggable: tr,
126
+ isIcon: or,
127
+ isObservable: rr,
128
+ isPaster: nr,
129
+ isRenderedElement: ar,
130
+ isSelectable: sr,
131
+ isSerializable: cr,
132
+ isVariableBackedParameterModel: ir,
133
+ procedures: lr,
134
+ registry: ur,
135
+ renderManagement: dr,
136
+ serialization: fr,
137
+ setLocale: Te,
138
+ setParentContainer: mr,
139
+ svgResize: yr,
140
+ thrasos: hr,
141
+ uiPosition: pr,
142
+ utils: br,
143
+ zelos: gr
144
+ } = ge;
145
+ function Pe(e, r) {
146
+ const o = oe();
147
+ if (!o)
148
+ throw new Error(`[Vuetify] ${e} must be called from inside a setup function`);
149
+ return o;
150
+ }
151
+ const Se = Symbol.for("vuetify:theme");
152
+ function De() {
153
+ Pe("useTheme");
154
+ const e = re(Se, null);
155
+ if (!e)
156
+ throw new Error("Could not find Vuetify theme injection");
157
+ return e;
158
+ }
159
+ var Ve = !1;
160
+ function I(e, r, o) {
161
+ return Array.isArray(e) ? (e.length = Math.max(e.length, r), e.splice(r, 1, o), o) : (e[r] = o, o);
162
+ }
163
+ function F(e, r) {
164
+ if (Array.isArray(e)) {
165
+ e.splice(r, 1);
166
+ return;
167
+ }
168
+ delete e[r];
169
+ }
170
+ var i = {};
171
+ let w;
172
+ const j = (e) => w = e, we = i.NODE_ENV !== "production" ? Symbol("pinia") : (
173
+ /* istanbul ignore next */
174
+ Symbol()
175
+ );
176
+ function C(e) {
177
+ return e && typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" && typeof e.toJSON != "function";
178
+ }
179
+ var x;
180
+ (function(e) {
181
+ e.direct = "direct", e.patchObject = "patch object", e.patchFunction = "patch function";
182
+ })(x || (x = {}));
183
+ const G = typeof window < "u", $ = (i.NODE_ENV !== "production" || !1) && i.NODE_ENV !== "test" && G;
184
+ function ie(e, r) {
185
+ for (const o in r) {
186
+ const t = r[o];
187
+ if (!(o in e))
188
+ continue;
189
+ const s = e[o];
190
+ C(s) && C(t) && !A(t) && !z(t) ? e[o] = ie(s, t) : e[o] = t;
191
+ }
192
+ return e;
193
+ }
194
+ const le = () => {
195
+ };
196
+ function Q(e, r, o, t = le) {
197
+ e.push(r);
198
+ const s = () => {
199
+ const l = e.indexOf(r);
200
+ l > -1 && (e.splice(l, 1), t());
201
+ };
202
+ return !o && Oe() && Ce(s), s;
203
+ }
204
+ function T(e, ...r) {
205
+ e.slice().forEach((o) => {
206
+ o(...r);
207
+ });
208
+ }
209
+ const xe = (e) => e();
210
+ function U(e, r) {
211
+ e instanceof Map && r instanceof Map && r.forEach((o, t) => e.set(t, o)), e instanceof Set && r instanceof Set && r.forEach(e.add, e);
212
+ for (const o in r) {
213
+ if (!r.hasOwnProperty(o))
214
+ continue;
215
+ const t = r[o], s = e[o];
216
+ C(s) && C(t) && e.hasOwnProperty(o) && !A(t) && !z(t) ? e[o] = U(s, t) : e[o] = t;
217
+ }
218
+ return e;
219
+ }
220
+ const Ae = i.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
221
+ /* istanbul ignore next */
222
+ Symbol()
223
+ );
224
+ function Me(e) {
225
+ return !C(e) || !e.hasOwnProperty(Ae);
226
+ }
227
+ const { assign: v } = Object;
228
+ function K(e) {
229
+ return !!(A(e) && e.effect);
230
+ }
231
+ function ee(e, r, o, t) {
232
+ const { state: s, actions: l, getters: h } = r, u = o.state.value[e];
233
+ let f;
234
+ function m() {
235
+ !u && (i.NODE_ENV === "production" || !t) && (o.state.value[e] = s ? s() : {});
236
+ const p = i.NODE_ENV !== "production" && t ? (
237
+ // use ref() to unwrap refs inside state TODO: check if this is still necessary
238
+ Z(O(s ? s() : {}).value)
239
+ ) : Z(o.state.value[e]);
240
+ return v(p, l, Object.keys(h || {}).reduce((y, b) => (i.NODE_ENV !== "production" && b in p && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${b}" in store "${e}".`), y[b] = V(ae(() => {
241
+ j(o);
242
+ const _ = o._s.get(e);
243
+ return h[b].call(_, _);
244
+ })), y), {}));
245
+ }
246
+ return f = W(e, m, r, o, t, !0), f;
247
+ }
248
+ function W(e, r, o = {}, t, s, l) {
249
+ let h;
250
+ const u = v({ actions: {} }, o);
251
+ if (i.NODE_ENV !== "production" && !t._e.active)
252
+ throw new Error("Pinia destroyed");
253
+ const f = {
254
+ deep: !0
255
+ // flush: 'post',
256
+ };
257
+ i.NODE_ENV !== "production" && !Ve && (f.onTrigger = (a) => {
258
+ m ? _ = a : m == !1 && !c._hotUpdating && (Array.isArray(_) ? _.push(a) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
259
+ });
260
+ let m, p, y = [], b = [], _;
261
+ const k = t.state.value[e];
262
+ !l && !k && (i.NODE_ENV === "production" || !s) && (t.state.value[e] = {});
263
+ const L = O({});
264
+ let H;
265
+ function q(a) {
266
+ let n;
267
+ m = p = !1, i.NODE_ENV !== "production" && (_ = []), typeof a == "function" ? (a(t.state.value[e]), n = {
268
+ type: x.patchFunction,
269
+ storeId: e,
270
+ events: _
271
+ }) : (U(t.state.value[e], a), n = {
272
+ type: x.patchObject,
273
+ payload: a,
274
+ storeId: e,
275
+ events: _
276
+ });
277
+ const d = H = Symbol();
278
+ J().then(() => {
279
+ H === d && (m = !0);
280
+ }), p = !0, T(y, n, t.state.value[e]);
281
+ }
282
+ const ye = l ? function() {
283
+ const { state: n } = o, d = n ? n() : {};
284
+ this.$patch((g) => {
285
+ v(g, d);
286
+ });
287
+ } : (
288
+ /* istanbul ignore next */
289
+ i.NODE_ENV !== "production" ? () => {
290
+ throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`);
291
+ } : le
292
+ );
293
+ function he() {
294
+ h.stop(), y = [], b = [], t._s.delete(e);
295
+ }
296
+ function X(a, n) {
297
+ return function() {
298
+ j(t);
299
+ const d = Array.from(arguments), g = [], S = [];
300
+ function pe(E) {
301
+ g.push(E);
302
+ }
303
+ function be(E) {
304
+ S.push(E);
305
+ }
306
+ T(b, {
307
+ args: d,
308
+ name: a,
309
+ store: c,
310
+ after: pe,
311
+ onError: be
312
+ });
313
+ let D;
314
+ try {
315
+ D = n.apply(this && this.$id === e ? this : c, d);
316
+ } catch (E) {
317
+ throw T(S, E), E;
318
+ }
319
+ return D instanceof Promise ? D.then((E) => (T(g, E), E)).catch((E) => (T(S, E), Promise.reject(E))) : (T(g, D), D);
320
+ };
321
+ }
322
+ const M = /* @__PURE__ */ V({
323
+ actions: {},
324
+ getters: {},
325
+ state: [],
326
+ hotState: L
327
+ }), Y = {
328
+ _p: t,
329
+ // _s: scope,
330
+ $id: e,
331
+ $onAction: Q.bind(null, b),
332
+ $patch: q,
333
+ $reset: ye,
334
+ $subscribe(a, n = {}) {
335
+ const d = Q(y, a, n.detached, () => g()), g = h.run(() => ne(() => t.state.value[e], (S) => {
336
+ (n.flush === "sync" ? p : m) && a({
337
+ storeId: e,
338
+ type: x.direct,
339
+ events: _
340
+ }, S);
341
+ }, v({}, f, n)));
342
+ return d;
343
+ },
344
+ $dispose: he
345
+ }, c = Ee(i.NODE_ENV !== "production" || $ ? v(
346
+ {
347
+ _hmrPayload: M,
348
+ _customProperties: V(/* @__PURE__ */ new Set())
349
+ // devtools custom properties
350
+ },
351
+ Y
352
+ // must be added later
353
+ // setupStore
354
+ ) : Y);
355
+ t._s.set(e, c);
356
+ const N = (t._a && t._a.runWithContext || xe)(() => t._e.run(() => (h = ve()).run(r)));
357
+ for (const a in N) {
358
+ const n = N[a];
359
+ if (A(n) && !K(n) || z(n))
360
+ i.NODE_ENV !== "production" && s ? I(L.value, a, B(N, a)) : l || (k && Me(n) && (A(n) ? n.value = k[a] : U(n, k[a])), t.state.value[e][a] = n), i.NODE_ENV !== "production" && M.state.push(a);
361
+ else if (typeof n == "function") {
362
+ const d = i.NODE_ENV !== "production" && s ? n : X(a, n);
363
+ N[a] = d, i.NODE_ENV !== "production" && (M.actions[a] = n), u.actions[a] = n;
364
+ } else
365
+ i.NODE_ENV !== "production" && K(n) && (M.getters[a] = l ? (
366
+ // @ts-expect-error
367
+ o.getters[a]
368
+ ) : n, G && (N._getters || // @ts-expect-error: same
369
+ (N._getters = V([]))).push(a));
370
+ }
371
+ if (v(c, N), v(Ne(c), N), Object.defineProperty(c, "$state", {
372
+ get: () => i.NODE_ENV !== "production" && s ? L.value : t.state.value[e],
373
+ set: (a) => {
374
+ if (i.NODE_ENV !== "production" && s)
375
+ throw new Error("cannot set hotState");
376
+ q((n) => {
377
+ v(n, a);
378
+ });
379
+ }
380
+ }), i.NODE_ENV !== "production" && (c._hotUpdate = V((a) => {
381
+ c._hotUpdating = !0, a._hmrPayload.state.forEach((n) => {
382
+ if (n in c.$state) {
383
+ const d = a.$state[n], g = c.$state[n];
384
+ typeof d == "object" && C(d) && C(g) ? ie(d, g) : a.$state[n] = g;
385
+ }
386
+ I(c, n, B(a.$state, n));
387
+ }), Object.keys(c.$state).forEach((n) => {
388
+ n in a.$state || F(c, n);
389
+ }), m = !1, p = !1, t.state.value[e] = B(a._hmrPayload, "hotState"), p = !0, J().then(() => {
390
+ m = !0;
391
+ });
392
+ for (const n in a._hmrPayload.actions) {
393
+ const d = a[n];
394
+ I(c, n, X(n, d));
395
+ }
396
+ for (const n in a._hmrPayload.getters) {
397
+ const d = a._hmrPayload.getters[n], g = l ? (
398
+ // special handling of options api
399
+ ae(() => (j(t), d.call(c, c)))
400
+ ) : d;
401
+ I(c, n, g);
402
+ }
403
+ Object.keys(c._hmrPayload.getters).forEach((n) => {
404
+ n in a._hmrPayload.getters || F(c, n);
405
+ }), Object.keys(c._hmrPayload.actions).forEach((n) => {
406
+ n in a._hmrPayload.actions || F(c, n);
407
+ }), c._hmrPayload = a._hmrPayload, c._getters = a._getters, c._hotUpdating = !1;
408
+ })), $) {
409
+ const a = {
410
+ writable: !0,
411
+ configurable: !0,
412
+ // avoid warning on devtools trying to display this property
413
+ enumerable: !1
414
+ };
415
+ ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((n) => {
416
+ Object.defineProperty(c, n, v({ value: c[n] }, a));
417
+ });
418
+ }
419
+ return t._p.forEach((a) => {
420
+ if ($) {
421
+ const n = h.run(() => a({
422
+ store: c,
423
+ app: t._a,
424
+ pinia: t,
425
+ options: u
426
+ }));
427
+ Object.keys(n || {}).forEach((d) => c._customProperties.add(d)), v(c, n);
428
+ } else
429
+ v(c, h.run(() => a({
430
+ store: c,
431
+ app: t._a,
432
+ pinia: t,
433
+ options: u
434
+ })));
435
+ }), i.NODE_ENV !== "production" && c.$state && typeof c.$state == "object" && typeof c.$state.constructor == "function" && !c.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
436
+ state: () => new MyClass()
437
+ Found in store "${c.$id}".`), k && l && o.hydrate && o.hydrate(c.$state, k), m = !0, p = !0, c;
438
+ }
439
+ function ue(e, r, o) {
440
+ let t, s;
441
+ const l = typeof r == "function";
442
+ if (typeof e == "string")
443
+ t = e, s = l ? o : r;
444
+ else if (s = e, t = e.id, i.NODE_ENV !== "production" && typeof t != "string")
445
+ throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');
446
+ function h(u, f) {
447
+ const m = _e();
448
+ if (u = // in test mode, ignore the argument provided as we can always retrieve a
449
+ // pinia instance with getActivePinia()
450
+ (i.NODE_ENV === "test" && w && w._testing ? null : u) || (m ? re(we, null) : null), u && j(u), i.NODE_ENV !== "production" && !w)
451
+ throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
452
+ See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
453
+ This will fail in production.`);
454
+ u = w, u._s.has(t) || (l ? W(t, r, s, u) : ee(t, s, u), i.NODE_ENV !== "production" && (h._pinia = u));
455
+ const p = u._s.get(t);
456
+ if (i.NODE_ENV !== "production" && f) {
457
+ const y = "__hot:" + t, b = l ? W(y, r, s, u, !0) : ee(y, v({}, s), u, !0);
458
+ f._hotUpdate(b), delete u.state.value[y], u._s.delete(y);
459
+ }
460
+ if (i.NODE_ENV !== "production" && G) {
461
+ const y = oe();
462
+ if (y && y.proxy && // avoid adding stores that are just built for hot module replacement
463
+ !f) {
464
+ const b = y.proxy, _ = "_pStores" in b ? b._pStores : b._pStores = {};
465
+ _[t] = p;
466
+ }
467
+ }
468
+ return p;
469
+ }
470
+ return h.$id = t, h;
471
+ }
472
+ (function() {
473
+ try {
474
+ if (typeof document < "u") {
475
+ var e = document.createElement("style");
476
+ e.appendChild(document.createTextNode('.inner-left-enter-active,.inner-right-enter-active{transition:transform .35s ease}.inner-left-enter-from{transform:translate(-100%)}.inner-right-enter-from{transform:translate(100%)}.inner-left-enter-to,.inner-right-enter-to{transform:translate(0)}.x-cont[data-v-a8f3d91f]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-a8f3d91f]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-a8f3d91f]{transform-origin:20px 20px;animation:lds-spinner-a8f3d91f 1.2s linear infinite}.lds-spinner div[data-v-a8f3d91f]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-a8f3d91f]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-a8f3d91f]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-a8f3d91f]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-a8f3d91f]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-a8f3d91f]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-a8f3d91f]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-a8f3d91f]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-a8f3d91f]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-a8f3d91f]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-a8f3d91f{0%{opacity:1}to{opacity:0}}.x-cont[data-v-70ed4b89]{position:absolute;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')), document.head.appendChild(e);
477
+ }
478
+ } catch (r) {
479
+ console.error("vite-plugin-css-injected-by-js", r);
480
+ }
481
+ })();
482
+ ue("viewMgr", () => {
483
+ const e = O([]);
484
+ function r() {
485
+ return e.value.length <= 0;
486
+ }
487
+ function o() {
488
+ const f = e.value.length;
489
+ if (f > 0)
490
+ return e.value[f - 1];
491
+ }
492
+ function t(f) {
493
+ return e.value.find((m) => m === f) !== void 0;
494
+ }
495
+ function s(f) {
496
+ l(f), e.value.push(f);
497
+ }
498
+ function l(f) {
499
+ const m = e.value.findIndex((p) => p === f);
500
+ m !== -1 && e.value.splice(m, 1);
501
+ }
502
+ function h() {
503
+ e.value.pop();
504
+ }
505
+ function u() {
506
+ e.value = [];
507
+ }
508
+ return { isEmpty: r, lastView: o, hasView: t, addView: s, delView: l, popView: h, clearViews: u };
509
+ });
510
+ function Ie(e) {
511
+ return { all: e = e || /* @__PURE__ */ new Map(), on: function(r, o) {
512
+ var t = e.get(r);
513
+ t ? t.push(o) : e.set(r, [o]);
514
+ }, off: function(r, o) {
515
+ var t = e.get(r);
516
+ t && (o ? t.splice(t.indexOf(o) >>> 0, 1) : e.set(r, []));
517
+ }, emit: function(r, o) {
518
+ var t = e.get(r);
519
+ t && t.slice().map(function(s) {
520
+ s(o);
521
+ }), (t = e.get("*")) && t.slice().map(function(s) {
522
+ s(r, o);
523
+ });
524
+ } };
525
+ }
526
+ const P = Ie();
527
+ async function de(e, r, o) {
528
+ return new Promise((t) => {
529
+ const s = async () => {
530
+ e() ? t(!0) : setTimeout(s, 30);
531
+ };
532
+ s();
533
+ });
534
+ }
535
+ ue(
536
+ "global",
537
+ () => {
538
+ const e = De(), r = O(!1);
539
+ ne(
540
+ r,
541
+ (l) => {
542
+ e.global.name.value = l ? "dark" : "light";
543
+ },
544
+ {
545
+ immediate: !0
546
+ }
547
+ );
548
+ const o = O("en"), t = O({}), s = O("");
549
+ return {
550
+ dark: r,
551
+ locale: o,
552
+ permissionObjects: t,
553
+ permissionChecksum: s
554
+ };
555
+ },
556
+ {
557
+ persist: [
558
+ {
559
+ storage: localStorage,
560
+ paths: ["dark", "locale", "permissionObjects", "permissionChecksum"]
561
+ }
562
+ ]
563
+ }
564
+ );
565
+ require("js-cookie");
566
+ let te = Date.now();
567
+ function fe() {
568
+ const e = Date.now();
569
+ return e - te > 500 ? (te = e, !0) : !1;
570
+ }
571
+ let je = 0;
572
+ function me() {
573
+ return ++je;
574
+ }
575
+ async function Re(e) {
576
+ if (!fe())
577
+ return;
578
+ let r = !1, o;
579
+ const t = (l) => {
580
+ o = l, r = !0;
581
+ }, s = me();
582
+ return P.on("confirmDlgResult" + s, t), P.emit("confirmDlg", { ...e, seq: s }), await de(() => r), P.off("confirmDlgResult" + s, t), o;
583
+ }
584
+ async function Le(e) {
585
+ if (!fe())
586
+ return;
587
+ let r = !1, o;
588
+ const t = (l) => {
589
+ o = l, r = !0;
590
+ }, s = me();
591
+ return P.on("promptDlgResult" + s, t), P.emit("promptDlg", { ...e, seq: s }), await de(() => r), P.off("promptDlgResult" + s, t), o;
592
+ }
593
+ require("js-cookie");
594
+ O("");
595
+ ce.setConfirm(async (e, r) => {
596
+ const o = await Re({
597
+ title: "",
598
+ text: e
599
+ });
600
+ r(!!o);
601
+ });
602
+ ce.setPrompt(async (e, r, o) => {
603
+ const t = await Le({
604
+ title: "",
605
+ value: r
606
+ });
607
+ o(t);
608
+ });
609
+ const Be = (e, r) => {
610
+ const o = e[r];
611
+ return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((t, s) => {
612
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(s.bind(null, new Error("Unknown variable dynamic import: " + r)));
613
+ });
614
+ };
615
+ async function _r(e) {
616
+ const r = await Be(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./en-DYxpcVy9.js"), "./msg/zhHans.ts": () => import("./zhHans-DjWw6Iqb.js") }), `./msg/${e}.ts`);
617
+ Te(r);
618
+ }
619
+ R.Classic.blockStyles = {
620
+ color_blocks: {
621
+ colourPrimary: "#a5745b",
622
+ colourSecondary: "#ede3de",
623
+ colourTertiary: "#845d49",
624
+ hat: ""
625
+ },
626
+ event_blocks: {
627
+ colourPrimary: "#a5a55b",
628
+ colourSecondary: "#ededde",
629
+ colourTertiary: "#848449",
630
+ hat: ""
631
+ },
632
+ list_blocks: {
633
+ colourPrimary: "#745ba5",
634
+ colourSecondary: "#e3deed",
635
+ colourTertiary: "#5d4984",
636
+ hat: ""
637
+ },
638
+ logic_blocks: {
639
+ colourPrimary: "#5b80a5",
640
+ colourSecondary: "#dee6ed",
641
+ colourTertiary: "#496684",
642
+ hat: ""
643
+ },
644
+ loop_blocks: {
645
+ colourPrimary: "#5ba55b",
646
+ colourSecondary: "#deedde",
647
+ colourTertiary: "#498449",
648
+ hat: ""
649
+ },
650
+ math_blocks: {
651
+ colourPrimary: "#5b67a5",
652
+ colourSecondary: "#dee1ed",
653
+ colourTertiary: "#495284",
654
+ hat: ""
655
+ },
656
+ object_blocks: {
657
+ colourPrimary: "#80a55b",
658
+ colourSecondary: "#e6edde",
659
+ colourTertiary: "#668449",
660
+ hat: ""
661
+ },
662
+ procedure_blocks: {
663
+ colourPrimary: "#995ba5",
664
+ colourSecondary: "#ebdeed",
665
+ colourTertiary: "#7a4984",
666
+ hat: ""
667
+ },
668
+ prop_blocks: {
669
+ colourPrimary: "#5ba5a5",
670
+ colourSecondary: "#deeded",
671
+ colourTertiary: "#498484",
672
+ hat: ""
673
+ },
674
+ text_blocks: {
675
+ colourPrimary: "#5ba58c",
676
+ colourSecondary: "#deede8",
677
+ colourTertiary: "#498470",
678
+ hat: ""
679
+ },
680
+ time_blocks: {
681
+ colourPrimary: "#5b99a5",
682
+ colourSecondary: "#deebed",
683
+ colourTertiary: "#497a84",
684
+ hat: ""
685
+ },
686
+ variable_blocks: {
687
+ colourPrimary: "#a55b80",
688
+ colourSecondary: "#eddee6",
689
+ colourTertiary: "#844966",
690
+ hat: ""
691
+ }
692
+ };
693
+ R.Classic.categoryStyles = {
694
+ calc_category: {
695
+ colour: "#757575"
696
+ },
697
+ color_category: {
698
+ colour: "#a5745b"
699
+ },
700
+ common_category: {
701
+ colour: "#757575"
702
+ },
703
+ data_category: {
704
+ colour: "#757575"
705
+ },
706
+ interface_category: {
707
+ colour: "#757575"
708
+ },
709
+ list_category: {
710
+ colour: "#745ba5"
711
+ },
712
+ logic_category: {
713
+ colour: "#5b80a5"
714
+ },
715
+ loop_category: {
716
+ colour: "#5ba55b"
717
+ },
718
+ math_category: {
719
+ colour: "#5b67a5"
720
+ },
721
+ message_category: {
722
+ colour: "#757575"
723
+ },
724
+ object_category: {
725
+ colour: "#80a55b"
726
+ },
727
+ procedure_category: {
728
+ colour: "#995ba5"
729
+ },
730
+ text_category: {
731
+ colour: "#5ba58c"
732
+ },
733
+ time_category: {
734
+ colour: "#5b99a5"
735
+ },
736
+ ui_category: {
737
+ colour: "#757575"
738
+ },
739
+ variable_category: {
740
+ colour: "#a55b80"
741
+ }
742
+ };
743
+ const Fe = se.defineTheme("light", {
744
+ name: "light",
745
+ base: R.Classic,
746
+ componentStyles: {
747
+ workspaceBackgroundColour: "#ffffff",
748
+ toolboxBackgroundColour: "#eeeeee",
749
+ toolboxForegroundColour: "",
750
+ flyoutBackgroundColour: "#eeeeee",
751
+ flyoutForegroundColour: "#000000",
752
+ flyoutOpacity: 0.8,
753
+ scrollbarColour: "",
754
+ insertionMarkerColour: "",
755
+ insertionMarkerOpacity: 0.3,
756
+ scrollbarOpacity: 0.4,
757
+ cursorColour: ""
758
+ }
759
+ }), $e = se.defineTheme("dark", {
760
+ name: "dark",
761
+ base: R.Classic,
762
+ componentStyles: {
763
+ workspaceBackgroundColour: "#1e1e1e",
764
+ toolboxBackgroundColour: "#272727",
765
+ toolboxForegroundColour: "",
766
+ flyoutBackgroundColour: "#272727",
767
+ flyoutForegroundColour: "#ffffff",
768
+ flyoutOpacity: 0.8,
769
+ scrollbarColour: "",
770
+ insertionMarkerColour: "",
771
+ insertionMarkerOpacity: 0.3,
772
+ scrollbarOpacity: 0.4,
773
+ cursorColour: ""
774
+ }
775
+ });
776
+ function Er(e) {
777
+ const r = ke();
778
+ switch (console.log(r), e) {
779
+ case "light":
780
+ r.setTheme(Fe);
781
+ break;
782
+ case "dark":
783
+ r.setTheme($e);
784
+ break;
785
+ }
786
+ }
787
+ export {
788
+ Ge as ASTNode,
789
+ He as BasicCursor,
790
+ qe as Block,
791
+ Xe as BlockSvg,
792
+ Ye as Blocks,
793
+ Je as COLLAPSED_FIELD_NAME,
794
+ Ze as COLLAPSED_INPUT_NAME,
795
+ Qe as COLLAPSE_CHARS,
796
+ Ke as CodeGenerator,
797
+ et as CollapsibleToolboxCategory,
798
+ tt as ComponentManager,
799
+ ot as Connection,
800
+ rt as ConnectionChecker,
801
+ nt as ConnectionDB,
802
+ at as ConnectionType,
803
+ st as ContextMenu,
804
+ ct as ContextMenuItems,
805
+ it as ContextMenuRegistry,
806
+ lt as Css,
807
+ ut as Cursor,
808
+ dt as DELETE_VARIABLE_ID,
809
+ ft as DeleteArea,
810
+ mt as DragTarget,
811
+ yt as DropDownDiv,
812
+ ht as Events,
813
+ pt as Extensions,
814
+ bt as Field,
815
+ gt as FieldCheckbox,
816
+ _t as FieldDropdown,
817
+ Et as FieldImage,
818
+ vt as FieldLabel,
819
+ Nt as FieldLabelSerializable,
820
+ Ot as FieldNumber,
821
+ Ct as FieldTextInput,
822
+ kt as FieldVariable,
823
+ Tt as Flyout,
824
+ Pt as FlyoutButton,
825
+ St as FlyoutMetricsManager,
826
+ Dt as Generator,
827
+ Vt as Gesture,
828
+ wt as Grid,
829
+ xt as HorizontalFlyout,
830
+ At as INPUT_VALUE,
831
+ Mt as Input,
832
+ It as InsertionMarkerManager,
833
+ jt as InsertionMarkerPreviewer,
834
+ Rt as Marker,
835
+ Lt as MarkerManager,
836
+ Bt as Menu,
837
+ Ft as MenuItem,
838
+ $t as MetricsManager,
839
+ Ut as Msg,
840
+ Wt as NEXT_STATEMENT,
841
+ zt as Names,
842
+ Gt as OPPOSITE_TYPE,
843
+ Ht as OUTPUT_VALUE,
844
+ qt as Options,
845
+ Xt as PREVIOUS_STATEMENT,
846
+ Yt as PROCEDURE_CATEGORY_NAME,
847
+ Jt as Procedures,
848
+ Zt as RENAME_VARIABLE_ID,
849
+ Qt as RenderedConnection,
850
+ Kt as Scrollbar,
851
+ eo as ScrollbarPair,
852
+ to as ShortcutItems,
853
+ oo as ShortcutRegistry,
854
+ ro as TOOLBOX_AT_BOTTOM,
855
+ no as TOOLBOX_AT_LEFT,
856
+ ao as TOOLBOX_AT_RIGHT,
857
+ so as TOOLBOX_AT_TOP,
858
+ co as TabNavigateCursor,
859
+ se as Theme,
860
+ io as ThemeManager,
861
+ R as Themes,
862
+ lo as Toolbox,
863
+ uo as ToolboxCategory,
864
+ fo as ToolboxItem,
865
+ mo as ToolboxSeparator,
866
+ yo as Tooltip,
867
+ ho as Touch,
868
+ po as Trashcan,
869
+ bo as UnattachedFieldError,
870
+ go as VARIABLE_CATEGORY_NAME,
871
+ _o as VARIABLE_DYNAMIC_CATEGORY_NAME,
872
+ Eo as VERSION,
873
+ vo as VariableMap,
874
+ No as VariableModel,
875
+ Oo as Variables,
876
+ Co as VariablesDynamic,
877
+ ko as VerticalFlyout,
878
+ To as WidgetDiv,
879
+ Po as Workspace,
880
+ So as WorkspaceAudio,
881
+ Do as WorkspaceDragger,
882
+ Vo as WorkspaceSvg,
883
+ wo as Xml,
884
+ xo as ZoomControls,
885
+ Ao as blockAnimations,
886
+ Mo as blockRendering,
887
+ Io as browserEvents,
888
+ jo as bubbles,
889
+ Ro as bumpObjects,
890
+ Lo as clipboard,
891
+ Bo as comments,
892
+ Fo as common,
893
+ $o as config,
894
+ Uo as constants,
895
+ Wo as defineBlocksWithJsonArray,
896
+ ce as dialog,
897
+ zo as dragging,
898
+ Go as fieldRegistry,
899
+ Ho as geras,
900
+ ke as getMainWorkspace,
901
+ qo as getSelected,
902
+ Xo as hasBubble,
903
+ Yo as hideChaff,
904
+ Jo as icons,
905
+ Zo as inject,
906
+ Qo as inputs,
907
+ Ko as isCopyable,
908
+ er as isDeletable,
909
+ tr as isDraggable,
910
+ or as isIcon,
911
+ rr as isObservable,
912
+ nr as isPaster,
913
+ ar as isRenderedElement,
914
+ sr as isSelectable,
915
+ cr as isSerializable,
916
+ ir as isVariableBackedParameterModel,
917
+ lr as procedures,
918
+ ur as registry,
919
+ dr as renderManagement,
920
+ fr as serialization,
921
+ Te as setLocale,
922
+ _r as setLocaleAsync,
923
+ mr as setParentContainer,
924
+ Er as setTheme,
925
+ yr as svgResize,
926
+ hr as thrasos,
927
+ pr as uiPosition,
928
+ br as utils,
929
+ gr as zelos
930
+ };