baselode 0.1.9 → 0.1.10

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/baselode.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import K from "papaparse";
2
- import { jsx as $, jsxs as Q } from "react/jsx-runtime";
3
- import { useRef as pt, useState as J, useEffect as me, useMemo as we } from "react";
4
- import Pe from "plotly.js-dist-min";
2
+ import { jsx as w, jsxs as Q } from "react/jsx-runtime";
3
+ import { useRef as bt, useState as J, useEffect as me, useMemo as Ve } from "react";
4
+ import Fe from "plotly.js-dist-min";
5
5
  import * as y from "three";
6
- import { OrbitControls as Xt } from "three/examples/jsm/controls/OrbitControls";
7
- import { FlyControls as Wt } from "three/examples/jsm/controls/FlyControls";
8
- import { ViewportGizmo as Zt } from "three-viewport-gizmo";
9
- import { EffectComposer as Kt } from "three/examples/jsm/postprocessing/EffectComposer.js";
10
- import { RenderPass as Jt } from "three/examples/jsm/postprocessing/RenderPass.js";
11
- import { OutlinePass as Qt } from "three/examples/jsm/postprocessing/OutlinePass.js";
12
- const z = "hole_id", te = "latitude", ne = "longitude", Me = "elevation", B = "azimuth", R = "dip", S = "from", D = "to", Ee = "mid", ae = "project_id", de = "easting", fe = "northing", bt = "crs", q = "depth", gt = "alpha", yt = "beta", en = "strike", oe = "geology_code", ie = "geology_description", Zr = {
6
+ import { OrbitControls as Wt } from "three/examples/jsm/controls/OrbitControls";
7
+ import { FlyControls as Zt } from "three/examples/jsm/controls/FlyControls";
8
+ import { ViewportGizmo as Kt } from "three-viewport-gizmo";
9
+ import { EffectComposer as Jt } from "three/examples/jsm/postprocessing/EffectComposer.js";
10
+ import { RenderPass as Qt } from "three/examples/jsm/postprocessing/RenderPass.js";
11
+ import { OutlinePass as en } from "three/examples/jsm/postprocessing/OutlinePass.js";
12
+ const z = "hole_id", te = "latitude", ne = "longitude", Me = "elevation", j = "azimuth", R = "dip", v = "from", S = "to", Ce = "mid", ae = "project_id", de = "easting", fe = "northing", gt = "crs", q = "depth", yt = "alpha", _t = "beta", tn = "strike", oe = "geology_code", ie = "geology_description", ro = {
13
13
  // A unique hole identifier across the entire dataset and all future data sets
14
14
  [z]: "string",
15
15
  // The hole ID from the original collar source
@@ -27,45 +27,45 @@ const z = "hole_id", te = "latitude", ne = "longitude", Me = "elevation", B = "a
27
27
  // The northing coordinate of the collar, in meters (projected CRS)
28
28
  [fe]: "number",
29
29
  // The coordinate reference system of the collar coordinates for easting/northing, as an EPSG code or proj string
30
- [bt]: "string"
31
- }, Kr = {
30
+ [gt]: "string"
31
+ }, oo = {
32
32
  // The unique hole id that maps to the collar and any other data tables
33
33
  [z]: "string",
34
34
  // The depth along the hole where the survey measurement was taken / started
35
35
  [q]: "number",
36
36
  // The depth along the hole where the survey measurement ended, if applicable (some surveys are point measurements and may not have a 'to' depth)
37
- [D]: "number",
37
+ [S]: "number",
38
38
  // The azimuth of the hole at the survey depth, in degrees from north
39
- [B]: "number",
39
+ [j]: "number",
40
40
  // The dip of the hole at the survey depth, in degrees from horizontal (negative values indicate downward inclination)
41
41
  [R]: "number"
42
- }, Jr = {
42
+ }, io = {
43
43
  // The unique hole id that maps to the collar and any other data tables
44
44
  [z]: "string",
45
45
  // The depth along the hole where the assay interval starts
46
- [S]: "number",
46
+ [v]: "number",
47
47
  // The depth along the hole where the assay interval ends
48
- [D]: "number",
48
+ [S]: "number",
49
49
  // The midpoint depth of the assay interval
50
- [Ee]: "number"
50
+ [Ce]: "number"
51
51
  // assay value columns are variable and not standardized here.
52
52
  // Assays may be flattened (one column per assay type) or long (one row per assay type with an additional 'assay_type' column)
53
- }, tn = {
53
+ }, nn = {
54
54
  [z]: "string",
55
+ [v]: "number",
55
56
  [S]: "number",
56
- [D]: "number",
57
- [Ee]: "number",
57
+ [Ce]: "number",
58
58
  [oe]: "string",
59
59
  [ie]: "string"
60
- }, Qr = {
60
+ }, so = {
61
61
  [z]: "string",
62
62
  [q]: "number",
63
63
  [R]: "number",
64
- [B]: "number",
65
- [gt]: "number",
64
+ [j]: "number",
66
65
  [yt]: "number",
66
+ [_t]: "number",
67
67
  comments: "string"
68
- }, nn = {
68
+ }, rn = {
69
69
  [z]: ["hole_id", "holeid", "hole id", "hole-id"],
70
70
  datasource_hole_id: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
71
71
  [ae]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
@@ -74,9 +74,9 @@ const z = "hole_id", te = "latitude", ne = "longitude", Me = "elevation", B = "a
74
74
  [Me]: ["elevation", "rl", "elev", "z"],
75
75
  [de]: ["easting", "x"],
76
76
  [fe]: ["northing", "y"],
77
- [bt]: ["crs", "epsg", "projection"],
78
- [S]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
79
- [D]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
77
+ [gt]: ["crs", "epsg", "projection"],
78
+ [v]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
79
+ [S]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
80
80
  [oe]: [
81
81
  "geology_code",
82
82
  "geologycode",
@@ -98,42 +98,42 @@ const z = "hole_id", te = "latitude", ne = "longitude", Me = "elevation", B = "a
98
98
  "description",
99
99
  "comments"
100
100
  ],
101
- [B]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
101
+ [j]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
102
102
  [R]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
103
- [gt]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
104
- [yt]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
103
+ [yt]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
104
+ [_t]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
105
105
  declination: ["declination", "dec"],
106
106
  [q]: ["depth", "survey_depth", "surveydepth"],
107
- [en]: ["strike", "str"]
108
- }, _t = {};
109
- for (const [e, t] of Object.entries(nn))
107
+ [tn]: ["strike", "str"]
108
+ }, Nt = {};
109
+ for (const [e, t] of Object.entries(rn))
110
110
  for (const n of t) {
111
111
  const r = n.toLowerCase().trim();
112
- _t[r] = e;
112
+ Nt[r] = e;
113
113
  }
114
- function Ce(e) {
114
+ function De(e) {
115
115
  return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
116
116
  }
117
117
  function he(e, t = null, n = null) {
118
- const r = { ..._t };
118
+ const r = { ...Nt };
119
119
  if (n) {
120
120
  for (const [i, s] of Object.entries(n))
121
121
  if (i != null && s != null) {
122
- const l = Ce(i), c = Ce(s);
123
- r[l] = c;
122
+ const l = De(i), u = De(s);
123
+ r[l] = u;
124
124
  }
125
125
  }
126
126
  const o = {};
127
127
  for (const [i, s] of Object.entries(e)) {
128
- const l = Ce(i), c = r[l] || l;
129
- o[c] = s;
128
+ const l = De(i), u = r[l] || l;
129
+ o[u] = s;
130
130
  }
131
131
  return o;
132
132
  }
133
- function eo(e, t = null, n = null) {
133
+ function lo(e, t = null, n = null) {
134
134
  return e.map((r) => he(r, t, n));
135
135
  }
136
- const rn = /* @__PURE__ */ new Set([
136
+ const on = /* @__PURE__ */ new Set([
137
137
  "hole_id",
138
138
  "holeid",
139
139
  "id",
@@ -165,34 +165,34 @@ const rn = /* @__PURE__ */ new Set([
165
165
  "todepth",
166
166
  "comment",
167
167
  "z"
168
- ]), Re = "[baselode:data]";
169
- function on(e, t = "Unknown error") {
168
+ ]), Ue = "[baselode:data]";
169
+ function sn(e, t = "Unknown error") {
170
170
  if (e instanceof Error) return e;
171
171
  const n = typeof e == "string" && e.trim() ? e : t;
172
172
  return new Error(n);
173
173
  }
174
- function H(e, t, n = "Operation failed") {
175
- const r = on(t, n), o = new Error(`${e}: ${r.message}`);
174
+ function V(e, t, n = "Operation failed") {
175
+ const r = sn(t, n), o = new Error(`${e}: ${r.message}`);
176
176
  return o.cause = r, o;
177
177
  }
178
- function to(e, t) {
178
+ function ao(e, t) {
179
179
  if (t !== void 0) {
180
- console.warn(`${Re} ${e}`, t);
180
+ console.warn(`${Ue} ${e}`, t);
181
181
  return;
182
182
  }
183
- console.warn(`${Re} ${e}`);
183
+ console.warn(`${Ue} ${e}`);
184
184
  }
185
- function no(e) {
186
- console.info(`${Re} ${e}`);
185
+ function co(e) {
186
+ console.info(`${Ue} ${e}`);
187
187
  }
188
- const Te = (e, t = null) => he(e, null, t);
189
- function sn(e) {
188
+ const we = (e, t = null) => he(e, null, t);
189
+ function ln(e) {
190
190
  return { holeId: e[z] };
191
191
  }
192
- function Nt(e, t = null) {
192
+ function zt(e, t = null) {
193
193
  const n = e[z], r = n !== void 0 ? `${n}`.trim() : "";
194
194
  if (!r) return null;
195
- const o = e[ae] || e.project || e.project_code, i = Number(e[S]), s = Number(e[D]);
195
+ const o = e[ae] || e.project || e.project_code, i = Number(e[v]), s = Number(e[S]);
196
196
  return !Number.isFinite(i) || !Number.isFinite(s) || s <= i ? null : {
197
197
  holeId: r,
198
198
  project: o,
@@ -201,22 +201,22 @@ function Nt(e, t = null) {
201
201
  ...e
202
202
  };
203
203
  }
204
- function zt(e, t) {
204
+ function Mt(e, t) {
205
205
  var o;
206
206
  const n = t.sort((i, s) => i.from - s.from), r = [];
207
207
  return n.forEach((i) => {
208
- const { from: s, to: l, project: c, ...a } = i, u = {
208
+ const { from: s, to: l, project: u, ...a } = i, c = {
209
209
  z: s,
210
210
  from: s,
211
211
  to: l,
212
212
  [z]: e,
213
- [ae]: c,
213
+ [ae]: u,
214
214
  ...a
215
215
  };
216
- r.push(u), r.push({ ...u, z: l });
216
+ r.push(c), r.push({ ...c, z: l });
217
217
  }), { id: e, project: (o = n[0]) == null ? void 0 : o.project, points: r };
218
218
  }
219
- function ro(e, t = null) {
219
+ function uo(e, t = null) {
220
220
  return new Promise((n, r) => {
221
221
  const o = /* @__PURE__ */ new Set();
222
222
  K.parse(e, {
@@ -224,18 +224,18 @@ function ro(e, t = null) {
224
224
  dynamicTyping: !0,
225
225
  skipEmptyLines: !0,
226
226
  step: (i) => {
227
- const l = Te(i.data, t)[z];
227
+ const l = we(i.data, t)[z];
228
228
  l !== void 0 && `${l}`.trim() !== "" && o.add(`${l}`.trim());
229
229
  },
230
230
  complete: () => n(Array.from(o)),
231
- error: (i) => r(H("parseAssayHoleIds", i))
231
+ error: (i) => r(V("parseAssayHoleIds", i))
232
232
  });
233
233
  });
234
234
  }
235
- function ln(e) {
236
- return Object.entries(e || {}).some(([t, n]) => !(rn.has(t) || n == null || typeof n == "string" && n.trim() === ""));
235
+ function an(e) {
236
+ return Object.entries(e || {}).some(([t, n]) => !(on.has(t) || n == null || typeof n == "string" && n.trim() === ""));
237
237
  }
238
- function an(e, t = null) {
238
+ function cn(e, t = null) {
239
239
  return new Promise((n, r) => {
240
240
  const o = /* @__PURE__ */ new Map();
241
241
  K.parse(e, {
@@ -243,26 +243,26 @@ function an(e, t = null) {
243
243
  dynamicTyping: !0,
244
244
  skipEmptyLines: !0,
245
245
  step: (i) => {
246
- const s = Te(i.data, t);
247
- if (!ln(s)) return;
248
- const c = sn(s).holeId;
249
- if (c !== void 0 && `${c}`.trim() !== "") {
250
- const a = `${c}`.trim();
246
+ const s = we(i.data, t);
247
+ if (!an(s)) return;
248
+ const u = ln(s).holeId;
249
+ if (u !== void 0 && `${u}`.trim() !== "") {
250
+ const a = `${u}`.trim();
251
251
  o.has(a) || o.set(a, {
252
252
  holeId: a
253
253
  });
254
254
  }
255
255
  },
256
256
  complete: () => n(Array.from(o.values())),
257
- error: (i) => r(H("parseAssayHoleIdsWithAssays", i))
257
+ error: (i) => r(V("parseAssayHoleIdsWithAssays", i))
258
258
  });
259
259
  });
260
260
  }
261
- function cn(e, t, n = null, r = null) {
261
+ function un(e, t, n = null, r = null) {
262
262
  return new Promise((o, i) => {
263
263
  const s = `${t}`.trim();
264
264
  if (!s) {
265
- i(H("parseAssayHole", new Error("Missing hole id")));
265
+ i(V("parseAssayHole", new Error("Missing hole id")));
266
266
  return;
267
267
  }
268
268
  const l = [];
@@ -270,23 +270,23 @@ function cn(e, t, n = null, r = null) {
270
270
  header: !0,
271
271
  dynamicTyping: !0,
272
272
  skipEmptyLines: !0,
273
- step: (c) => {
274
- const a = Te(c.data, r), u = Nt(a, r);
275
- u && `${u.holeId}`.trim() === s && l.push(u);
273
+ step: (u) => {
274
+ const a = we(u.data, r), c = zt(a, r);
275
+ c && `${c.holeId}`.trim() === s && l.push(c);
276
276
  },
277
277
  complete: () => {
278
278
  if (!l.length) {
279
279
  o(null);
280
280
  return;
281
281
  }
282
- const c = zt(s, l);
283
- o(c);
282
+ const u = Mt(s, l);
283
+ o(u);
284
284
  },
285
- error: (c) => i(H("parseAssayHole", c))
285
+ error: (u) => i(V("parseAssayHole", u))
286
286
  });
287
287
  });
288
288
  }
289
- function un(e, t = null, n = null) {
289
+ function mn(e, t = null, n = null) {
290
290
  return new Promise((r, o) => {
291
291
  K.parse(e, {
292
292
  header: !0,
@@ -294,24 +294,24 @@ function un(e, t = null, n = null) {
294
294
  skipEmptyLines: !0,
295
295
  complete: (i) => {
296
296
  const s = /* @__PURE__ */ new Map();
297
- i.data.forEach((c) => {
298
- const a = Te(c, n), u = Nt(a, n);
299
- u && (s.has(u.holeId) || s.set(u.holeId, []), s.get(u.holeId).push(u));
297
+ i.data.forEach((u) => {
298
+ const a = we(u, n), c = zt(a, n);
299
+ c && (s.has(c.holeId) || s.set(c.holeId, []), s.get(c.holeId).push(c));
300
300
  });
301
- const l = Array.from(s.entries()).map(([c, a]) => zt(c, a));
301
+ const l = Array.from(s.entries()).map(([u, a]) => Mt(u, a));
302
302
  r({ holes: l });
303
303
  },
304
- error: (i) => o(H("parseAssaysCSV", i))
304
+ error: (i) => o(V("parseAssaysCSV", i))
305
305
  });
306
306
  });
307
307
  }
308
- function oo(e = {}) {
308
+ function mo(e = {}) {
309
309
  const t = {};
310
310
  return Object.entries(e || {}).forEach(([n, r]) => {
311
- n && (t[Ce(n)] = r);
311
+ n && (t[De(n)] = r);
312
312
  }), t;
313
313
  }
314
- function io(e = {}, t = [], n) {
314
+ function fo(e = {}, t = [], n) {
315
315
  for (const r of t) {
316
316
  const o = e[r];
317
317
  if (o != null && `${o}`.trim() !== "")
@@ -319,8 +319,8 @@ function io(e = {}, t = [], n) {
319
319
  }
320
320
  return n;
321
321
  }
322
- const mn = 4;
323
- function Mt(e = [], t = "") {
322
+ const dn = 4;
323
+ function Et(e = [], t = "") {
324
324
  if (!e.length) return [];
325
325
  if (!t) return e;
326
326
  const n = e.findIndex((i) => i === t);
@@ -328,7 +328,7 @@ function Mt(e = [], t = "") {
328
328
  const r = e[n], o = e.filter((i, s) => s !== n);
329
329
  return [r, ...o];
330
330
  }
331
- function ke({
331
+ function Pe({
332
332
  property: e = "",
333
333
  chartType: t = "",
334
334
  categoricalProps: n = [],
@@ -337,18 +337,18 @@ function ke({
337
337
  } = {}) {
338
338
  return e ? r.includes(e) ? "comment" : n.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !t || t === "categorical" || t === "comment" || t === "tadpole" ? o : t : t || o;
339
339
  }
340
- function xt({
340
+ function At({
341
341
  holeIds: e = [],
342
342
  focusedHoleId: t = "",
343
- plotCount: n = mn,
343
+ plotCount: n = dn,
344
344
  defaultProp: r = "",
345
345
  categoricalProps: o = [],
346
346
  commentProps: i = [],
347
347
  numericDefaultChartType: s = "markers+line"
348
348
  } = {}) {
349
- const l = Mt(e, t);
350
- return Array.from({ length: n }).map((c, a) => {
351
- const u = l[a] || e[a] || "", m = ke({
349
+ const l = Et(e, t);
350
+ return Array.from({ length: n }).map((u, a) => {
351
+ const c = l[a] || e[a] || "", m = Pe({
352
352
  property: r,
353
353
  chartType: "",
354
354
  categoricalProps: o,
@@ -356,30 +356,30 @@ function xt({
356
356
  numericDefaultChartType: s
357
357
  });
358
358
  return {
359
- holeId: u,
359
+ holeId: c,
360
360
  property: r,
361
361
  chartType: m
362
362
  };
363
363
  });
364
364
  }
365
- const Ie = "numeric", Se = "categorical", xe = "comment", Oe = "hidden", Ge = "tadpole", Qe = {
366
- [Ie]: [
365
+ const Ae = "numeric", ve = "categorical", Ee = "comment", Oe = "hidden", Ye = "tadpole", tt = {
366
+ [Ae]: [
367
367
  { value: "bar", label: "Bars" },
368
368
  { value: "markers", label: "Markers" },
369
369
  { value: "markers+line", label: "Markers + Line" },
370
370
  { value: "line", label: "Line only" }
371
371
  ],
372
- [Se]: [
372
+ [ve]: [
373
373
  { value: "categorical", label: "Categorical bands" }
374
374
  ],
375
- [xe]: [
375
+ [Ee]: [
376
376
  { value: "comment", label: "Comments" }
377
377
  ],
378
- [Ge]: [
378
+ [Ye]: [
379
379
  { value: "tadpole", label: "Tadpole" }
380
380
  ],
381
381
  [Oe]: []
382
- }, et = /* @__PURE__ */ new Set([
382
+ }, nt = /* @__PURE__ */ new Set([
383
383
  // Hole identifiers
384
384
  "hole_id",
385
385
  "holeid",
@@ -434,7 +434,7 @@ const Ie = "numeric", Se = "categorical", xe = "comment", Oe = "hidden", Ge = "t
434
434
  "data_source",
435
435
  "_hole_key",
436
436
  "_hole_id_key"
437
- ]), dn = /* @__PURE__ */ new Set([
437
+ ]), fn = /* @__PURE__ */ new Set([
438
438
  "comments",
439
439
  "comment",
440
440
  "notes",
@@ -447,50 +447,50 @@ const Ie = "numeric", Se = "categorical", xe = "comment", Oe = "hidden", Ge = "t
447
447
  "structcomment",
448
448
  "geology_description"
449
449
  ]);
450
- function fn(e) {
450
+ function hn(e) {
451
451
  if (!(e != null && e.length))
452
452
  return { byType: {}, numericCols: [], categoricalCols: [], commentCols: [] };
453
453
  const t = new Set(e.flatMap((r) => Object.keys(r || {}))), n = {};
454
454
  for (const r of t) {
455
455
  const o = r.toLowerCase().trim();
456
- if (et.has(o) || et.has(r)) {
456
+ if (nt.has(o) || nt.has(r)) {
457
457
  n[r] = Oe;
458
458
  continue;
459
459
  }
460
- if (dn.has(o)) {
461
- const l = e.some((c) => {
462
- const a = c[r];
460
+ if (fn.has(o)) {
461
+ const l = e.some((u) => {
462
+ const a = u[r];
463
463
  return a != null && String(a).trim() !== "" && String(a) !== "null";
464
464
  });
465
- n[r] = l ? xe : Oe;
465
+ n[r] = l ? Ee : Oe;
466
466
  continue;
467
467
  }
468
468
  let i = !1, s = !1;
469
469
  for (const l of e) {
470
- const c = l[r];
471
- if (!(c == null || typeof c == "string" && c.trim() === "") && (s = !0, typeof c == "number" && Number.isFinite(c))) {
470
+ const u = l[r];
471
+ if (!(u == null || typeof u == "string" && u.trim() === "") && (s = !0, typeof u == "number" && Number.isFinite(u))) {
472
472
  i = !0;
473
473
  break;
474
474
  }
475
475
  }
476
- s ? i ? n[r] = Ie : n[r] = Se : n[r] = Oe;
476
+ s ? i ? n[r] = Ae : n[r] = ve : n[r] = Oe;
477
477
  }
478
478
  return {
479
479
  byType: n,
480
- numericCols: Object.entries(n).filter(([, r]) => r === Ie).map(([r]) => r),
481
- categoricalCols: Object.entries(n).filter(([, r]) => r === Se).map(([r]) => r),
482
- commentCols: Object.entries(n).filter(([, r]) => r === xe).map(([r]) => r)
480
+ numericCols: Object.entries(n).filter(([, r]) => r === Ae).map(([r]) => r),
481
+ categoricalCols: Object.entries(n).filter(([, r]) => r === ve).map(([r]) => r),
482
+ commentCols: Object.entries(n).filter(([, r]) => r === Ee).map(([r]) => r)
483
483
  };
484
484
  }
485
- function Ye(e) {
486
- return Qe[e] ?? Qe[Ie];
485
+ function Xe(e) {
486
+ return tt[e] ?? tt[Ae];
487
487
  }
488
- function so(e) {
489
- const t = Ye(e);
490
- return t.length ? e === Ie ? "line" : t[0].value : "markers+line";
488
+ function ho(e) {
489
+ const t = Xe(e);
490
+ return t.length ? e === Ae ? "line" : t[0].value : "markers+line";
491
491
  }
492
- function Le(e = []) {
493
- const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } = fn(t), s = n[0] || r[0] || "";
492
+ function ke(e = []) {
493
+ const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } = hn(t), s = n[0] || r[0] || "";
494
494
  return {
495
495
  numericProps: n,
496
496
  categoricalProps: r,
@@ -499,15 +499,15 @@ function Le(e = []) {
499
499
  defaultProp: s
500
500
  };
501
501
  }
502
- async function hn(e, t = null) {
503
- return await an(e);
502
+ async function pn(e, t = null) {
503
+ return await cn(e);
504
504
  }
505
- async function pn(e, t, n = null) {
506
- return await cn(e, t);
505
+ async function bn(e, t, n = null) {
506
+ return await un(e, t);
507
507
  }
508
- function bn(e = [], t = "") {
508
+ function gn(e = [], t = "") {
509
509
  if (!e.length) return null;
510
- const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Le(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), c = xt({
510
+ const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = ke(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), u = At({
511
511
  holeIds: l,
512
512
  focusedHoleId: t,
513
513
  plotCount: 4,
@@ -523,30 +523,30 @@ function bn(e = [], t = "") {
523
523
  commentProps: o,
524
524
  columnMeta: i,
525
525
  defaultProp: s,
526
- traceConfigs: c
526
+ traceConfigs: u
527
527
  };
528
528
  }
529
- async function lo(e, t = "", n = null) {
530
- const { holes: r } = await un(e, n), o = bn(r, t);
529
+ async function po(e, t = "", n = null) {
530
+ const { holes: r } = await mn(e, n), o = gn(r, t);
531
531
  if (!o) throw new Error("No valid assay intervals found.");
532
532
  return o;
533
533
  }
534
- function ao(e, t = null) {
534
+ function bo(e, t = null) {
535
535
  return new Promise((n, r) => {
536
536
  K.parse(e, {
537
537
  header: !0,
538
538
  dynamicTyping: !0,
539
539
  skipEmptyLines: !0,
540
540
  complete: (o) => {
541
- const i = o.data.map((s) => gn(s, t)).filter((s) => s[z] && Number.isFinite(s[q]) && Number.isFinite(s[R]) && Number.isFinite(s[B]));
541
+ const i = o.data.map((s) => yn(s, t)).filter((s) => s[z] && Number.isFinite(s[q]) && Number.isFinite(s[R]) && Number.isFinite(s[j]));
542
542
  n(i);
543
543
  },
544
- error: (o) => r(H("parseSurveyCSV", o))
544
+ error: (o) => r(V("parseSurveyCSV", o))
545
545
  });
546
546
  });
547
547
  }
548
- function gn(e, t = null) {
549
- const n = he(e, null, t), r = n[z], o = n[ae] || n.project || n.project_code, i = Ne(n[te]), s = Ne(n[ne]), l = Ne(n[q]), c = Ne(n[R]), a = Ne(n[B]), u = Ne(n.maxdepth);
548
+ function yn(e, t = null) {
549
+ const n = he(e, null, t), r = n[z], o = n[ae] || n.project || n.project_code, i = Ne(n[te]), s = Ne(n[ne]), l = Ne(n[q]), u = Ne(n[R]), a = Ne(n[j]), c = Ne(n.maxdepth);
550
550
  return {
551
551
  raw: n,
552
552
  [z]: r,
@@ -554,9 +554,9 @@ function gn(e, t = null) {
554
554
  [te]: i,
555
555
  [ne]: s,
556
556
  [q]: l,
557
- [R]: c,
558
- [B]: a,
559
- maxdepth: u,
557
+ [R]: u,
558
+ [j]: a,
559
+ maxdepth: c,
560
560
  // Legacy field names for backwards compatibility
561
561
  project_code: o,
562
562
  latitude: i,
@@ -568,8 +568,8 @@ const Ne = (e) => {
568
568
  const t = Number(e);
569
569
  return Number.isFinite(t) ? t : void 0;
570
570
  };
571
- function co(e, t) {
572
- var a, u, m, d;
571
+ function go(e, t) {
572
+ var a, c, m, d;
573
573
  const n = /* @__PURE__ */ new Map();
574
574
  e.forEach((f) => {
575
575
  const p = (f[z] || f.holeId || f.id || "").toString().trim();
@@ -577,93 +577,93 @@ function co(e, t) {
577
577
  const b = p.toLowerCase();
578
578
  n.has(b) || n.set(b, f);
579
579
  });
580
- const r = ((a = e[0]) == null ? void 0 : a.lat) ?? ((u = e[0]) == null ? void 0 : u[te]) ?? 0, o = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[ne]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), l = /* @__PURE__ */ new Map();
580
+ const r = ((a = e[0]) == null ? void 0 : a.lat) ?? ((c = e[0]) == null ? void 0 : c[te]) ?? 0, o = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[ne]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), l = /* @__PURE__ */ new Map();
581
581
  t.forEach((f) => {
582
582
  const p = (f[z] || "").toString().trim();
583
583
  if (!p) return;
584
584
  const b = p.toLowerCase();
585
585
  l.has(b) || l.set(b, []), l.get(b).push(f);
586
586
  });
587
- const c = [];
587
+ const u = [];
588
588
  return l.forEach((f, p) => {
589
589
  const b = n.get(p);
590
590
  if (!b) return;
591
- const h = f.filter((F) => Number.isFinite(F[q] ?? F.surveydepth)).sort((F, U) => (F[q] ?? F.surveydepth) - (U[q] ?? U.surveydepth));
591
+ const h = f.filter((L) => Number.isFinite(L[q] ?? L.surveydepth)).sort((L, U) => (L[q] ?? L.surveydepth) - (U[q] ?? U.surveydepth));
592
592
  if (!h.length) return;
593
- const N = b.lat ?? b[te], g = b.lng ?? b[ne], v = 111132, M = 111320 * Math.cos(N * Math.PI / 180), E = (g - o) * s, P = (N - r) * i, C = [];
594
- let L = 0, O = 0, G = 0;
595
- for (let F = 0; F < h.length; F += 1) {
596
- const U = h[F], j = h[F - 1], A = U[q] ?? U.surveydepth, x = U[B] ?? U.azimuth, _ = U[R] ?? U.dip;
597
- if (!j) {
598
- C.push({
599
- x: E + L,
600
- y: P + O,
593
+ const N = b.lat ?? b[te], g = b.lng ?? b[ne], I = 111132, M = 111320 * Math.cos(N * Math.PI / 180), C = (g - o) * s, F = (N - r) * i, D = [];
594
+ let k = 0, O = 0, G = 0;
595
+ for (let L = 0; L < h.length; L += 1) {
596
+ const U = h[L], H = h[L - 1], x = U[q] ?? U.surveydepth, E = U[j] ?? U.azimuth, _ = U[R] ?? U.dip;
597
+ if (!H) {
598
+ D.push({
599
+ x: C + k,
600
+ y: F + O,
601
601
  z: 0,
602
- md: A,
603
- azimuth: x,
602
+ md: x,
603
+ azimuth: E,
604
604
  dip: _
605
605
  });
606
606
  continue;
607
607
  }
608
- const k = j[q] ?? j.surveydepth, I = j[B] ?? j.azimuth, V = j[R] ?? j.dip, w = A - k;
609
- if (w <= 0) continue;
610
- const T = tt(V), Y = tt(_), W = Ue(I), re = Ue(x), pe = Math.acos(
608
+ const P = H[q] ?? H.surveydepth, A = H[j] ?? H.azimuth, $ = H[R] ?? H.dip, B = x - P;
609
+ if (B <= 0) continue;
610
+ const T = rt($), Y = rt(_), W = qe(A), re = qe(E), pe = Math.acos(
611
611
  Math.sin(T) * Math.sin(Y) * Math.cos(W - re) + Math.cos(T) * Math.cos(Y)
612
- ), ce = pe > 1e-6 ? 2 / pe * Math.tan(pe / 2) : 1, ve = 0.5 * w * (Math.sin(T) * Math.cos(W) + Math.sin(Y) * Math.cos(re)) * ce, ue = 0.5 * w * (Math.sin(T) * Math.sin(W) + Math.sin(Y) * Math.sin(re)) * ce, Ve = 0.5 * w * (Math.cos(T) + Math.cos(Y)) * ce;
613
- L += ve, O += ue, G += Ve, C.push({
614
- x: E + L,
615
- y: P + O,
612
+ ), ce = pe > 1e-6 ? 2 / pe * Math.tan(pe / 2) : 1, Ie = 0.5 * B * (Math.sin(T) * Math.cos(W) + Math.sin(Y) * Math.cos(re)) * ce, ue = 0.5 * B * (Math.sin(T) * Math.sin(W) + Math.sin(Y) * Math.sin(re)) * ce, Be = 0.5 * B * (Math.cos(T) + Math.cos(Y)) * ce;
613
+ k += Ie, O += ue, G += Be, D.push({
614
+ x: C + k,
615
+ y: F + O,
616
616
  z: -G,
617
617
  // render with z up; depth down
618
- md: A,
619
- azimuth: x,
618
+ md: x,
619
+ azimuth: E,
620
620
  dip: _
621
621
  });
622
622
  }
623
- const X = C.map((F) => ({
624
- ...F,
625
- lat: N + F.y / v,
626
- lng: g + F.x / M
623
+ const X = D.map((L) => ({
624
+ ...L,
625
+ lat: N + L.y / I,
626
+ lng: g + L.x / M
627
627
  }));
628
- c.push({
628
+ u.push({
629
629
  id: b[z] || b.holeId || p,
630
630
  project: b[ae] || b.project_id || b.project || "",
631
631
  points: X,
632
632
  collar: b
633
633
  });
634
- }), c;
634
+ }), u;
635
635
  }
636
- const Ue = (e) => e * Math.PI / 180, tt = (e) => {
636
+ const qe = (e) => e * Math.PI / 180, rt = (e) => {
637
637
  const t = Number(e), n = 90 + (Number.isFinite(t) ? t : 0), r = Math.min(180, Math.max(0, n));
638
- return Ue(r);
638
+ return qe(r);
639
639
  };
640
640
  function ee(e, t = void 0) {
641
641
  const n = Number(e);
642
642
  return Number.isFinite(n) ? n : t;
643
643
  }
644
- function nt(e) {
644
+ function ot(e) {
645
645
  return e == null ? "" : `${e}`.trim();
646
646
  }
647
- function Fe(e = [], t = null) {
648
- const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) => nt(s == null ? void 0 : s[i])));
647
+ function Te(e = [], t = null) {
648
+ const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) => ot(s == null ? void 0 : s[i])));
649
649
  if (!o)
650
- throw H("canonicalizeHoleIdRows", new Error(`hole id column '${n}' not found`));
650
+ throw V("canonicalizeHoleIdRows", new Error(`hole id column '${n}' not found`));
651
651
  return {
652
652
  aliasCol: o,
653
653
  rows: e.map((i) => ({
654
654
  ...i,
655
- hole_id: nt(i == null ? void 0 : i[o])
655
+ hole_id: ot(i == null ? void 0 : i[o])
656
656
  }))
657
657
  };
658
658
  }
659
- function rt(e) {
659
+ function it(e) {
660
660
  return Number(e) * Math.PI / 180;
661
661
  }
662
662
  function He(e, t) {
663
- const n = rt(e), r = rt(t), o = Math.cos(r) * Math.sin(n), i = Math.cos(r) * Math.cos(n), s = Math.sin(r) * -1;
663
+ const n = it(e), r = it(t), o = Math.cos(r) * Math.sin(n), i = Math.cos(r) * Math.cos(n), s = Math.sin(r) * -1;
664
664
  return { ca: o, cb: i, cc: s };
665
665
  }
666
- function yn(e, t, n, r, o, i = "minimum_curvature") {
666
+ function _n(e, t, n, r, o, i = "minimum_curvature") {
667
667
  const s = He(t, n), l = He(r, o);
668
668
  if (i === "tangential")
669
669
  return {
@@ -683,87 +683,87 @@ function yn(e, t, n, r, o, i = "minimum_curvature") {
683
683
  dip: d
684
684
  };
685
685
  }
686
- const c = s.ca * l.ca + s.cb * l.cb + s.cc * l.cc, a = Math.acos(Math.max(-1, Math.min(1, c))), u = a > 1e-6 ? 2 * Math.tan(a / 2) / a : 1;
686
+ const u = s.ca * l.ca + s.cb * l.cb + s.cc * l.cc, a = Math.acos(Math.max(-1, Math.min(1, u))), c = a > 1e-6 ? 2 * Math.tan(a / 2) / a : 1;
687
687
  return {
688
- dx: 0.5 * e * (s.ca + l.ca) * u,
689
- dy: 0.5 * e * (s.cb + l.cb) * u,
690
- dz: 0.5 * e * (s.cc + l.cc) * u,
688
+ dx: 0.5 * e * (s.ca + l.ca) * c,
689
+ dy: 0.5 * e * (s.cb + l.cb) * c,
690
+ dz: 0.5 * e * (s.cc + l.cc) * c,
691
691
  azimuth: r,
692
692
  dip: o
693
693
  };
694
694
  }
695
- function qe(e = [], t = [], n = {}) {
695
+ function We(e = [], t = [], n = {}) {
696
696
  const {
697
697
  step: r = 1,
698
698
  holeIdCol: o = null,
699
699
  method: i = "minimum_curvature"
700
- } = n, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, l = Fe(e, o), c = Fe(t, o || l.aliasCol);
701
- if (!l.rows.length || !c.rows.length) return [];
700
+ } = n, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, l = Te(e, o), u = Te(t, o || l.aliasCol);
701
+ if (!l.rows.length || !u.rows.length) return [];
702
702
  const a = /* @__PURE__ */ new Map();
703
703
  l.rows.forEach((d) => {
704
704
  !d.hole_id || a.has(d.hole_id) || a.set(d.hole_id, d);
705
705
  });
706
- const u = /* @__PURE__ */ new Map();
707
- c.rows.forEach((d) => {
708
- d.hole_id && (u.has(d.hole_id) || u.set(d.hole_id, []), u.get(d.hole_id).push(d));
706
+ const c = /* @__PURE__ */ new Map();
707
+ u.rows.forEach((d) => {
708
+ d.hole_id && (c.has(d.hole_id) || c.set(d.hole_id, []), c.get(d.hole_id).push(d));
709
709
  });
710
710
  const m = [];
711
- return u.forEach((d, f) => {
711
+ return c.forEach((d, f) => {
712
712
  const p = a.get(f);
713
713
  if (!p) return;
714
- const b = [...d].map((C) => ({
715
- ...C,
716
- from: ee(C.from),
717
- azimuth: ee(C.azimuth),
718
- dip: ee(C.dip)
719
- })).filter((C) => Number.isFinite(C.from) && Number.isFinite(C.azimuth) && Number.isFinite(C.dip)).sort((C, L) => C.from - L.from);
714
+ const b = [...d].map((D) => ({
715
+ ...D,
716
+ from: ee(D.from),
717
+ azimuth: ee(D.azimuth),
718
+ dip: ee(D.dip)
719
+ })).filter((D) => Number.isFinite(D.from) && Number.isFinite(D.azimuth) && Number.isFinite(D.dip)).sort((D, k) => D.from - k.from);
720
720
  if (!b.length) return;
721
- let h = ee(p.x, 0), N = ee(p.y, 0), g = ee(p.z, 0), v = b[0].from;
722
- const M = b[0].azimuth, E = b[0].dip, P = {
721
+ let h = ee(p.x, 0), N = ee(p.y, 0), g = ee(p.z, 0), I = b[0].from;
722
+ const M = b[0].azimuth, C = b[0].dip, F = {
723
723
  hole_id: f,
724
- md: v,
724
+ md: I,
725
725
  x: h,
726
726
  y: N,
727
727
  z: g,
728
728
  azimuth: M,
729
- dip: E
729
+ dip: C
730
730
  };
731
- l.aliasCol !== "hole_id" && p[l.aliasCol] !== void 0 && (P[l.aliasCol] = p[l.aliasCol]), m.push(P);
732
- for (let C = 0; C < b.length - 1; C += 1) {
733
- const L = b[C], O = b[C + 1], G = L.from, F = O.from - G;
734
- if (F <= 0) continue;
735
- const U = Math.max(1, Math.ceil(F / s)), j = F / U;
736
- for (let A = 0; A < U; A += 1) {
737
- v += j;
738
- const x = (v - G) / F, _ = L.azimuth + x * (O.azimuth - L.azimuth), k = L.dip + x * (O.dip - L.dip), I = yn(j, L.azimuth, L.dip, O.azimuth, O.dip, i);
739
- h += I.dx, N += I.dy, g += I.dz;
740
- const V = {
731
+ l.aliasCol !== "hole_id" && p[l.aliasCol] !== void 0 && (F[l.aliasCol] = p[l.aliasCol]), m.push(F);
732
+ for (let D = 0; D < b.length - 1; D += 1) {
733
+ const k = b[D], O = b[D + 1], G = k.from, L = O.from - G;
734
+ if (L <= 0) continue;
735
+ const U = Math.max(1, Math.ceil(L / s)), H = L / U;
736
+ for (let x = 0; x < U; x += 1) {
737
+ I += H;
738
+ const E = (I - G) / L, _ = k.azimuth + E * (O.azimuth - k.azimuth), P = k.dip + E * (O.dip - k.dip), A = _n(H, k.azimuth, k.dip, O.azimuth, O.dip, i);
739
+ h += A.dx, N += A.dy, g += A.dz;
740
+ const $ = {
741
741
  hole_id: f,
742
- md: v,
742
+ md: I,
743
743
  x: h,
744
744
  y: N,
745
745
  z: g,
746
- azimuth: i === "minimum_curvature" ? _ : I.azimuth,
747
- dip: i === "minimum_curvature" ? k : I.dip
746
+ azimuth: i === "minimum_curvature" ? _ : A.azimuth,
747
+ dip: i === "minimum_curvature" ? P : A.dip
748
748
  };
749
- l.aliasCol !== "hole_id" && p[l.aliasCol] !== void 0 && (V[l.aliasCol] = p[l.aliasCol]), m.push(V);
749
+ l.aliasCol !== "hole_id" && p[l.aliasCol] !== void 0 && ($[l.aliasCol] = p[l.aliasCol]), m.push($);
750
750
  }
751
751
  }
752
752
  }), m;
753
753
  }
754
- function _n(e, t, n = {}) {
755
- return qe(e, t, { ...n, method: "minimum_curvature" });
754
+ function Nn(e, t, n = {}) {
755
+ return We(e, t, { ...n, method: "minimum_curvature" });
756
756
  }
757
- function uo(e, t, n = {}) {
758
- return qe(e, t, { ...n, method: "tangential" });
757
+ function yo(e, t, n = {}) {
758
+ return We(e, t, { ...n, method: "tangential" });
759
759
  }
760
- function mo(e, t, n = {}) {
761
- return qe(e, t, { ...n, method: "balanced_tangential" });
760
+ function _o(e, t, n = {}) {
761
+ return We(e, t, { ...n, method: "balanced_tangential" });
762
762
  }
763
- function fo(e, t, n = {}) {
764
- return _n(e, t, n);
763
+ function No(e, t, n = {}) {
764
+ return Nn(e, t, n);
765
765
  }
766
- function Nn(e, t) {
766
+ function zn(e, t) {
767
767
  if (!e.length || !Number.isFinite(t)) return null;
768
768
  let n = null, r = 1 / 0;
769
769
  for (let o = 0; o < e.length; o += 1) {
@@ -774,18 +774,18 @@ function Nn(e, t) {
774
774
  }
775
775
  return n;
776
776
  }
777
- function ho(e = [], t = [], n = {}) {
778
- const r = n.holeIdCol || "hole_id", o = Fe(e, r), i = Fe(t, r);
777
+ function zo(e = [], t = [], n = {}) {
778
+ const r = n.holeIdCol || "hole_id", o = Te(e, r), i = Te(t, r);
779
779
  if (!o.rows.length || !i.rows.length) return [...o.rows];
780
780
  const s = /* @__PURE__ */ new Map();
781
781
  return i.rows.forEach((l) => {
782
782
  l.hole_id && (s.has(l.hole_id) || s.set(l.hole_id, []), s.get(l.hole_id).push(l));
783
- }), s.forEach((l, c) => {
784
- s.set(c, [...l].sort((a, u) => ee(a.md, 0) - ee(u.md, 0)));
783
+ }), s.forEach((l, u) => {
784
+ s.set(u, [...l].sort((a, c) => ee(a.md, 0) - ee(c.md, 0)));
785
785
  }), o.rows.map((l) => {
786
- const c = ee(l.from), a = ee(l.to), u = Number.isFinite(c) && Number.isFinite(a) ? 0.5 * (c + a) : void 0;
787
- if (!l.hole_id || !Number.isFinite(u)) return { ...l };
788
- const m = Nn(s.get(l.hole_id) || [], u);
786
+ const u = ee(l.from), a = ee(l.to), c = Number.isFinite(u) && Number.isFinite(a) ? 0.5 * (u + a) : void 0;
787
+ if (!l.hole_id || !Number.isFinite(c)) return { ...l };
788
+ const m = zn(s.get(l.hole_id) || [], c);
789
789
  if (!m) return { ...l };
790
790
  const d = { ...l };
791
791
  return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
@@ -793,7 +793,7 @@ function ho(e = [], t = [], n = {}) {
793
793
  }), d;
794
794
  });
795
795
  }
796
- function po(e, t = null) {
796
+ function Mo(e, t = null) {
797
797
  return new Promise((n, r) => {
798
798
  K.parse(e, {
799
799
  header: !0,
@@ -801,8 +801,8 @@ function po(e, t = null) {
801
801
  skipEmptyLines: !0,
802
802
  complete: (o) => {
803
803
  const i = /* @__PURE__ */ new Map();
804
- o.data.forEach((l, c) => {
805
- const a = he(l, null, t), u = a[z], m = u !== void 0 ? `${u}`.trim() : "", d = a[de] ?? a.x, f = a[fe] ?? a.y, p = a[Me] ?? a.z, b = a.order ?? c;
804
+ o.data.forEach((l, u) => {
805
+ const a = he(l, null, t), c = a[z], m = c !== void 0 ? `${c}`.trim() : "", d = a[de] ?? a.x, f = a[fe] ?? a.y, p = a[Me] ?? a.z, b = a.order ?? u;
806
806
  !m || d === null || d === void 0 || f === null || f === void 0 || p === null || p === void 0 || (i.has(m) || i.set(m, []), i.get(m).push({
807
807
  ...a,
808
808
  holeId: m,
@@ -812,9 +812,9 @@ function po(e, t = null) {
812
812
  z: Number(p) ?? 0
813
813
  }));
814
814
  });
815
- const s = Array.from(i.entries()).map(([l, c]) => ({
815
+ const s = Array.from(i.entries()).map(([l, u]) => ({
816
816
  id: l,
817
- points: c.sort((a, u) => a.order - u.order).map((a) => ({
817
+ points: u.sort((a, c) => a.order - c.order).map((a) => ({
818
818
  ...a,
819
819
  x: Number(a.x) || 0,
820
820
  y: Number(a.y) || 0,
@@ -823,7 +823,7 @@ function po(e, t = null) {
823
823
  }));
824
824
  n({ holes: s });
825
825
  },
826
- error: (o) => r(H("parseDrillholesCSV", o))
826
+ error: (o) => r(V("parseDrillholesCSV", o))
827
827
  });
828
828
  });
829
829
  }
@@ -834,33 +834,33 @@ function Z(e) {
834
834
  const t = Number(e);
835
835
  return Number.isFinite(t) ? t : void 0;
836
836
  }
837
- function De(e = [], t = []) {
837
+ function Se(e = [], t = []) {
838
838
  const n = [...e];
839
839
  return n.sort((r, o) => {
840
840
  for (let i = 0; i < t.length; i += 1) {
841
- const s = t[i], l = r == null ? void 0 : r[s], c = o == null ? void 0 : o[s];
842
- if (l !== c)
843
- return l == null ? 1 : c == null ? -1 : typeof l == "number" && typeof c == "number" ? l - c : `${l}`.localeCompare(`${c}`);
841
+ const s = t[i], l = r == null ? void 0 : r[s], u = o == null ? void 0 : o[s];
842
+ if (l !== u)
843
+ return l == null ? 1 : u == null ? -1 : typeof l == "number" && typeof u == "number" ? l - u : `${l}`.localeCompare(`${u}`);
844
844
  }
845
845
  return 0;
846
846
  }), n;
847
847
  }
848
- function zn(e = [], t = "Intervals") {
848
+ function Mn(e = [], t = "Intervals") {
849
849
  if (!e.length) return;
850
- const n = De(e, [z, S, D]), r = /* @__PURE__ */ new Map();
850
+ const n = Se(e, [z, v, S]), r = /* @__PURE__ */ new Map();
851
851
  n.forEach((o) => {
852
- const i = `${(o == null ? void 0 : o[z]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[S]), l = Number(o == null ? void 0 : o[D]);
852
+ const i = `${(o == null ? void 0 : o[z]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[v]), l = Number(o == null ? void 0 : o[S]);
853
853
  if (!i || !Number.isFinite(s) || !Number.isFinite(l)) return;
854
- const c = r.get(i);
855
- if (Number.isFinite(c) && s < c)
856
- throw H(
854
+ const u = r.get(i);
855
+ if (Number.isFinite(u) && s < u)
856
+ throw V(
857
857
  "validateNoOverlappingIntervals",
858
- new Error(`${t} intervals overlap for hole '${i}': from=${s} is less than previous to=${c}`)
858
+ new Error(`${t} intervals overlap for hole '${i}': from=${s} is less than previous to=${u}`)
859
859
  );
860
860
  r.set(i, l);
861
861
  });
862
862
  }
863
- function Mn(e, t = {}) {
863
+ function En(e, t = {}) {
864
864
  return new Promise((n, r) => {
865
865
  K.parse(e, {
866
866
  header: !0,
@@ -868,11 +868,11 @@ function Mn(e, t = {}) {
868
868
  skipEmptyLines: !0,
869
869
  ...t,
870
870
  complete: (o) => n(Array.isArray(o == null ? void 0 : o.data) ? o.data : []),
871
- error: (o) => r(H("loadTable(csv)", o))
871
+ error: (o) => r(V("loadTable(csv)", o))
872
872
  });
873
873
  });
874
874
  }
875
- function xn(e = [], t = null, n = null) {
875
+ function An(e = [], t = null, n = null) {
876
876
  return e.map((r) => he(r, t, n));
877
877
  }
878
878
  async function $e(e, t = {}) {
@@ -886,11 +886,11 @@ async function $e(e, t = {}) {
886
886
  if (Array.isArray(e))
887
887
  s = ze(e);
888
888
  else if (n === "csv")
889
- s = await Mn(e, i);
890
- else throw n === "parquet" || n === "sql" ? H("loadTable", new Error(`Unsupported kind in JS runtime: ${n}`)) : H("loadTable", new Error(`Unsupported kind: ${n}`));
891
- return xn(s, r, o);
889
+ s = await En(e, i);
890
+ else throw n === "parquet" || n === "sql" ? V("loadTable", new Error(`Unsupported kind in JS runtime: ${n}`)) : V("loadTable", new Error(`Unsupported kind: ${n}`));
891
+ return An(s, r, o);
892
892
  }
893
- async function bo(e, t = {}) {
893
+ async function Eo(e, t = {}) {
894
894
  const {
895
895
  crs: n = null,
896
896
  sourceColumnMap: r = null,
@@ -898,11 +898,11 @@ async function bo(e, t = {}) {
898
898
  ...i
899
899
  } = t, s = await $e(e, { ...i, sourceColumnMap: r });
900
900
  if (!s.some((d) => z in d))
901
- throw H("loadCollars", new Error(`Collar table missing column: ${z}`));
902
- const c = s.some((d) => de in d && fe in d), a = s.some((d) => te in d && ne in d);
903
- if (!c && !a)
904
- throw H("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
905
- const u = s.map((d) => {
901
+ throw V("loadCollars", new Error(`Collar table missing column: ${z}`));
902
+ const u = s.some((d) => de in d && fe in d), a = s.some((d) => te in d && ne in d);
903
+ if (!u && !a)
904
+ throw V("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
905
+ const c = s.map((d) => {
906
906
  const f = { ...d };
907
907
  if (z in f) {
908
908
  const p = f[z];
@@ -910,88 +910,88 @@ async function bo(e, t = {}) {
910
910
  }
911
911
  return te in f && (f[te] = Z(f[te])), ne in f && (f[ne] = Z(f[ne])), Me in f && (f[Me] = Z(f[Me])), de in f && (f[de] = Z(f[de])), fe in f && (f[fe] = Z(f[fe])), !("datasource_hole_id" in f) && z in f && (f.datasource_hole_id = f[z]), f;
912
912
  });
913
- if (!u.every((d) => !(!d[z] || a && (!Number.isFinite(d[te]) || !Number.isFinite(d[ne])) || c && !a && (!Number.isFinite(d[de]) || !Number.isFinite(d[fe])))))
914
- throw H("loadCollars", new Error("Collar table has missing required values"));
915
- return u;
913
+ if (!c.every((d) => !(!d[z] || a && (!Number.isFinite(d[te]) || !Number.isFinite(d[ne])) || u && !a && (!Number.isFinite(d[de]) || !Number.isFinite(d[fe])))))
914
+ throw V("loadCollars", new Error("Collar table has missing required values"));
915
+ return c;
916
916
  }
917
- async function go(e, t = {}) {
917
+ async function Ao(e, t = {}) {
918
918
  const {
919
919
  sourceColumnMap: n = null,
920
920
  keepAll: r = !0,
921
921
  ...o
922
- } = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, q, B, R];
922
+ } = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, q, j, R];
923
923
  for (const a of s)
924
924
  if (!i.some((m) => a in m))
925
- throw H("loadSurveys", new Error(`Survey table missing column: ${a}`));
925
+ throw V("loadSurveys", new Error(`Survey table missing column: ${a}`));
926
926
  const l = i.map((a) => {
927
- const u = { ...a };
928
- if (z in u) {
929
- const m = u[z];
930
- u[z] = m == null ? "" : `${m}`.trim();
927
+ const c = { ...a };
928
+ if (z in c) {
929
+ const m = c[z];
930
+ c[z] = m == null ? "" : `${m}`.trim();
931
931
  }
932
- return q in u && (u[q] = Z(u[q])), D in u && (u[D] = Z(u[D])), B in u && (u[B] = Z(u[B])), R in u && (u[R] = Z(u[R])), u;
932
+ return q in c && (c[q] = Z(c[q])), S in c && (c[S] = Z(c[S])), j in c && (c[j] = Z(c[j])), R in c && (c[R] = Z(c[R])), c;
933
933
  });
934
- if (!l.every((a) => !(!a[z] || !Number.isFinite(a[q]) || !Number.isFinite(a[B]) || !Number.isFinite(a[R]))))
935
- throw H("loadSurveys", new Error("Survey table has missing required values"));
936
- return De(l, [z, q]);
934
+ if (!l.every((a) => !(!a[z] || !Number.isFinite(a[q]) || !Number.isFinite(a[j]) || !Number.isFinite(a[R]))))
935
+ throw V("loadSurveys", new Error("Survey table has missing required values"));
936
+ return Se(l, [z, q]);
937
937
  }
938
- async function yo(e, t = {}) {
938
+ async function Co(e, t = {}) {
939
939
  const {
940
940
  sourceColumnMap: n = null,
941
941
  keepAll: r = !0,
942
942
  ...o
943
- } = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, S, D];
943
+ } = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, v, S];
944
944
  for (const a of s)
945
945
  if (!i.some((m) => a in m))
946
- throw H("loadAssays", new Error(`Assay table missing column: ${a}`));
946
+ throw V("loadAssays", new Error(`Assay table missing column: ${a}`));
947
947
  const l = i.map((a) => {
948
- const u = { ...a };
949
- if (z in u) {
950
- const m = u[z];
951
- u[z] = m == null ? "" : `${m}`.trim();
948
+ const c = { ...a };
949
+ if (z in c) {
950
+ const m = c[z];
951
+ c[z] = m == null ? "" : `${m}`.trim();
952
952
  }
953
- return S in u && (u[S] = Z(u[S])), D in u && (u[D] = Z(u[D])), S in u && D in u && Number.isFinite(u[S]) && Number.isFinite(u[D]) && (u[Ee] = 0.5 * (u[S] + u[D])), u;
953
+ return v in c && (c[v] = Z(c[v])), S in c && (c[S] = Z(c[S])), v in c && S in c && Number.isFinite(c[v]) && Number.isFinite(c[S]) && (c[Ce] = 0.5 * (c[v] + c[S])), c;
954
954
  });
955
- if (!l.every((a) => !(!a[z] || !Number.isFinite(a[S]) || !Number.isFinite(a[D]) || !(a[D] > a[S]))))
956
- throw H("loadAssays", new Error("Assay table has missing required values"));
957
- return De(l, [z, S, D]);
955
+ if (!l.every((a) => !(!a[z] || !Number.isFinite(a[v]) || !Number.isFinite(a[S]) || !(a[S] > a[v]))))
956
+ throw V("loadAssays", new Error("Assay table has missing required values"));
957
+ return Se(l, [z, v, S]);
958
958
  }
959
- async function _o(e, t = {}) {
959
+ async function Io(e, t = {}) {
960
960
  const {
961
961
  sourceColumnMap: n = null,
962
962
  keepAll: r = !0,
963
963
  ...o
964
- } = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, S, D];
965
- for (const u of s)
966
- if (!i.some((d) => u in d))
967
- throw H("loadGeology", new Error(`Geology table missing column: ${u}`));
968
- const l = i.map((u) => {
969
- const m = { ...u };
964
+ } = t, i = await $e(e, { ...o, sourceColumnMap: n }), s = [z, v, S];
965
+ for (const c of s)
966
+ if (!i.some((d) => c in d))
967
+ throw V("loadGeology", new Error(`Geology table missing column: ${c}`));
968
+ const l = i.map((c) => {
969
+ const m = { ...c };
970
970
  if (z in m) {
971
971
  const p = m[z];
972
972
  m[z] = p == null ? "" : `${p}`.trim();
973
973
  }
974
- S in m && (m[S] = Z(m[S])), D in m && (m[D] = Z(m[D])), S in m && D in m && Number.isFinite(m[S]) && Number.isFinite(m[D]) && (m[D] === m[S] && (m[S] = Math.round(m[S] * 1e3) / 1e3, m[D] = m[S] + 1e-3), m[Ee] = 0.5 * (m[S] + m[D]));
974
+ v in m && (m[v] = Z(m[v])), S in m && (m[S] = Z(m[S])), v in m && S in m && Number.isFinite(m[v]) && Number.isFinite(m[S]) && (m[S] === m[v] && (m[v] = Math.round(m[v] * 1e3) / 1e3, m[S] = m[v] + 1e-3), m[Ce] = 0.5 * (m[v] + m[S]));
975
975
  const d = m[oe] !== void 0 && m[oe] !== null && `${m[oe]}`.trim() !== "", f = m[ie] !== void 0 && m[ie] !== null && `${m[ie]}`.trim() !== "";
976
976
  return !d && f && (m[oe] = m[ie]), d && !f && (m[ie] = m[oe]), m;
977
977
  });
978
- if (!l.every((u) => !(!u[z] || !Number.isFinite(u[S]) || !Number.isFinite(u[D]) || !(u[D] > u[S]))))
979
- throw H("loadGeology", new Error("Geology table has missing or invalid interval values"));
980
- if (!l.some((u) => {
981
- const m = u[oe], d = u[ie];
978
+ if (!l.every((c) => !(!c[z] || !Number.isFinite(c[v]) || !Number.isFinite(c[S]) || !(c[S] > c[v]))))
979
+ throw V("loadGeology", new Error("Geology table has missing or invalid interval values"));
980
+ if (!l.some((c) => {
981
+ const m = c[oe], d = c[ie];
982
982
  return m != null && `${m}`.trim() !== "" || d != null && `${d}`.trim() !== "";
983
983
  }))
984
- throw H("loadGeology", new Error(`Geology table missing categorical columns: ${oe} or ${ie}`));
985
- if (zn(l, "Geology"), !r) {
986
- const u = new Set(Object.keys(tn));
987
- return De(
988
- l.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => u.has(d)))),
989
- [z, S, D]
984
+ throw V("loadGeology", new Error(`Geology table missing categorical columns: ${oe} or ${ie}`));
985
+ if (Mn(l, "Geology"), !r) {
986
+ const c = new Set(Object.keys(nn));
987
+ return Se(
988
+ l.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => c.has(d)))),
989
+ [z, v, S]
990
990
  );
991
991
  }
992
- return De(l, [z, S, D]);
992
+ return Se(l, [z, v, S]);
993
993
  }
994
- function No(e = [], t = [], n = {}) {
994
+ function xo(e = [], t = [], n = {}) {
995
995
  const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [z];
996
996
  if (!t.length) return [...e];
997
997
  const o = (s) => r.map((l) => `${(s == null ? void 0 : s[l]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
@@ -1000,16 +1000,16 @@ function No(e = [], t = [], n = {}) {
1000
1000
  }), e.map((s) => {
1001
1001
  const l = i.get(o(s));
1002
1002
  if (!l) return { ...s };
1003
- const c = { ...s };
1004
- return Object.entries(l).forEach(([a, u]) => {
1005
- r.includes(a) || (Object.prototype.hasOwnProperty.call(c, a) ? c[`${a}_trace`] = u : c[a] = u);
1006
- }), c;
1003
+ const u = { ...s };
1004
+ return Object.entries(l).forEach(([a, c]) => {
1005
+ r.includes(a) || (Object.prototype.hasOwnProperty.call(u, a) ? u[`${a}_trace`] = c : u[a] = c);
1006
+ }), u;
1007
1007
  });
1008
1008
  }
1009
- function zo(e = [], t = null) {
1009
+ function vo(e = [], t = null) {
1010
1010
  return t == null ? [...e] : e.length ? e.some((r) => ae in r) ? e.filter((r) => (r == null ? void 0 : r[ae]) === t) : [...e] : [];
1011
1011
  }
1012
- function Mo(e = [], t = []) {
1012
+ function So(e = [], t = []) {
1013
1013
  return e.map((n) => {
1014
1014
  const r = { ...n };
1015
1015
  return t.forEach((o) => {
@@ -1019,7 +1019,7 @@ function Mo(e = [], t = []) {
1019
1019
  }), r;
1020
1020
  });
1021
1021
  }
1022
- function xo({
1022
+ function Fo({
1023
1023
  collars: e = [],
1024
1024
  surveys: t = [],
1025
1025
  assays: n = [],
@@ -1036,57 +1036,57 @@ function xo({
1036
1036
  metadata: i || {}
1037
1037
  };
1038
1038
  }
1039
- const It = ["x", "y", "z", "dx", "dy", "dz"], In = {
1039
+ const Ct = ["x", "y", "z", "dx", "dy", "dz"], Cn = {
1040
1040
  x: ["x", "easting", "center_x", "xc", "xcentre", "xcenter", "x_centre", "x_center", "cx"],
1041
1041
  y: ["y", "northing", "center_y", "yc", "ycentre", "ycenter", "y_centre", "y_center", "cy"],
1042
1042
  z: ["z", "elevation", "center_z", "zc", "zcentre", "zcenter", "z_centre", "z_center", "cz"],
1043
1043
  dx: ["dx", "size_x", "sx", "sizex", "dim_x", "block_size_x"],
1044
1044
  dy: ["dy", "size_y", "sy", "sizey", "dim_y", "block_size_y"],
1045
1045
  dz: ["dz", "size_z", "sz", "sizez", "dim_z", "block_size_z"]
1046
- }, Et = {};
1047
- Object.entries(In).forEach(([e, t]) => {
1046
+ }, It = {};
1047
+ Object.entries(Cn).forEach(([e, t]) => {
1048
1048
  t.forEach((n) => {
1049
- Et[n.toLowerCase()] = e;
1049
+ It[n.toLowerCase()] = e;
1050
1050
  });
1051
1051
  });
1052
- function En(e) {
1052
+ function In(e) {
1053
1053
  const t = {};
1054
1054
  return Object.entries(e).forEach(([n, r]) => {
1055
- const o = Et[n.toLowerCase().trim()] || n;
1055
+ const o = It[n.toLowerCase().trim()] || n;
1056
1056
  t[o] = r;
1057
1057
  }), t;
1058
1058
  }
1059
- function Io(e) {
1059
+ function Do(e) {
1060
1060
  return new Promise((t, n) => {
1061
1061
  K.parse(e, {
1062
1062
  header: !0,
1063
1063
  dynamicTyping: !0,
1064
1064
  skipEmptyLines: !0,
1065
1065
  complete: (r) => {
1066
- const i = (r.data || []).map(En).filter(
1066
+ const i = (r.data || []).map(In).filter(
1067
1067
  (l) => l.x !== null && l.y !== null && l.z !== null
1068
1068
  ), s = Object.keys(i[0] || {}).filter(
1069
- (l) => !It.includes(l)
1069
+ (l) => !Ct.includes(l)
1070
1070
  );
1071
1071
  t({ data: i, properties: s });
1072
1072
  },
1073
1073
  error: (r) => {
1074
- n(H("parseBlockModelCSV", r));
1074
+ n(V("parseBlockModelCSV", r));
1075
1075
  }
1076
1076
  });
1077
1077
  });
1078
1078
  }
1079
- function Eo(e) {
1079
+ function Po(e) {
1080
1080
  if (typeof e == "string")
1081
1081
  try {
1082
1082
  return JSON.parse(e);
1083
1083
  } catch (t) {
1084
- throw H("loadBlockModelMetadata", t);
1084
+ throw V("loadBlockModelMetadata", t);
1085
1085
  }
1086
1086
  if (e && typeof e == "object") return e;
1087
- throw H("loadBlockModelMetadata", new Error("Invalid metadata source"));
1087
+ throw V("loadBlockModelMetadata", new Error("Invalid metadata source"));
1088
1088
  }
1089
- function vn(e, t) {
1089
+ function xn(e, t) {
1090
1090
  const n = e.map((i) => i[t]).filter((i) => i != null);
1091
1091
  if (n.length > 0 && n.every((i) => typeof i == "number")) {
1092
1092
  const i = Math.min(...n), s = Math.max(...n);
@@ -1094,16 +1094,16 @@ function vn(e, t) {
1094
1094
  }
1095
1095
  return { type: "categorical", categories: [...new Set(n)], values: n };
1096
1096
  }
1097
- function vo(e) {
1097
+ function Oo(e) {
1098
1098
  if (!e || e.length === 0) return {};
1099
1099
  const t = Object.keys(e[0]).filter(
1100
- (r) => !It.includes(r)
1100
+ (r) => !Ct.includes(r)
1101
1101
  ), n = {};
1102
1102
  return t.forEach((r) => {
1103
- n[r] = vn(e, r);
1103
+ n[r] = xn(e, r);
1104
1104
  }), n;
1105
1105
  }
1106
- function An(e, t) {
1106
+ function vn(e, t) {
1107
1107
  return !t || typeof t != "object" ? e : e.filter(
1108
1108
  (n) => Object.entries(t).every(([r, o]) => {
1109
1109
  const i = n[r];
@@ -1111,8 +1111,8 @@ function An(e, t) {
1111
1111
  })
1112
1112
  );
1113
1113
  }
1114
- function Ao(e, t = null) {
1115
- return (t ? An(e, t) : e).reduce((r, o) => {
1114
+ function ko(e, t = null) {
1115
+ return (t ? vn(e, t) : e).reduce((r, o) => {
1116
1116
  const i = Number(o.dx) || 0, s = Number(o.dy) || 0, l = Number(o.dz) || 0;
1117
1117
  return r + i * s * l;
1118
1118
  }, 0);
@@ -1126,17 +1126,17 @@ function Sn(e, t, n) {
1126
1126
  const o = t.categories.indexOf(e) / Math.max(t.categories.length, 1) * 360;
1127
1127
  return new n.Color().setHSL(o / 360, 0.7, 0.5);
1128
1128
  }
1129
- const Xe = (e, t = null) => he(e, null, t);
1130
- function Dn(e) {
1129
+ const Ze = (e, t = null) => he(e, null, t);
1130
+ function Fn(e) {
1131
1131
  if (!e.length) return null;
1132
- const t = e[0], n = S in t && D in t, r = q in t && !n;
1132
+ const t = e[0], n = v in t && S in t, r = q in t && !n;
1133
1133
  return n ? "interval" : r ? "point" : null;
1134
1134
  }
1135
1135
  function le(e) {
1136
1136
  const t = Number(e);
1137
1137
  return Number.isFinite(t) ? t : null;
1138
1138
  }
1139
- function vt(e) {
1139
+ function xt(e) {
1140
1140
  const t = e[z] !== void 0 ? `${e[z]}`.trim() : "";
1141
1141
  if (!t) return null;
1142
1142
  const n = le(e[q]);
@@ -1144,38 +1144,38 @@ function vt(e) {
1144
1144
  [z]: t,
1145
1145
  [q]: n,
1146
1146
  [R]: le(e[R]),
1147
- [B]: le(e[B]),
1147
+ [j]: le(e[j]),
1148
1148
  comments: e.comments != null ? `${e.comments}` : null,
1149
1149
  ...e
1150
1150
  };
1151
1151
  }
1152
- function At(e) {
1152
+ function vt(e) {
1153
1153
  const t = e[z] !== void 0 ? `${e[z]}`.trim() : "";
1154
1154
  if (!t) return null;
1155
- const n = le(e[S]), r = le(e[D]);
1155
+ const n = le(e[v]), r = le(e[S]);
1156
1156
  if (n === null || r === null || r <= n) return null;
1157
1157
  const o = 0.5 * (n + r);
1158
1158
  return {
1159
1159
  [z]: t,
1160
- [S]: n,
1161
- [D]: r,
1160
+ [v]: n,
1161
+ [S]: r,
1162
1162
  mid: o,
1163
1163
  [R]: le(e[R]),
1164
- [B]: le(e[B]),
1164
+ [j]: le(e[j]),
1165
1165
  classification: e.classification != null ? `${e.classification}` : null,
1166
1166
  comments: e.comments != null ? `${e.comments}` : null,
1167
1167
  ...e
1168
1168
  };
1169
1169
  }
1170
- function So(e) {
1170
+ function Lo(e) {
1171
1171
  const t = [], n = [];
1172
1172
  for (const r of e) {
1173
- const o = [], i = le(r[R]), s = le(r[B]);
1173
+ const o = [], i = le(r[R]), s = le(r[j]);
1174
1174
  i !== null && (i < 0 || i > 90) && o.push(`dip ${i} out of range [0, 90]`), s !== null && (s < 0 || s >= 360) && o.push(`azimuth ${s} out of range [0, 360)`), o.length ? n.push({ row: r, message: o.join("; ") }) : t.push(r);
1175
1175
  }
1176
1176
  return { valid: t, errors: n };
1177
1177
  }
1178
- function Do(e, t = null) {
1178
+ function To(e, t = null) {
1179
1179
  return new Promise((n, r) => {
1180
1180
  const o = {
1181
1181
  header: !0,
@@ -1184,18 +1184,18 @@ function Do(e, t = null) {
1184
1184
  complete: (i) => {
1185
1185
  const s = [];
1186
1186
  for (const l of i.data) {
1187
- const c = Xe(l, t), a = vt(c);
1187
+ const u = Ze(l, t), a = xt(u);
1188
1188
  a && s.push(a);
1189
1189
  }
1190
1190
  n(s);
1191
1191
  },
1192
- error: (i) => r(H("parseStructuralPointsCSV", i))
1192
+ error: (i) => r(V("parseStructuralPointsCSV", i))
1193
1193
  };
1194
1194
  typeof e == "string" && !e.startsWith("data:") && e.includes(`
1195
1195
  `) ? K.parse(e, o) : K.parse(e, o);
1196
1196
  });
1197
1197
  }
1198
- function Po(e, t = null) {
1198
+ function wo(e, t = null) {
1199
1199
  return new Promise((n, r) => {
1200
1200
  K.parse(e, {
1201
1201
  header: !0,
@@ -1204,16 +1204,16 @@ function Po(e, t = null) {
1204
1204
  complete: (o) => {
1205
1205
  const i = [];
1206
1206
  for (const s of o.data) {
1207
- const l = Xe(s, t), c = At(l);
1208
- c && i.push(c);
1207
+ const l = Ze(s, t), u = vt(l);
1208
+ u && i.push(u);
1209
1209
  }
1210
1210
  n(i);
1211
1211
  },
1212
- error: (o) => r(H("parseStructuralIntervalsCSV", o))
1212
+ error: (o) => r(V("parseStructuralIntervalsCSV", o))
1213
1213
  });
1214
1214
  });
1215
1215
  }
1216
- function Pn(e, t = z) {
1216
+ function Dn(e, t = z) {
1217
1217
  const n = /* @__PURE__ */ new Map();
1218
1218
  for (const r of e) {
1219
1219
  const o = r[t] != null ? String(r[t]).trim() : "";
@@ -1221,33 +1221,33 @@ function Pn(e, t = z) {
1221
1221
  }
1222
1222
  return Array.from(n.values());
1223
1223
  }
1224
- function Cn(e, t = null) {
1224
+ function Pn(e, t = null) {
1225
1225
  return new Promise((n, r) => {
1226
1226
  K.parse(e, {
1227
1227
  header: !0,
1228
1228
  dynamicTyping: !0,
1229
1229
  skipEmptyLines: !0,
1230
1230
  complete: (o) => {
1231
- const i = o.data.map((c) => Xe(c, t)), s = Dn(i);
1231
+ const i = o.data.map((u) => Ze(u, t)), s = Fn(i);
1232
1232
  if (!s) {
1233
- r(H(
1233
+ r(V(
1234
1234
  "parseStructuralCSV",
1235
1235
  new Error("Structural CSV requires either 'depth' (point) or 'from'/'to' (interval) columns")
1236
1236
  ));
1237
1237
  return;
1238
1238
  }
1239
1239
  const l = [];
1240
- for (const c of i) {
1241
- const a = s === "interval" ? At(c) : vt(c);
1240
+ for (const u of i) {
1241
+ const a = s === "interval" ? vt(u) : xt(u);
1242
1242
  a && l.push(a);
1243
1243
  }
1244
1244
  n({ schema: s, rows: l });
1245
1245
  },
1246
- error: (o) => r(H("parseStructuralCSV", o))
1246
+ error: (o) => r(V("parseStructuralCSV", o))
1247
1247
  });
1248
1248
  });
1249
1249
  }
1250
- function kn(e) {
1250
+ function On(e) {
1251
1251
  return new Promise((t) => {
1252
1252
  K.parse(e, {
1253
1253
  header: !0,
@@ -1258,15 +1258,15 @@ function kn(e) {
1258
1258
  for (const i of n.data) {
1259
1259
  const s = he(i), l = s[z] != null ? `${s[z]}`.trim() : "";
1260
1260
  if (!l) continue;
1261
- const c = Number(s[S]), a = Number(s[D]);
1262
- if (!Number.isFinite(c) || !Number.isFinite(a) || a <= c) continue;
1263
- const u = (c + a) / 2, { [R]: m, [B]: d, ...f } = s, p = {
1261
+ const u = Number(s[v]), a = Number(s[S]);
1262
+ if (!Number.isFinite(u) || !Number.isFinite(a) || a <= u) continue;
1263
+ const c = (u + a) / 2, { [R]: m, [j]: d, ...f } = s, p = {
1264
1264
  ...f,
1265
1265
  [z]: l,
1266
- [S]: c,
1267
- [D]: a,
1268
- [Ee]: u,
1269
- [q]: u,
1266
+ [v]: u,
1267
+ [S]: a,
1268
+ [Ce]: c,
1269
+ [q]: c,
1270
1270
  // unified depth field for y-axis rendering
1271
1271
  _source: "assay"
1272
1272
  };
@@ -1274,14 +1274,14 @@ function kn(e) {
1274
1274
  }
1275
1275
  const o = Array.from(r.entries()).map(([i, s]) => ({
1276
1276
  holeId: i,
1277
- points: s.sort((l, c) => l[S] - c[S])
1277
+ points: s.sort((l, u) => l[v] - u[v])
1278
1278
  }));
1279
1279
  t(o);
1280
1280
  }
1281
1281
  });
1282
1282
  });
1283
1283
  }
1284
- function On(e) {
1284
+ function kn(e) {
1285
1285
  return new Promise((t) => {
1286
1286
  K.parse(e, {
1287
1287
  header: !0,
@@ -1292,14 +1292,14 @@ function On(e) {
1292
1292
  for (const o of n.data) {
1293
1293
  const i = he(o), s = (i[z] ?? "").toString().trim();
1294
1294
  if (!s) continue;
1295
- const l = Number(i[S]), c = Number(i[D]);
1296
- if (!Number.isFinite(l) || !Number.isFinite(c) || c <= l) continue;
1297
- const a = (l + c) / 2, { [R]: u, [B]: m, ...d } = i, f = {
1295
+ const l = Number(i[v]), u = Number(i[S]);
1296
+ if (!Number.isFinite(l) || !Number.isFinite(u) || u <= l) continue;
1297
+ const a = (l + u) / 2, { [R]: c, [j]: m, ...d } = i, f = {
1298
1298
  ...d,
1299
1299
  [z]: s,
1300
- [S]: l,
1301
- [D]: c,
1302
- [Ee]: a,
1300
+ [v]: l,
1301
+ [S]: u,
1302
+ [Ce]: a,
1303
1303
  [q]: a,
1304
1304
  _source: "geology"
1305
1305
  };
@@ -1308,29 +1308,29 @@ function On(e) {
1308
1308
  t({
1309
1309
  holes: Array.from(r.entries()).map(([o, i]) => ({
1310
1310
  holeId: o,
1311
- points: i.sort((s, l) => s[S] - l[S])
1311
+ points: i.sort((s, l) => s[v] - l[v])
1312
1312
  }))
1313
1313
  });
1314
1314
  }
1315
1315
  });
1316
1316
  });
1317
1317
  }
1318
- async function Co({ assayCsv: e, structuralCsv: t, geologyCsv: n } = {}) {
1318
+ async function $o({ assayCsv: e, structuralCsv: t, geologyCsv: n } = {}) {
1319
1319
  const [r, o, i] = await Promise.all([
1320
- e ? kn(e) : Promise.resolve([]),
1321
- t ? Cn(t).then(
1322
- ({ rows: l }) => Pn(l.map((c) => ({ ...c, _source: "structural" })))
1320
+ e ? On(e) : Promise.resolve([]),
1321
+ t ? Pn(t).then(
1322
+ ({ rows: l }) => Dn(l.map((u) => ({ ...u, _source: "structural" })))
1323
1323
  ) : Promise.resolve([]),
1324
- n ? On(n).then(({ holes: l }) => l) : Promise.resolve([])
1324
+ n ? kn(n).then(({ holes: l }) => l) : Promise.resolve([])
1325
1325
  ]), s = new Map(r.map((l) => [l.holeId, { ...l, points: [...l.points] }]));
1326
1326
  for (const l of [...o, ...i]) {
1327
- const c = l.holeId;
1328
- if (c)
1329
- if (s.has(c)) {
1330
- const a = s.get(c);
1331
- s.set(c, { ...a, points: [...a.points, ...l.points || []] });
1327
+ const u = l.holeId;
1328
+ if (u)
1329
+ if (s.has(u)) {
1330
+ const a = s.get(u);
1331
+ s.set(u, { ...a, points: [...a.points, ...l.points || []] });
1332
1332
  } else
1333
- s.set(c, l);
1333
+ s.set(u, l);
1334
1334
  }
1335
1335
  return { holes: Array.from(s.values()) };
1336
1336
  }
@@ -1343,8 +1343,8 @@ function Ln(e, t) {
1343
1343
  }
1344
1344
  let r = -1;
1345
1345
  for (let g = 0; g < n - 1; g++) {
1346
- const v = Number(e[g].md), M = Number(e[g + 1].md);
1347
- if (t >= v && t <= M) {
1346
+ const I = Number(e[g].md), M = Number(e[g + 1].md);
1347
+ if (t >= I && t <= M) {
1348
1348
  r = g;
1349
1349
  break;
1350
1350
  }
@@ -1359,45 +1359,45 @@ function Ln(e, t) {
1359
1359
  const g = Number(o.md), M = Number(i.md) - g;
1360
1360
  s = M > 0 ? (t - g) / M : 0;
1361
1361
  }
1362
- const l = Number(o.x) + s * (Number(i.x) - Number(o.x)), c = Number(o.y) + s * (Number(i.y) - Number(o.y)), a = Number(o.z) + s * (Number(i.z) - Number(o.z));
1363
- let u, m, d;
1362
+ const l = Number(o.x) + s * (Number(i.x) - Number(o.x)), u = Number(o.y) + s * (Number(i.y) - Number(o.y)), a = Number(o.z) + s * (Number(i.z) - Number(o.z));
1363
+ let c, m, d;
1364
1364
  const f = Number(o.azimuth), p = Number(o.dip), b = Number(i.azimuth), h = Number(i.dip);
1365
1365
  if (Number.isFinite(f) && Number.isFinite(p)) {
1366
- const g = Number.isFinite(b) && Number.isFinite(h) ? f + s * (b - f) : f, v = Number.isFinite(b) && Number.isFinite(h) ? p + s * (h - p) : p, M = g * Math.PI / 180, E = v * Math.PI / 180;
1367
- u = Math.cos(E) * Math.sin(M), m = Math.cos(E) * Math.cos(M), d = -Math.sin(E);
1366
+ const g = Number.isFinite(b) && Number.isFinite(h) ? f + s * (b - f) : f, I = Number.isFinite(b) && Number.isFinite(h) ? p + s * (h - p) : p, M = g * Math.PI / 180, C = I * Math.PI / 180;
1367
+ c = Math.cos(C) * Math.sin(M), m = Math.cos(C) * Math.cos(M), d = -Math.sin(C);
1368
1368
  } else {
1369
- const g = Number(i.x) - Number(o.x), v = Number(i.y) - Number(o.y), M = Number(i.z) - Number(o.z), E = Math.sqrt(g * g + v * v + M * M);
1370
- if (E < 1e-10) return { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 };
1371
- u = g / E, m = v / E, d = M / E;
1372
- }
1373
- const N = Math.sqrt(u * u + m * m + d * d);
1374
- return N < 1e-10 ? { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 } : { x: l, y: c, z: a, dx: u / N, dy: m / N, dz: d / N };
1375
- }
1376
- function Fn(e, t, n, r = {}) {
1377
- const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: c } = n, a = [s, l, c];
1378
- let u = [0, 0, 1];
1379
- const m = a[0] * u[0] + a[1] * u[1] + a[2] * u[2];
1380
- Math.abs(m) > 0.99 && (u = [0, 1, 0]);
1369
+ const g = Number(i.x) - Number(o.x), I = Number(i.y) - Number(o.y), M = Number(i.z) - Number(o.z), C = Math.sqrt(g * g + I * I + M * M);
1370
+ if (C < 1e-10) return { x: l, y: u, z: a, dx: 0, dy: 0, dz: -1 };
1371
+ c = g / C, m = I / C, d = M / C;
1372
+ }
1373
+ const N = Math.sqrt(c * c + m * m + d * d);
1374
+ return N < 1e-10 ? { x: l, y: u, z: a, dx: 0, dy: 0, dz: -1 } : { x: l, y: u, z: a, dx: c / N, dy: m / N, dz: d / N };
1375
+ }
1376
+ function Tn(e, t, n, r = {}) {
1377
+ const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: u } = n, a = [s, l, u];
1378
+ let c = [0, 0, 1];
1379
+ const m = a[0] * c[0] + a[1] * c[1] + a[2] * c[2];
1380
+ Math.abs(m) > 0.99 && (c = [0, 1, 0]);
1381
1381
  const d = [
1382
- u[1] * a[2] - u[2] * a[1],
1383
- u[2] * a[0] - u[0] * a[2],
1384
- u[0] * a[1] - u[1] * a[0]
1382
+ c[1] * a[2] - c[2] * a[1],
1383
+ c[2] * a[0] - c[0] * a[2],
1384
+ c[0] * a[1] - c[1] * a[0]
1385
1385
  ], f = Math.sqrt(d[0] ** 2 + d[1] ** 2 + d[2] ** 2), p = f > 1e-10 ? [d[0] / f, d[1] / f, d[2] / f] : [1, 0, 0], b = [
1386
1386
  a[1] * p[2] - a[2] * p[1],
1387
1387
  a[2] * p[0] - a[0] * p[2],
1388
1388
  a[0] * p[1] - a[1] * p[0]
1389
- ], h = Math.sqrt(b[0] ** 2 + b[1] ** 2 + b[2] ** 2), N = h > 1e-10 ? [b[0] / h, b[1] / h, b[2] / h] : [0, 1, 0], g = o === "R" ? p : N, v = t * Math.PI / 180 * i, M = Math.cos(v), E = Math.sin(v), P = g[0] * a[0] + g[1] * a[1] + g[2] * a[2], C = [
1389
+ ], h = Math.sqrt(b[0] ** 2 + b[1] ** 2 + b[2] ** 2), N = h > 1e-10 ? [b[0] / h, b[1] / h, b[2] / h] : [0, 1, 0], g = o === "R" ? p : N, I = t * Math.PI / 180 * i, M = Math.cos(I), C = Math.sin(I), F = g[0] * a[0] + g[1] * a[1] + g[2] * a[2], D = [
1390
1390
  a[1] * g[2] - a[2] * g[1],
1391
1391
  a[2] * g[0] - a[0] * g[2],
1392
1392
  a[0] * g[1] - a[1] * g[0]
1393
- ], L = [
1394
- g[0] * M + C[0] * E + a[0] * P * (1 - M),
1395
- g[1] * M + C[1] * E + a[1] * P * (1 - M),
1396
- g[2] * M + C[2] * E + a[2] * P * (1 - M)
1397
- ], O = (90 - e) * Math.PI / 180, G = Math.cos(O), X = Math.sin(O), F = G * L[0] + X * a[0], U = G * L[1] + X * a[1], j = G * L[2] + X * a[2], A = Math.sqrt(F * F + U * U + j * j);
1398
- return A < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: F / A, ny: U / A, nz: j / A };
1399
- }
1400
- function Tn(e, t, n = {}) {
1393
+ ], k = [
1394
+ g[0] * M + D[0] * C + a[0] * F * (1 - M),
1395
+ g[1] * M + D[1] * C + a[1] * F * (1 - M),
1396
+ g[2] * M + D[2] * C + a[2] * F * (1 - M)
1397
+ ], O = (90 - e) * Math.PI / 180, G = Math.cos(O), X = Math.sin(O), L = G * k[0] + X * a[0], U = G * k[1] + X * a[1], H = G * k[2] + X * a[2], x = Math.sqrt(L * L + U * U + H * H);
1398
+ return x < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: L / x, ny: U / x, nz: H / x };
1399
+ }
1400
+ function wn(e, t, n = {}) {
1401
1401
  if (!(e != null && e.length) || !(t != null && t.length)) return [];
1402
1402
  const r = /* @__PURE__ */ new Map();
1403
1403
  for (const i of t) {
@@ -1412,46 +1412,164 @@ function Tn(e, t, n = {}) {
1412
1412
  if (!s) continue;
1413
1413
  const l = r.get(s);
1414
1414
  if (!l || l.length === 0) continue;
1415
- const c = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
1416
- if (!Number.isFinite(c)) continue;
1417
- const a = Ln(l, c);
1415
+ const u = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
1416
+ if (!Number.isFinite(u)) continue;
1417
+ const a = Ln(l, u);
1418
1418
  if (!a) continue;
1419
- const { x: u, y: m, z: d, dx: f, dy: p, dz: b } = a;
1419
+ const { x: c, y: m, z: d, dx: f, dy: p, dz: b } = a;
1420
1420
  let h, N, g;
1421
- const v = i.alpha != null ? Number(i.alpha) : null, M = i.beta != null ? Number(i.beta) : null;
1422
- if (Number.isFinite(v)) {
1423
- const E = Number.isFinite(M) ? M : 0, P = Fn(v, E, { dx: f, dy: p, dz: b }, n);
1424
- h = P.nx, N = P.ny, g = P.nz;
1421
+ const I = i.alpha != null ? Number(i.alpha) : null, M = i.beta != null ? Number(i.beta) : null;
1422
+ if (Number.isFinite(I)) {
1423
+ const C = Number.isFinite(M) ? M : 0, F = Tn(I, C, { dx: f, dy: p, dz: b }, n);
1424
+ h = F.nx, N = F.ny, g = F.nz;
1425
1425
  } else {
1426
- const E = i.dip != null ? Number(i.dip) : null, P = i.azimuth != null ? Number(i.azimuth) : null;
1427
- if (!Number.isFinite(E) || !Number.isFinite(P)) continue;
1428
- const C = E * Math.PI / 180, L = P * Math.PI / 180;
1429
- h = Math.sin(L) * Math.sin(C), N = Math.cos(L) * Math.sin(C), g = Math.cos(C);
1426
+ const C = i.dip != null ? Number(i.dip) : null, F = i.azimuth != null ? Number(i.azimuth) : null;
1427
+ if (!Number.isFinite(C) || !Number.isFinite(F)) continue;
1428
+ const D = C * Math.PI / 180, k = F * Math.PI / 180;
1429
+ h = Math.sin(k) * Math.sin(D), N = Math.cos(k) * Math.sin(D), g = Math.cos(D);
1430
1430
  }
1431
- o.push({ ...i, x: u, y: m, z: d, nx: h, ny: N, nz: g });
1431
+ o.push({ ...i, x: c, y: m, z: d, nx: h, ny: N, nz: g });
1432
1432
  }
1433
1433
  return o;
1434
1434
  }
1435
- const ot = "#8b1e3f", $n = "#a8324f", Vn = "#6b7280", wn = { l: 42, r: 4, t: 4, b: 30 }, it = 10, st = 12;
1436
- function lt(e) {
1435
+ const $n = "#7f7f7f", Le = {
1436
+ Au: "#FFD700",
1437
+ // gold
1438
+ Ag: "#C0C0C0",
1439
+ // silver
1440
+ Cu: "#B87333",
1441
+ // copper / orange-brown
1442
+ Fe: "#8B4513",
1443
+ // iron / rusty brown
1444
+ Ni: "#4CAF50",
1445
+ // nickel / green
1446
+ Zn: "#78909C",
1447
+ // zinc / blue-grey
1448
+ Pb: "#607D8B",
1449
+ // lead / slate
1450
+ Mo: "#9C27B0",
1451
+ // molybdenite / purple
1452
+ Co: "#2196F3",
1453
+ // cobalt / blue
1454
+ Li: "#FF5722",
1455
+ // lithium / deep orange
1456
+ Mn: "#795548",
1457
+ // manganese / brown
1458
+ Cr: "#009688",
1459
+ // chromium / teal
1460
+ V: "#673AB7",
1461
+ // vanadium / deep purple
1462
+ W: "#FF9800",
1463
+ // tungsten / amber
1464
+ Sn: "#9E9E9E",
1465
+ // tin / medium grey
1466
+ Ti: "#00BCD4",
1467
+ // titanium / cyan
1468
+ Al: "#FFEB3B",
1469
+ // aluminium / yellow
1470
+ U: "#8BC34A"
1471
+ // uranium / lime green
1472
+ }, Bn = {
1473
+ // Sedimentary
1474
+ shale: "#607D8B",
1475
+ mudstone: "#78909C",
1476
+ siltstone: "#90A4AE",
1477
+ sandstone: "#F5CBA7",
1478
+ limestone: "#B0BEC5",
1479
+ dolomite: "#CFD8DC",
1480
+ conglomerate: "#D7CCC8",
1481
+ coal: "#212121",
1482
+ // Iron-formation
1483
+ BIF: "#8B4513",
1484
+ ironstone: "#A0522D",
1485
+ // Igneous – intrusive
1486
+ granite: "#EF9A9A",
1487
+ granodiorite: "#F48FB1",
1488
+ diorite: "#CE93D8",
1489
+ gabbro: "#546E7A",
1490
+ peridotite: "#33691E",
1491
+ pegmatite: "#FFF9C4",
1492
+ // Igneous – extrusive / volcanic
1493
+ basalt: "#37474F",
1494
+ andesite: "#78909C",
1495
+ rhyolite: "#FFCCBC",
1496
+ dacite: "#FFAB91",
1497
+ tuff: "#D7CCC8",
1498
+ breccia: "#BCAAA4",
1499
+ // Metamorphic
1500
+ schist: "#80CBC4",
1501
+ gneiss: "#4DB6AC",
1502
+ quartzite: "#E0F7FA",
1503
+ marble: "#F5F5F5",
1504
+ slate: "#455A64",
1505
+ phyllite: "#80DEEA",
1506
+ // Other
1507
+ quartz: "#ECEFF1",
1508
+ calcite: "#F9FBE7",
1509
+ vein: "#FFFFFF",
1510
+ unknown: "#9E9E9E"
1511
+ }, je = {
1512
+ commodity: Le,
1513
+ lithology: Bn
1514
+ };
1515
+ function Vn(e, t, n = $n) {
1516
+ if (!t || e == null) return n;
1517
+ const r = String(e).trim();
1518
+ if (Object.prototype.hasOwnProperty.call(t, r)) return t[r];
1519
+ const o = r.toLowerCase();
1520
+ for (const [i, s] of Object.entries(t))
1521
+ if (String(i).trim().toLowerCase() === o) return s;
1522
+ return n;
1523
+ }
1524
+ function Hn(e) {
1525
+ if (e == null) return {};
1526
+ if (typeof e == "string") {
1527
+ const t = e.trim().toLowerCase();
1528
+ if (Object.prototype.hasOwnProperty.call(je, t))
1529
+ return je[t];
1530
+ const n = Object.keys(je).sort().join(", ");
1531
+ throw new RangeError(
1532
+ `Unknown built-in colour map '${e}'. Available maps: ${n}`
1533
+ );
1534
+ }
1535
+ if (typeof e == "object" && Object.getPrototypeOf(e) === Object.prototype) return e;
1536
+ throw new TypeError(
1537
+ `colourMap must be null, a string, or a plain object; got ${Array.isArray(e) ? "Array" : Object.prototype.toString.call(e)}`
1538
+ );
1539
+ }
1540
+ const jn = "#8b1e3f", Rn = "#a8324f";
1541
+ function Gn(e) {
1542
+ if (!e) return null;
1543
+ const t = e.split(/[_\-/\s]+/);
1544
+ for (const n of t) {
1545
+ if (Object.prototype.hasOwnProperty.call(Le, n))
1546
+ return Le[n];
1547
+ const r = n.toLowerCase();
1548
+ for (const [o, i] of Object.entries(Le))
1549
+ if (o.toLowerCase() === r) return i;
1550
+ }
1551
+ return null;
1552
+ }
1553
+ const Un = "#6b7280", Yn = { l: 42, r: 4, t: 4, b: 30 }, st = 10, lt = 12;
1554
+ function at(e) {
1437
1555
  return e ? typeof e == "string" ? { text: e } : e : {};
1438
1556
  }
1439
1557
  function St(e = {}) {
1440
- const t = lt(e.xaxis && e.xaxis.title), n = lt(e.yaxis && e.yaxis.title);
1558
+ const t = at(e.xaxis && e.xaxis.title), n = at(e.yaxis && e.yaxis.title);
1441
1559
  return {
1442
1560
  ...e,
1443
- margin: wn,
1561
+ margin: Yn,
1444
1562
  autosize: !0,
1445
1563
  width: void 0,
1446
1564
  xaxis: {
1447
1565
  ...e.xaxis || {},
1448
1566
  tickfont: {
1449
1567
  ...e.xaxis && e.xaxis.tickfont || {},
1450
- size: it
1568
+ size: st
1451
1569
  },
1452
1570
  title: {
1453
1571
  ...t,
1454
- font: { ...t.font || {}, size: st }
1572
+ font: { ...t.font || {}, size: lt }
1455
1573
  }
1456
1574
  },
1457
1575
  yaxis: {
@@ -1459,16 +1577,16 @@ function St(e = {}) {
1459
1577
  automargin: !0,
1460
1578
  tickfont: {
1461
1579
  ...e.yaxis && e.yaxis.tickfont || {},
1462
- size: it
1580
+ size: st
1463
1581
  },
1464
1582
  title: {
1465
1583
  ...n,
1466
- font: { ...n.font || {}, size: st }
1584
+ font: { ...n.font || {}, size: lt }
1467
1585
  }
1468
1586
  }
1469
1587
  };
1470
1588
  }
1471
- function Hn(e, t) {
1589
+ function qn(e, t) {
1472
1590
  var r;
1473
1591
  if (!e || !t) return !1;
1474
1592
  const n = e.points || [];
@@ -1479,40 +1597,40 @@ function Hn(e, t) {
1479
1597
  }
1480
1598
  return !1;
1481
1599
  }
1482
- function jn(e, t, n) {
1600
+ function Xn(e, t, n) {
1483
1601
  if (!e || !t) return [];
1484
1602
  const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
1485
1603
  return r.forEach((s) => {
1486
1604
  let l = Number(
1487
1605
  s.from ?? s.samp_from ?? s.sample_from ?? s.fromdepth ?? s.from_depth ?? s.depth_from
1488
- ), c = Number(
1606
+ ), u = Number(
1489
1607
  s.to ?? s.samp_to ?? s.sample_to ?? s.todepth ?? s.to_depth ?? s.depth_to
1490
1608
  );
1491
- if (!Number.isFinite(l) || !Number.isFinite(c)) {
1609
+ if (!Number.isFinite(l) || !Number.isFinite(u)) {
1492
1610
  const f = Number(s.depth ?? s.md);
1493
- Number.isFinite(f) && (l = f, c = f);
1611
+ Number.isFinite(f) && (l = f, u = f);
1494
1612
  }
1495
1613
  const a = s == null ? void 0 : s[t];
1496
- if (!Number.isFinite(l) || !Number.isFinite(c) || c < l || a == null || a === "" || n && typeof a == "string" && /^(nan|null|none)$/i.test(a.trim())) return;
1497
- const u = `${t}:${l}-${c}:${String(a)}`;
1498
- if (i.has(u)) return;
1499
- i.add(u);
1500
- const m = (l + c) / 2, d = n ? a : Number(a);
1614
+ if (!Number.isFinite(l) || !Number.isFinite(u) || u < l || a == null || a === "" || n && typeof a == "string" && /^(nan|null|none)$/i.test(a.trim())) return;
1615
+ const c = `${t}:${l}-${u}:${String(a)}`;
1616
+ if (i.has(c)) return;
1617
+ i.add(c);
1618
+ const m = (l + u) / 2, d = n ? a : Number(a);
1501
1619
  !n && !Number.isFinite(d) || o.push({
1502
1620
  z: m,
1503
1621
  val: d,
1504
1622
  from: l,
1505
- to: c,
1506
- errorPlus: c - m,
1623
+ to: u,
1624
+ errorPlus: u - m,
1507
1625
  errorMinus: m - l
1508
1626
  });
1509
1627
  }), o.sort((s, l) => l.z - s.z);
1510
1628
  }
1511
- function Bn(e, t) {
1629
+ function Wn(e, t, n) {
1512
1630
  if (!e.length) return { data: [], layout: {} };
1513
- const n = e.filter((c) => Number.isFinite(c == null ? void 0 : c.from) && Number.isFinite(c == null ? void 0 : c.to) && c.to > c.from).map((c) => ({ ...c, category: `${(c == null ? void 0 : c.val) ?? ""}`.trim() })).filter((c) => c.category !== "" && !/^(nan|null|none)$/i.test(c.category)).sort((c, a) => c.from - a.from || c.to - a.to);
1514
- if (!n.length) return { data: [], layout: {} };
1515
- const r = [
1631
+ const r = e.filter((m) => Number.isFinite(m == null ? void 0 : m.from) && Number.isFinite(m == null ? void 0 : m.to) && m.to > m.from).map((m) => ({ ...m, category: `${(m == null ? void 0 : m.val) ?? ""}`.trim() })).filter((m) => m.category !== "" && !/^(nan|null|none)$/i.test(m.category)).sort((m, d) => m.from - d.from || m.to - d.to);
1632
+ if (!r.length) return { data: [], layout: {} };
1633
+ const o = Hn(n), i = [
1516
1634
  "#1f77b4",
1517
1635
  // blue
1518
1636
  "#ff7f0e",
@@ -1541,20 +1659,30 @@ function Bn(e, t) {
1541
1659
  // violet
1542
1660
  "#636363"
1543
1661
  // dark gray
1544
- ], o = [...new Set(n.map((c) => c.category))], i = new Map(o.map((c, a) => [c, r[a % r.length]]));
1545
- return { data: o.map((c) => {
1546
- const a = n.filter((u) => u.category === c);
1662
+ ], s = [...new Set(r.map((m) => m.category))];
1663
+ function l(m, d) {
1664
+ if (o && Object.keys(o).length > 0) {
1665
+ const f = Vn(m, o, null);
1666
+ if (f !== null) return f;
1667
+ }
1668
+ return i[d % i.length];
1669
+ }
1670
+ const u = new Map(
1671
+ s.map((m, d) => [m, l(m, d)])
1672
+ );
1673
+ return { data: s.map((m) => {
1674
+ const d = r.filter((f) => f.category === m);
1547
1675
  return {
1548
1676
  type: "bar",
1549
- x: a.map(() => 0.5),
1550
- y: a.map((u) => u.to - u.from),
1551
- base: a.map((u) => u.from),
1677
+ x: d.map(() => 0.5),
1678
+ y: d.map((f) => f.to - f.from),
1679
+ base: d.map((f) => f.from),
1552
1680
  width: 1,
1553
- marker: { color: i.get(c), line: { width: 0 } },
1554
- name: c,
1681
+ marker: { color: u.get(m), line: { width: 0 } },
1682
+ name: m,
1555
1683
  showlegend: !1,
1556
- customdata: a.map((u) => [u.from, u.to]),
1557
- hovertemplate: `${t}: ${c}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
1684
+ customdata: d.map((f) => [f.from, f.to]),
1685
+ hovertemplate: `${t}: ${m}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
1558
1686
  };
1559
1687
  }), layout: St({
1560
1688
  barmode: "overlay",
@@ -1565,35 +1693,35 @@ function Bn(e, t) {
1565
1693
  title: t || void 0
1566
1694
  }) };
1567
1695
  }
1568
- function Rn(e, t, n) {
1696
+ function Zn(e, t, n, r) {
1569
1697
  if (!e.length) return { data: [], layout: {} };
1570
- const r = n === "bar", o = n === "markers", i = n === "line", s = {
1571
- x: e.map((u) => u.val),
1572
- y: e.map((u) => u.z),
1698
+ const o = n === "bar", i = n === "markers", s = n === "line", l = r || jn, u = r || Rn, a = {
1699
+ x: e.map((f) => f.val),
1700
+ y: e.map((f) => f.z),
1573
1701
  hovertemplate: `${t}: %{x}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
1574
- customdata: e.map((u) => [Math.min(u.from, u.to), Math.max(u.from, u.to)])
1575
- }, l = {
1702
+ customdata: e.map((f) => [Math.min(f.from, f.to), Math.max(f.from, f.to)])
1703
+ }, c = {
1576
1704
  type: "data",
1577
1705
  symmetric: !1,
1578
- array: e.map((u) => u.errorPlus),
1579
- arrayminus: e.map((u) => u.errorMinus),
1706
+ array: e.map((f) => f.errorPlus),
1707
+ arrayminus: e.map((f) => f.errorMinus),
1580
1708
  thickness: 1.5,
1581
1709
  width: 2,
1582
- color: Vn
1710
+ color: Un
1583
1711
  };
1584
- return { data: [r ? {
1585
- ...s,
1712
+ return { data: [o ? {
1713
+ ...a,
1586
1714
  type: "bar",
1587
1715
  orientation: "h",
1588
- marker: { color: ot },
1589
- error_y: l
1716
+ marker: { color: l },
1717
+ error_y: c
1590
1718
  } : {
1591
- ...s,
1719
+ ...a,
1592
1720
  type: "scatter",
1593
- mode: o ? "markers" : i ? "lines" : "lines+markers",
1594
- line: { color: ot, width: 2 },
1595
- marker: { size: 7, color: $n },
1596
- error_y: i ? void 0 : l
1721
+ mode: i ? "markers" : s ? "lines" : "lines+markers",
1722
+ line: { color: l, width: 2 },
1723
+ marker: { size: 7, color: u },
1724
+ error_y: s ? void 0 : c
1597
1725
  }], layout: St({
1598
1726
  xaxis: { title: t, zeroline: !1 },
1599
1727
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
@@ -1601,35 +1729,41 @@ function Rn(e, t, n) {
1601
1729
  showlegend: !1
1602
1730
  }) };
1603
1731
  }
1604
- function Dt({ points: e, isCategorical: t, property: n, chartType: r }) {
1605
- return !e || !e.length || !n ? { data: [], layout: {} } : t || r === "categorical" ? Bn(e, n) : Rn(e, n, r);
1732
+ function Ft({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o }) {
1733
+ if (!e || !e.length || !n) return { data: [], layout: {} };
1734
+ if (t || r === "categorical")
1735
+ return Wn(e, n, o);
1736
+ const i = Gn(n);
1737
+ return Zn(e, n, r, i);
1606
1738
  }
1607
- function ko(e = [], {
1739
+ function Bo(e = [], {
1608
1740
  fromCol: t = "from",
1609
1741
  toCol: n = "to",
1610
- categoryCol: r = "geology_code"
1742
+ categoryCol: r = "geology_code",
1743
+ colourMap: o = null
1611
1744
  } = {}) {
1612
- const o = [];
1613
- return e.forEach((i) => {
1614
- const s = Number(i == null ? void 0 : i[t]), l = Number(i == null ? void 0 : i[n]), c = i == null ? void 0 : i[r];
1615
- if (!Number.isFinite(s) || !Number.isFinite(l) || l <= s || c == null || `${c}`.trim() === "") return;
1616
- const a = (s + l) / 2;
1617
- o.push({
1618
- z: a,
1619
- val: `${c}`,
1620
- from: s,
1621
- to: l,
1622
- errorPlus: l - a,
1623
- errorMinus: a - s
1745
+ const i = [];
1746
+ return e.forEach((s) => {
1747
+ const l = Number(s == null ? void 0 : s[t]), u = Number(s == null ? void 0 : s[n]), a = s == null ? void 0 : s[r];
1748
+ if (!Number.isFinite(l) || !Number.isFinite(u) || u <= l || a == null || `${a}`.trim() === "") return;
1749
+ const c = (l + u) / 2;
1750
+ i.push({
1751
+ z: c,
1752
+ val: `${a}`,
1753
+ from: l,
1754
+ to: u,
1755
+ errorPlus: u - c,
1756
+ errorMinus: c - l
1624
1757
  });
1625
- }), o.sort((i, s) => s.z - i.z), Dt({
1626
- points: o,
1758
+ }), i.sort((s, l) => l.z - s.z), Ft({
1759
+ points: i,
1627
1760
  isCategorical: !0,
1628
1761
  property: r,
1629
- chartType: "categorical"
1762
+ chartType: "categorical",
1763
+ colourMap: o
1630
1764
  });
1631
1765
  }
1632
- const Pt = [
1766
+ const Dt = [
1633
1767
  "#0f172a",
1634
1768
  "#1e3a5f",
1635
1769
  "#7c3aed",
@@ -1640,24 +1774,24 @@ const Pt = [
1640
1774
  "#db2777",
1641
1775
  "#65a30d",
1642
1776
  "#9333ea"
1643
- ], Gn = { l: 42, r: 4, t: 4, b: 30 }, at = 10, ct = 12;
1644
- function Ct(e = {}) {
1777
+ ], Kn = { l: 42, r: 4, t: 4, b: 30 }, ct = 10, ut = 12;
1778
+ function Pt(e = {}) {
1645
1779
  return {
1646
1780
  ...e,
1647
- margin: Gn,
1781
+ margin: Kn,
1648
1782
  autosize: !0,
1649
1783
  width: void 0,
1650
1784
  xaxis: {
1651
1785
  ...e.xaxis || {},
1652
1786
  tickfont: {
1653
1787
  ...e.xaxis && e.xaxis.tickfont || {},
1654
- size: at
1788
+ size: ct
1655
1789
  },
1656
1790
  title: {
1657
1791
  ...e.xaxis && e.xaxis.title || {},
1658
1792
  font: {
1659
1793
  ...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
1660
- size: ct
1794
+ size: ut
1661
1795
  }
1662
1796
  }
1663
1797
  },
@@ -1666,49 +1800,49 @@ function Ct(e = {}) {
1666
1800
  automargin: !0,
1667
1801
  tickfont: {
1668
1802
  ...e.yaxis && e.yaxis.tickfont || {},
1669
- size: at
1803
+ size: ct
1670
1804
  },
1671
1805
  title: {
1672
1806
  ...e.yaxis && e.yaxis.title || {},
1673
1807
  font: {
1674
1808
  ...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
1675
- size: ct
1809
+ size: ut
1676
1810
  }
1677
1811
  }
1678
1812
  }
1679
1813
  };
1680
1814
  }
1681
- function Un(e, {
1815
+ function Jn(e, {
1682
1816
  tailScale: t = 5,
1683
1817
  colorBy: n = null,
1684
- palette: r = Pt,
1818
+ palette: r = Dt,
1685
1819
  depthCol: o = q,
1686
1820
  dipCol: i = R,
1687
- azCol: s = B
1821
+ azCol: s = j
1688
1822
  } = {}) {
1689
1823
  const l = e.filter(
1690
1824
  (p) => p[o] != null && p[i] != null && p[s] != null
1691
1825
  );
1692
1826
  if (!l.length)
1693
1827
  return { data: [], layout: {} };
1694
- const c = {};
1828
+ const u = {};
1695
1829
  n && [...new Set(l.map((b) => b[n]).filter((b) => b != null))].sort().forEach((b, h) => {
1696
- c[b] = r[h % r.length];
1830
+ u[b] = r[h % r.length];
1697
1831
  });
1698
- const a = /* @__PURE__ */ new Map(), u = [];
1832
+ const a = /* @__PURE__ */ new Map(), c = [];
1699
1833
  for (const p of l) {
1700
- const b = Number(p[o]), h = Number(p[i]), N = Number(p[s]), g = n ? p[n] ?? "_default" : "_default", v = n ? c[g] ?? "#0f172a" : "#0f172a";
1701
- a.has(g) || a.set(g, { xs: [], ys: [], dips: [], azs: [], color: v });
1834
+ const b = Number(p[o]), h = Number(p[i]), N = Number(p[s]), g = n ? p[n] ?? "_default" : "_default", I = n ? u[g] ?? "#0f172a" : "#0f172a";
1835
+ a.has(g) || a.set(g, { xs: [], ys: [], dips: [], azs: [], color: I });
1702
1836
  const M = a.get(g);
1703
1837
  M.xs.push(h), M.ys.push(b), M.dips.push(h), M.azs.push(N);
1704
- const E = N * Math.PI / 180, P = t * (Math.abs(h) / 90), C = Math.sin(E) * P, L = Math.cos(E) * P;
1705
- u.push({
1838
+ const C = N * Math.PI / 180, F = t * (Math.abs(h) / 90), D = Math.sin(C) * F, k = Math.cos(C) * F;
1839
+ c.push({
1706
1840
  type: "line",
1707
1841
  x0: h,
1708
1842
  y0: b,
1709
- x1: h + C,
1710
- y1: b + L,
1711
- line: { color: v, width: 2 }
1843
+ x1: h + D,
1844
+ y1: b + k,
1845
+ line: { color: I, width: 2 }
1712
1846
  });
1713
1847
  }
1714
1848
  const m = [], d = n && a.size > 1;
@@ -1725,7 +1859,7 @@ function Un(e, {
1725
1859
  hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
1726
1860
  });
1727
1861
  return { data: m, layout: {
1728
- shapes: u,
1862
+ shapes: c,
1729
1863
  height: 400,
1730
1864
  margin: { l: 40, r: 10, t: 10, b: 40 },
1731
1865
  xaxis: {
@@ -1739,11 +1873,11 @@ function Un(e, {
1739
1873
  showlegend: !!d
1740
1874
  } };
1741
1875
  }
1742
- function Oo(e, {
1876
+ function Vo(e, {
1743
1877
  labelCol: t = "structure_type",
1744
- palette: n = Pt,
1745
- fromCol: r = S,
1746
- toCol: o = D
1878
+ palette: n = Dt,
1879
+ fromCol: r = v,
1880
+ toCol: o = S
1747
1881
  } = {}) {
1748
1882
  const i = e.filter((m) => m[r] != null && m[o] != null && Number(m[o]) > Number(m[r])).filter((m) => {
1749
1883
  const d = m[t];
@@ -1753,7 +1887,7 @@ function Oo(e, {
1753
1887
  }).map((m) => ({ from: Number(m[r]), to: Number(m[o]), label: String(m[t]).trim() })).sort((m, d) => m.from - d.from);
1754
1888
  if (!i.length)
1755
1889
  return { data: [], layout: {} };
1756
- const s = [], l = [], c = [];
1890
+ const s = [], l = [], u = [];
1757
1891
  return i.forEach((m, d) => {
1758
1892
  s.push({
1759
1893
  type: "rect",
@@ -1766,17 +1900,17 @@ function Oo(e, {
1766
1900
  fillcolor: n[d % n.length],
1767
1901
  line: { width: 0 },
1768
1902
  layer: "below"
1769
- }), l.push(0.5 * (m.from + m.to)), c.push(m.label);
1903
+ }), l.push(0.5 * (m.from + m.to)), u.push(m.label);
1770
1904
  }), { data: [{
1771
1905
  type: "scatter",
1772
- x: Array(c.length).fill(0.5),
1906
+ x: Array(u.length).fill(0.5),
1773
1907
  y: l,
1774
1908
  mode: "text",
1775
- text: c,
1909
+ text: u,
1776
1910
  textposition: "middle center",
1777
1911
  showlegend: !1,
1778
1912
  hoverinfo: "text"
1779
- }], layout: Ct({
1913
+ }], layout: Pt({
1780
1914
  shapes: s,
1781
1915
  height: 400,
1782
1916
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
@@ -1784,7 +1918,7 @@ function Oo(e, {
1784
1918
  showlegend: !1
1785
1919
  }) };
1786
1920
  }
1787
- function ut(e, t) {
1921
+ function mt(e, t) {
1788
1922
  if (!e) return "";
1789
1923
  const n = String(e).trim().split(/\s+/), r = [];
1790
1924
  let o = "";
@@ -1792,23 +1926,23 @@ function ut(e, t) {
1792
1926
  o && o.length + 1 + i.length > t ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
1793
1927
  return o && r.push(o), r.join("<br>");
1794
1928
  }
1795
- function Yn(e, {
1929
+ function Qn(e, {
1796
1930
  commentCol: t = "comments",
1797
- fromCol: n = S,
1798
- toCol: r = D,
1931
+ fromCol: n = v,
1932
+ toCol: r = S,
1799
1933
  bgColor: o = "#f1f5f9",
1800
1934
  borderColor: i = "#cbd5e1",
1801
1935
  textColor: s = "#1e293b",
1802
1936
  charsPerLine: l = 18
1803
1937
  } = {}) {
1804
- const c = e.filter((h) => h[n] != null && h[r] != null && Number(h[r]) > Number(h[n])).map((h) => {
1938
+ const u = e.filter((h) => h[n] != null && h[r] != null && Number(h[r]) > Number(h[n])).map((h) => {
1805
1939
  const N = h[t], g = N != null && String(N).trim() !== "" && String(N) !== "null" ? String(N).trim() : "";
1806
1940
  return { from: Number(h[n]), to: Number(h[r]), comment: g };
1807
1941
  }).sort((h, N) => h.from - N.from);
1808
- if (!c.length)
1942
+ if (!u.length)
1809
1943
  return { data: [], layout: {} };
1810
- const a = [], u = [], m = [], d = [], f = [];
1811
- for (const h of c) {
1944
+ const a = [], c = [], m = [], d = [], f = [];
1945
+ for (const h of u) {
1812
1946
  const N = 0.5 * (h.from + h.to), g = !!h.comment;
1813
1947
  a.push({
1814
1948
  type: "rect",
@@ -1821,11 +1955,11 @@ function Yn(e, {
1821
1955
  fillcolor: g ? o : "rgba(0,0,0,0)",
1822
1956
  line: { color: i, width: 1 },
1823
1957
  layer: "below"
1824
- }), g && (u.push(0.5), m.push(N), d.push(ut(h.comment, l)), f.push(`${h.from.toFixed(3)}–${h.to.toFixed(3)} m<br>${ut(h.comment, 40)}`));
1958
+ }), g && (c.push(0.5), m.push(N), d.push(mt(h.comment, l)), f.push(`${h.from.toFixed(3)}–${h.to.toFixed(3)} m<br>${mt(h.comment, 40)}`));
1825
1959
  }
1826
- return { data: u.length ? [{
1960
+ return { data: c.length ? [{
1827
1961
  type: "scatter",
1828
- x: u,
1962
+ x: c,
1829
1963
  y: m,
1830
1964
  mode: "text",
1831
1965
  text: d,
@@ -1834,7 +1968,7 @@ function Yn(e, {
1834
1968
  hovertext: f,
1835
1969
  hoverinfo: "text",
1836
1970
  showlegend: !1
1837
- }] : [], layout: Ct({
1971
+ }] : [], layout: Pt({
1838
1972
  shapes: a,
1839
1973
  height: 400,
1840
1974
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
@@ -1842,16 +1976,16 @@ function Yn(e, {
1842
1976
  showlegend: !1
1843
1977
  }) };
1844
1978
  }
1845
- function Lo(e, {
1979
+ function Ho(e, {
1846
1980
  symbolSize: t = 10,
1847
1981
  xCol: n = "easting",
1848
1982
  yCol: r = "northing"
1849
1983
  } = {}) {
1850
- const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[R] != null ? Number(e[R]) : null, l = e[B] != null ? Number(e[B]) : null;
1984
+ const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[R] != null ? Number(e[R]) : null, l = e[j] != null ? Number(e[j]) : null;
1851
1985
  if (o === null || i === null || s === null || l === null) return null;
1852
- const c = (l - 90 + 360) % 360, a = c * Math.PI / 180, u = l * Math.PI / 180, m = t * Math.sin(a), d = t * Math.cos(a), f = t * 0.4 * (s / 90), p = f * Math.sin(u), b = f * Math.cos(u);
1986
+ const u = (l - 90 + 360) % 360, a = u * Math.PI / 180, c = l * Math.PI / 180, m = t * Math.sin(a), d = t * Math.cos(a), f = t * 0.4 * (s / 90), p = f * Math.sin(c), b = f * Math.cos(c);
1853
1987
  return {
1854
- strike: c,
1988
+ strike: u,
1855
1989
  dipValue: s,
1856
1990
  x: o,
1857
1991
  y: i,
@@ -1863,32 +1997,32 @@ function Lo(e, {
1863
1997
  tickY1: i + b
1864
1998
  };
1865
1999
  }
1866
- const kt = "markers+line";
1867
- function qn(e, t) {
2000
+ const Ot = "markers+line";
2001
+ function er(e, t) {
1868
2002
  var r;
1869
- const n = Ye(e);
1870
- return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || kt;
2003
+ const n = Xe(e);
2004
+ return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || Ot;
1871
2005
  }
1872
- function Fo({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o }) {
1873
- const i = pt(null), s = t == null ? void 0 : t.hole, l = (t == null ? void 0 : t.points) || [], c = (e == null ? void 0 : e.property) || "", a = (e == null ? void 0 : e.chartType) || kt, u = (e == null ? void 0 : e.holeId) || "", m = (t == null ? void 0 : t.displayType) || (t != null && t.isComment ? xe : t != null && t.isCategorical ? Se : Ie), d = Ye(m), f = qn(m, a), [p, b] = J("");
2006
+ function jo({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o }) {
2007
+ const i = bt(null), s = t == null ? void 0 : t.hole, l = (t == null ? void 0 : t.points) || [], u = (e == null ? void 0 : e.property) || "", a = (e == null ? void 0 : e.chartType) || Ot, c = (e == null ? void 0 : e.holeId) || "", m = (t == null ? void 0 : t.displayType) || (t != null && t.isComment ? Ee : t != null && t.isCategorical ? ve : Ae), d = Xe(m), f = er(m, a), [p, b] = J("");
1874
2008
  return me(() => {
1875
- const h = m === xe, N = m === Ge;
1876
- if (!s || !c || !h && !N && l.length === 0) return;
2009
+ const h = m === Ee, N = m === Ye;
2010
+ if (!s || !u || !h && !N && l.length === 0) return;
1877
2011
  const g = i.current;
1878
2012
  if (!g) return;
1879
- let v;
2013
+ let I;
1880
2014
  try {
1881
- h ? v = Yn(l, { commentCol: c, fromCol: "from", toCol: "to" }) : N ? v = Un(l) : v = Dt({
2015
+ h ? I = Qn(l, { commentCol: u, fromCol: "from", toCol: "to" }) : N ? I = Jn(l) : I = Ft({
1882
2016
  points: l,
1883
- isCategorical: m === Se,
1884
- property: c,
2017
+ isCategorical: m === ve,
2018
+ property: u,
1885
2019
  chartType: f
1886
2020
  });
1887
- } catch (E) {
1888
- console.error("Plot build error", E), b((E == null ? void 0 : E.message) || "Plot build error");
2021
+ } catch (C) {
2022
+ console.error("Plot build error", C), b((C == null ? void 0 : C.message) || "Plot build error");
1889
2023
  return;
1890
2024
  }
1891
- if ((!(v != null && v.data) || v.data.length === 0) && !h)
2025
+ if ((!(I != null && I.data) || I.data.length === 0) && !h)
1892
2026
  return;
1893
2027
  const M = {
1894
2028
  displayModeBar: !0,
@@ -1897,71 +2031,71 @@ function Fo({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [],
1897
2031
  modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
1898
2032
  };
1899
2033
  try {
1900
- b(""), Pe.react(g, v.data, v.layout, M), requestAnimationFrame(() => {
1901
- g && g.parentElement && Pe.Plots.resize(g);
2034
+ b(""), Fe.react(g, I.data, I.layout, M), requestAnimationFrame(() => {
2035
+ g && g.parentElement && Fe.Plots.resize(g);
1902
2036
  });
1903
- } catch (E) {
1904
- console.error("Plot render error", E), b((E == null ? void 0 : E.message) || "Plot render error");
2037
+ } catch (C) {
2038
+ console.error("Plot render error", C), b((C == null ? void 0 : C.message) || "Plot render error");
1905
2039
  }
1906
2040
  return () => {
1907
2041
  if (g)
1908
2042
  try {
1909
- Pe.purge(g);
1910
- } catch (E) {
1911
- console.warn("Plot purge error", E);
2043
+ Fe.purge(g);
2044
+ } catch (C) {
2045
+ console.warn("Plot purge error", C);
1912
2046
  }
1913
2047
  };
1914
- }, [s, c, f, m, l]), me(() => {
2048
+ }, [s, u, f, m, l]), me(() => {
1915
2049
  const h = i.current;
1916
2050
  if (!h || typeof ResizeObserver > "u") return;
1917
2051
  const N = new ResizeObserver(() => {
1918
2052
  try {
1919
- h && h.data && Pe.Plots.resize(h);
2053
+ h && h.data && Fe.Plots.resize(h);
1920
2054
  } catch (g) {
1921
2055
  console.warn("Plot resize error", g);
1922
2056
  }
1923
2057
  });
1924
2058
  return N.observe(h), () => N.disconnect();
1925
- }, []), !s || !c ? /* @__PURE__ */ $("div", { className: "plot-card empty", children: /* @__PURE__ */ $("div", { className: "placeholder", children: e != null && e.holeId ? t != null && t.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : m !== xe && m !== Ge && l.length === 0 ? /* @__PURE__ */ $("div", { className: "plot-card empty", children: /* @__PURE__ */ $("div", { className: "placeholder", children: "No data" }) }) : p ? /* @__PURE__ */ $("div", { className: "plot-card empty", children: /* @__PURE__ */ Q("div", { className: "placeholder", children: [
2059
+ }, []), !s || !u ? /* @__PURE__ */ w("div", { className: "plot-card empty", children: /* @__PURE__ */ w("div", { className: "placeholder", children: e != null && e.holeId ? t != null && t.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : m !== Ee && m !== Ye && l.length === 0 ? /* @__PURE__ */ w("div", { className: "plot-card empty", children: /* @__PURE__ */ w("div", { className: "placeholder", children: "No data" }) }) : p ? /* @__PURE__ */ w("div", { className: "plot-card empty", children: /* @__PURE__ */ Q("div", { className: "placeholder", children: [
1926
2060
  "Plot error: ",
1927
2061
  p
1928
2062
  ] }) }) : /* @__PURE__ */ Q("div", { className: "plot-card", children: [
1929
- /* @__PURE__ */ $("div", { className: "plot-title", children: /* @__PURE__ */ $(
2063
+ /* @__PURE__ */ w("div", { className: "plot-title", children: /* @__PURE__ */ w(
1930
2064
  "select",
1931
2065
  {
1932
2066
  className: "plot-select",
1933
- value: u,
2067
+ value: c,
1934
2068
  onChange: (h) => o && o({ holeId: h.target.value }),
1935
2069
  children: n.map((h) => {
1936
2070
  const N = typeof h == "string" ? h : h.holeId, g = typeof h == "string" ? h : h.label || h.holeId;
1937
- return /* @__PURE__ */ $("option", { value: N, children: g }, N);
2071
+ return /* @__PURE__ */ w("option", { value: N, children: g }, N);
1938
2072
  })
1939
2073
  }
1940
2074
  ) }),
1941
2075
  /* @__PURE__ */ Q("div", { className: "plot-controls column", children: [
1942
- r.length > 0 && /* @__PURE__ */ $(
2076
+ r.length > 0 && /* @__PURE__ */ w(
1943
2077
  "select",
1944
2078
  {
1945
2079
  className: "plot-select",
1946
- value: c,
2080
+ value: u,
1947
2081
  onChange: (h) => o && o({ property: h.target.value }),
1948
- children: r.map((h) => /* @__PURE__ */ $("option", { value: h, children: h }, h))
2082
+ children: r.map((h) => /* @__PURE__ */ w("option", { value: h, children: h }, h))
1949
2083
  }
1950
2084
  ),
1951
- d.length > 1 && /* @__PURE__ */ $(
2085
+ d.length > 1 && /* @__PURE__ */ w(
1952
2086
  "select",
1953
2087
  {
1954
2088
  className: "plot-select",
1955
2089
  value: f,
1956
2090
  onChange: (h) => o && o({ chartType: h.target.value }),
1957
- children: d.map((h) => /* @__PURE__ */ $("option", { value: h.value, children: h.label }, h.value))
2091
+ children: d.map((h) => /* @__PURE__ */ w("option", { value: h.value, children: h.label }, h.value))
1958
2092
  }
1959
2093
  )
1960
2094
  ] }),
1961
- /* @__PURE__ */ $("div", { className: "plotly-chart", ref: i })
2095
+ /* @__PURE__ */ w("div", { className: "plotly-chart", ref: i })
1962
2096
  ] });
1963
2097
  }
1964
- function mt(e, t) {
2098
+ function dt(e, t) {
1965
2099
  if (!(t != null && t.length)) return e;
1966
2100
  const n = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
1967
2101
  for (const r of t) {
@@ -1975,7 +2109,7 @@ function mt(e, t) {
1975
2109
  }
1976
2110
  return Array.from(n.values());
1977
2111
  }
1978
- function Xn(e, t) {
2112
+ function tr(e, t) {
1979
2113
  if (!e || !t) return [];
1980
2114
  const n = /* @__PURE__ */ new Set(), r = [];
1981
2115
  for (const o of e.points || []) {
@@ -1986,146 +2120,146 @@ function Xn(e, t) {
1986
2120
  }
1987
2121
  return r;
1988
2122
  }
1989
- function To({
2123
+ function Ro({
1990
2124
  initialFocusedHoleId: e = "",
1991
2125
  sourceFile: t = null,
1992
2126
  extraHoles: n = [],
1993
2127
  plotCount: r = 4
1994
2128
  } = {}) {
1995
- const [o, i] = J([]), [s, l] = J([]), [c, a] = J([]), [u, m] = J([]), [d, f] = J([]), [p, b] = J({}), [h, N] = J(""), [g, v] = J([]), [M, E] = J(""), [P, C] = J(e || ""), [L, O] = J([]), G = pt(null);
2129
+ const [o, i] = J([]), [s, l] = J([]), [u, a] = J([]), [c, m] = J([]), [d, f] = J([]), [p, b] = J({}), [h, N] = J(""), [g, I] = J([]), [M, C] = J(""), [F, D] = J(e || ""), [k, O] = J([]), G = bt(null);
1996
2130
  me(() => {
1997
- !t || G.current === t || (G.current = t, hn(t).then((A) => {
1998
- if (!A) return;
1999
- const x = Array.from(new Map(A.map((_) => [_.holeId, _])).values());
2000
- l(x), v(xt({
2001
- holeIds: x.map((_) => _.holeId),
2002
- focusedHoleId: P,
2131
+ !t || G.current === t || (G.current = t, pn(t).then((x) => {
2132
+ if (!x) return;
2133
+ const E = Array.from(new Map(x.map((_) => [_.holeId, _])).values());
2134
+ l(E), I(At({
2135
+ holeIds: E.map((_) => _.holeId),
2136
+ focusedHoleId: F,
2003
2137
  plotCount: r,
2004
2138
  defaultProp: "",
2005
- categoricalProps: u,
2139
+ categoricalProps: c,
2006
2140
  commentProps: d,
2007
2141
  numericDefaultChartType: "markers+line"
2008
2142
  }));
2009
- }).catch((A) => {
2010
- console.info("Assay metadata load skipped:", A.message);
2143
+ }).catch((x) => {
2144
+ console.info("Assay metadata load skipped:", x.message);
2011
2145
  }));
2012
- }, [t, P, r, u, d]), me(() => {
2146
+ }, [t, F, r, c, d]), me(() => {
2013
2147
  if (!(n != null && n.length)) return;
2014
- const A = n.map((x) => ({ holeId: x.id || x.holeId })).filter((x) => x.holeId);
2015
- l((x) => {
2016
- const _ = new Set(x.map((I) => I.holeId)), k = A.filter((I) => !_.has(I.holeId));
2017
- return k.length ? [...x, ...k] : x;
2148
+ const x = n.map((E) => ({ holeId: E.id || E.holeId })).filter((E) => E.holeId);
2149
+ l((E) => {
2150
+ const _ = new Set(E.map((A) => A.holeId)), P = x.filter((A) => !_.has(A.holeId));
2151
+ return P.length ? [...E, ...P] : E;
2018
2152
  });
2019
2153
  }, [n]), me(() => {
2020
- E((A) => A && A.startsWith("Loading ") && A.includes(" for hole ") ? A : "");
2154
+ C((x) => x && x.startsWith("Loading ") && x.includes(" for hole ") ? x : "");
2021
2155
  }, [g]), me(() => {
2022
2156
  if (!s.length) {
2023
- v([]);
2157
+ I([]);
2024
2158
  return;
2025
2159
  }
2026
- const A = Mt(s.map((x) => x.holeId), P);
2027
- v((x) => Array.from({ length: r }).map((k, I) => {
2160
+ const x = Et(s.map((E) => E.holeId), F);
2161
+ I((E) => Array.from({ length: r }).map((P, A) => {
2028
2162
  var W;
2029
- const V = x[I] || {}, w = s.some((re) => re.holeId === V.holeId) ? V.holeId : A[I] || ((W = s[I]) == null ? void 0 : W.holeId) || "", T = V.property || h, Y = ke({
2163
+ const $ = E[A] || {}, B = s.some((re) => re.holeId === $.holeId) ? $.holeId : x[A] || ((W = s[A]) == null ? void 0 : W.holeId) || "", T = $.property || h, Y = Pe({
2030
2164
  property: T,
2031
- chartType: V.chartType,
2032
- categoricalProps: u,
2165
+ chartType: $.chartType,
2166
+ categoricalProps: c,
2033
2167
  commentProps: d,
2034
2168
  numericDefaultChartType: "markers+line"
2035
2169
  });
2036
- return { holeId: w, property: T, chartType: Y };
2170
+ return { holeId: B, property: T, chartType: Y };
2037
2171
  }));
2038
- }, [s, P, h, u, d, r]), me(() => {
2172
+ }, [s, F, h, c, d, r]), me(() => {
2039
2173
  if (!t) return;
2040
- g.map((x) => x.holeId).filter(Boolean).forEach((x) => {
2041
- const _ = o.some((I) => (I.id || I.holeId) === x), k = L.includes(x);
2042
- _ || k || (O((I) => [...I, x]), pn(t, x).then((I) => {
2043
- O((V) => V.filter((w) => w !== x)), I && i((V) => {
2044
- const w = mt(
2045
- [...V.filter((Y) => (Y.id || Y.holeId) !== x), I],
2174
+ g.map((E) => E.holeId).filter(Boolean).forEach((E) => {
2175
+ const _ = o.some((A) => (A.id || A.holeId) === E), P = k.includes(E);
2176
+ _ || P || (O((A) => [...A, E]), bn(t, E).then((A) => {
2177
+ O(($) => $.filter((B) => B !== E)), A && i(($) => {
2178
+ const B = dt(
2179
+ [...$.filter((Y) => (Y.id || Y.holeId) !== E), A],
2046
2180
  n
2047
- ), T = Le(w);
2048
- return a(T.numericProps), m(T.categoricalProps), f(T.commentProps), b(T.columnMeta), !h && T.defaultProp && (N(T.defaultProp), v((Y) => Y.map((W) => ({
2181
+ ), T = ke(B);
2182
+ return a(T.numericProps), m(T.categoricalProps), f(T.commentProps), b(T.columnMeta), !h && T.defaultProp && (N(T.defaultProp), I((Y) => Y.map((W) => ({
2049
2183
  ...W,
2050
2184
  property: W.property || T.defaultProp,
2051
- chartType: ke({
2185
+ chartType: Pe({
2052
2186
  property: W.property || T.defaultProp,
2053
2187
  chartType: W.chartType,
2054
2188
  categoricalProps: T.categoricalProps,
2055
2189
  commentProps: T.commentProps,
2056
2190
  numericDefaultChartType: "markers+line"
2057
2191
  })
2058
- })))), w;
2192
+ })))), B;
2059
2193
  });
2060
- }).catch((I) => {
2061
- console.error(I), O((V) => V.filter((w) => w !== x)), E(I.message || `Error loading hole ${x}`);
2194
+ }).catch((A) => {
2195
+ console.error(A), O(($) => $.filter((B) => B !== E)), C(A.message || `Error loading hole ${E}`);
2062
2196
  }));
2063
2197
  });
2064
- }, [g, t, o, L, h, n]), me(() => {
2065
- n != null && n.length && i((A) => {
2066
- if (!A.length) {
2067
- const k = Le(n);
2068
- return a(k.numericProps), m(k.categoricalProps), f(k.commentProps), b(k.columnMeta), !h && k.defaultProp && N(k.defaultProp), n;
2198
+ }, [g, t, o, k, h, n]), me(() => {
2199
+ n != null && n.length && i((x) => {
2200
+ if (!x.length) {
2201
+ const P = ke(n);
2202
+ return a(P.numericProps), m(P.categoricalProps), f(P.commentProps), b(P.columnMeta), !h && P.defaultProp && N(P.defaultProp), n;
2069
2203
  }
2070
- const x = mt(A, n), _ = Le(x);
2071
- return a(_.numericProps), m(_.categoricalProps), f(_.commentProps), b(_.columnMeta), !h && _.defaultProp && N(_.defaultProp), x;
2204
+ const E = dt(x, n), _ = ke(E);
2205
+ return a(_.numericProps), m(_.categoricalProps), f(_.commentProps), b(_.columnMeta), !h && _.defaultProp && N(_.defaultProp), E;
2072
2206
  });
2073
2207
  }, [n]);
2074
- const X = we(
2075
- () => [...c, ...u, ...d],
2076
- [c, u, d]
2077
- ), F = we(
2078
- () => s.map((A) => ({ holeId: A.holeId, label: A.holeId })).sort((A, x) => A.label.localeCompare(x.label)),
2208
+ const X = Ve(
2209
+ () => [...u, ...c, ...d],
2210
+ [u, c, d]
2211
+ ), L = Ve(
2212
+ () => s.map((x) => ({ holeId: x.holeId, label: x.holeId })).sort((x, E) => x.label.localeCompare(E.label)),
2079
2213
  [s]
2080
- ), U = we(() => {
2081
- const A = [...c, ...u, ...d];
2082
- return Array.from({ length: r }).map((x, _) => {
2083
- const k = g[_] || {}, I = o.find((ue) => (ue.id || ue.holeId) === k.holeId) || null, V = I ? A.filter((ue) => Hn(I, ue)) : A;
2084
- let w = k.property || h;
2085
- I && !V.includes(w) && (w = V[0] || w);
2086
- const T = d.includes(w), Y = !T && u.includes(w), W = !T && !Y && w === "dip", re = T ? "comment" : W ? "tadpole" : Y ? "categorical" : "numeric", pe = W ? "tadpole" : k.chartType || (T ? "comment" : Y ? "categorical" : "markers+line"), ce = k.holeId || (I == null ? void 0 : I.id) || (I == null ? void 0 : I.holeId) || "", ve = W ? (I == null ? void 0 : I.points) || [] : T ? Xn(I, w) : jn(I, w, Y);
2214
+ ), U = Ve(() => {
2215
+ const x = [...u, ...c, ...d];
2216
+ return Array.from({ length: r }).map((E, _) => {
2217
+ const P = g[_] || {}, A = o.find((ue) => (ue.id || ue.holeId) === P.holeId) || null, $ = A ? x.filter((ue) => qn(A, ue)) : x;
2218
+ let B = P.property || h;
2219
+ A && !$.includes(B) && (B = $[0] || B);
2220
+ const T = d.includes(B), Y = !T && c.includes(B), W = !T && !Y && B === "dip", re = T ? "comment" : W ? "tadpole" : Y ? "categorical" : "numeric", pe = W ? "tadpole" : P.chartType || (T ? "comment" : Y ? "categorical" : "markers+line"), ce = P.holeId || (A == null ? void 0 : A.id) || (A == null ? void 0 : A.holeId) || "", Ie = W ? (A == null ? void 0 : A.points) || [] : T ? tr(A, B) : Xn(A, B, Y);
2087
2221
  return {
2088
- config: { holeId: ce, property: w, chartType: pe },
2089
- hole: I,
2090
- loading: L.includes(k.holeId),
2222
+ config: { holeId: ce, property: B, chartType: pe },
2223
+ hole: A,
2224
+ loading: k.includes(P.holeId),
2091
2225
  isCategorical: Y,
2092
2226
  isComment: T,
2093
2227
  isTadpole: W,
2094
2228
  displayType: re,
2095
- points: ve,
2096
- propertyOptions: V,
2229
+ points: Ie,
2230
+ propertyOptions: $,
2097
2231
  label: ce
2098
2232
  };
2099
2233
  });
2100
- }, [g, o, h, u, d, L, r, c]), j = (A, x) => {
2101
- v((_) => {
2102
- const k = [..._], V = { ...k[A] || {}, ...x };
2103
- return x.property && (V.chartType = ke({
2104
- property: x.property,
2105
- chartType: V.chartType,
2106
- categoricalProps: u,
2234
+ }, [g, o, h, c, d, k, r, u]), H = (x, E) => {
2235
+ I((_) => {
2236
+ const P = [..._], $ = { ...P[x] || {}, ...E };
2237
+ return E.property && ($.chartType = Pe({
2238
+ property: E.property,
2239
+ chartType: $.chartType,
2240
+ categoricalProps: c,
2107
2241
  commentProps: d,
2108
2242
  numericDefaultChartType: "markers+line"
2109
- })), k[A] = V, k;
2243
+ })), P[x] = $, P;
2110
2244
  });
2111
2245
  };
2112
2246
  return {
2113
2247
  error: M,
2114
- focusedHoleId: P,
2115
- setFocusedHoleId: C,
2116
- setError: E,
2248
+ focusedHoleId: F,
2249
+ setFocusedHoleId: D,
2250
+ setError: C,
2117
2251
  holeCount: s.length,
2118
- numericProps: c,
2119
- categoricalProps: u,
2252
+ numericProps: u,
2253
+ categoricalProps: c,
2120
2254
  commentProps: d,
2121
2255
  columnMeta: p,
2122
2256
  propertyOptions: X,
2123
- labeledHoleOptions: F,
2257
+ labeledHoleOptions: L,
2124
2258
  traceGraphs: U,
2125
- handleConfigChange: j
2259
+ handleConfigChange: H
2126
2260
  };
2127
2261
  }
2128
- const Wn = [
2262
+ const nr = [
2129
2263
  "#313695",
2130
2264
  "#4575b4",
2131
2265
  "#74add1",
@@ -2137,7 +2271,7 @@ const Wn = [
2137
2271
  "#d73027",
2138
2272
  "#a50026"
2139
2273
  ];
2140
- function Zn(e = [], t = Wn) {
2274
+ function rr(e = [], t = nr) {
2141
2275
  const n = e.filter((a) => Number.isFinite(a));
2142
2276
  if (!n.length)
2143
2277
  return {
@@ -2147,9 +2281,9 @@ function Zn(e = [], t = Wn) {
2147
2281
  bins: [],
2148
2282
  colors: t
2149
2283
  };
2150
- const r = n.slice().sort((a, u) => a - u), o = r[0], i = r[r.length - 1], s = t.length;
2284
+ const r = n.slice().sort((a, c) => a - c), o = r[0], i = r[r.length - 1], s = t.length;
2151
2285
  if (i === o) {
2152
- const a = t.map((u, m) => ({
2286
+ const a = t.map((c, m) => ({
2153
2287
  index: m,
2154
2288
  min: o,
2155
2289
  max: i,
@@ -2163,28 +2297,28 @@ function Zn(e = [], t = Wn) {
2163
2297
  colors: t
2164
2298
  };
2165
2299
  }
2166
- const l = t.map((a, u) => {
2167
- const m = u / s, d = (u + 1) / s, f = Math.floor(m * r.length), p = Math.min(r.length - 1, Math.floor(d * r.length)), b = r[f], h = u === s - 1 ? i : r[p];
2300
+ const l = t.map((a, c) => {
2301
+ const m = c / s, d = (c + 1) / s, f = Math.floor(m * r.length), p = Math.min(r.length - 1, Math.floor(d * r.length)), b = r[f], h = c === s - 1 ? i : r[p];
2168
2302
  return {
2169
- index: u,
2303
+ index: c,
2170
2304
  min: b,
2171
2305
  max: h,
2172
- label: Kn(b, h)
2306
+ label: or(b, h)
2173
2307
  };
2174
- }), c = (i - o) / s;
2308
+ }), u = (i - o) / s;
2175
2309
  return {
2176
2310
  min: o,
2177
2311
  max: i,
2178
- step: c,
2312
+ step: u,
2179
2313
  bins: l,
2180
2314
  colors: t
2181
2315
  };
2182
2316
  }
2183
- function Kn(e, t) {
2317
+ function or(e, t) {
2184
2318
  const n = (r) => Number.isFinite(r) ? Math.abs(r) >= 1e3 ? r.toFixed(0) : Math.abs(r) >= 10 ? r.toFixed(1) : Math.abs(r) >= 0.1 ? r.toFixed(2) : r.toFixed(3) : "n/a";
2185
2319
  return `${n(e)} – ${n(t)}`;
2186
2320
  }
2187
- function Ot(e, t) {
2321
+ function kt(e, t) {
2188
2322
  if (!Number.isFinite(e) || !t || !Array.isArray(t.bins) || !t.bins.length)
2189
2323
  return -1;
2190
2324
  if (t.max === t.min)
@@ -2196,43 +2330,43 @@ function Ot(e, t) {
2196
2330
  }
2197
2331
  return -1;
2198
2332
  }
2199
- function Jn(e, t, n = "#8b1e3f") {
2200
- const r = Ot(e, t);
2333
+ function ir(e, t, n = "#8b1e3f") {
2334
+ const r = kt(e, t);
2201
2335
  return r < 0 ? n : t.colors[r] || n;
2202
2336
  }
2203
2337
  function Lt(e) {
2204
2338
  return Array.isArray(e) ? e : [];
2205
2339
  }
2206
- function je(e) {
2340
+ function Re(e) {
2207
2341
  const t = Number(e);
2208
2342
  return Number.isFinite(t) ? t : void 0;
2209
2343
  }
2210
- function Ft(e = {}) {
2344
+ function Tt(e = {}) {
2211
2345
  return {
2212
2346
  ...e,
2213
- x: je(e.x),
2214
- y: je(e.y),
2215
- z: je(e.z)
2347
+ x: Re(e.x),
2348
+ y: Re(e.y),
2349
+ z: Re(e.z)
2216
2350
  };
2217
2351
  }
2218
- function Qn(e = [], t = [0, 0], n = 0) {
2352
+ function sr(e = [], t = [0, 0], n = 0) {
2219
2353
  const [r, o] = t, i = Number(n) * Math.PI / 180, s = Math.cos(i), l = Math.sin(i);
2220
- return Lt(e).map(Ft).map((c) => {
2221
- if (!Number.isFinite(c.x) || !Number.isFinite(c.y)) return { ...c };
2222
- const a = c.x - r, u = c.y - o;
2354
+ return Lt(e).map(Tt).map((u) => {
2355
+ if (!Number.isFinite(u.x) || !Number.isFinite(u.y)) return { ...u };
2356
+ const a = u.x - r, c = u.y - o;
2223
2357
  return {
2224
- ...c,
2225
- along: a * l + u * s,
2226
- across: a * s - u * l
2358
+ ...u,
2359
+ along: a * l + c * s,
2360
+ across: a * s - c * l
2227
2361
  };
2228
2362
  });
2229
2363
  }
2230
- function er(e = [], t = [0, 0], n = 0, r = 50) {
2231
- const o = Qn(e, t, n), i = 0.5 * Number(r || 0);
2364
+ function lr(e = [], t = [0, 0], n = 0, r = 50) {
2365
+ const o = sr(e, t, n), i = 0.5 * Number(r || 0);
2232
2366
  return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
2233
2367
  }
2234
- function $o(e = [], t = null, n = null) {
2235
- let r = Lt(e).map(Ft);
2368
+ function Go(e = [], t = null, n = null) {
2369
+ let r = Lt(e).map(Tt);
2236
2370
  if (Array.isArray(t) && t.length === 2) {
2237
2371
  const [o, i] = t;
2238
2372
  r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
@@ -2242,46 +2376,46 @@ function $o(e = [], t = null, n = null) {
2242
2376
  color_value: o == null ? void 0 : o[n]
2243
2377
  }))), r;
2244
2378
  }
2245
- function Vo(e = [], t = [0, 0], n = 0, r = 50, o = null) {
2246
- let i = er(e, t, n, r);
2379
+ function Uo(e = [], t = [0, 0], n = 0, r = 50, o = null) {
2380
+ let i = lr(e, t, n, r);
2247
2381
  return o && (i = i.map((s) => ({
2248
2382
  ...s,
2249
2383
  color_value: s == null ? void 0 : s[o]
2250
2384
  }))), i;
2251
2385
  }
2252
- function We(e) {
2386
+ function Ke(e) {
2253
2387
  return Array.isArray(e) ? e : [];
2254
2388
  }
2255
- function Ze(e = {}) {
2389
+ function Je(e = {}) {
2256
2390
  return e.hole_id ?? e.holeId ?? e.id;
2257
2391
  }
2258
2392
  function ge(e, t = void 0) {
2259
2393
  const n = Number(e);
2260
2394
  return Number.isFinite(n) ? n : t;
2261
2395
  }
2262
- function wo(e = [], t = null) {
2396
+ function Yo(e = [], t = null) {
2263
2397
  const n = /* @__PURE__ */ new Map();
2264
- We(e).forEach((o) => {
2265
- const i = Ze(o);
2398
+ Ke(e).forEach((o) => {
2399
+ const i = Je(o);
2266
2400
  if (i == null || `${i}`.trim() === "") return;
2267
2401
  const s = `${i}`;
2268
2402
  n.has(s) || n.set(s, []), n.get(s).push(o);
2269
2403
  });
2270
2404
  const r = [];
2271
2405
  return n.forEach((o, i) => {
2272
- const s = [...o].sort((c, a) => ge(c.md, 0) - ge(a.md, 0)), l = {
2406
+ const s = [...o].sort((u, a) => ge(u.md, 0) - ge(a.md, 0)), l = {
2273
2407
  hole_id: i,
2274
- x: s.map((c) => ge(c.x, 0)),
2275
- y: s.map((c) => ge(c.y, 0)),
2276
- z: s.map((c) => ge(c.z, 0)),
2408
+ x: s.map((u) => ge(u.x, 0)),
2409
+ y: s.map((u) => ge(u.y, 0)),
2410
+ z: s.map((u) => ge(u.z, 0)),
2277
2411
  color: null
2278
2412
  };
2279
- t && (l.color = s.map((c) => c == null ? void 0 : c[t])), r.push(l);
2413
+ t && (l.color = s.map((u) => u == null ? void 0 : u[t])), r.push(l);
2280
2414
  }), r;
2281
2415
  }
2282
- function Ho(e = [], t = 1, n = null) {
2283
- return We(e).map((r) => ({
2284
- hole_id: Ze(r),
2416
+ function qo(e = [], t = 1, n = null) {
2417
+ return Ke(e).map((r) => ({
2418
+ hole_id: Je(r),
2285
2419
  from: r == null ? void 0 : r.from,
2286
2420
  to: r == null ? void 0 : r.to,
2287
2421
  radius: t,
@@ -2289,9 +2423,9 @@ function Ho(e = [], t = 1, n = null) {
2289
2423
  value: n ? r == null ? void 0 : r[n] : null
2290
2424
  }));
2291
2425
  }
2292
- function jo(e = [], t = null) {
2293
- return t ? We(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
2294
- hole_id: Ze(n),
2426
+ function Xo(e = [], t = null) {
2427
+ return t ? Ke(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
2428
+ hole_id: Je(n),
2295
2429
  label: n == null ? void 0 : n[t],
2296
2430
  depth: 0.5 * (ge(n == null ? void 0 : n.from, 0) + ge(n == null ? void 0 : n.to, 0))
2297
2431
  })) : [];
@@ -2303,7 +2437,7 @@ function ye(e) {
2303
2437
  ...e.structuralMeshes
2304
2438
  ];
2305
2439
  }
2306
- const tr = {
2440
+ const ar = {
2307
2441
  bedding: "#2563eb",
2308
2442
  foliation: "#16a34a",
2309
2443
  joint: "#9333ea",
@@ -2312,11 +2446,11 @@ const tr = {
2312
2446
  "shear zone": "#0ea5e9",
2313
2447
  "fault zone": "#ef4444"
2314
2448
  };
2315
- function nr(e, t) {
2316
- const n = t || tr, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
2449
+ function cr(e, t) {
2450
+ const n = t || ar, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
2317
2451
  return new y.Color(o).getHex();
2318
2452
  }
2319
- function rr(e, t) {
2453
+ function ur(e, t) {
2320
2454
  const n = e * Math.PI / 180, r = t * Math.PI / 180;
2321
2455
  return new y.Vector3(
2322
2456
  Math.sin(r) * Math.sin(n),
@@ -2327,32 +2461,32 @@ function rr(e, t) {
2327
2461
  // Up component
2328
2462
  ).normalize();
2329
2463
  }
2330
- function or(e, t = {}) {
2464
+ function mr(e, t = {}) {
2331
2465
  const {
2332
2466
  radius: n = 5,
2333
2467
  discThickness: r = 0.2,
2334
2468
  opacity: o = 0.7,
2335
2469
  segments: i = 32,
2336
2470
  colorMap: s = null
2337
- } = t, l = new y.Group(), c = new y.Vector3(0, 1, 0);
2471
+ } = t, l = new y.Group(), u = new y.Vector3(0, 1, 0);
2338
2472
  for (const a of e) {
2339
- const u = a.x != null ? a.x : a.easting != null ? a.easting : null, m = a.y != null ? a.y : a.northing != null ? a.northing : null, d = a.z != null ? a.z : a.elevation != null ? a.elevation : null;
2340
- if (u == null || m == null || d == null || !Number.isFinite(u) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
2341
- const f = a[R] != null ? Number(a[R]) : null, p = a[B] != null ? Number(a[B]) : null;
2473
+ const c = a.x != null ? a.x : a.easting != null ? a.easting : null, m = a.y != null ? a.y : a.northing != null ? a.northing : null, d = a.z != null ? a.z : a.elevation != null ? a.elevation : null;
2474
+ if (c == null || m == null || d == null || !Number.isFinite(c) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
2475
+ const f = a[R] != null ? Number(a[R]) : null, p = a[j] != null ? Number(a[j]) : null;
2342
2476
  let b;
2343
2477
  if (a.nx != null && Number.isFinite(a.nx) && a.ny != null && Number.isFinite(a.ny) && a.nz != null && Number.isFinite(a.nz))
2344
2478
  b = new y.Vector3(a.nx, a.ny, a.nz).normalize();
2345
2479
  else {
2346
2480
  if (f == null || p == null || !Number.isFinite(f) || !Number.isFinite(p)) continue;
2347
- b = rr(f, p);
2481
+ b = ur(f, p);
2348
2482
  }
2349
2483
  const h = new y.CylinderGeometry(n, n, r, i, 1, !1), N = new y.MeshStandardMaterial({
2350
- color: nr(a.structure_type, s),
2484
+ color: cr(a.structure_type, s),
2351
2485
  transparent: !0,
2352
2486
  opacity: o,
2353
2487
  side: y.DoubleSide
2354
2488
  }), g = new y.Mesh(h, N);
2355
- g.position.set(u, m, d), g.quaternion.setFromUnitVectors(c, b), g.userData = {
2489
+ g.position.set(c, m, d), g.quaternion.setFromUnitVectors(u, b), g.userData = {
2356
2490
  type: "structure",
2357
2491
  hole_id: a.hole_id,
2358
2492
  depth: a.depth ?? a.mid,
@@ -2364,31 +2498,31 @@ function or(e, t = {}) {
2364
2498
  }
2365
2499
  return l;
2366
2500
  }
2367
- function ir(e, t, n, r = {}) {
2368
- if (!e.scene || (Tt(e), !(t != null && t.length) || !(n != null && n.length))) return;
2501
+ function dr(e, t, n, r = {}) {
2502
+ if (!e.scene || (wt(e), !(t != null && t.length) || !(n != null && n.length))) return;
2369
2503
  const { maxDiscs: o = 3e3 } = r;
2370
2504
  let i = t;
2371
2505
  if (i.length > o) {
2372
- const c = i.length / o, a = [];
2373
- for (let u = 0; u < o; u++)
2374
- a.push(i[Math.floor(u * c)]);
2506
+ const u = i.length / o, a = [];
2507
+ for (let c = 0; c < o; c++)
2508
+ a.push(i[Math.floor(c * u)]);
2375
2509
  i = a;
2376
2510
  }
2377
- const s = n.flatMap((c) => (c.points || []).map((a) => ({ ...a, hole_id: c.id }))), l = Tn(i, s, r);
2378
- l.length && (e.structuralGroup = or(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
2379
- c.isMesh && e.structuralMeshes.push(c);
2511
+ const s = n.flatMap((u) => (u.points || []).map((a) => ({ ...a, hole_id: u.id }))), l = wn(i, s, r);
2512
+ l.length && (e.structuralGroup = mr(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((u) => {
2513
+ u.isMesh && e.structuralMeshes.push(u);
2380
2514
  }), ye(e));
2381
2515
  }
2382
- function Tt(e) {
2516
+ function wt(e) {
2383
2517
  e.structuralGroup && (e.scene.remove(e.structuralGroup), e.structuralGroup.traverse((t) => {
2384
2518
  t.isMesh && (t.geometry.dispose(), t.material.dispose());
2385
2519
  }), e.structuralGroup = null), e.structuralMeshes = [], ye(e);
2386
2520
  }
2387
- function sr(e, t) {
2521
+ function fr(e, t) {
2388
2522
  e.structuralGroup && (e.structuralGroup.visible = !!t);
2389
2523
  }
2390
- function Ke(e) {
2391
- var n, r, o, i, s, l, c, a, u;
2524
+ function Qe(e) {
2525
+ var n, r, o, i, s, l, u, a, c;
2392
2526
  if (!e) return "";
2393
2527
  const t = (m) => Number.isFinite(m) ? m.toFixed(3) : "nan";
2394
2528
  return [
@@ -2398,9 +2532,9 @@ function Ke(e) {
2398
2532
  t((i = e.target) == null ? void 0 : i.x),
2399
2533
  t((s = e.target) == null ? void 0 : s.y),
2400
2534
  t((l = e.target) == null ? void 0 : l.z),
2401
- t((c = e.up) == null ? void 0 : c.x),
2535
+ t((u = e.up) == null ? void 0 : u.x),
2402
2536
  t((a = e.up) == null ? void 0 : a.y),
2403
- t((u = e.up) == null ? void 0 : u.z)
2537
+ t((c = e.up) == null ? void 0 : c.z)
2404
2538
  ].join("|");
2405
2539
  }
2406
2540
  function $t(e) {
@@ -2422,37 +2556,37 @@ function $t(e) {
2422
2556
  }
2423
2557
  };
2424
2558
  }
2425
- function lr(e, t) {
2559
+ function hr(e, t) {
2426
2560
  if (!e.camera || !e.controls || !t) return !1;
2427
2561
  const n = t.camera || {}, r = t.target || {}, o = t.up || {};
2428
- return [n.x, n.y, n.z, r.x, r.y, r.z, o.x, o.y, o.z].every(Number.isFinite) ? (e.camera.position.set(n.x, n.y, n.z), e.controls.target.set(r.x, r.y, r.z), e.camera.up.set(o.x, o.y, o.z), e.camera.lookAt(r.x, r.y, r.z), e.controls.update(), e._lastViewSignature = Ke(t), !0) : !1;
2562
+ return [n.x, n.y, n.z, r.x, r.y, r.z, o.x, o.y, o.z].every(Number.isFinite) ? (e.camera.position.set(n.x, n.y, n.z), e.controls.target.set(r.x, r.y, r.z), e.camera.up.set(o.x, o.y, o.z), e.camera.lookAt(r.x, r.y, r.z), e.controls.update(), e._lastViewSignature = Qe(t), !0) : !1;
2429
2563
  }
2430
- function ar(e) {
2564
+ function pr(e) {
2431
2565
  if (!e.viewChangeHandler) return;
2432
2566
  const t = Date.now();
2433
2567
  if (t - e._lastViewEmitMs < 250) return;
2434
2568
  const n = $t(e);
2435
2569
  if (!n) return;
2436
- const r = Ke(n);
2570
+ const r = Qe(n);
2437
2571
  r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
2438
2572
  }
2439
- function Je(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
2440
- const l = (t + n) / 2, c = (r + o) / 2, a = (i + s) / 2, u = n - t, m = o - r, d = s - i, p = Math.max(u, m, d, 1) * 2;
2441
- e.controls.target.set(l, c, a), e.camera.position.set(l + p, c + p, a + p), e.camera.lookAt(l, c, a), e.controls.update();
2573
+ function et(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
2574
+ const l = (t + n) / 2, u = (r + o) / 2, a = (i + s) / 2, c = n - t, m = o - r, d = s - i, p = Math.max(c, m, d, 1) * 2;
2575
+ e.controls.target.set(l, u, a), e.camera.position.set(l + p, u + p, a + p), e.camera.lookAt(l, u, a), e.controls.update();
2442
2576
  }
2443
- function cr(e, t = 1e3) {
2577
+ function br(e, t = 1e3) {
2444
2578
  !e.camera || !e.controls || (e.controls.target.set(0, 0, 0), e.camera.position.set(t, t, t), e.camera.lookAt(0, 0, 0), e.controls.update());
2445
2579
  }
2446
- function ur(e, t = 2e3) {
2580
+ function gr(e, t = 2e3) {
2447
2581
  !e.camera || !e.controls || (e.controls.target.set(0, 0, 0), e.camera.position.set(0, 0, t), e.camera.up.set(0, 1, 0), e.camera.lookAt(0, 0, 0), e.controls.update());
2448
2582
  }
2449
- function mr(e, t = 0, n = 0) {
2583
+ function yr(e, t = 0, n = 0) {
2450
2584
  e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
2451
2585
  }
2452
- function dr(e, t = 1.1) {
2586
+ function _r(e, t = 1.1) {
2453
2587
  !e.controls || typeof e.controls.dollyIn != "function" || typeof e.controls.dollyOut != "function" || (t > 1 ? e.controls.dollyOut(t) : e.controls.dollyIn(1 / t), e.controls.update());
2454
2588
  }
2455
- function fr(e, t = 1.2) {
2589
+ function Nr(e, t = 1.2) {
2456
2590
  if (!e.lastBounds) return;
2457
2591
  const {
2458
2592
  minX: n,
@@ -2461,16 +2595,16 @@ function fr(e, t = 1.2) {
2461
2595
  maxY: i,
2462
2596
  minZ: s,
2463
2597
  maxZ: l
2464
- } = e.lastBounds, c = (r - n) * t, a = (i - o) * t, u = (l - s) * t, m = (n + r) / 2, d = (o + i) / 2, f = (s + l) / 2, b = Math.max(c, a, u, 1) * 2;
2598
+ } = e.lastBounds, u = (r - n) * t, a = (i - o) * t, c = (l - s) * t, m = (n + r) / 2, d = (o + i) / 2, f = (s + l) / 2, b = Math.max(u, a, c, 1) * 2;
2465
2599
  e.controls.target.set(m, d, f), e.camera.position.set(m + b, d + b, f + b), e.camera.lookAt(m, d, f), e.controls.update();
2466
2600
  }
2467
- const hr = 1, pr = 120;
2468
- function br(e, t) {
2601
+ const zr = 1, Mr = 120;
2602
+ function Er(e, t) {
2469
2603
  if (!e.camera || !e.controls || !Number.isFinite(t)) return !1;
2470
- const n = Math.min(pr, Math.max(hr, t)), r = e.controls.target, o = e.camera.position.distanceTo(r), i = e.camera.fov * Math.PI / 180, s = 2 * o * Math.tan(i / 2), l = n * Math.PI / 180, c = s / (2 * Math.tan(l / 2)), a = e.camera.position.clone().sub(r).normalize();
2471
- return e.camera.position.copy(r).addScaledVector(a, c), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
2604
+ const n = Math.min(Mr, Math.max(zr, t)), r = e.controls.target, o = e.camera.position.distanceTo(r), i = e.camera.fov * Math.PI / 180, s = 2 * o * Math.tan(i / 2), l = n * Math.PI / 180, u = s / (2 * Math.tan(l / 2)), a = e.camera.position.clone().sub(r).normalize();
2605
+ return e.camera.position.copy(r).addScaledVector(a, u), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
2472
2606
  }
2473
- function gr(e, t = "orbit") {
2607
+ function Ar(e, t = "orbit") {
2474
2608
  if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
2475
2609
  e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
2476
2610
  else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
@@ -2480,36 +2614,36 @@ function gr(e, t = "orbit") {
2480
2614
  }
2481
2615
  }
2482
2616
  const se = "#9ca3af";
2483
- function dt(e, t) {
2617
+ function ft(e, t) {
2484
2618
  const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
2485
2619
  if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
2486
2620
  const o = Math.min(n, r), i = Math.max(n, r);
2487
2621
  return i <= o ? null : { segStart: o, segEnd: i };
2488
2622
  }
2489
- function yr(e, t, n) {
2623
+ function Cr(e, t, n) {
2490
2624
  let r = 0, o = 0;
2491
2625
  for (let s = 0; s < e.length; s += 1) {
2492
- const l = e[s], c = Number(l == null ? void 0 : l.from), a = Number(l == null ? void 0 : l.to), u = Number(l == null ? void 0 : l.value);
2493
- if (!Number.isFinite(c) || !Number.isFinite(a) || !Number.isFinite(u) || a <= c) continue;
2494
- const m = Math.max(t, c), f = Math.min(n, a) - m;
2495
- f <= 0 || (r += u * f, o += f);
2626
+ const l = e[s], u = Number(l == null ? void 0 : l.from), a = Number(l == null ? void 0 : l.to), c = Number(l == null ? void 0 : l.value);
2627
+ if (!Number.isFinite(u) || !Number.isFinite(a) || !Number.isFinite(c) || a <= u) continue;
2628
+ const m = Math.max(t, u), f = Math.min(n, a) - m;
2629
+ f <= 0 || (r += c * f, o += f);
2496
2630
  }
2497
2631
  if (o <= 0) return null;
2498
2632
  const i = r / o;
2499
2633
  return Number.isFinite(i) ? i : null;
2500
2634
  }
2501
- function _r(e, t) {
2635
+ function Ir(e, t) {
2502
2636
  if (!Number.isFinite(e)) return new y.Color(se);
2503
- if (Ot(e, t) < 0) return new y.Color(se);
2504
- const r = Jn(e, t, se);
2637
+ if (kt(e, t) < 0) return new y.Color(se);
2638
+ const r = ir(e, t, se);
2505
2639
  return new y.Color(r);
2506
2640
  }
2507
- function Nr(e) {
2641
+ function xr(e) {
2508
2642
  if (!e || !String(e).trim()) return se;
2509
- const t = Vt(String(e).toLowerCase().trim());
2643
+ const t = Bt(String(e).toLowerCase().trim());
2510
2644
  return "#" + new y.Color().setHSL(t, 0.7, 0.5).getHexString();
2511
2645
  }
2512
- function zr(e = {}) {
2646
+ function vr(e = {}) {
2513
2647
  return {
2514
2648
  preserveView: !!e.preserveView,
2515
2649
  assayIntervalsByHole: e.assayIntervalsByHole || null,
@@ -2517,7 +2651,7 @@ function zr(e = {}) {
2517
2651
  isCategoricalVariable: !!e.isCategoricalVariable
2518
2652
  };
2519
2653
  }
2520
- function Mr(e, t) {
2654
+ function Sr(e, t) {
2521
2655
  if (!e || !t) return [];
2522
2656
  const n = [];
2523
2657
  return Object.values(e).forEach((r) => {
@@ -2527,146 +2661,146 @@ function Mr(e, t) {
2527
2661
  });
2528
2662
  }), n;
2529
2663
  }
2530
- function Be(e) {
2664
+ function Ge(e) {
2531
2665
  return {
2532
2666
  holeId: e.id,
2533
2667
  project: e.project
2534
2668
  };
2535
2669
  }
2536
- function xr(e) {
2670
+ function Fr(e) {
2537
2671
  return `${e ?? ""}`.trim().toLowerCase();
2538
2672
  }
2539
- function Ir(e, t) {
2540
- const n = `${e ?? ""}:${t ?? 0}`, r = Vt(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new y.Color();
2673
+ function Dr(e, t) {
2674
+ const n = `${e ?? ""}:${t ?? 0}`, r = Bt(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new y.Color();
2541
2675
  return s.setHSL(i, 1, 0.5), s;
2542
2676
  }
2543
- function Vt(e) {
2677
+ function Bt(e) {
2544
2678
  const t = `${e ?? ""}`;
2545
2679
  let n = 2166136261;
2546
2680
  for (let r = 0; r < t.length; r += 1)
2547
2681
  n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
2548
2682
  return (n >>> 0) / 4294967295;
2549
2683
  }
2550
- function Er(e, t, n) {
2684
+ function Pr(e, t, n) {
2551
2685
  let r = null, o = 0;
2552
2686
  for (const i of e) {
2553
2687
  const s = Number(i == null ? void 0 : i.from), l = Number(i == null ? void 0 : i.to);
2554
2688
  if (!Number.isFinite(s) || !Number.isFinite(l)) continue;
2555
- const c = Math.min(n, l) - Math.max(t, s);
2556
- c > o && (o = c, r = i == null ? void 0 : i.value);
2689
+ const u = Math.min(n, l) - Math.max(t, s);
2690
+ u > o && (o = u, r = i == null ? void 0 : i.value);
2557
2691
  }
2558
2692
  return r;
2559
2693
  }
2560
- function vr(e, t) {
2694
+ function Or(e, t) {
2561
2695
  if (!t || !e) return [];
2562
2696
  const n = e.id || e.holeId;
2563
2697
  if (!n) return [];
2564
2698
  const r = t[n];
2565
2699
  if (Array.isArray(r) && r.length) return r;
2566
- const o = xr(n);
2700
+ const o = Fr(n);
2567
2701
  if (o) {
2568
2702
  const i = t[o];
2569
2703
  if (Array.isArray(i) && i.length) return i;
2570
2704
  }
2571
2705
  return [];
2572
2706
  }
2573
- function Ar({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
2707
+ function kr({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
2574
2708
  if (!e)
2575
- return Ir(r, o);
2709
+ return Dr(r, o);
2576
2710
  if (e === "__HAS_ASSAY__") {
2577
2711
  if (!(t != null && t.length)) return new y.Color(se);
2578
- const u = dt(i, s);
2579
- return u ? t.some((d) => {
2712
+ const c = ft(i, s);
2713
+ return c ? t.some((d) => {
2580
2714
  const f = Number(d == null ? void 0 : d.from), p = Number(d == null ? void 0 : d.to);
2581
2715
  if (!Number.isFinite(f) || !Number.isFinite(p)) return !1;
2582
- const b = Math.max(u.segStart, f);
2583
- return Math.min(u.segEnd, p) > b;
2716
+ const b = Math.max(c.segStart, f);
2717
+ return Math.min(c.segEnd, p) > b;
2584
2718
  }) ? new y.Color("#ff8c42") : new y.Color(se) : new y.Color(se);
2585
2719
  }
2586
2720
  if (!(t != null && t.length)) return new y.Color(se);
2587
- const c = dt(i, s);
2588
- if (!c) return new y.Color(se);
2721
+ const u = ft(i, s);
2722
+ if (!u) return new y.Color(se);
2589
2723
  if (l) {
2590
- const u = Er(t, c.segStart, c.segEnd);
2591
- return new y.Color(Nr(u));
2724
+ const c = Pr(t, u.segStart, u.segEnd);
2725
+ return new y.Color(xr(c));
2592
2726
  }
2593
- const a = yr(t, c.segStart, c.segEnd);
2594
- return _r(a, n);
2727
+ const a = Cr(t, u.segStart, u.segEnd);
2728
+ return Ir(a, n);
2595
2729
  }
2596
- function Sr(e, t, n = {}) {
2597
- if (!e.scene || (wt(e), !t || t.length === 0)) return;
2598
- const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = zr(n), l = s ? [] : Mr(o, i), c = Zn(l);
2599
- let a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0, f = 1 / 0, p = -1 / 0;
2730
+ function Lr(e, t, n = {}) {
2731
+ if (!e.scene || (Vt(e), !t || t.length === 0)) return;
2732
+ const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = vr(n), l = s ? [] : Sr(o, i), u = rr(l);
2733
+ let a = 1 / 0, c = -1 / 0, m = 1 / 0, d = -1 / 0, f = 1 / 0, p = -1 / 0;
2600
2734
  const b = new y.Vector3(), h = new y.Vector3(0, 1, 0);
2601
2735
  t.forEach((N, g) => {
2602
- const M = g * 137.5 % 360 / 360, E = new y.Color().setHSL(M, 0.75, 0.55), P = (N.points || []).map((O) => {
2603
- a = Math.min(a, O.x), u = Math.max(u, O.x), m = Math.min(m, O.y), d = Math.max(d, O.y), f = Math.min(f, O.z), p = Math.max(p, O.z);
2736
+ const M = g * 137.5 % 360 / 360, C = new y.Color().setHSL(M, 0.75, 0.55), F = (N.points || []).map((O) => {
2737
+ a = Math.min(a, O.x), c = Math.max(c, O.x), m = Math.min(m, O.y), d = Math.max(d, O.y), f = Math.min(f, O.z), p = Math.max(p, O.z);
2604
2738
  const G = new y.Vector3(O.x, O.y, O.z);
2605
2739
  return G.md = O.md, G;
2606
2740
  });
2607
- if (P.length < 2) {
2608
- if (P.length === 1) {
2741
+ if (F.length < 2) {
2742
+ if (F.length === 1) {
2609
2743
  const O = new y.SphereGeometry(5, 12, 12), G = new y.MeshLambertMaterial({
2610
- color: E,
2611
- emissive: E,
2744
+ color: C,
2745
+ emissive: C,
2612
2746
  emissiveIntensity: 0.2
2613
2747
  }), X = new y.Mesh(O, G);
2614
- X.position.copy(P[0]), X.userData = Be(N), e.scene.add(X), e.drillLines.push(X), e.drillMeshes.push(X);
2748
+ X.position.copy(F[0]), X.userData = Ge(N), e.scene.add(X), e.drillLines.push(X), e.drillMeshes.push(X);
2615
2749
  }
2616
2750
  return;
2617
2751
  }
2618
- const C = new y.Group();
2619
- C.userData = Be(N);
2620
- const L = i ? vr(N, o) : [];
2621
- for (let O = 0; O < P.length - 1; O += 1) {
2622
- const G = P[O], X = P[O + 1], F = b.subVectors(X, G), U = F.length();
2752
+ const D = new y.Group();
2753
+ D.userData = Ge(N);
2754
+ const k = i ? Or(N, o) : [];
2755
+ for (let O = 0; O < F.length - 1; O += 1) {
2756
+ const G = F[O], X = F[O + 1], L = b.subVectors(X, G), U = L.length();
2623
2757
  if (U <= 1e-3) continue;
2624
- const j = 2.2, A = new y.CylinderGeometry(j, j, U, 6, 1, !0), x = Ar({
2758
+ const H = 2.2, x = new y.CylinderGeometry(H, H, U, 6, 1, !0), E = kr({
2625
2759
  selectedAssayVariable: i,
2626
- assayIntervals: L,
2627
- assayScale: c,
2760
+ assayIntervals: k,
2761
+ assayScale: u,
2628
2762
  holeId: N.id,
2629
2763
  segmentIndex: O,
2630
2764
  p1: G,
2631
2765
  p2: X,
2632
2766
  isCategorical: s
2633
2767
  }), _ = new y.MeshLambertMaterial({
2634
- color: x,
2768
+ color: E,
2635
2769
  flatShading: !0,
2636
- emissive: x,
2770
+ emissive: E,
2637
2771
  emissiveIntensity: 0.15
2638
- }), k = new y.Mesh(A, _);
2639
- k.position.copy(G.clone().addScaledVector(F, 0.5)), k.quaternion.setFromUnitVectors(h, F.clone().normalize()), k.userData = Be(N), C.add(k), e.drillMeshes.push(k);
2772
+ }), P = new y.Mesh(x, _);
2773
+ P.position.copy(G.clone().addScaledVector(L, 0.5)), P.quaternion.setFromUnitVectors(h, L.clone().normalize()), P.userData = Ge(N), D.add(P), e.drillMeshes.push(P);
2640
2774
  }
2641
- e.scene.add(C), e.drillLines.push(C);
2642
- }), e.camera && e.controls && (e.lastBounds = { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: p }, r || Je(e, { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: p })), ye(e);
2775
+ e.scene.add(D), e.drillLines.push(D);
2776
+ }), e.camera && e.controls && (e.lastBounds = { minX: a, maxX: c, minY: m, maxY: d, minZ: f, maxZ: p }, r || et(e, { minX: a, maxX: c, minY: m, maxY: d, minZ: f, maxZ: p })), ye(e);
2643
2777
  }
2644
- function wt(e) {
2778
+ function Vt(e) {
2645
2779
  e.drillLines.forEach((t) => {
2646
2780
  e.scene.remove(t), t.isGroup ? t.traverse((n) => {
2647
2781
  n.isMesh && (n.geometry.dispose(), n.material.dispose());
2648
2782
  }) : t.isMesh && (t.geometry.dispose(), t.material.dispose());
2649
2783
  }), e.drillLines = [], e.drillMeshes = [], ye(e);
2650
2784
  }
2651
- const ft = "#ffffbb", Dr = 2, Pr = 1.5, Cr = 1;
2652
- function kr(e) {
2785
+ const ht = "#ffffbb", Tr = 2, wr = 1.5, $r = 1;
2786
+ function Br(e) {
2653
2787
  const { renderer: t, scene: n, camera: r, container: o } = e;
2654
2788
  if (!t || !n || !r) return;
2655
- const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, s = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, l = new Kt(t), c = new Jt(n, r);
2656
- l.addPass(c);
2657
- const a = new y.Vector2(i, s), u = new Qt(a, n, r);
2658
- u.visibleEdgeColor.set(ft), u.hiddenEdgeColor.set(ft), u.edgeStrength = Dr, u.edgeThickness = Pr, u.edgeGlow = Cr, u.pulsePeriod = 0, u.selectedObjects = [], l.addPass(u), l.setSize(i, s), e._composer = l, e._outlinePass = u;
2789
+ const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, s = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, l = new Jt(t), u = new Qt(n, r);
2790
+ l.addPass(u);
2791
+ const a = new y.Vector2(i, s), c = new en(a, n, r);
2792
+ c.visibleEdgeColor.set(ht), c.hiddenEdgeColor.set(ht), c.edgeStrength = Tr, c.edgeThickness = wr, c.edgeGlow = $r, c.pulsePeriod = 0, c.selectedObjects = [], l.addPass(c), l.setSize(i, s), e._composer = l, e._outlinePass = c;
2659
2793
  }
2660
- function Or(e, t, n) {
2794
+ function Vr(e, t, n) {
2661
2795
  !e._composer || !e._outlinePass || (e._composer.setSize(t, n), e._outlinePass.resolution.set(t, n));
2662
2796
  }
2663
- function Ae(e, t) {
2797
+ function xe(e, t) {
2664
2798
  e._outlinePass && (e._outlinePass.selectedObjects = t ? [t] : [], e._selectedObject = t || null);
2665
2799
  }
2666
- function ht(e) {
2800
+ function pt(e) {
2667
2801
  e._composer && (e._composer.dispose(), e._composer = null), e._outlinePass = null, e._selectedObject = null, e.selectables = [];
2668
2802
  }
2669
- const Lr = [
2803
+ const Hr = [
2670
2804
  { normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
2671
2805
  { normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
2672
2806
  { normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
@@ -2674,40 +2808,40 @@ const Lr = [
2674
2808
  { normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
2675
2809
  { normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
2676
2810
  ];
2677
- function Fr(e, t, n, r, o = {}) {
2811
+ function jr(e, t, n, r, o = {}) {
2678
2812
  if (!e.scene || (Ht(e), !t || !n || !r)) return;
2679
2813
  const { autoCenter: i = !0, opacity: s = 1 } = o;
2680
- let l = 1 / 0, c = -1 / 0, a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0;
2814
+ let l = 1 / 0, u = -1 / 0, a = 1 / 0, c = -1 / 0, m = 1 / 0, d = -1 / 0;
2681
2815
  t.forEach((_) => {
2682
- const k = Number(_.x ?? _.center_x ?? 0), I = Number(_.y ?? _.center_y ?? 0), V = Number(_.z ?? _.center_z ?? 0), w = Number(_.dx ?? _.size_x ?? 1), T = Number(_.dy ?? _.size_y ?? 1), Y = Number(_.dz ?? _.size_z ?? 1);
2683
- l = Math.min(l, k - w / 2), c = Math.max(c, k + w / 2), a = Math.min(a, I - T / 2), u = Math.max(u, I + T / 2), m = Math.min(m, V - Y / 2), d = Math.max(d, V + Y / 2);
2816
+ const P = Number(_.x ?? _.center_x ?? 0), A = Number(_.y ?? _.center_y ?? 0), $ = Number(_.z ?? _.center_z ?? 0), B = Number(_.dx ?? _.size_x ?? 1), T = Number(_.dy ?? _.size_y ?? 1), Y = Number(_.dz ?? _.size_z ?? 1);
2817
+ l = Math.min(l, P - B / 2), u = Math.max(u, P + B / 2), a = Math.min(a, A - T / 2), c = Math.max(c, A + T / 2), m = Math.min(m, $ - Y / 2), d = Math.max(d, $ + Y / 2);
2684
2818
  });
2685
2819
  let f = 0, p = 0, b = 0;
2686
- o.offset ? (f = Number(o.offset.x ?? 0), p = Number(o.offset.y ?? 0), b = Number(o.offset.z ?? 0)) : i && (f = -((l + c) / 2), p = -((a + u) / 2), b = -((m + d) / 2));
2687
- const h = l + f, N = c + f, g = a + p, v = u + p, M = m + b, E = d + b, P = (_, k, I) => `${Math.round(_)},${Math.round(k)},${Math.round(I)}`, C = new Set(
2688
- t.map((_) => P(Number(_.x ?? 0), Number(_.y ?? 0), Number(_.z ?? 0)))
2689
- ), L = [], O = [], G = [], X = [], F = [];
2820
+ o.offset ? (f = Number(o.offset.x ?? 0), p = Number(o.offset.y ?? 0), b = Number(o.offset.z ?? 0)) : i && (f = -((l + u) / 2), p = -((a + c) / 2), b = -((m + d) / 2));
2821
+ const h = l + f, N = u + f, g = a + p, I = c + p, M = m + b, C = d + b, F = (_, P, A) => `${Math.round(_)},${Math.round(P)},${Math.round(A)}`, D = new Set(
2822
+ t.map((_) => F(Number(_.x ?? 0), Number(_.y ?? 0), Number(_.z ?? 0)))
2823
+ ), k = [], O = [], G = [], X = [], L = [];
2690
2824
  let U = 0;
2691
2825
  if (t.forEach((_) => {
2692
- const k = Number(_.x ?? _.center_x ?? 0), I = Number(_.y ?? _.center_y ?? 0), V = Number(_.z ?? _.center_z ?? 0), w = Number(_.dx ?? _.size_x ?? 1), T = Number(_.dy ?? _.size_y ?? 1), Y = Number(_.dz ?? _.size_z ?? 1), W = k + f, re = I + p, pe = V + b, ce = Sn(_[n], r, y), { r: ve, g: ue, b: Ve } = ce;
2693
- Lr.forEach((be) => {
2694
- const Bt = k + be.neibDir[0] * w, Rt = I + be.neibDir[1] * T, Gt = V + be.neibDir[2] * Y;
2695
- if (C.has(P(Bt, Rt, Gt))) return;
2826
+ const P = Number(_.x ?? _.center_x ?? 0), A = Number(_.y ?? _.center_y ?? 0), $ = Number(_.z ?? _.center_z ?? 0), B = Number(_.dx ?? _.size_x ?? 1), T = Number(_.dy ?? _.size_y ?? 1), Y = Number(_.dz ?? _.size_z ?? 1), W = P + f, re = A + p, pe = $ + b, ce = Sn(_[n], r, y), { r: Ie, g: ue, b: Be } = ce;
2827
+ Hr.forEach((be) => {
2828
+ const Rt = P + be.neibDir[0] * B, Gt = A + be.neibDir[1] * T, Ut = $ + be.neibDir[2] * Y;
2829
+ if (D.has(F(Rt, Gt, Ut))) return;
2696
2830
  const _e = U;
2697
- be.verts.forEach(([Ut, Yt, qt]) => {
2698
- L.push(W + Ut * w / 2, re + Yt * T / 2, pe + qt * Y / 2), O.push(be.normal[0], be.normal[1], be.normal[2]), G.push(ve, ue, Ve), U++;
2699
- }), X.push(_e, _e + 1, _e + 2, _e, _e + 2, _e + 3), F.push(_);
2831
+ be.verts.forEach(([Yt, qt, Xt]) => {
2832
+ k.push(W + Yt * B / 2, re + qt * T / 2, pe + Xt * Y / 2), O.push(be.normal[0], be.normal[1], be.normal[2]), G.push(Ie, ue, Be), U++;
2833
+ }), X.push(_e, _e + 1, _e + 2, _e, _e + 2, _e + 3), L.push(_);
2700
2834
  });
2701
- }), L.length === 0) return;
2702
- const j = new y.BufferGeometry();
2703
- j.setAttribute("position", new y.Float32BufferAttribute(L, 3)), j.setAttribute("normal", new y.Float32BufferAttribute(O, 3)), j.setAttribute("color", new y.Float32BufferAttribute(G, 3)), j.setIndex(X);
2704
- const A = new y.MeshLambertMaterial({
2835
+ }), k.length === 0) return;
2836
+ const H = new y.BufferGeometry();
2837
+ H.setAttribute("position", new y.Float32BufferAttribute(k, 3)), H.setAttribute("normal", new y.Float32BufferAttribute(O, 3)), H.setAttribute("color", new y.Float32BufferAttribute(G, 3)), H.setIndex(X);
2838
+ const x = new y.MeshLambertMaterial({
2705
2839
  vertexColors: !0,
2706
2840
  transparent: s < 1,
2707
2841
  opacity: s,
2708
2842
  side: y.DoubleSide
2709
- }), x = new y.Mesh(j, A);
2710
- x.userData._isMergedBlocks = !0, x.userData._quadToBlock = F, x.userData._offset = { x: f, y: p, z: b }, e.scene.add(x), e.blocks.push(x), ye(e), e.camera && e.controls && (e.lastBounds = { minX: h, maxX: N, minY: g, maxY: v, minZ: M, maxZ: E }, Je(e, { minX: h, maxX: N, minY: g, maxY: v, minZ: M, maxZ: E }));
2843
+ }), E = new y.Mesh(H, x);
2844
+ E.userData._isMergedBlocks = !0, E.userData._quadToBlock = L, E.userData._offset = { x: f, y: p, z: b }, e.scene.add(E), e.blocks.push(E), ye(e), e.camera && e.controls && (e.lastBounds = { minX: h, maxX: N, minY: g, maxY: I, minZ: M, maxZ: C }, et(e, { minX: h, maxX: N, minY: g, maxY: I, minZ: M, maxZ: C }));
2711
2845
  }
2712
2846
  function Ht(e) {
2713
2847
  var t;
@@ -2715,45 +2849,45 @@ function Ht(e) {
2715
2849
  e.scene.remove(n), n.geometry.dispose(), n.material.dispose();
2716
2850
  }), e.blocks = [], e._blockHighlightMesh && ((t = e.scene) == null || t.remove(e._blockHighlightMesh), e._blockHighlightMesh.geometry.dispose(), e._blockHighlightMesh.material.dispose(), e._blockHighlightMesh = null), ye(e);
2717
2851
  }
2718
- function Tr(e, t) {
2852
+ function Rr(e, t) {
2719
2853
  const n = Math.max(0, Math.min(1, Number(t)));
2720
2854
  e.blocks.forEach((r) => {
2721
2855
  r.material && (r.material.opacity = n, r.material.transparent = n < 1, r.material.needsUpdate = !0);
2722
2856
  });
2723
2857
  }
2724
- function $r(e, t, n) {
2725
- const r = (n == null ? void 0 : n.x) ?? 0, o = (n == null ? void 0 : n.y) ?? 0, i = (n == null ? void 0 : n.z) ?? 0, s = Number(t.x ?? t.center_x ?? 0) + r, l = Number(t.y ?? t.center_y ?? 0) + o, c = Number(t.z ?? t.center_z ?? 0) + i, a = Number(t.dx ?? t.size_x ?? 1), u = Number(t.dy ?? t.size_y ?? 1), m = Number(t.dz ?? t.size_z ?? 1);
2858
+ function Gr(e, t, n) {
2859
+ const r = (n == null ? void 0 : n.x) ?? 0, o = (n == null ? void 0 : n.y) ?? 0, i = (n == null ? void 0 : n.z) ?? 0, s = Number(t.x ?? t.center_x ?? 0) + r, l = Number(t.y ?? t.center_y ?? 0) + o, u = Number(t.z ?? t.center_z ?? 0) + i, a = Number(t.dx ?? t.size_x ?? 1), c = Number(t.dy ?? t.size_y ?? 1), m = Number(t.dz ?? t.size_z ?? 1);
2726
2860
  if (!e._blockHighlightMesh) {
2727
2861
  const d = new y.BoxGeometry(1, 1, 1), f = new y.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
2728
2862
  e._blockHighlightMesh = new y.Mesh(d, f), e.scene.add(e._blockHighlightMesh);
2729
2863
  }
2730
- return e._blockHighlightMesh.position.set(s, l, c), e._blockHighlightMesh.scale.set(a, u, m), e._blockHighlightMesh;
2864
+ return e._blockHighlightMesh.position.set(s, l, u), e._blockHighlightMesh.scale.set(a, c, m), e._blockHighlightMesh;
2731
2865
  }
2732
2866
  function jt(e) {
2733
2867
  var o, i;
2734
2868
  if (!e._outlinePass || e.selectables.length === 0) {
2735
- e._outlinePass && Ae(e, null);
2869
+ e._outlinePass && xe(e, null);
2736
2870
  return;
2737
2871
  }
2738
2872
  const t = e.raycaster.intersectObjects(e.selectables, !0);
2739
2873
  if (t.length === 0) {
2740
- Ae(e, null);
2874
+ xe(e, null);
2741
2875
  return;
2742
2876
  }
2743
2877
  const n = t[0], r = n.object;
2744
2878
  if ((o = r == null ? void 0 : r.userData) != null && o._isMergedBlocks) {
2745
2879
  const s = Math.floor(n.faceIndex / 2), l = (i = r.userData._quadToBlock) == null ? void 0 : i[s];
2746
2880
  if (l) {
2747
- Ae(e, $r(e, l, r.userData._offset));
2881
+ xe(e, Gr(e, l, r.userData._offset));
2748
2882
  return;
2749
2883
  }
2750
2884
  }
2751
- Ae(e, r);
2885
+ xe(e, r);
2752
2886
  }
2753
- function Vr(e) {
2887
+ function Ur(e) {
2754
2888
  const t = e.renderer;
2755
2889
  t && (e.handleCanvasClick = (n) => {
2756
- var f, p, b, h, N, g, v;
2890
+ var f, p, b, h, N, g, I;
2757
2891
  if (n.button !== 0) return;
2758
2892
  if ((f = e.gizmo) != null && f.domElement) {
2759
2893
  const M = e.gizmo.domElement.getBoundingClientRect();
@@ -2764,29 +2898,29 @@ function Vr(e) {
2764
2898
  if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), jt(e), e.blocks.length > 0) {
2765
2899
  const M = e.raycaster.intersectObjects(e.blocks, !1);
2766
2900
  if (M.length > 0) {
2767
- const E = M[0], P = E.object;
2768
- if ((p = P == null ? void 0 : P.userData) != null && p._isMergedBlocks && e.blockClickHandler) {
2769
- const C = Math.floor(E.faceIndex / 2), L = P.userData._quadToBlock[C];
2770
- L && e.blockClickHandler(L);
2901
+ const C = M[0], F = C.object;
2902
+ if ((p = F == null ? void 0 : F.userData) != null && p._isMergedBlocks && e.blockClickHandler) {
2903
+ const D = Math.floor(C.faceIndex / 2), k = F.userData._quadToBlock[D];
2904
+ k && e.blockClickHandler(k);
2771
2905
  }
2772
2906
  return;
2773
2907
  }
2774
2908
  }
2775
- const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), c = ((b = s[0]) == null ? void 0 : b.distance) ?? 1 / 0;
2776
- if ((((h = l[0]) == null ? void 0 : h.distance) ?? 1 / 0) < c && l.length > 0) {
2909
+ const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), u = ((b = s[0]) == null ? void 0 : b.distance) ?? 1 / 0;
2910
+ if ((((h = l[0]) == null ? void 0 : h.distance) ?? 1 / 0) < u && l.length > 0) {
2777
2911
  const M = l[0].object;
2778
2912
  e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...M.userData });
2779
2913
  return;
2780
2914
  }
2781
2915
  if (s.length === 0) return;
2782
- let u = s[0].object;
2783
- for (; u && u.parent && !((N = u.userData) != null && N.holeId); )
2784
- u = u.parent;
2785
- const m = (g = u == null ? void 0 : u.userData) == null ? void 0 : g.holeId, d = (v = u == null ? void 0 : u.userData) == null ? void 0 : v.project;
2916
+ let c = s[0].object;
2917
+ for (; c && c.parent && !((N = c.userData) != null && N.holeId); )
2918
+ c = c.parent;
2919
+ const m = (g = c == null ? void 0 : c.userData) == null ? void 0 : g.holeId, d = (I = c == null ? void 0 : c.userData) == null ? void 0 : I.project;
2786
2920
  m && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: m, project: d });
2787
2921
  }, t.domElement.addEventListener("click", e.handleCanvasClick));
2788
2922
  }
2789
- class Bo {
2923
+ class Wo {
2790
2924
  constructor() {
2791
2925
  this.container = null, this.scene = null, this.camera = null, this.renderer = null, this.controls = null, this.flyControls = null, this.gizmo = null, this.blocks = [], this.drillLines = [], this.drillMeshes = [], this.structuralGroup = null, this.structuralMeshes = [], this.frameId = null, this.clock = new y.Clock(), this.handleCanvasClick = null, this.raycaster = new y.Raycaster(), this.pointer = new y.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new y.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null;
2792
2926
  }
@@ -2800,42 +2934,42 @@ class Bo {
2800
2934
  const i = new y.DirectionalLight(16777215, 1.5);
2801
2935
  i.position.set(10, 10, 5), this.scene.add(i);
2802
2936
  const s = new y.AxesHelper(20);
2803
- this.scene.add(s), this.controls = new Xt(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 1.2, this.controls.minDistance = 3e-3, this.controls.maxDistance = 4e4, this.controls.mouseButtons = {
2937
+ this.scene.add(s), this.controls = new Wt(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 1.2, this.controls.minDistance = 3e-3, this.controls.maxDistance = 4e4, this.controls.mouseButtons = {
2804
2938
  LEFT: y.MOUSE.PAN,
2805
2939
  MIDDLE: y.MOUSE.DOLLY,
2806
2940
  RIGHT: y.MOUSE.ROTATE
2807
2941
  }, this.controls.touches = {
2808
2942
  ONE: y.TOUCH.ROTATE,
2809
2943
  TWO: y.TOUCH.PAN
2810
- }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new Wt(this.camera, this.renderer.domElement), this.flyControls.movementSpeed = 2e3, this.flyControls.rollSpeed = Math.PI / 12, this.flyControls.dragToLook = !0, this.flyControls.enabled = !1, this.gizmo = new Zt(this.camera, this.renderer, {
2944
+ }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new Zt(this.camera, this.renderer.domElement), this.flyControls.movementSpeed = 2e3, this.flyControls.rollSpeed = Math.PI / 12, this.flyControls.dragToLook = !0, this.flyControls.enabled = !1, this.gizmo = new Kt(this.camera, this.renderer, {
2811
2945
  container: this.container,
2812
2946
  placement: "top-right",
2813
2947
  size: 110,
2814
2948
  offset: { top: 12, right: 12 },
2815
2949
  animated: !0,
2816
2950
  speed: 1.5
2817
- }), this.gizmo.attachControls(this.controls), Vr(this), kr(this);
2951
+ }), this.gizmo.attachControls(this.controls), Ur(this), Br(this);
2818
2952
  const l = () => {
2819
2953
  var a;
2820
2954
  this.frameId = requestAnimationFrame(l);
2821
- const c = this.clock.getDelta();
2822
- this.renderer.clear(), this.controlMode === "fly" && ((a = this.flyControls) != null && a.enabled) ? this.flyControls.update(c) : this.controls && this.controls.update(), this._emitViewChangeIfNeeded(), this._composer ? this._composer.render(c) : this.renderer.render(this.scene, this.camera), this.gizmo && this.gizmo.render();
2955
+ const u = this.clock.getDelta();
2956
+ this.renderer.clear(), this.controlMode === "fly" && ((a = this.flyControls) != null && a.enabled) ? this.flyControls.update(u) : this.controls && this.controls.update(), this._emitViewChangeIfNeeded(), this._composer ? this._composer.render(u) : this.renderer.render(this.scene, this.camera), this.gizmo && this.gizmo.render();
2823
2957
  };
2824
2958
  l();
2825
2959
  }
2826
2960
  resize() {
2827
2961
  if (!this.container || !this.camera || !this.renderer) return;
2828
2962
  const t = this.container.clientWidth, n = this.container.clientHeight;
2829
- this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), Or(this, t, n);
2963
+ this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), Vr(this, t, n);
2830
2964
  }
2831
2965
  dispose() {
2832
- this.frameId && cancelAnimationFrame(this.frameId), this.renderer && this.handleCanvasClick && this.renderer.domElement.removeEventListener("click", this.handleCanvasClick), this.gizmo && (this.gizmo.dispose(), this.gizmo = null), this.viewChangeHandler = null, Ht(this), wt(this), Tt(this), ht(this), this.controls && this.controls.dispose(), this.flyControls && this.flyControls.dispose(), this.renderer && (this.renderer.dispose(), this.container && this.renderer.domElement && this.container.removeChild(this.renderer.domElement));
2966
+ this.frameId && cancelAnimationFrame(this.frameId), this.renderer && this.handleCanvasClick && this.renderer.domElement.removeEventListener("click", this.handleCanvasClick), this.gizmo && (this.gizmo.dispose(), this.gizmo = null), this.viewChangeHandler = null, Ht(this), Vt(this), wt(this), pt(this), this.controls && this.controls.dispose(), this.flyControls && this.flyControls.dispose(), this.renderer && (this.renderer.dispose(), this.container && this.renderer.domElement && this.container.removeChild(this.renderer.domElement));
2833
2967
  }
2834
2968
  // ---------------------------------------------------------------------------
2835
2969
  // Data renderers — delegate to domain modules
2836
2970
  // ---------------------------------------------------------------------------
2837
2971
  setDrillholes(t, n = {}) {
2838
- Sr(this, t, n);
2972
+ Lr(this, t, n);
2839
2973
  }
2840
2974
  /**
2841
2975
  * Render block model data as a single merged mesh of exterior faces only.
@@ -2845,20 +2979,20 @@ class Bo {
2845
2979
  * @param {Object} [options]
2846
2980
  */
2847
2981
  setBlocks(t, n, r, o = {}) {
2848
- Fr(this, t, n, r, o);
2982
+ jr(this, t, n, r, o);
2849
2983
  }
2850
2984
  /**
2851
2985
  * Update the opacity of all currently rendered blocks.
2852
2986
  * @param {number} opacity - New opacity value between 0 and 1
2853
2987
  */
2854
2988
  setBlockOpacity(t) {
2855
- Tr(this, t);
2989
+ Rr(this, t);
2856
2990
  }
2857
2991
  setStructuralDiscs(t, n, r = {}) {
2858
- ir(this, t, n, r);
2992
+ dr(this, t, n, r);
2859
2993
  }
2860
2994
  setStructuralDiscsVisible(t) {
2861
- sr(this, t);
2995
+ fr(this, t);
2862
2996
  }
2863
2997
  // ---------------------------------------------------------------------------
2864
2998
  // Click handlers
@@ -2883,41 +3017,41 @@ class Bo {
2883
3017
  return $t(this);
2884
3018
  }
2885
3019
  setViewState(t) {
2886
- return lr(this, t);
3020
+ return hr(this, t);
2887
3021
  }
2888
3022
  _buildViewSignature(t) {
2889
- return Ke(t);
3023
+ return Qe(t);
2890
3024
  }
2891
3025
  _emitViewChangeIfNeeded() {
2892
- ar(this);
3026
+ pr(this);
2893
3027
  }
2894
3028
  _fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
2895
- Je(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
3029
+ et(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
2896
3030
  }
2897
3031
  recenterCameraToOrigin(t = 1e3) {
2898
- cr(this, t);
3032
+ br(this, t);
2899
3033
  }
2900
3034
  lookDown(t = 2e3) {
2901
- ur(this, t);
3035
+ gr(this, t);
2902
3036
  }
2903
3037
  pan(t = 0, n = 0) {
2904
- mr(this, t, n);
3038
+ yr(this, t, n);
2905
3039
  }
2906
3040
  dolly(t = 1.1) {
2907
- dr(this, t);
3041
+ _r(this, t);
2908
3042
  }
2909
3043
  focusOnLastBounds(t = 1.2) {
2910
- fr(this, t);
3044
+ Nr(this, t);
2911
3045
  }
2912
3046
  /**
2913
3047
  * Change the camera field-of-view while keeping the visible scene the same apparent size.
2914
3048
  * @param {number} fovDeg - Desired FOV in degrees
2915
3049
  */
2916
3050
  setCameraFov(t) {
2917
- br(this, t);
3051
+ Er(this, t);
2918
3052
  }
2919
3053
  setControlMode(t = "orbit") {
2920
- gr(this, t);
3054
+ Ar(this, t);
2921
3055
  }
2922
3056
  // ---------------------------------------------------------------------------
2923
3057
  // Selection glow public API
@@ -2937,7 +3071,7 @@ class Bo {
2937
3071
  * @param {THREE.Object3D|null} object
2938
3072
  */
2939
3073
  selectObject(t) {
2940
- Ae(this, t || null);
3074
+ xe(this, t || null);
2941
3075
  }
2942
3076
  /**
2943
3077
  * Return the currently selected object, or null if nothing is selected.
@@ -2950,14 +3084,14 @@ class Bo {
2950
3084
  * Dispose the effect composer and all GPU resources used by the selection glow.
2951
3085
  */
2952
3086
  disposeGlow() {
2953
- ht(this);
3087
+ pt(this);
2954
3088
  }
2955
3089
  /** @private */
2956
3090
  _updateSelectionFromPointer() {
2957
3091
  jt(this);
2958
3092
  }
2959
3093
  }
2960
- function Ro({
3094
+ function Zo({
2961
3095
  controlMode: e = "orbit",
2962
3096
  onToggleFly: t = () => {
2963
3097
  },
@@ -2969,13 +3103,13 @@ function Ro({
2969
3103
  }
2970
3104
  }) {
2971
3105
  return /* @__PURE__ */ Q("div", { className: "baselode-3d-controls", children: [
2972
- /* @__PURE__ */ $("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
2973
- /* @__PURE__ */ $("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
2974
- /* @__PURE__ */ $("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
2975
- /* @__PURE__ */ $("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
3106
+ /* @__PURE__ */ w("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
3107
+ /* @__PURE__ */ w("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
3108
+ /* @__PURE__ */ w("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
3109
+ /* @__PURE__ */ w("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
2976
3110
  ] });
2977
3111
  }
2978
- function Go({
3112
+ function Ko({
2979
3113
  properties: e = [],
2980
3114
  selectedProperty: t = "",
2981
3115
  onPropertyChange: n = () => {
@@ -2988,37 +3122,37 @@ function Go({
2988
3122
  onPopupClose: l = () => {
2989
3123
  }
2990
3124
  }) {
2991
- var c, a;
3125
+ var u, a;
2992
3126
  return /* @__PURE__ */ Q("div", { className: "bm-widget", children: [
2993
- /* @__PURE__ */ $("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
3127
+ /* @__PURE__ */ w("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
2994
3128
  /* @__PURE__ */ Q(
2995
3129
  "select",
2996
3130
  {
2997
3131
  id: "bm-property-select",
2998
3132
  className: "bm-widget__select",
2999
3133
  value: t,
3000
- onChange: (u) => n(u.target.value),
3134
+ onChange: (c) => n(c.target.value),
3001
3135
  children: [
3002
- e.length === 0 && /* @__PURE__ */ $("option", { value: "", children: "— no attributes —" }),
3003
- e.map((u) => /* @__PURE__ */ $("option", { value: u, children: u }, u))
3136
+ e.length === 0 && /* @__PURE__ */ w("option", { value: "", children: "— no attributes —" }),
3137
+ e.map((c) => /* @__PURE__ */ w("option", { value: c, children: c }, c))
3004
3138
  ]
3005
3139
  }
3006
3140
  ),
3007
3141
  i && i.type === "numeric" && /* @__PURE__ */ Q("div", { className: "bm-widget__scale", children: [
3008
- /* @__PURE__ */ $("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((c = i.min) == null ? void 0 : c.toFixed(2)) ?? "—" }),
3009
- /* @__PURE__ */ $("div", { className: "bm-widget__scale-bar" }),
3010
- /* @__PURE__ */ $("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((a = i.max) == null ? void 0 : a.toFixed(2)) ?? "—" })
3142
+ /* @__PURE__ */ w("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((u = i.min) == null ? void 0 : u.toFixed(2)) ?? "—" }),
3143
+ /* @__PURE__ */ w("div", { className: "bm-widget__scale-bar" }),
3144
+ /* @__PURE__ */ w("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((a = i.max) == null ? void 0 : a.toFixed(2)) ?? "—" })
3011
3145
  ] }),
3012
- i && i.type === "categorical" && /* @__PURE__ */ $("div", { className: "bm-widget__categories", children: (i.categories || []).map((u, m) => {
3146
+ i && i.type === "categorical" && /* @__PURE__ */ w("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, m) => {
3013
3147
  const d = Math.round(m / Math.max(i.categories.length, 1) * 360);
3014
- return /* @__PURE__ */ $(
3148
+ return /* @__PURE__ */ w(
3015
3149
  "span",
3016
3150
  {
3017
3151
  className: "bm-widget__category-chip",
3018
3152
  style: { background: `hsl(${d},70%,50%)` },
3019
- children: u
3153
+ children: c
3020
3154
  },
3021
- u
3155
+ c
3022
3156
  );
3023
3157
  }) }),
3024
3158
  /* @__PURE__ */ Q("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
@@ -3026,7 +3160,7 @@ function Go({
3026
3160
  Math.round(r * 100),
3027
3161
  "%)"
3028
3162
  ] }),
3029
- /* @__PURE__ */ $(
3163
+ /* @__PURE__ */ w(
3030
3164
  "input",
3031
3165
  {
3032
3166
  id: "bm-opacity-slider",
@@ -3036,13 +3170,13 @@ function Go({
3036
3170
  max: "1",
3037
3171
  step: "0.01",
3038
3172
  value: r,
3039
- onChange: (u) => o(parseFloat(u.target.value))
3173
+ onChange: (c) => o(parseFloat(c.target.value))
3040
3174
  }
3041
3175
  ),
3042
3176
  s && /* @__PURE__ */ Q("div", { className: "bm-widget__popup", children: [
3043
3177
  /* @__PURE__ */ Q("div", { className: "bm-widget__popup-header", children: [
3044
- /* @__PURE__ */ $("span", { children: "Block attributes" }),
3045
- /* @__PURE__ */ $(
3178
+ /* @__PURE__ */ w("span", { children: "Block attributes" }),
3179
+ /* @__PURE__ */ w(
3046
3180
  "button",
3047
3181
  {
3048
3182
  type: "button",
@@ -3053,14 +3187,14 @@ function Go({
3053
3187
  }
3054
3188
  )
3055
3189
  ] }),
3056
- /* @__PURE__ */ $("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ $("tbody", { children: Object.entries(s).map(([u, m]) => /* @__PURE__ */ Q("tr", { children: [
3057
- /* @__PURE__ */ $("th", { children: u }),
3058
- /* @__PURE__ */ $("td", { children: m == null ? "—" : String(m) })
3059
- ] }, u)) }) })
3190
+ /* @__PURE__ */ w("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ w("tbody", { children: Object.entries(s).map(([c, m]) => /* @__PURE__ */ Q("tr", { children: [
3191
+ /* @__PURE__ */ w("th", { children: c }),
3192
+ /* @__PURE__ */ w("td", { children: m == null ? "—" : String(m) })
3193
+ ] }, c)) }) })
3060
3194
  ] })
3061
3195
  ] });
3062
3196
  }
3063
- function Uo(e) {
3197
+ function Jo(e) {
3064
3198
  const t = typeof e == "string" ? JSON.parse(e) : e;
3065
3199
  if (t.schema_version !== "1.0")
3066
3200
  throw new Error(
@@ -3088,7 +3222,7 @@ function Uo(e) {
3088
3222
  blocks: n
3089
3223
  };
3090
3224
  }
3091
- function wr(e) {
3225
+ function Yr(e) {
3092
3226
  const t = new y.BufferGeometry(), n = new Float32Array(e.vertices.length * 3);
3093
3227
  e.vertices.forEach(([o, i, s], l) => {
3094
3228
  n[l * 3] = o, n[l * 3 + 1] = i, n[l * 3 + 2] = s;
@@ -3098,17 +3232,17 @@ function wr(e) {
3098
3232
  r[l * 3] = o, r[l * 3 + 1] = i, r[l * 3 + 2] = s;
3099
3233
  }), t.setIndex(new y.BufferAttribute(r, 1)), t;
3100
3234
  }
3101
- function Yo(e, t, n = {}) {
3235
+ function Qo(e, t, n = {}) {
3102
3236
  const { defaultOpacity: r = 1 } = n, o = new y.Group();
3103
3237
  return t.blocks.forEach((i) => {
3104
3238
  var b, h;
3105
- const s = wr(i), l = ((b = i.material) == null ? void 0 : b.color) ?? "#888888", c = ((h = i.material) == null ? void 0 : h.opacity) ?? r, a = c < 1, u = new y.MeshStandardMaterial({
3239
+ const s = Yr(i), l = ((b = i.material) == null ? void 0 : b.color) ?? "#888888", u = ((h = i.material) == null ? void 0 : h.opacity) ?? r, a = u < 1, c = new y.MeshStandardMaterial({
3106
3240
  color: new y.Color(l),
3107
- opacity: c,
3241
+ opacity: u,
3108
3242
  transparent: a,
3109
3243
  side: y.DoubleSide,
3110
3244
  flatShading: !0
3111
- }), m = new y.Mesh(s, u);
3245
+ }), m = new y.Mesh(s, c);
3112
3246
  m.userData = {
3113
3247
  id: i.id,
3114
3248
  attributes: i.attributes
@@ -3118,142 +3252,148 @@ function Yo(e, t, n = {}) {
3118
3252
  }), e.add(o), o;
3119
3253
  }
3120
3254
  export {
3121
- Wn as ASSAY_COLOR_PALETTE_10,
3122
- rn as ASSAY_NON_VALUE_FIELDS,
3123
- B as AZIMUTH,
3124
- Jr as BASELODE_DATA_MODEL_DRILL_ASSAY,
3125
- Zr as BASELODE_DATA_MODEL_DRILL_COLLAR,
3126
- tn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
3127
- Kr as BASELODE_DATA_MODEL_DRILL_SURVEY,
3128
- Qr as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
3129
- Ro as Baselode3DControls,
3130
- Bo as Baselode3DScene,
3131
- Go as BlockModelWidget,
3132
- Qe as CHART_OPTIONS,
3133
- dn as COMMENT_COLUMN_NAMES,
3134
- bt as CRS,
3135
- nn as DEFAULT_COLUMN_MAP,
3255
+ nr as ASSAY_COLOR_PALETTE_10,
3256
+ on as ASSAY_NON_VALUE_FIELDS,
3257
+ j as AZIMUTH,
3258
+ io as BASELODE_DATA_MODEL_DRILL_ASSAY,
3259
+ ro as BASELODE_DATA_MODEL_DRILL_COLLAR,
3260
+ nn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
3261
+ oo as BASELODE_DATA_MODEL_DRILL_SURVEY,
3262
+ so as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
3263
+ je as BUILTIN_COLOUR_MAPS,
3264
+ Zo as Baselode3DControls,
3265
+ Wo as Baselode3DScene,
3266
+ Ko as BlockModelWidget,
3267
+ tt as CHART_OPTIONS,
3268
+ fn as COMMENT_COLUMN_NAMES,
3269
+ Le as COMMODITY_COLOURS,
3270
+ gt as CRS,
3271
+ rn as DEFAULT_COLUMN_MAP,
3136
3272
  q as DEPTH,
3137
3273
  R as DIP,
3138
- Se as DISPLAY_CATEGORICAL,
3139
- xe as DISPLAY_COMMENT,
3274
+ ve as DISPLAY_CATEGORICAL,
3275
+ Ee as DISPLAY_COMMENT,
3140
3276
  Oe as DISPLAY_HIDDEN,
3141
- Ie as DISPLAY_NUMERIC,
3142
- Ge as DISPLAY_TADPOLE,
3277
+ Ae as DISPLAY_NUMERIC,
3278
+ Ye as DISPLAY_TADPOLE,
3143
3279
  de as EASTING,
3144
3280
  Me as ELEVATION,
3145
- Vn as ERROR_COLOR,
3146
- pr as FOV_MAX_DEG,
3147
- hr as FOV_MIN_DEG,
3148
- S as FROM,
3281
+ Un as ERROR_COLOR,
3282
+ $n as FALLBACK_COLOUR,
3283
+ Mr as FOV_MAX_DEG,
3284
+ zr as FOV_MIN_DEG,
3285
+ v as FROM,
3149
3286
  oe as GEOLOGY_CODE,
3150
3287
  ie as GEOLOGY_DESCRIPTION,
3151
- et as HIDDEN_COLUMNS,
3288
+ nt as HIDDEN_COLUMNS,
3152
3289
  z as HOLE_ID,
3153
3290
  te as LATITUDE,
3291
+ Bn as LITHOLOGY_COLOURS,
3154
3292
  ne as LONGITUDE,
3155
- Ee as MID,
3293
+ Ce as MID,
3156
3294
  fe as NORTHING,
3157
- ot as NUMERIC_LINE_COLOR,
3158
- $n as NUMERIC_MARKER_COLOR,
3295
+ jn as NUMERIC_LINE_COLOR,
3296
+ Rn as NUMERIC_MARKER_COLOR,
3159
3297
  ae as PROJECT_ID,
3160
- en as STRIKE,
3161
- D as TO,
3162
- Fo as TracePlot,
3163
- Yo as addGradeBlocksToScene,
3164
- Fn as alphaBetaToNormal,
3165
- jo as annotationsFromIntervals,
3166
- xo as assembleDataset,
3167
- ho as attachAssayPositions,
3168
- mo as balancedTangentialDesurvey,
3169
- bn as buildAssayState,
3170
- ko as buildCategoricalStripLogConfig,
3171
- Yn as buildCommentsConfig,
3172
- Zn as buildEqualRangeColorScale,
3173
- jn as buildIntervalPoints,
3174
- Dt as buildPlotConfig,
3175
- Lo as buildStrikeDipSymbol,
3176
- or as buildStructuralDiscs,
3177
- Oo as buildStructuralStripConfig,
3178
- Un as buildTadpoleConfig,
3179
- fo as buildTraces,
3180
- Ke as buildViewSignature,
3181
- Ao as calculateBlockVolume,
3182
- vn as calculatePropertyStats,
3183
- fn as classifyColumns,
3184
- Mo as coerceNumeric,
3185
- Tn as computeStructuralPositions,
3186
- so as defaultChartType,
3187
- Le as deriveAssayProps,
3188
- co as desurveyTraces,
3189
- rr as dipAzimuthToNormal,
3190
- dr as dolly,
3191
- ar as emitViewChangeIfNeeded,
3192
- An as filterBlocks,
3193
- zo as filterByProject,
3194
- Je as fitCameraToBounds,
3195
- fr as focusOnLastBounds,
3196
- vo as getBlockStats,
3197
- Nr as getCategoryHexColor,
3198
- Ye as getChartOptions,
3298
+ tn as STRIKE,
3299
+ S as TO,
3300
+ jo as TracePlot,
3301
+ Qo as addGradeBlocksToScene,
3302
+ Tn as alphaBetaToNormal,
3303
+ Xo as annotationsFromIntervals,
3304
+ Fo as assembleDataset,
3305
+ zo as attachAssayPositions,
3306
+ _o as balancedTangentialDesurvey,
3307
+ gn as buildAssayState,
3308
+ Bo as buildCategoricalStripLogConfig,
3309
+ Qn as buildCommentsConfig,
3310
+ rr as buildEqualRangeColorScale,
3311
+ Xn as buildIntervalPoints,
3312
+ Ft as buildPlotConfig,
3313
+ Ho as buildStrikeDipSymbol,
3314
+ mr as buildStructuralDiscs,
3315
+ Vo as buildStructuralStripConfig,
3316
+ Jn as buildTadpoleConfig,
3317
+ No as buildTraces,
3318
+ Qe as buildViewSignature,
3319
+ ko as calculateBlockVolume,
3320
+ xn as calculatePropertyStats,
3321
+ hn as classifyColumns,
3322
+ So as coerceNumeric,
3323
+ wn as computeStructuralPositions,
3324
+ ho as defaultChartType,
3325
+ ke as deriveAssayProps,
3326
+ go as desurveyTraces,
3327
+ ur as dipAzimuthToNormal,
3328
+ _r as dolly,
3329
+ pr as emitViewChangeIfNeeded,
3330
+ vn as filterBlocks,
3331
+ vo as filterByProject,
3332
+ et as fitCameraToBounds,
3333
+ Nr as focusOnLastBounds,
3334
+ Oo as getBlockStats,
3335
+ xr as getCategoryHexColor,
3336
+ Xe as getChartOptions,
3199
3337
  Sn as getColorForValue,
3200
- Ot as getEqualRangeBinIndex,
3201
- Jn as getEqualRangeColor,
3338
+ Vn as getColour,
3339
+ kt as getEqualRangeBinIndex,
3340
+ ir as getEqualRangeColor,
3202
3341
  $t as getViewState,
3203
- wr as gradeBlockToThreeGeometry,
3204
- Pn as groupRowsByHole,
3205
- Hn as holeHasData,
3342
+ Yr as gradeBlockToThreeGeometry,
3343
+ Dn as groupRowsByHole,
3344
+ qn as holeHasData,
3206
3345
  Ln as interpolateTrace,
3207
- Ho as intervalsAsTubes,
3208
- No as joinAssaysToTraces,
3209
- lo as loadAssayFile,
3210
- pn as loadAssayHole,
3211
- hn as loadAssayMetadata,
3212
- yo as loadAssays,
3213
- Eo as loadBlockModelMetadata,
3214
- bo as loadCollars,
3215
- _o as loadGeology,
3216
- Uo as loadGradeBlocksFromJson,
3217
- go as loadSurveys,
3346
+ qo as intervalsAsTubes,
3347
+ xo as joinAssaysToTraces,
3348
+ po as loadAssayFile,
3349
+ bn as loadAssayHole,
3350
+ pn as loadAssayMetadata,
3351
+ Co as loadAssays,
3352
+ Po as loadBlockModelMetadata,
3353
+ Eo as loadCollars,
3354
+ Io as loadGeology,
3355
+ Jo as loadGradeBlocksFromJson,
3356
+ Ao as loadSurveys,
3218
3357
  $e as loadTable,
3219
- no as logDataInfo,
3220
- to as logDataWarning,
3221
- ur as lookDown,
3222
- _n as minimumCurvatureDesurvey,
3223
- En as normalizeBlockRow,
3224
- oo as normalizeCsvRow,
3225
- Ce as normalizeFieldName,
3226
- mr as pan,
3227
- kn as parseAssayCsvTextToHoles,
3228
- cn as parseAssayHole,
3229
- ro as parseAssayHoleIds,
3230
- an as parseAssayHoleIdsWithAssays,
3231
- un as parseAssaysCSV,
3232
- Io as parseBlockModelCSV,
3233
- po as parseDrillholesCSV,
3234
- On as parseGeologyCsvText,
3235
- Cn as parseStructuralCSV,
3236
- Po as parseStructuralIntervalsCSV,
3237
- Do as parseStructuralPointsCSV,
3238
- ao as parseSurveyCSV,
3239
- Co as parseUnifiedDataset,
3240
- io as pickFirstPresent,
3241
- $o as planView,
3242
- Qn as projectTraceToSection,
3243
- cr as recenterCameraToOrigin,
3244
- Mt as reorderHoleIds,
3245
- Vo as sectionView,
3246
- er as sectionWindow,
3247
- gr as setControlMode,
3248
- br as setFov,
3249
- lr as setViewState,
3358
+ co as logDataInfo,
3359
+ ao as logDataWarning,
3360
+ gr as lookDown,
3361
+ Nn as minimumCurvatureDesurvey,
3362
+ In as normalizeBlockRow,
3363
+ mo as normalizeCsvRow,
3364
+ De as normalizeFieldName,
3365
+ yr as pan,
3366
+ On as parseAssayCsvTextToHoles,
3367
+ un as parseAssayHole,
3368
+ uo as parseAssayHoleIds,
3369
+ cn as parseAssayHoleIdsWithAssays,
3370
+ mn as parseAssaysCSV,
3371
+ Do as parseBlockModelCSV,
3372
+ Mo as parseDrillholesCSV,
3373
+ kn as parseGeologyCsvText,
3374
+ Pn as parseStructuralCSV,
3375
+ wo as parseStructuralIntervalsCSV,
3376
+ To as parseStructuralPointsCSV,
3377
+ bo as parseSurveyCSV,
3378
+ $o as parseUnifiedDataset,
3379
+ fo as pickFirstPresent,
3380
+ Go as planView,
3381
+ sr as projectTraceToSection,
3382
+ br as recenterCameraToOrigin,
3383
+ Et as reorderHoleIds,
3384
+ Hn as resolveColourMap,
3385
+ Uo as sectionView,
3386
+ lr as sectionWindow,
3387
+ Ar as setControlMode,
3388
+ Er as setFov,
3389
+ hr as setViewState,
3250
3390
  he as standardizeColumns,
3251
- eo as standardizeRowArray,
3252
- uo as tangentialDesurvey,
3253
- on as toError,
3254
- wo as tracesAsSegments,
3255
- To as useDrillholeTraceGrid,
3256
- So as validateStructuralPoints,
3257
- H as withDataErrorContext
3391
+ lo as standardizeRowArray,
3392
+ yo as tangentialDesurvey,
3393
+ sn as toError,
3394
+ Yo as tracesAsSegments,
3395
+ Ro as useDrillholeTraceGrid,
3396
+ Lo as validateStructuralPoints,
3397
+ V as withDataErrorContext
3258
3398
  };
3259
3399
  //# sourceMappingURL=baselode.js.map