baselode 0.1.16 → 0.1.17

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
- import te from "papaparse";
2
- import { jsx as P, jsxs as J } from "react/jsx-runtime";
3
- import { useRef as De, useState as Q, useEffect as se, useMemo as ne, useCallback as Ue } from "react";
1
+ import Q from "papaparse";
2
+ import { jsx as P, jsxs as K } from "react/jsx-runtime";
3
+ import { useRef as De, useState as ee, useEffect as se, useMemo as ne, useCallback as Ue } from "react";
4
4
  import Fe from "plotly.js-dist-min";
5
- import * as _ from "three";
6
- import { OrbitControls as on } from "three/examples/jsm/controls/OrbitControls";
7
- import { FlyControls as sn } from "three/examples/jsm/controls/FlyControls";
8
- import { ViewportGizmo as ln } from "three-viewport-gizmo";
9
- import { EffectComposer as an } from "three/examples/jsm/postprocessing/EffectComposer.js";
10
- import { RenderPass as cn } from "three/examples/jsm/postprocessing/RenderPass.js";
11
- import { OutlinePass as un } from "three/examples/jsm/postprocessing/OutlinePass.js";
12
- const k = "hole_id", oe = "latitude", ie = "longitude", xe = "elevation", X = "azimuth", q = "dip", F = "from", $ = "to", Ie = "mid", me = "project_id", pe = "easting", be = "northing", Et = "crs", W = "depth", xt = "alpha", kt = "beta", dn = "strike", ae = "geology_code", ce = "geology_description", Fo = {
5
+ import * as y from "three";
6
+ import { OrbitControls as un } from "three/examples/jsm/controls/OrbitControls";
7
+ import { FlyControls as dn } from "three/examples/jsm/controls/FlyControls";
8
+ import { ViewportGizmo as mn } from "three-viewport-gizmo";
9
+ import { EffectComposer as fn } from "three/examples/jsm/postprocessing/EffectComposer.js";
10
+ import { RenderPass as hn } from "three/examples/jsm/postprocessing/RenderPass.js";
11
+ import { OutlinePass as pn } from "three/examples/jsm/postprocessing/OutlinePass.js";
12
+ const k = "hole_id", oe = "latitude", ie = "longitude", ke = "elevation", q = "azimuth", W = "dip", F = "from", T = "to", ye = "mid", me = "project_id", be = "easting", ge = "northing", kt = "crs", X = "depth", At = "alpha", It = "beta", bn = "strike", ae = "geology_code", ce = "geology_description", Ko = {
13
13
  // A unique hole identifier across the entire dataset and all future data sets
14
14
  [k]: "string",
15
15
  // The hole ID from the original collar source
@@ -21,62 +21,68 @@ const k = "hole_id", oe = "latitude", ie = "longitude", xe = "elevation", X = "a
21
21
  // The longitude of the collar, in decimal degrees (WGS84)
22
22
  [ie]: "number",
23
23
  // The elevation of the collar, in meters above sea level (WGS84)
24
- [xe]: "number",
24
+ [ke]: "number",
25
25
  // The easting coordinate of the collar, in meters (projected CRS)
26
- [pe]: "number",
27
- // The northing coordinate of the collar, in meters (projected CRS)
28
26
  [be]: "number",
27
+ // The northing coordinate of the collar, in meters (projected CRS)
28
+ [ge]: "number",
29
29
  // The coordinate reference system of the collar coordinates for easting/northing, as an EPSG code or proj string
30
- [Et]: "string"
31
- }, wo = {
30
+ [kt]: "string"
31
+ }, Jo = {
32
32
  // The unique hole id that maps to the collar and any other data tables
33
33
  [k]: "string",
34
34
  // The depth along the hole where the survey measurement was taken / started
35
- [W]: "number",
35
+ [X]: "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
- [$]: "number",
37
+ [T]: "number",
38
38
  // The azimuth of the hole at the survey depth, in degrees from north
39
- [X]: "number",
39
+ [q]: "number",
40
40
  // The dip of the hole at the survey depth, in degrees from horizontal (negative values indicate downward inclination)
41
- [q]: "number"
42
- }, To = {
41
+ [W]: "number"
42
+ }, Qo = {
43
43
  // The unique hole id that maps to the collar and any other data tables
44
44
  [k]: "string",
45
45
  // The depth along the hole where the assay interval starts
46
46
  [F]: "number",
47
47
  // The depth along the hole where the assay interval ends
48
- [$]: "number",
48
+ [T]: "number",
49
49
  // The midpoint depth of the assay interval
50
- [Ie]: "number"
50
+ [ye]: "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
- }, mn = {
53
+ }, gn = {
54
54
  [k]: "string",
55
55
  [F]: "number",
56
- [$]: "number",
57
- [Ie]: "number",
56
+ [T]: "number",
57
+ [ye]: "number",
58
58
  [ae]: "string",
59
59
  [ce]: "string"
60
- }, $o = {
60
+ }, ei = {
61
61
  [k]: "string",
62
+ [X]: "number",
62
63
  [W]: "number",
63
64
  [q]: "number",
64
- [X]: "number",
65
- [xt]: "number",
66
- [kt]: "number",
65
+ [At]: "number",
66
+ [It]: "number",
67
67
  comments: "string"
68
- }, fn = {
68
+ }, ti = {
69
+ [k]: "string",
70
+ [F]: "number",
71
+ [T]: "number",
72
+ [ye]: "number"
73
+ // value columns are variable — not standardized here
74
+ }, Ot = -999.25, yn = {
69
75
  [k]: ["hole_id", "holeid", "hole id", "hole-id"],
70
76
  datasource_hole_id: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
71
77
  [me]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
72
78
  [oe]: ["latitude", "lat"],
73
79
  [ie]: ["longitude", "lon"],
74
- [xe]: ["elevation", "rl", "elev", "z"],
75
- [pe]: ["easting", "x"],
76
- [be]: ["northing", "y"],
77
- [Et]: ["crs", "epsg", "projection"],
80
+ [ke]: ["elevation", "rl", "elev", "z"],
81
+ [be]: ["easting", "x"],
82
+ [ge]: ["northing", "y"],
83
+ [kt]: ["crs", "epsg", "projection"],
78
84
  [F]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
79
- [$]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
85
+ [T]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
80
86
  [ae]: [
81
87
  "geology_code",
82
88
  "geologycode",
@@ -98,42 +104,42 @@ const k = "hole_id", oe = "latitude", ie = "longitude", xe = "elevation", X = "a
98
104
  "description",
99
105
  "comments"
100
106
  ],
101
- [X]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
102
- [q]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
103
- [xt]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
104
- [kt]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
107
+ [q]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
108
+ [W]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
109
+ [At]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
110
+ [It]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
105
111
  declination: ["declination", "dec"],
106
- [W]: ["depth", "survey_depth", "surveydepth"],
107
- [dn]: ["strike", "str"]
108
- }, At = {};
109
- for (const [e, t] of Object.entries(fn))
112
+ [X]: ["depth", "survey_depth", "surveydepth", "md", "measured_depth", "dept"],
113
+ [bn]: ["strike", "str"]
114
+ }, St = {};
115
+ for (const [e, t] of Object.entries(yn))
110
116
  for (const n of t) {
111
117
  const r = n.toLowerCase().trim();
112
- At[r] = e;
118
+ St[r] = e;
113
119
  }
114
- function we(e) {
120
+ function Pe(e) {
115
121
  return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
116
122
  }
117
- function ge(e, t = null, n = null) {
118
- const r = { ...At };
123
+ function fe(e, t = null, n = null) {
124
+ const r = { ...St };
119
125
  if (n) {
120
126
  for (const [i, s] of Object.entries(n))
121
127
  if (i != null && s != null) {
122
- const l = we(i), c = we(s);
128
+ const l = Pe(i), c = Pe(s);
123
129
  r[l] = c;
124
130
  }
125
131
  }
126
132
  const o = {};
127
133
  for (const [i, s] of Object.entries(e)) {
128
- const l = we(i), c = r[l] || l;
134
+ const l = Pe(i), c = r[l] || l;
129
135
  o[c] = s;
130
136
  }
131
137
  return o;
132
138
  }
133
- function Ro(e, t = null, n = null) {
134
- return e.map((r) => ge(r, t, n));
139
+ function ni(e, t = null, n = null) {
140
+ return e.map((r) => fe(r, t, n));
135
141
  }
136
- const hn = /* @__PURE__ */ new Set([
142
+ const _n = /* @__PURE__ */ new Set([
137
143
  "hole_id",
138
144
  "holeid",
139
145
  "id",
@@ -166,33 +172,33 @@ const hn = /* @__PURE__ */ new Set([
166
172
  "comment",
167
173
  "z"
168
174
  ]), Ke = "[baselode:data]";
169
- function pn(e, t = "Unknown error") {
175
+ function Nn(e, t = "Unknown error") {
170
176
  if (e instanceof Error) return e;
171
177
  const n = typeof e == "string" && e.trim() ? e : t;
172
178
  return new Error(n);
173
179
  }
174
180
  function Y(e, t, n = "Operation failed") {
175
- const r = pn(t, n), o = new Error(`${e}: ${r.message}`);
181
+ const r = Nn(t, n), o = new Error(`${e}: ${r.message}`);
176
182
  return o.cause = r, o;
177
183
  }
178
- function Bo(e, t) {
184
+ function ri(e, t) {
179
185
  if (t !== void 0) {
180
186
  console.warn(`${Ke} ${e}`, t);
181
187
  return;
182
188
  }
183
189
  console.warn(`${Ke} ${e}`);
184
190
  }
185
- function Vo(e) {
191
+ function oi(e) {
186
192
  console.info(`${Ke} ${e}`);
187
193
  }
188
- const He = (e, t = null) => ge(e, null, t);
189
- function bn(e) {
194
+ const He = (e, t = null) => fe(e, null, t);
195
+ function Mn(e) {
190
196
  return { holeId: e[k] };
191
197
  }
192
- function It(e, t = null) {
198
+ function Lt(e, t = null) {
193
199
  const n = e[k], r = n !== void 0 ? `${n}`.trim() : "";
194
200
  if (!r) return null;
195
- const o = e[me] || e.project || e.project_code, i = Number(e[F]), s = Number(e[$]);
201
+ const o = e[me] || e.project || e.project_code, i = Number(e[F]), s = Number(e[T]);
196
202
  return !Number.isFinite(i) || !Number.isFinite(s) || s <= i ? null : {
197
203
  holeId: r,
198
204
  project: o,
@@ -201,7 +207,7 @@ function It(e, t = null) {
201
207
  ...e
202
208
  };
203
209
  }
204
- function Ot(e, t) {
210
+ function Dt(e, t) {
205
211
  var o;
206
212
  const n = t.sort((i, s) => i.from - s.from), r = [];
207
213
  return n.forEach((i) => {
@@ -216,10 +222,10 @@ function Ot(e, t) {
216
222
  r.push(u), r.push({ ...u, z: l });
217
223
  }), { id: e, project: (o = n[0]) == null ? void 0 : o.project, points: r };
218
224
  }
219
- function Ho(e, t = null) {
225
+ function ii(e, t = null) {
220
226
  return new Promise((n, r) => {
221
227
  const o = /* @__PURE__ */ new Set();
222
- te.parse(e, {
228
+ Q.parse(e, {
223
229
  header: !0,
224
230
  dynamicTyping: !0,
225
231
  skipEmptyLines: !0,
@@ -232,20 +238,20 @@ function Ho(e, t = null) {
232
238
  });
233
239
  });
234
240
  }
235
- function gn(e) {
236
- return Object.entries(e || {}).some(([t, n]) => !(hn.has(t) || n == null || typeof n == "string" && n.trim() === ""));
241
+ function vn(e) {
242
+ return Object.entries(e || {}).some(([t, n]) => !(_n.has(t) || n == null || typeof n == "string" && n.trim() === ""));
237
243
  }
238
- function yn(e, t = null) {
244
+ function zn(e, t = null) {
239
245
  return new Promise((n, r) => {
240
246
  const o = /* @__PURE__ */ new Map();
241
- te.parse(e, {
247
+ Q.parse(e, {
242
248
  header: !0,
243
249
  dynamicTyping: !0,
244
250
  skipEmptyLines: !0,
245
251
  step: (i) => {
246
252
  const s = He(i.data, t);
247
- if (!gn(s)) return;
248
- const c = bn(s).holeId;
253
+ if (!vn(s)) return;
254
+ const c = Mn(s).holeId;
249
255
  if (c !== void 0 && `${c}`.trim() !== "") {
250
256
  const a = `${c}`.trim();
251
257
  o.has(a) || o.set(a, {
@@ -258,7 +264,7 @@ function yn(e, t = null) {
258
264
  });
259
265
  });
260
266
  }
261
- function _n(e, t, n = null, r = null) {
267
+ function En(e, t, n = null, r = null) {
262
268
  return new Promise((o, i) => {
263
269
  const s = `${t}`.trim();
264
270
  if (!s) {
@@ -266,12 +272,12 @@ function _n(e, t, n = null, r = null) {
266
272
  return;
267
273
  }
268
274
  const l = [];
269
- te.parse(e, {
275
+ Q.parse(e, {
270
276
  header: !0,
271
277
  dynamicTyping: !0,
272
278
  skipEmptyLines: !0,
273
279
  step: (c) => {
274
- const a = He(c.data, r), u = It(a, r);
280
+ const a = He(c.data, r), u = Lt(a, r);
275
281
  u && `${u.holeId}`.trim() === s && l.push(u);
276
282
  },
277
283
  complete: () => {
@@ -279,39 +285,39 @@ function _n(e, t, n = null, r = null) {
279
285
  o(null);
280
286
  return;
281
287
  }
282
- const c = Ot(s, l);
288
+ const c = Dt(s, l);
283
289
  o(c);
284
290
  },
285
291
  error: (c) => i(Y("parseAssayHole", c))
286
292
  });
287
293
  });
288
294
  }
289
- function Nn(e, t = null, n = null) {
295
+ function xn(e, t = null, n = null) {
290
296
  return new Promise((r, o) => {
291
- te.parse(e, {
297
+ Q.parse(e, {
292
298
  header: !0,
293
299
  dynamicTyping: !0,
294
300
  skipEmptyLines: !0,
295
301
  complete: (i) => {
296
302
  const s = /* @__PURE__ */ new Map();
297
303
  i.data.forEach((c) => {
298
- const a = He(c, n), u = It(a, n);
304
+ const a = He(c, n), u = Lt(a, n);
299
305
  u && (s.has(u.holeId) || s.set(u.holeId, []), s.get(u.holeId).push(u));
300
306
  });
301
- const l = Array.from(s.entries()).map(([c, a]) => Ot(c, a));
307
+ const l = Array.from(s.entries()).map(([c, a]) => Dt(c, a));
302
308
  r({ holes: l });
303
309
  },
304
310
  error: (i) => o(Y("parseAssaysCSV", i))
305
311
  });
306
312
  });
307
313
  }
308
- function jo(e = {}) {
314
+ function si(e = {}) {
309
315
  const t = {};
310
316
  return Object.entries(e || {}).forEach(([n, r]) => {
311
- n && (t[we(n)] = r);
317
+ n && (t[Pe(n)] = r);
312
318
  }), t;
313
319
  }
314
- function Go(e = {}, t = [], n) {
320
+ function li(e = {}, t = [], n) {
315
321
  for (const r of t) {
316
322
  const o = e[r];
317
323
  if (o != null && `${o}`.trim() !== "")
@@ -319,7 +325,7 @@ function Go(e = {}, t = [], n) {
319
325
  }
320
326
  return n;
321
327
  }
322
- const Mn = 4;
328
+ const kn = 4;
323
329
  function Ct(e = [], t = "") {
324
330
  if (!e.length) return [];
325
331
  if (!t) return e;
@@ -337,10 +343,10 @@ function Te({
337
343
  } = {}) {
338
344
  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
345
  }
340
- function St({
346
+ function wt({
341
347
  holeIds: e = [],
342
348
  focusedHoleId: t = "",
343
- plotCount: n = Mn,
349
+ plotCount: n = kn,
344
350
  defaultProp: r = "",
345
351
  categoricalProps: o = [],
346
352
  commentProps: i = [],
@@ -362,24 +368,24 @@ function St({
362
368
  };
363
369
  });
364
370
  }
365
- const Ae = "numeric", Le = "categorical", ke = "comment", $e = "hidden", Je = "tadpole", at = {
366
- [Ae]: [
371
+ const Ie = "numeric", Ce = "categorical", Ae = "comment", $e = "hidden", Je = "tadpole", ct = {
372
+ [Ie]: [
367
373
  { value: "bar", label: "Bars" },
368
374
  { value: "markers", label: "Markers" },
369
375
  { value: "markers+line", label: "Markers + Line" },
370
376
  { value: "line", label: "Line only" }
371
377
  ],
372
- [Le]: [
378
+ [Ce]: [
373
379
  { value: "categorical", label: "Categorical bands" }
374
380
  ],
375
- [ke]: [
381
+ [Ae]: [
376
382
  { value: "comment", label: "Comments" }
377
383
  ],
378
384
  [Je]: [
379
385
  { value: "tadpole", label: "Tadpole" }
380
386
  ],
381
387
  [$e]: []
382
- }, ct = /* @__PURE__ */ new Set([
388
+ }, ut = /* @__PURE__ */ new Set([
383
389
  // Hole identifiers
384
390
  "hole_id",
385
391
  "holeid",
@@ -434,7 +440,7 @@ const Ae = "numeric", Le = "categorical", ke = "comment", $e = "hidden", Je = "t
434
440
  "data_source",
435
441
  "_hole_key",
436
442
  "_hole_id_key"
437
- ]), zn = /* @__PURE__ */ new Set([
443
+ ]), An = /* @__PURE__ */ new Set([
438
444
  "comments",
439
445
  "comment",
440
446
  "notes",
@@ -447,22 +453,22 @@ const Ae = "numeric", Le = "categorical", ke = "comment", $e = "hidden", Je = "t
447
453
  "structcomment",
448
454
  "geology_description"
449
455
  ]);
450
- function vn(e) {
456
+ function In(e) {
451
457
  if (!(e != null && e.length))
452
458
  return { byType: {}, numericCols: [], categoricalCols: [], commentCols: [] };
453
459
  const t = new Set(e.flatMap((r) => Object.keys(r || {}))), n = {};
454
460
  for (const r of t) {
455
461
  const o = r.toLowerCase().trim();
456
- if (ct.has(o) || ct.has(r)) {
462
+ if (ut.has(o) || ut.has(r)) {
457
463
  n[r] = $e;
458
464
  continue;
459
465
  }
460
- if (zn.has(o)) {
466
+ if (An.has(o)) {
461
467
  const l = e.some((c) => {
462
468
  const a = c[r];
463
469
  return a != null && String(a).trim() !== "" && String(a) !== "null";
464
470
  });
465
- n[r] = l ? ke : $e;
471
+ n[r] = l ? Ae : $e;
466
472
  continue;
467
473
  }
468
474
  let i = !1, s = !1;
@@ -473,24 +479,24 @@ function vn(e) {
473
479
  break;
474
480
  }
475
481
  }
476
- s ? i ? n[r] = Ae : n[r] = Le : n[r] = $e;
482
+ s ? i ? n[r] = Ie : n[r] = Ce : n[r] = $e;
477
483
  }
478
484
  return {
479
485
  byType: n,
480
- numericCols: Object.entries(n).filter(([, r]) => r === Ae).map(([r]) => r),
481
- categoricalCols: Object.entries(n).filter(([, r]) => r === Le).map(([r]) => r),
482
- commentCols: Object.entries(n).filter(([, r]) => r === ke).map(([r]) => r)
486
+ numericCols: Object.entries(n).filter(([, r]) => r === Ie).map(([r]) => r),
487
+ categoricalCols: Object.entries(n).filter(([, r]) => r === Ce).map(([r]) => r),
488
+ commentCols: Object.entries(n).filter(([, r]) => r === Ae).map(([r]) => r)
483
489
  };
484
490
  }
485
- function et(e) {
486
- return at[e] ?? at[Ae];
491
+ function tt(e) {
492
+ return ct[e] ?? ct[Ie];
487
493
  }
488
- function Uo(e) {
489
- const t = et(e);
490
- return t.length ? e === Ae ? "line" : t[0].value : "markers+line";
494
+ function ai(e) {
495
+ const t = tt(e);
496
+ return t.length ? e === Ie ? "line" : t[0].value : "markers+line";
491
497
  }
492
498
  function Re(e = []) {
493
- const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } = vn(t), s = n[0] || r[0] || "";
499
+ const t = e.flatMap((l) => l.points || []), { numericCols: n, categoricalCols: r, commentCols: o, byType: i } = In(t), s = n[0] || r[0] || "";
494
500
  return {
495
501
  numericProps: n,
496
502
  categoricalProps: r,
@@ -499,15 +505,15 @@ function Re(e = []) {
499
505
  defaultProp: s
500
506
  };
501
507
  }
502
- async function En(e, t = null) {
503
- return await yn(e);
508
+ async function On(e, t = null) {
509
+ return await zn(e);
504
510
  }
505
- async function xn(e, t, n = null) {
506
- return await _n(e, t);
511
+ async function Sn(e, t, n = null) {
512
+ return await En(e, t);
507
513
  }
508
- function kn(e = [], t = "") {
514
+ function Ln(e = [], t = "") {
509
515
  if (!e.length) return null;
510
- const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Re(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), c = St({
516
+ const { numericProps: n, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Re(e), l = e.map((a) => a.id || a.holeId).filter(Boolean), c = wt({
511
517
  holeIds: l,
512
518
  focusedHoleId: t,
513
519
  plotCount: 4,
@@ -526,36 +532,36 @@ function kn(e = [], t = "") {
526
532
  traceConfigs: c
527
533
  };
528
534
  }
529
- async function Yo(e, t = "", n = null) {
530
- const { holes: r } = await Nn(e, n), o = kn(r, t);
535
+ async function ci(e, t = "", n = null) {
536
+ const { holes: r } = await xn(e, n), o = Ln(r, t);
531
537
  if (!o) throw new Error("No valid assay intervals found.");
532
538
  return o;
533
539
  }
534
- function Xo(e, t = null) {
540
+ function ui(e, t = null) {
535
541
  return new Promise((n, r) => {
536
- te.parse(e, {
542
+ Q.parse(e, {
537
543
  header: !0,
538
544
  dynamicTyping: !0,
539
545
  skipEmptyLines: !0,
540
546
  complete: (o) => {
541
- const i = o.data.map((s) => An(s, t)).filter((s) => s[k] && Number.isFinite(s[W]) && Number.isFinite(s[q]) && Number.isFinite(s[X]));
547
+ const i = o.data.map((s) => Dn(s, t)).filter((s) => s[k] && Number.isFinite(s[X]) && Number.isFinite(s[W]) && Number.isFinite(s[q]));
542
548
  n(i);
543
549
  },
544
550
  error: (o) => r(Y("parseSurveyCSV", o))
545
551
  });
546
552
  });
547
553
  }
548
- function An(e, t = null) {
549
- const n = ge(e, null, t), r = n[k], o = n[me] || n.project || n.project_code, i = ve(n[oe]), s = ve(n[ie]), l = ve(n[W]), c = ve(n[q]), a = ve(n[X]), u = ve(n.maxdepth);
554
+ function Dn(e, t = null) {
555
+ const n = fe(e, null, t), r = n[k], o = n[me] || n.project || n.project_code, i = Ee(n[oe]), s = Ee(n[ie]), l = Ee(n[X]), c = Ee(n[W]), a = Ee(n[q]), u = Ee(n.maxdepth);
550
556
  return {
551
557
  raw: n,
552
558
  [k]: r,
553
559
  [me]: o,
554
560
  [oe]: i,
555
561
  [ie]: s,
556
- [W]: l,
557
- [q]: c,
558
- [X]: a,
562
+ [X]: l,
563
+ [W]: c,
564
+ [q]: a,
559
565
  maxdepth: u,
560
566
  // Legacy field names for backwards compatibility
561
567
  project_code: o,
@@ -564,11 +570,11 @@ function An(e, t = null) {
564
570
  surveydepth: l
565
571
  };
566
572
  }
567
- const ve = (e) => {
573
+ const Ee = (e) => {
568
574
  const t = Number(e);
569
575
  return Number.isFinite(t) ? t : void 0;
570
576
  };
571
- function qo(e, t) {
577
+ function di(e, t) {
572
578
  var a, u, m, d;
573
579
  const n = /* @__PURE__ */ new Map();
574
580
  e.forEach((f) => {
@@ -588,52 +594,52 @@ function qo(e, t) {
588
594
  return l.forEach((f, h) => {
589
595
  const g = n.get(h);
590
596
  if (!g) return;
591
- const y = f.filter((O) => Number.isFinite(O[W] ?? O.surveydepth)).sort((O, V) => (O[W] ?? O.surveydepth) - (V[W] ?? V.surveydepth));
592
- if (!y.length) return;
593
- const p = g.lat ?? g[oe], b = g.lng ?? g[ie], N = 111132, M = 111320 * Math.cos(p * Math.PI / 180), I = (b - o) * s, x = (p - r) * i, S = [];
594
- let w = 0, D = 0, v = 0;
595
- for (let O = 0; O < y.length; O += 1) {
596
- const V = y[O], H = y[O - 1], A = V[W] ?? V.surveydepth, E = V[X] ?? V.azimuth, z = V[q] ?? V.dip;
597
+ const N = f.filter((I) => Number.isFinite(I[X] ?? I.surveydepth)).sort((I, B) => (I[X] ?? I.surveydepth) - (B[X] ?? B.surveydepth));
598
+ if (!N.length) return;
599
+ const p = g.lat ?? g[oe], b = g.lng ?? g[ie], M = 111132, v = 111320 * Math.cos(p * Math.PI / 180), O = (b - o) * s, z = (p - r) * i, L = [];
600
+ let w = 0, C = 0, _ = 0;
601
+ for (let I = 0; I < N.length; I += 1) {
602
+ const B = N[I], H = N[I - 1], S = B[X] ?? B.surveydepth, x = B[q] ?? B.azimuth, E = B[W] ?? B.dip;
597
603
  if (!H) {
598
- S.push({
599
- x: I + w,
600
- y: x + D,
604
+ L.push({
605
+ x: O + w,
606
+ y: z + C,
601
607
  z: 0,
602
- md: A,
603
- azimuth: E,
604
- dip: z
608
+ md: S,
609
+ azimuth: x,
610
+ dip: E
605
611
  });
606
612
  continue;
607
613
  }
608
- const R = H[W] ?? H.surveydepth, C = H[X] ?? H.azimuth, G = H[q] ?? H.dip, U = A - R;
614
+ const R = H[X] ?? H.surveydepth, D = H[q] ?? H.azimuth, G = H[W] ?? H.dip, U = S - R;
609
615
  if (U <= 0) continue;
610
- const j = ut(G), Z = ut(z), K = Qe(C), le = Qe(E), ye = Math.acos(
611
- Math.sin(j) * Math.sin(Z) * Math.cos(K - le) + Math.cos(j) * Math.cos(Z)
612
- ), fe = ye > 1e-6 ? 2 / ye * Math.tan(ye / 2) : 1, Ce = 0.5 * U * (Math.sin(j) * Math.cos(K) + Math.sin(Z) * Math.cos(le)) * fe, he = 0.5 * U * (Math.sin(j) * Math.sin(K) + Math.sin(Z) * Math.sin(le)) * fe, Ge = 0.5 * U * (Math.cos(j) + Math.cos(Z)) * fe;
613
- w += Ce, D += he, v += Ge, S.push({
614
- x: I + w,
615
- y: x + D,
616
- z: -v,
616
+ const j = dt(G), Z = dt(E), J = Qe(D), le = Qe(x), _e = Math.acos(
617
+ Math.sin(j) * Math.sin(Z) * Math.cos(J - le) + Math.cos(j) * Math.cos(Z)
618
+ ), he = _e > 1e-6 ? 2 / _e * Math.tan(_e / 2) : 1, Se = 0.5 * U * (Math.sin(j) * Math.cos(J) + Math.sin(Z) * Math.cos(le)) * he, pe = 0.5 * U * (Math.sin(j) * Math.sin(J) + Math.sin(Z) * Math.sin(le)) * he, Ge = 0.5 * U * (Math.cos(j) + Math.cos(Z)) * he;
619
+ w += Se, C += pe, _ += Ge, L.push({
620
+ x: O + w,
621
+ y: z + C,
622
+ z: -_,
617
623
  // render with z up; depth down
618
- md: A,
619
- azimuth: E,
620
- dip: z
624
+ md: S,
625
+ azimuth: x,
626
+ dip: E
621
627
  });
622
628
  }
623
- const L = S.map((O) => ({
624
- ...O,
625
- lat: p + O.y / N,
626
- lng: b + O.x / M
629
+ const A = L.map((I) => ({
630
+ ...I,
631
+ lat: p + I.y / M,
632
+ lng: b + I.x / v
627
633
  }));
628
634
  c.push({
629
635
  id: g[k] || g.holeId || h,
630
636
  project: g[me] || g.project_id || g.project || "",
631
- points: L,
637
+ points: A,
632
638
  collar: g
633
639
  });
634
640
  }), c;
635
641
  }
636
- const Qe = (e) => e * Math.PI / 180, ut = (e) => {
642
+ const Qe = (e) => e * Math.PI / 180, dt = (e) => {
637
643
  const t = Number(e), n = 90 + (Number.isFinite(t) ? t : 0), r = Math.min(180, Math.max(0, n));
638
644
  return Qe(r);
639
645
  };
@@ -641,29 +647,29 @@ function re(e, t = void 0) {
641
647
  const n = Number(e);
642
648
  return Number.isFinite(n) ? n : t;
643
649
  }
644
- function dt(e) {
650
+ function mt(e) {
645
651
  return e == null ? "" : `${e}`.trim();
646
652
  }
647
653
  function Ve(e = [], t = null) {
648
- const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) => dt(s == null ? void 0 : s[i])));
654
+ const n = t || "hole_id", o = [n, "hole_id", "holeId", "id"].find((i) => e.some((s) => mt(s == null ? void 0 : s[i])));
649
655
  if (!o)
650
656
  throw Y("canonicalizeHoleIdRows", new Error(`hole id column '${n}' not found`));
651
657
  return {
652
658
  aliasCol: o,
653
659
  rows: e.map((i) => ({
654
660
  ...i,
655
- hole_id: dt(i == null ? void 0 : i[o])
661
+ hole_id: mt(i == null ? void 0 : i[o])
656
662
  }))
657
663
  };
658
664
  }
659
- function mt(e) {
665
+ function ft(e) {
660
666
  return Number(e) * Math.PI / 180;
661
667
  }
662
668
  function Ye(e, t) {
663
- const n = mt(e), r = mt(t), o = Math.cos(r) * Math.sin(n), i = Math.cos(r) * Math.cos(n), s = Math.sin(r) * -1;
669
+ const n = ft(e), r = ft(t), o = Math.cos(r) * Math.sin(n), i = Math.cos(r) * Math.cos(n), s = Math.sin(r) * -1;
664
670
  return { ca: o, cb: i, cc: s };
665
671
  }
666
- function In(e, t, n, r, o, i = "minimum_curvature") {
672
+ function Cn(e, t, n, r, o, i = "minimum_curvature") {
667
673
  const s = Ye(t, n), l = Ye(r, o);
668
674
  if (i === "tangential")
669
675
  return {
@@ -692,7 +698,7 @@ function In(e, t, n, r, o, i = "minimum_curvature") {
692
698
  dip: o
693
699
  };
694
700
  }
695
- function tt(e = [], t = [], n = {}) {
701
+ function nt(e = [], t = [], n = {}) {
696
702
  const {
697
703
  step: r = 1,
698
704
  holeIdCol: o = null,
@@ -711,59 +717,59 @@ function tt(e = [], t = [], n = {}) {
711
717
  return u.forEach((d, f) => {
712
718
  const h = a.get(f);
713
719
  if (!h) return;
714
- const g = [...d].map((S) => ({
715
- ...S,
716
- from: re(S.from),
717
- azimuth: re(S.azimuth),
718
- dip: re(S.dip)
719
- })).filter((S) => Number.isFinite(S.from) && Number.isFinite(S.azimuth) && Number.isFinite(S.dip)).sort((S, w) => S.from - w.from);
720
+ const g = [...d].map((L) => ({
721
+ ...L,
722
+ from: re(L.from),
723
+ azimuth: re(L.azimuth),
724
+ dip: re(L.dip)
725
+ })).filter((L) => Number.isFinite(L.from) && Number.isFinite(L.azimuth) && Number.isFinite(L.dip)).sort((L, w) => L.from - w.from);
720
726
  if (!g.length) return;
721
- let y = re(h.x, 0), p = re(h.y, 0), b = re(h.z, 0), N = g[0].from;
722
- const M = g[0].azimuth, I = g[0].dip, x = {
727
+ let N = re(h.x, 0), p = re(h.y, 0), b = re(h.z, 0), M = g[0].from;
728
+ const v = g[0].azimuth, O = g[0].dip, z = {
723
729
  hole_id: f,
724
- md: N,
725
- x: y,
730
+ md: M,
731
+ x: N,
726
732
  y: p,
727
733
  z: b,
728
- azimuth: M,
729
- dip: I
734
+ azimuth: v,
735
+ dip: O
730
736
  };
731
- l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (x[l.aliasCol] = h[l.aliasCol]), m.push(x);
732
- for (let S = 0; S < g.length - 1; S += 1) {
733
- const w = g[S], D = g[S + 1], v = w.from, O = D.from - v;
734
- if (O <= 0) continue;
735
- const V = Math.max(1, Math.ceil(O / s)), H = O / V;
736
- for (let A = 0; A < V; A += 1) {
737
- N += H;
738
- const E = (N - v) / O, z = w.azimuth + E * (D.azimuth - w.azimuth), R = w.dip + E * (D.dip - w.dip), C = In(H, w.azimuth, w.dip, D.azimuth, D.dip, i);
739
- y += C.dx, p += C.dy, b += C.dz;
737
+ l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (z[l.aliasCol] = h[l.aliasCol]), m.push(z);
738
+ for (let L = 0; L < g.length - 1; L += 1) {
739
+ const w = g[L], C = g[L + 1], _ = w.from, I = C.from - _;
740
+ if (I <= 0) continue;
741
+ const B = Math.max(1, Math.ceil(I / s)), H = I / B;
742
+ for (let S = 0; S < B; S += 1) {
743
+ M += H;
744
+ const x = (M - _) / I, E = w.azimuth + x * (C.azimuth - w.azimuth), R = w.dip + x * (C.dip - w.dip), D = Cn(H, w.azimuth, w.dip, C.azimuth, C.dip, i);
745
+ N += D.dx, p += D.dy, b += D.dz;
740
746
  const G = {
741
747
  hole_id: f,
742
- md: N,
743
- x: y,
748
+ md: M,
749
+ x: N,
744
750
  y: p,
745
751
  z: b,
746
- azimuth: i === "minimum_curvature" ? z : C.azimuth,
747
- dip: i === "minimum_curvature" ? R : C.dip
752
+ azimuth: i === "minimum_curvature" ? E : D.azimuth,
753
+ dip: i === "minimum_curvature" ? R : D.dip
748
754
  };
749
755
  l.aliasCol !== "hole_id" && h[l.aliasCol] !== void 0 && (G[l.aliasCol] = h[l.aliasCol]), m.push(G);
750
756
  }
751
757
  }
752
758
  }), m;
753
759
  }
754
- function On(e, t, n = {}) {
755
- return tt(e, t, { ...n, method: "minimum_curvature" });
760
+ function wn(e, t, n = {}) {
761
+ return nt(e, t, { ...n, method: "minimum_curvature" });
756
762
  }
757
- function Zo(e, t, n = {}) {
758
- return tt(e, t, { ...n, method: "tangential" });
763
+ function mi(e, t, n = {}) {
764
+ return nt(e, t, { ...n, method: "tangential" });
759
765
  }
760
- function Wo(e, t, n = {}) {
761
- return tt(e, t, { ...n, method: "balanced_tangential" });
766
+ function fi(e, t, n = {}) {
767
+ return nt(e, t, { ...n, method: "balanced_tangential" });
762
768
  }
763
- function Ko(e, t, n = {}) {
764
- return On(e, t, n);
769
+ function hi(e, t, n = {}) {
770
+ return wn(e, t, n);
765
771
  }
766
- function Cn(e, t) {
772
+ function Fn(e, t) {
767
773
  if (!e.length || !Number.isFinite(t)) return null;
768
774
  let n = null, r = 1 / 0;
769
775
  for (let o = 0; o < e.length; o += 1) {
@@ -774,7 +780,7 @@ function Cn(e, t) {
774
780
  }
775
781
  return n;
776
782
  }
777
- function Jo(e = [], t = [], n = {}) {
783
+ function pi(e = [], t = [], n = {}) {
778
784
  const r = n.holeIdCol || "hole_id", o = Ve(e, r), i = Ve(t, r);
779
785
  if (!o.rows.length || !i.rows.length) return [...o.rows];
780
786
  const s = /* @__PURE__ */ new Map();
@@ -785,7 +791,7 @@ function Jo(e = [], t = [], n = {}) {
785
791
  }), o.rows.map((l) => {
786
792
  const c = re(l.from), a = re(l.to), u = Number.isFinite(c) && Number.isFinite(a) ? 0.5 * (c + a) : void 0;
787
793
  if (!l.hole_id || !Number.isFinite(u)) return { ...l };
788
- const m = Cn(s.get(l.hole_id) || [], u);
794
+ const m = Fn(s.get(l.hole_id) || [], u);
789
795
  if (!m) return { ...l };
790
796
  const d = { ...l };
791
797
  return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
@@ -793,16 +799,16 @@ function Jo(e = [], t = [], n = {}) {
793
799
  }), d;
794
800
  });
795
801
  }
796
- function Qo(e, t = null) {
802
+ function bi(e, t = null) {
797
803
  return new Promise((n, r) => {
798
- te.parse(e, {
804
+ Q.parse(e, {
799
805
  header: !0,
800
806
  dynamicTyping: !0,
801
807
  skipEmptyLines: !0,
802
808
  complete: (o) => {
803
809
  const i = /* @__PURE__ */ new Map();
804
810
  o.data.forEach((l, c) => {
805
- const a = ge(l, null, t), u = a[k], m = u !== void 0 ? `${u}`.trim() : "", d = a[pe] ?? a.x, f = a[be] ?? a.y, h = a[xe] ?? a.z, g = a.order ?? c;
811
+ const a = fe(l, null, t), u = a[k], m = u !== void 0 ? `${u}`.trim() : "", d = a[be] ?? a.x, f = a[ge] ?? a.y, h = a[ke] ?? a.z, g = a.order ?? c;
806
812
  !m || d === null || d === void 0 || f === null || f === void 0 || h === null || h === void 0 || (i.has(m) || i.set(m, []), i.get(m).push({
807
813
  ...a,
808
814
  holeId: m,
@@ -827,14 +833,14 @@ function Qo(e, t = null) {
827
833
  });
828
834
  });
829
835
  }
830
- function Ee(e) {
836
+ function xe(e) {
831
837
  return e ? Array.isArray(e) ? [...e] : [] : [];
832
838
  }
833
- function ee(e) {
839
+ function te(e) {
834
840
  const t = Number(e);
835
841
  return Number.isFinite(t) ? t : void 0;
836
842
  }
837
- function Pe(e = [], t = []) {
843
+ function we(e = [], t = []) {
838
844
  const n = [...e];
839
845
  return n.sort((r, o) => {
840
846
  for (let i = 0; i < t.length; i += 1) {
@@ -845,11 +851,11 @@ function Pe(e = [], t = []) {
845
851
  return 0;
846
852
  }), n;
847
853
  }
848
- function Sn(e = [], t = "Intervals") {
854
+ function Pn(e = [], t = "Intervals") {
849
855
  if (!e.length) return;
850
- const n = Pe(e, [k, F, $]), r = /* @__PURE__ */ new Map();
856
+ const n = we(e, [k, F, T]), r = /* @__PURE__ */ new Map();
851
857
  n.forEach((o) => {
852
- const i = `${(o == null ? void 0 : o[k]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[F]), l = Number(o == null ? void 0 : o[$]);
858
+ const i = `${(o == null ? void 0 : o[k]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[F]), l = Number(o == null ? void 0 : o[T]);
853
859
  if (!i || !Number.isFinite(s) || !Number.isFinite(l)) return;
854
860
  const c = r.get(i);
855
861
  if (Number.isFinite(c) && s < c)
@@ -860,9 +866,9 @@ function Sn(e = [], t = "Intervals") {
860
866
  r.set(i, l);
861
867
  });
862
868
  }
863
- function Dn(e, t = {}) {
869
+ function Tn(e, t = {}) {
864
870
  return new Promise((n, r) => {
865
- te.parse(e, {
871
+ Q.parse(e, {
866
872
  header: !0,
867
873
  dynamicTyping: !0,
868
874
  skipEmptyLines: !0,
@@ -872,8 +878,8 @@ function Dn(e, t = {}) {
872
878
  });
873
879
  });
874
880
  }
875
- function Ln(e = [], t = null, n = null) {
876
- return e.map((r) => ge(r, t, n));
881
+ function $n(e = [], t = null, n = null) {
882
+ return e.map((r) => fe(r, t, n));
877
883
  }
878
884
  async function je(e, t = {}) {
879
885
  const {
@@ -884,13 +890,13 @@ async function je(e, t = {}) {
884
890
  } = t;
885
891
  let s;
886
892
  if (Array.isArray(e))
887
- s = Ee(e);
893
+ s = xe(e);
888
894
  else if (n === "csv")
889
- s = await Dn(e, i);
895
+ s = await Tn(e, i);
890
896
  else throw n === "parquet" || n === "sql" ? Y("loadTable", new Error(`Unsupported kind in JS runtime: ${n}`)) : Y("loadTable", new Error(`Unsupported kind: ${n}`));
891
- return Ln(s, r, o);
897
+ return $n(s, r, o);
892
898
  }
893
- async function ei(e, t = {}) {
899
+ async function gi(e, t = {}) {
894
900
  const {
895
901
  crs: n = null,
896
902
  sourceColumnMap: r = null,
@@ -899,7 +905,7 @@ async function ei(e, t = {}) {
899
905
  } = t, s = await je(e, { ...i, sourceColumnMap: r });
900
906
  if (!s.some((d) => k in d))
901
907
  throw Y("loadCollars", new Error(`Collar table missing column: ${k}`));
902
- const c = s.some((d) => pe in d && be in d), a = s.some((d) => oe in d && ie in d);
908
+ const c = s.some((d) => be in d && ge in d), a = s.some((d) => oe in d && ie in d);
903
909
  if (!c && !a)
904
910
  throw Y("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
905
911
  const u = s.map((d) => {
@@ -908,18 +914,18 @@ async function ei(e, t = {}) {
908
914
  const h = f[k];
909
915
  f[k] = h == null ? "" : `${h}`.trim();
910
916
  }
911
- return oe in f && (f[oe] = ee(f[oe])), ie in f && (f[ie] = ee(f[ie])), xe in f && (f[xe] = ee(f[xe])), pe in f && (f[pe] = ee(f[pe])), be in f && (f[be] = ee(f[be])), !("datasource_hole_id" in f) && k in f && (f.datasource_hole_id = f[k]), f;
917
+ return oe in f && (f[oe] = te(f[oe])), ie in f && (f[ie] = te(f[ie])), ke in f && (f[ke] = te(f[ke])), be in f && (f[be] = te(f[be])), ge in f && (f[ge] = te(f[ge])), !("datasource_hole_id" in f) && k in f && (f.datasource_hole_id = f[k]), f;
912
918
  });
913
- if (!u.every((d) => !(!d[k] || a && (!Number.isFinite(d[oe]) || !Number.isFinite(d[ie])) || c && !a && (!Number.isFinite(d[pe]) || !Number.isFinite(d[be])))))
919
+ if (!u.every((d) => !(!d[k] || a && (!Number.isFinite(d[oe]) || !Number.isFinite(d[ie])) || c && !a && (!Number.isFinite(d[be]) || !Number.isFinite(d[ge])))))
914
920
  throw Y("loadCollars", new Error("Collar table has missing required values"));
915
921
  return u;
916
922
  }
917
- async function ti(e, t = {}) {
923
+ async function yi(e, t = {}) {
918
924
  const {
919
925
  sourceColumnMap: n = null,
920
926
  keepAll: r = !0,
921
927
  ...o
922
- } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [k, W, X, q];
928
+ } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [k, X, q, W];
923
929
  for (const a of s)
924
930
  if (!i.some((m) => a in m))
925
931
  throw Y("loadSurveys", new Error(`Survey table missing column: ${a}`));
@@ -929,18 +935,18 @@ async function ti(e, t = {}) {
929
935
  const m = u[k];
930
936
  u[k] = m == null ? "" : `${m}`.trim();
931
937
  }
932
- return W in u && (u[W] = ee(u[W])), $ in u && (u[$] = ee(u[$])), X in u && (u[X] = ee(u[X])), q in u && (u[q] = ee(u[q])), u;
938
+ return X in u && (u[X] = te(u[X])), T in u && (u[T] = te(u[T])), q in u && (u[q] = te(u[q])), W in u && (u[W] = te(u[W])), u;
933
939
  });
934
- if (!l.every((a) => !(!a[k] || !Number.isFinite(a[W]) || !Number.isFinite(a[X]) || !Number.isFinite(a[q]))))
940
+ if (!l.every((a) => !(!a[k] || !Number.isFinite(a[X]) || !Number.isFinite(a[q]) || !Number.isFinite(a[W]))))
935
941
  throw Y("loadSurveys", new Error("Survey table has missing required values"));
936
- return Pe(l, [k, W]);
942
+ return we(l, [k, X]);
937
943
  }
938
- async function ni(e, t = {}) {
944
+ async function _i(e, t = {}) {
939
945
  const {
940
946
  sourceColumnMap: n = null,
941
947
  keepAll: r = !0,
942
948
  ...o
943
- } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [k, F, $];
949
+ } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [k, F, T];
944
950
  for (const a of s)
945
951
  if (!i.some((m) => a in m))
946
952
  throw Y("loadAssays", new Error(`Assay table missing column: ${a}`));
@@ -950,18 +956,18 @@ async function ni(e, t = {}) {
950
956
  const m = u[k];
951
957
  u[k] = m == null ? "" : `${m}`.trim();
952
958
  }
953
- return F in u && (u[F] = ee(u[F])), $ in u && (u[$] = ee(u[$])), F in u && $ in u && Number.isFinite(u[F]) && Number.isFinite(u[$]) && (u[Ie] = 0.5 * (u[F] + u[$])), u;
959
+ return F in u && (u[F] = te(u[F])), T in u && (u[T] = te(u[T])), F in u && T in u && Number.isFinite(u[F]) && Number.isFinite(u[T]) && (u[ye] = 0.5 * (u[F] + u[T])), u;
954
960
  });
955
- if (!l.every((a) => !(!a[k] || !Number.isFinite(a[F]) || !Number.isFinite(a[$]) || !(a[$] > a[F]))))
961
+ if (!l.every((a) => !(!a[k] || !Number.isFinite(a[F]) || !Number.isFinite(a[T]) || !(a[T] > a[F]))))
956
962
  throw Y("loadAssays", new Error("Assay table has missing required values"));
957
- return Pe(l, [k, F, $]);
963
+ return we(l, [k, F, T]);
958
964
  }
959
- async function ri(e, t = {}) {
965
+ async function Ni(e, t = {}) {
960
966
  const {
961
967
  sourceColumnMap: n = null,
962
968
  keepAll: r = !0,
963
969
  ...o
964
- } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [k, F, $];
970
+ } = t, i = await je(e, { ...o, sourceColumnMap: n }), s = [k, F, T];
965
971
  for (const u of s)
966
972
  if (!i.some((d) => u in d))
967
973
  throw Y("loadGeology", new Error(`Geology table missing column: ${u}`));
@@ -971,27 +977,27 @@ async function ri(e, t = {}) {
971
977
  const h = m[k];
972
978
  m[k] = h == null ? "" : `${h}`.trim();
973
979
  }
974
- F in m && (m[F] = ee(m[F])), $ in m && (m[$] = ee(m[$])), F in m && $ in m && Number.isFinite(m[F]) && Number.isFinite(m[$]) && (m[$] === m[F] && (m[F] = Math.round(m[F] * 1e3) / 1e3, m[$] = m[F] + 1e-3), m[Ie] = 0.5 * (m[F] + m[$]));
980
+ F in m && (m[F] = te(m[F])), T in m && (m[T] = te(m[T])), F in m && T in m && Number.isFinite(m[F]) && Number.isFinite(m[T]) && (m[T] === m[F] && (m[F] = Math.round(m[F] * 1e3) / 1e3, m[T] = m[F] + 1e-3), m[ye] = 0.5 * (m[F] + m[T]));
975
981
  const d = m[ae] !== void 0 && m[ae] !== null && `${m[ae]}`.trim() !== "", f = m[ce] !== void 0 && m[ce] !== null && `${m[ce]}`.trim() !== "";
976
982
  return !d && f && (m[ae] = m[ce]), d && !f && (m[ce] = m[ae]), m;
977
983
  });
978
- if (!l.every((u) => !(!u[k] || !Number.isFinite(u[F]) || !Number.isFinite(u[$]) || !(u[$] > u[F]))))
984
+ if (!l.every((u) => !(!u[k] || !Number.isFinite(u[F]) || !Number.isFinite(u[T]) || !(u[T] > u[F]))))
979
985
  throw Y("loadGeology", new Error("Geology table has missing or invalid interval values"));
980
986
  if (!l.some((u) => {
981
987
  const m = u[ae], d = u[ce];
982
988
  return m != null && `${m}`.trim() !== "" || d != null && `${d}`.trim() !== "";
983
989
  }))
984
990
  throw Y("loadGeology", new Error(`Geology table missing categorical columns: ${ae} or ${ce}`));
985
- if (Sn(l, "Geology"), !r) {
986
- const u = new Set(Object.keys(mn));
987
- return Pe(
991
+ if (Pn(l, "Geology"), !r) {
992
+ const u = new Set(Object.keys(gn));
993
+ return we(
988
994
  l.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => u.has(d)))),
989
- [k, F, $]
995
+ [k, F, T]
990
996
  );
991
997
  }
992
- return Pe(l, [k, F, $]);
998
+ return we(l, [k, F, T]);
993
999
  }
994
- function oi(e = [], t = [], n = {}) {
1000
+ function Mi(e = [], t = [], n = {}) {
995
1001
  const r = Array.isArray(n.onCols) && n.onCols.length ? n.onCols : [k];
996
1002
  if (!t.length) return [...e];
997
1003
  const o = (s) => r.map((l) => `${(s == null ? void 0 : s[l]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
@@ -1006,20 +1012,20 @@ function oi(e = [], t = [], n = {}) {
1006
1012
  }), c;
1007
1013
  });
1008
1014
  }
1009
- function ii(e = [], t = null) {
1015
+ function vi(e = [], t = null) {
1010
1016
  return t == null ? [...e] : e.length ? e.some((r) => me in r) ? e.filter((r) => (r == null ? void 0 : r[me]) === t) : [...e] : [];
1011
1017
  }
1012
- function si(e = [], t = []) {
1018
+ function zi(e = [], t = []) {
1013
1019
  return e.map((n) => {
1014
1020
  const r = { ...n };
1015
1021
  return t.forEach((o) => {
1016
1022
  if (!(o in r)) return;
1017
- const i = ee(r[o]);
1023
+ const i = te(r[o]);
1018
1024
  r[o] = i;
1019
1025
  }), r;
1020
1026
  });
1021
1027
  }
1022
- function li({
1028
+ function Ei({
1023
1029
  collars: e = [],
1024
1030
  surveys: t = [],
1025
1031
  assays: n = [],
@@ -1028,45 +1034,45 @@ function li({
1028
1034
  metadata: i = {}
1029
1035
  } = {}) {
1030
1036
  return {
1031
- collars: Ee(e),
1032
- surveys: Ee(t),
1033
- assays: Ee(n),
1034
- geology: Ee(r),
1035
- structures: Ee(o),
1037
+ collars: xe(e),
1038
+ surveys: xe(t),
1039
+ assays: xe(n),
1040
+ geology: xe(r),
1041
+ structures: xe(o),
1036
1042
  metadata: i || {}
1037
1043
  };
1038
1044
  }
1039
- const Dt = ["x", "y", "z", "dx", "dy", "dz"], Pn = {
1045
+ const Ft = ["x", "y", "z", "dx", "dy", "dz"], Rn = {
1040
1046
  x: ["x", "easting", "center_x", "xc", "xcentre", "xcenter", "x_centre", "x_center", "cx"],
1041
1047
  y: ["y", "northing", "center_y", "yc", "ycentre", "ycenter", "y_centre", "y_center", "cy"],
1042
1048
  z: ["z", "elevation", "center_z", "zc", "zcentre", "zcenter", "z_centre", "z_center", "cz"],
1043
1049
  dx: ["dx", "size_x", "sx", "sizex", "dim_x", "block_size_x"],
1044
1050
  dy: ["dy", "size_y", "sy", "sizey", "dim_y", "block_size_y"],
1045
1051
  dz: ["dz", "size_z", "sz", "sizez", "dim_z", "block_size_z"]
1046
- }, Lt = {};
1047
- Object.entries(Pn).forEach(([e, t]) => {
1052
+ }, Pt = {};
1053
+ Object.entries(Rn).forEach(([e, t]) => {
1048
1054
  t.forEach((n) => {
1049
- Lt[n.toLowerCase()] = e;
1055
+ Pt[n.toLowerCase()] = e;
1050
1056
  });
1051
1057
  });
1052
- function Fn(e) {
1058
+ function Bn(e) {
1053
1059
  const t = {};
1054
1060
  return Object.entries(e).forEach(([n, r]) => {
1055
- const o = Lt[n.toLowerCase().trim()] || n;
1061
+ const o = Pt[n.toLowerCase().trim()] || n;
1056
1062
  t[o] = r;
1057
1063
  }), t;
1058
1064
  }
1059
- function ai(e) {
1065
+ function xi(e) {
1060
1066
  return new Promise((t, n) => {
1061
- te.parse(e, {
1067
+ Q.parse(e, {
1062
1068
  header: !0,
1063
1069
  dynamicTyping: !0,
1064
1070
  skipEmptyLines: !0,
1065
1071
  complete: (r) => {
1066
- const i = (r.data || []).map(Fn).filter(
1072
+ const i = (r.data || []).map(Bn).filter(
1067
1073
  (l) => l.x !== null && l.y !== null && l.z !== null
1068
1074
  ), s = Object.keys(i[0] || {}).filter(
1069
- (l) => !Dt.includes(l)
1075
+ (l) => !Ft.includes(l)
1070
1076
  );
1071
1077
  t({ data: i, properties: s });
1072
1078
  },
@@ -1076,7 +1082,7 @@ function ai(e) {
1076
1082
  });
1077
1083
  });
1078
1084
  }
1079
- function ci(e) {
1085
+ function ki(e) {
1080
1086
  if (typeof e == "string")
1081
1087
  try {
1082
1088
  return JSON.parse(e);
@@ -1086,7 +1092,7 @@ function ci(e) {
1086
1092
  if (e && typeof e == "object") return e;
1087
1093
  throw Y("loadBlockModelMetadata", new Error("Invalid metadata source"));
1088
1094
  }
1089
- function wn(e, t) {
1095
+ function Vn(e, t) {
1090
1096
  const n = e.map((i) => i[t]).filter((i) => i != null);
1091
1097
  if (n.length > 0 && n.every((i) => typeof i == "number")) {
1092
1098
  const i = Math.min(...n), s = Math.max(...n);
@@ -1094,16 +1100,16 @@ function wn(e, t) {
1094
1100
  }
1095
1101
  return { type: "categorical", categories: [...new Set(n)], values: n };
1096
1102
  }
1097
- function ui(e) {
1103
+ function Ai(e) {
1098
1104
  if (!e || e.length === 0) return {};
1099
1105
  const t = Object.keys(e[0]).filter(
1100
- (r) => !Dt.includes(r)
1106
+ (r) => !Ft.includes(r)
1101
1107
  ), n = {};
1102
1108
  return t.forEach((r) => {
1103
- n[r] = wn(e, r);
1109
+ n[r] = Vn(e, r);
1104
1110
  }), n;
1105
1111
  }
1106
- function Tn(e, t) {
1112
+ function Hn(e, t) {
1107
1113
  return !t || typeof t != "object" ? e : e.filter(
1108
1114
  (n) => Object.entries(t).every(([r, o]) => {
1109
1115
  const i = n[r];
@@ -1111,13 +1117,13 @@ function Tn(e, t) {
1111
1117
  })
1112
1118
  );
1113
1119
  }
1114
- function di(e, t = null) {
1115
- return (t ? Tn(e, t) : e).reduce((r, o) => {
1120
+ function Ii(e, t = null) {
1121
+ return (t ? Hn(e, t) : e).reduce((r, o) => {
1116
1122
  const i = Number(o.dx) || 0, s = Number(o.dy) || 0, l = Number(o.dz) || 0;
1117
1123
  return r + i * s * l;
1118
1124
  }, 0);
1119
1125
  }
1120
- function $n(e, t, n) {
1126
+ function jn(e, t, n) {
1121
1127
  if (!t) return new n.Color("#888888");
1122
1128
  if (t.type === "numeric") {
1123
1129
  const i = t.max - t.min, l = (1 - (i === 0 ? 0.5 : (e - t.min) / i)) * 240;
@@ -1126,56 +1132,56 @@ function $n(e, t, n) {
1126
1132
  const o = t.categories.indexOf(e) / Math.max(t.categories.length, 1) * 360;
1127
1133
  return new n.Color().setHSL(o / 360, 0.7, 0.5);
1128
1134
  }
1129
- const nt = (e, t = null) => ge(e, null, t);
1130
- function Rn(e) {
1135
+ const rt = (e, t = null) => fe(e, null, t);
1136
+ function Gn(e) {
1131
1137
  if (!e.length) return null;
1132
- const t = e[0], n = F in t && $ in t, r = W in t && !n;
1138
+ const t = e[0], n = F in t && T in t, r = X in t && !n;
1133
1139
  return n ? "interval" : r ? "point" : null;
1134
1140
  }
1135
1141
  function de(e) {
1136
1142
  const t = Number(e);
1137
1143
  return Number.isFinite(t) ? t : null;
1138
1144
  }
1139
- function Pt(e) {
1145
+ function Tt(e) {
1140
1146
  const t = e[k] !== void 0 ? `${e[k]}`.trim() : "";
1141
1147
  if (!t) return null;
1142
- const n = de(e[W]);
1148
+ const n = de(e[X]);
1143
1149
  return n === null ? null : {
1144
1150
  [k]: t,
1145
- [W]: n,
1151
+ [X]: n,
1152
+ [W]: de(e[W]),
1146
1153
  [q]: de(e[q]),
1147
- [X]: de(e[X]),
1148
1154
  comments: e.comments != null ? `${e.comments}` : null,
1149
1155
  ...e
1150
1156
  };
1151
1157
  }
1152
- function Ft(e) {
1158
+ function $t(e) {
1153
1159
  const t = e[k] !== void 0 ? `${e[k]}`.trim() : "";
1154
1160
  if (!t) return null;
1155
- const n = de(e[F]), r = de(e[$]);
1161
+ const n = de(e[F]), r = de(e[T]);
1156
1162
  if (n === null || r === null || r <= n) return null;
1157
1163
  const o = 0.5 * (n + r);
1158
1164
  return {
1159
1165
  [k]: t,
1160
1166
  [F]: n,
1161
- [$]: r,
1167
+ [T]: r,
1162
1168
  mid: o,
1169
+ [W]: de(e[W]),
1163
1170
  [q]: de(e[q]),
1164
- [X]: de(e[X]),
1165
1171
  classification: e.classification != null ? `${e.classification}` : null,
1166
1172
  comments: e.comments != null ? `${e.comments}` : null,
1167
1173
  ...e
1168
1174
  };
1169
1175
  }
1170
- function mi(e) {
1176
+ function Oi(e) {
1171
1177
  const t = [], n = [];
1172
1178
  for (const r of e) {
1173
- const o = [], i = de(r[q]), s = de(r[X]);
1179
+ const o = [], i = de(r[W]), s = de(r[q]);
1174
1180
  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
1181
  }
1176
1182
  return { valid: t, errors: n };
1177
1183
  }
1178
- function fi(e, t = null) {
1184
+ function Si(e, t = null) {
1179
1185
  return new Promise((n, r) => {
1180
1186
  const o = {
1181
1187
  header: !0,
@@ -1184,7 +1190,7 @@ function fi(e, t = null) {
1184
1190
  complete: (i) => {
1185
1191
  const s = [];
1186
1192
  for (const l of i.data) {
1187
- const c = nt(l, t), a = Pt(c);
1193
+ const c = rt(l, t), a = Tt(c);
1188
1194
  a && s.push(a);
1189
1195
  }
1190
1196
  n(s);
@@ -1192,19 +1198,19 @@ function fi(e, t = null) {
1192
1198
  error: (i) => r(Y("parseStructuralPointsCSV", i))
1193
1199
  };
1194
1200
  typeof e == "string" && !e.startsWith("data:") && e.includes(`
1195
- `) ? te.parse(e, o) : te.parse(e, o);
1201
+ `) ? Q.parse(e, o) : Q.parse(e, o);
1196
1202
  });
1197
1203
  }
1198
- function hi(e, t = null) {
1204
+ function Li(e, t = null) {
1199
1205
  return new Promise((n, r) => {
1200
- te.parse(e, {
1206
+ Q.parse(e, {
1201
1207
  header: !0,
1202
1208
  dynamicTyping: !0,
1203
1209
  skipEmptyLines: !0,
1204
1210
  complete: (o) => {
1205
1211
  const i = [];
1206
1212
  for (const s of o.data) {
1207
- const l = nt(s, t), c = Ft(l);
1213
+ const l = rt(s, t), c = $t(l);
1208
1214
  c && i.push(c);
1209
1215
  }
1210
1216
  n(i);
@@ -1213,7 +1219,7 @@ function hi(e, t = null) {
1213
1219
  });
1214
1220
  });
1215
1221
  }
1216
- function Bn(e, t = k) {
1222
+ function Un(e, t = k) {
1217
1223
  const n = /* @__PURE__ */ new Map();
1218
1224
  for (const r of e) {
1219
1225
  const o = r[t] != null ? String(r[t]).trim() : "";
@@ -1221,14 +1227,14 @@ function Bn(e, t = k) {
1221
1227
  }
1222
1228
  return Array.from(n.values());
1223
1229
  }
1224
- function Vn(e, t = null) {
1230
+ function Yn(e, t = null) {
1225
1231
  return new Promise((n, r) => {
1226
- te.parse(e, {
1232
+ Q.parse(e, {
1227
1233
  header: !0,
1228
1234
  dynamicTyping: !0,
1229
1235
  skipEmptyLines: !0,
1230
1236
  complete: (o) => {
1231
- const i = o.data.map((c) => nt(c, t)), s = Rn(i);
1237
+ const i = o.data.map((c) => rt(c, t)), s = Gn(i);
1232
1238
  if (!s) {
1233
1239
  r(Y(
1234
1240
  "parseStructuralCSV",
@@ -1238,7 +1244,7 @@ function Vn(e, t = null) {
1238
1244
  }
1239
1245
  const l = [];
1240
1246
  for (const c of i) {
1241
- const a = s === "interval" ? Ft(c) : Pt(c);
1247
+ const a = s === "interval" ? $t(c) : Tt(c);
1242
1248
  a && l.push(a);
1243
1249
  }
1244
1250
  n({ schema: s, rows: l });
@@ -1247,26 +1253,26 @@ function Vn(e, t = null) {
1247
1253
  });
1248
1254
  });
1249
1255
  }
1250
- function Hn(e) {
1256
+ function Xn(e) {
1251
1257
  return new Promise((t) => {
1252
- te.parse(e, {
1258
+ Q.parse(e, {
1253
1259
  header: !0,
1254
1260
  dynamicTyping: !0,
1255
1261
  skipEmptyLines: !0,
1256
1262
  complete: (n) => {
1257
1263
  const r = /* @__PURE__ */ new Map();
1258
1264
  for (const i of n.data) {
1259
- const s = ge(i), l = s[k] != null ? `${s[k]}`.trim() : "";
1265
+ const s = fe(i), l = s[k] != null ? `${s[k]}`.trim() : "";
1260
1266
  if (!l) continue;
1261
- const c = Number(s[F]), a = Number(s[$]);
1267
+ const c = Number(s[F]), a = Number(s[T]);
1262
1268
  if (!Number.isFinite(c) || !Number.isFinite(a) || a <= c) continue;
1263
- const u = (c + a) / 2, { [q]: m, [X]: d, ...f } = s, h = {
1269
+ const u = (c + a) / 2, { [W]: m, [q]: d, ...f } = s, h = {
1264
1270
  ...f,
1265
1271
  [k]: l,
1266
1272
  [F]: c,
1267
- [$]: a,
1268
- [Ie]: u,
1269
- [W]: u,
1273
+ [T]: a,
1274
+ [ye]: u,
1275
+ [X]: u,
1270
1276
  // unified depth field for y-axis rendering
1271
1277
  _source: "assay"
1272
1278
  };
@@ -1281,26 +1287,26 @@ function Hn(e) {
1281
1287
  });
1282
1288
  });
1283
1289
  }
1284
- function jn(e) {
1290
+ function qn(e) {
1285
1291
  return new Promise((t) => {
1286
- te.parse(e, {
1292
+ Q.parse(e, {
1287
1293
  header: !0,
1288
1294
  dynamicTyping: !0,
1289
1295
  skipEmptyLines: !0,
1290
1296
  complete: (n) => {
1291
1297
  const r = /* @__PURE__ */ new Map();
1292
1298
  for (const o of n.data) {
1293
- const i = ge(o), s = (i[k] ?? "").toString().trim();
1299
+ const i = fe(o), s = (i[k] ?? "").toString().trim();
1294
1300
  if (!s) continue;
1295
- const l = Number(i[F]), c = Number(i[$]);
1301
+ const l = Number(i[F]), c = Number(i[T]);
1296
1302
  if (!Number.isFinite(l) || !Number.isFinite(c) || c <= l) continue;
1297
- const a = (l + c) / 2, { [q]: u, [X]: m, ...d } = i, f = {
1303
+ const a = (l + c) / 2, { [W]: u, [q]: m, ...d } = i, f = {
1298
1304
  ...d,
1299
1305
  [k]: s,
1300
1306
  [F]: l,
1301
- [$]: c,
1302
- [Ie]: a,
1303
- [W]: a,
1307
+ [T]: c,
1308
+ [ye]: a,
1309
+ [X]: a,
1304
1310
  _source: "geology"
1305
1311
  };
1306
1312
  r.has(s) || r.set(s, []), r.get(s).push(f);
@@ -1315,13 +1321,13 @@ function jn(e) {
1315
1321
  });
1316
1322
  });
1317
1323
  }
1318
- async function pi({ assayCsv: e, structuralCsv: t, geologyCsv: n } = {}) {
1324
+ async function Di({ assayCsv: e, structuralCsv: t, geologyCsv: n } = {}) {
1319
1325
  const [r, o, i] = await Promise.all([
1320
- e ? Hn(e) : Promise.resolve([]),
1321
- t ? Vn(t).then(
1322
- ({ rows: l }) => Bn(l.map((c) => ({ ...c, _source: "structural" })))
1326
+ e ? Xn(e) : Promise.resolve([]),
1327
+ t ? Yn(t).then(
1328
+ ({ rows: l }) => Un(l.map((c) => ({ ...c, _source: "structural" })))
1323
1329
  ) : Promise.resolve([]),
1324
- n ? jn(n).then(({ holes: l }) => l) : Promise.resolve([])
1330
+ n ? qn(n).then(({ holes: l }) => l) : Promise.resolve([])
1325
1331
  ]), s = new Map(r.map((l) => [l.holeId, { ...l, points: [...l.points] }]));
1326
1332
  for (const l of [...o, ...i]) {
1327
1333
  const c = l.holeId;
@@ -1334,7 +1340,7 @@ async function pi({ assayCsv: e, structuralCsv: t, geologyCsv: n } = {}) {
1334
1340
  }
1335
1341
  return { holes: Array.from(s.values()) };
1336
1342
  }
1337
- function bi(e, t, n, r, o = {}) {
1343
+ function Ci(e, t, n, r, o = {}) {
1338
1344
  const i = o.fromCol || "from", s = o.toCol || "to", l = o.holeCol || "hole_id";
1339
1345
  if (!e || !e.length) return [];
1340
1346
  const c = {};
@@ -1350,36 +1356,171 @@ function bi(e, t, n, r, o = {}) {
1350
1356
  });
1351
1357
  if (!f.length) continue;
1352
1358
  const h = [];
1353
- let g = [], y = null;
1359
+ let g = [], N = null;
1354
1360
  for (const p of f) {
1355
- const b = Number(p[i]), N = Number(p[s]);
1356
- y === null || Math.abs(b - y) > 1e-6 ? (g.length && h.push(g), g = [p]) : g.push(p), y = N;
1361
+ const b = Number(p[i]), M = Number(p[s]);
1362
+ N === null || Math.abs(b - N) > 1e-6 ? (g.length && h.push(g), g = [p]) : g.push(p), N = M;
1357
1363
  }
1358
1364
  g.length && h.push(g);
1359
1365
  for (const p of h) {
1360
- const b = Number(p[0][i]), N = Number(p[p.length - 1][s]), M = N - b;
1361
- if (M < r) continue;
1362
- let I = 0, x = 0;
1363
- for (const v of p) {
1364
- const L = Number(v[t]), O = Number(v[s]) - Number(v[i]);
1365
- I += L * O, x += O;
1366
+ const b = Number(p[0][i]), M = Number(p[p.length - 1][s]), v = M - b;
1367
+ if (v < r) continue;
1368
+ let O = 0, z = 0;
1369
+ for (const _ of p) {
1370
+ const A = Number(_[t]), I = Number(_[s]) - Number(_[i]);
1371
+ O += A * I, z += I;
1366
1372
  }
1367
- const S = I / x, w = p.length, D = `${M.toFixed(1)} m @ ${S.toFixed(2)} ${t}`;
1373
+ const L = O / z, w = p.length, C = `${v.toFixed(1)} m @ ${L.toFixed(2)} ${t}`;
1368
1374
  a.push({
1369
1375
  [l]: u,
1370
1376
  assay_field: t,
1371
1377
  [i]: b,
1372
- [s]: N,
1373
- length: M,
1374
- avg_grade: S,
1378
+ [s]: M,
1379
+ length: v,
1380
+ avg_grade: L,
1375
1381
  n_samples: w,
1376
- label: D
1382
+ label: C
1377
1383
  });
1378
1384
  }
1379
1385
  }
1380
1386
  return a;
1381
1387
  }
1382
- function Gn(e, t) {
1388
+ const Rt = ["depth", "md", "measured_depth", "dept", "z"];
1389
+ function Wn(e) {
1390
+ if (e[X] !== void 0) {
1391
+ const r = Number(e[X]);
1392
+ if (Number.isFinite(r)) return r;
1393
+ }
1394
+ for (const r of Rt)
1395
+ if (e[r] !== void 0) {
1396
+ const o = Number(e[r]);
1397
+ if (Number.isFinite(o)) return o;
1398
+ }
1399
+ const t = Number(e[F]), n = Number(e[T]);
1400
+ return Number.isFinite(t) && Number.isFinite(n) && n >= t ? (t + n) / 2 : null;
1401
+ }
1402
+ function Zn(e) {
1403
+ if (e.length === 0) return [];
1404
+ const t = /* @__PURE__ */ new Set([k, X, F, T, ye, ...Rt]);
1405
+ return Object.keys(e[0]).filter((r) => !t.has(r)).filter((r) => {
1406
+ let o = 0;
1407
+ for (const i of e) {
1408
+ const s = Number(i[r]);
1409
+ Number.isFinite(s) && o++;
1410
+ }
1411
+ return o / e.length > 0.5;
1412
+ });
1413
+ }
1414
+ function wi(e, t = null) {
1415
+ const r = Q.parse(e, {
1416
+ header: !0,
1417
+ skipEmptyLines: !0,
1418
+ dynamicTyping: !1
1419
+ }).data || [];
1420
+ if (r.length === 0) return [];
1421
+ const o = r.map((c) => fe(c, null, t)), i = Zn(o), s = /* @__PURE__ */ new Map();
1422
+ for (const c of o) {
1423
+ const a = c[k] != null ? `${c[k]}`.trim() : "";
1424
+ if (!a) continue;
1425
+ const u = Wn(c);
1426
+ u === null || u < 0 || (s.has(a) || s.set(a, []), s.get(a).push({ depth: u, row: c }));
1427
+ }
1428
+ const l = [];
1429
+ for (const [c, a] of s) {
1430
+ a.sort((m, d) => m.depth - d.depth);
1431
+ const u = {};
1432
+ for (const m of i) {
1433
+ const d = [], f = [];
1434
+ for (const { depth: h, row: g } of a) {
1435
+ const N = Number(g[m]);
1436
+ Number.isFinite(N) && N !== Ot && (d.push(h), f.push(N));
1437
+ }
1438
+ d.length >= 2 && (u[m] = { depths: d, values: f });
1439
+ }
1440
+ Object.keys(u).length > 0 && l.push({ holeId: c, channels: u });
1441
+ }
1442
+ return l;
1443
+ }
1444
+ function Fi(e, t = null, n = {}) {
1445
+ const r = [];
1446
+ for (const { holeId: o, channels: i } of e) {
1447
+ const s = t && i[t] ? t : Object.keys(i)[0];
1448
+ if (!s) continue;
1449
+ const { depths: l, values: c } = i[s];
1450
+ r.push({ holeId: o, depths: l, values: c, options: n });
1451
+ }
1452
+ return r;
1453
+ }
1454
+ function Bt(e) {
1455
+ const t = e.indexOf(".");
1456
+ if (t < 0) return null;
1457
+ const n = e.slice(0, t).trim().toUpperCase(), r = e.slice(t + 1), o = r.match(/^(\S*)\s*(.*)/s), i = o ? o[1] : "", s = o ? o[2] : r, l = s.lastIndexOf(":"), c = l >= 0 ? s.slice(0, l).trim() : s.trim(), a = l >= 0 ? s.slice(l + 1).trim() : "";
1458
+ return { mnem: n, unit: i, value: c, description: a };
1459
+ }
1460
+ function Kn(e) {
1461
+ const t = [];
1462
+ let n = null;
1463
+ for (const r of e.split(/\r?\n/)) {
1464
+ const o = r.trimEnd();
1465
+ o.startsWith("~") ? (n = { type: o.slice(1, 2).toUpperCase(), lines: [] }, t.push(n)) : n && n.lines.push(o);
1466
+ }
1467
+ return t;
1468
+ }
1469
+ function ht(e = []) {
1470
+ const t = {};
1471
+ for (const n of e) {
1472
+ const r = n.trimStart();
1473
+ if (!r || r.startsWith("#")) continue;
1474
+ const o = Bt(n);
1475
+ o && (t[o.mnem] = o);
1476
+ }
1477
+ return t;
1478
+ }
1479
+ function Pi(e, t = {}) {
1480
+ var p, b, M, v, O, z, L, w, C;
1481
+ const n = Kn(e), r = n.find((_) => _.type === "V"), o = n.find((_) => _.type === "W"), i = n.find((_) => _.type === "C"), s = n.find((_) => _.type === "A");
1482
+ if (!s) return [];
1483
+ const l = ht(r == null ? void 0 : r.lines), c = ht(o == null ? void 0 : o.lines), a = [];
1484
+ for (const _ of (i == null ? void 0 : i.lines) ?? []) {
1485
+ const A = _.trimStart();
1486
+ if (!A || A.startsWith("#")) continue;
1487
+ const I = Bt(_);
1488
+ I && a.push(I);
1489
+ }
1490
+ (((b = (p = l.WRAP) == null ? void 0 : p.value) == null ? void 0 : b.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
1491
+ "parseLasFile: WRAP YES is not supported. Data rows may be read incorrectly."
1492
+ );
1493
+ const m = t.holeId ?? (((v = (M = c.WELL) == null ? void 0 : M.value) == null ? void 0 : v.trim()) || null) ?? (((z = (O = c.UWI) == null ? void 0 : O.value) == null ? void 0 : z.trim()) || null) ?? (((w = (L = c.API) == null ? void 0 : L.value) == null ? void 0 : w.trim()) || null) ?? "unknown";
1494
+ let d = Ot;
1495
+ if ((C = c.NULL) != null && C.value) {
1496
+ const _ = Number(c.NULL.value);
1497
+ Number.isFinite(_) && (d = _);
1498
+ }
1499
+ if (t.nullSentinel !== void 0 && (d = t.nullSentinel), a.length === 0) return [];
1500
+ const f = a.slice(1), h = {};
1501
+ for (const { mnem: _, unit: A } of f)
1502
+ h[_.toLowerCase()] = A;
1503
+ const g = {};
1504
+ for (const { mnem: _ } of f)
1505
+ g[_.toLowerCase()] = { depths: [], values: [] };
1506
+ for (const _ of s.lines) {
1507
+ const A = _.trimStart();
1508
+ if (!A || A.startsWith("#")) continue;
1509
+ const I = A.split(/\s+/);
1510
+ if (I.length < 2) continue;
1511
+ const B = Number(I[0]);
1512
+ if (!(!Number.isFinite(B) || B === d))
1513
+ for (let H = 0; H < f.length; H++) {
1514
+ const S = f[H].mnem.toLowerCase(), x = Number(I[H + 1]);
1515
+ Number.isFinite(x) && x !== d && (g[S].depths.push(B), g[S].values.push(x));
1516
+ }
1517
+ }
1518
+ const N = {};
1519
+ for (const [_, A] of Object.entries(g))
1520
+ A.depths.length >= 2 && (N[_] = A);
1521
+ return Object.keys(N).length === 0 ? [] : [{ holeId: m, units: h, channels: N }];
1522
+ }
1523
+ function Jn(e, t) {
1383
1524
  if (!e || e.length === 0 || !Number.isFinite(t)) return null;
1384
1525
  const n = e.length;
1385
1526
  if (n === 1) {
@@ -1388,8 +1529,8 @@ function Gn(e, t) {
1388
1529
  }
1389
1530
  let r = -1;
1390
1531
  for (let b = 0; b < n - 1; b++) {
1391
- const N = Number(e[b].md), M = Number(e[b + 1].md);
1392
- if (t >= N && t <= M) {
1532
+ const M = Number(e[b].md), v = Number(e[b + 1].md);
1533
+ if (t >= M && t <= v) {
1393
1534
  r = b;
1394
1535
  break;
1395
1536
  }
@@ -1397,28 +1538,28 @@ function Gn(e, t) {
1397
1538
  let o, i, s;
1398
1539
  if (r === -1) {
1399
1540
  t < Number(e[0].md) ? (o = e[0], i = e[1]) : (o = e[n - 2], i = e[n - 1]);
1400
- const b = Number(o.md), M = Number(i.md) - b;
1401
- s = M > 0 ? (t - b) / M : t < b ? 0 : 1;
1541
+ const b = Number(o.md), v = Number(i.md) - b;
1542
+ s = v > 0 ? (t - b) / v : t < b ? 0 : 1;
1402
1543
  } else {
1403
1544
  o = e[r], i = e[r + 1];
1404
- const b = Number(o.md), M = Number(i.md) - b;
1405
- s = M > 0 ? (t - b) / M : 0;
1545
+ const b = Number(o.md), v = Number(i.md) - b;
1546
+ s = v > 0 ? (t - b) / v : 0;
1406
1547
  }
1407
1548
  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));
1408
1549
  let u, m, d;
1409
- const f = Number(o.azimuth), h = Number(o.dip), g = Number(i.azimuth), y = Number(i.dip);
1550
+ const f = Number(o.azimuth), h = Number(o.dip), g = Number(i.azimuth), N = Number(i.dip);
1410
1551
  if (Number.isFinite(f) && Number.isFinite(h)) {
1411
- const b = Number.isFinite(g) && Number.isFinite(y) ? f + s * (g - f) : f, N = Number.isFinite(g) && Number.isFinite(y) ? h + s * (y - h) : h, M = b * Math.PI / 180, I = N * Math.PI / 180;
1412
- u = Math.cos(I) * Math.sin(M), m = Math.cos(I) * Math.cos(M), d = -Math.sin(I);
1552
+ const b = Number.isFinite(g) && Number.isFinite(N) ? f + s * (g - f) : f, M = Number.isFinite(g) && Number.isFinite(N) ? h + s * (N - h) : h, v = b * Math.PI / 180, O = M * Math.PI / 180;
1553
+ u = Math.cos(O) * Math.sin(v), m = Math.cos(O) * Math.cos(v), d = -Math.sin(O);
1413
1554
  } else {
1414
- const b = Number(i.x) - Number(o.x), N = Number(i.y) - Number(o.y), M = Number(i.z) - Number(o.z), I = Math.sqrt(b * b + N * N + M * M);
1415
- if (I < 1e-10) return { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 };
1416
- u = b / I, m = N / I, d = M / I;
1555
+ const b = Number(i.x) - Number(o.x), M = Number(i.y) - Number(o.y), v = Number(i.z) - Number(o.z), O = Math.sqrt(b * b + M * M + v * v);
1556
+ if (O < 1e-10) return { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 };
1557
+ u = b / O, m = M / O, d = v / O;
1417
1558
  }
1418
1559
  const p = Math.sqrt(u * u + m * m + d * d);
1419
1560
  return p < 1e-10 ? { x: l, y: c, z: a, dx: 0, dy: 0, dz: -1 } : { x: l, y: c, z: a, dx: u / p, dy: m / p, dz: d / p };
1420
1561
  }
1421
- function Un(e, t, n, r = {}) {
1562
+ function Qn(e, t, n, r = {}) {
1422
1563
  const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: s, dy: l, dz: c } = n, a = [s, l, c];
1423
1564
  let u = [0, 0, 1];
1424
1565
  const m = a[0] * u[0] + a[1] * u[1] + a[2] * u[2];
@@ -1431,18 +1572,18 @@ function Un(e, t, n, r = {}) {
1431
1572
  a[1] * h[2] - a[2] * h[1],
1432
1573
  a[2] * h[0] - a[0] * h[2],
1433
1574
  a[0] * h[1] - a[1] * h[0]
1434
- ], y = Math.sqrt(g[0] ** 2 + g[1] ** 2 + g[2] ** 2), p = y > 1e-10 ? [g[0] / y, g[1] / y, g[2] / y] : [0, 1, 0], b = o === "R" ? h : p, N = t * Math.PI / 180 * i, M = Math.cos(N), I = Math.sin(N), x = b[0] * a[0] + b[1] * a[1] + b[2] * a[2], S = [
1575
+ ], N = Math.sqrt(g[0] ** 2 + g[1] ** 2 + g[2] ** 2), p = N > 1e-10 ? [g[0] / N, g[1] / N, g[2] / N] : [0, 1, 0], b = o === "R" ? h : p, M = t * Math.PI / 180 * i, v = Math.cos(M), O = Math.sin(M), z = b[0] * a[0] + b[1] * a[1] + b[2] * a[2], L = [
1435
1576
  a[1] * b[2] - a[2] * b[1],
1436
1577
  a[2] * b[0] - a[0] * b[2],
1437
1578
  a[0] * b[1] - a[1] * b[0]
1438
1579
  ], w = [
1439
- b[0] * M + S[0] * I + a[0] * x * (1 - M),
1440
- b[1] * M + S[1] * I + a[1] * x * (1 - M),
1441
- b[2] * M + S[2] * I + a[2] * x * (1 - M)
1442
- ], D = (90 - e) * Math.PI / 180, v = Math.cos(D), L = Math.sin(D), O = v * w[0] + L * a[0], V = v * w[1] + L * a[1], H = v * w[2] + L * a[2], A = Math.sqrt(O * O + V * V + H * H);
1443
- return A < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: O / A, ny: V / A, nz: H / A };
1580
+ b[0] * v + L[0] * O + a[0] * z * (1 - v),
1581
+ b[1] * v + L[1] * O + a[1] * z * (1 - v),
1582
+ b[2] * v + L[2] * O + a[2] * z * (1 - v)
1583
+ ], C = (90 - e) * Math.PI / 180, _ = Math.cos(C), A = Math.sin(C), I = _ * w[0] + A * a[0], B = _ * w[1] + A * a[1], H = _ * w[2] + A * a[2], S = Math.sqrt(I * I + B * B + H * H);
1584
+ return S < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: I / S, ny: B / S, nz: H / S };
1444
1585
  }
1445
- function Yn(e, t, n = {}) {
1586
+ function er(e, t, n = {}) {
1446
1587
  if (!(e != null && e.length) || !(t != null && t.length)) return [];
1447
1588
  const r = /* @__PURE__ */ new Map();
1448
1589
  for (const i of t) {
@@ -1459,25 +1600,25 @@ function Yn(e, t, n = {}) {
1459
1600
  if (!l || l.length === 0) continue;
1460
1601
  const c = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
1461
1602
  if (!Number.isFinite(c)) continue;
1462
- const a = Gn(l, c);
1603
+ const a = Jn(l, c);
1463
1604
  if (!a) continue;
1464
1605
  const { x: u, y: m, z: d, dx: f, dy: h, dz: g } = a;
1465
- let y, p, b;
1466
- const N = i.alpha != null ? Number(i.alpha) : null, M = i.beta != null ? Number(i.beta) : null;
1467
- if (Number.isFinite(N)) {
1468
- const I = Number.isFinite(M) ? M : 0, x = Un(N, I, { dx: f, dy: h, dz: g }, n);
1469
- y = x.nx, p = x.ny, b = x.nz;
1606
+ let N, p, b;
1607
+ const M = i.alpha != null ? Number(i.alpha) : null, v = i.beta != null ? Number(i.beta) : null;
1608
+ if (Number.isFinite(M)) {
1609
+ const O = Number.isFinite(v) ? v : 0, z = Qn(M, O, { dx: f, dy: h, dz: g }, n);
1610
+ N = z.nx, p = z.ny, b = z.nz;
1470
1611
  } else {
1471
- const I = i.dip != null ? Number(i.dip) : null, x = i.azimuth != null ? Number(i.azimuth) : null;
1472
- if (!Number.isFinite(I) || !Number.isFinite(x)) continue;
1473
- const S = I * Math.PI / 180, w = x * Math.PI / 180;
1474
- y = Math.sin(w) * Math.sin(S), p = Math.cos(w) * Math.sin(S), b = Math.cos(S);
1612
+ const O = i.dip != null ? Number(i.dip) : null, z = i.azimuth != null ? Number(i.azimuth) : null;
1613
+ if (!Number.isFinite(O) || !Number.isFinite(z)) continue;
1614
+ const L = O * Math.PI / 180, w = z * Math.PI / 180;
1615
+ N = Math.sin(w) * Math.sin(L), p = Math.cos(w) * Math.sin(L), b = Math.cos(L);
1475
1616
  }
1476
- o.push({ ...i, x: u, y: m, z: d, nx: y, ny: p, nz: b });
1617
+ o.push({ ...i, x: u, y: m, z: d, nx: N, ny: p, nz: b });
1477
1618
  }
1478
1619
  return o;
1479
1620
  }
1480
- const Xn = "baselode", gi = Xn, qn = [
1621
+ const tr = "baselode", Ti = tr, nr = [
1481
1622
  "#8b1e3f",
1482
1623
  "#2563eb",
1483
1624
  "#16a34a",
@@ -1488,7 +1629,7 @@ const Xn = "baselode", gi = Xn, qn = [
1488
1629
  "#10b981",
1489
1630
  "#f97316",
1490
1631
  "#8b5cf6"
1491
- ], B = {
1632
+ ], V = {
1492
1633
  bg: "#ffffff",
1493
1634
  panel: "#f8fafc",
1494
1635
  ink: "#1e293b",
@@ -1504,29 +1645,29 @@ const Xn = "baselode", gi = Xn, qn = [
1504
1645
  primary_2: "#a8324f"
1505
1646
  }, Oe = {
1506
1647
  layout: {
1507
- paper_bgcolor: B.bg,
1508
- plot_bgcolor: B.bg,
1509
- colorway: qn,
1648
+ paper_bgcolor: V.bg,
1649
+ plot_bgcolor: V.bg,
1650
+ colorway: nr,
1510
1651
  font: {
1511
1652
  family: "Inter, system-ui, sans-serif",
1512
1653
  size: 12,
1513
- color: B.ink
1654
+ color: V.ink
1514
1655
  },
1515
1656
  title: {
1516
- font: { size: 14, color: B.ink },
1657
+ font: { size: 14, color: V.ink },
1517
1658
  x: 0.05
1518
1659
  },
1519
1660
  hovermode: "x unified",
1520
1661
  hoverlabel: {
1521
- bgcolor: B.bg,
1522
- bordercolor: B.line,
1523
- font: { size: 12, color: B.ink }
1662
+ bgcolor: V.bg,
1663
+ bordercolor: V.line,
1664
+ font: { size: 12, color: V.ink }
1524
1665
  },
1525
1666
  legend: {
1526
1667
  bgcolor: "rgba(255,255,255,0.9)",
1527
- bordercolor: B.muted_3,
1668
+ bordercolor: V.muted_3,
1528
1669
  borderwidth: 1,
1529
- font: { size: 11, color: B.ink },
1670
+ font: { size: 11, color: V.ink },
1530
1671
  orientation: "h",
1531
1672
  yanchor: "bottom",
1532
1673
  y: 1.02,
@@ -1536,34 +1677,34 @@ const Xn = "baselode", gi = Xn, qn = [
1536
1677
  xaxis: {
1537
1678
  showline: !0,
1538
1679
  linewidth: 1,
1539
- linecolor: B.line,
1680
+ linecolor: V.line,
1540
1681
  mirror: !1,
1541
1682
  ticks: "outside",
1542
1683
  tickwidth: 1,
1543
- tickcolor: B.line,
1684
+ tickcolor: V.line,
1544
1685
  ticklen: 4,
1545
1686
  showgrid: !0,
1546
- gridcolor: B.grid,
1687
+ gridcolor: V.grid,
1547
1688
  gridwidth: 1,
1548
1689
  zeroline: !1,
1549
- title_font: { color: B.ink, size: 12 },
1550
- tickfont: { color: B.ink_soft, size: 10 }
1690
+ title_font: { color: V.ink, size: 12 },
1691
+ tickfont: { color: V.ink_soft, size: 10 }
1551
1692
  },
1552
1693
  yaxis: {
1553
1694
  showline: !0,
1554
1695
  linewidth: 1,
1555
- linecolor: B.line,
1696
+ linecolor: V.line,
1556
1697
  mirror: !1,
1557
1698
  ticks: "outside",
1558
1699
  tickwidth: 1,
1559
- tickcolor: B.line,
1700
+ tickcolor: V.line,
1560
1701
  ticklen: 4,
1561
1702
  showgrid: !0,
1562
- gridcolor: B.grid,
1703
+ gridcolor: V.grid,
1563
1704
  gridwidth: 1,
1564
1705
  zeroline: !1,
1565
- title_font: { color: B.ink, size: 12 },
1566
- tickfont: { color: B.ink_soft, size: 10 }
1706
+ title_font: { color: V.ink, size: 12 },
1707
+ tickfont: { color: V.ink_soft, size: 10 }
1567
1708
  },
1568
1709
  modebar: {
1569
1710
  remove: ["select2d", "lasso2d", "autoScale2d"]
@@ -1574,34 +1715,34 @@ const Xn = "baselode", gi = Xn, qn = [
1574
1715
  data: {
1575
1716
  scatter: [{
1576
1717
  mode: "lines+markers",
1577
- line: { width: 2, color: B.primary },
1718
+ line: { width: 2, color: V.primary },
1578
1719
  marker: {
1579
1720
  size: 7,
1580
- color: B.primary_2,
1581
- line: { width: 1.5, color: B.bg }
1721
+ color: V.primary_2,
1722
+ line: { width: 1.5, color: V.bg }
1582
1723
  }
1583
1724
  }],
1584
1725
  bar: [{
1585
1726
  marker: {
1586
- color: B.primary,
1587
- line: { color: B.bg, width: 0 }
1727
+ color: V.primary,
1728
+ line: { color: V.bg, width: 0 }
1588
1729
  }
1589
1730
  }],
1590
1731
  histogram: [{
1591
1732
  marker: {
1592
- color: B.primary,
1593
- line: { color: B.bg, width: 0 }
1733
+ color: V.primary,
1734
+ line: { color: V.bg, width: 0 }
1594
1735
  }
1595
1736
  }],
1596
1737
  box: [{
1597
- fillcolor: B.accent,
1598
- line: { color: B.ink, width: 1.5 },
1599
- marker: { color: B.ink }
1738
+ fillcolor: V.accent,
1739
+ line: { color: V.ink, width: 1.5 },
1740
+ marker: { color: V.ink }
1600
1741
  }],
1601
1742
  violin: [{
1602
- fillcolor: B.accent,
1603
- line: { color: B.ink, width: 1.5 },
1604
- marker: { color: B.ink }
1743
+ fillcolor: V.accent,
1744
+ line: { color: V.ink, width: 1.5 },
1745
+ marker: { color: V.ink }
1605
1746
  }],
1606
1747
  heatmap: [{
1607
1748
  colorscale: [
@@ -1613,9 +1754,9 @@ const Xn = "baselode", gi = Xn, qn = [
1613
1754
  [1, "#1e293b"]
1614
1755
  ],
1615
1756
  colorbar: {
1616
- outlinecolor: B.line,
1617
- tickcolor: B.line,
1618
- tickfont: { color: B.ink_soft }
1757
+ outlinecolor: V.line,
1758
+ tickcolor: V.line,
1759
+ tickfont: { color: V.ink_soft }
1619
1760
  }
1620
1761
  }],
1621
1762
  contour: [{
@@ -1627,13 +1768,13 @@ const Xn = "baselode", gi = Xn, qn = [
1627
1768
  [1, "#1e293b"]
1628
1769
  ],
1629
1770
  colorbar: {
1630
- outlinecolor: B.line,
1631
- tickcolor: B.line,
1632
- tickfont: { color: B.ink_soft }
1771
+ outlinecolor: V.line,
1772
+ tickcolor: V.line,
1773
+ tickfont: { color: V.ink_soft }
1633
1774
  }
1634
1775
  }]
1635
1776
  }
1636
- }, yi = Oe, T = {
1777
+ }, $i = Oe, $ = {
1637
1778
  bg: "#1b1b1f",
1638
1779
  panel: "#25252a",
1639
1780
  ink: "#f0f0e4",
@@ -1645,11 +1786,11 @@ const Xn = "baselode", gi = Xn, qn = [
1645
1786
  muted_1: "#8a8a80",
1646
1787
  muted_2: "#5e5e56",
1647
1788
  muted_3: "#3a3a34"
1648
- }, _i = "baselode-dark", Ni = {
1789
+ }, Ri = "baselode-dark", Bi = {
1649
1790
  layout: {
1650
1791
  font: {
1651
1792
  family: "Inter, Arial, sans-serif",
1652
- color: T.ink,
1793
+ color: $.ink,
1653
1794
  size: 14
1654
1795
  },
1655
1796
  title: {
@@ -1658,37 +1799,37 @@ const Xn = "baselode", gi = Xn, qn = [
1658
1799
  font: {
1659
1800
  family: "Inter, Arial, sans-serif",
1660
1801
  size: 22,
1661
- color: T.ink
1802
+ color: $.ink
1662
1803
  }
1663
1804
  },
1664
- paper_bgcolor: T.bg,
1665
- plot_bgcolor: T.bg,
1805
+ paper_bgcolor: $.bg,
1806
+ plot_bgcolor: $.bg,
1666
1807
  colorway: [
1667
- T.ink,
1668
- T.accent,
1669
- T.muted_1,
1670
- T.accent_2,
1671
- T.muted_2,
1672
- T.muted_3
1808
+ $.ink,
1809
+ $.accent,
1810
+ $.muted_1,
1811
+ $.accent_2,
1812
+ $.muted_2,
1813
+ $.muted_3
1673
1814
  ],
1674
1815
  margin: { l: 70, r: 30, t: 70, b: 60 },
1675
1816
  hovermode: "x unified",
1676
1817
  hoverlabel: {
1677
- bgcolor: T.panel,
1678
- bordercolor: T.accent,
1818
+ bgcolor: $.panel,
1819
+ bordercolor: $.accent,
1679
1820
  font: {
1680
1821
  family: "Inter, Arial, sans-serif",
1681
- color: T.ink,
1822
+ color: $.ink,
1682
1823
  size: 13
1683
1824
  }
1684
1825
  },
1685
1826
  legend: {
1686
1827
  bgcolor: "rgba(37,37,42,0.88)",
1687
- bordercolor: T.line,
1828
+ bordercolor: $.line,
1688
1829
  borderwidth: 1,
1689
1830
  font: {
1690
1831
  family: "Inter, Arial, sans-serif",
1691
- color: T.ink,
1832
+ color: $.ink,
1692
1833
  size: 12
1693
1834
  },
1694
1835
  orientation: "h",
@@ -1701,27 +1842,27 @@ const Xn = "baselode", gi = Xn, qn = [
1701
1842
  showline: !1,
1702
1843
  ticks: "outside",
1703
1844
  tickwidth: 1,
1704
- tickcolor: T.muted_1,
1845
+ tickcolor: $.muted_1,
1705
1846
  ticklen: 6,
1706
1847
  showgrid: !0,
1707
- gridcolor: T.grid,
1848
+ gridcolor: $.grid,
1708
1849
  gridwidth: 1,
1709
1850
  zeroline: !1,
1710
- title_font: { color: T.ink },
1711
- tickfont: { color: T.ink_soft }
1851
+ title_font: { color: $.ink },
1852
+ tickfont: { color: $.ink_soft }
1712
1853
  },
1713
1854
  yaxis: {
1714
1855
  showline: !1,
1715
1856
  ticks: "outside",
1716
1857
  tickwidth: 1,
1717
- tickcolor: T.muted_1,
1858
+ tickcolor: $.muted_1,
1718
1859
  ticklen: 6,
1719
1860
  showgrid: !0,
1720
- gridcolor: T.grid,
1861
+ gridcolor: $.grid,
1721
1862
  gridwidth: 1,
1722
1863
  zeroline: !1,
1723
- title_font: { color: T.ink },
1724
- tickfont: { color: T.ink_soft }
1864
+ title_font: { color: $.ink },
1865
+ tickfont: { color: $.ink_soft }
1725
1866
  },
1726
1867
  bargap: 0.18,
1727
1868
  bargroupgap: 0.08
@@ -1729,34 +1870,34 @@ const Xn = "baselode", gi = Xn, qn = [
1729
1870
  data: {
1730
1871
  scatter: [{
1731
1872
  mode: "lines+markers",
1732
- line: { width: 2.5, color: T.ink },
1873
+ line: { width: 2.5, color: $.ink },
1733
1874
  marker: {
1734
1875
  size: 7,
1735
- color: T.ink,
1736
- line: { width: 1.5, color: T.bg }
1876
+ color: $.ink,
1877
+ line: { width: 1.5, color: $.bg }
1737
1878
  }
1738
1879
  }],
1739
1880
  bar: [{
1740
1881
  marker: {
1741
- color: T.ink,
1742
- line: { color: T.bg, width: 0 }
1882
+ color: $.ink,
1883
+ line: { color: $.bg, width: 0 }
1743
1884
  }
1744
1885
  }],
1745
1886
  histogram: [{
1746
1887
  marker: {
1747
- color: T.ink,
1748
- line: { color: T.bg, width: 0 }
1888
+ color: $.ink,
1889
+ line: { color: $.bg, width: 0 }
1749
1890
  }
1750
1891
  }],
1751
1892
  box: [{
1752
- fillcolor: T.accent,
1753
- line: { color: T.ink, width: 1.5 },
1754
- marker: { color: T.ink }
1893
+ fillcolor: $.accent,
1894
+ line: { color: $.ink, width: 1.5 },
1895
+ marker: { color: $.ink }
1755
1896
  }],
1756
1897
  violin: [{
1757
- fillcolor: T.accent,
1758
- line: { color: T.ink, width: 1.5 },
1759
- marker: { color: T.ink }
1898
+ fillcolor: $.accent,
1899
+ line: { color: $.ink, width: 1.5 },
1900
+ marker: { color: $.ink }
1760
1901
  }],
1761
1902
  heatmap: [{
1762
1903
  colorscale: [
@@ -1768,9 +1909,9 @@ const Xn = "baselode", gi = Xn, qn = [
1768
1909
  [1, "#ffffbb"]
1769
1910
  ],
1770
1911
  colorbar: {
1771
- outlinecolor: T.ink,
1772
- tickcolor: T.ink,
1773
- tickfont: { color: T.ink_soft }
1912
+ outlinecolor: $.ink,
1913
+ tickcolor: $.ink,
1914
+ tickfont: { color: $.ink_soft }
1774
1915
  }
1775
1916
  }],
1776
1917
  contour: [{
@@ -1782,13 +1923,13 @@ const Xn = "baselode", gi = Xn, qn = [
1782
1923
  [1, "#ffffbb"]
1783
1924
  ],
1784
1925
  colorbar: {
1785
- outlinecolor: T.ink,
1786
- tickcolor: T.ink,
1787
- tickfont: { color: T.ink_soft }
1926
+ outlinecolor: $.ink,
1927
+ tickcolor: $.ink,
1928
+ tickfont: { color: $.ink_soft }
1788
1929
  }
1789
1930
  }]
1790
1931
  }
1791
- }, Zn = "#7f7f7f", Be = {
1932
+ }, rr = "#7f7f7f", Be = {
1792
1933
  Au: "#FFD700",
1793
1934
  // gold
1794
1935
  Ag: "#C0C0C0",
@@ -1825,7 +1966,7 @@ const Xn = "baselode", gi = Xn, qn = [
1825
1966
  // aluminium / yellow
1826
1967
  U: "#8BC34A"
1827
1968
  // uranium / lime green
1828
- }, Wn = {
1969
+ }, or = {
1829
1970
  // Sedimentary
1830
1971
  shale: "#607D8B",
1831
1972
  mudstone: "#78909C",
@@ -1866,9 +2007,9 @@ const Xn = "baselode", gi = Xn, qn = [
1866
2007
  unknown: "#9E9E9E"
1867
2008
  }, Xe = {
1868
2009
  commodity: Be,
1869
- lithology: Wn
2010
+ lithology: or
1870
2011
  };
1871
- function Kn(e, t, n = Zn) {
2012
+ function ir(e, t, n = rr) {
1872
2013
  if (!t || e == null) return n;
1873
2014
  const r = String(e).trim();
1874
2015
  if (Object.prototype.hasOwnProperty.call(t, r)) return t[r];
@@ -1877,7 +2018,7 @@ function Kn(e, t, n = Zn) {
1877
2018
  if (String(i).trim().toLowerCase() === o) return s;
1878
2019
  return n;
1879
2020
  }
1880
- function Jn(e) {
2021
+ function sr(e) {
1881
2022
  if (e == null) return {};
1882
2023
  if (typeof e == "string") {
1883
2024
  const t = e.trim().toLowerCase();
@@ -1893,8 +2034,8 @@ function Jn(e) {
1893
2034
  `colourMap must be null, a string, or a plain object; got ${Array.isArray(e) ? "Array" : Object.prototype.toString.call(e)}`
1894
2035
  );
1895
2036
  }
1896
- const Qn = "#8b1e3f", er = "#a8324f";
1897
- function tr(e) {
2037
+ const lr = "#8b1e3f", ar = "#a8324f";
2038
+ function cr(e) {
1898
2039
  if (!e) return null;
1899
2040
  const t = e.split(/[_\-/\s]+/);
1900
2041
  for (const n of t) {
@@ -1906,26 +2047,26 @@ function tr(e) {
1906
2047
  }
1907
2048
  return null;
1908
2049
  }
1909
- const nr = "#6b7280", rr = { l: 42, r: 4, t: 4, b: 30 }, ft = 10, ht = 12;
1910
- function pt(e) {
2050
+ const ur = "#6b7280", dr = { l: 42, r: 4, t: 4, b: 30 }, pt = 10, bt = 12;
2051
+ function gt(e) {
1911
2052
  return e ? typeof e == "string" ? { text: e } : e : {};
1912
2053
  }
1913
- function wt(e = {}) {
1914
- const t = pt(e.xaxis && e.xaxis.title), n = pt(e.yaxis && e.yaxis.title);
2054
+ function Vt(e = {}) {
2055
+ const t = gt(e.xaxis && e.xaxis.title), n = gt(e.yaxis && e.yaxis.title);
1915
2056
  return {
1916
2057
  ...e,
1917
- margin: rr,
2058
+ margin: dr,
1918
2059
  autosize: !0,
1919
2060
  width: void 0,
1920
2061
  xaxis: {
1921
2062
  ...e.xaxis || {},
1922
2063
  tickfont: {
1923
2064
  ...e.xaxis && e.xaxis.tickfont || {},
1924
- size: ft
2065
+ size: pt
1925
2066
  },
1926
2067
  title: {
1927
2068
  ...t,
1928
- font: { ...t.font || {}, size: ht }
2069
+ font: { ...t.font || {}, size: bt }
1929
2070
  }
1930
2071
  },
1931
2072
  yaxis: {
@@ -1933,16 +2074,16 @@ function wt(e = {}) {
1933
2074
  automargin: !0,
1934
2075
  tickfont: {
1935
2076
  ...e.yaxis && e.yaxis.tickfont || {},
1936
- size: ft
2077
+ size: pt
1937
2078
  },
1938
2079
  title: {
1939
2080
  ...n,
1940
- font: { ...n.font || {}, size: ht }
2081
+ font: { ...n.font || {}, size: bt }
1941
2082
  }
1942
2083
  }
1943
2084
  };
1944
2085
  }
1945
- function or(e, t) {
2086
+ function mr(e, t) {
1946
2087
  var r;
1947
2088
  if (!e || !t) return !1;
1948
2089
  const n = e.points || [];
@@ -1953,7 +2094,7 @@ function or(e, t) {
1953
2094
  }
1954
2095
  return !1;
1955
2096
  }
1956
- function ir(e, t, n) {
2097
+ function fr(e, t, n) {
1957
2098
  if (!e || !t) return [];
1958
2099
  const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
1959
2100
  return r.forEach((s) => {
@@ -1982,11 +2123,11 @@ function ir(e, t, n) {
1982
2123
  });
1983
2124
  }), o.sort((s, l) => l.z - s.z);
1984
2125
  }
1985
- function sr(e, t, n, r) {
2126
+ function hr(e, t, n, r) {
1986
2127
  if (!e.length) return { data: [], layout: {} };
1987
2128
  const o = e.filter((d) => Number.isFinite(d == null ? void 0 : d.from) && Number.isFinite(d == null ? void 0 : d.to) && d.to > d.from).map((d) => ({ ...d, category: `${(d == null ? void 0 : d.val) ?? ""}`.trim() })).filter((d) => d.category !== "" && !/^(nan|null|none)$/i.test(d.category)).sort((d, f) => d.from - f.from || d.to - f.to);
1988
2129
  if (!o.length) return { data: [], layout: {} };
1989
- const i = Jn(n), s = [
2130
+ const i = sr(n), s = [
1990
2131
  "#1f77b4",
1991
2132
  // blue
1992
2133
  "#ff7f0e",
@@ -2018,7 +2159,7 @@ function sr(e, t, n, r) {
2018
2159
  ], l = [...new Set(o.map((d) => d.category))];
2019
2160
  function c(d, f) {
2020
2161
  if (i && Object.keys(i).length > 0) {
2021
- const h = Kn(d, i, null);
2162
+ const h = ir(d, i, null);
2022
2163
  if (h !== null) return h;
2023
2164
  }
2024
2165
  return s[f % s.length];
@@ -2040,7 +2181,7 @@ function sr(e, t, n, r) {
2040
2181
  customdata: f.map((h) => [h.from, h.to]),
2041
2182
  hovertemplate: `${t}: ${d}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
2042
2183
  };
2043
- }), layout: wt({
2184
+ }), layout: Vt({
2044
2185
  barmode: "overlay",
2045
2186
  bargap: 0,
2046
2187
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
@@ -2050,9 +2191,9 @@ function sr(e, t, n, r) {
2050
2191
  template: r !== void 0 ? r : Oe
2051
2192
  }) };
2052
2193
  }
2053
- function lr(e, t, n, r, o) {
2194
+ function pr(e, t, n, r, o) {
2054
2195
  if (!e.length) return { data: [], layout: {} };
2055
- const i = n === "bar", s = n === "markers", l = n === "line", c = r || Qn, a = r || er, u = {
2196
+ const i = n === "bar", s = n === "markers", l = n === "line", c = r || lr, a = r || ar, u = {
2056
2197
  x: e.map((h) => h.val),
2057
2198
  y: e.map((h) => h.z),
2058
2199
  hovertemplate: `${t}: %{x}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
@@ -2064,7 +2205,7 @@ function lr(e, t, n, r, o) {
2064
2205
  arrayminus: e.map((h) => h.errorMinus),
2065
2206
  thickness: 1.5,
2066
2207
  width: 2,
2067
- color: nr
2208
+ color: ur
2068
2209
  };
2069
2210
  return { data: [i ? {
2070
2211
  ...u,
@@ -2079,7 +2220,7 @@ function lr(e, t, n, r, o) {
2079
2220
  line: { color: c, width: 2 },
2080
2221
  marker: { size: 7, color: a },
2081
2222
  error_y: l ? void 0 : m
2082
- }], layout: wt({
2223
+ }], layout: Vt({
2083
2224
  xaxis: { title: t, zeroline: !1 },
2084
2225
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
2085
2226
  barmode: "overlay",
@@ -2087,14 +2228,14 @@ function lr(e, t, n, r, o) {
2087
2228
  template: o !== void 0 ? o : Oe
2088
2229
  }) };
2089
2230
  }
2090
- function Tt({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i }) {
2231
+ function Ht({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i }) {
2091
2232
  if (!e || !e.length || !n) return { data: [], layout: {} };
2092
2233
  if (t || r === "categorical")
2093
- return sr(e, n, o, i);
2094
- const s = tr(n);
2095
- return lr(e, n, r, s, i);
2234
+ return hr(e, n, o, i);
2235
+ const s = cr(n);
2236
+ return pr(e, n, r, s, i);
2096
2237
  }
2097
- function Mi(e = [], {
2238
+ function Vi(e = [], {
2098
2239
  fromCol: t = "from",
2099
2240
  toCol: n = "to",
2100
2241
  categoryCol: r = "geology_code",
@@ -2114,7 +2255,7 @@ function Mi(e = [], {
2114
2255
  errorPlus: a - m,
2115
2256
  errorMinus: m - c
2116
2257
  });
2117
- }), s.sort((l, c) => c.z - l.z), Tt({
2258
+ }), s.sort((l, c) => c.z - l.z), Ht({
2118
2259
  points: s,
2119
2260
  isCategorical: !0,
2120
2261
  property: r,
@@ -2123,7 +2264,7 @@ function Mi(e = [], {
2123
2264
  template: i
2124
2265
  });
2125
2266
  }
2126
- const $t = [
2267
+ const jt = [
2127
2268
  "#0f172a",
2128
2269
  "#1e3a5f",
2129
2270
  "#7c3aed",
@@ -2134,24 +2275,24 @@ const $t = [
2134
2275
  "#db2777",
2135
2276
  "#65a30d",
2136
2277
  "#9333ea"
2137
- ], ar = { l: 42, r: 4, t: 4, b: 30 }, bt = 10, gt = 12;
2138
- function Rt(e = {}) {
2278
+ ], br = { l: 42, r: 4, t: 4, b: 30 }, yt = 10, _t = 12;
2279
+ function Gt(e = {}) {
2139
2280
  return {
2140
2281
  ...e,
2141
- margin: ar,
2282
+ margin: br,
2142
2283
  autosize: !0,
2143
2284
  width: void 0,
2144
2285
  xaxis: {
2145
2286
  ...e.xaxis || {},
2146
2287
  tickfont: {
2147
2288
  ...e.xaxis && e.xaxis.tickfont || {},
2148
- size: bt
2289
+ size: yt
2149
2290
  },
2150
2291
  title: {
2151
2292
  ...e.xaxis && e.xaxis.title || {},
2152
2293
  font: {
2153
2294
  ...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
2154
- size: gt
2295
+ size: _t
2155
2296
  }
2156
2297
  }
2157
2298
  },
@@ -2160,25 +2301,25 @@ function Rt(e = {}) {
2160
2301
  automargin: !0,
2161
2302
  tickfont: {
2162
2303
  ...e.yaxis && e.yaxis.tickfont || {},
2163
- size: bt
2304
+ size: yt
2164
2305
  },
2165
2306
  title: {
2166
2307
  ...e.yaxis && e.yaxis.title || {},
2167
2308
  font: {
2168
2309
  ...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
2169
- size: gt
2310
+ size: _t
2170
2311
  }
2171
2312
  }
2172
2313
  }
2173
2314
  };
2174
2315
  }
2175
- function cr(e, {
2316
+ function gr(e, {
2176
2317
  tailScale: t = 5,
2177
2318
  colorBy: n = null,
2178
- palette: r = $t,
2179
- depthCol: o = W,
2180
- dipCol: i = q,
2181
- azCol: s = X,
2319
+ palette: r = jt,
2320
+ depthCol: o = X,
2321
+ dipCol: i = W,
2322
+ azCol: s = q,
2182
2323
  template: l = void 0
2183
2324
  } = {}) {
2184
2325
  const c = e.filter(
@@ -2187,36 +2328,36 @@ function cr(e, {
2187
2328
  if (!c.length)
2188
2329
  return { data: [], layout: {} };
2189
2330
  const a = {};
2190
- n && [...new Set(c.map((y) => y[n]).filter((y) => y != null))].sort().forEach((y, p) => {
2191
- a[y] = r[p % r.length];
2331
+ n && [...new Set(c.map((N) => N[n]).filter((N) => N != null))].sort().forEach((N, p) => {
2332
+ a[N] = r[p % r.length];
2192
2333
  });
2193
2334
  const u = /* @__PURE__ */ new Map(), m = [];
2194
2335
  for (const g of c) {
2195
- const y = Number(g[o]), p = Number(g[i]), b = Number(g[s]), N = n ? g[n] ?? "_default" : "_default", M = n ? a[N] ?? "#0f172a" : "#0f172a";
2196
- u.has(N) || u.set(N, { xs: [], ys: [], dips: [], azs: [], color: M });
2197
- const I = u.get(N);
2198
- I.xs.push(p), I.ys.push(y), I.dips.push(p), I.azs.push(b);
2199
- const x = b * Math.PI / 180, S = t * (Math.abs(p) / 90), w = Math.sin(x) * S, D = Math.cos(x) * S;
2336
+ const N = Number(g[o]), p = Number(g[i]), b = Number(g[s]), M = n ? g[n] ?? "_default" : "_default", v = n ? a[M] ?? "#0f172a" : "#0f172a";
2337
+ u.has(M) || u.set(M, { xs: [], ys: [], dips: [], azs: [], color: v });
2338
+ const O = u.get(M);
2339
+ O.xs.push(p), O.ys.push(N), O.dips.push(p), O.azs.push(b);
2340
+ const z = b * Math.PI / 180, L = t * (Math.abs(p) / 90), w = Math.sin(z) * L, C = Math.cos(z) * L;
2200
2341
  m.push({
2201
2342
  type: "line",
2202
2343
  x0: p,
2203
- y0: y,
2344
+ y0: N,
2204
2345
  x1: p + w,
2205
- y1: y + D,
2206
- line: { color: M, width: 2 }
2346
+ y1: N + C,
2347
+ line: { color: v, width: 2 }
2207
2348
  });
2208
2349
  }
2209
2350
  const d = [], f = n && u.size > 1;
2210
- for (const [g, y] of u.entries())
2351
+ for (const [g, N] of u.entries())
2211
2352
  d.push({
2212
2353
  type: "scatter",
2213
- x: y.xs,
2214
- y: y.ys,
2354
+ x: N.xs,
2355
+ y: N.ys,
2215
2356
  mode: "markers",
2216
2357
  name: g !== "_default" ? String(g) : void 0,
2217
- marker: { size: 8, color: y.color },
2358
+ marker: { size: 8, color: N.color },
2218
2359
  showlegend: f && g !== "_default",
2219
- customdata: y.dips.map((p, b) => [p, y.azs[b]]),
2360
+ customdata: N.dips.map((p, b) => [p, N.azs[b]]),
2220
2361
  hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
2221
2362
  });
2222
2363
  return { data: d, layout: {
@@ -2235,11 +2376,11 @@ function cr(e, {
2235
2376
  template: l !== void 0 ? l : Oe
2236
2377
  } };
2237
2378
  }
2238
- function zi(e, {
2379
+ function Hi(e, {
2239
2380
  labelCol: t = "structure_type",
2240
- palette: n = $t,
2381
+ palette: n = jt,
2241
2382
  fromCol: r = F,
2242
- toCol: o = $,
2383
+ toCol: o = T,
2243
2384
  template: i = void 0
2244
2385
  } = {}) {
2245
2386
  const s = e.filter((d) => d[r] != null && d[o] != null && Number(d[o]) > Number(d[r])).filter((d) => {
@@ -2273,7 +2414,7 @@ function zi(e, {
2273
2414
  textposition: "middle center",
2274
2415
  showlegend: !1,
2275
2416
  hoverinfo: "text"
2276
- }], layout: Rt({
2417
+ }], layout: Gt({
2277
2418
  shapes: l,
2278
2419
  height: 400,
2279
2420
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
@@ -2282,7 +2423,7 @@ function zi(e, {
2282
2423
  template: i !== void 0 ? i : Oe
2283
2424
  }) };
2284
2425
  }
2285
- function yt(e, t) {
2426
+ function Nt(e, t) {
2286
2427
  if (!e) return "";
2287
2428
  const n = String(e).trim().split(/\s+/), r = [];
2288
2429
  let o = "";
@@ -2290,10 +2431,10 @@ function yt(e, t) {
2290
2431
  o && o.length + 1 + i.length > t ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
2291
2432
  return o && r.push(o), r.join("<br>");
2292
2433
  }
2293
- function ur(e, {
2434
+ function yr(e, {
2294
2435
  commentCol: t = "comments",
2295
2436
  fromCol: n = F,
2296
- toCol: r = $,
2437
+ toCol: r = T,
2297
2438
  bgColor: o = "#f1f5f9",
2298
2439
  borderColor: i = "#cbd5e1",
2299
2440
  textColor: s = "#1e293b",
@@ -2301,14 +2442,14 @@ function ur(e, {
2301
2442
  template: c = void 0
2302
2443
  } = {}) {
2303
2444
  const a = e.filter((p) => p[n] != null && p[r] != null && Number(p[r]) > Number(p[n])).map((p) => {
2304
- const b = p[t], N = b != null && String(b).trim() !== "" && String(b) !== "null" ? String(b).trim() : "";
2305
- return { from: Number(p[n]), to: Number(p[r]), comment: N };
2445
+ const b = p[t], M = b != null && String(b).trim() !== "" && String(b) !== "null" ? String(b).trim() : "";
2446
+ return { from: Number(p[n]), to: Number(p[r]), comment: M };
2306
2447
  }).sort((p, b) => p.from - b.from);
2307
2448
  if (!a.length)
2308
2449
  return { data: [], layout: {} };
2309
2450
  const u = [], m = [], d = [], f = [], h = [];
2310
2451
  for (const p of a) {
2311
- const b = 0.5 * (p.from + p.to), N = !!p.comment;
2452
+ const b = 0.5 * (p.from + p.to), M = !!p.comment;
2312
2453
  u.push({
2313
2454
  type: "rect",
2314
2455
  xref: "x",
@@ -2317,10 +2458,10 @@ function ur(e, {
2317
2458
  x1: 1,
2318
2459
  y0: p.from,
2319
2460
  y1: p.to,
2320
- fillcolor: N ? o : "rgba(0,0,0,0)",
2461
+ fillcolor: M ? o : "rgba(0,0,0,0)",
2321
2462
  line: { color: i, width: 1 },
2322
2463
  layer: "below"
2323
- }), N && (m.push(0.5), d.push(b), f.push(yt(p.comment, l)), h.push(`${p.from.toFixed(3)}–${p.to.toFixed(3)} m<br>${yt(p.comment, 40)}`));
2464
+ }), M && (m.push(0.5), d.push(b), f.push(Nt(p.comment, l)), h.push(`${p.from.toFixed(3)}–${p.to.toFixed(3)} m<br>${Nt(p.comment, 40)}`));
2324
2465
  }
2325
2466
  return { data: m.length ? [{
2326
2467
  type: "scatter",
@@ -2333,7 +2474,7 @@ function ur(e, {
2333
2474
  hovertext: h,
2334
2475
  hoverinfo: "text",
2335
2476
  showlegend: !1
2336
- }] : [], layout: Rt({
2477
+ }] : [], layout: Gt({
2337
2478
  shapes: u,
2338
2479
  height: 400,
2339
2480
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
@@ -2342,12 +2483,12 @@ function ur(e, {
2342
2483
  template: c !== void 0 ? c : Oe
2343
2484
  }) };
2344
2485
  }
2345
- function vi(e, {
2486
+ function ji(e, {
2346
2487
  symbolSize: t = 10,
2347
2488
  xCol: n = "easting",
2348
2489
  yCol: r = "northing"
2349
2490
  } = {}) {
2350
- const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[q] != null ? Number(e[q]) : null, l = e[X] != null ? Number(e[X]) : null;
2491
+ const o = e[n] != null ? Number(e[n]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[W] != null ? Number(e[W]) : null, l = e[q] != null ? Number(e[q]) : null;
2351
2492
  if (o === null || i === null || s === null || l === null) return null;
2352
2493
  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), h = f * Math.sin(u), g = f * Math.cos(u);
2353
2494
  return {
@@ -2363,53 +2504,53 @@ function vi(e, {
2363
2504
  tickY1: i + g
2364
2505
  };
2365
2506
  }
2366
- const Bt = "markers+line";
2367
- function dr(e, t) {
2507
+ const Ut = "markers+line";
2508
+ function _r(e, t) {
2368
2509
  var r;
2369
- const n = et(e);
2370
- return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || Bt;
2510
+ const n = tt(e);
2511
+ return n.some((o) => o.value === t) ? t : ((r = n[0]) == null ? void 0 : r.value) || Ut;
2371
2512
  }
2372
- function Ei({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o, template: i }) {
2373
- const s = De(null), l = t == null ? void 0 : t.hole, c = (t == null ? void 0 : t.points) || [], a = (e == null ? void 0 : e.property) || "", u = (e == null ? void 0 : e.chartType) || Bt, m = (e == null ? void 0 : e.holeId) || "", d = (t == null ? void 0 : t.displayType) || (t != null && t.isComment ? ke : t != null && t.isCategorical ? Le : Ae), f = et(d), h = dr(d, u), [g, y] = Q("");
2513
+ function Gi({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [], onConfigChange: o, template: i }) {
2514
+ const s = De(null), l = t == null ? void 0 : t.hole, c = (t == null ? void 0 : t.points) || [], a = (e == null ? void 0 : e.property) || "", u = (e == null ? void 0 : e.chartType) || Ut, m = (e == null ? void 0 : e.holeId) || "", d = (t == null ? void 0 : t.displayType) || (t != null && t.isComment ? Ae : t != null && t.isCategorical ? Ce : Ie), f = tt(d), h = _r(d, u), [g, N] = ee("");
2374
2515
  return se(() => {
2375
- const p = d === ke, b = d === Je;
2516
+ const p = d === Ae, b = d === Je;
2376
2517
  if (!l || !a || !p && !b && c.length === 0) return;
2377
- const N = s.current;
2378
- if (!N) return;
2379
- let M;
2518
+ const M = s.current;
2519
+ if (!M) return;
2520
+ let v;
2380
2521
  try {
2381
- p ? M = ur(c, { commentCol: a, fromCol: "from", toCol: "to" }) : b ? M = cr(c) : M = Tt({
2522
+ p ? v = yr(c, { commentCol: a, fromCol: "from", toCol: "to" }) : b ? v = gr(c) : v = Ht({
2382
2523
  points: c,
2383
- isCategorical: d === Le,
2524
+ isCategorical: d === Ce,
2384
2525
  property: a,
2385
2526
  chartType: h,
2386
2527
  template: i
2387
2528
  });
2388
- } catch (x) {
2389
- console.error("Plot build error", x), y((x == null ? void 0 : x.message) || "Plot build error");
2529
+ } catch (z) {
2530
+ console.error("Plot build error", z), N((z == null ? void 0 : z.message) || "Plot build error");
2390
2531
  return;
2391
2532
  }
2392
- if ((!(M != null && M.data) || M.data.length === 0) && !p)
2533
+ if ((!(v != null && v.data) || v.data.length === 0) && !p)
2393
2534
  return;
2394
- const I = {
2535
+ const O = {
2395
2536
  displayModeBar: !0,
2396
2537
  responsive: !0,
2397
2538
  useResizeHandler: !0,
2398
2539
  modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
2399
2540
  };
2400
2541
  try {
2401
- y(""), Fe.react(N, M.data, M.layout, I), requestAnimationFrame(() => {
2402
- N && N.parentElement && Fe.Plots.resize(N);
2542
+ N(""), Fe.react(M, v.data, v.layout, O), requestAnimationFrame(() => {
2543
+ M && M.parentElement && Fe.Plots.resize(M);
2403
2544
  });
2404
- } catch (x) {
2405
- console.error("Plot render error", x), y((x == null ? void 0 : x.message) || "Plot render error");
2545
+ } catch (z) {
2546
+ console.error("Plot render error", z), N((z == null ? void 0 : z.message) || "Plot render error");
2406
2547
  }
2407
2548
  return () => {
2408
- if (N)
2549
+ if (M)
2409
2550
  try {
2410
- Fe.purge(N);
2411
- } catch (x) {
2412
- console.warn("Plot purge error", x);
2551
+ Fe.purge(M);
2552
+ } catch (z) {
2553
+ console.warn("Plot purge error", z);
2413
2554
  }
2414
2555
  };
2415
2556
  }, [l, a, h, d, c, i]), se(() => {
@@ -2418,15 +2559,15 @@ function Ei({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [],
2418
2559
  const b = new ResizeObserver(() => {
2419
2560
  try {
2420
2561
  p && p.data && Fe.Plots.resize(p);
2421
- } catch (N) {
2422
- console.warn("Plot resize error", N);
2562
+ } catch (M) {
2563
+ console.warn("Plot resize error", M);
2423
2564
  }
2424
2565
  });
2425
2566
  return b.observe(p), () => b.disconnect();
2426
- }, []), !l || !a ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ P("div", { className: "placeholder", children: e != null && e.holeId ? t != null && t.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : d !== ke && d !== Je && c.length === 0 ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ P("div", { className: "placeholder", children: "No data" }) }) : g ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ J("div", { className: "placeholder", children: [
2567
+ }, []), !l || !a ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ P("div", { className: "placeholder", children: e != null && e.holeId ? t != null && t.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : d !== Ae && d !== Je && c.length === 0 ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ P("div", { className: "placeholder", children: "No data" }) }) : g ? /* @__PURE__ */ P("div", { className: "plot-card empty", children: /* @__PURE__ */ K("div", { className: "placeholder", children: [
2427
2568
  "Plot error: ",
2428
2569
  g
2429
- ] }) }) : /* @__PURE__ */ J("div", { className: "plot-card", children: [
2570
+ ] }) }) : /* @__PURE__ */ K("div", { className: "plot-card", children: [
2430
2571
  /* @__PURE__ */ P("div", { className: "plot-title", children: /* @__PURE__ */ P(
2431
2572
  "select",
2432
2573
  {
@@ -2434,12 +2575,12 @@ function Ei({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [],
2434
2575
  value: m,
2435
2576
  onChange: (p) => o && o({ holeId: p.target.value }),
2436
2577
  children: n.map((p) => {
2437
- const b = typeof p == "string" ? p : p.holeId, N = typeof p == "string" ? p : p.label || p.holeId;
2438
- return /* @__PURE__ */ P("option", { value: b, children: N }, b);
2578
+ const b = typeof p == "string" ? p : p.holeId, M = typeof p == "string" ? p : p.label || p.holeId;
2579
+ return /* @__PURE__ */ P("option", { value: b, children: M }, b);
2439
2580
  })
2440
2581
  }
2441
2582
  ) }),
2442
- /* @__PURE__ */ J("div", { className: "plot-controls column", children: [
2583
+ /* @__PURE__ */ K("div", { className: "plot-controls column", children: [
2443
2584
  r.length > 0 && /* @__PURE__ */ P(
2444
2585
  "select",
2445
2586
  {
@@ -2462,7 +2603,7 @@ function Ei({ config: e, graph: t, holeOptions: n = [], propertyOptions: r = [],
2462
2603
  /* @__PURE__ */ P("div", { className: "plotly-chart", ref: s })
2463
2604
  ] });
2464
2605
  }
2465
- function _t(e, t) {
2606
+ function Mt(e, t) {
2466
2607
  if (!(t != null && t.length)) return e;
2467
2608
  const n = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
2468
2609
  for (const r of t) {
@@ -2476,7 +2617,7 @@ function _t(e, t) {
2476
2617
  }
2477
2618
  return Array.from(n.values());
2478
2619
  }
2479
- function mr(e, t) {
2620
+ function Nr(e, t) {
2480
2621
  if (!e || !t) return [];
2481
2622
  const n = /* @__PURE__ */ new Set(), r = [];
2482
2623
  for (const o of e.points || []) {
@@ -2487,47 +2628,47 @@ function mr(e, t) {
2487
2628
  }
2488
2629
  return r;
2489
2630
  }
2490
- function xi({
2631
+ function Ui({
2491
2632
  initialFocusedHoleId: e = "",
2492
2633
  sourceFile: t = null,
2493
2634
  extraHoles: n = [],
2494
2635
  plotCount: r = 4
2495
2636
  } = {}) {
2496
- const [o, i] = Q([]), [s, l] = Q([]), [c, a] = Q([]), [u, m] = Q([]), [d, f] = Q([]), [h, g] = Q({}), [y, p] = Q(""), [b, N] = Q([]), [M, I] = Q(""), [x, S] = Q(e || ""), [w, D] = Q([]), v = De(null);
2637
+ const [o, i] = ee([]), [s, l] = ee([]), [c, a] = ee([]), [u, m] = ee([]), [d, f] = ee([]), [h, g] = ee({}), [N, p] = ee(""), [b, M] = ee([]), [v, O] = ee(""), [z, L] = ee(e || ""), [w, C] = ee([]), _ = De(null);
2497
2638
  se(() => {
2498
- !t || v.current === t || (v.current = t, En(t).then((A) => {
2499
- if (!A) return;
2500
- const E = Array.from(new Map(A.map((z) => [z.holeId, z])).values());
2501
- l(E), N(St({
2502
- holeIds: E.map((z) => z.holeId),
2503
- focusedHoleId: x,
2639
+ !t || _.current === t || (_.current = t, On(t).then((S) => {
2640
+ if (!S) return;
2641
+ const x = Array.from(new Map(S.map((E) => [E.holeId, E])).values());
2642
+ l(x), M(wt({
2643
+ holeIds: x.map((E) => E.holeId),
2644
+ focusedHoleId: z,
2504
2645
  plotCount: r,
2505
2646
  defaultProp: "",
2506
2647
  categoricalProps: u,
2507
2648
  commentProps: d,
2508
2649
  numericDefaultChartType: "markers+line"
2509
2650
  }));
2510
- }).catch((A) => {
2511
- console.info("Assay metadata load skipped:", A.message);
2651
+ }).catch((S) => {
2652
+ console.info("Assay metadata load skipped:", S.message);
2512
2653
  }));
2513
- }, [t, x, r, u, d]), se(() => {
2654
+ }, [t, z, r, u, d]), se(() => {
2514
2655
  if (!(n != null && n.length)) return;
2515
- const A = n.map((E) => ({ holeId: E.id || E.holeId })).filter((E) => E.holeId);
2516
- l((E) => {
2517
- const z = new Set(E.map((C) => C.holeId)), R = A.filter((C) => !z.has(C.holeId));
2518
- return R.length ? [...E, ...R] : E;
2656
+ const S = n.map((x) => ({ holeId: x.id || x.holeId })).filter((x) => x.holeId);
2657
+ l((x) => {
2658
+ const E = new Set(x.map((D) => D.holeId)), R = S.filter((D) => !E.has(D.holeId));
2659
+ return R.length ? [...x, ...R] : x;
2519
2660
  });
2520
2661
  }, [n]), se(() => {
2521
- I((A) => A && A.startsWith("Loading ") && A.includes(" for hole ") ? A : "");
2662
+ O((S) => S && S.startsWith("Loading ") && S.includes(" for hole ") ? S : "");
2522
2663
  }, [b]), se(() => {
2523
2664
  if (!s.length) {
2524
- N([]);
2665
+ M([]);
2525
2666
  return;
2526
2667
  }
2527
- const A = Ct(s.map((E) => E.holeId), x);
2528
- N((E) => Array.from({ length: r }).map((R, C) => {
2529
- var K;
2530
- const G = E[C] || {}, U = s.some((le) => le.holeId === G.holeId) ? G.holeId : A[C] || ((K = s[C]) == null ? void 0 : K.holeId) || "", j = G.property || y, Z = Te({
2668
+ const S = Ct(s.map((x) => x.holeId), z);
2669
+ M((x) => Array.from({ length: r }).map((R, D) => {
2670
+ var J;
2671
+ const G = x[D] || {}, U = s.some((le) => le.holeId === G.holeId) ? G.holeId : S[D] || ((J = s[D]) == null ? void 0 : J.holeId) || "", j = G.property || N, Z = Te({
2531
2672
  property: j,
2532
2673
  chartType: G.chartType,
2533
2674
  categoricalProps: u,
@@ -2536,97 +2677,97 @@ function xi({
2536
2677
  });
2537
2678
  return { holeId: U, property: j, chartType: Z };
2538
2679
  }));
2539
- }, [s, x, y, u, d, r]), se(() => {
2680
+ }, [s, z, N, u, d, r]), se(() => {
2540
2681
  if (!t) return;
2541
- b.map((E) => E.holeId).filter(Boolean).forEach((E) => {
2542
- const z = o.some((C) => (C.id || C.holeId) === E), R = w.includes(E);
2543
- z || R || (D((C) => [...C, E]), xn(t, E).then((C) => {
2544
- D((G) => G.filter((U) => U !== E)), C && i((G) => {
2545
- const U = _t(
2546
- [...G.filter((Z) => (Z.id || Z.holeId) !== E), C],
2682
+ b.map((x) => x.holeId).filter(Boolean).forEach((x) => {
2683
+ const E = o.some((D) => (D.id || D.holeId) === x), R = w.includes(x);
2684
+ E || R || (C((D) => [...D, x]), Sn(t, x).then((D) => {
2685
+ C((G) => G.filter((U) => U !== x)), D && i((G) => {
2686
+ const U = Mt(
2687
+ [...G.filter((Z) => (Z.id || Z.holeId) !== x), D],
2547
2688
  n
2548
2689
  ), j = Re(U);
2549
- return a(j.numericProps), m(j.categoricalProps), f(j.commentProps), g(j.columnMeta), !y && j.defaultProp && (p(j.defaultProp), N((Z) => Z.map((K) => ({
2550
- ...K,
2551
- property: K.property || j.defaultProp,
2690
+ return a(j.numericProps), m(j.categoricalProps), f(j.commentProps), g(j.columnMeta), !N && j.defaultProp && (p(j.defaultProp), M((Z) => Z.map((J) => ({
2691
+ ...J,
2692
+ property: J.property || j.defaultProp,
2552
2693
  chartType: Te({
2553
- property: K.property || j.defaultProp,
2554
- chartType: K.chartType,
2694
+ property: J.property || j.defaultProp,
2695
+ chartType: J.chartType,
2555
2696
  categoricalProps: j.categoricalProps,
2556
2697
  commentProps: j.commentProps,
2557
2698
  numericDefaultChartType: "markers+line"
2558
2699
  })
2559
2700
  })))), U;
2560
2701
  });
2561
- }).catch((C) => {
2562
- console.error(C), D((G) => G.filter((U) => U !== E)), I(C.message || `Error loading hole ${E}`);
2702
+ }).catch((D) => {
2703
+ console.error(D), C((G) => G.filter((U) => U !== x)), O(D.message || `Error loading hole ${x}`);
2563
2704
  }));
2564
2705
  });
2565
- }, [b, t, o, w, y, n]), se(() => {
2566
- n != null && n.length && i((A) => {
2567
- if (!A.length) {
2706
+ }, [b, t, o, w, N, n]), se(() => {
2707
+ n != null && n.length && i((S) => {
2708
+ if (!S.length) {
2568
2709
  const R = Re(n);
2569
- return a(R.numericProps), m(R.categoricalProps), f(R.commentProps), g(R.columnMeta), !y && R.defaultProp && p(R.defaultProp), n;
2710
+ return a(R.numericProps), m(R.categoricalProps), f(R.commentProps), g(R.columnMeta), !N && R.defaultProp && p(R.defaultProp), n;
2570
2711
  }
2571
- const E = _t(A, n), z = Re(E);
2572
- return a(z.numericProps), m(z.categoricalProps), f(z.commentProps), g(z.columnMeta), !y && z.defaultProp && p(z.defaultProp), E;
2712
+ const x = Mt(S, n), E = Re(x);
2713
+ return a(E.numericProps), m(E.categoricalProps), f(E.commentProps), g(E.columnMeta), !N && E.defaultProp && p(E.defaultProp), x;
2573
2714
  });
2574
2715
  }, [n]);
2575
- const L = ne(
2716
+ const A = ne(
2576
2717
  () => [...c, ...u, ...d],
2577
2718
  [c, u, d]
2578
- ), O = ne(
2579
- () => s.map((A) => ({ holeId: A.holeId, label: A.holeId })).sort((A, E) => A.label.localeCompare(E.label)),
2719
+ ), I = ne(
2720
+ () => s.map((S) => ({ holeId: S.holeId, label: S.holeId })).sort((S, x) => S.label.localeCompare(x.label)),
2580
2721
  [s]
2581
- ), V = ne(() => {
2582
- const A = [...c, ...u, ...d];
2583
- return Array.from({ length: r }).map((E, z) => {
2584
- const R = b[z] || {}, C = o.find((he) => (he.id || he.holeId) === R.holeId) || null, G = C ? A.filter((he) => or(C, he)) : A;
2585
- let U = R.property || y;
2586
- C && !G.includes(U) && (U = G[0] || U);
2587
- const j = d.includes(U), Z = !j && u.includes(U), K = !j && !Z && U === "dip", le = j ? "comment" : K ? "tadpole" : Z ? "categorical" : "numeric", ye = K ? "tadpole" : R.chartType || (j ? "comment" : Z ? "categorical" : "markers+line"), fe = R.holeId || (C == null ? void 0 : C.id) || (C == null ? void 0 : C.holeId) || "", Ce = K ? (C == null ? void 0 : C.points) || [] : j ? mr(C, U) : ir(C, U, Z);
2722
+ ), B = ne(() => {
2723
+ const S = [...c, ...u, ...d];
2724
+ return Array.from({ length: r }).map((x, E) => {
2725
+ const R = b[E] || {}, D = o.find((pe) => (pe.id || pe.holeId) === R.holeId) || null, G = D ? S.filter((pe) => mr(D, pe)) : S;
2726
+ let U = R.property || N;
2727
+ D && !G.includes(U) && (U = G[0] || U);
2728
+ const j = d.includes(U), Z = !j && u.includes(U), J = !j && !Z && U === "dip", le = j ? "comment" : J ? "tadpole" : Z ? "categorical" : "numeric", _e = J ? "tadpole" : R.chartType || (j ? "comment" : Z ? "categorical" : "markers+line"), he = R.holeId || (D == null ? void 0 : D.id) || (D == null ? void 0 : D.holeId) || "", Se = J ? (D == null ? void 0 : D.points) || [] : j ? Nr(D, U) : fr(D, U, Z);
2588
2729
  return {
2589
- config: { holeId: fe, property: U, chartType: ye },
2590
- hole: C,
2730
+ config: { holeId: he, property: U, chartType: _e },
2731
+ hole: D,
2591
2732
  loading: w.includes(R.holeId),
2592
2733
  isCategorical: Z,
2593
2734
  isComment: j,
2594
- isTadpole: K,
2735
+ isTadpole: J,
2595
2736
  displayType: le,
2596
- points: Ce,
2737
+ points: Se,
2597
2738
  propertyOptions: G,
2598
- label: fe
2739
+ label: he
2599
2740
  };
2600
2741
  });
2601
- }, [b, o, y, u, d, w, r, c]), H = (A, E) => {
2602
- N((z) => {
2603
- const R = [...z], G = { ...R[A] || {}, ...E };
2604
- return E.property && (G.chartType = Te({
2605
- property: E.property,
2742
+ }, [b, o, N, u, d, w, r, c]), H = (S, x) => {
2743
+ M((E) => {
2744
+ const R = [...E], G = { ...R[S] || {}, ...x };
2745
+ return x.property && (G.chartType = Te({
2746
+ property: x.property,
2606
2747
  chartType: G.chartType,
2607
2748
  categoricalProps: u,
2608
2749
  commentProps: d,
2609
2750
  numericDefaultChartType: "markers+line"
2610
- })), R[A] = G, R;
2751
+ })), R[S] = G, R;
2611
2752
  });
2612
2753
  };
2613
2754
  return {
2614
- error: M,
2615
- focusedHoleId: x,
2616
- setFocusedHoleId: S,
2617
- setError: I,
2755
+ error: v,
2756
+ focusedHoleId: z,
2757
+ setFocusedHoleId: L,
2758
+ setError: O,
2618
2759
  holeCount: s.length,
2619
2760
  numericProps: c,
2620
2761
  categoricalProps: u,
2621
2762
  commentProps: d,
2622
2763
  columnMeta: h,
2623
- propertyOptions: L,
2624
- labeledHoleOptions: O,
2625
- traceGraphs: V,
2764
+ propertyOptions: A,
2765
+ labeledHoleOptions: I,
2766
+ traceGraphs: B,
2626
2767
  handleConfigChange: H
2627
2768
  };
2628
2769
  }
2629
- const fr = [
2770
+ const Mr = [
2630
2771
  "#313695",
2631
2772
  "#4575b4",
2632
2773
  "#74add1",
@@ -2638,7 +2779,7 @@ const fr = [
2638
2779
  "#d73027",
2639
2780
  "#a50026"
2640
2781
  ];
2641
- function hr(e = [], t = fr) {
2782
+ function vr(e = [], t = Mr) {
2642
2783
  const n = e.filter((a) => Number.isFinite(a));
2643
2784
  if (!n.length)
2644
2785
  return {
@@ -2665,12 +2806,12 @@ function hr(e = [], t = fr) {
2665
2806
  };
2666
2807
  }
2667
2808
  const l = t.map((a, u) => {
2668
- const m = u / s, d = (u + 1) / s, f = Math.floor(m * r.length), h = Math.min(r.length - 1, Math.floor(d * r.length)), g = r[f], y = u === s - 1 ? i : r[h];
2809
+ const m = u / s, d = (u + 1) / s, f = Math.floor(m * r.length), h = Math.min(r.length - 1, Math.floor(d * r.length)), g = r[f], N = u === s - 1 ? i : r[h];
2669
2810
  return {
2670
2811
  index: u,
2671
2812
  min: g,
2672
- max: y,
2673
- label: pr(g, y)
2813
+ max: N,
2814
+ label: zr(g, N)
2674
2815
  };
2675
2816
  }), c = (i - o) / s;
2676
2817
  return {
@@ -2681,11 +2822,11 @@ function hr(e = [], t = fr) {
2681
2822
  colors: t
2682
2823
  };
2683
2824
  }
2684
- function pr(e, t) {
2825
+ function zr(e, t) {
2685
2826
  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";
2686
2827
  return `${n(e)} – ${n(t)}`;
2687
2828
  }
2688
- function Vt(e, t) {
2829
+ function Yt(e, t) {
2689
2830
  if (!Number.isFinite(e) || !t || !Array.isArray(t.bins) || !t.bins.length)
2690
2831
  return -1;
2691
2832
  if (t.max === t.min)
@@ -2697,18 +2838,18 @@ function Vt(e, t) {
2697
2838
  }
2698
2839
  return -1;
2699
2840
  }
2700
- function br(e, t, n = "#8b1e3f") {
2701
- const r = Vt(e, t);
2841
+ function Er(e, t, n = "#8b1e3f") {
2842
+ const r = Yt(e, t);
2702
2843
  return r < 0 ? n : t.colors[r] || n;
2703
2844
  }
2704
- function Ht(e) {
2845
+ function Xt(e) {
2705
2846
  return Array.isArray(e) ? e : [];
2706
2847
  }
2707
2848
  function qe(e) {
2708
2849
  const t = Number(e);
2709
2850
  return Number.isFinite(t) ? t : void 0;
2710
2851
  }
2711
- function jt(e = {}) {
2852
+ function qt(e = {}) {
2712
2853
  return {
2713
2854
  ...e,
2714
2855
  x: qe(e.x),
@@ -2716,9 +2857,9 @@ function jt(e = {}) {
2716
2857
  z: qe(e.z)
2717
2858
  };
2718
2859
  }
2719
- function gr(e = [], t = [0, 0], n = 0) {
2860
+ function xr(e = [], t = [0, 0], n = 0) {
2720
2861
  const [r, o] = t, i = Number(n) * Math.PI / 180, s = Math.cos(i), l = Math.sin(i);
2721
- return Ht(e).map(jt).map((c) => {
2862
+ return Xt(e).map(qt).map((c) => {
2722
2863
  if (!Number.isFinite(c.x) || !Number.isFinite(c.y)) return { ...c };
2723
2864
  const a = c.x - r, u = c.y - o;
2724
2865
  return {
@@ -2728,12 +2869,12 @@ function gr(e = [], t = [0, 0], n = 0) {
2728
2869
  };
2729
2870
  });
2730
2871
  }
2731
- function yr(e = [], t = [0, 0], n = 0, r = 50) {
2732
- const o = gr(e, t, n), i = 0.5 * Number(r || 0);
2872
+ function kr(e = [], t = [0, 0], n = 0, r = 50) {
2873
+ const o = xr(e, t, n), i = 0.5 * Number(r || 0);
2733
2874
  return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
2734
2875
  }
2735
- function ki(e = [], t = null, n = null) {
2736
- let r = Ht(e).map(jt);
2876
+ function Yi(e = [], t = null, n = null) {
2877
+ let r = Xt(e).map(qt);
2737
2878
  if (Array.isArray(t) && t.length === 2) {
2738
2879
  const [o, i] = t;
2739
2880
  r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
@@ -2743,46 +2884,46 @@ function ki(e = [], t = null, n = null) {
2743
2884
  color_value: o == null ? void 0 : o[n]
2744
2885
  }))), r;
2745
2886
  }
2746
- function Ai(e = [], t = [0, 0], n = 0, r = 50, o = null) {
2747
- let i = yr(e, t, n, r);
2887
+ function Xi(e = [], t = [0, 0], n = 0, r = 50, o = null) {
2888
+ let i = kr(e, t, n, r);
2748
2889
  return o && (i = i.map((s) => ({
2749
2890
  ...s,
2750
2891
  color_value: s == null ? void 0 : s[o]
2751
2892
  }))), i;
2752
2893
  }
2753
- function rt(e) {
2894
+ function ot(e) {
2754
2895
  return Array.isArray(e) ? e : [];
2755
2896
  }
2756
- function ot(e = {}) {
2897
+ function it(e = {}) {
2757
2898
  return e.hole_id ?? e.holeId ?? e.id;
2758
2899
  }
2759
- function Ne(e, t = void 0) {
2900
+ function Me(e, t = void 0) {
2760
2901
  const n = Number(e);
2761
2902
  return Number.isFinite(n) ? n : t;
2762
2903
  }
2763
- function Ii(e = [], t = null) {
2904
+ function qi(e = [], t = null) {
2764
2905
  const n = /* @__PURE__ */ new Map();
2765
- rt(e).forEach((o) => {
2766
- const i = ot(o);
2906
+ ot(e).forEach((o) => {
2907
+ const i = it(o);
2767
2908
  if (i == null || `${i}`.trim() === "") return;
2768
2909
  const s = `${i}`;
2769
2910
  n.has(s) || n.set(s, []), n.get(s).push(o);
2770
2911
  });
2771
2912
  const r = [];
2772
2913
  return n.forEach((o, i) => {
2773
- const s = [...o].sort((c, a) => Ne(c.md, 0) - Ne(a.md, 0)), l = {
2914
+ const s = [...o].sort((c, a) => Me(c.md, 0) - Me(a.md, 0)), l = {
2774
2915
  hole_id: i,
2775
- x: s.map((c) => Ne(c.x, 0)),
2776
- y: s.map((c) => Ne(c.y, 0)),
2777
- z: s.map((c) => Ne(c.z, 0)),
2916
+ x: s.map((c) => Me(c.x, 0)),
2917
+ y: s.map((c) => Me(c.y, 0)),
2918
+ z: s.map((c) => Me(c.z, 0)),
2778
2919
  color: null
2779
2920
  };
2780
2921
  t && (l.color = s.map((c) => c == null ? void 0 : c[t])), r.push(l);
2781
2922
  }), r;
2782
2923
  }
2783
- function Oi(e = [], t = 1, n = null) {
2784
- return rt(e).map((r) => ({
2785
- hole_id: ot(r),
2924
+ function Wi(e = [], t = 1, n = null) {
2925
+ return ot(e).map((r) => ({
2926
+ hole_id: it(r),
2786
2927
  from: r == null ? void 0 : r.from,
2787
2928
  to: r == null ? void 0 : r.to,
2788
2929
  radius: t,
@@ -2790,21 +2931,21 @@ function Oi(e = [], t = 1, n = null) {
2790
2931
  value: n ? r == null ? void 0 : r[n] : null
2791
2932
  }));
2792
2933
  }
2793
- function Ci(e = [], t = null) {
2794
- return t ? rt(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
2795
- hole_id: ot(n),
2934
+ function Zi(e = [], t = null) {
2935
+ return t ? ot(e).filter((n) => Object.prototype.hasOwnProperty.call(n || {}, t)).map((n) => ({
2936
+ hole_id: it(n),
2796
2937
  label: n == null ? void 0 : n[t],
2797
- depth: 0.5 * (Ne(n == null ? void 0 : n.from, 0) + Ne(n == null ? void 0 : n.to, 0))
2938
+ depth: 0.5 * (Me(n == null ? void 0 : n.from, 0) + Me(n == null ? void 0 : n.to, 0))
2798
2939
  })) : [];
2799
2940
  }
2800
- function Me(e) {
2941
+ function ve(e) {
2801
2942
  e.selectables = [
2802
2943
  ...e.blocks,
2803
2944
  ...e.drillMeshes,
2804
2945
  ...e.structuralMeshes
2805
2946
  ];
2806
2947
  }
2807
- const _r = {
2948
+ const Ar = {
2808
2949
  bedding: "#2563eb",
2809
2950
  foliation: "#16a34a",
2810
2951
  joint: "#9333ea",
@@ -2813,13 +2954,13 @@ const _r = {
2813
2954
  "shear zone": "#0ea5e9",
2814
2955
  "fault zone": "#ef4444"
2815
2956
  };
2816
- function Nr(e, t) {
2817
- const n = t || _r, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
2818
- return new _.Color(o).getHex();
2957
+ function Ir(e, t) {
2958
+ const n = t || Ar, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
2959
+ return new y.Color(o).getHex();
2819
2960
  }
2820
- function Mr(e, t) {
2961
+ function Or(e, t) {
2821
2962
  const n = e * Math.PI / 180, r = t * Math.PI / 180;
2822
- return new _.Vector3(
2963
+ return new y.Vector3(
2823
2964
  Math.sin(r) * Math.sin(n),
2824
2965
  // East component
2825
2966
  Math.cos(r) * Math.sin(n),
@@ -2828,31 +2969,31 @@ function Mr(e, t) {
2828
2969
  // Up component
2829
2970
  ).normalize();
2830
2971
  }
2831
- function zr(e, t = {}) {
2972
+ function Sr(e, t = {}) {
2832
2973
  const {
2833
2974
  radius: n = 5,
2834
2975
  discThickness: r = 0.2,
2835
2976
  opacity: o = 0.7,
2836
2977
  segments: i = 32,
2837
2978
  colorMap: s = null
2838
- } = t, l = new _.Group(), c = new _.Vector3(0, 1, 0);
2979
+ } = t, l = new y.Group(), c = new y.Vector3(0, 1, 0);
2839
2980
  for (const a of e) {
2840
2981
  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;
2841
2982
  if (u == null || m == null || d == null || !Number.isFinite(u) || !Number.isFinite(m) || !Number.isFinite(d)) continue;
2842
- const f = a[q] != null ? Number(a[q]) : null, h = a[X] != null ? Number(a[X]) : null;
2983
+ const f = a[W] != null ? Number(a[W]) : null, h = a[q] != null ? Number(a[q]) : null;
2843
2984
  let g;
2844
2985
  if (a.nx != null && Number.isFinite(a.nx) && a.ny != null && Number.isFinite(a.ny) && a.nz != null && Number.isFinite(a.nz))
2845
- g = new _.Vector3(a.nx, a.ny, a.nz).normalize();
2986
+ g = new y.Vector3(a.nx, a.ny, a.nz).normalize();
2846
2987
  else {
2847
2988
  if (f == null || h == null || !Number.isFinite(f) || !Number.isFinite(h)) continue;
2848
- g = Mr(f, h);
2989
+ g = Or(f, h);
2849
2990
  }
2850
- const y = new _.CylinderGeometry(n, n, r, i, 1, !1), p = new _.MeshStandardMaterial({
2851
- color: Nr(a.structure_type, s),
2991
+ const N = new y.CylinderGeometry(n, n, r, i, 1, !1), p = new y.MeshStandardMaterial({
2992
+ color: Ir(a.structure_type, s),
2852
2993
  transparent: !0,
2853
2994
  opacity: o,
2854
- side: _.DoubleSide
2855
- }), b = new _.Mesh(y, p);
2995
+ side: y.DoubleSide
2996
+ }), b = new y.Mesh(N, p);
2856
2997
  b.position.set(u, m, d), b.quaternion.setFromUnitVectors(c, g), b.userData = {
2857
2998
  type: "structure",
2858
2999
  hole_id: a.hole_id,
@@ -2865,8 +3006,8 @@ function zr(e, t = {}) {
2865
3006
  }
2866
3007
  return l;
2867
3008
  }
2868
- function vr(e, t, n, r = {}) {
2869
- if (!e.scene || (Gt(e), !(t != null && t.length) || !(n != null && n.length))) return;
3009
+ function Lr(e, t, n, r = {}) {
3010
+ if (!e.scene || (Wt(e), !(t != null && t.length) || !(n != null && n.length))) return;
2870
3011
  const { maxDiscs: o = 3e3 } = r;
2871
3012
  let i = t;
2872
3013
  if (i.length > o) {
@@ -2875,21 +3016,21 @@ function vr(e, t, n, r = {}) {
2875
3016
  a.push(i[Math.floor(u * c)]);
2876
3017
  i = a;
2877
3018
  }
2878
- const s = n.flatMap((c) => (c.points || []).map((a) => ({ ...a, hole_id: c.id }))), l = Yn(i, s, r);
2879
- l.length && (e.structuralGroup = zr(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
3019
+ const s = n.flatMap((c) => (c.points || []).map((a) => ({ ...a, hole_id: c.id }))), l = er(i, s, r);
3020
+ l.length && (e.structuralGroup = Sr(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
2880
3021
  c.isMesh && e.structuralMeshes.push(c);
2881
- }), Me(e));
3022
+ }), ve(e));
2882
3023
  }
2883
- function Gt(e) {
3024
+ function Wt(e) {
2884
3025
  e.structuralGroup && (e.scene.remove(e.structuralGroup), e.structuralGroup.traverse((t) => {
2885
3026
  t.isMesh && (t.geometry.dispose(), t.material.dispose());
2886
- }), e.structuralGroup = null), e.structuralMeshes = [], Me(e);
3027
+ }), e.structuralGroup = null), e.structuralMeshes = [], ve(e);
2887
3028
  }
2888
- function Er(e, t) {
3029
+ function Dr(e, t) {
2889
3030
  e.structuralGroup && (e.structuralGroup.visible = !!t);
2890
3031
  }
2891
- let xr = 0;
2892
- function kr(e) {
3032
+ let Cr = 0;
3033
+ function wr(e) {
2893
3034
  let t, n, r, o;
2894
3035
  if ("width" in e || "height" in e || "x" in e && !("maxX" in e)) {
2895
3036
  const i = Number(e.x ?? 0), s = Number(e.y ?? 0), l = Number(e.width ?? 0), c = Number(e.height ?? 0);
@@ -2906,7 +3047,7 @@ function kr(e) {
2906
3047
  );
2907
3048
  return { minX: t, minY: n, maxX: r, maxY: o };
2908
3049
  }
2909
- function Ar(e) {
3050
+ function Fr(e) {
2910
3051
  if (e.type === "texture")
2911
3052
  return Promise.resolve(e.texture);
2912
3053
  let t, n = !1;
@@ -2919,7 +3060,7 @@ function Ar(e) {
2919
3060
  new Error(`Unsupported raster source type: "${e.type}"`)
2920
3061
  );
2921
3062
  return new Promise((r, o) => {
2922
- new _.TextureLoader().load(
3063
+ new y.TextureLoader().load(
2923
3064
  t,
2924
3065
  (s) => {
2925
3066
  n && URL.revokeObjectURL(t), r(s);
@@ -2935,55 +3076,55 @@ function Ar(e) {
2935
3076
  );
2936
3077
  });
2937
3078
  }
2938
- async function Si(e) {
2939
- const { source: t, bounds: n, elevation: r = 0, visible: o = !0, renderOrder: i = 0 } = e, s = e.id ?? `raster-overlay-${++xr}`, l = e.name ?? s;
3079
+ async function Ki(e) {
3080
+ const { source: t, bounds: n, elevation: r = 0, visible: o = !0, renderOrder: i = 0 } = e, s = e.id ?? `raster-overlay-${++Cr}`, l = e.name ?? s;
2940
3081
  let c = e.opacity ?? 1;
2941
3082
  if ((c < 0 || c > 1) && (console.warn(
2942
3083
  `[baselode] raster overlay "${s}": opacity ${c} is outside [0, 1] — clamped`
2943
3084
  ), c = Math.max(0, Math.min(1, c))), !t) throw new Error("raster overlay: options.source is required");
2944
3085
  if (!n) throw new Error("raster overlay: options.bounds is required");
2945
- const a = kr(n), { minX: u, minY: m, maxX: d, maxY: f } = a, h = d - u, g = f - m, y = (u + d) / 2, p = (m + f) / 2, b = await Ar(t), N = new _.PlaneGeometry(h, g), M = new _.MeshBasicMaterial({
3086
+ const a = wr(n), { minX: u, minY: m, maxX: d, maxY: f } = a, h = d - u, g = f - m, N = (u + d) / 2, p = (m + f) / 2, b = await Fr(t), M = new y.PlaneGeometry(h, g), v = new y.MeshBasicMaterial({
2946
3087
  map: b,
2947
3088
  transparent: !0,
2948
3089
  opacity: c,
2949
- side: _.DoubleSide,
3090
+ side: y.DoubleSide,
2950
3091
  depthWrite: !1
2951
- }), I = new _.Mesh(N, M);
2952
- return I.position.set(y, p, r), I.renderOrder = i, I.visible = o, { id: s, name: l, mesh: I, texture: b, bounds: a, elevation: r, opacity: c, visible: o };
3092
+ }), O = new y.Mesh(M, v);
3093
+ return O.position.set(N, p, r), O.renderOrder = i, O.visible = o, { id: s, name: l, mesh: O, texture: b, bounds: a, elevation: r, opacity: c, visible: o };
2953
3094
  }
2954
- function Ir(e, t) {
2955
- e.scene && (e.rasterOverlays.has(t.id) && it(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
3095
+ function Pr(e, t) {
3096
+ e.scene && (e.rasterOverlays.has(t.id) && st(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
2956
3097
  }
2957
- function it(e, t) {
3098
+ function st(e, t) {
2958
3099
  var r;
2959
3100
  const n = e.rasterOverlays.get(t);
2960
3101
  n && ((r = e.scene) == null || r.remove(n.mesh), n.mesh.geometry.dispose(), n.mesh.material.dispose(), n.texture && n.texture.dispose(), e.rasterOverlays.delete(t));
2961
3102
  }
2962
- function Or(e, t, n) {
3103
+ function Tr(e, t, n) {
2963
3104
  const r = e.rasterOverlays.get(t);
2964
3105
  if (!r) return;
2965
3106
  const o = Math.max(0, Math.min(1, Number(n)));
2966
3107
  r.opacity = o, r.mesh.material.opacity = o, r.mesh.material.needsUpdate = !0;
2967
3108
  }
2968
- function Cr(e, t, n) {
3109
+ function $r(e, t, n) {
2969
3110
  const r = e.rasterOverlays.get(t);
2970
3111
  r && (r.visible = !!n, r.mesh.visible = r.visible);
2971
3112
  }
2972
- function Sr(e, t, n) {
3113
+ function Rr(e, t, n) {
2973
3114
  const r = e.rasterOverlays.get(t);
2974
3115
  r && (r.elevation = Number(n), r.mesh.position.setZ(r.elevation));
2975
3116
  }
2976
- function Dr(e, t) {
3117
+ function Br(e, t) {
2977
3118
  return e.rasterOverlays.get(t);
2978
3119
  }
2979
- function Lr(e) {
3120
+ function Vr(e) {
2980
3121
  return Array.from(e.rasterOverlays.values());
2981
3122
  }
2982
- function Pr(e) {
3123
+ function Hr(e) {
2983
3124
  for (const t of [...e.rasterOverlays.keys()])
2984
- it(e, t);
3125
+ st(e, t);
2985
3126
  }
2986
- function st(e) {
3127
+ function lt(e) {
2987
3128
  var n, r, o, i, s, l, c, a, u;
2988
3129
  if (!e) return "";
2989
3130
  const t = (m) => Number.isFinite(m) ? m.toFixed(3) : "nan";
@@ -2999,7 +3140,7 @@ function st(e) {
2999
3140
  t((u = e.up) == null ? void 0 : u.z)
3000
3141
  ].join("|");
3001
3142
  }
3002
- function Ut(e) {
3143
+ function Zt(e) {
3003
3144
  return !e.camera || !e.controls ? null : {
3004
3145
  camera: {
3005
3146
  x: e.camera.position.x,
@@ -3018,37 +3159,37 @@ function Ut(e) {
3018
3159
  }
3019
3160
  };
3020
3161
  }
3021
- function Fr(e, t) {
3162
+ function jr(e, t) {
3022
3163
  if (!e.camera || !e.controls || !t) return !1;
3023
3164
  const n = t.camera || {}, r = t.target || {}, o = t.up || {};
3024
- 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 = st(t), !0) : !1;
3165
+ 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 = lt(t), !0) : !1;
3025
3166
  }
3026
- function wr(e) {
3167
+ function Gr(e) {
3027
3168
  if (!e.viewChangeHandler) return;
3028
3169
  const t = Date.now();
3029
3170
  if (t - e._lastViewEmitMs < 250) return;
3030
- const n = Ut(e);
3171
+ const n = Zt(e);
3031
3172
  if (!n) return;
3032
- const r = st(n);
3173
+ const r = lt(n);
3033
3174
  r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
3034
3175
  }
3035
- function lt(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
3176
+ function at(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
3036
3177
  const l = (t + n) / 2, c = (r + o) / 2, a = (i + s) / 2, u = n - t, m = o - r, d = s - i, h = Math.max(u, m, d, 1) * 2;
3037
3178
  e.controls.target.set(l, c, a), e.camera.position.set(l + h, c + h, a + h), e.camera.lookAt(l, c, a), e.controls.update();
3038
3179
  }
3039
- function Tr(e, t = 1e3) {
3180
+ function Ur(e, t = 1e3) {
3040
3181
  !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());
3041
3182
  }
3042
- function $r(e, t = 2e3) {
3183
+ function Yr(e, t = 2e3) {
3043
3184
  !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());
3044
3185
  }
3045
- function Rr(e, t = 0, n = 0) {
3186
+ function Xr(e, t = 0, n = 0) {
3046
3187
  e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
3047
3188
  }
3048
- function Br(e, t = 1.1) {
3189
+ function qr(e, t = 1.1) {
3049
3190
  !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());
3050
3191
  }
3051
- function Vr(e, t = 1.2) {
3192
+ function Wr(e, t = 1.2) {
3052
3193
  if (!e.lastBounds) return;
3053
3194
  const {
3054
3195
  minX: n,
@@ -3060,13 +3201,13 @@ function Vr(e, t = 1.2) {
3060
3201
  } = 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, g = Math.max(c, a, u, 1) * 2;
3061
3202
  e.controls.target.set(m, d, f), e.camera.position.set(m + g, d + g, f + g), e.camera.lookAt(m, d, f), e.controls.update();
3062
3203
  }
3063
- const Hr = 1, jr = 120;
3064
- function Gr(e, t) {
3204
+ const Zr = 1, Kr = 120;
3205
+ function Jr(e, t) {
3065
3206
  if (!e.camera || !e.controls || !Number.isFinite(t)) return !1;
3066
- const n = Math.min(jr, 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();
3207
+ const n = Math.min(Kr, 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, c = s / (2 * Math.tan(l / 2)), a = e.camera.position.clone().sub(r).normalize();
3067
3208
  return e.camera.position.copy(r).addScaledVector(a, c), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
3068
3209
  }
3069
- function Ur(e, t = "orbit") {
3210
+ function Qr(e, t = "orbit") {
3070
3211
  if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
3071
3212
  e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
3072
3213
  else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
@@ -3076,13 +3217,13 @@ function Ur(e, t = "orbit") {
3076
3217
  }
3077
3218
  }
3078
3219
  const ue = "#9ca3af";
3079
- function Nt(e, t) {
3220
+ function vt(e, t) {
3080
3221
  const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
3081
3222
  if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
3082
3223
  const o = Math.min(n, r), i = Math.max(n, r);
3083
3224
  return i <= o ? null : { segStart: o, segEnd: i };
3084
3225
  }
3085
- function Yr(e, t, n) {
3226
+ function eo(e, t, n) {
3086
3227
  let r = 0, o = 0;
3087
3228
  for (let s = 0; s < e.length; s += 1) {
3088
3229
  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);
@@ -3094,18 +3235,18 @@ function Yr(e, t, n) {
3094
3235
  const i = r / o;
3095
3236
  return Number.isFinite(i) ? i : null;
3096
3237
  }
3097
- function Xr(e, t) {
3098
- if (!Number.isFinite(e)) return new _.Color(ue);
3099
- if (Vt(e, t) < 0) return new _.Color(ue);
3100
- const r = br(e, t, ue);
3101
- return new _.Color(r);
3238
+ function to(e, t) {
3239
+ if (!Number.isFinite(e)) return new y.Color(ue);
3240
+ if (Yt(e, t) < 0) return new y.Color(ue);
3241
+ const r = Er(e, t, ue);
3242
+ return new y.Color(r);
3102
3243
  }
3103
- function qr(e) {
3244
+ function no(e) {
3104
3245
  if (!e || !String(e).trim()) return ue;
3105
- const t = Yt(String(e).toLowerCase().trim());
3106
- return "#" + new _.Color().setHSL(t, 0.7, 0.5).getHexString();
3246
+ const t = Kt(String(e).toLowerCase().trim());
3247
+ return "#" + new y.Color().setHSL(t, 0.7, 0.5).getHexString();
3107
3248
  }
3108
- function Zr(e = {}) {
3249
+ function ro(e = {}) {
3109
3250
  return {
3110
3251
  preserveView: !!e.preserveView,
3111
3252
  assayIntervalsByHole: e.assayIntervalsByHole || null,
@@ -3113,7 +3254,7 @@ function Zr(e = {}) {
3113
3254
  isCategoricalVariable: !!e.isCategoricalVariable
3114
3255
  };
3115
3256
  }
3116
- function Wr(e, t) {
3257
+ function oo(e, t) {
3117
3258
  if (!e || !t) return [];
3118
3259
  const n = [];
3119
3260
  return Object.values(e).forEach((r) => {
@@ -3123,27 +3264,27 @@ function Wr(e, t) {
3123
3264
  });
3124
3265
  }), n;
3125
3266
  }
3126
- function Ze(e) {
3267
+ function We(e) {
3127
3268
  return {
3128
3269
  holeId: e.id,
3129
3270
  project: e.project
3130
3271
  };
3131
3272
  }
3132
- function Kr(e) {
3273
+ function io(e) {
3133
3274
  return `${e ?? ""}`.trim().toLowerCase();
3134
3275
  }
3135
- function Jr(e, t) {
3136
- const n = `${e ?? ""}:${t ?? 0}`, r = Yt(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new _.Color();
3276
+ function so(e, t) {
3277
+ const n = `${e ?? ""}:${t ?? 0}`, r = Kt(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, s = new y.Color();
3137
3278
  return s.setHSL(i, 1, 0.5), s;
3138
3279
  }
3139
- function Yt(e) {
3280
+ function Kt(e) {
3140
3281
  const t = `${e ?? ""}`;
3141
3282
  let n = 2166136261;
3142
3283
  for (let r = 0; r < t.length; r += 1)
3143
3284
  n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
3144
3285
  return (n >>> 0) / 4294967295;
3145
3286
  }
3146
- function Qr(e, t, n) {
3287
+ function lo(e, t, n) {
3147
3288
  let r = null, o = 0;
3148
3289
  for (const i of e) {
3149
3290
  const s = Number(i == null ? void 0 : i.from), l = Number(i == null ? void 0 : i.to);
@@ -3153,116 +3294,225 @@ function Qr(e, t, n) {
3153
3294
  }
3154
3295
  return r;
3155
3296
  }
3156
- function eo(e, t) {
3297
+ function ao(e, t) {
3157
3298
  if (!t || !e) return [];
3158
3299
  const n = e.id || e.holeId;
3159
3300
  if (!n) return [];
3160
3301
  const r = t[n];
3161
3302
  if (Array.isArray(r) && r.length) return r;
3162
- const o = Kr(n);
3303
+ const o = io(n);
3163
3304
  if (o) {
3164
3305
  const i = t[o];
3165
3306
  if (Array.isArray(i) && i.length) return i;
3166
3307
  }
3167
3308
  return [];
3168
3309
  }
3169
- function to({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
3310
+ function co({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: s, isCategorical: l }) {
3170
3311
  if (!e)
3171
- return Jr(r, o);
3312
+ return so(r, o);
3172
3313
  if (e === "__HAS_ASSAY__") {
3173
- if (!(t != null && t.length)) return new _.Color(ue);
3174
- const u = Nt(i, s);
3314
+ if (!(t != null && t.length)) return new y.Color(ue);
3315
+ const u = vt(i, s);
3175
3316
  return u ? t.some((d) => {
3176
3317
  const f = Number(d == null ? void 0 : d.from), h = Number(d == null ? void 0 : d.to);
3177
3318
  if (!Number.isFinite(f) || !Number.isFinite(h)) return !1;
3178
3319
  const g = Math.max(u.segStart, f);
3179
3320
  return Math.min(u.segEnd, h) > g;
3180
- }) ? new _.Color("#ff8c42") : new _.Color(ue) : new _.Color(ue);
3321
+ }) ? new y.Color("#ff8c42") : new y.Color(ue) : new y.Color(ue);
3181
3322
  }
3182
- if (!(t != null && t.length)) return new _.Color(ue);
3183
- const c = Nt(i, s);
3184
- if (!c) return new _.Color(ue);
3323
+ if (!(t != null && t.length)) return new y.Color(ue);
3324
+ const c = vt(i, s);
3325
+ if (!c) return new y.Color(ue);
3185
3326
  if (l) {
3186
- const u = Qr(t, c.segStart, c.segEnd);
3187
- return new _.Color(qr(u));
3327
+ const u = lo(t, c.segStart, c.segEnd);
3328
+ return new y.Color(no(u));
3188
3329
  }
3189
- const a = Yr(t, c.segStart, c.segEnd);
3190
- return Xr(a, n);
3330
+ const a = eo(t, c.segStart, c.segEnd);
3331
+ return to(a, n);
3191
3332
  }
3192
- function no(e, t, n = {}) {
3193
- if (!e.scene || (Xt(e), !t || t.length === 0)) return;
3194
- const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = Zr(n), l = s ? [] : Wr(o, i), c = hr(l);
3333
+ function uo(e, t, n = {}) {
3334
+ if (!e.scene || (Jt(e), !t || t.length === 0)) return;
3335
+ const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: s } = ro(n), l = s ? [] : oo(o, i), c = vr(l);
3195
3336
  let a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0, f = 1 / 0, h = -1 / 0;
3196
- const g = new _.Vector3(), y = new _.Vector3(0, 1, 0);
3337
+ const g = new y.Vector3(), N = new y.Vector3(0, 1, 0);
3197
3338
  t.forEach((p, b) => {
3198
- const M = b * 137.5 % 360 / 360, I = new _.Color().setHSL(M, 0.75, 0.55), x = (p.points || []).map((D) => {
3199
- a = Math.min(a, D.x), u = Math.max(u, D.x), m = Math.min(m, D.y), d = Math.max(d, D.y), f = Math.min(f, D.z), h = Math.max(h, D.z);
3200
- const v = new _.Vector3(D.x, D.y, D.z);
3201
- return v.md = D.md, v;
3339
+ const v = b * 137.5 % 360 / 360, O = new y.Color().setHSL(v, 0.75, 0.55), z = (p.points || []).map((C) => {
3340
+ a = Math.min(a, C.x), u = Math.max(u, C.x), m = Math.min(m, C.y), d = Math.max(d, C.y), f = Math.min(f, C.z), h = Math.max(h, C.z);
3341
+ const _ = new y.Vector3(C.x, C.y, C.z);
3342
+ return _.md = C.md, _;
3202
3343
  });
3203
- if (x.length < 2) {
3204
- if (x.length === 1) {
3205
- const D = new _.SphereGeometry(5, 12, 12), v = new _.MeshLambertMaterial({
3206
- color: I,
3207
- emissive: I,
3344
+ if (z.length < 2) {
3345
+ if (z.length === 1) {
3346
+ const C = new y.SphereGeometry(5, 12, 12), _ = new y.MeshLambertMaterial({
3347
+ color: O,
3348
+ emissive: O,
3208
3349
  emissiveIntensity: 0.2
3209
- }), L = new _.Mesh(D, v);
3210
- L.position.copy(x[0]), L.userData = Ze(p), e.scene.add(L), e.drillLines.push(L), e.drillMeshes.push(L);
3350
+ }), A = new y.Mesh(C, _);
3351
+ A.position.copy(z[0]), A.userData = We(p), e.scene.add(A), e.drillLines.push(A), e.drillMeshes.push(A);
3211
3352
  }
3212
3353
  return;
3213
3354
  }
3214
- const S = new _.Group();
3215
- S.userData = Ze(p);
3216
- const w = i ? eo(p, o) : [];
3217
- for (let D = 0; D < x.length - 1; D += 1) {
3218
- const v = x[D], L = x[D + 1], O = g.subVectors(L, v), V = O.length();
3219
- if (V <= 1e-3) continue;
3220
- const H = 2.2, A = new _.CylinderGeometry(H, H, V, 6, 1, !0), E = to({
3355
+ const L = new y.Group();
3356
+ L.userData = We(p);
3357
+ const w = i ? ao(p, o) : [];
3358
+ for (let C = 0; C < z.length - 1; C += 1) {
3359
+ const _ = z[C], A = z[C + 1], I = g.subVectors(A, _), B = I.length();
3360
+ if (B <= 1e-3) continue;
3361
+ const H = 2.2, S = new y.CylinderGeometry(H, H, B, 6, 1, !0), x = co({
3221
3362
  selectedAssayVariable: i,
3222
3363
  assayIntervals: w,
3223
3364
  assayScale: c,
3224
3365
  holeId: p.id,
3225
- segmentIndex: D,
3226
- p1: v,
3227
- p2: L,
3366
+ segmentIndex: C,
3367
+ p1: _,
3368
+ p2: A,
3228
3369
  isCategorical: s
3229
- }), z = new _.MeshLambertMaterial({
3230
- color: E,
3370
+ }), E = new y.MeshLambertMaterial({
3371
+ color: x,
3231
3372
  flatShading: !0,
3232
- emissive: E,
3373
+ emissive: x,
3233
3374
  emissiveIntensity: 0.15
3234
- }), R = new _.Mesh(A, z);
3235
- R.position.copy(v.clone().addScaledVector(O, 0.5)), R.quaternion.setFromUnitVectors(y, O.clone().normalize()), R.userData = Ze(p), S.add(R), e.drillMeshes.push(R);
3375
+ }), R = new y.Mesh(S, E);
3376
+ R.position.copy(_.clone().addScaledVector(I, 0.5)), R.quaternion.setFromUnitVectors(N, I.clone().normalize()), R.userData = We(p), L.add(R), e.drillMeshes.push(R);
3236
3377
  }
3237
- e.scene.add(S), e.drillLines.push(S);
3238
- }), e.camera && e.controls && (e.lastBounds = { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: h }, r || lt(e, { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: h })), Me(e);
3378
+ e.scene.add(L), e.drillLines.push(L);
3379
+ }), e.camera && e.controls && (e.lastBounds = { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: h }, r || at(e, { minX: a, maxX: u, minY: m, maxY: d, minZ: f, maxZ: h })), ve(e);
3239
3380
  }
3240
- function Xt(e) {
3381
+ function Jt(e) {
3241
3382
  e.drillLines.forEach((t) => {
3242
3383
  e.scene.remove(t), t.isGroup ? t.traverse((n) => {
3243
3384
  n.isMesh && (n.geometry.dispose(), n.material.dispose());
3244
3385
  }) : t.isMesh && (t.geometry.dispose(), t.material.dispose());
3245
- }), e.drillLines = [], e.drillMeshes = [], Me(e);
3386
+ }), e.drillLines = [], e.drillMeshes = [], ve(e);
3387
+ }
3388
+ const mo = 20, fo = 15, ho = "#00bcd4";
3389
+ function po(e = {}) {
3390
+ return {
3391
+ panelWidth: e.panelWidth != null ? Number(e.panelWidth) : mo,
3392
+ lateralOffset: e.lateralOffset != null ? Number(e.lateralOffset) : fo,
3393
+ color: e.color || ho,
3394
+ valueMin: e.valueMin != null ? Number(e.valueMin) : null,
3395
+ valueMax: e.valueMax != null ? Number(e.valueMax) : null
3396
+ };
3246
3397
  }
3247
- const Mt = "#ffffbb", ro = 2, oo = 1.5, io = 1;
3248
- function so(e) {
3398
+ function Ji(e) {
3399
+ if (!e || e.length < 2) return null;
3400
+ let t = -1 / 0, n = 1 / 0;
3401
+ for (const o of e)
3402
+ o.z > t && (t = o.z), o.z < n && (n = o.z);
3403
+ const r = t - n;
3404
+ return r < 1e-3 ? null : { topZ: t, botZ: n, height: r };
3405
+ }
3406
+ function bo(e, t, n, r, o, i, s) {
3407
+ if (!Array.isArray(e) || !Array.isArray(t)) return [];
3408
+ const l = Math.min(e.length, t.length), c = [];
3409
+ for (let b = 0; b < l; b++)
3410
+ Number.isFinite(e[b]) && Number.isFinite(t[b]) && c.push({ d: e[b], v: t[b] });
3411
+ if (c.length < 2) return [];
3412
+ const a = s != null && s > 0 ? s : null, u = a != null ? 0 : Math.min(...c.map((b) => b.d)), d = (a ?? Math.max(...c.map((b) => b.d))) - u || 1, f = Math.min(...c.map((b) => b.v)), h = Math.max(...c.map((b) => b.v)), g = o ?? f, p = (i ?? h) - g || 1;
3413
+ return c.map(({ d: b, v: M }) => {
3414
+ const v = (b - u) / d, O = Math.max(0, Math.min(1, (M - g) / p)), z = -n / 2 + O * n, L = v * r;
3415
+ return new y.Vector3(z, L, 0.01);
3416
+ });
3417
+ }
3418
+ function go(e, t) {
3419
+ const n = e.length;
3420
+ if (n < 2) return null;
3421
+ const r = [], o = [];
3422
+ let i = 0;
3423
+ for (let l = 0; l < n - 1; l++) {
3424
+ const c = e[l], a = e[l + 1], u = a.x - c.x, m = a.y - c.y, d = Math.sqrt(u * u + m * m);
3425
+ if (d < 1e-6) continue;
3426
+ const f = -m / d * t, h = u / d * t, g = 0.01;
3427
+ r.push(
3428
+ c.x + f,
3429
+ c.y + h,
3430
+ g,
3431
+ c.x - f,
3432
+ c.y - h,
3433
+ g,
3434
+ a.x + f,
3435
+ a.y + h,
3436
+ g,
3437
+ a.x - f,
3438
+ a.y - h,
3439
+ g
3440
+ ), o.push(i, i + 1, i + 2, i + 1, i + 3, i + 2), i += 4;
3441
+ }
3442
+ if (r.length === 0) return null;
3443
+ const s = new y.BufferGeometry();
3444
+ return s.setAttribute("position", new y.Float32BufferAttribute(r, 3)), s.setIndex(o), s;
3445
+ }
3446
+ function yo(e, t) {
3447
+ const n = e.points || [];
3448
+ if (n.length < 2) return null;
3449
+ const r = n[0], o = n[n.length - 1], i = new y.Vector3(
3450
+ o.x - r.x,
3451
+ o.y - r.y,
3452
+ o.z - r.z
3453
+ ), s = i.length();
3454
+ if (s < 1e-3) return null;
3455
+ const l = i.clone().normalize(), c = po(t.options), { panelWidth: a, lateralOffset: u, color: m, valueMin: d, valueMax: f } = c, h = new y.Vector3(0, 0, 1);
3456
+ let g = new y.Vector3().crossVectors(l, h);
3457
+ g.lengthSq() < 1e-6 ? g.set(1, 0, 0) : g.normalize();
3458
+ const N = new y.Vector3().crossVectors(g, l).normalize(), p = new y.Vector3(r.x, r.y, r.z).addScaledVector(g, u), b = new y.Matrix4().makeBasis(g, l, N), M = new y.Quaternion().setFromRotationMatrix(b), v = n.map((I) => I.md).filter(Number.isFinite), O = v.length > 0 ? Math.max(...v) : s, z = bo(
3459
+ t.depths,
3460
+ t.values,
3461
+ a,
3462
+ s,
3463
+ d,
3464
+ f,
3465
+ O
3466
+ );
3467
+ if (z.length < 2) return null;
3468
+ const L = new y.Group();
3469
+ L.userData = { holeId: e.id, isStripLog: !0 };
3470
+ const w = a * 0.025, C = go(z, w);
3471
+ if (!C) return null;
3472
+ const _ = new y.MeshBasicMaterial({
3473
+ color: new y.Color(m),
3474
+ side: y.DoubleSide
3475
+ }), A = new y.Mesh(C, _);
3476
+ return A.position.copy(p), A.quaternion.copy(M), L.add(A), L;
3477
+ }
3478
+ function _o(e, t, n) {
3479
+ if (!e.scene || (et(e), !n || n.length === 0) || !t || t.length === 0) return;
3480
+ const r = /* @__PURE__ */ new Map();
3481
+ t.forEach((o) => {
3482
+ o.id != null && r.set(o.id, o);
3483
+ }), n.forEach((o) => {
3484
+ const i = r.get(o.holeId);
3485
+ if (!i) return;
3486
+ const s = yo(i, o);
3487
+ s && (e.scene.add(s), e.stripLogGroups.push(s));
3488
+ });
3489
+ }
3490
+ function et(e) {
3491
+ e.stripLogGroups && (e.stripLogGroups.forEach((t) => {
3492
+ e.scene && e.scene.remove(t), t.traverse((n) => {
3493
+ n.geometry && n.geometry.dispose(), n.material && n.material.dispose();
3494
+ });
3495
+ }), e.stripLogGroups = []);
3496
+ }
3497
+ const zt = "#ffffbb", No = 2, Mo = 1.5, vo = 1;
3498
+ function zo(e) {
3249
3499
  const { renderer: t, scene: n, camera: r, container: o } = e;
3250
3500
  if (!t || !n || !r) return;
3251
- 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 an(t), c = new cn(n, r);
3501
+ 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 fn(t), c = new hn(n, r);
3252
3502
  l.addPass(c);
3253
- const a = new _.Vector2(i, s), u = new un(a, n, r);
3254
- u.visibleEdgeColor.set(Mt), u.hiddenEdgeColor.set(Mt), u.edgeStrength = ro, u.edgeThickness = oo, u.edgeGlow = io, u.pulsePeriod = 0, u.selectedObjects = [], l.addPass(u), l.setSize(i, s), e._composer = l, e._outlinePass = u;
3503
+ const a = new y.Vector2(i, s), u = new pn(a, n, r);
3504
+ u.visibleEdgeColor.set(zt), u.hiddenEdgeColor.set(zt), u.edgeStrength = No, u.edgeThickness = Mo, u.edgeGlow = vo, u.pulsePeriod = 0, u.selectedObjects = [], l.addPass(u), l.setSize(i, s), e._composer = l, e._outlinePass = u;
3255
3505
  }
3256
- function lo(e, t, n) {
3506
+ function Eo(e, t, n) {
3257
3507
  !e._composer || !e._outlinePass || (e._composer.setSize(t, n), e._outlinePass.resolution.set(t, n));
3258
3508
  }
3259
- function Se(e, t) {
3509
+ function Le(e, t) {
3260
3510
  e._outlinePass && (e._outlinePass.selectedObjects = t ? [t] : [], e._selectedObject = t || null);
3261
3511
  }
3262
- function zt(e) {
3512
+ function Et(e) {
3263
3513
  e._composer && (e._composer.dispose(), e._composer = null), e._outlinePass = null, e._selectedObject = null, e.selectables = [];
3264
3514
  }
3265
- const ao = [
3515
+ const xo = [
3266
3516
  { normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
3267
3517
  { normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
3268
3518
  { normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
@@ -3270,147 +3520,160 @@ const ao = [
3270
3520
  { normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
3271
3521
  { normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
3272
3522
  ];
3273
- function co(e, t, n, r, o = {}) {
3274
- if (!e.scene || (qt(e), !t || !n || !r)) return;
3523
+ function ko(e, t, n, r, o = {}) {
3524
+ if (!e.scene || (Qt(e), !t || !n || !r)) return;
3275
3525
  const { autoCenter: i = !0, opacity: s = 1 } = o;
3276
3526
  let l = 1 / 0, c = -1 / 0, a = 1 / 0, u = -1 / 0, m = 1 / 0, d = -1 / 0;
3277
- t.forEach((z) => {
3278
- const R = Number(z.x ?? z.center_x ?? 0), C = Number(z.y ?? z.center_y ?? 0), G = Number(z.z ?? z.center_z ?? 0), U = Number(z.dx ?? z.size_x ?? 1), j = Number(z.dy ?? z.size_y ?? 1), Z = Number(z.dz ?? z.size_z ?? 1);
3279
- l = Math.min(l, R - U / 2), c = Math.max(c, R + U / 2), a = Math.min(a, C - j / 2), u = Math.max(u, C + j / 2), m = Math.min(m, G - Z / 2), d = Math.max(d, G + Z / 2);
3527
+ t.forEach((E) => {
3528
+ const R = Number(E.x ?? E.center_x ?? 0), D = Number(E.y ?? E.center_y ?? 0), G = Number(E.z ?? E.center_z ?? 0), U = Number(E.dx ?? E.size_x ?? 1), j = Number(E.dy ?? E.size_y ?? 1), Z = Number(E.dz ?? E.size_z ?? 1);
3529
+ l = Math.min(l, R - U / 2), c = Math.max(c, R + U / 2), a = Math.min(a, D - j / 2), u = Math.max(u, D + j / 2), m = Math.min(m, G - Z / 2), d = Math.max(d, G + Z / 2);
3280
3530
  });
3281
3531
  let f = 0, h = 0, g = 0;
3282
3532
  o.offset ? (f = Number(o.offset.x ?? 0), h = Number(o.offset.y ?? 0), g = Number(o.offset.z ?? 0)) : i && (f = -((l + c) / 2), h = -((a + u) / 2), g = -((m + d) / 2));
3283
- const y = l + f, p = c + f, b = a + h, N = u + h, M = m + g, I = d + g, x = (z, R, C) => `${Math.round(z)},${Math.round(R)},${Math.round(C)}`, S = new Set(
3284
- t.map((z) => x(Number(z.x ?? 0), Number(z.y ?? 0), Number(z.z ?? 0)))
3285
- ), w = [], D = [], v = [], L = [], O = [];
3286
- let V = 0;
3287
- if (t.forEach((z) => {
3288
- const R = Number(z.x ?? z.center_x ?? 0), C = Number(z.y ?? z.center_y ?? 0), G = Number(z.z ?? z.center_z ?? 0), U = Number(z.dx ?? z.size_x ?? 1), j = Number(z.dy ?? z.size_y ?? 1), Z = Number(z.dz ?? z.size_z ?? 1), K = R + f, le = C + h, ye = G + g, fe = $n(z[n], r, _), { r: Ce, g: he, b: Ge } = fe;
3289
- ao.forEach((_e) => {
3290
- const Jt = R + _e.neibDir[0] * U, Qt = C + _e.neibDir[1] * j, en = G + _e.neibDir[2] * Z;
3291
- if (S.has(x(Jt, Qt, en))) return;
3292
- const ze = V;
3293
- _e.verts.forEach(([tn, nn, rn]) => {
3294
- w.push(K + tn * U / 2, le + nn * j / 2, ye + rn * Z / 2), D.push(_e.normal[0], _e.normal[1], _e.normal[2]), v.push(Ce, he, Ge), V++;
3295
- }), L.push(ze, ze + 1, ze + 2, ze, ze + 2, ze + 3), O.push(z);
3533
+ const N = l + f, p = c + f, b = a + h, M = u + h, v = m + g, O = d + g, z = (E, R, D) => `${Math.round(E)},${Math.round(R)},${Math.round(D)}`, L = new Set(
3534
+ t.map((E) => z(Number(E.x ?? 0), Number(E.y ?? 0), Number(E.z ?? 0)))
3535
+ ), w = [], C = [], _ = [], A = [], I = [];
3536
+ let B = 0;
3537
+ if (t.forEach((E) => {
3538
+ const R = Number(E.x ?? E.center_x ?? 0), D = Number(E.y ?? E.center_y ?? 0), G = Number(E.z ?? E.center_z ?? 0), U = Number(E.dx ?? E.size_x ?? 1), j = Number(E.dy ?? E.size_y ?? 1), Z = Number(E.dz ?? E.size_z ?? 1), J = R + f, le = D + h, _e = G + g, he = jn(E[n], r, y), { r: Se, g: pe, b: Ge } = he;
3539
+ xo.forEach((Ne) => {
3540
+ const rn = R + Ne.neibDir[0] * U, on = D + Ne.neibDir[1] * j, sn = G + Ne.neibDir[2] * Z;
3541
+ if (L.has(z(rn, on, sn))) return;
3542
+ const ze = B;
3543
+ Ne.verts.forEach(([ln, an, cn]) => {
3544
+ w.push(J + ln * U / 2, le + an * j / 2, _e + cn * Z / 2), C.push(Ne.normal[0], Ne.normal[1], Ne.normal[2]), _.push(Se, pe, Ge), B++;
3545
+ }), A.push(ze, ze + 1, ze + 2, ze, ze + 2, ze + 3), I.push(E);
3296
3546
  });
3297
3547
  }), w.length === 0) return;
3298
- const H = new _.BufferGeometry();
3299
- H.setAttribute("position", new _.Float32BufferAttribute(w, 3)), H.setAttribute("normal", new _.Float32BufferAttribute(D, 3)), H.setAttribute("color", new _.Float32BufferAttribute(v, 3)), H.setIndex(L);
3300
- const A = new _.MeshLambertMaterial({
3548
+ const H = new y.BufferGeometry();
3549
+ H.setAttribute("position", new y.Float32BufferAttribute(w, 3)), H.setAttribute("normal", new y.Float32BufferAttribute(C, 3)), H.setAttribute("color", new y.Float32BufferAttribute(_, 3)), H.setIndex(A);
3550
+ const S = new y.MeshLambertMaterial({
3301
3551
  vertexColors: !0,
3302
3552
  transparent: s < 1,
3303
3553
  opacity: s,
3304
- side: _.DoubleSide
3305
- }), E = new _.Mesh(H, A);
3306
- E.userData._isMergedBlocks = !0, E.userData._quadToBlock = O, E.userData._offset = { x: f, y: h, z: g }, e.scene.add(E), e.blocks.push(E), Me(e), e.camera && e.controls && (e.lastBounds = { minX: y, maxX: p, minY: b, maxY: N, minZ: M, maxZ: I }, lt(e, { minX: y, maxX: p, minY: b, maxY: N, minZ: M, maxZ: I }));
3554
+ side: y.DoubleSide
3555
+ }), x = new y.Mesh(H, S);
3556
+ x.userData._isMergedBlocks = !0, x.userData._quadToBlock = I, x.userData._offset = { x: f, y: h, z: g }, e.scene.add(x), e.blocks.push(x), ve(e), e.camera && e.controls && (e.lastBounds = { minX: N, maxX: p, minY: b, maxY: M, minZ: v, maxZ: O }, at(e, { minX: N, maxX: p, minY: b, maxY: M, minZ: v, maxZ: O }));
3307
3557
  }
3308
- function qt(e) {
3558
+ function Qt(e) {
3309
3559
  var t;
3310
3560
  e.blocks.forEach((n) => {
3311
3561
  e.scene.remove(n), n.geometry.dispose(), n.material.dispose();
3312
- }), e.blocks = [], e._blockHighlightMesh && ((t = e.scene) == null || t.remove(e._blockHighlightMesh), e._blockHighlightMesh.geometry.dispose(), e._blockHighlightMesh.material.dispose(), e._blockHighlightMesh = null), Me(e);
3562
+ }), e.blocks = [], e._blockHighlightMesh && ((t = e.scene) == null || t.remove(e._blockHighlightMesh), e._blockHighlightMesh.geometry.dispose(), e._blockHighlightMesh.material.dispose(), e._blockHighlightMesh = null), ve(e);
3313
3563
  }
3314
- function uo(e, t) {
3564
+ function Ao(e, t) {
3315
3565
  const n = Math.max(0, Math.min(1, Number(t)));
3316
3566
  e.blocks.forEach((r) => {
3317
3567
  r.material && (r.material.opacity = n, r.material.transparent = n < 1, r.material.needsUpdate = !0);
3318
3568
  });
3319
3569
  }
3320
- function mo(e, t, n) {
3570
+ function Io(e, t, n) {
3321
3571
  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);
3322
3572
  if (!e._blockHighlightMesh) {
3323
- const d = new _.BoxGeometry(1, 1, 1), f = new _.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
3324
- e._blockHighlightMesh = new _.Mesh(d, f), e.scene.add(e._blockHighlightMesh);
3573
+ const d = new y.BoxGeometry(1, 1, 1), f = new y.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
3574
+ e._blockHighlightMesh = new y.Mesh(d, f), e.scene.add(e._blockHighlightMesh);
3325
3575
  }
3326
3576
  return e._blockHighlightMesh.position.set(s, l, c), e._blockHighlightMesh.scale.set(a, u, m), e._blockHighlightMesh;
3327
3577
  }
3328
- function Zt(e) {
3578
+ function en(e) {
3329
3579
  var o, i;
3330
3580
  if (!e._outlinePass || e.selectables.length === 0) {
3331
- e._outlinePass && Se(e, null);
3581
+ e._outlinePass && Le(e, null);
3332
3582
  return;
3333
3583
  }
3334
3584
  const t = e.raycaster.intersectObjects(e.selectables, !0);
3335
3585
  if (t.length === 0) {
3336
- Se(e, null);
3586
+ Le(e, null);
3337
3587
  return;
3338
3588
  }
3339
3589
  const n = t[0], r = n.object;
3340
3590
  if ((o = r == null ? void 0 : r.userData) != null && o._isMergedBlocks) {
3341
3591
  const s = Math.floor(n.faceIndex / 2), l = (i = r.userData._quadToBlock) == null ? void 0 : i[s];
3342
3592
  if (l) {
3343
- Se(e, mo(e, l, r.userData._offset));
3593
+ Le(e, Io(e, l, r.userData._offset));
3344
3594
  return;
3345
3595
  }
3346
3596
  }
3347
- Se(e, r);
3597
+ Le(e, r);
3348
3598
  }
3349
- function fo(e) {
3599
+ function Oo(e) {
3350
3600
  const t = e.renderer;
3351
3601
  t && (e.handleCanvasClick = (n) => {
3352
- var f, h, g, y, p, b, N;
3602
+ var f, h, g, N, p, b, M;
3353
3603
  if (n.button !== 0) return;
3354
3604
  if ((f = e.gizmo) != null && f.domElement) {
3355
- const M = e.gizmo.domElement.getBoundingClientRect();
3356
- if (n.clientX >= M.left && n.clientX <= M.right && n.clientY >= M.top && n.clientY <= M.bottom)
3605
+ const v = e.gizmo.domElement.getBoundingClientRect();
3606
+ if (n.clientX >= v.left && n.clientX <= v.right && n.clientY >= v.top && n.clientY <= v.bottom)
3357
3607
  return;
3358
3608
  }
3359
3609
  const r = t.domElement.getBoundingClientRect(), o = n.clientX - r.left, i = n.clientY - r.top;
3360
- if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), Zt(e), e.blocks.length > 0) {
3361
- const M = e.raycaster.intersectObjects(e.blocks, !1);
3362
- if (M.length > 0) {
3363
- const I = M[0], x = I.object;
3364
- if ((h = x == null ? void 0 : x.userData) != null && h._isMergedBlocks && e.blockClickHandler) {
3365
- const S = Math.floor(I.faceIndex / 2), w = x.userData._quadToBlock[S];
3610
+ if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), en(e), e.blocks.length > 0) {
3611
+ const v = e.raycaster.intersectObjects(e.blocks, !1);
3612
+ if (v.length > 0) {
3613
+ const O = v[0], z = O.object;
3614
+ if ((h = z == null ? void 0 : z.userData) != null && h._isMergedBlocks && e.blockClickHandler) {
3615
+ const L = Math.floor(O.faceIndex / 2), w = z.userData._quadToBlock[L];
3366
3616
  w && e.blockClickHandler(w);
3367
3617
  }
3368
3618
  return;
3369
3619
  }
3370
3620
  }
3371
3621
  const s = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), c = ((g = s[0]) == null ? void 0 : g.distance) ?? 1 / 0;
3372
- if ((((y = l[0]) == null ? void 0 : y.distance) ?? 1 / 0) < c && l.length > 0) {
3373
- const M = l[0].object;
3374
- e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...M.userData });
3622
+ if ((((N = l[0]) == null ? void 0 : N.distance) ?? 1 / 0) < c && l.length > 0) {
3623
+ const v = l[0].object;
3624
+ e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...v.userData });
3375
3625
  return;
3376
3626
  }
3377
3627
  if (s.length === 0) return;
3378
3628
  let u = s[0].object;
3379
3629
  for (; u && u.parent && !((p = u.userData) != null && p.holeId); )
3380
3630
  u = u.parent;
3381
- const m = (b = u == null ? void 0 : u.userData) == null ? void 0 : b.holeId, d = (N = u == null ? void 0 : u.userData) == null ? void 0 : N.project;
3631
+ const m = (b = u == null ? void 0 : u.userData) == null ? void 0 : b.holeId, d = (M = u == null ? void 0 : u.userData) == null ? void 0 : M.project;
3382
3632
  m && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: m, project: d });
3383
3633
  }, t.domElement.addEventListener("click", e.handleCanvasClick));
3384
3634
  }
3385
- class Di {
3635
+ class Qi {
3386
3636
  constructor() {
3387
- 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 _.Clock(), this.handleCanvasClick = null, this.raycaster = new _.Raycaster(), this.pointer = new _.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new _.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null, this.rasterOverlays = /* @__PURE__ */ new Map();
3637
+ 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.stripLogGroups = [], 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, this.rasterOverlays = /* @__PURE__ */ new Map();
3388
3638
  }
3389
3639
  init(t) {
3390
3640
  if (!t) return;
3391
3641
  this.container = t;
3392
3642
  const n = t.clientWidth, r = t.clientHeight;
3393
- this.scene = new _.Scene(), this.scene.background = new _.Color(16777215), this.camera = new _.PerspectiveCamera(28, n / r, 1e-3, 1e7), this.camera.up.set(0, 0, 1), this.camera.position.set(50, 50, 50), this.camera.lookAt(0, 0, 0), this.renderer = new _.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
3394
- const o = new _.AmbientLight(16777215, 1.2);
3643
+ this.scene = new y.Scene(), this.scene.background = new y.Color(16777215), this.camera = new y.PerspectiveCamera(28, n / r, 1e-3, 1e7), this.camera.up.set(0, 0, 1), this.camera.position.set(50, 50, 50), this.camera.lookAt(0, 0, 0), this.renderer = new y.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
3644
+ const o = new y.AmbientLight(16777215, 1.2);
3395
3645
  this.scene.add(o);
3396
- const i = new _.DirectionalLight(16777215, 1.5);
3646
+ const i = new y.DirectionalLight(16777215, 1.5);
3397
3647
  i.position.set(10, 10, 5), this.scene.add(i);
3398
- const s = new _.AxesHelper(20);
3399
- this.scene.add(s), this.controls = new on(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 = 5e6, this.controls.mouseButtons = {
3400
- LEFT: _.MOUSE.PAN,
3401
- MIDDLE: _.MOUSE.DOLLY,
3402
- RIGHT: _.MOUSE.ROTATE
3648
+ const s = new y.AxesHelper(20);
3649
+ this.scene.add(s), this.controls = new un(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 10, this.controls.minDistance = 1e-4, this.controls.maxDistance = 5e6, this.controls.mouseButtons = {
3650
+ LEFT: y.MOUSE.PAN,
3651
+ MIDDLE: y.MOUSE.DOLLY,
3652
+ RIGHT: y.MOUSE.ROTATE
3403
3653
  }, this.controls.touches = {
3404
- ONE: _.TOUCH.ROTATE,
3405
- TWO: _.TOUCH.PAN
3406
- }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new sn(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 ln(this.camera, this.renderer, {
3654
+ ONE: y.TOUCH.ROTATE,
3655
+ TWO: y.TOUCH.DOLLY_PAN
3656
+ }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new dn(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 mn(this.camera, this.renderer, {
3407
3657
  container: this.container,
3408
3658
  placement: "top-right",
3409
3659
  size: 110,
3410
3660
  offset: { top: 12, right: 12 },
3411
3661
  animated: !0,
3412
3662
  speed: 1.5
3413
- }), this.gizmo.attachControls(this.controls), fo(this), so(this);
3663
+ }), this.gizmo.attachControls(this.controls), Oo(this), this._wheelRelay = (c) => {
3664
+ c.target !== this.renderer.domElement && (c.preventDefault(), this.renderer.domElement.dispatchEvent(new WheelEvent("wheel", {
3665
+ clientX: c.clientX,
3666
+ clientY: c.clientY,
3667
+ deltaX: c.deltaX,
3668
+ deltaY: c.deltaY,
3669
+ deltaZ: c.deltaZ,
3670
+ deltaMode: c.deltaMode,
3671
+ ctrlKey: c.ctrlKey,
3672
+ shiftKey: c.shiftKey,
3673
+ altKey: c.altKey,
3674
+ bubbles: !1
3675
+ })));
3676
+ }, this.container.addEventListener("wheel", this._wheelRelay, { passive: !1 }), zo(this);
3414
3677
  const l = () => {
3415
3678
  var a;
3416
3679
  this.frameId = requestAnimationFrame(l);
@@ -3422,16 +3685,37 @@ class Di {
3422
3685
  resize() {
3423
3686
  if (!this.container || !this.camera || !this.renderer) return;
3424
3687
  const t = this.container.clientWidth, n = this.container.clientHeight;
3425
- this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), lo(this, t, n);
3688
+ this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), Eo(this, t, n);
3426
3689
  }
3427
3690
  dispose() {
3428
- 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, qt(this), Xt(this), Gt(this), Pr(this), zt(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));
3691
+ 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, Qt(this), Jt(this), et(this), Wt(this), Hr(this), Et(this), this.container && this._wheelRelay && this.container.removeEventListener("wheel", this._wheelRelay), 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));
3429
3692
  }
3430
3693
  // ---------------------------------------------------------------------------
3431
3694
  // Data renderers — delegate to domain modules
3432
3695
  // ---------------------------------------------------------------------------
3433
3696
  setDrillholes(t, n = {}) {
3434
- no(this, t, n);
3697
+ uo(this, t, n);
3698
+ }
3699
+ /**
3700
+ * Add floating 2D strip log panels beside drillholes in the 3D scene.
3701
+ * Each panel is a flat rectangle offset from the hole collar, depth-registered
3702
+ * to the hole's vertical extent and containing a line graph of numeric data.
3703
+ *
3704
+ * @param {Array<object>} holes - Hole objects (same array as passed to setDrillholes)
3705
+ * @param {Array<object>} stripLogs - Strip log definitions. Each must contain:
3706
+ * - `holeId` {string} — must match a hole id
3707
+ * - `depths` {number[]} — downhole depth positions for each sample
3708
+ * - `values` {number[]} — numeric value at each depth
3709
+ * - `options` {object} — optional: panelWidth, lateralOffset, color, valueMin, valueMax
3710
+ */
3711
+ setStripLogs(t, n) {
3712
+ _o(this, t, n);
3713
+ }
3714
+ /**
3715
+ * Remove all strip log panels from the scene and free GPU resources.
3716
+ */
3717
+ clearStripLogs() {
3718
+ et(this);
3435
3719
  }
3436
3720
  /**
3437
3721
  * Render block model data as a single merged mesh of exterior faces only.
@@ -3441,20 +3725,20 @@ class Di {
3441
3725
  * @param {Object} [options]
3442
3726
  */
3443
3727
  setBlocks(t, n, r, o = {}) {
3444
- co(this, t, n, r, o);
3728
+ ko(this, t, n, r, o);
3445
3729
  }
3446
3730
  /**
3447
3731
  * Update the opacity of all currently rendered blocks.
3448
3732
  * @param {number} opacity - New opacity value between 0 and 1
3449
3733
  */
3450
3734
  setBlockOpacity(t) {
3451
- uo(this, t);
3735
+ Ao(this, t);
3452
3736
  }
3453
3737
  setStructuralDiscs(t, n, r = {}) {
3454
- vr(this, t, n, r);
3738
+ Lr(this, t, n, r);
3455
3739
  }
3456
3740
  setStructuralDiscsVisible(t) {
3457
- Er(this, t);
3741
+ Dr(this, t);
3458
3742
  }
3459
3743
  // ---------------------------------------------------------------------------
3460
3744
  // Click handlers
@@ -3476,50 +3760,57 @@ class Di {
3476
3760
  this.viewChangeHandler = typeof t == "function" ? t : null;
3477
3761
  }
3478
3762
  getViewState() {
3479
- return Ut(this);
3763
+ return Zt(this);
3480
3764
  }
3481
3765
  setViewState(t) {
3482
- return Fr(this, t);
3766
+ return jr(this, t);
3483
3767
  }
3484
3768
  _buildViewSignature(t) {
3485
- return st(t);
3769
+ return lt(t);
3486
3770
  }
3487
3771
  _emitViewChangeIfNeeded() {
3488
- wr(this);
3772
+ Gr(this);
3489
3773
  }
3490
3774
  _fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s }) {
3491
- lt(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
3775
+ at(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: s });
3492
3776
  }
3493
3777
  recenterCameraToOrigin(t = 1e3) {
3494
- Tr(this, t);
3778
+ Ur(this, t);
3495
3779
  }
3496
3780
  lookDown(t = 2e3) {
3497
- $r(this, t);
3781
+ Yr(this, t);
3498
3782
  }
3499
3783
  pan(t = 0, n = 0) {
3500
- Rr(this, t, n);
3784
+ Xr(this, t, n);
3501
3785
  }
3502
3786
  dolly(t = 1.1) {
3503
- Br(this, t);
3787
+ qr(this, t);
3504
3788
  }
3505
3789
  focusOnLastBounds(t = 1.2) {
3506
- Vr(this, t);
3790
+ Wr(this, t);
3507
3791
  }
3508
3792
  /**
3509
3793
  * Change the camera field-of-view while keeping the visible scene the same apparent size.
3510
3794
  * @param {number} fovDeg - Desired FOV in degrees
3511
3795
  */
3512
3796
  setCameraFov(t) {
3513
- Gr(this, t);
3797
+ Jr(this, t);
3798
+ }
3799
+ /**
3800
+ * Set the scene background colour.
3801
+ * @param {'white'|'black'} colour
3802
+ */
3803
+ setBackground(t) {
3804
+ this.scene && (this.scene.background = new y.Color(t === "black" ? 0 : 16777215));
3514
3805
  }
3515
3806
  setControlMode(t = "orbit") {
3516
- Ur(this, t);
3807
+ Qr(this, t);
3517
3808
  }
3518
3809
  // ---------------------------------------------------------------------------
3519
3810
  // Selection glow public API
3520
3811
  // ---------------------------------------------------------------------------
3521
3812
  _syncSelectables() {
3522
- Me(this);
3813
+ ve(this);
3523
3814
  }
3524
3815
  /**
3525
3816
  * Register the objects that are candidates for click-select glow.
@@ -3533,7 +3824,7 @@ class Di {
3533
3824
  * @param {THREE.Object3D|null} object
3534
3825
  */
3535
3826
  selectObject(t) {
3536
- Se(this, t || null);
3827
+ Le(this, t || null);
3537
3828
  }
3538
3829
  /**
3539
3830
  * Return the currently selected object, or null if nothing is selected.
@@ -3546,11 +3837,11 @@ class Di {
3546
3837
  * Dispose the effect composer and all GPU resources used by the selection glow.
3547
3838
  */
3548
3839
  disposeGlow() {
3549
- zt(this);
3840
+ Et(this);
3550
3841
  }
3551
3842
  /** @private */
3552
3843
  _updateSelectionFromPointer() {
3553
- Zt(this);
3844
+ en(this);
3554
3845
  }
3555
3846
  // ---------------------------------------------------------------------------
3556
3847
  // Raster overlay API — delegate to rasterOverlayScene
@@ -3560,14 +3851,14 @@ class Di {
3560
3851
  * @param {object} layer - Layer descriptor returned by createRasterOverlay()
3561
3852
  */
3562
3853
  addRasterOverlay(t) {
3563
- Ir(this, t);
3854
+ Pr(this, t);
3564
3855
  }
3565
3856
  /**
3566
3857
  * Remove a raster overlay from the scene and dispose its GPU resources.
3567
3858
  * @param {string} id - Overlay id
3568
3859
  */
3569
3860
  removeRasterOverlay(t) {
3570
- it(this, t);
3861
+ st(this, t);
3571
3862
  }
3572
3863
  /**
3573
3864
  * Set the opacity of a raster overlay at runtime.
@@ -3575,7 +3866,7 @@ class Di {
3575
3866
  * @param {number} opacity - New opacity [0, 1]
3576
3867
  */
3577
3868
  setRasterOverlayOpacity(t, n) {
3578
- Or(this, t, n);
3869
+ Tr(this, t, n);
3579
3870
  }
3580
3871
  /**
3581
3872
  * Show or hide a raster overlay.
@@ -3583,7 +3874,7 @@ class Di {
3583
3874
  * @param {boolean} visible
3584
3875
  */
3585
3876
  setRasterOverlayVisibility(t, n) {
3586
- Cr(this, t, n);
3877
+ $r(this, t, n);
3587
3878
  }
3588
3879
  /**
3589
3880
  * Update the elevation (Z position) of a raster overlay.
@@ -3591,7 +3882,7 @@ class Di {
3591
3882
  * @param {number} elevation
3592
3883
  */
3593
3884
  setRasterOverlayElevation(t, n) {
3594
- Sr(this, t, n);
3885
+ Rr(this, t, n);
3595
3886
  }
3596
3887
  /**
3597
3888
  * Return a raster overlay by id, or undefined if not found.
@@ -3599,17 +3890,17 @@ class Di {
3599
3890
  * @returns {object|undefined}
3600
3891
  */
3601
3892
  getRasterOverlay(t) {
3602
- return Dr(this, t);
3893
+ return Br(this, t);
3603
3894
  }
3604
3895
  /**
3605
3896
  * Return all raster overlay layers in insertion order.
3606
3897
  * @returns {object[]}
3607
3898
  */
3608
3899
  listRasterOverlays() {
3609
- return Lr(this);
3900
+ return Vr(this);
3610
3901
  }
3611
3902
  }
3612
- function Li({
3903
+ function es({
3613
3904
  controlMode: e = "orbit",
3614
3905
  onToggleFly: t = () => {
3615
3906
  },
@@ -3618,16 +3909,30 @@ function Li({
3618
3909
  onLookDown: r = () => {
3619
3910
  },
3620
3911
  onFit: o = () => {
3912
+ },
3913
+ darkBackground: i = !1,
3914
+ onToggleDarkBackground: s = () => {
3621
3915
  }
3622
3916
  }) {
3623
- return /* @__PURE__ */ J("div", { className: "baselode-3d-controls", children: [
3917
+ return /* @__PURE__ */ K("div", { className: "baselode-3d-controls", children: [
3624
3918
  /* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: n, children: "Recenter to (0,0,0)" }),
3625
3919
  /* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
3626
3920
  /* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
3627
- /* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" })
3921
+ /* @__PURE__ */ P("button", { type: "button", className: "ghost-button", onClick: t, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" }),
3922
+ /* @__PURE__ */ K("label", { className: "baselode-3d-controls-checkbox", children: [
3923
+ /* @__PURE__ */ P(
3924
+ "input",
3925
+ {
3926
+ type: "checkbox",
3927
+ checked: i,
3928
+ onChange: s
3929
+ }
3930
+ ),
3931
+ "Dark background"
3932
+ ] })
3628
3933
  ] });
3629
3934
  }
3630
- function Pi({
3935
+ function ts({
3631
3936
  properties: e = [],
3632
3937
  selectedProperty: t = "",
3633
3938
  onPropertyChange: n = () => {
@@ -3641,9 +3946,9 @@ function Pi({
3641
3946
  }
3642
3947
  }) {
3643
3948
  var c, a;
3644
- return /* @__PURE__ */ J("div", { className: "bm-widget", children: [
3949
+ return /* @__PURE__ */ K("div", { className: "bm-widget", children: [
3645
3950
  /* @__PURE__ */ P("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
3646
- /* @__PURE__ */ J(
3951
+ /* @__PURE__ */ K(
3647
3952
  "select",
3648
3953
  {
3649
3954
  id: "bm-property-select",
@@ -3656,7 +3961,7 @@ function Pi({
3656
3961
  ]
3657
3962
  }
3658
3963
  ),
3659
- i && i.type === "numeric" && /* @__PURE__ */ J("div", { className: "bm-widget__scale", children: [
3964
+ i && i.type === "numeric" && /* @__PURE__ */ K("div", { className: "bm-widget__scale", children: [
3660
3965
  /* @__PURE__ */ P("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((c = i.min) == null ? void 0 : c.toFixed(2)) ?? "—" }),
3661
3966
  /* @__PURE__ */ P("div", { className: "bm-widget__scale-bar" }),
3662
3967
  /* @__PURE__ */ P("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((a = i.max) == null ? void 0 : a.toFixed(2)) ?? "—" })
@@ -3673,7 +3978,7 @@ function Pi({
3673
3978
  u
3674
3979
  );
3675
3980
  }) }),
3676
- /* @__PURE__ */ J("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
3981
+ /* @__PURE__ */ K("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
3677
3982
  "Opacity (",
3678
3983
  Math.round(r * 100),
3679
3984
  "%)"
@@ -3691,8 +3996,8 @@ function Pi({
3691
3996
  onChange: (u) => o(parseFloat(u.target.value))
3692
3997
  }
3693
3998
  ),
3694
- s && /* @__PURE__ */ J("div", { className: "bm-widget__popup", children: [
3695
- /* @__PURE__ */ J("div", { className: "bm-widget__popup-header", children: [
3999
+ s && /* @__PURE__ */ K("div", { className: "bm-widget__popup", children: [
4000
+ /* @__PURE__ */ K("div", { className: "bm-widget__popup-header", children: [
3696
4001
  /* @__PURE__ */ P("span", { children: "Block attributes" }),
3697
4002
  /* @__PURE__ */ P(
3698
4003
  "button",
@@ -3705,19 +4010,19 @@ function Pi({
3705
4010
  }
3706
4011
  )
3707
4012
  ] }),
3708
- /* @__PURE__ */ P("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ P("tbody", { children: Object.entries(s).map(([u, m]) => /* @__PURE__ */ J("tr", { children: [
4013
+ /* @__PURE__ */ P("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ P("tbody", { children: Object.entries(s).map(([u, m]) => /* @__PURE__ */ K("tr", { children: [
3709
4014
  /* @__PURE__ */ P("th", { children: u }),
3710
4015
  /* @__PURE__ */ P("td", { children: m == null ? "—" : String(m) })
3711
4016
  ] }, u)) }) })
3712
4017
  ] })
3713
4018
  ] });
3714
4019
  }
3715
- const ho = [
4020
+ const So = [
3716
4021
  { minZoom: 0, lodKey: "thumb" },
3717
4022
  { minZoom: 4, lodKey: "medium" },
3718
4023
  { minZoom: 7, lodKey: "full" }
3719
- ], Wt = 50;
3720
- function po(e, t, n = ho) {
4024
+ ], tn = 50;
4025
+ function Lo(e, t, n = So) {
3721
4026
  var i;
3722
4027
  const r = e.lod_urls;
3723
4028
  if (!r || typeof r != "object" || Array.isArray(r))
@@ -3727,10 +4032,10 @@ function po(e, t, n = ho) {
3727
4032
  t >= s.minZoom && (o = s.lodKey);
3728
4033
  return r[o] || e.image_url || "";
3729
4034
  }
3730
- function bo(e) {
4035
+ function Do(e) {
3731
4036
  return [...e].sort((t, n) => (t.from_depth ?? 0) - (n.from_depth ?? 0));
3732
4037
  }
3733
- function go(e) {
4038
+ function Co(e) {
3734
4039
  const t = {};
3735
4040
  for (const n of e) {
3736
4041
  const r = n.photo_set != null && n.photo_set !== "" ? String(n.photo_set) : "default";
@@ -3738,7 +4043,7 @@ function go(e) {
3738
4043
  }
3739
4044
  return t;
3740
4045
  }
3741
- function yo(e, t, n = 10) {
4046
+ function wo(e, t, n = 10) {
3742
4047
  const r = [];
3743
4048
  if (e >= t || n <= 0) return r;
3744
4049
  const o = Math.ceil(e / n) * n, i = n * 1e-9;
@@ -3748,13 +4053,13 @@ function yo(e, t, n = 10) {
3748
4053
  }
3749
4054
  return r;
3750
4055
  }
3751
- function _o(e) {
4056
+ function Fo(e) {
3752
4057
  return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
3753
4058
  }
3754
- function Kt(e) {
4059
+ function nn(e) {
3755
4060
  return `tray_${String(e).padStart(3, "0")}.jpg`;
3756
4061
  }
3757
- function No(e, t, n, r, o = "Tray Images", i = Kt) {
4062
+ function Po(e, t, n, r, o = "Tray Images", i = nn) {
3758
4063
  const s = (n ?? "").replace(/\/$/, ""), l = (r ?? "").replace(/\/$/, "");
3759
4064
  return t.map((c, a) => {
3760
4065
  const u = c.filename ?? i(a), m = c.photoSet ?? o;
@@ -3771,93 +4076,93 @@ function No(e, t, n, r, o = "Tray Images", i = Kt) {
3771
4076
  };
3772
4077
  });
3773
4078
  }
3774
- function Fi(e, t, n = Wt) {
4079
+ function ns(e, t, n = tn) {
3775
4080
  const r = t / 5;
3776
4081
  return Math.max(1, Math.round(e * n * r));
3777
4082
  }
3778
- const We = 5, vt = 1.12, Mo = 0.05, zo = 40;
3779
- function vo({
4083
+ const Ze = 5, xt = 1.12, To = 0.05, $o = 40;
4084
+ function Ro({
3780
4085
  photos: e = [],
3781
4086
  holeId: t = "",
3782
4087
  initialZoom: n = 5,
3783
4088
  transform: r,
3784
4089
  onTransformChange: o
3785
4090
  }) {
3786
- const [i, s] = Q({ scale: 1, tx: 0, ty: 0 }), l = r ?? i, c = De(l);
4091
+ const [i, s] = ee({ scale: 1, tx: 0, ty: 0 }), l = r ?? i, c = De(l);
3787
4092
  c.current = l;
3788
4093
  const a = Ue(
3789
- (v) => {
3790
- const L = typeof v == "function" ? v(c.current) : v;
3791
- o ? o(L) : s(L);
4094
+ (_) => {
4095
+ const A = typeof _ == "function" ? _(c.current) : _;
4096
+ o ? o(A) : s(A);
3792
4097
  },
3793
4098
  [o]
3794
- ), [u, m] = Q(!1), d = De(null), f = De(null), h = ne(() => bo(e), [e]), g = ne(() => go(h), [h]), y = ne(() => {
3795
- const v = /* @__PURE__ */ new Set();
3796
- for (const L of e) {
3797
- const O = L.photo_set != null && L.photo_set !== "" ? String(L.photo_set) : "default";
3798
- v.add(O);
4099
+ ), [u, m] = ee(!1), d = De(null), f = De(null), h = ne(() => Do(e), [e]), g = ne(() => Co(h), [h]), N = ne(() => {
4100
+ const _ = /* @__PURE__ */ new Set();
4101
+ for (const A of e) {
4102
+ const I = A.photo_set != null && A.photo_set !== "" ? String(A.photo_set) : "default";
4103
+ _.add(I);
3799
4104
  }
3800
- return [...v];
4105
+ return [..._];
3801
4106
  }, [e]), { minDepth: p, maxDepth: b } = ne(() => {
3802
4107
  if (!h.length) return { minDepth: 0, maxDepth: 0 };
3803
- const v = h.map((L) => L.to_depth ?? L.from_depth ?? 0);
4108
+ const _ = h.map((A) => A.to_depth ?? A.from_depth ?? 0);
3804
4109
  return {
3805
4110
  minDepth: h[0].from_depth ?? 0,
3806
- maxDepth: Math.max(...v)
4111
+ maxDepth: Math.max(..._)
3807
4112
  };
3808
- }, [h]), N = Wt * We / 5, M = ne(
3809
- () => Math.max(1, Math.round((b - p) * N)),
3810
- [p, b, N]
3811
- ), I = ne(() => {
3812
- const v = _o(We);
3813
- return yo(p, b, v);
3814
- }, [p, b]), x = 540 * We / 5, S = ne(
4113
+ }, [h]), M = tn * Ze / 5, v = ne(
4114
+ () => Math.max(1, Math.round((b - p) * M)),
4115
+ [p, b, M]
4116
+ ), O = ne(() => {
4117
+ const _ = Fo(Ze);
4118
+ return wo(p, b, _);
4119
+ }, [p, b]), z = 540 * Ze / 5, L = ne(
3815
4120
  () => Math.max(1, Math.min(10, Math.round(n * l.scale))),
3816
4121
  [n, l.scale]
3817
- ), w = Ue((v) => {
3818
- v.preventDefault();
3819
- const L = v.deltaY < 0 ? vt : 1 / vt, O = f.current.getBoundingClientRect(), V = v.clientX - O.left, H = v.clientY - O.top;
3820
- a((A) => {
3821
- const E = Math.max(Mo, Math.min(zo, A.scale * L)), z = E / A.scale;
4122
+ ), w = Ue((_) => {
4123
+ _.preventDefault();
4124
+ const A = _.deltaY < 0 ? xt : 1 / xt, I = f.current.getBoundingClientRect(), B = _.clientX - I.left, H = _.clientY - I.top;
4125
+ a((S) => {
4126
+ const x = Math.max(To, Math.min($o, S.scale * A)), E = x / S.scale;
3822
4127
  return {
3823
- scale: E,
3824
- tx: V - (V - A.tx) * z,
3825
- ty: H - (H - A.ty) * z
4128
+ scale: x,
4129
+ tx: B - (B - S.tx) * E,
4130
+ ty: H - (H - S.ty) * E
3826
4131
  };
3827
4132
  });
3828
4133
  }, [a]);
3829
4134
  se(() => {
3830
- const v = f.current;
3831
- if (v)
3832
- return v.addEventListener("wheel", w, { passive: !1 }), () => v.removeEventListener("wheel", w);
4135
+ const _ = f.current;
4136
+ if (_)
4137
+ return _.addEventListener("wheel", w, { passive: !1 }), () => _.removeEventListener("wheel", w);
3833
4138
  }, [w]);
3834
- const D = Ue((v) => {
3835
- v.button === 0 && (v.preventDefault(), d.current = {
3836
- x: v.clientX,
3837
- y: v.clientY,
4139
+ const C = Ue((_) => {
4140
+ _.button === 0 && (_.preventDefault(), d.current = {
4141
+ x: _.clientX,
4142
+ y: _.clientY,
3838
4143
  tx: c.current.tx,
3839
4144
  ty: c.current.ty
3840
4145
  }, m(!0));
3841
4146
  }, []);
3842
4147
  return se(() => {
3843
- const v = (O) => {
4148
+ const _ = (I) => {
3844
4149
  if (!d.current) return;
3845
- const { tx: V, ty: H, x: A, y: E } = d.current;
3846
- a((z) => ({
3847
- ...z,
3848
- tx: V + (O.clientX - A),
3849
- ty: H + (O.clientY - E)
4150
+ const { tx: B, ty: H, x: S, y: x } = d.current;
4151
+ a((E) => ({
4152
+ ...E,
4153
+ tx: B + (I.clientX - S),
4154
+ ty: H + (I.clientY - x)
3850
4155
  }));
3851
- }, L = () => {
4156
+ }, A = () => {
3852
4157
  d.current = null, m(!1);
3853
4158
  };
3854
- return window.addEventListener("mousemove", v), window.addEventListener("mouseup", L), () => {
3855
- window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", L);
4159
+ return window.addEventListener("mousemove", _), window.addEventListener("mouseup", A), () => {
4160
+ window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", A);
3856
4161
  };
3857
- }, [a]), /* @__PURE__ */ J("div", { className: "core-photo-table", children: [
3858
- /* @__PURE__ */ J("div", { className: "core-photo-controls", children: [
4162
+ }, [a]), /* @__PURE__ */ K("div", { className: "core-photo-table", children: [
4163
+ /* @__PURE__ */ K("div", { className: "core-photo-controls", children: [
3859
4164
  t && /* @__PURE__ */ P("span", { className: "core-photo-hole-id", children: t }),
3860
- /* @__PURE__ */ J("span", { className: "core-photo-zoom-label", children: [
4165
+ /* @__PURE__ */ K("span", { className: "core-photo-zoom-label", children: [
3861
4166
  Math.round(l.scale * 100),
3862
4167
  "%"
3863
4168
  ] }),
@@ -3872,16 +4177,16 @@ function vo({
3872
4177
  }
3873
4178
  )
3874
4179
  ] }),
3875
- e.length > 0 && /* @__PURE__ */ J("div", { className: "core-photo-col-headers", children: [
4180
+ e.length > 0 && /* @__PURE__ */ K("div", { className: "core-photo-col-headers", children: [
3876
4181
  /* @__PURE__ */ P("div", { className: "core-photo-ruler-spacer" }),
3877
- y.map((v) => /* @__PURE__ */ P(
4182
+ N.map((_) => /* @__PURE__ */ P(
3878
4183
  "div",
3879
4184
  {
3880
4185
  className: "core-photo-set-header",
3881
- style: { width: x },
3882
- children: v
4186
+ style: { width: z },
4187
+ children: _
3883
4188
  },
3884
- v
4189
+ _
3885
4190
  ))
3886
4191
  ] }),
3887
4192
  e.length === 0 ? /* @__PURE__ */ P("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ P(
@@ -3889,13 +4194,13 @@ function vo({
3889
4194
  {
3890
4195
  className: `core-photo-scroll${u ? " is-dragging" : ""}`,
3891
4196
  ref: f,
3892
- onMouseDown: D,
3893
- children: /* @__PURE__ */ J(
4197
+ onMouseDown: C,
4198
+ children: /* @__PURE__ */ K(
3894
4199
  "div",
3895
4200
  {
3896
4201
  className: "core-photo-inner",
3897
4202
  style: {
3898
- height: M,
4203
+ height: v,
3899
4204
  transform: `translate(${l.tx}px, ${l.ty}px) scale(${l.scale})`,
3900
4205
  transformOrigin: "0 0"
3901
4206
  },
@@ -3904,60 +4209,60 @@ function vo({
3904
4209
  "div",
3905
4210
  {
3906
4211
  className: "core-photo-depth-ruler",
3907
- style: { height: M },
3908
- children: I.map(({ depth: v, label: L }) => /* @__PURE__ */ P(
4212
+ style: { height: v },
4213
+ children: O.map(({ depth: _, label: A }) => /* @__PURE__ */ P(
3909
4214
  "div",
3910
4215
  {
3911
4216
  className: "core-photo-depth-marker",
3912
4217
  style: {
3913
- top: Math.round((v - p) * N)
4218
+ top: Math.round((_ - p) * M)
3914
4219
  },
3915
- children: L
4220
+ children: A
3916
4221
  },
3917
- v
4222
+ _
3918
4223
  ))
3919
4224
  }
3920
4225
  ),
3921
- y.map((v) => /* @__PURE__ */ P(
4226
+ N.map((_) => /* @__PURE__ */ P(
3922
4227
  "div",
3923
4228
  {
3924
4229
  className: "core-photo-col-body",
3925
- style: { height: M, width: x },
3926
- children: g[v].map((L) => {
3927
- const O = L.from_depth ?? 0, V = L.to_depth ?? O, H = Math.round(
3928
- (O - p) * N
3929
- ), A = Math.max(
4230
+ style: { height: v, width: z },
4231
+ children: g[_].map((A) => {
4232
+ const I = A.from_depth ?? 0, B = A.to_depth ?? I, H = Math.round(
4233
+ (I - p) * M
4234
+ ), S = Math.max(
3930
4235
  2,
3931
- Math.round((V - O) * N)
3932
- ), E = po(L, S);
3933
- return /* @__PURE__ */ J(
4236
+ Math.round((B - I) * M)
4237
+ ), x = Lo(A, L);
4238
+ return /* @__PURE__ */ K(
3934
4239
  "div",
3935
4240
  {
3936
4241
  className: "core-photo-item",
3937
- style: { top: H, height: A, width: x },
3938
- title: `${O}–${V} m`,
4242
+ style: { top: H, height: S, width: z },
4243
+ title: `${I}–${B} m`,
3939
4244
  children: [
3940
- E ? /* @__PURE__ */ P(
4245
+ x ? /* @__PURE__ */ P(
3941
4246
  "img",
3942
4247
  {
3943
- src: E,
3944
- alt: `Core ${O}–${V} m`,
4248
+ src: x,
4249
+ alt: `Core ${I}–${B} m`,
3945
4250
  loading: "lazy"
3946
4251
  }
3947
4252
  ) : /* @__PURE__ */ P("div", { className: "core-photo-no-image" }),
3948
- A >= 18 && /* @__PURE__ */ J("span", { className: "core-photo-item-label", children: [
3949
- O,
4253
+ S >= 18 && /* @__PURE__ */ K("span", { className: "core-photo-item-label", children: [
4254
+ I,
3950
4255
  "–",
3951
- V,
4256
+ B,
3952
4257
  " m"
3953
4258
  ] })
3954
4259
  ]
3955
4260
  },
3956
- `${L.hole_id ?? ""}-${O}-${V}-${v}`
4261
+ `${A.hole_id ?? ""}-${I}-${B}-${_}`
3957
4262
  );
3958
4263
  })
3959
4264
  },
3960
- v
4265
+ _
3961
4266
  ))
3962
4267
  ]
3963
4268
  }
@@ -3966,23 +4271,23 @@ function vo({
3966
4271
  )
3967
4272
  ] });
3968
4273
  }
3969
- function wi({
4274
+ function rs({
3970
4275
  holeId: e = "",
3971
4276
  trays: t = [],
3972
4277
  thumbBaseUrl: n = "",
3973
4278
  fullBaseUrl: r = "",
3974
4279
  photoSet: o = "Tray Images",
3975
- getFilename: i = Kt,
4280
+ getFilename: i = nn,
3976
4281
  initialZoom: s = 5,
3977
4282
  transform: l,
3978
4283
  onTransformChange: c
3979
4284
  }) {
3980
4285
  const a = ne(
3981
- () => No(e, t, n, r, o, i),
4286
+ () => Po(e, t, n, r, o, i),
3982
4287
  [e, t, n, r, o, i]
3983
4288
  );
3984
4289
  return /* @__PURE__ */ P(
3985
- vo,
4290
+ Ro,
3986
4291
  {
3987
4292
  photos: a,
3988
4293
  holeId: e,
@@ -3992,7 +4297,7 @@ function wi({
3992
4297
  }
3993
4298
  );
3994
4299
  }
3995
- function Ti(e) {
4300
+ function os(e) {
3996
4301
  const t = typeof e == "string" ? JSON.parse(e) : e;
3997
4302
  if (t.schema_version !== "1.0")
3998
4303
  throw new Error(
@@ -4020,210 +4325,224 @@ function Ti(e) {
4020
4325
  blocks: n
4021
4326
  };
4022
4327
  }
4023
- function Eo(e) {
4024
- const t = new _.BufferGeometry(), n = new Float32Array(e.vertices.length * 3);
4328
+ function Bo(e) {
4329
+ const t = new y.BufferGeometry(), n = new Float32Array(e.vertices.length * 3);
4025
4330
  e.vertices.forEach(([o, i, s], l) => {
4026
4331
  n[l * 3] = o, n[l * 3 + 1] = i, n[l * 3 + 2] = s;
4027
- }), t.setAttribute("position", new _.BufferAttribute(n, 3));
4332
+ }), t.setAttribute("position", new y.BufferAttribute(n, 3));
4028
4333
  const r = new Uint32Array(e.triangles.length * 3);
4029
4334
  return e.triangles.forEach(([o, i, s], l) => {
4030
4335
  r[l * 3] = o, r[l * 3 + 1] = i, r[l * 3 + 2] = s;
4031
- }), t.setIndex(new _.BufferAttribute(r, 1)), t;
4336
+ }), t.setIndex(new y.BufferAttribute(r, 1)), t;
4032
4337
  }
4033
- function $i(e, t, n = {}) {
4034
- const { defaultOpacity: r = 1 } = n, o = new _.Group();
4338
+ function is(e, t, n = {}) {
4339
+ const { defaultOpacity: r = 1 } = n, o = new y.Group();
4035
4340
  return t.blocks.forEach((i) => {
4036
- var g, y;
4037
- const s = Eo(i), l = ((g = i.material) == null ? void 0 : g.color) ?? "#888888", c = ((y = i.material) == null ? void 0 : y.opacity) ?? r, a = c < 1, u = new _.MeshStandardMaterial({
4038
- color: new _.Color(l),
4341
+ var g, N;
4342
+ const s = Bo(i), l = ((g = i.material) == null ? void 0 : g.color) ?? "#888888", c = ((N = i.material) == null ? void 0 : N.opacity) ?? r, a = c < 1, u = new y.MeshStandardMaterial({
4343
+ color: new y.Color(l),
4039
4344
  opacity: c,
4040
4345
  transparent: a,
4041
- side: _.DoubleSide,
4346
+ side: y.DoubleSide,
4042
4347
  flatShading: !0
4043
- }), m = new _.Mesh(s, u);
4348
+ }), m = new y.Mesh(s, u);
4044
4349
  m.userData = {
4045
4350
  id: i.id,
4046
4351
  attributes: i.attributes
4047
4352
  };
4048
- const d = new _.EdgesGeometry(s, 15), f = new _.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), h = new _.LineSegments(d, f);
4353
+ const d = new y.EdgesGeometry(s, 15), f = new y.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), h = new y.LineSegments(d, f);
4049
4354
  h.visible = !1, m.add(h), o.add(m);
4050
4355
  }), e.add(o), o;
4051
4356
  }
4052
4357
  export {
4053
- fr as ASSAY_COLOR_PALETTE_10,
4054
- hn as ASSAY_NON_VALUE_FIELDS,
4055
- X as AZIMUTH,
4056
- qn as BASELODE_COLORWAY,
4057
- T as BASELODE_DARK,
4058
- Ni as BASELODE_DARK_TEMPLATE,
4059
- _i as BASELODE_DARK_TEMPLATE_NAME,
4060
- To as BASELODE_DATA_MODEL_DRILL_ASSAY,
4061
- Fo as BASELODE_DATA_MODEL_DRILL_COLLAR,
4062
- mn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
4063
- wo as BASELODE_DATA_MODEL_DRILL_SURVEY,
4064
- $o as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
4065
- B as BASELODE_LIGHT,
4066
- yi as BASELODE_LIGHT_TEMPLATE,
4067
- gi as BASELODE_LIGHT_TEMPLATE_NAME,
4358
+ Mr as ASSAY_COLOR_PALETTE_10,
4359
+ _n as ASSAY_NON_VALUE_FIELDS,
4360
+ q as AZIMUTH,
4361
+ nr as BASELODE_COLORWAY,
4362
+ $ as BASELODE_DARK,
4363
+ Bi as BASELODE_DARK_TEMPLATE,
4364
+ Ri as BASELODE_DARK_TEMPLATE_NAME,
4365
+ Qo as BASELODE_DATA_MODEL_DRILL_ASSAY,
4366
+ Ko as BASELODE_DATA_MODEL_DRILL_COLLAR,
4367
+ gn as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
4368
+ Jo as BASELODE_DATA_MODEL_DRILL_SURVEY,
4369
+ ti as BASELODE_DATA_MODEL_GEOPHYSICS,
4370
+ ei as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
4371
+ V as BASELODE_LIGHT,
4372
+ $i as BASELODE_LIGHT_TEMPLATE,
4373
+ Ti as BASELODE_LIGHT_TEMPLATE_NAME,
4068
4374
  Oe as BASELODE_TEMPLATE,
4069
- Xn as BASELODE_TEMPLATE_NAME,
4070
- Wt as BASE_PIXELS_PER_METRE,
4375
+ tr as BASELODE_TEMPLATE_NAME,
4376
+ tn as BASE_PIXELS_PER_METRE,
4071
4377
  Xe as BUILTIN_COLOUR_MAPS,
4072
- Li as Baselode3DControls,
4073
- Di as Baselode3DScene,
4074
- Pi as BlockModelWidget,
4075
- at as CHART_OPTIONS,
4076
- zn as COMMENT_COLUMN_NAMES,
4378
+ es as Baselode3DControls,
4379
+ Qi as Baselode3DScene,
4380
+ ts as BlockModelWidget,
4381
+ ct as CHART_OPTIONS,
4382
+ An as COMMENT_COLUMN_NAMES,
4077
4383
  Be as COMMODITY_COLOURS,
4078
- Et as CRS,
4079
- vo as CorePhotoTable,
4080
- wi as CorePhotoViewer,
4081
- fn as DEFAULT_COLUMN_MAP,
4082
- ho as DEFAULT_LOD_BREAKPOINTS,
4083
- W as DEPTH,
4084
- q as DIP,
4085
- Le as DISPLAY_CATEGORICAL,
4086
- ke as DISPLAY_COMMENT,
4384
+ kt as CRS,
4385
+ Ro as CorePhotoTable,
4386
+ rs as CorePhotoViewer,
4387
+ yn as DEFAULT_COLUMN_MAP,
4388
+ So as DEFAULT_LOD_BREAKPOINTS,
4389
+ X as DEPTH,
4390
+ W as DIP,
4391
+ Ce as DISPLAY_CATEGORICAL,
4392
+ Ae as DISPLAY_COMMENT,
4087
4393
  $e as DISPLAY_HIDDEN,
4088
- Ae as DISPLAY_NUMERIC,
4394
+ Ie as DISPLAY_NUMERIC,
4089
4395
  Je as DISPLAY_TADPOLE,
4090
- pe as EASTING,
4091
- xe as ELEVATION,
4092
- nr as ERROR_COLOR,
4093
- Zn as FALLBACK_COLOUR,
4094
- jr as FOV_MAX_DEG,
4095
- Hr as FOV_MIN_DEG,
4396
+ be as EASTING,
4397
+ ke as ELEVATION,
4398
+ ur as ERROR_COLOR,
4399
+ rr as FALLBACK_COLOUR,
4400
+ Kr as FOV_MAX_DEG,
4401
+ Zr as FOV_MIN_DEG,
4096
4402
  F as FROM,
4097
4403
  ae as GEOLOGY_CODE,
4098
4404
  ce as GEOLOGY_DESCRIPTION,
4099
- ct as HIDDEN_COLUMNS,
4405
+ Ot as GEOPHYSICS_NULL_SENTINEL,
4406
+ ut as HIDDEN_COLUMNS,
4100
4407
  k as HOLE_ID,
4101
4408
  oe as LATITUDE,
4102
- Wn as LITHOLOGY_COLOURS,
4409
+ or as LITHOLOGY_COLOURS,
4103
4410
  ie as LONGITUDE,
4104
- Ie as MID,
4105
- be as NORTHING,
4106
- Qn as NUMERIC_LINE_COLOR,
4107
- er as NUMERIC_MARKER_COLOR,
4411
+ ye as MID,
4412
+ ge as NORTHING,
4413
+ lr as NUMERIC_LINE_COLOR,
4414
+ ar as NUMERIC_MARKER_COLOR,
4108
4415
  me as PROJECT_ID,
4109
- dn as STRIKE,
4110
- $ as TO,
4111
- Ei as TracePlot,
4112
- $i as addGradeBlocksToScene,
4113
- Ir as addRasterOverlay,
4114
- Un as alphaBetaToNormal,
4115
- Ci as annotationsFromIntervals,
4116
- li as assembleDataset,
4117
- Jo as attachAssayPositions,
4118
- Wo as balancedTangentialDesurvey,
4119
- kn as buildAssayState,
4120
- Mi as buildCategoricalStripLogConfig,
4121
- ur as buildCommentsConfig,
4122
- yo as buildDepthMarkers,
4123
- hr as buildEqualRangeColorScale,
4124
- ir as buildIntervalPoints,
4125
- Tt as buildPlotConfig,
4126
- vi as buildStrikeDipSymbol,
4127
- zr as buildStructuralDiscs,
4128
- zi as buildStructuralStripConfig,
4129
- cr as buildTadpoleConfig,
4130
- Ko as buildTraces,
4131
- No as buildTrayPhotos,
4132
- st as buildViewSignature,
4133
- di as calculateBlockVolume,
4134
- wn as calculatePropertyStats,
4135
- vn as classifyColumns,
4136
- Pr as clearRasterOverlays,
4137
- si as coerceNumeric,
4138
- Yn as computeStructuralPositions,
4139
- Si as createRasterOverlay,
4140
- Uo as defaultChartType,
4141
- Kt as defaultTrayFilename,
4142
- Fi as depthIntervalToPixels,
4143
- _o as depthMarkerInterval,
4416
+ bn as STRIKE,
4417
+ ho as STRIP_LOG_DEFAULT_COLOR,
4418
+ fo as STRIP_LOG_DEFAULT_LATERAL_OFFSET,
4419
+ mo as STRIP_LOG_DEFAULT_PANEL_WIDTH,
4420
+ T as TO,
4421
+ Gi as TracePlot,
4422
+ is as addGradeBlocksToScene,
4423
+ Pr as addRasterOverlay,
4424
+ Qn as alphaBetaToNormal,
4425
+ Zi as annotationsFromIntervals,
4426
+ Ei as assembleDataset,
4427
+ pi as attachAssayPositions,
4428
+ fi as balancedTangentialDesurvey,
4429
+ Ln as buildAssayState,
4430
+ Vi as buildCategoricalStripLogConfig,
4431
+ yr as buildCommentsConfig,
4432
+ wo as buildDepthMarkers,
4433
+ vr as buildEqualRangeColorScale,
4434
+ fr as buildIntervalPoints,
4435
+ Ht as buildPlotConfig,
4436
+ ji as buildStrikeDipSymbol,
4437
+ yo as buildStripLogGroup,
4438
+ bo as buildStripLogLinePoints,
4439
+ Sr as buildStructuralDiscs,
4440
+ Hi as buildStructuralStripConfig,
4441
+ gr as buildTadpoleConfig,
4442
+ hi as buildTraces,
4443
+ Po as buildTrayPhotos,
4444
+ lt as buildViewSignature,
4445
+ Ii as calculateBlockVolume,
4446
+ Vn as calculatePropertyStats,
4447
+ In as classifyColumns,
4448
+ Hr as clearRasterOverlays,
4449
+ et as clearStripLogs,
4450
+ zi as coerceNumeric,
4451
+ er as computeStructuralPositions,
4452
+ Ki as createRasterOverlay,
4453
+ ai as defaultChartType,
4454
+ nn as defaultTrayFilename,
4455
+ ns as depthIntervalToPixels,
4456
+ Fo as depthMarkerInterval,
4144
4457
  Re as deriveAssayProps,
4145
- qo as desurveyTraces,
4146
- Mr as dipAzimuthToNormal,
4147
- Br as dolly,
4148
- wr as emitViewChangeIfNeeded,
4149
- Tn as filterBlocks,
4150
- ii as filterByProject,
4151
- lt as fitCameraToBounds,
4152
- Vr as focusOnLastBounds,
4153
- ui as getBlockStats,
4154
- qr as getCategoryHexColor,
4155
- et as getChartOptions,
4156
- $n as getColorForValue,
4157
- Kn as getColour,
4158
- Vt as getEqualRangeBinIndex,
4159
- br as getEqualRangeColor,
4160
- Dr as getRasterOverlay,
4161
- Ut as getViewState,
4162
- Eo as gradeBlockToThreeGeometry,
4163
- go as groupPhotosBySet,
4164
- Bn as groupRowsByHole,
4165
- or as holeHasData,
4166
- Gn as interpolateTrace,
4167
- Oi as intervalsAsTubes,
4168
- oi as joinAssaysToTraces,
4169
- Lr as listRasterOverlays,
4170
- Yo as loadAssayFile,
4171
- xn as loadAssayHole,
4172
- En as loadAssayMetadata,
4173
- ni as loadAssays,
4174
- ci as loadBlockModelMetadata,
4175
- ei as loadCollars,
4176
- ri as loadGeology,
4177
- Ti as loadGradeBlocksFromJson,
4178
- ti as loadSurveys,
4458
+ di as desurveyTraces,
4459
+ Or as dipAzimuthToNormal,
4460
+ qr as dolly,
4461
+ Gr as emitViewChangeIfNeeded,
4462
+ Hn as filterBlocks,
4463
+ vi as filterByProject,
4464
+ at as fitCameraToBounds,
4465
+ Wr as focusOnLastBounds,
4466
+ Fi as geophysicsToStripLogs,
4467
+ Ai as getBlockStats,
4468
+ no as getCategoryHexColor,
4469
+ tt as getChartOptions,
4470
+ jn as getColorForValue,
4471
+ ir as getColour,
4472
+ Yt as getEqualRangeBinIndex,
4473
+ Er as getEqualRangeColor,
4474
+ Ji as getHoleVerticalExtent,
4475
+ Br as getRasterOverlay,
4476
+ Zt as getViewState,
4477
+ Bo as gradeBlockToThreeGeometry,
4478
+ Co as groupPhotosBySet,
4479
+ Un as groupRowsByHole,
4480
+ mr as holeHasData,
4481
+ Jn as interpolateTrace,
4482
+ Wi as intervalsAsTubes,
4483
+ Mi as joinAssaysToTraces,
4484
+ Vr as listRasterOverlays,
4485
+ ci as loadAssayFile,
4486
+ Sn as loadAssayHole,
4487
+ On as loadAssayMetadata,
4488
+ _i as loadAssays,
4489
+ ki as loadBlockModelMetadata,
4490
+ gi as loadCollars,
4491
+ Ni as loadGeology,
4492
+ os as loadGradeBlocksFromJson,
4493
+ yi as loadSurveys,
4179
4494
  je as loadTable,
4180
- Vo as logDataInfo,
4181
- Bo as logDataWarning,
4182
- $r as lookDown,
4183
- On as minimumCurvatureDesurvey,
4184
- Fn as normalizeBlockRow,
4185
- kr as normalizeBounds,
4186
- jo as normalizeCsvRow,
4187
- we as normalizeFieldName,
4188
- Rr as pan,
4189
- Hn as parseAssayCsvTextToHoles,
4190
- _n as parseAssayHole,
4191
- Ho as parseAssayHoleIds,
4192
- yn as parseAssayHoleIdsWithAssays,
4193
- Nn as parseAssaysCSV,
4194
- ai as parseBlockModelCSV,
4195
- Qo as parseDrillholesCSV,
4196
- jn as parseGeologyCsvText,
4197
- Vn as parseStructuralCSV,
4198
- hi as parseStructuralIntervalsCSV,
4199
- fi as parseStructuralPointsCSV,
4200
- Xo as parseSurveyCSV,
4201
- pi as parseUnifiedDataset,
4202
- Go as pickFirstPresent,
4203
- ki as planView,
4204
- gr as projectTraceToSection,
4205
- Tr as recenterCameraToOrigin,
4206
- it as removeRasterOverlay,
4495
+ oi as logDataInfo,
4496
+ ri as logDataWarning,
4497
+ Yr as lookDown,
4498
+ wn as minimumCurvatureDesurvey,
4499
+ Bn as normalizeBlockRow,
4500
+ wr as normalizeBounds,
4501
+ si as normalizeCsvRow,
4502
+ Pe as normalizeFieldName,
4503
+ po as normalizeStripLogOptions,
4504
+ Xr as pan,
4505
+ Xn as parseAssayCsvTextToHoles,
4506
+ En as parseAssayHole,
4507
+ ii as parseAssayHoleIds,
4508
+ zn as parseAssayHoleIdsWithAssays,
4509
+ xn as parseAssaysCSV,
4510
+ xi as parseBlockModelCSV,
4511
+ bi as parseDrillholesCSV,
4512
+ qn as parseGeologyCsvText,
4513
+ wi as parseGeophysicsCSV,
4514
+ Pi as parseLasFile,
4515
+ Yn as parseStructuralCSV,
4516
+ Li as parseStructuralIntervalsCSV,
4517
+ Si as parseStructuralPointsCSV,
4518
+ ui as parseSurveyCSV,
4519
+ Di as parseUnifiedDataset,
4520
+ li as pickFirstPresent,
4521
+ Yi as planView,
4522
+ xr as projectTraceToSection,
4523
+ Ur as recenterCameraToOrigin,
4524
+ st as removeRasterOverlay,
4207
4525
  Ct as reorderHoleIds,
4208
- Jn as resolveColourMap,
4209
- Ai as sectionView,
4210
- yr as sectionWindow,
4211
- po as selectPhotoLodUrl,
4212
- Ur as setControlMode,
4213
- Gr as setFov,
4214
- Sr as setRasterOverlayElevation,
4215
- Or as setRasterOverlayOpacity,
4216
- Cr as setRasterOverlayVisibility,
4217
- Fr as setViewState,
4218
- bi as significantIntercepts,
4219
- bo as sortPhotosByDepth,
4220
- ge as standardizeColumns,
4221
- Ro as standardizeRowArray,
4222
- Zo as tangentialDesurvey,
4223
- pn as toError,
4224
- Ii as tracesAsSegments,
4225
- xi as useDrillholeTraceGrid,
4226
- mi as validateStructuralPoints,
4526
+ sr as resolveColourMap,
4527
+ Xi as sectionView,
4528
+ kr as sectionWindow,
4529
+ Lo as selectPhotoLodUrl,
4530
+ Qr as setControlMode,
4531
+ Jr as setFov,
4532
+ Rr as setRasterOverlayElevation,
4533
+ Tr as setRasterOverlayOpacity,
4534
+ $r as setRasterOverlayVisibility,
4535
+ _o as setStripLogs,
4536
+ jr as setViewState,
4537
+ Ci as significantIntercepts,
4538
+ Do as sortPhotosByDepth,
4539
+ fe as standardizeColumns,
4540
+ ni as standardizeRowArray,
4541
+ mi as tangentialDesurvey,
4542
+ Nn as toError,
4543
+ qi as tracesAsSegments,
4544
+ Ui as useDrillholeTraceGrid,
4545
+ Oi as validateStructuralPoints,
4227
4546
  Y as withDataErrorContext
4228
4547
  };
4229
4548
  //# sourceMappingURL=baselode.js.map