geonodes-web-render 0.3.28 → 0.3.30

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/embed.js CHANGED
@@ -7847,8 +7847,85 @@ function cf(e, t) {
7847
7847
  return nf[sf(e, t) ?? of[e] ?? af(e)] ?? nf.DEFAULT;
7848
7848
  }
7849
7849
  //#endregion
7850
- //#region src/gn/importer/blenderTree.ts
7850
+ //#region src/gn/ir/operationLabels.ts
7851
7851
  var lf = {
7852
+ EQUAL: "Equal",
7853
+ NOT_EQUAL: "Not Equal",
7854
+ LESS_THAN: "Less Than",
7855
+ LESS_EQUAL: "Less Than or Equal",
7856
+ GREATER_THAN: "Greater Than",
7857
+ GREATER_EQUAL: "Greater Than or Equal",
7858
+ ADD: "Add",
7859
+ SUBTRACT: "Subtract",
7860
+ MULTIPLY: "Multiply",
7861
+ DIVIDE: "Divide",
7862
+ MULTIPLY_ADD: "Multiply Add",
7863
+ POWER: "Power",
7864
+ LOGARITHM: "Logarithm",
7865
+ SQRT: "Square Root",
7866
+ INVERSE_SQRT: "Inverse Square Root",
7867
+ ABSOLUTE: "Absolute",
7868
+ EXPONENT: "Exponent",
7869
+ MINIMUM: "Minimum",
7870
+ MAXIMUM: "Maximum",
7871
+ SIGN: "Sign",
7872
+ COMPARE: "Compare",
7873
+ SMOOTH_MIN: "Smooth Minimum",
7874
+ SMOOTH_MAX: "Smooth Maximum",
7875
+ ROUND: "Round",
7876
+ FLOOR: "Floor",
7877
+ CEIL: "Ceiling",
7878
+ TRUNCATE: "Truncate",
7879
+ FRACTION: "Fraction",
7880
+ MODULO: "Modulo",
7881
+ WRAP: "Wrap",
7882
+ SNAP: "Snap",
7883
+ PINGPONG: "Ping-Pong",
7884
+ SINE: "Sine",
7885
+ COSINE: "Cosine",
7886
+ TANGENT: "Tangent",
7887
+ ARCSINE: "Arcsine",
7888
+ ARCCOSINE: "Arccosine",
7889
+ ARCTANGENT: "Arctangent",
7890
+ ARCTAN2: "Arctan2",
7891
+ SINH: "Hyperbolic Sine",
7892
+ COSH: "Hyperbolic Cosine",
7893
+ TANH: "Hyperbolic Tangent",
7894
+ RADIANS: "To Radians",
7895
+ DEGREES: "To Degrees",
7896
+ NEGATE: "Negate",
7897
+ DIVIDE_ROUND: "Divide Round",
7898
+ DIVIDE_FLOOR: "Divide Floor",
7899
+ DIVIDE_CEIL: "Divide Ceiling",
7900
+ FLOORED_MODULO: "Floored Modulo",
7901
+ GCD: "Greatest Common Divisor",
7902
+ LCM: "Least Common Multiple",
7903
+ CROSS_PRODUCT: "Cross Product",
7904
+ DOT_PRODUCT: "Dot Product",
7905
+ PROJECT: "Project",
7906
+ REFLECT: "Reflect",
7907
+ REFRACT: "Refract",
7908
+ FACEFORWARD: "Faceforward",
7909
+ DISTANCE: "Distance",
7910
+ LENGTH: "Length",
7911
+ SCALE: "Scale",
7912
+ NORMALIZE: "Normalize",
7913
+ AND: "And",
7914
+ OR: "Or",
7915
+ NOT: "Not",
7916
+ NAND: "Not And",
7917
+ NOR: "Nor",
7918
+ XNOR: "Equal",
7919
+ XOR: "Not Equal",
7920
+ IMPLY: "Imply",
7921
+ NIMPLY: "Subtract"
7922
+ };
7923
+ function uf(e) {
7924
+ return lf[e] ?? e;
7925
+ }
7926
+ //#endregion
7927
+ //#region src/gn/importer/blenderTree.ts
7928
+ var df = {
7852
7929
  NodeSocketGeometry: "GEOMETRY",
7853
7930
  NodeSocketFloat: "FLOAT",
7854
7931
  NodeSocketVector: "VECTOR",
@@ -7865,10 +7942,10 @@ var lf = {
7865
7942
  NodeSocketMatrix: "MATRIX",
7866
7943
  NodeSocketMenu: "MENU"
7867
7944
  };
7868
- function uf(e) {
7869
- return lf[e] ?? "CUSTOM";
7945
+ function ff(e) {
7946
+ return df[e] ?? "CUSTOM";
7870
7947
  }
7871
- var df = {
7948
+ var pf = {
7872
7949
  HSV: [
7873
7950
  "Hue",
7874
7951
  "Saturation",
@@ -7885,7 +7962,7 @@ var df = {
7885
7962
  "Blue"
7886
7963
  ]
7887
7964
  };
7888
- function ff(e) {
7965
+ function mf(e) {
7889
7966
  let t = e.data.mapping?.data;
7890
7967
  if (!t) return;
7891
7968
  let n = t.curves?.data?.items;
@@ -7903,7 +7980,7 @@ function ff(e) {
7903
7980
  points: r
7904
7981
  };
7905
7982
  }
7906
- function pf(e) {
7983
+ function hf(e) {
7907
7984
  let t = e.data.color_ramp?.data;
7908
7985
  if (!t) return;
7909
7986
  let n = (t.elements?.data?.items ?? []).map((e) => {
@@ -7925,8 +8002,8 @@ function pf(e) {
7925
8002
  stops: n
7926
8003
  };
7927
8004
  }
7928
- function mf(e, t) {
7929
- let n = df[t ?? "RGB"] ?? df.RGB, r = df.RGB;
8005
+ function gf(e, t) {
8006
+ let n = pf[t ?? "RGB"] ?? pf.RGB, r = pf.RGB;
7930
8007
  return e.map((e) => {
7931
8008
  let t = r.indexOf(e.name);
7932
8009
  return t === -1 ? e : {
@@ -7935,11 +8012,11 @@ function mf(e, t) {
7935
8012
  };
7936
8013
  });
7937
8014
  }
7938
- function hf(e) {
8015
+ function _f(e) {
7939
8016
  return e.replace(/\.\d{3}$/, "");
7940
8017
  }
7941
- function gf(e, t) {
7942
- let n = uf(e.data.socket_idname ?? ""), r = tf(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
8018
+ function vf(e, t) {
8019
+ let n = ff(e.data.socket_idname ?? ""), r = tf(n), i = String(e.data.single_input ?? `${e.id}_in`), a = String(e.data.single_output ?? `${e.id}_out`), o = (e) => ({
7943
8020
  id: e,
7944
8021
  name: "",
7945
8022
  dataType: n,
@@ -7965,7 +8042,7 @@ function gf(e, t) {
7965
8042
  ...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) }
7966
8043
  };
7967
8044
  }
7968
- function _f(e) {
8045
+ function yf(e) {
7969
8046
  return e == null ? null : Array.isArray(e) && e.length >= 2 ? {
7970
8047
  kind: "vec",
7971
8048
  values: e
@@ -7974,74 +8051,87 @@ function _f(e) {
7974
8051
  value: e
7975
8052
  } : null;
7976
8053
  }
7977
- function vf(e, t) {
8054
+ function bf(e, t) {
7978
8055
  return {
7979
8056
  id: String(e.id),
7980
8057
  name: e.data.name,
7981
8058
  dataType: e.data.type,
7982
8059
  displayShape: e.data.display_shape,
7983
8060
  color: tf(e.data.type),
7984
- defaultValue: _f(e.data.default_value),
8061
+ defaultValue: yf(e.data.default_value),
7985
8062
  hideValue: e.data.hide_value ?? !1,
7986
8063
  enabled: e.data.enabled ?? !0,
7987
8064
  index: t
7988
8065
  };
7989
8066
  }
7990
- function yf(e) {
8067
+ var xf = new Set([
8068
+ "ShaderNodeMath",
8069
+ "ShaderNodeVectorMath",
8070
+ "FunctionNodeIntegerMath",
8071
+ "FunctionNodeBooleanMath",
8072
+ "FunctionNodeCompare"
8073
+ ]);
8074
+ function Sf(e) {
7991
8075
  if (e.data.bl_idname === "FunctionNodeCompare") {
7992
8076
  let t = {};
7993
8077
  return e.data.data_type && (t.data_type = e.data.data_type), e.data.operation && (t.operation = e.data.operation), Object.keys(t).length > 0 ? t : void 0;
7994
8078
  }
7995
- if (e.data.bl_idname === "ShaderNodeMath") {
8079
+ if (xf.has(e.data.bl_idname)) {
7996
8080
  let t = {};
7997
8081
  return e.data.operation && (t.operation = e.data.operation), e.data.use_clamp && (t.use_clamp = "true"), Object.keys(t).length > 0 ? t : void 0;
7998
8082
  }
7999
8083
  }
8000
- function bf(e, t) {
8084
+ function Cf(e) {
8085
+ return e.data.label ? e.data.label : xf.has(e.data.bl_idname) && e.data.operation ? uf(e.data.operation) : _f(e.data.name);
8086
+ }
8087
+ function wf(e, t) {
8001
8088
  if (!e?.data) throw Error(`"node_trees[${t}].data" is missing.`);
8002
8089
  if (!e.data.nodes?.data?.items) throw Error(`"node_trees[${t}].data.nodes.data.items" is missing.`);
8003
8090
  if (!e.data.links?.data?.items) throw Error(`"node_trees[${t}].data.links.data.items" is missing.`);
8091
+ let n = /* @__PURE__ */ new Map();
8092
+ for (let t of e.data.nodes.data.items) t?.data?.name && n.set(t.data.name, String(t.id));
8004
8093
  return {
8005
8094
  id: String(e.id),
8006
8095
  label: e.data.name,
8007
8096
  nodes: e.data.nodes.data.items.map((e, t) => {
8008
8097
  if (!e?.data) throw Error(`Node at index ${t} is missing ".data".`);
8009
- let n = e.data.location_absolute ?? e.data.location ?? [0, 0];
8010
- if (e.data.bl_idname === "NodeReroute") return gf(e, n);
8011
- let r = (e.data.outputs?.data?.items ?? []).map((t, n) => {
8098
+ let r = e.data.location_absolute ?? e.data.location ?? [0, 0];
8099
+ if (e.data.bl_idname === "NodeReroute") return vf(e, r);
8100
+ let i = (e.data.outputs?.data?.items ?? []).map((t, n) => {
8012
8101
  if (!t?.data) throw Error(`Node "${e.data.name}" output socket ${n} is missing ".data".`);
8013
- return vf(t, n);
8102
+ return bf(t, n);
8014
8103
  });
8015
- e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (r[0] &&= {
8016
- ...r[0],
8104
+ e.data.bl_idname === "FunctionNodeInputVector" && Array.isArray(e.data.vector) && (i[0] &&= {
8105
+ ...i[0],
8017
8106
  defaultValue: {
8018
8107
  kind: "vec",
8019
8108
  values: e.data.vector
8020
8109
  }
8021
8110
  });
8022
- let i = (e.data.inputs?.data?.items ?? []).map((t, n) => {
8111
+ let a = (e.data.inputs?.data?.items ?? []).map((t, n) => {
8023
8112
  if (!t?.data) throw Error(`Node "${e.data.name}" input socket ${n} is missing ".data".`);
8024
- return vf(t, n);
8113
+ return bf(t, n);
8025
8114
  });
8026
- (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (i = mf(i, e.data.mode));
8027
- let a = e.data.bl_idname === "ShaderNodeFloatCurve" ? ff(e) : void 0, o = e.data.bl_idname === "ShaderNodeValToRGB" ? pf(e) : void 0, s = yf(e);
8115
+ (e.data.bl_idname === "ShaderNodeCombineColor" || e.data.bl_idname === "ShaderNodeSeparateColor") && (a = gf(a, e.data.mode));
8116
+ let o = e.data.bl_idname === "ShaderNodeFloatCurve" ? mf(e) : void 0, s = e.data.bl_idname === "ShaderNodeValToRGB" ? hf(e) : void 0, c = Sf(e);
8028
8117
  return {
8029
8118
  id: String(e.id),
8030
8119
  type: e.data.bl_idname,
8031
- label: e.data.label || hf(e.data.name),
8120
+ label: Cf(e),
8032
8121
  position: {
8033
- x: n[0],
8034
- y: -n[1]
8122
+ x: r[0],
8123
+ y: -r[1]
8035
8124
  },
8036
8125
  width: e.data.width ?? 140,
8037
8126
  headerColor: cf(e.data.bl_idname, e.data.data_type),
8038
- inputs: i,
8039
- outputs: r,
8040
- floatCurve: a,
8041
- colorRamp: o,
8042
- ...s ? { properties: s } : {},
8127
+ inputs: a,
8128
+ outputs: i,
8129
+ floatCurve: o,
8130
+ colorRamp: s,
8131
+ ...c ? { properties: c } : {},
8043
8132
  ...e.data.node_tree == null ? {} : { groupTreeId: String(e.data.node_tree) },
8044
- ...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) }
8133
+ ...e.data.parent == null ? {} : { parentFrameId: String(e.data.parent) },
8134
+ ...e.data.paired_output && n.has(e.data.paired_output) ? { pairedOutputId: n.get(e.data.paired_output) } : {}
8045
8135
  };
8046
8136
  }),
8047
8137
  links: e.data.links.data.items.map((e, t) => {
@@ -8054,12 +8144,12 @@ function bf(e, t) {
8054
8144
  })
8055
8145
  };
8056
8146
  }
8057
- function xf(e) {
8147
+ function Tf(e) {
8058
8148
  if (!e || typeof e != "object") throw Error("JSON root must be an object.");
8059
8149
  if (!Array.isArray(e.node_trees) || e.node_trees.length === 0) throw Error("Expected \"node_trees\" array with at least one entry.");
8060
8150
  let t = {};
8061
8151
  for (let n = 0; n < e.node_trees.length; n++) {
8062
- let r = bf(e.node_trees[n], n);
8152
+ let r = wf(e.node_trees[n], n);
8063
8153
  t[r.id] = r;
8064
8154
  }
8065
8155
  let n = /* @__PURE__ */ new Set();
@@ -8078,21 +8168,21 @@ function xf(e) {
8078
8168
  trees: t
8079
8169
  };
8080
8170
  }
8081
- function Sf(e, t) {
8171
+ function Ef(e, t) {
8082
8172
  return {
8083
8173
  ...t,
8084
8174
  nodeId: e,
8085
8175
  direction: "input"
8086
8176
  };
8087
8177
  }
8088
- function Cf(e, t) {
8178
+ function Df(e, t) {
8089
8179
  return {
8090
8180
  ...t,
8091
8181
  nodeId: e,
8092
8182
  direction: "output"
8093
8183
  };
8094
8184
  }
8095
- function wf(e) {
8185
+ function Of(e) {
8096
8186
  let t = e.nodes.map((e) => ({
8097
8187
  id: e.id,
8098
8188
  type: e.type,
@@ -8100,14 +8190,15 @@ function wf(e) {
8100
8190
  position: e.position,
8101
8191
  width: e.width,
8102
8192
  headerColor: e.headerColor,
8103
- inputs: e.inputs.map((t) => Sf(e.id, t)),
8104
- outputs: e.outputs.map((t) => Cf(e.id, t)),
8193
+ inputs: e.inputs.map((t) => Ef(e.id, t)),
8194
+ outputs: e.outputs.map((t) => Df(e.id, t)),
8105
8195
  floatCurve: e.floatCurve,
8106
8196
  colorRamp: e.colorRamp,
8107
8197
  properties: e.properties,
8108
8198
  groupTreeId: e.groupTreeId,
8109
8199
  groupTreeName: e.groupTreeName,
8110
- parentFrameId: e.parentFrameId
8200
+ parentFrameId: e.parentFrameId,
8201
+ pairedOutputId: e.pairedOutputId
8111
8202
  })), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
8112
8203
  for (let e of t) for (let t of [...e.inputs, ...e.outputs]) n.set(t.id, e.id), r.set(t.id, t);
8113
8204
  let i = /* @__PURE__ */ new Map();
@@ -8146,20 +8237,20 @@ function wf(e) {
8146
8237
  }
8147
8238
  //#endregion
8148
8239
  //#region src/gn/xyflow/mapGraphIRToFlow.ts
8149
- function Tf(e) {
8240
+ function kf(e) {
8150
8241
  let t = Math.max(e.inputs.length, e.outputs.length);
8151
8242
  return Math.max(60, 32 + t * 18 + 16);
8152
8243
  }
8153
- function Ef(e) {
8244
+ function Af(e) {
8154
8245
  return e.type === "NodeReroute" ? {
8155
8246
  w: 12,
8156
8247
  h: 12
8157
8248
  } : {
8158
8249
  w: e.width,
8159
- h: Tf(e)
8250
+ h: kf(e)
8160
8251
  };
8161
8252
  }
8162
- function Df(e) {
8253
+ function jf(e) {
8163
8254
  let t = e.nodes.filter((e) => e.type === "NodeFrame");
8164
8255
  if (t.length === 0) return [];
8165
8256
  let n = /* @__PURE__ */ new Map();
@@ -8174,7 +8265,7 @@ function Df(e) {
8174
8265
  if (t.length === 0) continue;
8175
8266
  let i = Infinity, a = Infinity, o = -Infinity, s = -Infinity;
8176
8267
  for (let e of t) {
8177
- let { w: t, h: n } = Ef(e);
8268
+ let { w: t, h: n } = Af(e);
8178
8269
  i = Math.min(i, e.position.x), a = Math.min(a, e.position.y), o = Math.max(o, e.position.x + t), s = Math.max(s, e.position.y + n);
8179
8270
  }
8180
8271
  Number.isFinite(i) && r.push({
@@ -8197,7 +8288,65 @@ function Df(e) {
8197
8288
  }
8198
8289
  return r;
8199
8290
  }
8200
- function Of(e, t, n) {
8291
+ var Mf = [
8292
+ {
8293
+ input: "GeometryNodeSimulationInput",
8294
+ output: "GeometryNodeSimulationOutput",
8295
+ kind: "simulation"
8296
+ },
8297
+ {
8298
+ input: "GeometryNodeRepeatInput",
8299
+ output: "GeometryNodeRepeatOutput",
8300
+ kind: "repeat"
8301
+ },
8302
+ {
8303
+ input: "GeometryNodeForeachGeometryElementInput",
8304
+ output: "GeometryNodeForeachGeometryElementOutput",
8305
+ kind: "foreach"
8306
+ },
8307
+ {
8308
+ input: "NodeClosureInput",
8309
+ output: "NodeClosureOutput",
8310
+ kind: "closure"
8311
+ }
8312
+ ];
8313
+ function Nf(e) {
8314
+ let t = new Map(e.nodes.map((e) => [e.id, e])), n = [];
8315
+ for (let r of Mf) {
8316
+ let i = e.nodes.filter((e) => e.type === r.input), a = e.nodes.filter((e) => e.type === r.output);
8317
+ for (let o of i) {
8318
+ let i = (o.pairedOutputId === void 0 ? void 0 : t.get(o.pairedOutputId)) ?? (a.length === 1 ? a[0] : void 0);
8319
+ if (!i || i.type !== r.output) continue;
8320
+ let s = Ff(o.id, i.id, e);
8321
+ if (s.size === 0) continue;
8322
+ let c = Infinity, l = -Infinity;
8323
+ for (let e of s) {
8324
+ let n = t.get(e);
8325
+ n && (c = Math.min(c, n.position.y), l = Math.max(l, n.position.y + Af(n).h));
8326
+ }
8327
+ let u = o.position.x + o.width / 2, d = i.position.x + i.width / 2, f = Math.min(u, d), p = Math.max(u, d);
8328
+ !Number.isFinite(c) || !Number.isFinite(l) || !Number.isFinite(f) || !Number.isFinite(p) || n.push({
8329
+ id: `zone:${r.kind}:${o.id}`,
8330
+ type: "simulationZone",
8331
+ position: {
8332
+ x: f,
8333
+ y: c - 26
8334
+ },
8335
+ draggable: !1,
8336
+ selectable: !1,
8337
+ connectable: !1,
8338
+ data: { kind: r.kind },
8339
+ style: {
8340
+ width: p - f,
8341
+ height: l - c + 52,
8342
+ zIndex: -10
8343
+ }
8344
+ });
8345
+ }
8346
+ }
8347
+ return n;
8348
+ }
8349
+ function Pf(e, t, n) {
8201
8350
  if (e.type === "NodeReroute") {
8202
8351
  let t = e.outputs[0]?.color ?? e.inputs[0]?.color ?? "#888888";
8203
8352
  return {
@@ -8239,7 +8388,7 @@ function Of(e, t, n) {
8239
8388
  }
8240
8389
  };
8241
8390
  }
8242
- function kf(e, t, n) {
8391
+ function Ff(e, t, n) {
8243
8392
  let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
8244
8393
  for (let e of n.nodes) r.set(e.id, []), i.set(e.id, []);
8245
8394
  for (let e of n.edges) r.has(e.sourceNodeId) || r.set(e.sourceNodeId, []), i.has(e.targetNodeId) || i.set(e.targetNodeId, []), r.get(e.sourceNodeId).push(e.targetNodeId), i.get(e.targetNodeId).push(e.sourceNodeId);
@@ -8263,41 +8412,10 @@ function kf(e, t, n) {
8263
8412
  for (let e of a) s.has(e) && l.add(e);
8264
8413
  return l;
8265
8414
  }
8266
- function Af(e) {
8267
- let t = new Set(e.edges.map((e) => e.targetSocketId)), n = new Set(e.edges.map((e) => e.sourceSocketId)), r = Df(e), i = e.nodes.filter((e) => e.type !== "NodeFrame").map((e) => Of(e, t, n)), a = e.nodes.find((e) => e.type === "GeometryNodeSimulationInput"), o = e.nodes.find((e) => e.type === "GeometryNodeSimulationOutput"), s = i;
8268
- if (a && o) {
8269
- let t = kf(a.id, o.id, e);
8270
- if (t.size > 0) {
8271
- let n = new Map(e.nodes.map((e) => [e.id, e])), r = Infinity, c = -Infinity;
8272
- for (let e of t) {
8273
- let t = n.get(e);
8274
- t && (r = Math.min(r, t.position.y), c = Math.max(c, t.position.y + Tf(t)));
8275
- }
8276
- let l = a.position.x + a.width / 2, u = o.position.x + o.width / 2, d = Math.min(l, u), f = Math.max(l, u);
8277
- if (Number.isFinite(r) && Number.isFinite(c) && Number.isFinite(d) && Number.isFinite(f)) {
8278
- let e = d, t = r - 26, n = f - d, o = c - r + 52;
8279
- s = [{
8280
- id: `zone:simulation:${a.id}`,
8281
- type: "simulationZone",
8282
- position: {
8283
- x: e,
8284
- y: t
8285
- },
8286
- draggable: !1,
8287
- selectable: !1,
8288
- connectable: !1,
8289
- data: {},
8290
- style: {
8291
- width: n,
8292
- height: o,
8293
- zIndex: -10
8294
- }
8295
- }, ...i];
8296
- }
8297
- }
8298
- }
8415
+ function If(e) {
8416
+ let t = new Set(e.edges.map((e) => e.targetSocketId)), n = new Set(e.edges.map((e) => e.sourceSocketId)), r = jf(e), i = e.nodes.filter((e) => e.type !== "NodeFrame").map((e) => Pf(e, t, n)), a = [...Nf(e), ...i];
8299
8417
  return {
8300
- nodes: [...r, ...s],
8418
+ nodes: [...r, ...a],
8301
8419
  edges: e.edges.map((e) => ({
8302
8420
  id: e.id,
8303
8421
  source: e.sourceNodeId,
@@ -8311,10 +8429,10 @@ function Af(e) {
8311
8429
  }
8312
8430
  //#endregion
8313
8431
  //#region src/gn/ir/curvePath.ts
8314
- function jf(e, t) {
8432
+ function Lf(e, t) {
8315
8433
  return Math.sqrt(e * e + t * t);
8316
8434
  }
8317
- function Mf(e) {
8435
+ function Rf(e) {
8318
8436
  let t = e.length, n = e.map(({ location: [n, r], handleType: i }, a) => {
8319
8437
  let o = a > 0 ? e[a - 1].location : null, s = a < t - 1 ? e[a + 1].location : null;
8320
8438
  if (i === "VECTOR") return {
@@ -8324,11 +8442,11 @@ function Mf(e) {
8324
8442
  let c = 0, l = 0, u = 0, d = 0;
8325
8443
  if (o && s) {
8326
8444
  let e = n - o[0], t = r - o[1], i = s[0] - n, a = s[1] - r;
8327
- if (u = jf(e, t), d = jf(i, a), u > 1e-8 && d > 1e-8) {
8328
- let n = e / u + i / d, r = t / u + a / d, o = jf(n, r);
8445
+ if (u = Lf(e, t), d = Lf(i, a), u > 1e-8 && d > 1e-8) {
8446
+ let n = e / u + i / d, r = t / u + a / d, o = Lf(n, r);
8329
8447
  o > 1e-8 && (c = n / o, l = r / o);
8330
8448
  } else d > 1e-8 ? (c = (s[0] - n) / d, l = (s[1] - r) / d) : u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u);
8331
- } else s ? (d = jf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = jf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
8449
+ } else s ? (d = Lf(s[0] - n, s[1] - r), d > 1e-8 && (c = (s[0] - n) / d, l = (s[1] - r) / d)) : o && (u = Lf(n - o[0], r - o[1]), u > 1e-8 && (c = (n - o[0]) / u, l = (r - o[1]) / u));
8332
8450
  let f = [n - c * u / 3, r - l * u / 3], p = [n + c * d / 3, r + l * d / 3];
8333
8451
  if (i === "AUTO_CLAMPED") {
8334
8452
  if (o) {
@@ -8373,7 +8491,7 @@ function Mf(e) {
8373
8491
  }
8374
8492
  return n;
8375
8493
  }
8376
- function Nf(e, t, n, r, i, a, o) {
8494
+ function zf(e, t, n, r, i, a, o) {
8377
8495
  let s = r - t || 1, c = i - n || 1, l = (e) => (e - t) / s * a, u = (e) => (1 - (e - n) / c) * o;
8378
8496
  if (e.length < 2) return {
8379
8497
  strokePath: "",
@@ -8381,7 +8499,7 @@ function Nf(e, t, n, r, i, a, o) {
8381
8499
  zeroLinePath: "",
8382
8500
  dotPositions: []
8383
8501
  };
8384
- let d = Mf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8502
+ let d = Rf(e), [f, p] = e[0].location, m = `M ${l(f).toFixed(2)} ${u(p).toFixed(2)}`;
8385
8503
  for (let t = 0; t < e.length - 1; t++) {
8386
8504
  let n = d[t].right, r = d[t + 1].left, [i, a] = e[t + 1].location;
8387
8505
  m += ` C ${l(n[0]).toFixed(2)} ${u(n[1]).toFixed(2)},`, m += ` ${l(r[0]).toFixed(2)} ${u(r[1]).toFixed(2)},`, m += ` ${l(i).toFixed(2)} ${u(a).toFixed(2)}`;
@@ -8396,7 +8514,7 @@ function Nf(e, t, n, r, i, a, o) {
8396
8514
  }
8397
8515
  //#endregion
8398
8516
  //#region src/gn/components/ColorRampViz.tsx
8399
- function Pf([e, t, n]) {
8517
+ function Bf([e, t, n]) {
8400
8518
  let r = Math.max(e, t, n), i = r - Math.min(e, t, n), a = 0;
8401
8519
  i !== 0 && (a = r === e ? (t - n) / i % 6 : r === t ? (n - e) / i + 2 : (e - t) / i + 4, a /= 6, a < 0 && (a += 1));
8402
8520
  let o = r === 0 ? 0 : i / r;
@@ -8406,7 +8524,7 @@ function Pf([e, t, n]) {
8406
8524
  r
8407
8525
  ];
8408
8526
  }
8409
- function Ff([e, t, n]) {
8527
+ function Vf([e, t, n]) {
8410
8528
  if (t === 0) return [
8411
8529
  n,
8412
8530
  n,
@@ -8446,7 +8564,7 @@ function Ff([e, t, n]) {
8446
8564
  ];
8447
8565
  }
8448
8566
  }
8449
- function If([e, t, n]) {
8567
+ function Hf([e, t, n]) {
8450
8568
  let r = Math.max(e, t, n), i = Math.min(e, t, n), a = (r + i) / 2, o = r - i, s = 0, c = 0;
8451
8569
  return o !== 0 && (c = a > .5 ? o / (2 - r - i) : o / (r + i), s = r === e ? (t - n) / o % 6 : r === t ? (n - e) / o + 2 : (e - t) / o + 4, s /= 6, s < 0 && (s += 1)), [
8452
8570
  s,
@@ -8454,7 +8572,7 @@ function If([e, t, n]) {
8454
8572
  a
8455
8573
  ];
8456
8574
  }
8457
- function Lf([e, t, n]) {
8575
+ function Uf([e, t, n]) {
8458
8576
  if (t === 0) return [
8459
8577
  n,
8460
8578
  n,
@@ -8467,9 +8585,9 @@ function Lf([e, t, n]) {
8467
8585
  a(e - 1 / 3)
8468
8586
  ];
8469
8587
  }
8470
- var Rf = (e) => e < 1 ? e : e - 1;
8471
- function zf(e, t, n, r, i) {
8472
- let a = Rf((r % 1 + 1) % 1), o = Rf((i % 1 + 1) % 1), s = 0;
8588
+ var Wf = (e) => e < 1 ? e : e - 1;
8589
+ function Gf(e, t, n, r, i) {
8590
+ let a = Wf((r % 1 + 1) % 1), o = Wf((i % 1 + 1) % 1), s = 0;
8473
8591
  switch (e) {
8474
8592
  case "NEAR":
8475
8593
  a < o && o - a > .5 ? s = 1 : a > o && o - a < -.5 && (s = 2);
@@ -8485,9 +8603,9 @@ function zf(e, t, n, r, i) {
8485
8603
  break;
8486
8604
  }
8487
8605
  let c = (e, r) => t * e + n * r;
8488
- return s === 1 ? Rf(c(a + 1, o)) : s === 2 ? Rf(c(a, o + 1)) : c(a, o);
8606
+ return s === 1 ? Wf(c(a + 1, o)) : s === 2 ? Wf(c(a, o + 1)) : c(a, o);
8489
8607
  }
8490
- function Bf(e, t) {
8608
+ function Kf(e, t) {
8491
8609
  let n = [...e.stops].sort((e, t) => e.position - t.position);
8492
8610
  if (n.length === 0) return [
8493
8611
  0,
@@ -8507,7 +8625,7 @@ function Bf(e, t) {
8507
8625
  r === "EASE" && (c = 3 * c * c - 2 * c * c * c);
8508
8626
  let l = c, u = 1 - c, d = u * a.color[3] + l * o.color[3];
8509
8627
  if (e.colorMode === "HSV" || e.colorMode === "HSL") {
8510
- let t = e.colorMode === "HSV" ? Pf : If, n = e.colorMode === "HSV" ? Ff : Lf, r = t([
8628
+ let t = e.colorMode === "HSV" ? Bf : Hf, n = e.colorMode === "HSV" ? Vf : Uf, r = t([
8511
8629
  a.color[0],
8512
8630
  a.color[1],
8513
8631
  a.color[2]
@@ -8516,7 +8634,7 @@ function Bf(e, t) {
8516
8634
  o.color[1],
8517
8635
  o.color[2]
8518
8636
  ]), [s, c, f] = n([
8519
- zf(e.hueInterpolation, l, u, i[0], r[0]),
8637
+ Gf(e.hueInterpolation, l, u, i[0], r[0]),
8520
8638
  u * r[1] + l * i[1],
8521
8639
  u * r[2] + l * i[2]
8522
8640
  ]);
@@ -8534,25 +8652,25 @@ function Bf(e, t) {
8534
8652
  d
8535
8653
  ];
8536
8654
  }
8537
- function Vf(e) {
8655
+ function qf(e) {
8538
8656
  let t = Math.min(1, Math.max(0, e));
8539
8657
  return t <= .0031308 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - .055;
8540
8658
  }
8541
- function Hf([e, t, n, r]) {
8542
- let i = (e) => Math.round(Vf(e) * 255);
8659
+ function Jf([e, t, n, r]) {
8660
+ let i = (e) => Math.round(qf(e) * 255);
8543
8661
  return `rgba(${i(e)}, ${i(t)}, ${i(n)}, ${r.toFixed(3)})`;
8544
8662
  }
8545
- var Uf = {
8663
+ var Yf = {
8546
8664
  NEAR: "Near",
8547
8665
  FAR: "Far",
8548
8666
  CW: "CW",
8549
8667
  CCW: "CCW"
8550
- }, Wf = 64;
8551
- function Gf({ data: e, width: t }) {
8668
+ }, Xf = 64;
8669
+ function Zf({ data: e, width: t }) {
8552
8670
  let n = [];
8553
- for (let t = 0; t <= Wf; t++) {
8554
- let r = t / Wf;
8555
- n.push(`${Hf(Bf(e, r))} ${(r * 100).toFixed(1)}%`);
8671
+ for (let t = 0; t <= Xf; t++) {
8672
+ let r = t / Xf;
8673
+ n.push(`${Jf(Kf(e, r))} ${(r * 100).toFixed(1)}%`);
8556
8674
  }
8557
8675
  let r = `linear-gradient(to right, ${n.join(", ")})`, i = [...e.stops].sort((e, t) => e.position - t.position), a = i[i.length - 1];
8558
8676
  return /* @__PURE__ */ _("div", {
@@ -8566,7 +8684,7 @@ function Gf({ data: e, width: t }) {
8566
8684
  children: e.colorMode
8567
8685
  }), /* @__PURE__ */ g("span", {
8568
8686
  className: "gn-color-ramp__select",
8569
- children: Uf[e.hueInterpolation] ?? e.hueInterpolation
8687
+ children: Yf[e.hueInterpolation] ?? e.hueInterpolation
8570
8688
  })]
8571
8689
  }),
8572
8690
  /* @__PURE__ */ _("div", {
@@ -8586,7 +8704,7 @@ function Gf({ data: e, width: t }) {
8586
8704
  children: ["Pos ", a.position.toFixed(3)]
8587
8705
  }), /* @__PURE__ */ g("span", {
8588
8706
  className: "gn-color-ramp__swatch",
8589
- style: { background: Hf(a.color) }
8707
+ style: { background: Jf(a.color) }
8590
8708
  })]
8591
8709
  })
8592
8710
  ]
@@ -8594,18 +8712,18 @@ function Gf({ data: e, width: t }) {
8594
8712
  }
8595
8713
  //#endregion
8596
8714
  //#region src/gn/components/groupNavContext.ts
8597
- var Kf = t(null);
8598
- function qf() {
8599
- return o(Kf);
8715
+ var Qf = t(null);
8716
+ function $f() {
8717
+ return o(Qf);
8600
8718
  }
8601
8719
  //#endregion
8602
8720
  //#region src/gn/components/GenericGNNode.tsx
8603
- var Jf = [
8721
+ var ep = [
8604
8722
  "X",
8605
8723
  "Y",
8606
8724
  "Z",
8607
8725
  "W"
8608
- ], Yf = {
8726
+ ], tp = {
8609
8727
  FLOAT: "Float",
8610
8728
  INT: "Integer",
8611
8729
  VECTOR: "Vector",
@@ -8613,56 +8731,11 @@ var Jf = [
8613
8731
  STRING: "String",
8614
8732
  BOOLEAN: "Boolean",
8615
8733
  ROTATION: "Rotation"
8616
- }, Xf = {
8617
- EQUAL: "Equal",
8618
- NOT_EQUAL: "Not Equal",
8619
- LESS_THAN: "Less Than",
8620
- LESS_EQUAL: "Less Than or Equal",
8621
- GREATER_THAN: "Greater Than",
8622
- GREATER_EQUAL: "Greater Than or Equal",
8623
- ADD: "Add",
8624
- SUBTRACT: "Subtract",
8625
- MULTIPLY: "Multiply",
8626
- DIVIDE: "Divide",
8627
- MULTIPLY_ADD: "Multiply Add",
8628
- POWER: "Power",
8629
- LOGARITHM: "Logarithm",
8630
- SQRT: "Square Root",
8631
- INVERSE_SQRT: "Inverse Square Root",
8632
- ABSOLUTE: "Absolute",
8633
- EXPONENT: "Exponent",
8634
- MINIMUM: "Minimum",
8635
- MAXIMUM: "Maximum",
8636
- SIGN: "Sign",
8637
- COMPARE: "Compare",
8638
- SMOOTH_MIN: "Smooth Minimum",
8639
- SMOOTH_MAX: "Smooth Maximum",
8640
- ROUND: "Round",
8641
- FLOOR: "Floor",
8642
- CEIL: "Ceiling",
8643
- TRUNCATE: "Truncate",
8644
- FRACTION: "Fraction",
8645
- MODULO: "Modulo",
8646
- WRAP: "Wrap",
8647
- SNAP: "Snap",
8648
- PINGPONG: "Ping-Pong",
8649
- SINE: "Sine",
8650
- COSINE: "Cosine",
8651
- TANGENT: "Tangent",
8652
- ARCSINE: "Arcsine",
8653
- ARCCOSINE: "Arccosine",
8654
- ARCTANGENT: "Arctangent",
8655
- ARCTAN2: "Arctan2",
8656
- SINH: "Hyperbolic Sine",
8657
- COSH: "Hyperbolic Cosine",
8658
- TANH: "Hyperbolic Tangent",
8659
- RADIANS: "To Radians",
8660
- DEGREES: "To Degrees"
8661
8734
  };
8662
- function Zf(e, t) {
8663
- return e === "data_type" ? Yf[t] ?? t : e === "operation" ? Xf[t] ?? t : e === "use_clamp" ? "Clamp" : t;
8735
+ function np(e, t) {
8736
+ return e === "data_type" ? tp[t] ?? t : e === "operation" ? uf(t) : e === "use_clamp" ? "Clamp" : t;
8664
8737
  }
8665
- function Qf(e) {
8738
+ function rp(e) {
8666
8739
  switch (e) {
8667
8740
  case "LINE": return "gn-socket--line";
8668
8741
  case "DIAMOND": return "gn-socket--diamond";
@@ -8671,55 +8744,55 @@ function Qf(e) {
8671
8744
  default: return "gn-socket--circle";
8672
8745
  }
8673
8746
  }
8674
- function $f(e) {
8747
+ function ip(e) {
8675
8748
  return e === "ROTATION" ? "°" : e === "FLOAT" ? " m" : "";
8676
8749
  }
8677
- function ep(e) {
8750
+ function ap(e) {
8678
8751
  return parseFloat(e.toFixed(3)).toString();
8679
8752
  }
8680
- function tp(e, t) {
8681
- return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${ep(e)}${$f(t)}`;
8753
+ function op(e, t) {
8754
+ return typeof e == "boolean" ? e ? "True" : "False" : typeof e == "string" ? e : `${ap(e)}${ip(t)}`;
8682
8755
  }
8683
- function np(e) {
8756
+ function sp(e) {
8684
8757
  return Math.round(Math.min(1, Math.max(0, e)) * 255);
8685
8758
  }
8686
- function rp(e) {
8759
+ function cp(e) {
8687
8760
  let [t, n, r, i = 1] = e.values;
8688
8761
  return /* @__PURE__ */ g("div", {
8689
8762
  className: "gn-node__color-swatch",
8690
- style: { background: `rgba(${np(t)},${np(n)},${np(r)},${i.toFixed(2)})` }
8763
+ style: { background: `rgba(${sp(t)},${sp(n)},${sp(r)},${i.toFixed(2)})` }
8691
8764
  });
8692
8765
  }
8693
- function ip(e) {
8694
- if (e.dataType === "RGBA") return /* @__PURE__ */ g(rp, { values: e.values });
8695
- let t = $f(e.dataType);
8766
+ function lp(e) {
8767
+ if (e.dataType === "RGBA") return /* @__PURE__ */ g(cp, { values: e.values });
8768
+ let t = ip(e.dataType);
8696
8769
  return /* @__PURE__ */ g("div", {
8697
8770
  className: "gn-node__vec-block",
8698
8771
  children: e.values.slice(0, 4).map((e, n) => /* @__PURE__ */ _("div", {
8699
8772
  className: "gn-node__vec-row",
8700
8773
  children: [/* @__PURE__ */ g("span", {
8701
8774
  className: "gn-node__vec-label",
8702
- children: Jf[n]
8775
+ children: ep[n]
8703
8776
  }), /* @__PURE__ */ _("span", {
8704
8777
  className: "gn-node__vec-value",
8705
- children: [ep(e), t]
8778
+ children: [ap(e), t]
8706
8779
  })]
8707
8780
  }, n))
8708
8781
  });
8709
8782
  }
8710
- function ap({ properties: e }) {
8783
+ function up({ properties: e }) {
8711
8784
  let t = Object.entries(e);
8712
8785
  return t.length === 0 ? null : /* @__PURE__ */ g("div", {
8713
8786
  className: "gn-node__props",
8714
8787
  children: t.map(([e, t]) => /* @__PURE__ */ g("div", {
8715
8788
  className: "gn-node__prop-row",
8716
- children: Zf(e, t)
8789
+ children: np(e, t)
8717
8790
  }, e))
8718
8791
  });
8719
8792
  }
8720
- var op = 120, sp = 6;
8721
- function cp({ curve: e, width: t }) {
8722
- let n = Math.max(10, t - sp * 2), r = op, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = Nf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
8793
+ var dp = 120, fp = 6;
8794
+ function pp({ curve: e, width: t }) {
8795
+ let n = Math.max(10, t - fp * 2), r = dp, { strokePath: i, fillPath: a, zeroLinePath: o, dotPositions: s } = zf(e.points, e.clipMinX, e.clipMinY, e.clipMaxX, e.clipMaxY, n, r);
8723
8796
  return /* @__PURE__ */ g("div", {
8724
8797
  className: "gn-node__curve-wrap",
8725
8798
  children: /* @__PURE__ */ _("svg", {
@@ -8750,7 +8823,7 @@ function cp({ curve: e, width: t }) {
8750
8823
  })
8751
8824
  });
8752
8825
  }
8753
- function lp(e) {
8826
+ function mp(e) {
8754
8827
  let { socket: t, position: n, type: r, align: i, suppressDefault: a } = e, o = t.name.trim().length === 0, s = !a && !t.hideValue && t.defaultValue?.kind === "scalar";
8755
8828
  return /* @__PURE__ */ _("div", {
8756
8829
  className: `gn-node__socket-row gn-node__socket-row--${i}`,
@@ -8759,7 +8832,7 @@ function lp(e) {
8759
8832
  id: t.id,
8760
8833
  type: r,
8761
8834
  position: n,
8762
- className: `gn-socket ${Qf(t.displayShape)}`,
8835
+ className: `gn-socket ${rp(t.displayShape)}`,
8763
8836
  style: {
8764
8837
  top: "50%",
8765
8838
  background: t.color,
@@ -8772,15 +8845,15 @@ function lp(e) {
8772
8845
  }),
8773
8846
  s && t.defaultValue?.kind === "scalar" ? /* @__PURE__ */ g("span", {
8774
8847
  className: "gn-node__value",
8775
- children: tp(t.defaultValue.value, t.dataType)
8848
+ children: op(t.defaultValue.value, t.dataType)
8776
8849
  }) : null
8777
8850
  ]
8778
8851
  });
8779
8852
  }
8780
- function up(e, t) {
8853
+ function hp(e, t) {
8781
8854
  return !t && !e.hideValue && e.defaultValue?.kind === "vec";
8782
8855
  }
8783
- function dp() {
8856
+ function gp() {
8784
8857
  return /* @__PURE__ */ _("div", {
8785
8858
  className: "gn-node__stack",
8786
8859
  "aria-hidden": "true",
@@ -8791,8 +8864,8 @@ function dp() {
8791
8864
  ]
8792
8865
  });
8793
8866
  }
8794
- function fp(e) {
8795
- let t = e.data, n = qf(), r = new Set(t.connectedInputIds ?? []), i = t.outputs.filter((e) => e.enabled), a = t.inputs.filter((e) => e.enabled), o = t.groupTreeId, s = o !== void 0 && t.groupTreeName !== void 0 && !!n;
8867
+ function _p(e) {
8868
+ let t = e.data, n = $f(), r = new Set(t.connectedInputIds ?? []), i = t.outputs.filter((e) => e.enabled), a = t.inputs.filter((e) => e.enabled), o = t.groupTreeId, s = o !== void 0 && t.groupTreeName !== void 0 && !!n;
8796
8869
  return /* @__PURE__ */ _("div", {
8797
8870
  className: `gn-node${s ? " gn-node--group nodrag" : ""}`,
8798
8871
  onClick: s ? () => n.openGroup(o) : void 0,
@@ -8807,35 +8880,35 @@ function fp(e) {
8807
8880
  children: t.label
8808
8881
  })
8809
8882
  }),
8810
- s && /* @__PURE__ */ g(dp, {}),
8811
- t.properties && /* @__PURE__ */ g(ap, { properties: t.properties }),
8812
- t.floatCurve && /* @__PURE__ */ g(cp, {
8883
+ s && /* @__PURE__ */ g(gp, {}),
8884
+ t.properties && /* @__PURE__ */ g(up, { properties: t.properties }),
8885
+ t.floatCurve && /* @__PURE__ */ g(pp, {
8813
8886
  curve: t.floatCurve,
8814
8887
  width: t.width
8815
8888
  }),
8816
8889
  /* @__PURE__ */ _("div", {
8817
8890
  className: "gn-node__body",
8818
8891
  children: [
8819
- i.map((e) => /* @__PURE__ */ g(lp, {
8892
+ i.map((e) => /* @__PURE__ */ g(mp, {
8820
8893
  socket: e,
8821
8894
  position: Y.Right,
8822
8895
  type: "source",
8823
8896
  align: "right",
8824
8897
  suppressDefault: !0
8825
8898
  }, e.id)),
8826
- t.colorRamp && /* @__PURE__ */ g(Gf, {
8899
+ t.colorRamp && /* @__PURE__ */ g(Zf, {
8827
8900
  data: t.colorRamp,
8828
8901
  width: t.width
8829
8902
  }),
8830
8903
  a.map((e) => {
8831
8904
  let t = r.has(e.id);
8832
- return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(lp, {
8905
+ return /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g(mp, {
8833
8906
  socket: e,
8834
8907
  position: Y.Left,
8835
8908
  type: "target",
8836
8909
  align: "left",
8837
8910
  suppressDefault: t
8838
- }), up(e, t) ? /* @__PURE__ */ g(ip, {
8911
+ }), hp(e, t) ? /* @__PURE__ */ g(lp, {
8839
8912
  values: e.defaultValue.values,
8840
8913
  dataType: e.dataType
8841
8914
  }) : null] }, e.id);
@@ -8847,7 +8920,7 @@ function fp(e) {
8847
8920
  }
8848
8921
  //#endregion
8849
8922
  //#region src/gn/components/RerouteNode.tsx
8850
- function pp(e) {
8923
+ function vp(e) {
8851
8924
  let t = e.data;
8852
8925
  return /* @__PURE__ */ _("div", {
8853
8926
  className: "gn-reroute",
@@ -8867,22 +8940,29 @@ function pp(e) {
8867
8940
  }
8868
8941
  //#endregion
8869
8942
  //#region src/gn/components/SimulationZoneFrame.tsx
8870
- function mp() {
8943
+ var yp = {
8944
+ simulation: "102, 65, 98",
8945
+ repeat: "118, 81, 47",
8946
+ foreach: "51, 82, 127",
8947
+ closure: "125, 125, 58"
8948
+ };
8949
+ function bp(e) {
8950
+ let t = yp[e.data.kind ?? "simulation"] ?? yp.simulation;
8871
8951
  return /* @__PURE__ */ g("div", {
8872
8952
  className: "gn-sim-zone",
8873
8953
  style: {
8874
8954
  width: "100%",
8875
8955
  height: "100%",
8876
8956
  borderRadius: 10,
8877
- border: "1.5px solid rgba(102, 65, 98, 0.85)",
8878
- background: "rgba(102, 65, 98, 0.2)",
8957
+ border: `1.5px solid rgba(${t}, 0.85)`,
8958
+ background: `rgba(${t}, 0.2)`,
8879
8959
  pointerEvents: "none"
8880
8960
  }
8881
8961
  });
8882
8962
  }
8883
8963
  //#endregion
8884
8964
  //#region src/gn/components/NodeFrame.tsx
8885
- function hp(e) {
8965
+ function xp(e) {
8886
8966
  let t = e.data;
8887
8967
  return /* @__PURE__ */ g("div", {
8888
8968
  className: "gn-node-frame",
@@ -8912,13 +8992,13 @@ function hp(e) {
8912
8992
  }
8913
8993
  //#endregion
8914
8994
  //#region src/gn/components/GeometryNodesFlow.tsx
8915
- var gp = {
8916
- gnNode: fp,
8917
- rerouteNode: pp,
8918
- simulationZone: mp,
8919
- nodeFrame: hp
8920
- }, _p = { padding: .08 };
8921
- function vp(e) {
8995
+ var Sp = {
8996
+ gnNode: _p,
8997
+ rerouteNode: vp,
8998
+ simulationZone: bp,
8999
+ nodeFrame: xp
9000
+ }, Cp = { padding: .08 };
9001
+ function wp(e) {
8922
9002
  let { nodes: t, edges: n, jsonText: r, breadcrumbs: i, onNavigate: o, onSelectionIds: s, onCopiedMagicString: l, interaction: u = "always", allowCopy: p = !0, allowSelection: m = !0 } = e, { fitView: h, getNodes: v, getNodesBounds: y } = ml(), b = bd(), x = d(null), S = d(!1), C = d([]), [w, D] = f(null), [O, k] = f(!1), [A, j] = f(!1), M = d(null), [N, P] = f("mouse"), F = d(-Infinity), [I, L] = f(!1), [R, z] = f(!1), B = d([]), [V, H, U] = _d(t), [W, G, ee] = vd(n), [te, ne] = f(void 0);
8923
9003
  c(() => {
8924
9004
  if (!b) return;
@@ -8930,7 +9010,7 @@ function vp(e) {
8930
9010
  v,
8931
9011
  y
8932
9012
  ]), c(() => {
8933
- H(t), s?.([]), S.current = !1, h(_p);
9013
+ H(t), s?.([]), S.current = !1, h(Cp);
8934
9014
  }, [
8935
9015
  t,
8936
9016
  H,
@@ -8942,7 +9022,7 @@ function vp(e) {
8942
9022
  let e = x.current;
8943
9023
  if (!e) return;
8944
9024
  let t = new ResizeObserver(() => {
8945
- S.current || h(_p);
9025
+ S.current || h(Cp);
8946
9026
  });
8947
9027
  return t.observe(e), () => t.disconnect();
8948
9028
  }, [h]);
@@ -9024,9 +9104,9 @@ function vp(e) {
9024
9104
  onEdgesChange: ee,
9025
9105
  onSelectionChange: ie,
9026
9106
  onMoveStart: re,
9027
- nodeTypes: gp,
9107
+ nodeTypes: Sp,
9028
9108
  fitView: !0,
9029
- fitViewOptions: _p,
9109
+ fitViewOptions: Cp,
9030
9110
  minZoom: .2,
9031
9111
  translateExtent: te,
9032
9112
  nodesDraggable: !1,
@@ -9064,7 +9144,7 @@ function vp(e) {
9064
9144
  className: "gn-top-left",
9065
9145
  children: [/* @__PURE__ */ _("span", {
9066
9146
  className: "gn-version-badge",
9067
- children: ["node-web-render v", "0.3.28"]
9147
+ children: ["node-web-render v", "0.3.30"]
9068
9148
  }), i.length > 1 ? /* @__PURE__ */ g("nav", {
9069
9149
  className: "gn-breadcrumbs",
9070
9150
  "aria-label": "Node group path",
@@ -9117,19 +9197,19 @@ function vp(e) {
9117
9197
  ]
9118
9198
  });
9119
9199
  }
9120
- function yp(e) {
9200
+ function Tp(e) {
9121
9201
  let { jsonText: t, showHeader: n = !0, onSelectionChange: r, onCopiedMagicString: i, interaction: o = "always", allowCopy: s = !0, allowSelection: l = !0 } = e, [d, p] = f({
9122
9202
  json: t,
9123
9203
  ids: []
9124
9204
  }), m = u(() => {
9125
9205
  if (!t.trim()) return null;
9126
9206
  try {
9127
- let { rootId: e, trees: n } = xf(JSON.parse(t)), r = {};
9207
+ let { rootId: e, trees: n } = Tf(JSON.parse(t)), r = {};
9128
9208
  for (let e of Object.values(n)) {
9129
- let t = wf(e);
9209
+ let t = Of(e);
9130
9210
  r[t.id] = {
9131
9211
  graph: t,
9132
- flow: Af(t)
9212
+ flow: If(t)
9133
9213
  };
9134
9214
  }
9135
9215
  return {
@@ -9193,9 +9273,9 @@ function yp(e) {
9193
9273
  className: "flow-error",
9194
9274
  role: "alert",
9195
9275
  children: [/* @__PURE__ */ g("strong", { children: "Parse error" }), /* @__PURE__ */ g("span", { children: m.error })]
9196
- }) : v ? /* @__PURE__ */ g(Kf.Provider, {
9276
+ }) : v ? /* @__PURE__ */ g(Qf.Provider, {
9197
9277
  value: b,
9198
- children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(vp, {
9278
+ children: /* @__PURE__ */ g(fd, { children: /* @__PURE__ */ g(wp, {
9199
9279
  nodes: v.flow.nodes,
9200
9280
  edges: v.flow.edges,
9201
9281
  jsonText: t,
@@ -9219,7 +9299,7 @@ function yp(e) {
9219
9299
  }
9220
9300
  //#endregion
9221
9301
  //#region src/components/TreeClipperLogo.tsx
9222
- function bp({ className: e }) {
9302
+ function Ep({ className: e }) {
9223
9303
  return /* @__PURE__ */ _("svg", {
9224
9304
  viewBox: "0 0 256 256",
9225
9305
  className: e,
@@ -9280,7 +9360,7 @@ function bp({ className: e }) {
9280
9360
  }
9281
9361
  //#endregion
9282
9362
  //#region src/embed.tsx
9283
- function xp(e) {
9363
+ function Dp(e) {
9284
9364
  let { payload: t, showCopyButton: n = !0, allowSelection: r = !0 } = e, [i, a] = f(""), [o, s] = f(null), [l, u] = f(!0), [p, m] = f([]), [v, y] = f(!1), [b, S] = f(!1), C = d(!1), w = d(!1), D = d(null), O = d(null), k = d(null), A = () => {
9285
9365
  !w.current || C.current || (S(!0), k.current && clearTimeout(k.current), k.current = setTimeout(() => {
9286
9366
  y(!1), S(!1);
@@ -9324,7 +9404,7 @@ function xp(e) {
9324
9404
  className: "gnwr-loading",
9325
9405
  role: "status",
9326
9406
  "aria-live": "polite",
9327
- children: [/* @__PURE__ */ g(bp, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
9407
+ children: [/* @__PURE__ */ g(Ep, { className: "gnwr-loading__logo" }), /* @__PURE__ */ g("span", {
9328
9408
  className: "gnwr-loading__label",
9329
9409
  children: "Loading graph…"
9330
9410
  })]
@@ -9332,7 +9412,7 @@ function xp(e) {
9332
9412
  className: "flow-error",
9333
9413
  role: "alert",
9334
9414
  children: [/* @__PURE__ */ g("strong", { children: "Decode error" }), /* @__PURE__ */ g("span", { children: o })]
9335
- }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(yp, {
9415
+ }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Tp, {
9336
9416
  jsonText: i,
9337
9417
  showHeader: !1,
9338
9418
  interaction: "hybrid",
@@ -9359,7 +9439,7 @@ function xp(e) {
9359
9439
  strokeLinecap: "round",
9360
9440
  strokeLinejoin: "round"
9361
9441
  })
9362
- }), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(bp, { className: "gnwr-copy-button__logo" }), /* @__PURE__ */ g("span", { children: p.length > 0 ? `Copy Magic String of ${p.length} selected node${p.length === 1 ? "" : "s"}` : "Copy TreeClipper Magic String" })] })
9442
+ }), /* @__PURE__ */ g("span", { children: "Copied!" })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Ep, { className: "gnwr-copy-button__logo" }), /* @__PURE__ */ g("span", { children: p.length > 0 ? `Copy Magic String of ${p.length} selected node${p.length === 1 ? "" : "s"}` : "Copy TreeClipper Magic String" })] })
9363
9443
  }), (v || b) && /* @__PURE__ */ _("div", {
9364
9444
  className: `gnwr-copy-toast${b ? " gnwr-leaving" : ""}`,
9365
9445
  role: "status",
@@ -9382,22 +9462,22 @@ function xp(e) {
9382
9462
  })
9383
9463
  });
9384
9464
  }
9385
- var Sp = /* @__PURE__ */ new Map(), Cp = null;
9386
- function wp(e, t) {
9387
- Sp.get(e)?.unmount();
9465
+ var Op = /* @__PURE__ */ new Map(), kp = null;
9466
+ function Ap(e, t) {
9467
+ Op.get(e)?.unmount();
9388
9468
  let r = m(e);
9389
- Sp.set(e, r), Cp = e;
9469
+ Op.set(e, r), kp = e;
9390
9470
  let i = t.onClose;
9391
- return r.render(n(xp, {
9471
+ return r.render(n(Dp, {
9392
9472
  ...t,
9393
9473
  onClose: i ? () => {
9394
- Tp(e), i();
9474
+ jp(e), i();
9395
9475
  } : void 0
9396
- })), () => Tp(e);
9476
+ })), () => jp(e);
9397
9477
  }
9398
- function Tp(e) {
9399
- let t = e ?? Cp;
9400
- t && (Sp.get(t)?.unmount(), Sp.delete(t), t === Cp && (Cp = null));
9478
+ function jp(e) {
9479
+ let t = e ?? kp;
9480
+ t && (Op.get(t)?.unmount(), Op.delete(t), t === kp && (kp = null));
9401
9481
  }
9402
9482
  //#endregion
9403
- export { xp as GraphView, wp as mountGraphView, Tp as unmountGraphView };
9483
+ export { Dp as GraphView, Ap as mountGraphView, jp as unmountGraphView };
@@ -1 +1,2 @@
1
- export declare function SimulationZoneFrame(): import("react").JSX.Element;
1
+ import { NodeProps } from '@xyflow/react';
2
+ export declare function SimulationZoneFrame(props: NodeProps): import("react").JSX.Element;
@@ -35,6 +35,7 @@ type BlenderNode = {
35
35
  single_output?: number;
36
36
  vector?: number[];
37
37
  node_tree?: number | null;
38
+ paired_output?: string;
38
39
  mode?: string;
39
40
  operation?: string;
40
41
  data_type?: string;
@@ -145,6 +146,8 @@ export type NormalizedNode = {
145
146
  groupTreeName?: string;
146
147
  /** Id of the NodeFrame this node is parented to (Blender "parent"), if any. */
147
148
  parentFrameId?: string;
149
+ /** For zone input nodes (Simulation/Repeat/…): id of the paired output node. */
150
+ pairedOutputId?: string;
148
151
  };
149
152
  export type NormalizedLink = {
150
153
  id: string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Human-readable labels for the `operation` enum shared by the math-style
3
+ * nodes (Math, Integer Math, Vector Math, Boolean Math, Compare). Mirrors
4
+ * the labels Blender shows in the node header / operation dropdown.
5
+ */
6
+ export declare const OPERATION_LABELS: Record<string, string>;
7
+ export declare function operationLabel(operation: string): string;
@@ -67,6 +67,8 @@ export type NodeIR = {
67
67
  groupTreeName?: string;
68
68
  /** Id of the NodeFrame this node is parented to (Blender "parent"), if any. */
69
69
  parentFrameId?: string;
70
+ /** For zone input nodes (Simulation/Repeat/…): id of the paired output node. */
71
+ pairedOutputId?: string;
70
72
  };
71
73
  export type EdgeIR = {
72
74
  id: string;
@@ -19,8 +19,9 @@ export type GNRerouteNodeData = {
19
19
  inputSocketId: string;
20
20
  outputSocketId: string;
21
21
  };
22
+ export type ZoneKind = 'simulation' | 'repeat' | 'foreach' | 'closure';
22
23
  export type SimulationZoneNodeData = {
23
- label: string;
24
+ kind: ZoneKind;
24
25
  };
25
26
  export type NodeFrameData = {
26
27
  label: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geonodes-web-render",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "Browser-based viewer for Blender Geometry Nodes exported via Tree Clipper. Renders node trees as a read-only, Blender-styled graph.",
5
5
  "type": "module",
6
6
  "exports": {