x-block-lib 0.4.14 → 0.4.16

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.
Files changed (2) hide show
  1. package/dist/index.js +406 -362
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,14 +1,61 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="x-block-lib",o.appendChild(document.createTextNode(".blocklyToolboxDiv{overflow-x:hidden;width:56px}.blocklyMainBackground{stroke-width:0}.blocklyToolboxCategory{margin-bottom:10px}.blocklyTreeRow{height:28px;display:flex;align-items:center;border-left-width:6px!important;border-right-width:6px!important}.blocklyTreeIcon{display:none!important}.blocklyFlyout{z-index:21}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- var ot = Object.defineProperty;
3
- var nt = (e, o, t) => o in e ? ot(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
4
- var v = (e, o, t) => nt(e, typeof o != "symbol" ? o + "" : o, t);
5
- import { defineComponent as X, resolveComponent as C, openBlock as I, createBlock as P, unref as A, useModel as _e, ref as ue, onMounted as Me, onUnmounted as it, withCtx as Y, createElementBlock as j, Fragment as st, renderList as lt, createVNode as B, createTextVNode as at, toDisplayString as pe, computed as K, isRef as rt, withKeys as ct, withModifiers as se, mergeProps as _t, createElementVNode as M, normalizeStyle as F, createCommentVNode as ee, mergeModels as Ce, useTemplateRef as ut, onBeforeUnmount as pt, watch as W, resolveDirective as Tt, withDirectives as dt } from "vue";
6
- import { d as _, j as s, O as l, u, X as ft, B as L, E, M as m, i as ne, a as U, b as f, C as Ue, F as fe, c as Et, P as Te, N as Ee, V as te, e as ht, f as Ve, s as mt, g as H, S as g, h as le, k as D, l as J, m as ae, n as G, o as V, p as ve, G as re, q as Ot, r as gt, t as ce, U as z, D as Q, v as x, w as It, T as ie, x as Pe, y as Lt, z as Ae, A as yt } from "./blockly-d7r2qvsx.js";
2
+ var tt = Object.defineProperty;
3
+ var ot = (e, o, t) => o in e ? tt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
4
+ var A = (e, o, t) => ot(e, typeof o != "symbol" ? o + "" : o, t);
5
+ import { getCurrentScope as nt, onScopeDispose as it, unref as C, computed as S, watch as j, ref as ne, getCurrentInstance as st, onMounted as fe, defineComponent as W, resolveComponent as v, openBlock as L, createBlock as x, useModel as ue, onUnmounted as lt, withCtx as K, createElementBlock as X, Fragment as at, renderList as rt, createVNode as B, createTextVNode as ct, toDisplayString as pe, isRef as _t, withKeys as ut, withModifiers as le, mergeProps as pt, createElementVNode as V, normalizeStyle as F, createCommentVNode as ee, mergeModels as ve, useTemplateRef as Tt, onBeforeUnmount as dt } from "vue";
6
+ import { d as _, j as s, O as l, u, X as ft, B as y, E, M as O, i as ie, a as U, b as f, C as Ue, F as Ee, c as Et, P as Te, N as he, V as te, e as ht, f as Pe, s as mt, g as w, S as I, h as ae, k as Y, l as J, m as re, n as G, o as P, p as Ae, G as ce, q as Ot, r as gt, t as _e, U as z, D as Q, v as D, w as It, T as se, x as xe, y as Lt, z as be, A as yt } from "./blockly-d7r2qvsx.js";
7
7
  import { storeToRefs as Ct } from "pinia";
8
- import { openConfirmDlg as vt, openPromptDlg as At, eventBus as be, useSystem as bt, useColor as kt, useViewStack as xe, useGlobalStore as Nt } from "x-essential-lib";
8
+ import { openConfirmDlg as vt, openPromptDlg as At, eventBus as ke, useSystem as bt, useColor as kt, useViewStack as De, useGlobalStore as Nt } from "x-essential-lib";
9
9
  import { useDisplay as Bt } from "vuetify";
10
- import { useI18n as De } from "vue-i18n";
11
- var Rt = "M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z", St = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", Mt = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", Ut = "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z", Vt = "M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z", Pt = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
10
+ import { useI18n as Ye } from "vue-i18n";
11
+ var Rt = "M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z", St = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", Mt = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", Vt = "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z", Ut = "M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z", Pt = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
12
+ function xt(e) {
13
+ return nt() ? (it(e), !0) : !1;
14
+ }
15
+ function Dt(e) {
16
+ return typeof e == "function" ? e() : C(e);
17
+ }
18
+ const Yt = typeof window < "u" && typeof document < "u";
19
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
20
+ function Ne(e) {
21
+ var o;
22
+ const t = Dt(e);
23
+ return (o = t == null ? void 0 : t.$el) != null ? o : t;
24
+ }
25
+ const Kt = Yt ? window : void 0;
26
+ function Ft() {
27
+ const e = ne(!1), o = st();
28
+ return o && fe(() => {
29
+ e.value = !0;
30
+ }, o), e;
31
+ }
32
+ function wt(e) {
33
+ const o = Ft();
34
+ return S(() => (o.value, !!e()));
35
+ }
36
+ function Ht(e, o, t = {}) {
37
+ const { window: n = Kt, ...i } = t;
38
+ let a;
39
+ const r = wt(() => n && "ResizeObserver" in n), c = () => {
40
+ a && (a.disconnect(), a = void 0);
41
+ }, p = S(() => Array.isArray(e) ? e.map((g) => Ne(g)) : [Ne(e)]), h = j(
42
+ p,
43
+ (g) => {
44
+ if (c(), r.value && n) {
45
+ a = new ResizeObserver(o);
46
+ for (const d of g)
47
+ d && a.observe(d, i);
48
+ }
49
+ },
50
+ { immediate: !0, flush: "post" }
51
+ ), T = () => {
52
+ c(), h();
53
+ };
54
+ return xt(T), {
55
+ isSupported: r,
56
+ stop: T
57
+ };
58
+ }
12
59
  _([
13
60
  {
14
61
  type: "color_blend_v1",
@@ -151,7 +198,7 @@ function ${s.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
151
198
  `
152
199
  )}(${o}, ${t}, ${n})`, l.FUNCTION_CALL];
153
200
  };
154
- const xt = function() {
201
+ const Gt = function() {
155
202
  if (!window.blocklyState) {
156
203
  const e = {
157
204
  runtime: {
@@ -196,11 +243,11 @@ function q(e) {
196
243
  console.assert(!1, "invalid param type", e.type);
197
244
  return u.xml.textToDom(o);
198
245
  }
199
- function Ye(e, o, t) {
246
+ function Ke(e, o, t) {
200
247
  const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = u.xml.textToDom(n), a = ft.domToWorkspace(i, e);
201
248
  return e.getBlockById(a[0]);
202
249
  }
203
- const Dt = u.xml, Yt = [
250
+ const $t = u.xml, jt = [
204
251
  {
205
252
  type: "call_func_v1",
206
253
  prefixInputs: ["OUTPUT"]
@@ -230,17 +277,17 @@ const Dt = u.xml, Yt = [
230
277
  prefixInputs: ["ARG"]
231
278
  }
232
279
  ];
233
- function Kt(e, o) {
280
+ function Xt(e, o) {
234
281
  var n, i;
235
- const t = Yt.find((a) => a.type === e);
282
+ const t = jt.find((a) => a.type === e);
236
283
  return t ? !!((n = t.prefixInputs) != null && n.some((a) => o.startsWith(a)) || (i = t.inputs) != null && i.some((a) => a === o)) : !1;
237
284
  }
238
- const Ft = {
285
+ const Wt = {
239
286
  init: function() {
240
287
  this.key = "", this.name = "", this.appendDummyInput().appendField("", "LABEL"), this.setOutput(!0), this.setColour(220);
241
288
  },
242
289
  mutationToDom: function() {
243
- const e = Dt.createElement("mutation");
290
+ const e = $t.createElement("mutation");
244
291
  return e.setAttribute("key", this.key), e.setAttribute("name", this.name), e;
245
292
  },
246
293
  domToMutation: function(e) {
@@ -269,12 +316,12 @@ const Ft = {
269
316
  tryDuplicate_: function(e) {
270
317
  var t;
271
318
  const o = this.workspace.getBlockById(e.oldParentId);
272
- if (o && Kt(o.type, e.oldInputName))
319
+ if (o && Xt(o.type, e.oldInputName))
273
320
  try {
274
321
  E.disable();
275
322
  const n = (t = o.getInput(e.oldInputName)) == null ? void 0 : t.connection;
276
323
  if (n) {
277
- const i = Ye(this.workspace, this.key, this.name);
324
+ const i = Ke(this.workspace, this.key, this.name);
278
325
  n.connect(i.outputConnection);
279
326
  }
280
327
  } finally {
@@ -282,36 +329,36 @@ const Ft = {
282
329
  }
283
330
  },
284
331
  updateShape_: function() {
285
- this.name ? this.setFieldValue(m[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
332
+ this.name ? this.setFieldValue(O[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
286
333
  }
287
334
  };
288
- L.parameter_v1 = Ft;
335
+ y.parameter_v1 = Wt;
289
336
  s.forBlock.parameter_v1 = function(e) {
290
337
  return [e.key, l.ATOMIC];
291
338
  };
292
- const Ht = u.xml, wt = {
339
+ const Jt = u.xml, zt = {
293
340
  init: function() {
294
341
  this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_CONTAINER_TITLE}"), this.appendStatementInput("STACK"), this.setStyle("list_blocks"), this.contextMenu = !1;
295
342
  }
296
343
  };
297
- L.list_create_container_v1 = wt;
298
- const Gt = {
344
+ y.list_create_container_v1 = zt;
345
+ const Qt = {
299
346
  init: function() {
300
347
  this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("list_blocks"), this.contextMenu = !1;
301
348
  }
302
349
  };
303
- L.list_create_item_v1 = Gt;
304
- const $t = {
350
+ y.list_create_item_v1 = Qt;
351
+ const qt = {
305
352
  init: function() {
306
353
  this.itemCount_ = 0, this.setMutator(
307
- new ne.MutatorIcon(
354
+ new ie.MutatorIcon(
308
355
  ["list_create_item_v1"],
309
356
  this
310
357
  )
311
358
  ), this.setOutput(!0, "Array"), this.setStyle("list_blocks"), this.setTooltip("%{BKY_LIST_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_LIST_V1_CREATE_HELPURL}");
312
359
  },
313
360
  mutationToDom: function() {
314
- const e = Ht.createElement("mutation");
361
+ const e = Jt.createElement("mutation");
315
362
  return e.setAttribute("items", String(this.itemCount_)), e;
316
363
  },
317
364
  domToMutation: function(e) {
@@ -385,7 +432,7 @@ const $t = {
385
432
  this.removeInput("ADD" + e);
386
433
  }
387
434
  };
388
- L.list_create_v1 = $t;
435
+ y.list_create_v1 = qt;
389
436
  s.forBlock.list_create_v1 = function(e) {
390
437
  const o = e, t = new Array(o.itemCount_);
391
438
  for (let i = 0; i < o.itemCount_; i++)
@@ -601,7 +648,7 @@ s.forBlock.list_set_v1 = function(e) {
601
648
  return `${o}[${t}] = ${n};
602
649
  `;
603
650
  };
604
- const jt = {
651
+ const Zt = {
605
652
  // logic_compare
606
653
  EQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_EQ}",
607
654
  NEQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_NEQ}",
@@ -615,7 +662,7 @@ const jt = {
615
662
  };
616
663
  f.register(
617
664
  "logic_op_tooltip_v1",
618
- f.buildTooltipForDropdown("OP", jt)
665
+ f.buildTooltipForDropdown("OP", Zt)
619
666
  );
620
667
  _([
621
668
  {
@@ -640,7 +687,7 @@ _([
640
687
  s.forBlock.logic_boolean_v1 = function(e) {
641
688
  return [e.getFieldValue("BOOL") === "TRUE" ? "true" : "false", l.ATOMIC];
642
689
  };
643
- const Xt = {
690
+ const eo = {
644
691
  onchange: function(e) {
645
692
  this.prevBlocks_ || (this.prevBlocks_ = [null, null]);
646
693
  const o = this.getInputTargetBlock("A"), t = this.getInputTargetBlock("B");
@@ -660,7 +707,7 @@ const Xt = {
660
707
  f.register(
661
708
  "logic_compare_v1",
662
709
  function() {
663
- this.mixin(Xt);
710
+ this.mixin(eo);
664
711
  }
665
712
  );
666
713
  _([
@@ -710,7 +757,7 @@ s.forBlock.logic_compare_v1 = function(e) {
710
757
  const i = s.valueToCode(e, "A", n) || "0", a = s.valueToCode(e, "B", n) || "0";
711
758
  return [`${i} ${t} ${a}`, n];
712
759
  };
713
- const Wt = {
760
+ const to = {
714
761
  elseIfCount_: 0,
715
762
  hasElse_: !1,
716
763
  mutationToDom: function() {
@@ -826,8 +873,8 @@ const Wt = {
826
873
  for (let e = 1; this.getInput("IF" + e); e++)
827
874
  this.removeInput("IF" + e), this.removeInput("DO" + e);
828
875
  for (let e = 1; e <= this.elseIfCount_; e++)
829
- this.appendValueInput("IF" + e).setCheck("Boolean").appendField(m.LOGIC_ELSE_IF), this.appendStatementInput("DO" + e).appendField(m.LOGIC_DO);
830
- this.hasElse_ && this.appendStatementInput("ELSE").appendField(m.LOGIC_ELSE);
876
+ this.appendValueInput("IF" + e).setCheck("Boolean").appendField(O.LOGIC_ELSE_IF), this.appendStatementInput("DO" + e).appendField(O.LOGIC_DO);
877
+ this.hasElse_ && this.appendStatementInput("ELSE").appendField(O.LOGIC_ELSE);
831
878
  },
832
879
  reconnectChildBlocks_: function(e, o, t) {
833
880
  var n, i;
@@ -838,7 +885,7 @@ const Wt = {
838
885
  };
839
886
  f.registerMutator(
840
887
  "logic_if_v1_mutator",
841
- Wt,
888
+ to,
842
889
  void 0,
843
890
  ["logic_if_else_if_v1", "logic_if_else_v1"]
844
891
  );
@@ -984,7 +1031,7 @@ s.forBlock.logic_operation_v1 = function(e) {
984
1031
  }
985
1032
  return [`${n} ${o} ${i}`, t];
986
1033
  };
987
- const Jt = {
1034
+ const oo = {
988
1035
  prevParentConnection_: null,
989
1036
  onchange: function(e) {
990
1037
  const o = this.getInputTargetBlock("THEN"), t = this.getInputTargetBlock("ELSE"), n = this.outputConnection.targetConnection;
@@ -999,7 +1046,7 @@ const Jt = {
999
1046
  this.prevParentConnection_ = n;
1000
1047
  }
1001
1048
  };
1002
- f.registerMixin("logic_ternary_v1", Jt);
1049
+ f.registerMixin("logic_ternary_v1", oo);
1003
1050
  _([
1004
1051
  {
1005
1052
  type: "logic_ternary_v1",
@@ -1036,7 +1083,7 @@ s.forBlock.logic_ternary_v1 = function(e) {
1036
1083
  const o = s.valueToCode(e, "IF", l.CONDITIONAL) || "false", t = s.valueToCode(e, "THEN", l.CONDITIONAL) || "null", n = s.valueToCode(e, "ELSE", l.CONDITIONAL) || "null";
1037
1084
  return [o + " ? " + t + " : " + n, l.CONDITIONAL];
1038
1085
  };
1039
- const zt = {
1086
+ const no = {
1040
1087
  customContextMenu: function(e) {
1041
1088
  if (this.isInFlyout)
1042
1089
  return;
@@ -1050,7 +1097,7 @@ const zt = {
1050
1097
  };
1051
1098
  e.push({
1052
1099
  enabled: !0,
1053
- text: m.VARIABLES_SET_CREATE_GET.replace("%1", n),
1100
+ text: O.VARIABLES_SET_CREATE_GET.replace("%1", n),
1054
1101
  callback: Ue.callbackFactory(this, i)
1055
1102
  });
1056
1103
  }
@@ -1058,7 +1105,7 @@ const zt = {
1058
1105
  };
1059
1106
  f.registerMixin(
1060
1107
  "contextMenu_newGetVariableBlock_v1",
1061
- zt
1108
+ no
1062
1109
  );
1063
1110
  f.register(
1064
1111
  "flow_control_tooltip_v1",
@@ -1067,16 +1114,16 @@ f.register(
1067
1114
  CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
1068
1115
  })
1069
1116
  );
1070
- const Qt = /* @__PURE__ */ new Set([
1117
+ const io = /* @__PURE__ */ new Set([
1071
1118
  "repeat_v1",
1072
1119
  "for_each_v1",
1073
1120
  "for_v1",
1074
1121
  "while_until_v1"
1075
- ]), qt = {
1122
+ ]), so = {
1076
1123
  getSurroundLoop: function() {
1077
1124
  let e = this;
1078
1125
  do {
1079
- if (Qt.has(e.type))
1126
+ if (io.has(e.type))
1080
1127
  return !0;
1081
1128
  e = e == null ? void 0 : e.getSurroundParent();
1082
1129
  } while (e);
@@ -1088,7 +1135,7 @@ const Qt = /* @__PURE__ */ new Set([
1088
1135
  return;
1089
1136
  const t = this.getSurroundLoop();
1090
1137
  if (console.log(e.type, t), this.setWarningText(
1091
- t ? null : m.LOOP_FLOW_CONTROL_WARNING
1138
+ t ? null : O.LOOP_FLOW_CONTROL_WARNING
1092
1139
  ), !this.isInFlyout)
1093
1140
  try {
1094
1141
  E.setRecordUndo(!1), this.setDisabledReason(!t, "FLOW_CONTROL_NOT_IN_LOOP");
@@ -1099,7 +1146,7 @@ const Qt = /* @__PURE__ */ new Set([
1099
1146
  };
1100
1147
  f.registerMixin(
1101
1148
  "flow_control_in_loop_check_v1",
1102
- qt
1149
+ so
1103
1150
  );
1104
1151
  _([
1105
1152
  {
@@ -1264,7 +1311,7 @@ ${n}
1264
1311
  }
1265
1312
  `;
1266
1313
  };
1267
- const Zt = {
1314
+ const lo = {
1268
1315
  // math_arithmetic
1269
1316
  ADD: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_ADD}",
1270
1317
  SUBTRACT: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_SUBTRACT}",
@@ -1298,7 +1345,7 @@ const Zt = {
1298
1345
  };
1299
1346
  f.register(
1300
1347
  "math_op_tooltip_v1",
1301
- f.buildTooltipForDropdown("OP", Zt)
1348
+ f.buildTooltipForDropdown("OP", lo)
1302
1349
  );
1303
1350
  _([
1304
1351
  {
@@ -1901,31 +1948,31 @@ s.forBlock.math_trig_v1 = function(e) {
1901
1948
  }
1902
1949
  return [n, l.DIVISION];
1903
1950
  };
1904
- const eo = u.xml, to = {
1951
+ const ao = u.xml, ro = {
1905
1952
  init: function() {
1906
1953
  this.appendDummyInput().appendField(
1907
1954
  "%{BKY_OBJECT_V1_CREATE_CONTAINER_TITLE}"
1908
1955
  ), this.appendStatementInput("STACK"), this.setStyle("object_blocks"), this.contextMenu = !1;
1909
1956
  }
1910
1957
  };
1911
- L.object_create_container_v1 = to;
1912
- const oo = {
1958
+ y.object_create_container_v1 = ro;
1959
+ const co = {
1913
1960
  init: function() {
1914
1961
  this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("object_blocks"), this.contextMenu = !1;
1915
1962
  }
1916
1963
  };
1917
- L.object_create_item_v1 = oo;
1918
- const no = {
1964
+ y.object_create_item_v1 = co;
1965
+ const _o = {
1919
1966
  init: function() {
1920
1967
  this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
1921
- new ne.MutatorIcon(
1968
+ new ie.MutatorIcon(
1922
1969
  ["object_create_item_v1"],
1923
1970
  this
1924
1971
  )
1925
1972
  ), this.setOutput(!0, "Object"), this.setStyle("object_blocks"), this.setTooltip("%{BKY_OBJECT_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_OBJECT_V1_CREATE_HELPURL}");
1926
1973
  },
1927
1974
  mutationToDom: function() {
1928
- const e = eo.createElement("mutation");
1975
+ const e = ao.createElement("mutation");
1929
1976
  return e.setAttribute("items", String(this.itemCount_)), e;
1930
1977
  },
1931
1978
  domToMutation: function(e) {
@@ -1990,12 +2037,12 @@ const no = {
1990
2037
  },
1991
2038
  updateShape_: function() {
1992
2039
  for (let e = 0; e < this.itemCount_; e++)
1993
- this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(U.Align.RIGHT).appendField(new fe("key"), "KEY" + e);
2040
+ this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(U.Align.RIGHT).appendField(new Ee("key"), "KEY" + e);
1994
2041
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
1995
2042
  this.removeInput("ADD" + e);
1996
2043
  }
1997
2044
  };
1998
- L.object_create_v1 = no;
2045
+ y.object_create_v1 = _o;
1999
2046
  s.forBlock.object_create_v1 = function(e) {
2000
2047
  const o = e;
2001
2048
  let t = "{";
@@ -2253,15 +2300,15 @@ _([
2253
2300
  s.forBlock.object_to_json_v1 = function(e) {
2254
2301
  return [`__jsonStringifyV1__(${s.valueToCode(e, "OBJECT", l.NONE) || "null"})`, l.FUNCTION_CALL];
2255
2302
  };
2256
- const ke = u.xml, io = {
2303
+ const Be = u.xml, uo = {
2257
2304
  init: function() {
2258
2305
  this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new Et(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
2259
2306
  }
2260
2307
  };
2261
- L.procedure_def_container_v1 = io;
2262
- const so = {
2308
+ y.procedure_def_container_v1 = uo;
2309
+ const po = {
2263
2310
  init: function() {
2264
- const e = new fe(Te.DEFAULT_ARG);
2311
+ const e = new Ee(Te.DEFAULT_ARG);
2265
2312
  e.setValidator(this.validator_), this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_ITEM_TITLE}").appendField(e, "NAME"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("procedure_blocks"), this.contextMenu = !1;
2266
2313
  },
2267
2314
  validator_: function(e) {
@@ -2281,24 +2328,24 @@ const so = {
2281
2328
  return e;
2282
2329
  }
2283
2330
  };
2284
- L.procedure_def_item_v1 = so;
2285
- const lo = {
2331
+ y.procedure_def_item_v1 = po;
2332
+ const To = {
2286
2333
  init: function() {
2287
2334
  this.withReturn = !1, this.args = [];
2288
- const e = new fe(
2335
+ const e = new Ee(
2289
2336
  Te.findLegalName("", this)
2290
2337
  );
2291
2338
  e.setValidator(Te.rename), e.setSpellcheck(!1), this.appendDummyInput("DUMMY").appendField(e, "NAME"), this.appendStatementInput("HANDLE"), this.setMutator(
2292
- new ne.MutatorIcon(
2339
+ new ie.MutatorIcon(
2293
2340
  ["procedure_def_item_v1"],
2294
2341
  this
2295
2342
  )
2296
2343
  ), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_DEF_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_DEF_HELPURL}");
2297
2344
  },
2298
2345
  mutationToDom: function() {
2299
- const e = ke.createElement("mutation");
2346
+ const e = Be.createElement("mutation");
2300
2347
  return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), this.args.forEach((o) => {
2301
- const t = ke.createElement("arg");
2348
+ const t = Be.createElement("arg");
2302
2349
  t.setAttribute("name", o.name), t.setAttribute("id", o.id), e.appendChild(t);
2303
2350
  }), e;
2304
2351
  },
@@ -2375,20 +2422,20 @@ const lo = {
2375
2422
  n.setKeyName(o.name, "");
2376
2423
  else
2377
2424
  try {
2378
- E.disable(), n = Ye(this.workspace, o.name, ""), n.outputConnection.connect(t);
2425
+ E.disable(), n = Ke(this.workspace, o.name, ""), n.outputConnection.connect(t);
2379
2426
  } finally {
2380
2427
  E.enable();
2381
2428
  }
2382
2429
  }
2383
2430
  }
2384
2431
  };
2385
- L.procedure_def_v1 = lo;
2386
- const ao = u.xml, ro = {
2432
+ y.procedure_def_v1 = To;
2433
+ const fo = u.xml, Eo = {
2387
2434
  init: function() {
2388
2435
  this.withReturn = !1, this.appendDummyInput("DUMMY").appendField("%{BKY_PROCEDURE_RETURN}"), this.appendValueInput("VALUE").appendField("%{BKY_PROCEDURE_RETURN}").setVisible(!1), this.setPreviousStatement(!0), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_RETURN_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_RETURN_HELPURL}");
2389
2436
  },
2390
2437
  mutationToDom: function() {
2391
- const e = ao.createElement("mutation");
2438
+ const e = fo.createElement("mutation");
2392
2439
  return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), e;
2393
2440
  },
2394
2441
  domToMutation: function(e) {
@@ -2439,7 +2486,7 @@ const ao = u.xml, ro = {
2439
2486
  e.type === "procedure_def_v1" || e.type === "func_entry_v1" ? this.setWarningText(null) : this.setWarningText("the block can only be used in procedure block");
2440
2487
  }
2441
2488
  };
2442
- L.procedure_return_v1 = ro;
2489
+ y.procedure_return_v1 = Eo;
2443
2490
  s.forBlock.procedure_return_v1 = function(e) {
2444
2491
  const o = e;
2445
2492
  return o.withReturn ? `return ${s.valueToCode(o, "VALUE", l.NONE) || "null"};
@@ -2467,9 +2514,9 @@ _([
2467
2514
  s.forBlock.text_v1 = function(e) {
2468
2515
  return [s.quote_(e.getFieldValue("TEXT")), l.ATOMIC];
2469
2516
  };
2470
- const co = /^\s*'([^']|\\')*'\s*$/;
2517
+ const ho = /^\s*'([^']|\\')*'\s*$/;
2471
2518
  function oe(e) {
2472
- return co.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
2519
+ return ho.test(e) ? [e, l.ATOMIC] : [`String(${e})`, l.FUNCTION_CALL];
2473
2520
  }
2474
2521
  f.register(
2475
2522
  "text_append_tooltip_v1",
@@ -2503,7 +2550,7 @@ s.forBlock.text_append_v1 = function(e) {
2503
2550
  var n;
2504
2551
  const o = (n = s.nameDB_) == null ? void 0 : n.getName(
2505
2552
  e.getFieldValue("VAR"),
2506
- Ee.NameType.VARIABLE
2553
+ he.NameType.VARIABLE
2507
2554
  ), t = s.valueToCode(e, "TEXT", l.NONE) || "''";
2508
2555
  return `${o} += ${oe(t)};
2509
2556
  `;
@@ -2674,10 +2721,10 @@ _([
2674
2721
  s.forBlock.text_is_empty_v1 = function(e) {
2675
2722
  return [`!${s.valueToCode(e, "VALUE", l.MEMBER) || "''"}.length`, l.LOGICAL_NOT];
2676
2723
  };
2677
- const _o = u.xml, uo = {
2724
+ const mo = u.xml, Oo = {
2678
2725
  itemCount_: 0,
2679
2726
  mutationToDom: function() {
2680
- const e = _o.createElement("mutation");
2727
+ const e = mo.createElement("mutation");
2681
2728
  return e.setAttribute("items", `${this.itemCount_}`), e;
2682
2729
  },
2683
2730
  domToMutation: function(e) {
@@ -2749,13 +2796,13 @@ const _o = u.xml, uo = {
2749
2796
  for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
2750
2797
  this.removeInput("ADD" + e);
2751
2798
  }
2752
- }, po = function() {
2753
- this.itemCount_ = 2, this.updateShape_(), this.setMutator(new ne.MutatorIcon(["text_join_item_v1"], this));
2799
+ }, go = function() {
2800
+ this.itemCount_ = 2, this.updateShape_(), this.setMutator(new ie.MutatorIcon(["text_join_item_v1"], this));
2754
2801
  };
2755
2802
  f.registerMutator(
2756
2803
  "text_join_mutator_v1",
2757
- uo,
2758
- po
2804
+ Oo,
2805
+ go
2759
2806
  );
2760
2807
  _([
2761
2808
  {
@@ -2987,7 +3034,7 @@ s.forBlock.text_trim_v1 = function(e) {
2987
3034
  }[e.getFieldValue("MODE")];
2988
3035
  return [`__trimV1__(${o}, ${n})`, l.ATOMIC];
2989
3036
  };
2990
- const To = {
3037
+ const Io = {
2991
3038
  init: function() {
2992
3039
  this.appendDummyInput().appendField("%{BKY_TIME_V1_CREATE_TIMER_TITLE}"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("time_blocks"), this.setTooltip("%{BKY_TIME_V1_CREATE_TIMER_TOOLTIP}"), this.setHelpUrl("%{BKY_TIME_V1_CREATE_TIMER_HELPURL}");
2993
3040
  },
@@ -3013,7 +3060,7 @@ const To = {
3013
3060
  ));
3014
3061
  }
3015
3062
  };
3016
- L.create_timer_v1 = To;
3063
+ y.create_timer_v1 = Io;
3017
3064
  s.forBlock.create_timer_v1 = function(e) {
3018
3065
  const o = s.valueToCode(e, "INTERVAL", l.ATOMIC) || "1000", t = s.valueToCode(e, "LOOP", l.ATOMIC) || "false", n = s.valueToCode(e, "COUNT", l.ATOMIC) || "1", i = s.valueToCode(e, "IMMEDIATE", l.ATOMIC) || "false", a = s.statementToCode(e, "CALLBACK");
3019
3066
  return `__createTimerV1__(${o}, ${t}, ${n}, ${i}, function() {
@@ -3043,24 +3090,24 @@ s.forBlock.delay_v1 = function(e) {
3043
3090
  return `__delayV1__(${s.valueToCode(e, "MS", l.ATOMIC) || "0"});
3044
3091
  `;
3045
3092
  };
3046
- const fo = {
3093
+ const Lo = {
3047
3094
  customContextMenu: function(e) {
3048
3095
  if (this.isInFlyout) {
3049
3096
  if (this.type === "variables_get_v1" || this.type === "variables_get_v1_reporter") {
3050
3097
  const o = {
3051
- text: m.RENAME_VARIABLE,
3098
+ text: O.RENAME_VARIABLE,
3052
3099
  enabled: !0,
3053
- callback: Eo(this)
3100
+ callback: yo(this)
3054
3101
  }, t = this.getField("VAR").getText(), n = {
3055
- text: m.DELETE_VARIABLE.replace("%1", t),
3102
+ text: O.DELETE_VARIABLE.replace("%1", t),
3056
3103
  enabled: !0,
3057
- callback: ho(this)
3104
+ callback: Co(this)
3058
3105
  };
3059
3106
  e.unshift(o), e.unshift(n);
3060
3107
  }
3061
3108
  } else {
3062
3109
  let o, t;
3063
- this.type === "variables_get_v1" ? (o = "variables_set_v1", t = m.VARIABLE_V1_GET_CREATE_SET) : this.type === "variables_set_v1" ? (o = "variables_get_v1", t = m.VARIABLE_V1_SET_CREATE_GET) : console.assert(!1);
3110
+ this.type === "variables_get_v1" ? (o = "variables_set_v1", t = O.VARIABLE_V1_GET_CREATE_SET) : this.type === "variables_set_v1" ? (o = "variables_get_v1", t = O.VARIABLE_V1_SET_CREATE_GET) : console.assert(!1);
3064
3111
  const n = this.getField("VAR"), i = {
3065
3112
  type: o,
3066
3113
  fields: { VAR: n.saveState(!0) }
@@ -3072,12 +3119,12 @@ const fo = {
3072
3119
  });
3073
3120
  }
3074
3121
  }
3075
- }, Eo = function(e) {
3122
+ }, yo = function(e) {
3076
3123
  return function() {
3077
3124
  const o = e.workspace, n = e.getField("VAR").getVariable();
3078
3125
  te.renameVariable(o, n);
3079
3126
  };
3080
- }, ho = function(e) {
3127
+ }, Co = function(e) {
3081
3128
  return function() {
3082
3129
  const o = e.workspace, n = e.getField("VAR").getVariable();
3083
3130
  o.deleteVariableById(n.getId()), o.refreshToolboxSelection();
@@ -3085,7 +3132,7 @@ const fo = {
3085
3132
  };
3086
3133
  f.registerMixin(
3087
3134
  "context_menu_variable_v1",
3088
- fo
3135
+ Lo
3089
3136
  );
3090
3137
  _([
3091
3138
  {
@@ -3107,7 +3154,7 @@ _([
3107
3154
  s.forBlock.variable_get_v1 = function(e) {
3108
3155
  return [s.nameDB_.getName(
3109
3156
  e.getFieldValue("VAR"),
3110
- Ee.NameType.VARIABLE
3157
+ he.NameType.VARIABLE
3111
3158
  ), l.ATOMIC];
3112
3159
  };
3113
3160
  _([
@@ -3136,29 +3183,29 @@ _([
3136
3183
  s.forBlock.variable_set_v1 = function(e) {
3137
3184
  const o = s.nameDB_.getName(
3138
3185
  e.getFieldValue("VAR"),
3139
- Ee.NameType.VARIABLE
3186
+ he.NameType.VARIABLE
3140
3187
  ), t = s.valueToCode(e, "VALUE", l.ASSIGNMENT) || "0";
3141
3188
  return `${o} = ${t};
3142
3189
  `;
3143
3190
  };
3144
- const Ne = u.xml;
3145
- function mo() {
3191
+ const Re = u.xml;
3192
+ function vo() {
3146
3193
  const e = [];
3147
3194
  {
3148
- const o = Ne.createElement("label");
3149
- o.setAttribute("text", m.LABEL_ASSET_LAYER), e.push(o);
3195
+ const o = Re.createElement("label");
3196
+ o.setAttribute("text", O.LABEL_ASSET_LAYER), e.push(o);
3150
3197
  }
3151
3198
  {
3152
- const o = Ne.createElement("block");
3199
+ const o = Re.createElement("block");
3153
3200
  o.setAttribute("type", "upload_asset_v1"), e.push(o);
3154
3201
  }
3155
3202
  return e;
3156
3203
  }
3157
- const Oo = {
3204
+ const Ao = {
3158
3205
  name: "INTERFACE_CATEGORY",
3159
- callback: mo
3206
+ callback: vo
3160
3207
  }, $ = u.xml;
3161
- function go() {
3208
+ function bo() {
3162
3209
  const e = [];
3163
3210
  {
3164
3211
  const o = $.createElement("label");
@@ -3171,7 +3218,7 @@ function go() {
3171
3218
  const t = $.createElement("field");
3172
3219
  t.setAttribute("name", "NAME");
3173
3220
  const n = $.createTextNode(
3174
- m.PROCEDURE_DEFAULT_NAME
3221
+ O.PROCEDURE_DEFAULT_NAME
3175
3222
  );
3176
3223
  t.appendChild(n), o.appendChild(t);
3177
3224
  }
@@ -3185,24 +3232,24 @@ function go() {
3185
3232
  }
3186
3233
  const k = {
3187
3234
  name: "PROCEDURE_CATEGORY",
3188
- callback: go
3235
+ callback: bo
3189
3236
  };
3190
- function Io() {
3191
- const { args: e } = xt.app.view, o = [];
3237
+ function ko() {
3238
+ const { args: e } = Gt.app.view, o = [];
3192
3239
  return e == null || e.forEach(({ id: t, name: n, type: i }) => {
3193
3240
  o.push({ id: t, name: n, type: i });
3194
3241
  }), o;
3195
3242
  }
3196
- const Be = u.xml;
3197
- function Lo() {
3243
+ const Se = u.xml;
3244
+ function No() {
3198
3245
  const e = [];
3199
- if (Io().length > 0) {
3246
+ if (ko().length > 0) {
3200
3247
  {
3201
- const o = Be.createElement("label");
3248
+ const o = Se.createElement("label");
3202
3249
  o.setAttribute("text", "%{BKY_LABEL_ARGUMENT}"), e.push(o);
3203
3250
  }
3204
3251
  {
3205
- const o = Be.createElement("block");
3252
+ const o = Se.createElement("block");
3206
3253
  o.setAttribute("type", "get_arg_v1"), e.push(o);
3207
3254
  }
3208
3255
  }
@@ -3210,9 +3257,9 @@ function Lo() {
3210
3257
  }
3211
3258
  const de = {
3212
3259
  name: "UI_CATEGORY",
3213
- callback: Lo
3260
+ callback: No
3214
3261
  }, Z = u.xml;
3215
- function yo(e) {
3262
+ function Bo(e) {
3216
3263
  const o = [];
3217
3264
  {
3218
3265
  const n = Z.createElement("label");
@@ -3235,7 +3282,7 @@ function yo(e) {
3235
3282
  t.sort(ht.compareByName);
3236
3283
  {
3237
3284
  const n = Z.createElement("label");
3238
- n.setAttribute("text", m.LABEL_CREATED), o.push(n);
3285
+ n.setAttribute("text", O.LABEL_CREATED), o.push(n);
3239
3286
  }
3240
3287
  return t.forEach((n) => {
3241
3288
  {
@@ -3250,23 +3297,23 @@ function yo(e) {
3250
3297
  }
3251
3298
  const N = {
3252
3299
  name: "VARIABLE_CATEGORY",
3253
- callback: yo
3300
+ callback: Bo
3254
3301
  };
3255
- Ve.setConfirm(async (e, o) => {
3302
+ Pe.setConfirm(async (e, o) => {
3256
3303
  const t = await vt({
3257
3304
  title: "",
3258
3305
  text: e
3259
3306
  });
3260
3307
  o(!!t);
3261
3308
  });
3262
- Ve.setPrompt(async (e, o, t) => {
3309
+ Pe.setPrompt(async (e, o, t) => {
3263
3310
  const n = await At({
3264
3311
  title: "",
3265
3312
  value: o
3266
3313
  });
3267
3314
  t(String(n));
3268
3315
  });
3269
- const Ke = (e, o, t) => {
3316
+ const Fe = (e, o, t) => {
3270
3317
  const n = e[o];
3271
3318
  return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((i, a) => {
3272
3319
  (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
@@ -3279,12 +3326,12 @@ const Ke = (e, o, t) => {
3279
3326
  );
3280
3327
  });
3281
3328
  };
3282
- async function Re(e) {
3283
- const o = await Ke(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./msg-zhHans-hfznrf5k.js") }), `./msg/${e}.ts`, 3);
3329
+ async function Me(e) {
3330
+ const o = await Fe(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./msg-zhHans-hfznrf5k.js") }), `./msg/${e}.ts`, 3);
3284
3331
  mt(o.default);
3285
3332
  }
3286
- function Fe(e) {
3287
- const o = H();
3333
+ function we(e) {
3334
+ const o = w();
3288
3335
  if (!o)
3289
3336
  return;
3290
3337
  const t = o.getBlockById(e);
@@ -3296,35 +3343,35 @@ function Fe(e) {
3296
3343
  const i = n.getRelativeToSurfaceXY(), a = i.x * o.scale, r = i.y * o.scale;
3297
3344
  o.scroll(-a, -r);
3298
3345
  }
3299
- function Co() {
3346
+ function Ro() {
3300
3347
  var t;
3301
- const e = H();
3348
+ const e = w();
3302
3349
  if (!e)
3303
3350
  return;
3304
3351
  const o = (t = e.getTopBlocks(!0)) == null ? void 0 : t[0];
3305
- o && Fe(o.id);
3352
+ o && we(o.id);
3306
3353
  }
3307
- class vo {
3354
+ class So {
3308
3355
  init({ contextMenu: o = !0, shortcut: t = !0 } = {
3309
3356
  contextMenu: !0,
3310
3357
  shortcut: !0
3311
3358
  }) {
3312
- o && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), t && (g.registry.unregister(
3313
- le.names.COPY
3314
- ), g.registry.unregister(
3315
- le.names.CUT
3316
- ), g.registry.unregister(
3317
- le.names.PASTE
3359
+ o && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), t && (I.registry.unregister(
3360
+ ae.names.COPY
3361
+ ), I.registry.unregister(
3362
+ ae.names.CUT
3363
+ ), I.registry.unregister(
3364
+ ae.names.PASTE
3318
3365
  ), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
3319
3366
  }
3320
3367
  blockCopyToStorageContextMenu() {
3321
3368
  const o = {
3322
3369
  displayText: function() {
3323
- return m.CROSS_TAB_COPY ? m.CROSS_TAB_COPY : "Copy";
3370
+ return O.CROSS_TAB_COPY ? O.CROSS_TAB_COPY : "Copy";
3324
3371
  },
3325
3372
  preconditionFn: function() {
3326
- const t = D();
3327
- return !t || !J(t) || !t.isDeletable() || !ae(t) || !t.isMovable() || !G(t) ? "disabled" : "enabled";
3373
+ const t = Y();
3374
+ return !t || !J(t) || !t.isDeletable() || !re(t) || !t.isMovable() || !G(t) ? "disabled" : "enabled";
3328
3375
  },
3329
3376
  callback: function(t) {
3330
3377
  var n;
@@ -3333,16 +3380,16 @@ class vo {
3333
3380
  JSON.stringify((n = t.block) == null ? void 0 : n.toCopyData())
3334
3381
  );
3335
3382
  },
3336
- scopeType: V.ScopeType.BLOCK,
3383
+ scopeType: P.ScopeType.BLOCK,
3337
3384
  id: "blockCopyToStorage",
3338
3385
  weight: 0
3339
3386
  };
3340
- V.registry.register(o);
3387
+ P.registry.register(o);
3341
3388
  }
3342
3389
  blockPasteFromStorageContextMenu() {
3343
3390
  const o = {
3344
3391
  displayText: function() {
3345
- return m.CROSS_TAB_PASTE ? m.CROSS_TAB_PASTE : "Paste";
3392
+ return O.CROSS_TAB_PASTE ? O.CROSS_TAB_PASTE : "Paste";
3346
3393
  },
3347
3394
  preconditionFn: function(t) {
3348
3395
  var a;
@@ -3357,35 +3404,35 @@ class vo {
3357
3404
  if (!n)
3358
3405
  return;
3359
3406
  const i = JSON.parse(n);
3360
- i && t.workspace && ve.paste(i, t.workspace);
3407
+ i && t.workspace && Ae.paste(i, t.workspace);
3361
3408
  },
3362
- scopeType: V.ScopeType.WORKSPACE,
3409
+ scopeType: P.ScopeType.WORKSPACE,
3363
3410
  id: "blockPasteFromStorage",
3364
3411
  weight: 0
3365
3412
  };
3366
- V.registry.register(o);
3413
+ P.registry.register(o);
3367
3414
  }
3368
3415
  blockCopyToStorageShortcut() {
3369
- const o = g.registry.createSerializedKey(
3416
+ const o = I.registry.createSerializedKey(
3370
3417
  u.KeyCodes.C,
3371
3418
  [u.KeyCodes.CTRL]
3372
- ), t = g.registry.createSerializedKey(
3419
+ ), t = I.registry.createSerializedKey(
3373
3420
  u.KeyCodes.C,
3374
3421
  [u.KeyCodes.ALT]
3375
- ), n = g.registry.createSerializedKey(
3422
+ ), n = I.registry.createSerializedKey(
3376
3423
  u.KeyCodes.C,
3377
3424
  [u.KeyCodes.META]
3378
3425
  ), i = {
3379
3426
  name: "copy",
3380
3427
  preconditionFn: function(a) {
3381
- if (a.options.readOnly || re.inProgress())
3428
+ if (a.options.readOnly || ce.inProgress())
3382
3429
  return !1;
3383
- const r = D();
3384
- return !(!r || !J(r) || !r.isDeletable() || !ae(r) || !r.isMovable() || !G(r));
3430
+ const r = Y();
3431
+ return !(!r || !J(r) || !r.isDeletable() || !re(r) || !r.isMovable() || !G(r));
3385
3432
  },
3386
3433
  callback: function(a, r) {
3387
3434
  r.preventDefault();
3388
- const c = D();
3435
+ const c = Y();
3389
3436
  if (!c || !G(c))
3390
3437
  return !1;
3391
3438
  const p = c.toCopyData();
@@ -3393,29 +3440,29 @@ class vo {
3393
3440
  },
3394
3441
  keyCodes: [o, t, n]
3395
3442
  };
3396
- g.registry.register(i);
3443
+ I.registry.register(i);
3397
3444
  }
3398
3445
  blockCutToStorageShortcut() {
3399
- const o = g.registry.createSerializedKey(
3446
+ const o = I.registry.createSerializedKey(
3400
3447
  u.KeyCodes.X,
3401
3448
  [u.KeyCodes.CTRL]
3402
- ), t = g.registry.createSerializedKey(
3449
+ ), t = I.registry.createSerializedKey(
3403
3450
  u.KeyCodes.X,
3404
3451
  [u.KeyCodes.ALT]
3405
- ), n = g.registry.createSerializedKey(
3452
+ ), n = I.registry.createSerializedKey(
3406
3453
  u.KeyCodes.X,
3407
3454
  [u.KeyCodes.META]
3408
3455
  ), i = {
3409
3456
  name: "cut",
3410
3457
  preconditionFn: function(a) {
3411
- if (a.options.readOnly || re.inProgress())
3458
+ if (a.options.readOnly || ce.inProgress())
3412
3459
  return !1;
3413
- const r = D();
3414
- return !(!r || !J(r) || !r.isDeletable() || !ae(r) || !r.isMovable() || !G(r) || r.workspace.isFlyout);
3460
+ const r = Y();
3461
+ return !(!r || !J(r) || !r.isDeletable() || !re(r) || !r.isMovable() || !G(r) || r.workspace.isFlyout);
3415
3462
  },
3416
3463
  callback: function(a, r) {
3417
3464
  r.preventDefault();
3418
- const c = D();
3465
+ const c = Y();
3419
3466
  if (!c || !J(c) || !c.isDeletable() || !G(c))
3420
3467
  return !1;
3421
3468
  const p = c.toCopyData();
@@ -3423,22 +3470,22 @@ class vo {
3423
3470
  },
3424
3471
  keyCodes: [o, t, n]
3425
3472
  };
3426
- g.registry.register(i);
3473
+ I.registry.register(i);
3427
3474
  }
3428
3475
  blockPasteFromStorageShortcut() {
3429
- const o = g.registry.createSerializedKey(
3476
+ const o = I.registry.createSerializedKey(
3430
3477
  u.KeyCodes.V,
3431
3478
  [u.KeyCodes.CTRL]
3432
- ), t = g.registry.createSerializedKey(
3479
+ ), t = I.registry.createSerializedKey(
3433
3480
  u.KeyCodes.V,
3434
3481
  [u.KeyCodes.ALT]
3435
- ), n = g.registry.createSerializedKey(
3482
+ ), n = I.registry.createSerializedKey(
3436
3483
  u.KeyCodes.V,
3437
3484
  [u.KeyCodes.META]
3438
3485
  ), i = {
3439
3486
  name: "paste",
3440
3487
  preconditionFn: function(a) {
3441
- if (a.options.readOnly || re.inProgress())
3488
+ if (a.options.readOnly || ce.inProgress())
3442
3489
  return !1;
3443
3490
  const r = localStorage.getItem("blocklyStash");
3444
3491
  if (!r)
@@ -3452,16 +3499,16 @@ class vo {
3452
3499
  if (!c)
3453
3500
  return !1;
3454
3501
  const p = JSON.parse(c);
3455
- return p ? (ve.paste(p, a), !0) : !1;
3502
+ return p ? (Ae.paste(p, a), !0) : !1;
3456
3503
  },
3457
3504
  keyCodes: [o, t, n]
3458
3505
  };
3459
- g.registry.register(i);
3506
+ I.registry.register(i);
3460
3507
  }
3461
3508
  }
3462
- class Ao {
3509
+ class Mo {
3463
3510
  init() {
3464
- const o = V.registry.getItem("cleanWorkspace");
3511
+ const o = P.registry.getItem("cleanWorkspace");
3465
3512
  o && (o.callback = function(t) {
3466
3513
  const n = t.workspace;
3467
3514
  if (!n)
@@ -3483,46 +3530,46 @@ function He(e) {
3483
3530
  const o = e.getParent();
3484
3531
  return o && He(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
3485
3532
  }
3486
- class bo {
3533
+ class Vo {
3487
3534
  init() {
3488
- const o = V.registry.getItem("blockDisable");
3535
+ const o = P.registry.getItem("blockDisable");
3489
3536
  o && (o.preconditionFn = function(t) {
3490
3537
  const n = t.block;
3491
3538
  return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || He(n) ? "disabled" : "enabled" : "hidden";
3492
3539
  });
3493
3540
  }
3494
3541
  }
3495
- class we extends ce {
3542
+ class Ge extends _e {
3496
3543
  constructor(t, n, i) {
3497
- super(ce.SKIP_SETUP);
3544
+ super(_e.SKIP_SETUP);
3498
3545
  /** The field's colour picker element. */
3499
- v(this, "picker", null);
3546
+ A(this, "picker", null);
3500
3547
  /** Index of the currently highlighted element. */
3501
- v(this, "highlightedIndex", null);
3548
+ A(this, "highlightedIndex", null);
3502
3549
  /**
3503
3550
  * Array holding info needed to unbind events.
3504
3551
  * Used for disposing.
3505
3552
  * Ex: [[node, name, func], [node, name, func]].
3506
3553
  */
3507
- v(this, "boundEvents", []);
3554
+ A(this, "boundEvents", []);
3508
3555
  /**
3509
3556
  * Serializable fields are saved by the serializer, non-serializable fields
3510
3557
  * are not. Editable fields should also be serializable.
3511
3558
  */
3512
- v(this, "SERIALIZABLE", !0);
3559
+ A(this, "SERIALIZABLE", !0);
3513
3560
  /** Mouse cursor style when over the hotspot that initiates the editor. */
3514
- v(this, "CURSOR", "default");
3561
+ A(this, "CURSOR", "default");
3515
3562
  /**
3516
3563
  * Used to tell if the field needs to be rendered the next time the block is
3517
3564
  * rendered. Colour fields are statically sized, and only need to be
3518
3565
  * rendered at initialization.
3519
3566
  */
3520
- v(this, "isDirty_", !1);
3567
+ A(this, "isDirty_", !1);
3521
3568
  /**
3522
3569
  * An array of colour strings for the palette.
3523
3570
  * Copied from goog.ui.ColorPicker.SIMPLE_GRID_COLORS
3524
3571
  */
3525
- v(this, "colours", [
3572
+ A(this, "colours", [
3526
3573
  // red
3527
3574
  "#F44336",
3528
3575
  // base
@@ -4084,12 +4131,12 @@ class we extends ce {
4084
4131
  * An array of tooltip strings for the palette. If not the same length as
4085
4132
  * COLOURS, the colour's hex code will be used for any missing titles.
4086
4133
  */
4087
- v(this, "titles", ["%{BKY_COLOR_RED}"]);
4134
+ A(this, "titles", ["%{BKY_COLOR_RED}"]);
4088
4135
  /**
4089
4136
  * Number of columns in the palette.
4090
4137
  */
4091
- v(this, "columns", 14);
4092
- t !== ce.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
4138
+ A(this, "columns", 14);
4139
+ t !== _e.SKIP_SETUP && (i && this.configure_(i), this.setValue(t), n && this.setValidator(n));
4093
4140
  }
4094
4141
  configure_(t) {
4095
4142
  super.configure_(t), t.colourOptions && (this.colours = t.colourOptions), t.colourTitles && (this.titles = t.colourTitles), t.columns && (this.columns = t.columns);
@@ -4198,8 +4245,8 @@ class we extends ce {
4198
4245
  const i = this.colours, a = this.columns;
4199
4246
  let r = this.highlightedIndex % a, c = Math.floor(this.highlightedIndex / a);
4200
4247
  r += t, c += n, t < 0 ? r < 0 && c > 0 ? (r = a - 1, c--) : r < 0 && (r = 0) : t > 0 ? r > a - 1 && c < Math.floor(i.length / a) - 1 ? (r = 0, c++) : r > a - 1 && r-- : n < 0 ? c < 0 && (c = 0) : n > 0 && c > Math.floor(i.length / a) - 1 && (c = Math.floor(i.length / a) - 1);
4201
- const p = this.picker.childNodes[c].childNodes[r], O = c * a + r;
4202
- this.setHighlightedCell(p, O);
4248
+ const p = this.picker.childNodes[c].childNodes[r], h = c * a + r;
4249
+ this.setHighlightedCell(p, h);
4203
4250
  }
4204
4251
  onMouseMove(t) {
4205
4252
  const n = t.target, i = n && Number(n.getAttribute("data-index"));
@@ -4258,7 +4305,7 @@ class we extends ce {
4258
4305
  ), p.style.backgroundColor = n[c], n[c] === i && (p.className = "blocklyColourSelected", this.highlightedIndex = c);
4259
4306
  }
4260
4307
  this.boundEvents.push(
4261
- x.conditionalBind(
4308
+ D.conditionalBind(
4262
4309
  a,
4263
4310
  "pointerdown",
4264
4311
  this,
@@ -4266,7 +4313,7 @@ class we extends ce {
4266
4313
  !0
4267
4314
  )
4268
4315
  ), this.boundEvents.push(
4269
- x.conditionalBind(
4316
+ D.conditionalBind(
4270
4317
  a,
4271
4318
  "pointermove",
4272
4319
  this,
@@ -4274,7 +4321,7 @@ class we extends ce {
4274
4321
  !0
4275
4322
  )
4276
4323
  ), this.boundEvents.push(
4277
- x.conditionalBind(
4324
+ D.conditionalBind(
4278
4325
  a,
4279
4326
  "pointerenter",
4280
4327
  this,
@@ -4282,7 +4329,7 @@ class we extends ce {
4282
4329
  !0
4283
4330
  )
4284
4331
  ), this.boundEvents.push(
4285
- x.conditionalBind(
4332
+ D.conditionalBind(
4286
4333
  a,
4287
4334
  "pointerleave",
4288
4335
  this,
@@ -4290,7 +4337,7 @@ class we extends ce {
4290
4337
  !0
4291
4338
  )
4292
4339
  ), this.boundEvents.push(
4293
- x.conditionalBind(
4340
+ D.conditionalBind(
4294
4341
  a,
4295
4342
  "keydown",
4296
4343
  this,
@@ -4302,14 +4349,14 @@ class we extends ce {
4302
4349
  /** Disposes of events and DOM-references belonging to the colour editor. */
4303
4350
  dropdownDispose() {
4304
4351
  for (const t of this.boundEvents)
4305
- x.unbind(t);
4352
+ D.unbind(t);
4306
4353
  this.boundEvents.length = 0, this.picker = null, this.highlightedIndex = null;
4307
4354
  }
4308
4355
  static fromJson(t) {
4309
4356
  return new this(t.colour, void 0, t);
4310
4357
  }
4311
4358
  }
4312
- we.prototype.DEFAULT_VALUE = "#ffffff";
4359
+ Ge.prototype.DEFAULT_VALUE = "#ffffff";
4313
4360
  gt.register(`
4314
4361
  .blocklyColourTable {
4315
4362
  border-collapse: collapse;
@@ -4337,17 +4384,17 @@ gt.register(`
4337
4384
  position: relative;
4338
4385
  }
4339
4386
  `);
4340
- function ko() {
4341
- It.register("field_colour", we);
4387
+ function Uo() {
4388
+ It.register("field_colour", Ge);
4342
4389
  }
4343
- const No = new vo();
4344
- No.init({ contextMenu: !0, shortcut: !0 });
4345
- const Bo = new Ao();
4346
- Bo.init();
4347
- const Ro = new bo();
4348
- Ro.init();
4349
- ko();
4350
- ie.Classic.blockStyles = {
4390
+ const Po = new So();
4391
+ Po.init({ contextMenu: !0, shortcut: !0 });
4392
+ const xo = new Mo();
4393
+ xo.init();
4394
+ const Do = new Vo();
4395
+ Do.init();
4396
+ Uo();
4397
+ se.Classic.blockStyles = {
4351
4398
  color_blocks: {
4352
4399
  colourPrimary: "#a5745b",
4353
4400
  colourSecondary: "#ede3de",
@@ -4421,7 +4468,7 @@ ie.Classic.blockStyles = {
4421
4468
  hat: ""
4422
4469
  }
4423
4470
  };
4424
- ie.Classic.categoryStyles = {
4471
+ se.Classic.categoryStyles = {
4425
4472
  calc_category: {
4426
4473
  colour: "#757575"
4427
4474
  },
@@ -4471,9 +4518,9 @@ ie.Classic.categoryStyles = {
4471
4518
  colour: "#a55b80"
4472
4519
  }
4473
4520
  };
4474
- const So = Pe.defineTheme("light", {
4521
+ const Yo = xe.defineTheme("light", {
4475
4522
  name: "light",
4476
- base: ie.Classic,
4523
+ base: se.Classic,
4477
4524
  componentStyles: {
4478
4525
  workspaceBackgroundColour: "#ffffff",
4479
4526
  toolboxBackgroundColour: "#eeeeee",
@@ -4487,9 +4534,9 @@ const So = Pe.defineTheme("light", {
4487
4534
  scrollbarOpacity: 0.4,
4488
4535
  cursorColour: ""
4489
4536
  }
4490
- }), Mo = Pe.defineTheme("dark", {
4537
+ }), Ko = xe.defineTheme("dark", {
4491
4538
  name: "dark",
4492
- base: ie.Classic,
4539
+ base: se.Classic,
4493
4540
  componentStyles: {
4494
4541
  workspaceBackgroundColour: "#1e1e1e",
4495
4542
  toolboxBackgroundColour: "#272727",
@@ -4504,18 +4551,18 @@ const So = Pe.defineTheme("light", {
4504
4551
  cursorColour: ""
4505
4552
  }
4506
4553
  });
4507
- function Uo(e) {
4508
- const o = H();
4554
+ function Fo(e) {
4555
+ const o = w();
4509
4556
  switch (console.log(o), e) {
4510
4557
  case "light":
4511
- o.setTheme(So);
4558
+ o.setTheme(Yo);
4512
4559
  break;
4513
4560
  case "dark":
4514
- o.setTheme(Mo);
4561
+ o.setTheme(Ko);
4515
4562
  break;
4516
4563
  }
4517
4564
  }
4518
- const he = {
4565
+ const me = {
4519
4566
  kind: "category",
4520
4567
  name: "%{BKY_CATEGORY_COLOR}",
4521
4568
  categorystyle: "color_category",
@@ -4589,7 +4636,7 @@ const he = {
4589
4636
  }
4590
4637
  }
4591
4638
  ]
4592
- }, me = {
4639
+ }, Oe = {
4593
4640
  kind: "category",
4594
4641
  name: "%{BKY_CATEGORY_LIST}",
4595
4642
  categorystyle: "list_category",
@@ -4704,7 +4751,7 @@ const he = {
4704
4751
  type: "list_reverse_v1"
4705
4752
  }
4706
4753
  ]
4707
- }, Oe = {
4754
+ }, ge = {
4708
4755
  kind: "category",
4709
4756
  name: "%{BKY_CATEGORY_LOGIC}",
4710
4757
  categorystyle: "logic_category",
@@ -4746,7 +4793,7 @@ const he = {
4746
4793
  type: "logic_ternary_v1"
4747
4794
  }
4748
4795
  ]
4749
- }, ge = {
4796
+ }, Ie = {
4750
4797
  kind: "category",
4751
4798
  name: "%{BKY_CATEGORY_LOOP}",
4752
4799
  categorystyle: "loop_category",
@@ -4768,7 +4815,7 @@ const he = {
4768
4815
  type: "for_each_v1"
4769
4816
  }
4770
4817
  ]
4771
- }, Ie = {
4818
+ }, Le = {
4772
4819
  kind: "category",
4773
4820
  name: "%{BKY_CATEGORY_MATH}",
4774
4821
  categorystyle: "math_category",
@@ -4923,7 +4970,7 @@ const he = {
4923
4970
  type: "math_on_list_v1"
4924
4971
  }
4925
4972
  ]
4926
- }, Le = {
4973
+ }, ye = {
4927
4974
  kind: "category",
4928
4975
  name: "%{BKY_CATEGORY_OBJECT}",
4929
4976
  categorystyle: "object_category",
@@ -4991,7 +5038,7 @@ const he = {
4991
5038
  }
4992
5039
  }
4993
5040
  ]
4994
- }, ye = {
5041
+ }, Ce = {
4995
5042
  kind: "category",
4996
5043
  name: "%{BKY_CATEGORY_TEXT}",
4997
5044
  categorystyle: "text_category",
@@ -5154,7 +5201,7 @@ const he = {
5154
5201
  type: "text_reverse_v1"
5155
5202
  }
5156
5203
  ]
5157
- }, Vo = {
5204
+ }, wo = {
5158
5205
  kind: "category",
5159
5206
  name: "%{BKY_CATEGORY_TIME}",
5160
5207
  categorystyle: "time_category",
@@ -5178,7 +5225,7 @@ const he = {
5178
5225
  }
5179
5226
  }
5180
5227
  ]
5181
- }, Po = {
5228
+ }, Ho = {
5182
5229
  kind: "categoryToolbox",
5183
5230
  contents: [
5184
5231
  {
@@ -5187,14 +5234,14 @@ const he = {
5187
5234
  categorystyle: "ui_category",
5188
5235
  custom: de.name
5189
5236
  },
5237
+ Ie,
5190
5238
  ge,
5239
+ Le,
5240
+ Ce,
5191
5241
  Oe,
5192
- Ie,
5193
5242
  ye,
5194
5243
  me,
5195
- Le,
5196
- he,
5197
- Vo,
5244
+ wo,
5198
5245
  {
5199
5246
  kind: "category",
5200
5247
  name: "%{BKY_CATEGORY_VARIABLE}",
@@ -5211,19 +5258,19 @@ const he = {
5211
5258
  kind: "category",
5212
5259
  name: "%{BKY_CATEGORY_INTERFACE}",
5213
5260
  categorystyle: "interface_category",
5214
- custom: Oo.name
5261
+ custom: Ao.name
5215
5262
  }
5216
5263
  ]
5217
- }, xo = {
5264
+ }, Go = {
5218
5265
  kind: "categoryToolbox",
5219
5266
  contents: [
5267
+ Ie,
5220
5268
  ge,
5269
+ Le,
5270
+ Ce,
5221
5271
  Oe,
5222
- Ie,
5223
5272
  ye,
5224
5273
  me,
5225
- Le,
5226
- he,
5227
5274
  {
5228
5275
  kind: "category",
5229
5276
  name: "%{BKY_CATEGORY_VARIABLE}",
@@ -5237,16 +5284,16 @@ const he = {
5237
5284
  custom: k.name
5238
5285
  }
5239
5286
  ]
5240
- }, Do = {
5287
+ }, $o = {
5241
5288
  kind: "categoryToolbox",
5242
5289
  contents: [
5290
+ Ie,
5243
5291
  ge,
5292
+ Le,
5293
+ Ce,
5244
5294
  Oe,
5245
- Ie,
5246
5295
  ye,
5247
5296
  me,
5248
- Le,
5249
- he,
5250
5297
  {
5251
5298
  kind: "category",
5252
5299
  name: "%{BKY_CATEGORY_VARIABLE}",
@@ -5260,28 +5307,28 @@ const he = {
5260
5307
  custom: k.name
5261
5308
  }
5262
5309
  ]
5263
- }, Yo = /* @__PURE__ */ X({
5310
+ }, jo = /* @__PURE__ */ W({
5264
5311
  __name: "index",
5265
5312
  setup(e) {
5266
5313
  const o = () => {
5267
- const t = H();
5314
+ const t = w();
5268
5315
  if (!t)
5269
5316
  return;
5270
- const n = V.registry.getItem("cleanWorkspace");
5317
+ const n = P.registry.getItem("cleanWorkspace");
5271
5318
  n && n.callback({ workspace: t }, new PointerEvent("dummy"));
5272
5319
  };
5273
5320
  return (t, n) => {
5274
- const i = C("v-btn");
5275
- return I(), P(i, {
5321
+ const i = v("v-btn");
5322
+ return L(), x(i, {
5276
5323
  class: "mr-3",
5277
5324
  variant: "outlined",
5278
5325
  density: "comfortable",
5279
- icon: A(Rt),
5326
+ icon: C(Rt),
5280
5327
  onClick: o
5281
5328
  }, null, 8, ["icon"]);
5282
5329
  };
5283
5330
  }
5284
- }), Ko = /* @__PURE__ */ X({
5331
+ }), Xo = /* @__PURE__ */ W({
5285
5332
  __name: "index",
5286
5333
  props: {
5287
5334
  modelValue: { type: Boolean, required: !0 },
@@ -5289,76 +5336,76 @@ const he = {
5289
5336
  },
5290
5337
  emits: ["update:modelValue"],
5291
5338
  setup(e) {
5292
- const o = _e(e, "modelValue");
5339
+ const o = ue(e, "modelValue");
5293
5340
  return (t, n) => {
5294
- const i = C("v-btn");
5295
- return I(), P(i, {
5341
+ const i = v("v-btn");
5342
+ return L(), x(i, {
5296
5343
  class: "mr-3",
5297
5344
  variant: "outlined",
5298
5345
  density: "comfortable",
5299
- icon: o.value ? A(Ut) : A(Vt),
5346
+ icon: o.value ? C(Vt) : C(Ut),
5300
5347
  onClick: n[0] || (n[0] = (a) => o.value = !o.value)
5301
5348
  }, null, 8, ["icon"]);
5302
5349
  };
5303
5350
  }
5304
- }), Fo = {
5351
+ }), Wo = {
5305
5352
  key: 1,
5306
5353
  class: "text-caption text-grey"
5307
- }, Ho = /* @__PURE__ */ X({
5354
+ }, Jo = /* @__PURE__ */ W({
5308
5355
  __name: "index",
5309
5356
  setup(e) {
5310
- const { t: o } = De(), t = ue([]), n = () => {
5311
- var O;
5312
- const a = H();
5357
+ const { t: o } = Ye(), t = ne([]), n = () => {
5358
+ var h;
5359
+ const a = w();
5313
5360
  if (!a) {
5314
5361
  t.value = [];
5315
5362
  return;
5316
5363
  }
5317
- const r = [], c = a.getTopBlocks(!0), p = ((O = D()) == null ? void 0 : O.id) ?? "";
5364
+ const r = [], c = a.getTopBlocks(!0), p = ((h = Y()) == null ? void 0 : h.id) ?? "";
5318
5365
  c.forEach((T) => {
5319
- const y = T;
5320
- if (y.type.startsWith("on_node_event_v"))
5366
+ const g = T;
5367
+ if (g.type.startsWith("on_node_event_v"))
5321
5368
  console.log("1");
5322
- else if (y.type.startsWith("procedure_def_v"))
5369
+ else if (g.type.startsWith("procedure_def_v"))
5323
5370
  console.log("2");
5324
5371
  else {
5325
- const d = y.getRelativeToSurfaceXY();
5372
+ const d = g.getRelativeToSurfaceXY();
5326
5373
  r.push({
5327
- id: y.id,
5328
- name: m.fffff,
5374
+ id: g.id,
5375
+ name: O.fffff,
5329
5376
  x: d.x,
5330
5377
  y: d.y,
5331
- active: y.id === p
5378
+ active: g.id === p
5332
5379
  });
5333
5380
  }
5334
5381
  }), t.value = r;
5335
5382
  };
5336
- Me(() => {
5337
- be.on("codeUpdate", n);
5338
- }), it(() => {
5339
- be.off("codeUpdate", n);
5383
+ fe(() => {
5384
+ ke.on("codeUpdate", n);
5385
+ }), lt(() => {
5386
+ ke.off("codeUpdate", n);
5340
5387
  });
5341
5388
  const i = (a) => {
5342
- const r = H();
5389
+ const r = w();
5343
5390
  if (!r)
5344
5391
  return;
5345
5392
  const c = r.getBlockById(a.id);
5346
- c && (Fe(a.id), c.select());
5393
+ c && (we(a.id), c.select());
5347
5394
  };
5348
5395
  return (a, r) => {
5349
- const c = C("v-list-item-title"), p = C("v-list-item"), O = C("v-list");
5350
- return t.value.length > 0 ? (I(), P(O, { key: 0 }, {
5351
- default: Y(() => [
5352
- (I(!0), j(st, null, lt(t.value, (T) => (I(), P(p, {
5396
+ const c = v("v-list-item-title"), p = v("v-list-item"), h = v("v-list");
5397
+ return t.value.length > 0 ? (L(), x(h, { key: 0 }, {
5398
+ default: K(() => [
5399
+ (L(!0), X(at, null, rt(t.value, (T) => (L(), x(p, {
5353
5400
  key: T.id,
5354
5401
  class: "d-flex justify-start",
5355
5402
  active: T.active,
5356
- onClick: (y) => i(T)
5403
+ onClick: (g) => i(T)
5357
5404
  }, {
5358
- default: Y(() => [
5405
+ default: K(() => [
5359
5406
  B(c, null, {
5360
- default: Y(() => [
5361
- at(pe(T.name), 1)
5407
+ default: K(() => [
5408
+ ct(pe(T.name), 1)
5362
5409
  ]),
5363
5410
  _: 2
5364
5411
  }, 1024)
@@ -5367,58 +5414,58 @@ const he = {
5367
5414
  }, 1032, ["active", "onClick"]))), 128))
5368
5415
  ]),
5369
5416
  _: 1
5370
- })) : (I(), j("span", Fo, pe(A(o)("x-block-lib.noOption")), 1));
5417
+ })) : (L(), X("span", Wo, pe(C(o)("x-block-lib.noOption")), 1));
5371
5418
  };
5372
5419
  }
5373
- }), wo = { class: "text-subtitle-1 ml-3" }, Go = /* @__PURE__ */ X({
5420
+ }), zo = { class: "text-subtitle-1 ml-3" }, Qo = /* @__PURE__ */ W({
5374
5421
  __name: "index",
5375
5422
  setup(e) {
5376
- const { t: o } = De(), t = Bt(), { sysBarAvail: n } = bt(), { backgroundColor1: i } = kt(), a = K(() => {
5377
- let O = "100%";
5378
- return t.mdAndUp.value && (O = "400px"), {
5423
+ const { t: o } = Ye(), t = Bt(), { sysBarAvail: n } = bt(), { backgroundColor1: i } = kt(), a = S(() => {
5424
+ let h = "100%";
5425
+ return t.mdAndUp.value && (h = "400px"), {
5379
5426
  background: i.value,
5380
- width: O,
5427
+ width: h,
5381
5428
  height: "100%"
5382
5429
  };
5383
- }), r = K(() => {
5384
- let O = 48;
5385
- return n.value && (O += 24), {
5430
+ }), r = S(() => {
5431
+ let h = 48;
5432
+ return n.value && (h += 24), {
5386
5433
  position: "relative",
5387
5434
  width: "100%",
5388
- height: `calc(100% - ${O}px)`
5435
+ height: `calc(100% - ${h}px)`
5389
5436
  };
5390
- }), c = K(() => ({
5437
+ }), c = S(() => ({
5391
5438
  height: "60px"
5392
- })), { open: p } = xe("blocklyNavigatorDlg");
5393
- return (O, T) => {
5394
- const y = C("v-btn"), d = C("v-sheet"), S = C("v-icon"), w = C("v-dialog");
5395
- return I(), P(w, {
5396
- modelValue: A(p),
5397
- "onUpdate:modelValue": T[3] || (T[3] = (b) => rt(p) ? p.value = b : null),
5439
+ })), { open: p } = De("blocklyNavigatorDlg");
5440
+ return (h, T) => {
5441
+ const g = v("v-btn"), d = v("v-sheet"), M = v("v-icon"), H = v("v-dialog");
5442
+ return L(), x(H, {
5443
+ modelValue: C(p),
5444
+ "onUpdate:modelValue": T[3] || (T[3] = (b) => _t(p) ? p.value = b : null),
5398
5445
  transition: "scroll-x-reverse-transition",
5399
5446
  persistent: "",
5400
5447
  "no-click-animation": "",
5401
5448
  fullscreen: "",
5402
- onKeydown: T[4] || (T[4] = ct(se((b) => p.value = !1, ["stop", "prevent"]), ["esc"]))
5449
+ onKeydown: T[4] || (T[4] = ut(le((b) => p.value = !1, ["stop", "prevent"]), ["esc"]))
5403
5450
  }, {
5404
- activator: Y(({ props: b }) => [
5405
- B(y, _t(b, {
5451
+ activator: K(({ props: b }) => [
5452
+ B(g, pt(b, {
5406
5453
  variant: "outlined",
5407
5454
  density: "comfortable",
5408
- icon: A(Pt)
5455
+ icon: C(Pt)
5409
5456
  }), null, 16, ["icon"])
5410
5457
  ]),
5411
- default: Y(() => [
5412
- M("div", {
5458
+ default: K(() => [
5459
+ V("div", {
5413
5460
  class: "w-100 h-100 d-flex flex-row-reverse",
5414
- onClick: T[1] || (T[1] = se((b) => p.value = !1, ["self"])),
5415
- onContextmenu: T[2] || (T[2] = se((b) => p.value = !1, ["self", "prevent"]))
5461
+ onClick: T[1] || (T[1] = le((b) => p.value = !1, ["self"])),
5462
+ onContextmenu: T[2] || (T[2] = le((b) => p.value = !1, ["self", "prevent"]))
5416
5463
  }, [
5417
- M("div", {
5464
+ V("div", {
5418
5465
  class: "elevation-2",
5419
5466
  style: F(a.value)
5420
5467
  }, [
5421
- A(n) ? (I(), P(d, {
5468
+ C(n) ? (L(), x(d, {
5422
5469
  key: 0,
5423
5470
  color: "transparent",
5424
5471
  height: 24
@@ -5428,21 +5475,21 @@ const he = {
5428
5475
  color: "transparent",
5429
5476
  height: 48
5430
5477
  }, {
5431
- default: Y(() => [
5432
- B(S, {
5433
- icon: A(St),
5478
+ default: K(() => [
5479
+ B(M, {
5480
+ icon: C(St),
5434
5481
  onClick: T[0] || (T[0] = (b) => p.value = !1)
5435
5482
  }, null, 8, ["icon"]),
5436
- M("span", wo, pe(A(o)("x-block-lib.navigator")), 1)
5483
+ V("span", zo, pe(C(o)("x-block-lib.navigator")), 1)
5437
5484
  ]),
5438
5485
  _: 1
5439
5486
  }),
5440
- M("div", {
5487
+ V("div", {
5441
5488
  class: "overflow-y-auto",
5442
5489
  style: F(r.value)
5443
5490
  }, [
5444
- B(Ho),
5445
- M("div", {
5491
+ B(Jo),
5492
+ V("div", {
5446
5493
  style: F(c.value)
5447
5494
  }, null, 4)
5448
5495
  ], 4)
@@ -5453,7 +5500,7 @@ const he = {
5453
5500
  }, 8, ["modelValue"]);
5454
5501
  };
5455
5502
  }
5456
- }), Se = {
5503
+ }), Ve = {
5457
5504
  grid: {
5458
5505
  length: 2,
5459
5506
  snap: !0,
@@ -5476,10 +5523,10 @@ const he = {
5476
5523
  wheel: !0
5477
5524
  }
5478
5525
  };
5479
- function $o(e, o, t) {
5526
+ function qo(e, o, t) {
5480
5527
  let n;
5481
- o === "app" ? t === "v1" && (n = Po) : o === "func" ? t === "v1" && (n = Do) : o === "flow" && t === "v1" && (n = xo), console.assert(!!n), Se.toolbox = n;
5482
- const i = Lt(e, Se);
5528
+ o === "app" ? t === "v1" && (n = Ho) : o === "func" ? t === "v1" && (n = $o) : o === "flow" && t === "v1" && (n = Go), console.assert(!!n), Ve.toolbox = n;
5529
+ const i = Lt(e, Ve);
5483
5530
  return o === "app" ? t === "v1" && (i.registerToolboxCategoryCallback(
5484
5531
  de.name,
5485
5532
  de.callback
@@ -5503,9 +5550,9 @@ function $o(e, o, t) {
5503
5550
  N.callback
5504
5551
  )), i;
5505
5552
  }
5506
- const jo = { class: "position-relative w-100 h-100" }, Xo = /* @__PURE__ */ X({
5553
+ const Zo = { class: "position-relative w-100 h-100" }, en = /* @__PURE__ */ W({
5507
5554
  __name: "index",
5508
- props: /* @__PURE__ */ Ce({
5555
+ props: /* @__PURE__ */ ve({
5509
5556
  type: {},
5510
5557
  version: {}
5511
5558
  }, {
@@ -5514,11 +5561,11 @@ const jo = { class: "position-relative w-100 h-100" }, Xo = /* @__PURE__ */ X({
5514
5561
  scale: { required: !0 },
5515
5562
  scaleModifiers: {}
5516
5563
  }),
5517
- emits: /* @__PURE__ */ Ce(["ready", "change"], ["update:lock", "update:scale"]),
5564
+ emits: /* @__PURE__ */ ve(["ready", "change"], ["update:lock", "update:scale"]),
5518
5565
  setup(e, { expose: o, emit: t }) {
5519
- const n = Nt(), { locale: i, dark: a } = Ct(n), { open: r } = xe("blocklyEditorFlyout"), c = _e(e, "lock"), p = _e(e, "scale"), O = e, T = t, y = ut("blocklyDiv");
5566
+ const n = Nt(), { locale: i, dark: a } = Ct(n), { open: r } = De("blocklyEditorFlyout"), c = ue(e, "lock"), p = ue(e, "scale"), h = e, T = t, g = Tt("blocklyDiv");
5520
5567
  let d;
5521
- const S = ue(!1), w = ue(!1), b = K(() => ({
5568
+ const M = ne(!1), H = ne(!1), b = S(() => ({
5522
5569
  position: "absolute",
5523
5570
  background: a.value ? "#0000007f" : "#ffffff7f",
5524
5571
  top: "1px",
@@ -5527,7 +5574,7 @@ const jo = { class: "position-relative w-100 h-100" }, Xo = /* @__PURE__ */ X({
5527
5574
  height: "calc(100% - 1px)",
5528
5575
  pointerEvents: "none",
5529
5576
  zIndex: 999
5530
- })), Ge = K(() => ({
5577
+ })), $e = S(() => ({
5531
5578
  position: "absolute",
5532
5579
  background: a.value ? "#0000007f" : "#ffffff7f",
5533
5580
  top: "0px",
@@ -5535,93 +5582,90 @@ const jo = { class: "position-relative w-100 h-100" }, Xo = /* @__PURE__ */ X({
5535
5582
  width: "100%",
5536
5583
  height: "100%",
5537
5584
  pointerEvents: "none"
5538
- })), $e = K(() => ({
5585
+ })), je = S(() => ({
5539
5586
  position: "absolute",
5540
5587
  top: "0px",
5541
5588
  right: "0px",
5542
5589
  zIndex: 20
5543
- })), je = () => {
5544
- console.log("blockly resize"), d == null || d.resize();
5545
- }, Xe = (h) => {
5546
- console.log("blockly load"), S.value = !0, Ae.workspaces.load(h, d);
5547
- }, We = () => (console.log("blockly save"), Ae.workspaces.save(d)), Je = () => (console.log("blockly generateCode"), s.workspaceToCode(d));
5548
- Me(async () => {
5549
- await Re(i.value), d = $o(y.value, O.type, O.version), d.addChangeListener(E.disableOrphans), d.addChangeListener(Qe), d.setScale(p.value), T("ready");
5550
- }), pt(() => {
5590
+ })), Xe = () => {
5591
+ d == null || d.resize();
5592
+ }, We = (m) => {
5593
+ M.value = !0, be.workspaces.load(m, d);
5594
+ }, Je = () => be.workspaces.save(d), ze = () => s.workspaceToCode(d);
5595
+ fe(async () => {
5596
+ await Me(i.value), d = qo(g.value, h.type, h.version), d.addChangeListener(E.disableOrphans), d.addChangeListener(Qe), d.setScale(p.value), T("ready");
5597
+ }), dt(() => {
5551
5598
  r.value = !1;
5552
- });
5553
- function ze() {
5599
+ }), Ht(g, () => {
5554
5600
  d && yt(d);
5555
- }
5556
- function Qe(h) {
5557
- if (h.type === E.FINISHED_LOADING) {
5558
- Co(), S.value = !1;
5601
+ });
5602
+ function Qe(m) {
5603
+ if (m.type === E.FINISHED_LOADING) {
5604
+ Ro(), M.value = !1;
5559
5605
  return;
5560
5606
  }
5561
- S.value || (h.type === E.VIEWPORT_CHANGE && (p.value = d.getScale()), h.type === E.BLOCK_DRAG && (h.isStart ? w.value = !0 : w.value = !1), console.log(s.workspaceToCode(d)), T("change"));
5607
+ M.value || (m.type === E.VIEWPORT_CHANGE && (p.value = d.getScale()), m.type === E.BLOCK_DRAG && (m.isStart ? H.value = !0 : H.value = !1), T("change"));
5562
5608
  }
5563
- return W(i, (h) => {
5564
- Re(h);
5565
- }), W(a, (h) => {
5566
- Uo(h ? "dark" : "light");
5567
- }), W(r, (h) => {
5609
+ return j(i, (m) => {
5610
+ Me(m);
5611
+ }), j(a, (m) => {
5612
+ Fo(m ? "dark" : "light");
5613
+ }), j(r, (m) => {
5568
5614
  var R;
5569
- h || (R = d.getToolbox()) == null || R.clearSelection();
5570
- }), W(p, (h) => {
5571
- d.setScale(h);
5572
- }), o({ loading: S, resize: je, load: Xe, save: We, generateCode: Je }), (h, R) => {
5573
- const qe = C("v-icon"), Ze = C("x-loading"), et = Tt("resize");
5574
- return I(), j("div", jo, [
5575
- dt(M("div", {
5615
+ m || (R = d.getToolbox()) == null || R.clearSelection();
5616
+ }), j(p, (m) => {
5617
+ d.setScale(m);
5618
+ }), o({ loading: M, resize: Xe, load: We, save: Je, generateCode: ze }), (m, R) => {
5619
+ const qe = v("v-icon"), Ze = v("x-loading");
5620
+ return L(), X("div", Zo, [
5621
+ V("div", {
5576
5622
  id: "blocklyEditor",
5577
5623
  ref_key: "blocklyDiv",
5578
- ref: y,
5624
+ ref: g,
5579
5625
  class: "w-100 h-100"
5580
- }, null, 512), [
5581
- [et, ze]
5582
- ]),
5583
- w.value ? (I(), j("div", {
5626
+ }, null, 512),
5627
+ H.value ? (L(), X("div", {
5584
5628
  key: 0,
5585
5629
  class: "d-flex flex-column align-center justify-center",
5586
5630
  style: F(b.value)
5587
5631
  }, [
5588
5632
  B(qe, {
5589
- icon: A(Mt),
5633
+ icon: C(Mt),
5590
5634
  size: "x-large"
5591
5635
  }, null, 8, ["icon"])
5592
5636
  ], 4)) : ee("", !0),
5593
- c.value ? (I(), j("div", {
5637
+ c.value ? (L(), X("div", {
5594
5638
  key: 1,
5595
- style: F(Ge.value)
5639
+ style: F($e.value)
5596
5640
  }, null, 4)) : ee("", !0),
5597
- M("div", {
5641
+ V("div", {
5598
5642
  class: "d-flex align-end pt-3 pr-3",
5599
- style: F($e.value)
5643
+ style: F(je.value)
5600
5644
  }, [
5601
- B(Yo),
5602
- B(Ko, {
5645
+ B(jo),
5646
+ B(Xo, {
5603
5647
  modelValue: c.value,
5604
- "onUpdate:modelValue": R[0] || (R[0] = (tt) => c.value = tt)
5648
+ "onUpdate:modelValue": R[0] || (R[0] = (et) => c.value = et)
5605
5649
  }, null, 8, ["modelValue"]),
5606
- B(Go)
5650
+ B(Qo)
5607
5651
  ], 4),
5608
- S.value ? (I(), P(Ze, {
5652
+ M.value ? (L(), x(Ze, {
5609
5653
  key: 2,
5610
5654
  "z-index": 99
5611
5655
  })) : ee("", !0)
5612
5656
  ]);
5613
5657
  };
5614
5658
  }
5615
- }), Wo = (e) => {
5616
- e.component("XBlockly", Xo);
5659
+ }), tn = (e) => {
5660
+ e.component("XBlockly", en);
5617
5661
  };
5618
- async function on(e) {
5619
- return (await Ke(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en-hf8d9jpk.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans-kicfou8k.js") }), `./locales/${e}/index.ts`, 4)).default;
5662
+ async function _n(e) {
5663
+ return (await Fe(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en-hf8d9jpk.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans-kicfou8k.js") }), `./locales/${e}/index.ts`, 4)).default;
5620
5664
  }
5621
- const nn = { install: Wo };
5665
+ const un = { install: tn };
5622
5666
  export {
5623
- Xo as XBlockly,
5624
- nn as default,
5625
- Wo as install,
5626
- on as loadLocaleMessageBlock
5667
+ en as XBlockly,
5668
+ un as default,
5669
+ tn as install,
5670
+ _n as loadLocaleMessageBlock
5627
5671
  };