baselode 0.1.20 → 0.1.21

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,33 +1,33 @@
1
- import { _ as gt, w as k, H as _, P as de, F as C, T as M, c as bt, L as se, a as re, D as G, A as j, b as Y, E as pe, N as ye, d as ve, M as Ee, G as le, e as ce, B as _t, f as Qe, g as $e, h as Pe, i as Be, j as Nt, k as et, l as Et, m as Ge, n as At, o as vt } from "./baselode3dScene-qMfVRKxK.js";
2
- import { p as us, q as ds, r as ms, s as fs, t as hs, u as ps, v as ys, x as gs, y as bs, z as _s, C as Ns, I as Es, J as As, K as vs, O as Is, Q as Ss, R as Ls, S as Cs, U as Ts, V as Ms, W as Os, X as Ps, Y as Ds, Z as xs, $ as Rs, a0 as zs, a1 as Fs, a2 as $s, a3 as ks, a4 as ws, a5 as Hs, a6 as Us, a7 as Bs, a8 as Gs, a9 as Vs, aa as js, ab as Ys, ac as Ws, ad as qs, ae as Ks, af as Xs, ag as Zs, ah as Js, ai as Qs, aj as er, ak as tr, al as nr, am as sr, an as rr, ao as or, ap as ir, aq as ar, ar as lr, as as cr, at as ur, au as dr, av as mr, aw as fr, ax as hr, ay as pr, az as yr, aA as gr, aB as br, aC as _r, aD as Nr, aE as Er, aF as Ar, aG as vr, aH as Ir, aI as Sr, aJ as Lr, aK as Cr, aL as Tr, aM as Mr, aN as Or, aO as Pr, aP as Dr, aQ as xr, aR as Rr, aS as zr, aT as Fr, aU as $r, aV as kr, aW as wr, aX as Hr, aY as Ur, aZ as Br, a_ as Gr, a$ as Vr, b0 as jr, b1 as Yr, b2 as Wr, b3 as qr, b4 as Kr, b5 as Xr, b6 as Zr, b7 as Jr, b8 as Qr, b9 as eo, ba as to, bb as no, bc as so, bd as ro, be as oo, bf as io, bg as ao } from "./baselode3dScene-qMfVRKxK.js";
1
+ import { _ as Nt, w as G, H as N, P as de, F as L, T as M, c as vt, L as re, a as oe, D as j, A as Y, b as W, E as he, N as ge, d as Ae, M as ve, G as le, e as ce, B as Et, f as et, g as ke, h as ze, i as tt, j as Ue, k as At, l as nt, m as St, n as Tt, o as It } from "./baselode3dScene-CLEvddGM.js";
2
+ import { p as Nr, q as vr, r as Er, s as Ar, t as Sr, u as Tr, v as Ir, x as Cr, y as Lr, z as Mr, C as Pr, I as Or, J as xr, K as Dr, O as Rr, Q as zr, R as $r, S as kr, U as Fr, V as wr, W as Hr, X as Gr, Y as Ur, Z as Br, $ as Vr, a0 as jr, a1 as Yr, a2 as Wr, a3 as qr, a4 as Xr, a5 as Kr, a6 as Zr, a7 as Jr, a8 as Qr, a9 as eo, aa as to, ab as no, ac as ro, ad as oo, ae as so, af as io, ag as ao, ah as lo, ai as co, aj as uo, ak as mo, al as fo, am as po, an as ho, ao as go, ap as yo, aq as bo, ar as _o, as as No, at as vo, au as Eo, av as Ao, aw as So, ax as To, ay as Io, az as Co, aA as Lo, aB as Mo, aC as Po, aD as Oo, aE as xo, aF as Do, aG as Ro, aH as zo, aI as $o, aJ as ko, aK as Fo, aL as wo, aM as Ho, aN as Go, aO as Uo, aP as Bo, aQ as Vo, aR as jo, aS as Yo, aT as Wo, aU as qo, aV as Xo, aW as Ko, aX as Zo, aY as Jo, aZ as Qo, a_ as es, a$ as ts, b0 as ns, b1 as rs, b2 as os, b3 as ss, b4 as is, b5 as as, b6 as ls, b7 as cs, b8 as us, b9 as ds, ba as ms, bb as fs, bc as ps, bd as hs, be as gs, bf as ys, bg as bs } from "./baselode3dScene-CLEvddGM.js";
3
3
  import J from "papaparse";
4
- import { jsx as S, jsxs as W } from "react/jsx-runtime";
5
- import { useRef as _e, useState as X, useEffect as ne, useMemo as ee, useCallback as De } from "react";
6
- import Ae from "plotly.js-dist-min";
4
+ import { jsxs as H, jsx as E, Fragment as Ct } from "react/jsx-runtime";
5
+ import { useRef as _e, useState as K, useEffect as ne, useMemo as ee, useCallback as Oe } from "react";
6
+ import Ee from "plotly.js-dist-min";
7
7
  import * as Q from "three";
8
- function Ie(e) {
8
+ function Se(e) {
9
9
  return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
10
10
  }
11
11
  function ie(e, n = null, t = null) {
12
- const s = { ...gt };
12
+ const r = { ...Nt };
13
13
  if (t) {
14
- for (const [i, o] of Object.entries(t))
15
- if (i != null && o != null) {
16
- const a = Ie(i), l = Ie(o);
17
- s[a] = l;
14
+ for (const [i, s] of Object.entries(t))
15
+ if (i != null && s != null) {
16
+ const a = Se(i), l = Se(s);
17
+ r[a] = l;
18
18
  }
19
19
  }
20
- const r = {};
21
- for (const [i, o] of Object.entries(e)) {
22
- const a = Ie(i), l = s[a] || a;
23
- r[l] = o;
20
+ const o = {};
21
+ for (const [i, s] of Object.entries(e)) {
22
+ const a = Se(i), l = r[a] || a;
23
+ o[l] = s;
24
24
  }
25
- return r;
25
+ return o;
26
26
  }
27
- function _n(e, n = null, t = null) {
28
- return e.map((s) => ie(s, n, t));
27
+ function Mn(e, n = null, t = null) {
28
+ return e.map((r) => ie(r, n, t));
29
29
  }
30
- const It = /* @__PURE__ */ new Set([
30
+ const Lt = /* @__PURE__ */ new Set([
31
31
  "hole_id",
32
32
  "holeid",
33
33
  "id",
@@ -59,84 +59,84 @@ const It = /* @__PURE__ */ new Set([
59
59
  "todepth",
60
60
  "comment",
61
61
  "z"
62
- ]), Te = (e, n = null) => ie(e, null, n);
63
- function St(e) {
64
- return { holeId: e[_] };
65
- }
66
- function tt(e, n = null) {
67
- const t = e[_], s = t !== void 0 ? `${t}`.trim() : "";
68
- if (!s) return null;
69
- const r = e[de] || e.project || e.project_code, i = Number(e[C]), o = Number(e[M]);
70
- return !Number.isFinite(i) || !Number.isFinite(o) || o <= i ? null : {
71
- holeId: s,
72
- project: r,
62
+ ]), Le = (e, n = null) => ie(e, null, n);
63
+ function Mt(e) {
64
+ return { holeId: e[N] };
65
+ }
66
+ function rt(e, n = null) {
67
+ const t = e[N], r = t !== void 0 ? `${t}`.trim() : "";
68
+ if (!r) return null;
69
+ const o = e[de] || e.project || e.project_code, i = Number(e[L]), s = Number(e[M]);
70
+ return !Number.isFinite(i) || !Number.isFinite(s) || s <= i ? null : {
71
+ holeId: r,
72
+ project: o,
73
73
  from: i,
74
- to: o,
74
+ to: s,
75
75
  ...e
76
76
  };
77
77
  }
78
- function nt(e, n) {
79
- var r;
80
- const t = n.sort((i, o) => i.from - o.from), s = [];
78
+ function ot(e, n) {
79
+ var o;
80
+ const t = n.sort((i, s) => i.from - s.from), r = [];
81
81
  return t.forEach((i) => {
82
- const { from: o, to: a, project: l, ...u } = i, c = {
83
- z: o,
84
- from: o,
82
+ const { from: s, to: a, project: l, ...u } = i, c = {
83
+ z: s,
84
+ from: s,
85
85
  to: a,
86
- [_]: e,
86
+ [N]: e,
87
87
  [de]: l,
88
88
  ...u
89
89
  };
90
- s.push(c), s.push({ ...c, z: a });
91
- }), { id: e, project: (r = t[0]) == null ? void 0 : r.project, points: s };
90
+ r.push(c), r.push({ ...c, z: a });
91
+ }), { id: e, project: (o = t[0]) == null ? void 0 : o.project, points: r };
92
92
  }
93
- function Nn(e, n = null) {
94
- return new Promise((t, s) => {
95
- const r = /* @__PURE__ */ new Set();
93
+ function Pn(e, n = null) {
94
+ return new Promise((t, r) => {
95
+ const o = /* @__PURE__ */ new Set();
96
96
  J.parse(e, {
97
97
  header: !0,
98
98
  dynamicTyping: !0,
99
99
  skipEmptyLines: !0,
100
100
  step: (i) => {
101
- const a = Te(i.data, n)[_];
102
- a !== void 0 && `${a}`.trim() !== "" && r.add(`${a}`.trim());
101
+ const a = Le(i.data, n)[N];
102
+ a !== void 0 && `${a}`.trim() !== "" && o.add(`${a}`.trim());
103
103
  },
104
- complete: () => t(Array.from(r)),
105
- error: (i) => s(k("parseAssayHoleIds", i))
104
+ complete: () => t(Array.from(o)),
105
+ error: (i) => r(G("parseAssayHoleIds", i))
106
106
  });
107
107
  });
108
108
  }
109
- function Lt(e) {
110
- return Object.entries(e || {}).some(([n, t]) => !(It.has(n) || t == null || typeof t == "string" && t.trim() === ""));
109
+ function Pt(e) {
110
+ return Object.entries(e || {}).some(([n, t]) => !(Lt.has(n) || t == null || typeof t == "string" && t.trim() === ""));
111
111
  }
112
- function Ct(e, n = null) {
113
- return new Promise((t, s) => {
114
- const r = /* @__PURE__ */ new Map();
112
+ function Ot(e, n = null) {
113
+ return new Promise((t, r) => {
114
+ const o = /* @__PURE__ */ new Map();
115
115
  J.parse(e, {
116
116
  header: !0,
117
117
  dynamicTyping: !0,
118
118
  skipEmptyLines: !0,
119
119
  step: (i) => {
120
- const o = Te(i.data, n);
121
- if (!Lt(o)) return;
122
- const l = St(o).holeId;
120
+ const s = Le(i.data, n);
121
+ if (!Pt(s)) return;
122
+ const l = Mt(s).holeId;
123
123
  if (l !== void 0 && `${l}`.trim() !== "") {
124
124
  const u = `${l}`.trim();
125
- r.has(u) || r.set(u, {
125
+ o.has(u) || o.set(u, {
126
126
  holeId: u
127
127
  });
128
128
  }
129
129
  },
130
- complete: () => t(Array.from(r.values())),
131
- error: (i) => s(k("parseAssayHoleIdsWithAssays", i))
130
+ complete: () => t(Array.from(o.values())),
131
+ error: (i) => r(G("parseAssayHoleIdsWithAssays", i))
132
132
  });
133
133
  });
134
134
  }
135
- function Tt(e, n, t = null, s = null) {
136
- return new Promise((r, i) => {
137
- const o = `${n}`.trim();
138
- if (!o) {
139
- i(k("parseAssayHole", new Error("Missing hole id")));
135
+ function xt(e, n, t = null, r = null) {
136
+ return new Promise((o, i) => {
137
+ const s = `${n}`.trim();
138
+ if (!s) {
139
+ i(G("parseAssayHole", new Error("Missing hole id")));
140
140
  return;
141
141
  }
142
142
  const a = [];
@@ -145,421 +145,421 @@ function Tt(e, n, t = null, s = null) {
145
145
  dynamicTyping: !0,
146
146
  skipEmptyLines: !0,
147
147
  step: (l) => {
148
- const u = Te(l.data, s), c = tt(u, s);
149
- c && `${c.holeId}`.trim() === o && a.push(c);
148
+ const u = Le(l.data, r), c = rt(u, r);
149
+ c && `${c.holeId}`.trim() === s && a.push(c);
150
150
  },
151
151
  complete: () => {
152
152
  if (!a.length) {
153
- r(null);
153
+ o(null);
154
154
  return;
155
155
  }
156
- const l = nt(o, a);
157
- r(l);
156
+ const l = ot(s, a);
157
+ o(l);
158
158
  },
159
- error: (l) => i(k("parseAssayHole", l))
159
+ error: (l) => i(G("parseAssayHole", l))
160
160
  });
161
161
  });
162
162
  }
163
- function Mt(e, n = null, t = null) {
164
- return new Promise((s, r) => {
163
+ function Dt(e, n = null, t = null) {
164
+ return new Promise((r, o) => {
165
165
  J.parse(e, {
166
166
  header: !0,
167
167
  dynamicTyping: !0,
168
168
  skipEmptyLines: !0,
169
169
  complete: (i) => {
170
- const o = /* @__PURE__ */ new Map();
170
+ const s = /* @__PURE__ */ new Map();
171
171
  i.data.forEach((l) => {
172
- const u = Te(l, t), c = tt(u, t);
173
- c && (o.has(c.holeId) || o.set(c.holeId, []), o.get(c.holeId).push(c));
172
+ const u = Le(l, t), c = rt(u, t);
173
+ c && (s.has(c.holeId) || s.set(c.holeId, []), s.get(c.holeId).push(c));
174
174
  });
175
- const a = Array.from(o.entries()).map(([l, u]) => nt(l, u));
176
- s({ holes: a });
175
+ const a = Array.from(s.entries()).map(([l, u]) => ot(l, u));
176
+ r({ holes: a });
177
177
  },
178
- error: (i) => r(k("parseAssaysCSV", i))
178
+ error: (i) => o(G("parseAssaysCSV", i))
179
179
  });
180
180
  });
181
181
  }
182
- function En(e = {}) {
182
+ function On(e = {}) {
183
183
  const n = {};
184
- return Object.entries(e || {}).forEach(([t, s]) => {
185
- t && (n[Ie(t)] = s);
184
+ return Object.entries(e || {}).forEach(([t, r]) => {
185
+ t && (n[Se(t)] = r);
186
186
  }), n;
187
187
  }
188
- function An(e = {}, n = [], t) {
189
- for (const s of n) {
190
- const r = e[s];
191
- if (r != null && `${r}`.trim() !== "")
192
- return r;
188
+ function xn(e = {}, n = [], t) {
189
+ for (const r of n) {
190
+ const o = e[r];
191
+ if (o != null && `${o}`.trim() !== "")
192
+ return o;
193
193
  }
194
194
  return t;
195
195
  }
196
- const Ot = 4;
196
+ const Rt = 4;
197
197
  function st(e = [], n = "") {
198
198
  if (!e.length) return [];
199
199
  if (!n) return e;
200
200
  const t = e.findIndex((i) => i === n);
201
201
  if (t === -1) return e;
202
- const s = e[t], r = e.filter((i, o) => o !== t);
203
- return [s, ...r];
202
+ const r = e[t], o = e.filter((i, s) => s !== t);
203
+ return [r, ...o];
204
204
  }
205
- function Se({
205
+ function Te({
206
206
  property: e = "",
207
207
  chartType: n = "",
208
208
  categoricalProps: t = [],
209
- commentProps: s = [],
210
- numericDefaultChartType: r = "markers+line"
209
+ commentProps: r = [],
210
+ numericDefaultChartType: o = "markers+line"
211
211
  } = {}) {
212
- return e ? s.includes(e) ? "comment" : t.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !n || n === "categorical" || n === "comment" || n === "tadpole" ? r : n : n || r;
212
+ return e ? r.includes(e) ? "comment" : t.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !n || n === "categorical" || n === "comment" || n === "tadpole" ? o : n : n || o;
213
213
  }
214
- function rt({
214
+ function it({
215
215
  holeIds: e = [],
216
216
  focusedHoleId: n = "",
217
- plotCount: t = Ot,
218
- defaultProp: s = "",
219
- categoricalProps: r = [],
217
+ plotCount: t = Rt,
218
+ defaultProp: r = "",
219
+ categoricalProps: o = [],
220
220
  commentProps: i = [],
221
- numericDefaultChartType: o = "markers+line"
221
+ numericDefaultChartType: s = "markers+line"
222
222
  } = {}) {
223
223
  const a = st(e, n);
224
224
  return Array.from({ length: t }).map((l, u) => {
225
- const c = a[u] || e[u] || "", m = Se({
226
- property: s,
225
+ const c = a[u] || e[u] || "", d = Te({
226
+ property: r,
227
227
  chartType: "",
228
- categoricalProps: r,
228
+ categoricalProps: o,
229
229
  commentProps: i,
230
- numericDefaultChartType: o
230
+ numericDefaultChartType: s
231
231
  });
232
232
  return {
233
233
  holeId: c,
234
- property: s,
235
- chartType: m
234
+ property: r,
235
+ chartType: d
236
236
  };
237
237
  });
238
238
  }
239
- function Le(e = []) {
240
- const n = e.flatMap((a) => a.points || []), { numericCols: t, categoricalCols: s, commentCols: r, byType: i } = bt(n), o = t[0] || s[0] || "";
239
+ function Ie(e = []) {
240
+ const n = e.flatMap((a) => a.points || []), { numericCols: t, categoricalCols: r, commentCols: o, byType: i } = vt(n), s = t[0] || r[0] || "";
241
241
  return {
242
242
  numericProps: t,
243
- categoricalProps: s,
244
- commentProps: r,
243
+ categoricalProps: r,
244
+ commentProps: o,
245
245
  columnMeta: i,
246
- defaultProp: o
246
+ defaultProp: s
247
247
  };
248
248
  }
249
- async function Pt(e, n = null) {
250
- return await Ct(e);
249
+ async function zt(e, n = null) {
250
+ return await Ot(e);
251
251
  }
252
- async function Dt(e, n, t = null) {
253
- return await Tt(e, n);
252
+ async function $t(e, n, t = null) {
253
+ return await xt(e, n);
254
254
  }
255
- function xt(e = [], n = "") {
255
+ function kt(e = [], n = "") {
256
256
  if (!e.length) return null;
257
- const { numericProps: t, categoricalProps: s, commentProps: r, columnMeta: i, defaultProp: o } = Le(e), a = e.map((u) => u.id || u.holeId).filter(Boolean), l = rt({
257
+ const { numericProps: t, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Ie(e), a = e.map((u) => u.id || u.holeId).filter(Boolean), l = it({
258
258
  holeIds: a,
259
259
  focusedHoleId: n,
260
260
  plotCount: 4,
261
- defaultProp: o,
262
- categoricalProps: s,
263
- commentProps: r,
261
+ defaultProp: s,
262
+ categoricalProps: r,
263
+ commentProps: o,
264
264
  numericDefaultChartType: "line"
265
265
  });
266
266
  return {
267
267
  holes: e,
268
268
  numericProps: t,
269
- categoricalProps: s,
270
- commentProps: r,
269
+ categoricalProps: r,
270
+ commentProps: o,
271
271
  columnMeta: i,
272
- defaultProp: o,
272
+ defaultProp: s,
273
273
  traceConfigs: l
274
274
  };
275
275
  }
276
- async function vn(e, n = "", t = null) {
277
- const { holes: s } = await Mt(e, t), r = xt(s, n);
278
- if (!r) throw new Error("No valid assay intervals found.");
279
- return r;
276
+ async function Dn(e, n = "", t = null) {
277
+ const { holes: r } = await Dt(e, t), o = kt(r, n);
278
+ if (!o) throw new Error("No valid assay intervals found.");
279
+ return o;
280
280
  }
281
- function In(e, n = null) {
282
- return new Promise((t, s) => {
281
+ function Rn(e, n = null) {
282
+ return new Promise((t, r) => {
283
283
  J.parse(e, {
284
284
  header: !0,
285
285
  dynamicTyping: !0,
286
286
  skipEmptyLines: !0,
287
- complete: (r) => {
288
- const i = r.data.map((o) => Rt(o, n)).filter((o) => o[_] && Number.isFinite(o[G]) && Number.isFinite(o[Y]) && Number.isFinite(o[j]));
287
+ complete: (o) => {
288
+ const i = o.data.map((s) => Ft(s, n)).filter((s) => s[N] && Number.isFinite(s[j]) && Number.isFinite(s[W]) && Number.isFinite(s[Y]));
289
289
  t(i);
290
290
  },
291
- error: (r) => s(k("parseSurveyCSV", r))
291
+ error: (o) => r(G("parseSurveyCSV", o))
292
292
  });
293
293
  });
294
294
  }
295
- function Rt(e, n = null) {
296
- const t = ie(e, null, n), s = t[_], r = t[de] || t.project || t.project_code, i = he(t[se]), o = he(t[re]), a = he(t[G]), l = he(t[Y]), u = he(t[j]), c = he(t.maxdepth);
295
+ function Ft(e, n = null) {
296
+ const t = ie(e, null, n), r = t[N], o = t[de] || t.project || t.project_code, i = pe(t[re]), s = pe(t[oe]), a = pe(t[j]), l = pe(t[W]), u = pe(t[Y]), c = pe(t.maxdepth);
297
297
  return {
298
298
  raw: t,
299
- [_]: s,
300
- [de]: r,
301
- [se]: i,
302
- [re]: o,
303
- [G]: a,
304
- [Y]: l,
305
- [j]: u,
299
+ [N]: r,
300
+ [de]: o,
301
+ [re]: i,
302
+ [oe]: s,
303
+ [j]: a,
304
+ [W]: l,
305
+ [Y]: u,
306
306
  maxdepth: c,
307
307
  // Legacy field names for backwards compatibility
308
- project_code: r,
308
+ project_code: o,
309
309
  latitude: i,
310
- longitude: o,
310
+ longitude: s,
311
311
  surveydepth: a
312
312
  };
313
313
  }
314
- const he = (e) => {
314
+ const pe = (e) => {
315
315
  const n = Number(e);
316
316
  return Number.isFinite(n) ? n : void 0;
317
317
  };
318
- function Sn(e, n) {
319
- var u, c, m, d;
318
+ function zn(e, n) {
319
+ var u, c, d, m;
320
320
  const t = /* @__PURE__ */ new Map();
321
321
  e.forEach((f) => {
322
- const g = (f[_] || f.holeId || f.id || "").toString().trim();
323
- if (!g) return;
324
- const y = g.toLowerCase();
325
- t.has(y) || t.set(y, f);
322
+ const y = (f[N] || f.holeId || f.id || "").toString().trim();
323
+ if (!y) return;
324
+ const h = y.toLowerCase();
325
+ t.has(h) || t.set(h, f);
326
326
  });
327
- const s = ((u = e[0]) == null ? void 0 : u.lat) ?? ((c = e[0]) == null ? void 0 : c[se]) ?? 0, r = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[re]) ?? 0, i = 111132, o = 111320 * Math.cos(s * Math.PI / 180), a = /* @__PURE__ */ new Map();
327
+ const r = ((u = e[0]) == null ? void 0 : u.lat) ?? ((c = e[0]) == null ? void 0 : c[re]) ?? 0, o = ((d = e[0]) == null ? void 0 : d.lng) ?? ((m = e[0]) == null ? void 0 : m[oe]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), a = /* @__PURE__ */ new Map();
328
328
  n.forEach((f) => {
329
- const g = (f[_] || "").toString().trim();
330
- if (!g) return;
331
- const y = g.toLowerCase();
332
- a.has(y) || a.set(y, []), a.get(y).push(f);
329
+ const y = (f[N] || "").toString().trim();
330
+ if (!y) return;
331
+ const h = y.toLowerCase();
332
+ a.has(h) || a.set(h, []), a.get(h).push(f);
333
333
  });
334
334
  const l = [];
335
- return a.forEach((f, g) => {
336
- const y = t.get(g);
337
- if (!y) return;
338
- const b = f.filter((I) => Number.isFinite(I[G] ?? I.surveydepth)).sort((I, z) => (I[G] ?? I.surveydepth) - (z[G] ?? z.surveydepth));
335
+ return a.forEach((f, y) => {
336
+ const h = t.get(y);
337
+ if (!h) return;
338
+ const b = f.filter((_) => Number.isFinite(_[j] ?? _.surveydepth)).sort((_, R) => (_[j] ?? _.surveydepth) - (R[j] ?? R.surveydepth));
339
339
  if (!b.length) return;
340
- const h = y.lat ?? y[se], E = y.lng ?? y[re], A = 111132, x = 111320 * Math.cos(h * Math.PI / 180), H = (E - r) * o, O = (h - s) * i, P = [];
341
- let R = 0, V = 0, p = 0;
342
- for (let I = 0; I < b.length; I += 1) {
343
- const z = b[I], w = b[I - 1], v = z[G] ?? z.surveydepth, N = z[j] ?? z.azimuth, D = z[Y] ?? z.dip;
344
- if (!w) {
345
- P.push({
346
- x: H + R,
347
- y: O + V,
340
+ const g = h.lat ?? h[re], A = h.lng ?? h[oe], P = 111132, U = 111320 * Math.cos(g * Math.PI / 180), $ = (A - o) * s, k = (g - r) * i, O = [];
341
+ let D = 0, S = 0, p = 0;
342
+ for (let _ = 0; _ < b.length; _ += 1) {
343
+ const R = b[_], x = b[_ - 1], T = R[j] ?? R.surveydepth, v = R[Y] ?? R.azimuth, z = R[W] ?? R.dip;
344
+ if (!x) {
345
+ O.push({
346
+ x: $ + D,
347
+ y: k + S,
348
348
  z: 0,
349
- md: v,
350
- azimuth: N,
351
- dip: D
349
+ md: T,
350
+ azimuth: v,
351
+ dip: z
352
352
  });
353
353
  continue;
354
354
  }
355
- const F = w[G] ?? w.surveydepth, L = w[j] ?? w.azimuth, U = w[Y] ?? w.dip, B = v - F;
356
- if (B <= 0) continue;
357
- const $ = Ve(U), q = Ve(D), K = Fe(L), ae = Fe(N), be = Math.acos(
358
- Math.sin($) * Math.sin(q) * Math.cos(K - ae) + Math.cos($) * Math.cos(q)
359
- ), me = be > 1e-6 ? 2 / be * Math.tan(be / 2) : 1, Oe = 0.5 * B * (Math.sin($) * Math.cos(K) + Math.sin(q) * Math.cos(ae)) * me, fe = 0.5 * B * (Math.sin($) * Math.sin(K) + Math.sin(q) * Math.sin(ae)) * me, yt = 0.5 * B * (Math.cos($) + Math.cos(q)) * me;
360
- R += Oe, V += fe, p += yt, P.push({
361
- x: H + R,
362
- y: O + V,
355
+ const F = x[j] ?? x.surveydepth, C = x[Y] ?? x.azimuth, B = x[W] ?? x.dip, V = T - F;
356
+ if (V <= 0) continue;
357
+ const w = Be(B), q = Be(z), X = $e(C), ae = $e(v), be = Math.acos(
358
+ Math.sin(w) * Math.sin(q) * Math.cos(X - ae) + Math.cos(w) * Math.cos(q)
359
+ ), me = be > 1e-6 ? 2 / be * Math.tan(be / 2) : 1, Pe = 0.5 * V * (Math.sin(w) * Math.cos(X) + Math.sin(q) * Math.cos(ae)) * me, fe = 0.5 * V * (Math.sin(w) * Math.sin(X) + Math.sin(q) * Math.sin(ae)) * me, _t = 0.5 * V * (Math.cos(w) + Math.cos(q)) * me;
360
+ D += Pe, S += fe, p += _t, O.push({
361
+ x: $ + D,
362
+ y: k + S,
363
363
  z: -p,
364
364
  // render with z up; depth down
365
- md: v,
366
- azimuth: N,
367
- dip: D
365
+ md: T,
366
+ azimuth: v,
367
+ dip: z
368
368
  });
369
369
  }
370
- const T = P.map((I) => ({
371
- ...I,
372
- lat: h + I.y / A,
373
- lng: E + I.x / x
370
+ const I = O.map((_) => ({
371
+ ..._,
372
+ lat: g + _.y / P,
373
+ lng: A + _.x / U
374
374
  }));
375
375
  l.push({
376
- id: y[_] || y.holeId || g,
377
- project: y[de] || y.project_id || y.project || "",
378
- points: T,
379
- collar: y
376
+ id: h[N] || h.holeId || y,
377
+ project: h[de] || h.project_id || h.project || "",
378
+ points: I,
379
+ collar: h
380
380
  });
381
381
  }), l;
382
382
  }
383
- const Fe = (e) => e * Math.PI / 180, Ve = (e) => {
384
- const n = Number(e), t = 90 + (Number.isFinite(n) ? n : 0), s = Math.min(180, Math.max(0, t));
385
- return Fe(s);
383
+ const $e = (e) => e * Math.PI / 180, Be = (e) => {
384
+ const n = Number(e), t = 90 + (Number.isFinite(n) ? n : 0), r = Math.min(180, Math.max(0, t));
385
+ return $e(r);
386
386
  };
387
387
  function te(e, n = void 0) {
388
388
  const t = Number(e);
389
389
  return Number.isFinite(t) ? t : n;
390
390
  }
391
- function je(e) {
391
+ function Ve(e) {
392
392
  return e == null ? "" : `${e}`.trim();
393
393
  }
394
394
  function Ce(e = [], n = null) {
395
- const t = n || "hole_id", r = [t, "hole_id", "holeId", "id"].find((i) => e.some((o) => je(o == null ? void 0 : o[i])));
396
- if (!r)
397
- throw k("canonicalizeHoleIdRows", new Error(`hole id column '${t}' not found`));
395
+ const t = n || "hole_id", o = [t, "hole_id", "holeId", "id"].find((i) => e.some((s) => Ve(s == null ? void 0 : s[i])));
396
+ if (!o)
397
+ throw G("canonicalizeHoleIdRows", new Error(`hole id column '${t}' not found`));
398
398
  return {
399
- aliasCol: r,
399
+ aliasCol: o,
400
400
  rows: e.map((i) => ({
401
401
  ...i,
402
- hole_id: je(i == null ? void 0 : i[r])
402
+ hole_id: Ve(i == null ? void 0 : i[o])
403
403
  }))
404
404
  };
405
405
  }
406
- function Ye(e) {
406
+ function je(e) {
407
407
  return Number(e) * Math.PI / 180;
408
408
  }
409
409
  function xe(e, n) {
410
- const t = Ye(e), s = Ye(n), r = Math.cos(s) * Math.sin(t), i = Math.cos(s) * Math.cos(t), o = Math.sin(s) * -1;
411
- return { ca: r, cb: i, cc: o };
410
+ const t = je(e), r = je(n), o = Math.cos(r) * Math.sin(t), i = Math.cos(r) * Math.cos(t), s = Math.sin(r) * -1;
411
+ return { ca: o, cb: i, cc: s };
412
412
  }
413
- function zt(e, n, t, s, r, i = "minimum_curvature") {
414
- const o = xe(n, t), a = xe(s, r);
413
+ function wt(e, n, t, r, o, i = "minimum_curvature") {
414
+ const s = xe(n, t), a = xe(r, o);
415
415
  if (i === "tangential")
416
416
  return {
417
- dx: e * o.ca,
418
- dy: e * o.cb,
419
- dz: e * o.cc,
417
+ dx: e * s.ca,
418
+ dy: e * s.cb,
419
+ dz: e * s.cc,
420
420
  azimuth: n,
421
421
  dip: t
422
422
  };
423
423
  if (i === "balanced_tangential") {
424
- const m = 0.5 * (n + s), d = 0.5 * (t + r), f = xe(m, d);
424
+ const d = 0.5 * (n + r), m = 0.5 * (t + o), f = xe(d, m);
425
425
  return {
426
426
  dx: e * f.ca,
427
427
  dy: e * f.cb,
428
428
  dz: e * f.cc,
429
- azimuth: m,
430
- dip: d
429
+ azimuth: d,
430
+ dip: m
431
431
  };
432
432
  }
433
- const l = o.ca * a.ca + o.cb * a.cb + o.cc * a.cc, u = Math.acos(Math.max(-1, Math.min(1, l))), c = u > 1e-6 ? 2 * Math.tan(u / 2) / u : 1;
433
+ const l = s.ca * a.ca + s.cb * a.cb + s.cc * a.cc, u = Math.acos(Math.max(-1, Math.min(1, l))), c = u > 1e-6 ? 2 * Math.tan(u / 2) / u : 1;
434
434
  return {
435
- dx: 0.5 * e * (o.ca + a.ca) * c,
436
- dy: 0.5 * e * (o.cb + a.cb) * c,
437
- dz: 0.5 * e * (o.cc + a.cc) * c,
438
- azimuth: s,
439
- dip: r
435
+ dx: 0.5 * e * (s.ca + a.ca) * c,
436
+ dy: 0.5 * e * (s.cb + a.cb) * c,
437
+ dz: 0.5 * e * (s.cc + a.cc) * c,
438
+ azimuth: r,
439
+ dip: o
440
440
  };
441
441
  }
442
- function ke(e = [], n = [], t = {}) {
442
+ function Fe(e = [], n = [], t = {}) {
443
443
  const {
444
- step: s = 1,
445
- holeIdCol: r = null,
444
+ step: r = 1,
445
+ holeIdCol: o = null,
446
446
  method: i = "minimum_curvature"
447
- } = t, o = Number.isFinite(Number(s)) && Number(s) > 0 ? Number(s) : 1, a = Ce(e, r), l = Ce(n, r || a.aliasCol);
447
+ } = t, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, a = Ce(e, o), l = Ce(n, o || a.aliasCol);
448
448
  if (!a.rows.length || !l.rows.length) return [];
449
449
  const u = /* @__PURE__ */ new Map();
450
- a.rows.forEach((d) => {
451
- !d.hole_id || u.has(d.hole_id) || u.set(d.hole_id, d);
450
+ a.rows.forEach((m) => {
451
+ !m.hole_id || u.has(m.hole_id) || u.set(m.hole_id, m);
452
452
  });
453
453
  const c = /* @__PURE__ */ new Map();
454
- l.rows.forEach((d) => {
455
- d.hole_id && (c.has(d.hole_id) || c.set(d.hole_id, []), c.get(d.hole_id).push(d));
454
+ l.rows.forEach((m) => {
455
+ m.hole_id && (c.has(m.hole_id) || c.set(m.hole_id, []), c.get(m.hole_id).push(m));
456
456
  });
457
- const m = [];
458
- return c.forEach((d, f) => {
459
- const g = u.get(f);
460
- if (!g) return;
461
- const y = [...d].map((P) => ({
462
- ...P,
463
- from: te(P.from),
464
- azimuth: te(P.azimuth),
465
- dip: te(P.dip)
466
- })).filter((P) => Number.isFinite(P.from) && Number.isFinite(P.azimuth) && Number.isFinite(P.dip)).sort((P, R) => P.from - R.from);
467
- if (!y.length) return;
468
- let b = te(g.x, 0), h = te(g.y, 0), E = te(g.z, 0), A = y[0].from;
469
- const x = y[0].azimuth, H = y[0].dip, O = {
457
+ const d = [];
458
+ return c.forEach((m, f) => {
459
+ const y = u.get(f);
460
+ if (!y) return;
461
+ const h = [...m].map((O) => ({
462
+ ...O,
463
+ from: te(O.from),
464
+ azimuth: te(O.azimuth),
465
+ dip: te(O.dip)
466
+ })).filter((O) => Number.isFinite(O.from) && Number.isFinite(O.azimuth) && Number.isFinite(O.dip)).sort((O, D) => O.from - D.from);
467
+ if (!h.length) return;
468
+ let b = te(y.x, 0), g = te(y.y, 0), A = te(y.z, 0), P = h[0].from;
469
+ const U = h[0].azimuth, $ = h[0].dip, k = {
470
470
  hole_id: f,
471
- md: A,
471
+ md: P,
472
472
  x: b,
473
- y: h,
474
- z: E,
475
- azimuth: x,
476
- dip: H
473
+ y: g,
474
+ z: A,
475
+ azimuth: U,
476
+ dip: $
477
477
  };
478
- a.aliasCol !== "hole_id" && g[a.aliasCol] !== void 0 && (O[a.aliasCol] = g[a.aliasCol]), m.push(O);
479
- for (let P = 0; P < y.length - 1; P += 1) {
480
- const R = y[P], V = y[P + 1], p = R.from, I = V.from - p;
481
- if (I <= 0) continue;
482
- const z = Math.max(1, Math.ceil(I / o)), w = I / z;
483
- for (let v = 0; v < z; v += 1) {
484
- A += w;
485
- const N = (A - p) / I, D = R.azimuth + N * (V.azimuth - R.azimuth), F = R.dip + N * (V.dip - R.dip), L = zt(w, R.azimuth, R.dip, V.azimuth, V.dip, i);
486
- b += L.dx, h += L.dy, E += L.dz;
487
- const U = {
478
+ a.aliasCol !== "hole_id" && y[a.aliasCol] !== void 0 && (k[a.aliasCol] = y[a.aliasCol]), d.push(k);
479
+ for (let O = 0; O < h.length - 1; O += 1) {
480
+ const D = h[O], S = h[O + 1], p = D.from, _ = S.from - p;
481
+ if (_ <= 0) continue;
482
+ const R = Math.max(1, Math.ceil(_ / s)), x = _ / R;
483
+ for (let T = 0; T < R; T += 1) {
484
+ P += x;
485
+ const v = (P - p) / _, z = D.azimuth + v * (S.azimuth - D.azimuth), F = D.dip + v * (S.dip - D.dip), C = wt(x, D.azimuth, D.dip, S.azimuth, S.dip, i);
486
+ b += C.dx, g += C.dy, A += C.dz;
487
+ const B = {
488
488
  hole_id: f,
489
- md: A,
489
+ md: P,
490
490
  x: b,
491
- y: h,
492
- z: E,
493
- azimuth: i === "minimum_curvature" ? D : L.azimuth,
494
- dip: i === "minimum_curvature" ? F : L.dip
491
+ y: g,
492
+ z: A,
493
+ azimuth: i === "minimum_curvature" ? z : C.azimuth,
494
+ dip: i === "minimum_curvature" ? F : C.dip
495
495
  };
496
- a.aliasCol !== "hole_id" && g[a.aliasCol] !== void 0 && (U[a.aliasCol] = g[a.aliasCol]), m.push(U);
496
+ a.aliasCol !== "hole_id" && y[a.aliasCol] !== void 0 && (B[a.aliasCol] = y[a.aliasCol]), d.push(B);
497
497
  }
498
498
  }
499
- }), m;
499
+ }), d;
500
500
  }
501
- function Ft(e, n, t = {}) {
502
- return ke(e, n, { ...t, method: "minimum_curvature" });
501
+ function Ht(e, n, t = {}) {
502
+ return Fe(e, n, { ...t, method: "minimum_curvature" });
503
503
  }
504
- function Ln(e, n, t = {}) {
505
- return ke(e, n, { ...t, method: "tangential" });
504
+ function $n(e, n, t = {}) {
505
+ return Fe(e, n, { ...t, method: "tangential" });
506
506
  }
507
- function Cn(e, n, t = {}) {
508
- return ke(e, n, { ...t, method: "balanced_tangential" });
507
+ function kn(e, n, t = {}) {
508
+ return Fe(e, n, { ...t, method: "balanced_tangential" });
509
509
  }
510
- function Tn(e, n, t = {}) {
511
- return Ft(e, n, t);
510
+ function Fn(e, n, t = {}) {
511
+ return Ht(e, n, t);
512
512
  }
513
- function $t(e, n) {
513
+ function Gt(e, n) {
514
514
  if (!e.length || !Number.isFinite(n)) return null;
515
- let t = null, s = 1 / 0;
516
- for (let r = 0; r < e.length; r += 1) {
517
- const i = e[r], o = te(i.md);
518
- if (!Number.isFinite(o)) continue;
519
- const a = Math.abs(o - n);
520
- a < s && (s = a, t = i);
515
+ let t = null, r = 1 / 0;
516
+ for (let o = 0; o < e.length; o += 1) {
517
+ const i = e[o], s = te(i.md);
518
+ if (!Number.isFinite(s)) continue;
519
+ const a = Math.abs(s - n);
520
+ a < r && (r = a, t = i);
521
521
  }
522
522
  return t;
523
523
  }
524
- function Mn(e = [], n = [], t = {}) {
525
- const s = t.holeIdCol || "hole_id", r = Ce(e, s), i = Ce(n, s);
526
- if (!r.rows.length || !i.rows.length) return [...r.rows];
527
- const o = /* @__PURE__ */ new Map();
524
+ function wn(e = [], n = [], t = {}) {
525
+ const r = t.holeIdCol || "hole_id", o = Ce(e, r), i = Ce(n, r);
526
+ if (!o.rows.length || !i.rows.length) return [...o.rows];
527
+ const s = /* @__PURE__ */ new Map();
528
528
  return i.rows.forEach((a) => {
529
- a.hole_id && (o.has(a.hole_id) || o.set(a.hole_id, []), o.get(a.hole_id).push(a));
530
- }), o.forEach((a, l) => {
531
- o.set(l, [...a].sort((u, c) => te(u.md, 0) - te(c.md, 0)));
532
- }), r.rows.map((a) => {
529
+ a.hole_id && (s.has(a.hole_id) || s.set(a.hole_id, []), s.get(a.hole_id).push(a));
530
+ }), s.forEach((a, l) => {
531
+ s.set(l, [...a].sort((u, c) => te(u.md, 0) - te(c.md, 0)));
532
+ }), o.rows.map((a) => {
533
533
  const l = te(a.from), u = te(a.to), c = Number.isFinite(l) && Number.isFinite(u) ? 0.5 * (l + u) : void 0;
534
534
  if (!a.hole_id || !Number.isFinite(c)) return { ...a };
535
- const m = $t(o.get(a.hole_id) || [], c);
536
- if (!m) return { ...a };
537
- const d = { ...a };
535
+ const d = Gt(s.get(a.hole_id) || [], c);
536
+ if (!d) return { ...a };
537
+ const m = { ...a };
538
538
  return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
539
- m[f] !== void 0 && (Object.prototype.hasOwnProperty.call(d, f) ? d[`${f}_trace`] = m[f] : d[f] = m[f]);
540
- }), d;
539
+ d[f] !== void 0 && (Object.prototype.hasOwnProperty.call(m, f) ? m[`${f}_trace`] = d[f] : m[f] = d[f]);
540
+ }), m;
541
541
  });
542
542
  }
543
- function On(e, n = null) {
544
- return new Promise((t, s) => {
543
+ function Hn(e, n = null) {
544
+ return new Promise((t, r) => {
545
545
  J.parse(e, {
546
546
  header: !0,
547
547
  dynamicTyping: !0,
548
548
  skipEmptyLines: !0,
549
- complete: (r) => {
549
+ complete: (o) => {
550
550
  const i = /* @__PURE__ */ new Map();
551
- r.data.forEach((a, l) => {
552
- const u = ie(a, null, n), c = u[_], m = c !== void 0 ? `${c}`.trim() : "", d = u[pe] ?? u.x, f = u[ye] ?? u.y, g = u[ve] ?? u.z, y = u.order ?? l;
553
- !m || d === null || d === void 0 || f === null || f === void 0 || g === null || g === void 0 || (i.has(m) || i.set(m, []), i.get(m).push({
551
+ o.data.forEach((a, l) => {
552
+ const u = ie(a, null, n), c = u[N], d = c !== void 0 ? `${c}`.trim() : "", m = u[he] ?? u.x, f = u[ge] ?? u.y, y = u[Ae] ?? u.z, h = u.order ?? l;
553
+ !d || m === null || m === void 0 || f === null || f === void 0 || y === null || y === void 0 || (i.has(d) || i.set(d, []), i.get(d).push({
554
554
  ...u,
555
- holeId: m,
556
- order: y,
557
- x: Number(d) ?? 0,
555
+ holeId: d,
556
+ order: h,
557
+ x: Number(m) ?? 0,
558
558
  y: Number(f) ?? 0,
559
- z: Number(g) ?? 0
559
+ z: Number(y) ?? 0
560
560
  }));
561
561
  });
562
- const o = Array.from(i.entries()).map(([a, l]) => ({
562
+ const s = Array.from(i.entries()).map(([a, l]) => ({
563
563
  id: a,
564
564
  points: l.sort((u, c) => u.order - c.order).map((u) => ({
565
565
  ...u,
@@ -568,13 +568,13 @@ function On(e, n = null) {
568
568
  z: Number(u.z) || 0
569
569
  }))
570
570
  }));
571
- t({ holes: o });
571
+ t({ holes: s });
572
572
  },
573
- error: (r) => s(k("parseDrillholesCSV", r))
573
+ error: (o) => r(G("parseDrillholesCSV", o))
574
574
  });
575
575
  });
576
576
  }
577
- function ge(e) {
577
+ function ye(e) {
578
578
  return e ? Array.isArray(e) ? [...e] : [] : [];
579
579
  }
580
580
  function Z(e) {
@@ -583,311 +583,311 @@ function Z(e) {
583
583
  }
584
584
  function Ne(e = [], n = []) {
585
585
  const t = [...e];
586
- return t.sort((s, r) => {
586
+ return t.sort((r, o) => {
587
587
  for (let i = 0; i < n.length; i += 1) {
588
- const o = n[i], a = s == null ? void 0 : s[o], l = r == null ? void 0 : r[o];
588
+ const s = n[i], a = r == null ? void 0 : r[s], l = o == null ? void 0 : o[s];
589
589
  if (a !== l)
590
590
  return a == null ? 1 : l == null ? -1 : typeof a == "number" && typeof l == "number" ? a - l : `${a}`.localeCompare(`${l}`);
591
591
  }
592
592
  return 0;
593
593
  }), t;
594
594
  }
595
- function kt(e = [], n = "Intervals") {
595
+ function Ut(e = [], n = "Intervals") {
596
596
  if (!e.length) return;
597
- const t = Ne(e, [_, C, M]), s = /* @__PURE__ */ new Map();
598
- t.forEach((r) => {
599
- const i = `${(r == null ? void 0 : r[_]) ?? ""}`.trim(), o = Number(r == null ? void 0 : r[C]), a = Number(r == null ? void 0 : r[M]);
600
- if (!i || !Number.isFinite(o) || !Number.isFinite(a)) return;
601
- const l = s.get(i);
602
- if (Number.isFinite(l) && o < l)
603
- throw k(
597
+ const t = Ne(e, [N, L, M]), r = /* @__PURE__ */ new Map();
598
+ t.forEach((o) => {
599
+ const i = `${(o == null ? void 0 : o[N]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[L]), a = Number(o == null ? void 0 : o[M]);
600
+ if (!i || !Number.isFinite(s) || !Number.isFinite(a)) return;
601
+ const l = r.get(i);
602
+ if (Number.isFinite(l) && s < l)
603
+ throw G(
604
604
  "validateNoOverlappingIntervals",
605
- new Error(`${n} intervals overlap for hole '${i}': from=${o} is less than previous to=${l}`)
605
+ new Error(`${n} intervals overlap for hole '${i}': from=${s} is less than previous to=${l}`)
606
606
  );
607
- s.set(i, a);
607
+ r.set(i, a);
608
608
  });
609
609
  }
610
- function wt(e, n = {}) {
611
- return new Promise((t, s) => {
610
+ function Bt(e, n = {}) {
611
+ return new Promise((t, r) => {
612
612
  J.parse(e, {
613
613
  header: !0,
614
614
  dynamicTyping: !0,
615
615
  skipEmptyLines: !0,
616
616
  ...n,
617
- complete: (r) => t(Array.isArray(r == null ? void 0 : r.data) ? r.data : []),
618
- error: (r) => s(k("loadTable(csv)", r))
617
+ complete: (o) => t(Array.isArray(o == null ? void 0 : o.data) ? o.data : []),
618
+ error: (o) => r(G("loadTable(csv)", o))
619
619
  });
620
620
  });
621
621
  }
622
- function Ht(e = [], n = null, t = null) {
623
- return e.map((s) => ie(s, n, t));
622
+ function Vt(e = [], n = null, t = null) {
623
+ return e.map((r) => ie(r, n, t));
624
624
  }
625
625
  async function Me(e, n = {}) {
626
626
  const {
627
627
  kind: t = "csv",
628
- columnMap: s = null,
629
- sourceColumnMap: r = null,
628
+ columnMap: r = null,
629
+ sourceColumnMap: o = null,
630
630
  papaParseConfig: i = {}
631
631
  } = n;
632
- let o;
632
+ let s;
633
633
  if (Array.isArray(e))
634
- o = ge(e);
634
+ s = ye(e);
635
635
  else if (t === "csv")
636
- o = await wt(e, i);
637
- else throw t === "parquet" || t === "sql" ? k("loadTable", new Error(`Unsupported kind in JS runtime: ${t}`)) : k("loadTable", new Error(`Unsupported kind: ${t}`));
638
- return Ht(o, s, r);
636
+ s = await Bt(e, i);
637
+ else throw t === "parquet" || t === "sql" ? G("loadTable", new Error(`Unsupported kind in JS runtime: ${t}`)) : G("loadTable", new Error(`Unsupported kind: ${t}`));
638
+ return Vt(s, r, o);
639
639
  }
640
- async function Pn(e, n = {}) {
640
+ async function Gn(e, n = {}) {
641
641
  const {
642
642
  crs: t = null,
643
- sourceColumnMap: s = null,
644
- keepAll: r = !0,
643
+ sourceColumnMap: r = null,
644
+ keepAll: o = !0,
645
645
  ...i
646
- } = n, o = await Me(e, { ...i, sourceColumnMap: s });
647
- if (!o.some((d) => _ in d))
648
- throw k("loadCollars", new Error(`Collar table missing column: ${_}`));
649
- const l = o.some((d) => pe in d && ye in d), u = o.some((d) => se in d && re in d);
646
+ } = n, s = await Me(e, { ...i, sourceColumnMap: r });
647
+ if (!s.some((m) => N in m))
648
+ throw G("loadCollars", new Error(`Collar table missing column: ${N}`));
649
+ const l = s.some((m) => he in m && ge in m), u = s.some((m) => re in m && oe in m);
650
650
  if (!l && !u)
651
- throw k("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
652
- const c = o.map((d) => {
653
- const f = { ...d };
654
- if (_ in f) {
655
- const g = f[_];
656
- f[_] = g == null ? "" : `${g}`.trim();
651
+ throw G("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
652
+ const c = s.map((m) => {
653
+ const f = { ...m };
654
+ if (N in f) {
655
+ const y = f[N];
656
+ f[N] = y == null ? "" : `${y}`.trim();
657
657
  }
658
- return se in f && (f[se] = Z(f[se])), re in f && (f[re] = Z(f[re])), ve in f && (f[ve] = Z(f[ve])), pe in f && (f[pe] = Z(f[pe])), ye in f && (f[ye] = Z(f[ye])), !("datasource_hole_id" in f) && _ in f && (f.datasource_hole_id = f[_]), f;
658
+ return re in f && (f[re] = Z(f[re])), oe in f && (f[oe] = Z(f[oe])), Ae in f && (f[Ae] = Z(f[Ae])), he in f && (f[he] = Z(f[he])), ge in f && (f[ge] = Z(f[ge])), !("datasource_hole_id" in f) && N in f && (f.datasource_hole_id = f[N]), f;
659
659
  });
660
- if (!c.every((d) => !(!d[_] || u && (!Number.isFinite(d[se]) || !Number.isFinite(d[re])) || l && !u && (!Number.isFinite(d[pe]) || !Number.isFinite(d[ye])))))
661
- throw k("loadCollars", new Error("Collar table has missing required values"));
660
+ if (!c.every((m) => !(!m[N] || u && (!Number.isFinite(m[re]) || !Number.isFinite(m[oe])) || l && !u && (!Number.isFinite(m[he]) || !Number.isFinite(m[ge])))))
661
+ throw G("loadCollars", new Error("Collar table has missing required values"));
662
662
  return c;
663
663
  }
664
- async function Dn(e, n = {}) {
664
+ async function Un(e, n = {}) {
665
665
  const {
666
666
  sourceColumnMap: t = null,
667
- keepAll: s = !0,
668
- ...r
669
- } = n, i = await Me(e, { ...r, sourceColumnMap: t }), o = [_, G, j, Y];
670
- for (const u of o)
671
- if (!i.some((m) => u in m))
672
- throw k("loadSurveys", new Error(`Survey table missing column: ${u}`));
667
+ keepAll: r = !0,
668
+ ...o
669
+ } = n, i = await Me(e, { ...o, sourceColumnMap: t }), s = [N, j, Y, W];
670
+ for (const u of s)
671
+ if (!i.some((d) => u in d))
672
+ throw G("loadSurveys", new Error(`Survey table missing column: ${u}`));
673
673
  const a = i.map((u) => {
674
674
  const c = { ...u };
675
- if (_ in c) {
676
- const m = c[_];
677
- c[_] = m == null ? "" : `${m}`.trim();
675
+ if (N in c) {
676
+ const d = c[N];
677
+ c[N] = d == null ? "" : `${d}`.trim();
678
678
  }
679
- return G in c && (c[G] = Z(c[G])), M in c && (c[M] = Z(c[M])), j in c && (c[j] = Z(c[j])), Y in c && (c[Y] = Z(c[Y])), c;
679
+ return j in c && (c[j] = Z(c[j])), M in c && (c[M] = Z(c[M])), Y in c && (c[Y] = Z(c[Y])), W in c && (c[W] = Z(c[W])), c;
680
680
  });
681
- if (!a.every((u) => !(!u[_] || !Number.isFinite(u[G]) || !Number.isFinite(u[j]) || !Number.isFinite(u[Y]))))
682
- throw k("loadSurveys", new Error("Survey table has missing required values"));
683
- return Ne(a, [_, G]);
681
+ if (!a.every((u) => !(!u[N] || !Number.isFinite(u[j]) || !Number.isFinite(u[Y]) || !Number.isFinite(u[W]))))
682
+ throw G("loadSurveys", new Error("Survey table has missing required values"));
683
+ return Ne(a, [N, j]);
684
684
  }
685
- async function xn(e, n = {}) {
685
+ async function Bn(e, n = {}) {
686
686
  const {
687
687
  sourceColumnMap: t = null,
688
- keepAll: s = !0,
689
- ...r
690
- } = n, i = await Me(e, { ...r, sourceColumnMap: t }), o = [_, C, M];
691
- for (const u of o)
692
- if (!i.some((m) => u in m))
693
- throw k("loadAssays", new Error(`Assay table missing column: ${u}`));
688
+ keepAll: r = !0,
689
+ ...o
690
+ } = n, i = await Me(e, { ...o, sourceColumnMap: t }), s = [N, L, M];
691
+ for (const u of s)
692
+ if (!i.some((d) => u in d))
693
+ throw G("loadAssays", new Error(`Assay table missing column: ${u}`));
694
694
  const a = i.map((u) => {
695
695
  const c = { ...u };
696
- if (_ in c) {
697
- const m = c[_];
698
- c[_] = m == null ? "" : `${m}`.trim();
696
+ if (N in c) {
697
+ const d = c[N];
698
+ c[N] = d == null ? "" : `${d}`.trim();
699
699
  }
700
- return C in c && (c[C] = Z(c[C])), M in c && (c[M] = Z(c[M])), C in c && M in c && Number.isFinite(c[C]) && Number.isFinite(c[M]) && (c[Ee] = 0.5 * (c[C] + c[M])), c;
700
+ return L in c && (c[L] = Z(c[L])), M in c && (c[M] = Z(c[M])), L in c && M in c && Number.isFinite(c[L]) && Number.isFinite(c[M]) && (c[ve] = 0.5 * (c[L] + c[M])), c;
701
701
  });
702
- if (!a.every((u) => !(!u[_] || !Number.isFinite(u[C]) || !Number.isFinite(u[M]) || !(u[M] > u[C]))))
703
- throw k("loadAssays", new Error("Assay table has missing required values"));
704
- return Ne(a, [_, C, M]);
702
+ if (!a.every((u) => !(!u[N] || !Number.isFinite(u[L]) || !Number.isFinite(u[M]) || !(u[M] > u[L]))))
703
+ throw G("loadAssays", new Error("Assay table has missing required values"));
704
+ return Ne(a, [N, L, M]);
705
705
  }
706
- async function Rn(e, n = {}) {
706
+ async function Vn(e, n = {}) {
707
707
  const {
708
708
  sourceColumnMap: t = null,
709
- keepAll: s = !0,
710
- ...r
711
- } = n, i = await Me(e, { ...r, sourceColumnMap: t }), o = [_, C, M];
712
- for (const c of o)
713
- if (!i.some((d) => c in d))
714
- throw k("loadGeology", new Error(`Geology table missing column: ${c}`));
709
+ keepAll: r = !0,
710
+ ...o
711
+ } = n, i = await Me(e, { ...o, sourceColumnMap: t }), s = [N, L, M];
712
+ for (const c of s)
713
+ if (!i.some((m) => c in m))
714
+ throw G("loadGeology", new Error(`Geology table missing column: ${c}`));
715
715
  const a = i.map((c) => {
716
- const m = { ...c };
717
- if (_ in m) {
718
- const g = m[_];
719
- m[_] = g == null ? "" : `${g}`.trim();
716
+ const d = { ...c };
717
+ if (N in d) {
718
+ const y = d[N];
719
+ d[N] = y == null ? "" : `${y}`.trim();
720
720
  }
721
- C in m && (m[C] = Z(m[C])), M in m && (m[M] = Z(m[M])), C in m && M in m && Number.isFinite(m[C]) && Number.isFinite(m[M]) && (m[M] === m[C] && (m[C] = Math.round(m[C] * 1e3) / 1e3, m[M] = m[C] + 1e-3), m[Ee] = 0.5 * (m[C] + m[M]));
722
- const d = m[le] !== void 0 && m[le] !== null && `${m[le]}`.trim() !== "", f = m[ce] !== void 0 && m[ce] !== null && `${m[ce]}`.trim() !== "";
723
- return !d && f && (m[le] = m[ce]), d && !f && (m[ce] = m[le]), m;
721
+ L in d && (d[L] = Z(d[L])), M in d && (d[M] = Z(d[M])), L in d && M in d && Number.isFinite(d[L]) && Number.isFinite(d[M]) && (d[M] === d[L] && (d[L] = Math.round(d[L] * 1e3) / 1e3, d[M] = d[L] + 1e-3), d[ve] = 0.5 * (d[L] + d[M]));
722
+ const m = d[le] !== void 0 && d[le] !== null && `${d[le]}`.trim() !== "", f = d[ce] !== void 0 && d[ce] !== null && `${d[ce]}`.trim() !== "";
723
+ return !m && f && (d[le] = d[ce]), m && !f && (d[ce] = d[le]), d;
724
724
  });
725
- if (!a.every((c) => !(!c[_] || !Number.isFinite(c[C]) || !Number.isFinite(c[M]) || !(c[M] > c[C]))))
726
- throw k("loadGeology", new Error("Geology table has missing or invalid interval values"));
725
+ if (!a.every((c) => !(!c[N] || !Number.isFinite(c[L]) || !Number.isFinite(c[M]) || !(c[M] > c[L]))))
726
+ throw G("loadGeology", new Error("Geology table has missing or invalid interval values"));
727
727
  if (!a.some((c) => {
728
- const m = c[le], d = c[ce];
729
- return m != null && `${m}`.trim() !== "" || d != null && `${d}`.trim() !== "";
728
+ const d = c[le], m = c[ce];
729
+ return d != null && `${d}`.trim() !== "" || m != null && `${m}`.trim() !== "";
730
730
  }))
731
- throw k("loadGeology", new Error(`Geology table missing categorical columns: ${le} or ${ce}`));
732
- if (kt(a, "Geology"), !s) {
733
- const c = new Set(Object.keys(_t));
731
+ throw G("loadGeology", new Error(`Geology table missing categorical columns: ${le} or ${ce}`));
732
+ if (Ut(a, "Geology"), !r) {
733
+ const c = new Set(Object.keys(Et));
734
734
  return Ne(
735
- a.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => c.has(d)))),
736
- [_, C, M]
735
+ a.map((d) => Object.fromEntries(Object.entries(d).filter(([m]) => c.has(m)))),
736
+ [N, L, M]
737
737
  );
738
738
  }
739
- return Ne(a, [_, C, M]);
739
+ return Ne(a, [N, L, M]);
740
740
  }
741
- function zn(e = [], n = [], t = {}) {
742
- const s = Array.isArray(t.onCols) && t.onCols.length ? t.onCols : [_];
741
+ function jn(e = [], n = [], t = {}) {
742
+ const r = Array.isArray(t.onCols) && t.onCols.length ? t.onCols : [N];
743
743
  if (!n.length) return [...e];
744
- const r = (o) => s.map((a) => `${(o == null ? void 0 : o[a]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
745
- return n.forEach((o) => {
746
- i.set(r(o), o);
747
- }), e.map((o) => {
748
- const a = i.get(r(o));
749
- if (!a) return { ...o };
750
- const l = { ...o };
744
+ const o = (s) => r.map((a) => `${(s == null ? void 0 : s[a]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
745
+ return n.forEach((s) => {
746
+ i.set(o(s), s);
747
+ }), e.map((s) => {
748
+ const a = i.get(o(s));
749
+ if (!a) return { ...s };
750
+ const l = { ...s };
751
751
  return Object.entries(a).forEach(([u, c]) => {
752
- s.includes(u) || (Object.prototype.hasOwnProperty.call(l, u) ? l[`${u}_trace`] = c : l[u] = c);
752
+ r.includes(u) || (Object.prototype.hasOwnProperty.call(l, u) ? l[`${u}_trace`] = c : l[u] = c);
753
753
  }), l;
754
754
  });
755
755
  }
756
- function Fn(e = [], n = null) {
757
- return n == null ? [...e] : e.length ? e.some((s) => de in s) ? e.filter((s) => (s == null ? void 0 : s[de]) === n) : [...e] : [];
756
+ function Yn(e = [], n = null) {
757
+ return n == null ? [...e] : e.length ? e.some((r) => de in r) ? e.filter((r) => (r == null ? void 0 : r[de]) === n) : [...e] : [];
758
758
  }
759
- function $n(e = [], n = []) {
759
+ function Wn(e = [], n = []) {
760
760
  return e.map((t) => {
761
- const s = { ...t };
762
- return n.forEach((r) => {
763
- if (!(r in s)) return;
764
- const i = Z(s[r]);
765
- s[r] = i;
766
- }), s;
761
+ const r = { ...t };
762
+ return n.forEach((o) => {
763
+ if (!(o in r)) return;
764
+ const i = Z(r[o]);
765
+ r[o] = i;
766
+ }), r;
767
767
  });
768
768
  }
769
- function kn({
769
+ function qn({
770
770
  collars: e = [],
771
771
  surveys: n = [],
772
772
  assays: t = [],
773
- geology: s = [],
774
- structures: r = [],
773
+ geology: r = [],
774
+ structures: o = [],
775
775
  metadata: i = {}
776
776
  } = {}) {
777
777
  return {
778
- collars: ge(e),
779
- surveys: ge(n),
780
- assays: ge(t),
781
- geology: ge(s),
782
- structures: ge(r),
778
+ collars: ye(e),
779
+ surveys: ye(n),
780
+ assays: ye(t),
781
+ geology: ye(r),
782
+ structures: ye(o),
783
783
  metadata: i || {}
784
784
  };
785
785
  }
786
786
  const we = (e, n = null) => ie(e, null, n);
787
- function Ut(e) {
787
+ function jt(e) {
788
788
  if (!e.length) return null;
789
- const n = e[0], t = C in n && M in n, s = G in n && !t;
790
- return t ? "interval" : s ? "point" : null;
789
+ const n = e[0], t = L in n && M in n, r = j in n && !t;
790
+ return t ? "interval" : r ? "point" : null;
791
791
  }
792
- function oe(e) {
792
+ function se(e) {
793
793
  const n = Number(e);
794
794
  return Number.isFinite(n) ? n : null;
795
795
  }
796
- function ot(e) {
797
- const n = e[_] !== void 0 ? `${e[_]}`.trim() : "";
796
+ function at(e) {
797
+ const n = e[N] !== void 0 ? `${e[N]}`.trim() : "";
798
798
  if (!n) return null;
799
- const t = oe(e[G]);
799
+ const t = se(e[j]);
800
800
  return t === null ? null : {
801
- [_]: n,
802
- [G]: t,
803
- [Y]: oe(e[Y]),
804
- [j]: oe(e[j]),
801
+ [N]: n,
802
+ [j]: t,
803
+ [W]: se(e[W]),
804
+ [Y]: se(e[Y]),
805
805
  comments: e.comments != null ? `${e.comments}` : null,
806
806
  ...e
807
807
  };
808
808
  }
809
- function it(e) {
810
- const n = e[_] !== void 0 ? `${e[_]}`.trim() : "";
809
+ function lt(e) {
810
+ const n = e[N] !== void 0 ? `${e[N]}`.trim() : "";
811
811
  if (!n) return null;
812
- const t = oe(e[C]), s = oe(e[M]);
813
- if (t === null || s === null || s <= t) return null;
814
- const r = 0.5 * (t + s);
812
+ const t = se(e[L]), r = se(e[M]);
813
+ if (t === null || r === null || r <= t) return null;
814
+ const o = 0.5 * (t + r);
815
815
  return {
816
- [_]: n,
817
- [C]: t,
818
- [M]: s,
819
- mid: r,
820
- [Y]: oe(e[Y]),
821
- [j]: oe(e[j]),
816
+ [N]: n,
817
+ [L]: t,
818
+ [M]: r,
819
+ mid: o,
820
+ [W]: se(e[W]),
821
+ [Y]: se(e[Y]),
822
822
  classification: e.classification != null ? `${e.classification}` : null,
823
823
  comments: e.comments != null ? `${e.comments}` : null,
824
824
  ...e
825
825
  };
826
826
  }
827
- function wn(e) {
827
+ function Xn(e) {
828
828
  const n = [], t = [];
829
- for (const s of e) {
830
- const r = [], i = oe(s[Y]), o = oe(s[j]);
831
- i !== null && (i < 0 || i > 90) && r.push(`dip ${i} out of range [0, 90]`), o !== null && (o < 0 || o >= 360) && r.push(`azimuth ${o} out of range [0, 360)`), r.length ? t.push({ row: s, message: r.join("; ") }) : n.push(s);
829
+ for (const r of e) {
830
+ const o = [], i = se(r[W]), s = se(r[Y]);
831
+ 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 ? t.push({ row: r, message: o.join("; ") }) : n.push(r);
832
832
  }
833
833
  return { valid: n, errors: t };
834
834
  }
835
- function Hn(e, n = null) {
836
- return new Promise((t, s) => {
837
- const r = {
835
+ function Kn(e, n = null) {
836
+ return new Promise((t, r) => {
837
+ const o = {
838
838
  header: !0,
839
839
  dynamicTyping: !0,
840
840
  skipEmptyLines: !0,
841
841
  complete: (i) => {
842
- const o = [];
842
+ const s = [];
843
843
  for (const a of i.data) {
844
- const l = we(a, n), u = ot(l);
845
- u && o.push(u);
844
+ const l = we(a, n), u = at(l);
845
+ u && s.push(u);
846
846
  }
847
- t(o);
847
+ t(s);
848
848
  },
849
- error: (i) => s(k("parseStructuralPointsCSV", i))
849
+ error: (i) => r(G("parseStructuralPointsCSV", i))
850
850
  };
851
851
  typeof e == "string" && !e.startsWith("data:") && e.includes(`
852
- `) ? J.parse(e, r) : J.parse(e, r);
852
+ `) ? J.parse(e, o) : J.parse(e, o);
853
853
  });
854
854
  }
855
- function Un(e, n = null) {
856
- return new Promise((t, s) => {
855
+ function Zn(e, n = null) {
856
+ return new Promise((t, r) => {
857
857
  J.parse(e, {
858
858
  header: !0,
859
859
  dynamicTyping: !0,
860
860
  skipEmptyLines: !0,
861
- complete: (r) => {
861
+ complete: (o) => {
862
862
  const i = [];
863
- for (const o of r.data) {
864
- const a = we(o, n), l = it(a);
863
+ for (const s of o.data) {
864
+ const a = we(s, n), l = lt(a);
865
865
  l && i.push(l);
866
866
  }
867
867
  t(i);
868
868
  },
869
- error: (r) => s(k("parseStructuralIntervalsCSV", r))
869
+ error: (o) => r(G("parseStructuralIntervalsCSV", o))
870
870
  });
871
871
  });
872
872
  }
873
- function Bt(e, n = _) {
873
+ function Yt(e, n = N) {
874
874
  const t = /* @__PURE__ */ new Map();
875
- for (const s of e) {
876
- const r = s[n] != null ? String(s[n]).trim() : "";
877
- r && (t.has(r) || t.set(r, { holeId: r, points: [] }), t.get(r).points.push(s));
875
+ for (const r of e) {
876
+ const o = r[n] != null ? String(r[n]).trim() : "";
877
+ o && (t.has(o) || t.set(o, { holeId: o, points: [] }), t.get(o).points.push(r));
878
878
  }
879
879
  return Array.from(t.values());
880
880
  }
881
- function Gt(e, n = null) {
882
- return new Promise((t, s) => {
881
+ function Wt(e, n = null) {
882
+ return new Promise((t, r) => {
883
883
  J.parse(e, {
884
884
  header: !0,
885
885
  dynamicTyping: !0,
886
886
  skipEmptyLines: !0,
887
- complete: (r) => {
888
- const i = r.data.map((l) => we(l, n)), o = Ut(i);
889
- if (!o) {
890
- s(k(
887
+ complete: (o) => {
888
+ const i = o.data.map((l) => we(l, n)), s = jt(i);
889
+ if (!s) {
890
+ r(G(
891
891
  "parseStructuralCSV",
892
892
  new Error("Structural CSV requires either 'depth' (point) or 'from'/'to' (interval) columns")
893
893
  ));
@@ -895,283 +895,283 @@ function Gt(e, n = null) {
895
895
  }
896
896
  const a = [];
897
897
  for (const l of i) {
898
- const u = o === "interval" ? it(l) : ot(l);
898
+ const u = s === "interval" ? lt(l) : at(l);
899
899
  u && a.push(u);
900
900
  }
901
- t({ schema: o, rows: a });
901
+ t({ schema: s, rows: a });
902
902
  },
903
- error: (r) => s(k("parseStructuralCSV", r))
903
+ error: (o) => r(G("parseStructuralCSV", o))
904
904
  });
905
905
  });
906
906
  }
907
- function Vt(e) {
907
+ function qt(e) {
908
908
  return new Promise((n) => {
909
909
  J.parse(e, {
910
910
  header: !0,
911
911
  dynamicTyping: !0,
912
912
  skipEmptyLines: !0,
913
913
  complete: (t) => {
914
- const s = /* @__PURE__ */ new Map();
914
+ const r = /* @__PURE__ */ new Map();
915
915
  for (const i of t.data) {
916
- const o = ie(i), a = o[_] != null ? `${o[_]}`.trim() : "";
916
+ const s = ie(i), a = s[N] != null ? `${s[N]}`.trim() : "";
917
917
  if (!a) continue;
918
- const l = Number(o[C]), u = Number(o[M]);
918
+ const l = Number(s[L]), u = Number(s[M]);
919
919
  if (!Number.isFinite(l) || !Number.isFinite(u) || u <= l) continue;
920
- const c = (l + u) / 2, { [Y]: m, [j]: d, ...f } = o, g = {
920
+ const c = (l + u) / 2, { [W]: d, [Y]: m, ...f } = s, y = {
921
921
  ...f,
922
- [_]: a,
923
- [C]: l,
922
+ [N]: a,
923
+ [L]: l,
924
924
  [M]: u,
925
- [Ee]: c,
926
- [G]: c,
925
+ [ve]: c,
926
+ [j]: c,
927
927
  // unified depth field for y-axis rendering
928
928
  _source: "assay"
929
929
  };
930
- s.has(a) || s.set(a, []), s.get(a).push(g);
930
+ r.has(a) || r.set(a, []), r.get(a).push(y);
931
931
  }
932
- const r = Array.from(s.entries()).map(([i, o]) => ({
932
+ const o = Array.from(r.entries()).map(([i, s]) => ({
933
933
  holeId: i,
934
- points: o.sort((a, l) => a[C] - l[C])
934
+ points: s.sort((a, l) => a[L] - l[L])
935
935
  }));
936
- n(r);
936
+ n(o);
937
937
  }
938
938
  });
939
939
  });
940
940
  }
941
- function jt(e) {
941
+ function Xt(e) {
942
942
  return new Promise((n) => {
943
943
  J.parse(e, {
944
944
  header: !0,
945
945
  dynamicTyping: !0,
946
946
  skipEmptyLines: !0,
947
947
  complete: (t) => {
948
- const s = /* @__PURE__ */ new Map();
949
- for (const r of t.data) {
950
- const i = ie(r), o = (i[_] ?? "").toString().trim();
951
- if (!o) continue;
952
- const a = Number(i[C]), l = Number(i[M]);
948
+ const r = /* @__PURE__ */ new Map();
949
+ for (const o of t.data) {
950
+ const i = ie(o), s = (i[N] ?? "").toString().trim();
951
+ if (!s) continue;
952
+ const a = Number(i[L]), l = Number(i[M]);
953
953
  if (!Number.isFinite(a) || !Number.isFinite(l) || l <= a) continue;
954
- const u = (a + l) / 2, { [Y]: c, [j]: m, ...d } = i, f = {
955
- ...d,
956
- [_]: o,
957
- [C]: a,
954
+ const u = (a + l) / 2, { [W]: c, [Y]: d, ...m } = i, f = {
955
+ ...m,
956
+ [N]: s,
957
+ [L]: a,
958
958
  [M]: l,
959
- [Ee]: u,
960
- [G]: u,
959
+ [ve]: u,
960
+ [j]: u,
961
961
  _source: "geology"
962
962
  };
963
- s.has(o) || s.set(o, []), s.get(o).push(f);
963
+ r.has(s) || r.set(s, []), r.get(s).push(f);
964
964
  }
965
965
  n({
966
- holes: Array.from(s.entries()).map(([r, i]) => ({
967
- holeId: r,
968
- points: i.sort((o, a) => o[C] - a[C])
966
+ holes: Array.from(r.entries()).map(([o, i]) => ({
967
+ holeId: o,
968
+ points: i.sort((s, a) => s[L] - a[L])
969
969
  }))
970
970
  });
971
971
  }
972
972
  });
973
973
  });
974
974
  }
975
- async function Bn({ assayCsv: e, structuralCsv: n, geologyCsv: t } = {}) {
976
- const [s, r, i] = await Promise.all([
977
- e ? Vt(e) : Promise.resolve([]),
978
- n ? Gt(n).then(
979
- ({ rows: a }) => Bt(a.map((l) => ({ ...l, _source: "structural" })))
975
+ async function Jn({ assayCsv: e, structuralCsv: n, geologyCsv: t } = {}) {
976
+ const [r, o, i] = await Promise.all([
977
+ e ? qt(e) : Promise.resolve([]),
978
+ n ? Wt(n).then(
979
+ ({ rows: a }) => Yt(a.map((l) => ({ ...l, _source: "structural" })))
980
980
  ) : Promise.resolve([]),
981
- t ? jt(t).then(({ holes: a }) => a) : Promise.resolve([])
982
- ]), o = new Map(s.map((a) => [a.holeId, { ...a, points: [...a.points] }]));
983
- for (const a of [...r, ...i]) {
981
+ t ? Xt(t).then(({ holes: a }) => a) : Promise.resolve([])
982
+ ]), s = new Map(r.map((a) => [a.holeId, { ...a, points: [...a.points] }]));
983
+ for (const a of [...o, ...i]) {
984
984
  const l = a.holeId;
985
985
  if (l)
986
- if (o.has(l)) {
987
- const u = o.get(l);
988
- o.set(l, { ...u, points: [...u.points, ...a.points || []] });
986
+ if (s.has(l)) {
987
+ const u = s.get(l);
988
+ s.set(l, { ...u, points: [...u.points, ...a.points || []] });
989
989
  } else
990
- o.set(l, a);
990
+ s.set(l, a);
991
991
  }
992
- return { holes: Array.from(o.values()) };
992
+ return { holes: Array.from(s.values()) };
993
993
  }
994
- function Gn(e, n, t, s, r = {}) {
995
- const i = r.fromCol || "from", o = r.toCol || "to", a = r.holeCol || "hole_id";
994
+ function Qn(e, n, t, r, o = {}) {
995
+ const i = o.fromCol || "from", s = o.toCol || "to", a = o.holeCol || "hole_id";
996
996
  if (!e || !e.length) return [];
997
997
  const l = {};
998
998
  for (const c of e) {
999
- const m = c[a];
1000
- m != null && (l[m] || (l[m] = []), l[m].push(c));
999
+ const d = c[a];
1000
+ d != null && (l[d] || (l[d] = []), l[d].push(c));
1001
1001
  }
1002
1002
  const u = [];
1003
- for (const [c, m] of Object.entries(l)) {
1004
- const f = [...m].sort((h, E) => Number(h[i]) - Number(E[i])).filter((h) => {
1005
- const E = Number(h[n]);
1006
- return Number.isFinite(E) && E >= t;
1003
+ for (const [c, d] of Object.entries(l)) {
1004
+ const f = [...d].sort((g, A) => Number(g[i]) - Number(A[i])).filter((g) => {
1005
+ const A = Number(g[n]);
1006
+ return Number.isFinite(A) && A >= t;
1007
1007
  });
1008
1008
  if (!f.length) continue;
1009
- const g = [];
1010
- let y = [], b = null;
1011
- for (const h of f) {
1012
- const E = Number(h[i]), A = Number(h[o]);
1013
- b === null || Math.abs(E - b) > 1e-6 ? (y.length && g.push(y), y = [h]) : y.push(h), b = A;
1009
+ const y = [];
1010
+ let h = [], b = null;
1011
+ for (const g of f) {
1012
+ const A = Number(g[i]), P = Number(g[s]);
1013
+ b === null || Math.abs(A - b) > 1e-6 ? (h.length && y.push(h), h = [g]) : h.push(g), b = P;
1014
1014
  }
1015
- y.length && g.push(y);
1016
- for (const h of g) {
1017
- const E = Number(h[0][i]), A = Number(h[h.length - 1][o]), x = A - E;
1018
- if (x < s) continue;
1019
- let H = 0, O = 0;
1020
- for (const p of h) {
1021
- const T = Number(p[n]), I = Number(p[o]) - Number(p[i]);
1022
- H += T * I, O += I;
1015
+ h.length && y.push(h);
1016
+ for (const g of y) {
1017
+ const A = Number(g[0][i]), P = Number(g[g.length - 1][s]), U = P - A;
1018
+ if (U < r) continue;
1019
+ let $ = 0, k = 0;
1020
+ for (const p of g) {
1021
+ const I = Number(p[n]), _ = Number(p[s]) - Number(p[i]);
1022
+ $ += I * _, k += _;
1023
1023
  }
1024
- const P = H / O, R = h.length, V = `${x.toFixed(1)} m @ ${P.toFixed(2)} ${n}`;
1024
+ const O = $ / k, D = g.length, S = `${U.toFixed(1)} m @ ${O.toFixed(2)} ${n}`;
1025
1025
  u.push({
1026
1026
  [a]: c,
1027
1027
  assay_field: n,
1028
- [i]: E,
1029
- [o]: A,
1030
- length: x,
1031
- avg_grade: P,
1032
- n_samples: R,
1033
- label: V
1028
+ [i]: A,
1029
+ [s]: P,
1030
+ length: U,
1031
+ avg_grade: O,
1032
+ n_samples: D,
1033
+ label: S
1034
1034
  });
1035
1035
  }
1036
1036
  }
1037
1037
  return u;
1038
1038
  }
1039
- const at = ["depth", "md", "measured_depth", "dept", "z"];
1040
- function Yt(e) {
1041
- if (e[G] !== void 0) {
1042
- const s = Number(e[G]);
1043
- if (Number.isFinite(s)) return s;
1039
+ const ct = ["depth", "md", "measured_depth", "dept", "z"];
1040
+ function Kt(e) {
1041
+ if (e[j] !== void 0) {
1042
+ const r = Number(e[j]);
1043
+ if (Number.isFinite(r)) return r;
1044
1044
  }
1045
- for (const s of at)
1046
- if (e[s] !== void 0) {
1047
- const r = Number(e[s]);
1048
- if (Number.isFinite(r)) return r;
1045
+ for (const r of ct)
1046
+ if (e[r] !== void 0) {
1047
+ const o = Number(e[r]);
1048
+ if (Number.isFinite(o)) return o;
1049
1049
  }
1050
- const n = Number(e[C]), t = Number(e[M]);
1050
+ const n = Number(e[L]), t = Number(e[M]);
1051
1051
  return Number.isFinite(n) && Number.isFinite(t) && t >= n ? (n + t) / 2 : null;
1052
1052
  }
1053
- function Wt(e) {
1053
+ function Zt(e) {
1054
1054
  if (e.length === 0) return [];
1055
- const n = /* @__PURE__ */ new Set([_, G, C, M, Ee, ...at]);
1056
- return Object.keys(e[0]).filter((s) => !n.has(s)).filter((s) => {
1057
- let r = 0;
1055
+ const n = /* @__PURE__ */ new Set([N, j, L, M, ve, ...ct]);
1056
+ return Object.keys(e[0]).filter((r) => !n.has(r)).filter((r) => {
1057
+ let o = 0;
1058
1058
  for (const i of e) {
1059
- const o = Number(i[s]);
1060
- Number.isFinite(o) && r++;
1059
+ const s = Number(i[r]);
1060
+ Number.isFinite(s) && o++;
1061
1061
  }
1062
- return r / e.length > 0.5;
1062
+ return o / e.length > 0.5;
1063
1063
  });
1064
1064
  }
1065
- function Vn(e, n = null) {
1066
- const s = J.parse(e, {
1065
+ function er(e, n = null) {
1066
+ const r = J.parse(e, {
1067
1067
  header: !0,
1068
1068
  skipEmptyLines: !0,
1069
1069
  dynamicTyping: !1
1070
1070
  }).data || [];
1071
- if (s.length === 0) return [];
1072
- const r = s.map((l) => ie(l, null, n)), i = Wt(r), o = /* @__PURE__ */ new Map();
1073
- for (const l of r) {
1074
- const u = l[_] != null ? `${l[_]}`.trim() : "";
1071
+ if (r.length === 0) return [];
1072
+ const o = r.map((l) => ie(l, null, n)), i = Zt(o), s = /* @__PURE__ */ new Map();
1073
+ for (const l of o) {
1074
+ const u = l[N] != null ? `${l[N]}`.trim() : "";
1075
1075
  if (!u) continue;
1076
- const c = Yt(l);
1077
- c === null || c < 0 || (o.has(u) || o.set(u, []), o.get(u).push({ depth: c, row: l }));
1076
+ const c = Kt(l);
1077
+ c === null || c < 0 || (s.has(u) || s.set(u, []), s.get(u).push({ depth: c, row: l }));
1078
1078
  }
1079
1079
  const a = [];
1080
- for (const [l, u] of o) {
1081
- u.sort((m, d) => m.depth - d.depth);
1080
+ for (const [l, u] of s) {
1081
+ u.sort((d, m) => d.depth - m.depth);
1082
1082
  const c = {};
1083
- for (const m of i) {
1084
- const d = [], f = [];
1085
- for (const { depth: g, row: y } of u) {
1086
- const b = Number(y[m]);
1087
- Number.isFinite(b) && b !== Qe && (d.push(g), f.push(b));
1083
+ for (const d of i) {
1084
+ const m = [], f = [];
1085
+ for (const { depth: y, row: h } of u) {
1086
+ const b = Number(h[d]);
1087
+ Number.isFinite(b) && b !== et && (m.push(y), f.push(b));
1088
1088
  }
1089
- d.length >= 2 && (c[m] = { depths: d, values: f });
1089
+ m.length >= 2 && (c[d] = { depths: m, values: f });
1090
1090
  }
1091
1091
  Object.keys(c).length > 0 && a.push({ holeId: l, channels: c });
1092
1092
  }
1093
1093
  return a;
1094
1094
  }
1095
- function jn(e, n = null, t = {}) {
1096
- const s = [];
1097
- for (const { holeId: r, channels: i } of e) {
1098
- const o = n && i[n] ? n : Object.keys(i)[0];
1099
- if (!o) continue;
1100
- const { depths: a, values: l } = i[o];
1101
- s.push({ holeId: r, depths: a, values: l, options: t });
1095
+ function tr(e, n = null, t = {}) {
1096
+ const r = [];
1097
+ for (const { holeId: o, channels: i } of e) {
1098
+ const s = n && i[n] ? n : Object.keys(i)[0];
1099
+ if (!s) continue;
1100
+ const { depths: a, values: l } = i[s];
1101
+ r.push({ holeId: o, depths: a, values: l, options: t });
1102
1102
  }
1103
- return s;
1103
+ return r;
1104
1104
  }
1105
- function lt(e) {
1105
+ function ut(e) {
1106
1106
  const n = e.indexOf(".");
1107
1107
  if (n < 0) return null;
1108
- const t = e.slice(0, n).trim().toUpperCase(), s = e.slice(n + 1), r = s.match(/^(\S*)\s*(.*)/s), i = r ? r[1] : "", o = r ? r[2] : s, a = o.lastIndexOf(":"), l = a >= 0 ? o.slice(0, a).trim() : o.trim(), u = a >= 0 ? o.slice(a + 1).trim() : "";
1108
+ const t = e.slice(0, n).trim().toUpperCase(), r = e.slice(n + 1), o = r.match(/^(\S*)\s*(.*)/s), i = o ? o[1] : "", s = o ? o[2] : r, a = s.lastIndexOf(":"), l = a >= 0 ? s.slice(0, a).trim() : s.trim(), u = a >= 0 ? s.slice(a + 1).trim() : "";
1109
1109
  return { mnem: t, unit: i, value: l, description: u };
1110
1110
  }
1111
- function qt(e) {
1111
+ function Jt(e) {
1112
1112
  const n = [];
1113
1113
  let t = null;
1114
- for (const s of e.split(/\r?\n/)) {
1115
- const r = s.trimEnd();
1116
- r.startsWith("~") ? (t = { type: r.slice(1, 2).toUpperCase(), lines: [] }, n.push(t)) : t && t.lines.push(r);
1114
+ for (const r of e.split(/\r?\n/)) {
1115
+ const o = r.trimEnd();
1116
+ o.startsWith("~") ? (t = { type: o.slice(1, 2).toUpperCase(), lines: [] }, n.push(t)) : t && t.lines.push(o);
1117
1117
  }
1118
1118
  return n;
1119
1119
  }
1120
- function We(e = []) {
1120
+ function Ye(e = []) {
1121
1121
  const n = {};
1122
1122
  for (const t of e) {
1123
- const s = t.trimStart();
1124
- if (!s || s.startsWith("#")) continue;
1125
- const r = lt(t);
1126
- r && (n[r.mnem] = r);
1123
+ const r = t.trimStart();
1124
+ if (!r || r.startsWith("#")) continue;
1125
+ const o = ut(t);
1126
+ o && (n[o.mnem] = o);
1127
1127
  }
1128
1128
  return n;
1129
1129
  }
1130
- function Yn(e, n = {}) {
1131
- var h, E, A, x, H, O, P, R, V;
1132
- const t = qt(e), s = t.find((p) => p.type === "V"), r = t.find((p) => p.type === "W"), i = t.find((p) => p.type === "C"), o = t.find((p) => p.type === "A");
1133
- if (!o) return [];
1134
- const a = We(s == null ? void 0 : s.lines), l = We(r == null ? void 0 : r.lines), u = [];
1130
+ function nr(e, n = {}) {
1131
+ var g, A, P, U, $, k, O, D, S;
1132
+ const t = Jt(e), r = t.find((p) => p.type === "V"), o = t.find((p) => p.type === "W"), i = t.find((p) => p.type === "C"), s = t.find((p) => p.type === "A");
1133
+ if (!s) return [];
1134
+ const a = Ye(r == null ? void 0 : r.lines), l = Ye(o == null ? void 0 : o.lines), u = [];
1135
1135
  for (const p of (i == null ? void 0 : i.lines) ?? []) {
1136
- const T = p.trimStart();
1137
- if (!T || T.startsWith("#")) continue;
1138
- const I = lt(p);
1139
- I && u.push(I);
1136
+ const I = p.trimStart();
1137
+ if (!I || I.startsWith("#")) continue;
1138
+ const _ = ut(p);
1139
+ _ && u.push(_);
1140
1140
  }
1141
- (((E = (h = a.WRAP) == null ? void 0 : h.value) == null ? void 0 : E.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
1141
+ (((A = (g = a.WRAP) == null ? void 0 : g.value) == null ? void 0 : A.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
1142
1142
  "parseLasFile: WRAP YES is not supported. Data rows may be read incorrectly."
1143
1143
  );
1144
- const m = n.holeId ?? (((x = (A = l.WELL) == null ? void 0 : A.value) == null ? void 0 : x.trim()) || null) ?? (((O = (H = l.UWI) == null ? void 0 : H.value) == null ? void 0 : O.trim()) || null) ?? (((R = (P = l.API) == null ? void 0 : P.value) == null ? void 0 : R.trim()) || null) ?? "unknown";
1145
- let d = Qe;
1146
- if ((V = l.NULL) != null && V.value) {
1144
+ const d = n.holeId ?? (((U = (P = l.WELL) == null ? void 0 : P.value) == null ? void 0 : U.trim()) || null) ?? (((k = ($ = l.UWI) == null ? void 0 : $.value) == null ? void 0 : k.trim()) || null) ?? (((D = (O = l.API) == null ? void 0 : O.value) == null ? void 0 : D.trim()) || null) ?? "unknown";
1145
+ let m = et;
1146
+ if ((S = l.NULL) != null && S.value) {
1147
1147
  const p = Number(l.NULL.value);
1148
- Number.isFinite(p) && (d = p);
1148
+ Number.isFinite(p) && (m = p);
1149
1149
  }
1150
- if (n.nullSentinel !== void 0 && (d = n.nullSentinel), u.length === 0) return [];
1151
- const f = u.slice(1), g = {};
1152
- for (const { mnem: p, unit: T } of f)
1153
- g[p.toLowerCase()] = T;
1154
- const y = {};
1150
+ if (n.nullSentinel !== void 0 && (m = n.nullSentinel), u.length === 0) return [];
1151
+ const f = u.slice(1), y = {};
1152
+ for (const { mnem: p, unit: I } of f)
1153
+ y[p.toLowerCase()] = I;
1154
+ const h = {};
1155
1155
  for (const { mnem: p } of f)
1156
- y[p.toLowerCase()] = { depths: [], values: [] };
1157
- for (const p of o.lines) {
1158
- const T = p.trimStart();
1159
- if (!T || T.startsWith("#")) continue;
1160
- const I = T.split(/\s+/);
1161
- if (I.length < 2) continue;
1162
- const z = Number(I[0]);
1163
- if (!(!Number.isFinite(z) || z === d))
1164
- for (let w = 0; w < f.length; w++) {
1165
- const v = f[w].mnem.toLowerCase(), N = Number(I[w + 1]);
1166
- Number.isFinite(N) && N !== d && (y[v].depths.push(z), y[v].values.push(N));
1156
+ h[p.toLowerCase()] = { depths: [], values: [] };
1157
+ for (const p of s.lines) {
1158
+ const I = p.trimStart();
1159
+ if (!I || I.startsWith("#")) continue;
1160
+ const _ = I.split(/\s+/);
1161
+ if (_.length < 2) continue;
1162
+ const R = Number(_[0]);
1163
+ if (!(!Number.isFinite(R) || R === m))
1164
+ for (let x = 0; x < f.length; x++) {
1165
+ const T = f[x].mnem.toLowerCase(), v = Number(_[x + 1]);
1166
+ Number.isFinite(v) && v !== m && (h[T].depths.push(R), h[T].values.push(v));
1167
1167
  }
1168
1168
  }
1169
1169
  const b = {};
1170
- for (const [p, T] of Object.entries(y))
1171
- T.depths.length >= 2 && (b[p] = T);
1172
- return Object.keys(b).length === 0 ? [] : [{ holeId: m, units: g, channels: b }];
1170
+ for (const [p, I] of Object.entries(h))
1171
+ I.depths.length >= 2 && (b[p] = I);
1172
+ return Object.keys(b).length === 0 ? [] : [{ holeId: d, units: y, channels: b }];
1173
1173
  }
1174
- const ct = [
1174
+ const dt = [
1175
1175
  "#0f172a",
1176
1176
  "#1e3a5f",
1177
1177
  "#7c3aed",
@@ -1182,25 +1182,26 @@ const ct = [
1182
1182
  "#db2777",
1183
1183
  "#65a30d",
1184
1184
  "#9333ea"
1185
- ], Kt = { l: 42, r: 4, t: 4, b: 30 }, qe = 10, Ke = 12;
1186
- function ut(e = {}) {
1185
+ ], Qt = { l: 42, r: 4, t: 4, b: 36 }, We = 10, qe = 11, en = 6;
1186
+ function mt(e = {}) {
1187
1187
  return {
1188
1188
  ...e,
1189
- margin: Kt,
1189
+ margin: Qt,
1190
1190
  autosize: !0,
1191
1191
  width: void 0,
1192
1192
  xaxis: {
1193
1193
  ...e.xaxis || {},
1194
1194
  tickfont: {
1195
1195
  ...e.xaxis && e.xaxis.tickfont || {},
1196
- size: qe
1196
+ size: We
1197
1197
  },
1198
1198
  title: {
1199
1199
  ...e.xaxis && e.xaxis.title || {},
1200
1200
  font: {
1201
1201
  ...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
1202
- size: Ke
1203
- }
1202
+ size: qe
1203
+ },
1204
+ standoff: (e.xaxis && e.xaxis.title && e.xaxis.title.standoff) ?? en
1204
1205
  }
1205
1206
  },
1206
1207
  yaxis: {
@@ -1208,67 +1209,67 @@ function ut(e = {}) {
1208
1209
  automargin: !0,
1209
1210
  tickfont: {
1210
1211
  ...e.yaxis && e.yaxis.tickfont || {},
1211
- size: qe
1212
+ size: We
1212
1213
  },
1213
1214
  title: {
1214
1215
  ...e.yaxis && e.yaxis.title || {},
1215
1216
  font: {
1216
1217
  ...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
1217
- size: Ke
1218
+ size: qe
1218
1219
  }
1219
1220
  }
1220
1221
  }
1221
1222
  };
1222
1223
  }
1223
- function Xt(e, {
1224
+ function tn(e, {
1224
1225
  tailScale: n = 5,
1225
1226
  colorBy: t = null,
1226
- palette: s = ct,
1227
- depthCol: r = G,
1228
- dipCol: i = Y,
1229
- azCol: o = j,
1227
+ palette: r = dt,
1228
+ depthCol: o = j,
1229
+ dipCol: i = W,
1230
+ azCol: s = Y,
1230
1231
  template: a = void 0
1231
1232
  } = {}) {
1232
1233
  const l = e.filter(
1233
- (y) => y[r] != null && y[i] != null && y[o] != null
1234
+ (h) => h[o] != null && h[i] != null && h[s] != null
1234
1235
  );
1235
1236
  if (!l.length)
1236
1237
  return { data: [], layout: {} };
1237
1238
  const u = {};
1238
- t && [...new Set(l.map((b) => b[t]).filter((b) => b != null))].sort().forEach((b, h) => {
1239
- u[b] = s[h % s.length];
1239
+ t && [...new Set(l.map((b) => b[t]).filter((b) => b != null))].sort().forEach((b, g) => {
1240
+ u[b] = r[g % r.length];
1240
1241
  });
1241
- const c = /* @__PURE__ */ new Map(), m = [];
1242
- for (const y of l) {
1243
- const b = Number(y[r]), h = Number(y[i]), E = Number(y[o]), A = t ? y[t] ?? "_default" : "_default", x = t ? u[A] ?? "#0f172a" : "#0f172a";
1244
- c.has(A) || c.set(A, { xs: [], ys: [], dips: [], azs: [], color: x });
1245
- const H = c.get(A);
1246
- H.xs.push(h), H.ys.push(b), H.dips.push(h), H.azs.push(E);
1247
- const O = E * Math.PI / 180, P = n * (Math.abs(h) / 90), R = Math.sin(O) * P, V = Math.cos(O) * P;
1248
- m.push({
1242
+ const c = /* @__PURE__ */ new Map(), d = [];
1243
+ for (const h of l) {
1244
+ const b = Number(h[o]), g = Number(h[i]), A = Number(h[s]), P = t ? h[t] ?? "_default" : "_default", U = t ? u[P] ?? "#0f172a" : "#0f172a";
1245
+ c.has(P) || c.set(P, { xs: [], ys: [], dips: [], azs: [], color: U });
1246
+ const $ = c.get(P);
1247
+ $.xs.push(g), $.ys.push(b), $.dips.push(g), $.azs.push(A);
1248
+ const k = A * Math.PI / 180, O = n * (Math.abs(g) / 90), D = Math.sin(k) * O, S = Math.cos(k) * O;
1249
+ d.push({
1249
1250
  type: "line",
1250
- x0: h,
1251
+ x0: g,
1251
1252
  y0: b,
1252
- x1: h + R,
1253
- y1: b + V,
1254
- line: { color: x, width: 2 }
1253
+ x1: g + D,
1254
+ y1: b + S,
1255
+ line: { color: U, width: 2 }
1255
1256
  });
1256
1257
  }
1257
- const d = [], f = t && c.size > 1;
1258
- for (const [y, b] of c.entries())
1259
- d.push({
1258
+ const m = [], f = t && c.size > 1;
1259
+ for (const [h, b] of c.entries())
1260
+ m.push({
1260
1261
  type: "scatter",
1261
1262
  x: b.xs,
1262
1263
  y: b.ys,
1263
1264
  mode: "markers",
1264
- name: y !== "_default" ? String(y) : void 0,
1265
+ name: h !== "_default" ? String(h) : void 0,
1265
1266
  marker: { size: 8, color: b.color },
1266
- showlegend: f && y !== "_default",
1267
- customdata: b.dips.map((h, E) => [h, b.azs[E]]),
1267
+ showlegend: f && h !== "_default",
1268
+ customdata: b.dips.map((g, A) => [g, b.azs[A]]),
1268
1269
  hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
1269
1270
  });
1270
- return { data: d, layout: {
1271
- shapes: m,
1271
+ return { data: m, layout: {
1272
+ shapes: d,
1272
1273
  height: 400,
1273
1274
  margin: { l: 40, r: 10, t: 10, b: 40 },
1274
1275
  xaxis: {
@@ -1280,38 +1281,38 @@ function Xt(e, {
1280
1281
  },
1281
1282
  yaxis: { title: "Depth (m)", autorange: "reversed" },
1282
1283
  showlegend: !!f,
1283
- template: a !== void 0 ? a : $e
1284
+ template: a !== void 0 ? a : ke
1284
1285
  } };
1285
1286
  }
1286
- function Wn(e, {
1287
+ function rr(e, {
1287
1288
  labelCol: n = "structure_type",
1288
- palette: t = ct,
1289
- fromCol: s = C,
1290
- toCol: r = M,
1289
+ palette: t = dt,
1290
+ fromCol: r = L,
1291
+ toCol: o = M,
1291
1292
  template: i = void 0
1292
1293
  } = {}) {
1293
- const o = e.filter((d) => d[s] != null && d[r] != null && Number(d[r]) > Number(d[s])).filter((d) => {
1294
- const f = d[n];
1294
+ const s = e.filter((m) => m[r] != null && m[o] != null && Number(m[o]) > Number(m[r])).filter((m) => {
1295
+ const f = m[n];
1295
1296
  if (f == null) return !1;
1296
- const g = String(f).trim();
1297
- return g !== "" && !/^(nan|null|none)$/i.test(g);
1298
- }).map((d) => ({ from: Number(d[s]), to: Number(d[r]), label: String(d[n]).trim() })).sort((d, f) => d.from - f.from);
1299
- if (!o.length)
1297
+ const y = String(f).trim();
1298
+ return y !== "" && !/^(nan|null|none)$/i.test(y);
1299
+ }).map((m) => ({ from: Number(m[r]), to: Number(m[o]), label: String(m[n]).trim() })).sort((m, f) => m.from - f.from);
1300
+ if (!s.length)
1300
1301
  return { data: [], layout: {} };
1301
1302
  const a = [], l = [], u = [];
1302
- return o.forEach((d, f) => {
1303
+ return s.forEach((m, f) => {
1303
1304
  a.push({
1304
1305
  type: "rect",
1305
1306
  xref: "x",
1306
1307
  yref: "y",
1307
1308
  x0: 0,
1308
1309
  x1: 1,
1309
- y0: d.from,
1310
- y1: d.to,
1310
+ y0: m.from,
1311
+ y1: m.to,
1311
1312
  fillcolor: t[f % t.length],
1312
1313
  line: { width: 0 },
1313
1314
  layer: "below"
1314
- }), l.push(0.5 * (d.from + d.to)), u.push(d.label);
1315
+ }), l.push(0.5 * (m.from + m.to)), u.push(m.label);
1315
1316
  }), { data: [{
1316
1317
  type: "scatter",
1317
1318
  x: Array(u.length).fill(0.5),
@@ -1321,504 +1322,673 @@ function Wn(e, {
1321
1322
  textposition: "middle center",
1322
1323
  showlegend: !1,
1323
1324
  hoverinfo: "text"
1324
- }], layout: ut({
1325
+ }], layout: mt({
1325
1326
  shapes: a,
1326
1327
  height: 400,
1327
1328
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
1328
1329
  yaxis: { title: "Depth (m)", autorange: "reversed" },
1329
1330
  showlegend: !1,
1330
- template: i !== void 0 ? i : $e
1331
+ template: i !== void 0 ? i : ke
1331
1332
  }) };
1332
1333
  }
1333
1334
  function Xe(e, n) {
1334
1335
  if (!e) return "";
1335
- const t = String(e).trim().split(/\s+/), s = [];
1336
- let r = "";
1336
+ const t = String(e).trim().split(/\s+/), r = [];
1337
+ let o = "";
1337
1338
  for (const i of t)
1338
- r && r.length + 1 + i.length > n ? (s.push(r), r = i) : r = r ? `${r} ${i}` : i;
1339
- return r && s.push(r), s.join("<br>");
1339
+ o && o.length + 1 + i.length > n ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
1340
+ return o && r.push(o), r.join("<br>");
1340
1341
  }
1341
- function Zt(e, {
1342
+ function nn(e, {
1342
1343
  commentCol: n = "comments",
1343
- fromCol: t = C,
1344
- toCol: s = M,
1345
- bgColor: r = "#f1f5f9",
1344
+ fromCol: t = L,
1345
+ toCol: r = M,
1346
+ bgColor: o = "#f1f5f9",
1346
1347
  borderColor: i = "#cbd5e1",
1347
- textColor: o = "#1e293b",
1348
+ textColor: s = "#1e293b",
1348
1349
  charsPerLine: a = 18,
1349
1350
  template: l = void 0
1350
1351
  } = {}) {
1351
- const u = e.filter((h) => h[t] != null && h[s] != null && Number(h[s]) > Number(h[t])).map((h) => {
1352
- const E = h[n], A = E != null && String(E).trim() !== "" && String(E) !== "null" ? String(E).trim() : "";
1353
- return { from: Number(h[t]), to: Number(h[s]), comment: A };
1354
- }).sort((h, E) => h.from - E.from);
1352
+ const u = e.filter((g) => g[t] != null && g[r] != null && Number(g[r]) > Number(g[t])).map((g) => {
1353
+ const A = g[n], P = A != null && String(A).trim() !== "" && String(A) !== "null" ? String(A).trim() : "";
1354
+ return { from: Number(g[t]), to: Number(g[r]), comment: P };
1355
+ }).sort((g, A) => g.from - A.from);
1355
1356
  if (!u.length)
1356
1357
  return { data: [], layout: {} };
1357
- const c = [], m = [], d = [], f = [], g = [];
1358
- for (const h of u) {
1359
- const E = 0.5 * (h.from + h.to), A = !!h.comment;
1358
+ const c = [], d = [], m = [], f = [], y = [];
1359
+ for (const g of u) {
1360
+ const A = 0.5 * (g.from + g.to), P = !!g.comment;
1360
1361
  c.push({
1361
1362
  type: "rect",
1362
1363
  xref: "x",
1363
1364
  yref: "y",
1364
1365
  x0: 0,
1365
1366
  x1: 1,
1366
- y0: h.from,
1367
- y1: h.to,
1368
- fillcolor: A ? r : "rgba(0,0,0,0)",
1367
+ y0: g.from,
1368
+ y1: g.to,
1369
+ fillcolor: P ? o : "rgba(0,0,0,0)",
1369
1370
  line: { color: i, width: 1 },
1370
1371
  layer: "below"
1371
- }), A && (m.push(0.5), d.push(E), f.push(Xe(h.comment, a)), g.push(`${h.from.toFixed(3)}–${h.to.toFixed(3)} m<br>${Xe(h.comment, 40)}`));
1372
+ }), P && (d.push(0.5), m.push(A), f.push(Xe(g.comment, a)), y.push(`${g.from.toFixed(3)}–${g.to.toFixed(3)} m<br>${Xe(g.comment, 40)}`));
1372
1373
  }
1373
- return { data: m.length ? [{
1374
+ return { data: d.length ? [{
1374
1375
  type: "scatter",
1375
- x: m,
1376
- y: d,
1376
+ x: d,
1377
+ y: m,
1377
1378
  mode: "text",
1378
1379
  text: f,
1379
1380
  textposition: "middle center",
1380
- textfont: { color: o, size: 10 },
1381
- hovertext: g,
1381
+ textfont: { color: s, size: 10 },
1382
+ hovertext: y,
1382
1383
  hoverinfo: "text",
1383
1384
  showlegend: !1
1384
- }] : [], layout: ut({
1385
+ }] : [], layout: mt({
1385
1386
  shapes: c,
1386
1387
  height: 400,
1387
1388
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
1388
1389
  yaxis: { title: "Depth (m)", autorange: "reversed" },
1389
1390
  showlegend: !1,
1390
- template: l !== void 0 ? l : $e
1391
+ template: l !== void 0 ? l : ke
1391
1392
  }) };
1392
1393
  }
1393
- function qn(e, {
1394
+ function or(e, {
1394
1395
  symbolSize: n = 10,
1395
1396
  xCol: t = "easting",
1396
- yCol: s = "northing"
1397
+ yCol: r = "northing"
1397
1398
  } = {}) {
1398
- const r = e[t] != null ? Number(e[t]) : null, i = e[s] != null ? Number(e[s]) : null, o = e[Y] != null ? Number(e[Y]) : null, a = e[j] != null ? Number(e[j]) : null;
1399
- if (r === null || i === null || o === null || a === null) return null;
1400
- const l = (a - 90 + 360) % 360, u = l * Math.PI / 180, c = a * Math.PI / 180, m = n * Math.sin(u), d = n * Math.cos(u), f = n * 0.4 * (o / 90), g = f * Math.sin(c), y = f * Math.cos(c);
1399
+ const o = e[t] != null ? Number(e[t]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[W] != null ? Number(e[W]) : null, a = e[Y] != null ? Number(e[Y]) : null;
1400
+ if (o === null || i === null || s === null || a === null) return null;
1401
+ const l = (a - 90 + 360) % 360, u = l * Math.PI / 180, c = a * Math.PI / 180, d = n * Math.sin(u), m = n * Math.cos(u), f = n * 0.4 * (s / 90), y = f * Math.sin(c), h = f * Math.cos(c);
1401
1402
  return {
1402
1403
  strike: l,
1403
- dipValue: o,
1404
- x: r,
1404
+ dipValue: s,
1405
+ x: o,
1405
1406
  y: i,
1406
- strikeX0: r - m,
1407
- strikeY0: i - d,
1408
- strikeX1: r + m,
1409
- strikeY1: i + d,
1410
- tickX1: r + g,
1411
- tickY1: i + y
1407
+ strikeX0: o - d,
1408
+ strikeY0: i - m,
1409
+ strikeX1: o + d,
1410
+ strikeY1: i + m,
1411
+ tickX1: o + y,
1412
+ tickY1: i + h
1412
1413
  };
1413
1414
  }
1414
- const dt = "markers+line";
1415
- function Jt(e, n) {
1416
- var s;
1417
- const t = et(e);
1418
- return t.some((r) => r.value === n) ? n : ((s = t[0]) == null ? void 0 : s.value) || dt;
1415
+ function rn({
1416
+ holeId: e,
1417
+ hole: n,
1418
+ holeOptions: t,
1419
+ property: r,
1420
+ propertyOptions: o,
1421
+ displayType: i,
1422
+ points: s,
1423
+ renderError: a
1424
+ }) {
1425
+ if (a)
1426
+ return { kind: "placeholder", text: `Plot error: ${a}` };
1427
+ const l = t || [];
1428
+ if (!e)
1429
+ return l.length === 0 ? { kind: "placeholder", text: "No holes loaded" } : { kind: "placeholder", text: "Select a hole" };
1430
+ if (!n)
1431
+ return { kind: "placeholder", text: `Loading ${e}…` };
1432
+ const u = o || [];
1433
+ return r ? !(i === ze) && !(i === tt) && (s || []).length === 0 ? { kind: "placeholder", text: `No values for ${r} in hole ${e}` } : { kind: "chart" } : u.length === 0 ? { kind: "placeholder", text: `No properties available for hole ${e}` } : { kind: "placeholder", text: "Select a property" };
1434
+ }
1435
+ function ft(e, n) {
1436
+ if (typeof n == "function") return n(e);
1437
+ if (!(typeof n != "string" || !n) && !(e == null || typeof e != "object"))
1438
+ return e[n];
1439
+ }
1440
+ function on(e, n) {
1441
+ const t = [], r = /* @__PURE__ */ new Set();
1442
+ for (const o of e || []) {
1443
+ const i = ft(o, n);
1444
+ i == null || i === "" || r.has(i) || (r.add(i), t.push(i));
1445
+ }
1446
+ return t;
1447
+ }
1448
+ function sn(e, n, t) {
1449
+ return t == null || t === "" ? e || [] : (e || []).filter((r) => ft(r, n) === t);
1450
+ }
1451
+ function an({
1452
+ chartOptions: e,
1453
+ showHoleSelect: n,
1454
+ showPropertySelect: t,
1455
+ showChartTypeSelect: r
1456
+ }) {
1457
+ return {
1458
+ hole: n !== !1,
1459
+ property: t !== !1,
1460
+ chartType: r !== !1 && (e || []).length > 1
1461
+ };
1419
1462
  }
1420
- function Kn({ config: e, graph: n, holeOptions: t = [], propertyOptions: s = [], onConfigChange: r, template: i }) {
1421
- const o = _e(null), a = n == null ? void 0 : n.hole, l = (n == null ? void 0 : n.points) || [], u = (e == null ? void 0 : e.property) || "", c = (e == null ? void 0 : e.chartType) || dt, m = (e == null ? void 0 : e.holeId) || "", d = (n == null ? void 0 : n.displayType) || (n != null && n.isComment ? Pe : n != null && n.isCategorical ? Be : Nt), f = et(d), g = Jt(d, c), [y, b] = X("");
1463
+ const pt = "markers+line";
1464
+ function ln(e, n) {
1465
+ var r;
1466
+ const t = nt(e);
1467
+ return t.some((o) => o.value === n) ? n : ((r = t[0]) == null ? void 0 : r.value) || pt;
1468
+ }
1469
+ function Ke(e) {
1470
+ const n = typeof e == "string" ? e : e.holeId, t = typeof e == "string" ? e : e.label || e.holeId;
1471
+ return [n, t];
1472
+ }
1473
+ function Ze(e) {
1474
+ const n = typeof e == "string" ? e : e.value, t = typeof e == "string" ? e : e.label ?? e.value;
1475
+ return [n, t];
1476
+ }
1477
+ function cn({ selector: e, holeOptions: n, selectedHoleId: t, onConfigChange: r }) {
1478
+ const o = (e == null ? void 0 : e.kind) || "hole";
1479
+ if (o === "field") {
1480
+ const s = e.value ?? "", a = e.options || [], l = e.label || "Selection";
1481
+ return /* @__PURE__ */ H(
1482
+ "select",
1483
+ {
1484
+ className: "plot-select plot-select--field",
1485
+ value: s,
1486
+ onChange: (u) => e.onChange && e.onChange(u.target.value),
1487
+ disabled: a.length === 0,
1488
+ "aria-label": l,
1489
+ children: [
1490
+ a.length === 0 && /* @__PURE__ */ E("option", { value: "", children: "—" }),
1491
+ !s && a.length > 0 && /* @__PURE__ */ E("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
1492
+ a.map((u) => {
1493
+ const [c, d] = Ze(u);
1494
+ return /* @__PURE__ */ E("option", { value: c, children: d }, c);
1495
+ })
1496
+ ]
1497
+ }
1498
+ );
1499
+ }
1500
+ if (o === "group+hole") {
1501
+ const s = e.groupBy, a = e.groupValue ?? "", l = e.groupLabel || "Group", u = e.groupOptions || on(n, s), c = sn(n, s, a);
1502
+ return /* @__PURE__ */ H(Ct, { children: [
1503
+ /* @__PURE__ */ H(
1504
+ "select",
1505
+ {
1506
+ className: "plot-select plot-select--group",
1507
+ value: a,
1508
+ onChange: (d) => e.onGroupChange && e.onGroupChange(d.target.value),
1509
+ disabled: u.length === 0,
1510
+ "aria-label": l,
1511
+ children: [
1512
+ u.length === 0 && /* @__PURE__ */ H("option", { value: "", children: [
1513
+ "No ",
1514
+ l.toLowerCase(),
1515
+ "s"
1516
+ ] }),
1517
+ !a && u.length > 0 && /* @__PURE__ */ E("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
1518
+ u.map((d) => {
1519
+ const [m, f] = Ze(d);
1520
+ return /* @__PURE__ */ E("option", { value: m, children: f }, m);
1521
+ })
1522
+ ]
1523
+ }
1524
+ ),
1525
+ /* @__PURE__ */ H(
1526
+ "select",
1527
+ {
1528
+ className: "plot-select plot-select--hole",
1529
+ value: t,
1530
+ onChange: (d) => r && r({ holeId: d.target.value }),
1531
+ disabled: c.length === 0,
1532
+ "aria-label": "Hole",
1533
+ children: [
1534
+ c.length === 0 && /* @__PURE__ */ E("option", { value: "", children: "No holes" }),
1535
+ !t && c.length > 0 && /* @__PURE__ */ E("option", { value: "", disabled: !0, hidden: !0, children: "Select a hole" }),
1536
+ c.map((d) => {
1537
+ const [m, f] = Ke(d);
1538
+ return /* @__PURE__ */ E("option", { value: m, children: f }, m);
1539
+ })
1540
+ ]
1541
+ }
1542
+ )
1543
+ ] });
1544
+ }
1545
+ const i = n.length > 0;
1546
+ return /* @__PURE__ */ H(
1547
+ "select",
1548
+ {
1549
+ className: "plot-select plot-select--hole",
1550
+ value: t,
1551
+ onChange: (s) => r && r({ holeId: s.target.value }),
1552
+ disabled: !i,
1553
+ "aria-label": "Hole",
1554
+ children: [
1555
+ !i && /* @__PURE__ */ E("option", { value: "", children: "No holes loaded" }),
1556
+ !t && i && /* @__PURE__ */ E("option", { value: "", disabled: !0, hidden: !0, children: "Select a hole" }),
1557
+ n.map((s) => {
1558
+ const [a, l] = Ke(s);
1559
+ return /* @__PURE__ */ E("option", { value: a, children: l }, a);
1560
+ })
1561
+ ]
1562
+ }
1563
+ );
1564
+ }
1565
+ function sr({
1566
+ config: e,
1567
+ graph: n,
1568
+ holeOptions: t = [],
1569
+ propertyOptions: r = [],
1570
+ onConfigChange: o,
1571
+ template: i,
1572
+ showHoleSelect: s = !0,
1573
+ showPropertySelect: a = !0,
1574
+ showChartTypeSelect: l = !0,
1575
+ holeSelector: u
1576
+ }) {
1577
+ const c = _e(null), d = n == null ? void 0 : n.hole, m = (n == null ? void 0 : n.points) || [], f = (e == null ? void 0 : e.property) || "", y = (e == null ? void 0 : e.chartType) || pt, h = (e == null ? void 0 : e.holeId) || "", b = (n == null ? void 0 : n.displayType) || (n != null && n.isComment ? ze : n != null && n.isCategorical ? Ue : At), g = nt(b), A = ln(b, y), [P, U] = K(""), $ = rn({
1578
+ holeId: h,
1579
+ hole: d,
1580
+ holeOptions: t,
1581
+ property: f,
1582
+ propertyOptions: r,
1583
+ displayType: b,
1584
+ points: m,
1585
+ renderError: P
1586
+ }), k = $.kind !== "chart", O = an({
1587
+ chartOptions: g,
1588
+ showHoleSelect: s,
1589
+ showPropertySelect: a,
1590
+ showChartTypeSelect: l
1591
+ }), D = r.length > 0;
1422
1592
  return ne(() => {
1423
- const h = d === Pe, E = d === Ge;
1424
- if (!a || !u || !h && !E && l.length === 0) return;
1425
- const A = o.current;
1426
- if (!A) return;
1427
- let x;
1593
+ if ($.kind !== "chart") return;
1594
+ const S = c.current;
1595
+ if (!S) return;
1596
+ const p = b === ze, I = b === tt;
1597
+ let _;
1428
1598
  try {
1429
- h ? x = Zt(l, { commentCol: u, fromCol: "from", toCol: "to" }) : E ? x = Xt(l) : x = Et({
1430
- points: l,
1431
- isCategorical: d === Be,
1432
- property: u,
1433
- chartType: g,
1599
+ p ? _ = nn(m, { commentCol: f, fromCol: "from", toCol: "to" }) : I ? _ = tn(m) : _ = St({
1600
+ points: m,
1601
+ isCategorical: b === Ue,
1602
+ property: f,
1603
+ chartType: A,
1434
1604
  template: i
1435
1605
  });
1436
- } catch (O) {
1437
- console.error("Plot build error", O), b((O == null ? void 0 : O.message) || "Plot build error");
1606
+ } catch (x) {
1607
+ console.error("Plot build error", x), U((x == null ? void 0 : x.message) || "Plot build error");
1438
1608
  return;
1439
1609
  }
1440
- if ((!(x != null && x.data) || x.data.length === 0) && !h)
1610
+ if ((!(_ != null && _.data) || _.data.length === 0) && !p)
1441
1611
  return;
1442
- const H = {
1612
+ const R = {
1443
1613
  displayModeBar: !0,
1444
1614
  responsive: !0,
1445
1615
  useResizeHandler: !0,
1446
1616
  modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
1447
1617
  };
1448
1618
  try {
1449
- b(""), Ae.react(A, x.data, x.layout, H), requestAnimationFrame(() => {
1450
- A && A.parentElement && Ae.Plots.resize(A);
1619
+ U(""), Ee.react(S, _.data, _.layout, R), requestAnimationFrame(() => {
1620
+ S && S.parentElement && Ee.Plots.resize(S);
1451
1621
  });
1452
- } catch (O) {
1453
- console.error("Plot render error", O), b((O == null ? void 0 : O.message) || "Plot render error");
1622
+ } catch (x) {
1623
+ console.error("Plot render error", x), U((x == null ? void 0 : x.message) || "Plot render error");
1454
1624
  }
1455
1625
  return () => {
1456
- if (A)
1626
+ if (S)
1457
1627
  try {
1458
- Ae.purge(A);
1459
- } catch (O) {
1460
- console.warn("Plot purge error", O);
1628
+ Ee.purge(S);
1629
+ } catch (x) {
1630
+ console.warn("Plot purge error", x);
1461
1631
  }
1462
1632
  };
1463
- }, [a, u, g, d, l, i]), ne(() => {
1464
- const h = o.current;
1465
- if (!h || typeof ResizeObserver > "u") return;
1466
- const E = new ResizeObserver(() => {
1633
+ }, [$.kind, d, f, A, b, m, i]), ne(() => {
1634
+ const S = c.current;
1635
+ if (!S || typeof ResizeObserver > "u") return;
1636
+ const p = new ResizeObserver(() => {
1467
1637
  try {
1468
- h && h.data && Ae.Plots.resize(h);
1469
- } catch (A) {
1470
- console.warn("Plot resize error", A);
1638
+ S && S.data && Ee.Plots.resize(S);
1639
+ } catch (I) {
1640
+ console.warn("Plot resize error", I);
1471
1641
  }
1472
1642
  });
1473
- return E.observe(h), () => E.disconnect();
1474
- }, []), !a || !u ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ S("div", { className: "placeholder", children: e != null && e.holeId ? n != null && n.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : d !== Pe && d !== Ge && l.length === 0 ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ S("div", { className: "placeholder", children: "No data" }) }) : y ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ W("div", { className: "placeholder", children: [
1475
- "Plot error: ",
1476
- y
1477
- ] }) }) : /* @__PURE__ */ W("div", { className: "plot-card", children: [
1478
- /* @__PURE__ */ S("div", { className: "plot-title", children: /* @__PURE__ */ S(
1479
- "select",
1480
- {
1481
- className: "plot-select",
1482
- value: m,
1483
- onChange: (h) => r && r({ holeId: h.target.value }),
1484
- children: t.map((h) => {
1485
- const E = typeof h == "string" ? h : h.holeId, A = typeof h == "string" ? h : h.label || h.holeId;
1486
- return /* @__PURE__ */ S("option", { value: E, children: A }, E);
1487
- })
1488
- }
1489
- ) }),
1490
- /* @__PURE__ */ W("div", { className: "plot-controls column", children: [
1491
- s.length > 0 && /* @__PURE__ */ S(
1492
- "select",
1493
- {
1494
- className: "plot-select",
1495
- value: u,
1496
- onChange: (h) => r && r({ property: h.target.value }),
1497
- children: s.map((h) => /* @__PURE__ */ S("option", { value: h, children: h }, h))
1498
- }
1499
- ),
1500
- f.length > 1 && /* @__PURE__ */ S(
1501
- "select",
1502
- {
1503
- className: "plot-select",
1504
- value: g,
1505
- onChange: (h) => r && r({ chartType: h.target.value }),
1506
- children: f.map((h) => /* @__PURE__ */ S("option", { value: h.value, children: h.label }, h.value))
1507
- }
1508
- )
1643
+ return p.observe(S), () => p.disconnect();
1644
+ }, [$.kind]), /* @__PURE__ */ H("div", { className: `plot-card${k ? " empty" : ""}`, children: [
1645
+ /* @__PURE__ */ H("header", { className: "plot-card__controls", children: [
1646
+ O.hole && /* @__PURE__ */ E("div", { className: "plot-title", children: cn({
1647
+ selector: u,
1648
+ holeOptions: t,
1649
+ selectedHoleId: h,
1650
+ onConfigChange: o
1651
+ }) }),
1652
+ (O.property || O.chartType) && /* @__PURE__ */ H("div", { className: "plot-controls column", children: [
1653
+ O.property && /* @__PURE__ */ H(
1654
+ "select",
1655
+ {
1656
+ className: "plot-select plot-select--property",
1657
+ value: f,
1658
+ onChange: (S) => o && o({ property: S.target.value }),
1659
+ disabled: !D,
1660
+ "aria-label": "Property",
1661
+ children: [
1662
+ !D && /* @__PURE__ */ E("option", { value: "", children: "—" }),
1663
+ !f && D && /* @__PURE__ */ E("option", { value: "", disabled: !0, hidden: !0, children: "Select a property" }),
1664
+ r.map((S) => /* @__PURE__ */ E("option", { value: S, children: S }, S))
1665
+ ]
1666
+ }
1667
+ ),
1668
+ O.chartType && /* @__PURE__ */ E(
1669
+ "select",
1670
+ {
1671
+ className: "plot-select plot-select--chart-type",
1672
+ value: A,
1673
+ onChange: (S) => o && o({ chartType: S.target.value }),
1674
+ "aria-label": "Chart type",
1675
+ children: g.map((S) => /* @__PURE__ */ E("option", { value: S.value, children: S.label }, S.value))
1676
+ }
1677
+ )
1678
+ ] })
1509
1679
  ] }),
1510
- /* @__PURE__ */ S("div", { className: "plotly-chart", ref: o })
1680
+ /* @__PURE__ */ E("div", { className: "plot-card__body", children: $.kind === "chart" ? /* @__PURE__ */ E("div", { className: "plotly-chart", ref: c }) : /* @__PURE__ */ E("div", { className: "placeholder", children: $.text }) })
1511
1681
  ] });
1512
1682
  }
1513
- function Ze(e, n) {
1683
+ function Je(e, n) {
1514
1684
  if (!(n != null && n.length)) return e;
1515
- const t = new Map(e.map((s) => [s.id || s.holeId, { ...s }]));
1516
- for (const s of n) {
1517
- const r = s.id || s.holeId;
1518
- if (r)
1519
- if (t.has(r)) {
1520
- const i = t.get(r);
1521
- t.set(r, { ...i, points: [...i.points || [], ...s.points || []] });
1685
+ const t = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
1686
+ for (const r of n) {
1687
+ const o = r.id || r.holeId;
1688
+ if (o)
1689
+ if (t.has(o)) {
1690
+ const i = t.get(o);
1691
+ t.set(o, { ...i, points: [...i.points || [], ...r.points || []] });
1522
1692
  } else
1523
- t.set(r, s);
1693
+ t.set(o, r);
1524
1694
  }
1525
1695
  return Array.from(t.values());
1526
1696
  }
1527
- function Qt(e, n) {
1697
+ function un(e, n) {
1528
1698
  if (!e || !n) return [];
1529
- const t = /* @__PURE__ */ new Set(), s = [];
1530
- for (const r of e.points || []) {
1531
- const i = Number(r.from ?? r.samp_from ?? r.depth_from ?? r.from_depth), o = Number(r.to ?? r.samp_to ?? r.depth_to ?? r.to_depth);
1532
- if (!Number.isFinite(i) || !Number.isFinite(o) || o <= i) continue;
1533
- const a = `${i}-${o}`;
1534
- t.has(a) || (t.add(a), s.push({ from: i, to: o, [n]: r[n] ?? "" }));
1699
+ const t = /* @__PURE__ */ new Set(), r = [];
1700
+ for (const o of e.points || []) {
1701
+ const i = Number(o.from ?? o.samp_from ?? o.depth_from ?? o.from_depth), s = Number(o.to ?? o.samp_to ?? o.depth_to ?? o.to_depth);
1702
+ if (!Number.isFinite(i) || !Number.isFinite(s) || s <= i) continue;
1703
+ const a = `${i}-${s}`;
1704
+ t.has(a) || (t.add(a), r.push({ from: i, to: s, [n]: o[n] ?? "" }));
1535
1705
  }
1536
- return s;
1706
+ return r;
1537
1707
  }
1538
- function Xn({
1708
+ function ir({
1539
1709
  initialFocusedHoleId: e = "",
1540
1710
  sourceFile: n = null,
1541
1711
  extraHoles: t = [],
1542
- plotCount: s = 4
1712
+ plotCount: r = 4
1543
1713
  } = {}) {
1544
- const [r, i] = X([]), [o, a] = X([]), [l, u] = X([]), [c, m] = X([]), [d, f] = X([]), [g, y] = X({}), [b, h] = X(""), [E, A] = X([]), [x, H] = X(""), [O, P] = X(e || ""), [R, V] = X([]), p = _e(null);
1714
+ const [o, i] = K([]), [s, a] = K([]), [l, u] = K([]), [c, d] = K([]), [m, f] = K([]), [y, h] = K({}), [b, g] = K(""), [A, P] = K([]), [U, $] = K(""), [k, O] = K(e || ""), [D, S] = K([]), p = _e(null);
1545
1715
  ne(() => {
1546
- !n || p.current === n || (p.current = n, Pt(n).then((v) => {
1547
- if (!v) return;
1548
- const N = Array.from(new Map(v.map((D) => [D.holeId, D])).values());
1549
- a(N), A(rt({
1550
- holeIds: N.map((D) => D.holeId),
1551
- focusedHoleId: O,
1552
- plotCount: s,
1716
+ !n || p.current === n || (p.current = n, zt(n).then((T) => {
1717
+ if (!T) return;
1718
+ const v = Array.from(new Map(T.map((z) => [z.holeId, z])).values());
1719
+ a(v), P(it({
1720
+ holeIds: v.map((z) => z.holeId),
1721
+ focusedHoleId: k,
1722
+ plotCount: r,
1553
1723
  defaultProp: "",
1554
1724
  categoricalProps: c,
1555
- commentProps: d,
1725
+ commentProps: m,
1556
1726
  numericDefaultChartType: "markers+line"
1557
1727
  }));
1558
- }).catch((v) => {
1559
- console.info("Assay metadata load skipped:", v.message);
1728
+ }).catch((T) => {
1729
+ console.info("Assay metadata load skipped:", T.message);
1560
1730
  }));
1561
- }, [n, O, s, c, d]), ne(() => {
1731
+ }, [n, k, r, c, m]), ne(() => {
1562
1732
  if (!(t != null && t.length)) return;
1563
- const v = t.map((N) => ({ holeId: N.id || N.holeId })).filter((N) => N.holeId);
1564
- a((N) => {
1565
- const D = new Set(N.map((L) => L.holeId)), F = v.filter((L) => !D.has(L.holeId));
1566
- return F.length ? [...N, ...F] : N;
1733
+ const T = t.map((v) => ({ holeId: v.id || v.holeId })).filter((v) => v.holeId);
1734
+ a((v) => {
1735
+ const z = new Set(v.map((C) => C.holeId)), F = T.filter((C) => !z.has(C.holeId));
1736
+ return F.length ? [...v, ...F] : v;
1567
1737
  });
1568
1738
  }, [t]), ne(() => {
1569
- H((v) => v && v.startsWith("Loading ") && v.includes(" for hole ") ? v : "");
1570
- }, [E]), ne(() => {
1571
- if (!o.length) {
1572
- A([]);
1739
+ $((T) => T && T.startsWith("Loading ") && T.includes(" for hole ") ? T : "");
1740
+ }, [A]), ne(() => {
1741
+ if (!s.length) {
1742
+ P([]);
1573
1743
  return;
1574
1744
  }
1575
- const v = st(o.map((N) => N.holeId), O);
1576
- A((N) => Array.from({ length: s }).map((F, L) => {
1577
- var K;
1578
- const U = N[L] || {}, B = o.some((ae) => ae.holeId === U.holeId) ? U.holeId : v[L] || ((K = o[L]) == null ? void 0 : K.holeId) || "", $ = U.property || b, q = Se({
1579
- property: $,
1580
- chartType: U.chartType,
1745
+ const T = st(s.map((v) => v.holeId), k);
1746
+ P((v) => Array.from({ length: r }).map((F, C) => {
1747
+ var X;
1748
+ const B = v[C] || {}, V = s.some((ae) => ae.holeId === B.holeId) ? B.holeId : T[C] || ((X = s[C]) == null ? void 0 : X.holeId) || "", w = B.property || b, q = Te({
1749
+ property: w,
1750
+ chartType: B.chartType,
1581
1751
  categoricalProps: c,
1582
- commentProps: d,
1752
+ commentProps: m,
1583
1753
  numericDefaultChartType: "markers+line"
1584
1754
  });
1585
- return { holeId: B, property: $, chartType: q };
1755
+ return { holeId: V, property: w, chartType: q };
1586
1756
  }));
1587
- }, [o, O, b, c, d, s]), ne(() => {
1757
+ }, [s, k, b, c, m, r]), ne(() => {
1588
1758
  if (!n) return;
1589
- E.map((N) => N.holeId).filter(Boolean).forEach((N) => {
1590
- const D = r.some((L) => (L.id || L.holeId) === N), F = R.includes(N);
1591
- D || F || (V((L) => [...L, N]), Dt(n, N).then((L) => {
1592
- V((U) => U.filter((B) => B !== N)), L && i((U) => {
1593
- const B = Ze(
1594
- [...U.filter((q) => (q.id || q.holeId) !== N), L],
1759
+ A.map((v) => v.holeId).filter(Boolean).forEach((v) => {
1760
+ const z = o.some((C) => (C.id || C.holeId) === v), F = D.includes(v);
1761
+ z || F || (S((C) => [...C, v]), $t(n, v).then((C) => {
1762
+ S((B) => B.filter((V) => V !== v)), C && i((B) => {
1763
+ const V = Je(
1764
+ [...B.filter((q) => (q.id || q.holeId) !== v), C],
1595
1765
  t
1596
- ), $ = Le(B);
1597
- return u($.numericProps), m($.categoricalProps), f($.commentProps), y($.columnMeta), !b && $.defaultProp && (h($.defaultProp), A((q) => q.map((K) => ({
1598
- ...K,
1599
- property: K.property || $.defaultProp,
1600
- chartType: Se({
1601
- property: K.property || $.defaultProp,
1602
- chartType: K.chartType,
1603
- categoricalProps: $.categoricalProps,
1604
- commentProps: $.commentProps,
1766
+ ), w = Ie(V);
1767
+ return u(w.numericProps), d(w.categoricalProps), f(w.commentProps), h(w.columnMeta), !b && w.defaultProp && (g(w.defaultProp), P((q) => q.map((X) => ({
1768
+ ...X,
1769
+ property: X.property || w.defaultProp,
1770
+ chartType: Te({
1771
+ property: X.property || w.defaultProp,
1772
+ chartType: X.chartType,
1773
+ categoricalProps: w.categoricalProps,
1774
+ commentProps: w.commentProps,
1605
1775
  numericDefaultChartType: "markers+line"
1606
1776
  })
1607
- })))), B;
1777
+ })))), V;
1608
1778
  });
1609
- }).catch((L) => {
1610
- console.error(L), V((U) => U.filter((B) => B !== N)), H(L.message || `Error loading hole ${N}`);
1779
+ }).catch((C) => {
1780
+ console.error(C), S((B) => B.filter((V) => V !== v)), $(C.message || `Error loading hole ${v}`);
1611
1781
  }));
1612
1782
  });
1613
- }, [E, n, r, R, b, t]), ne(() => {
1614
- t != null && t.length && i((v) => {
1615
- if (!v.length) {
1616
- const F = Le(t);
1617
- return u(F.numericProps), m(F.categoricalProps), f(F.commentProps), y(F.columnMeta), !b && F.defaultProp && h(F.defaultProp), t;
1783
+ }, [A, n, o, D, b, t]), ne(() => {
1784
+ t != null && t.length && i((T) => {
1785
+ if (!T.length) {
1786
+ const F = Ie(t);
1787
+ return u(F.numericProps), d(F.categoricalProps), f(F.commentProps), h(F.columnMeta), !b && F.defaultProp && g(F.defaultProp), t;
1618
1788
  }
1619
- const N = Ze(v, t), D = Le(N);
1620
- return u(D.numericProps), m(D.categoricalProps), f(D.commentProps), y(D.columnMeta), !b && D.defaultProp && h(D.defaultProp), N;
1789
+ const v = Je(T, t), z = Ie(v);
1790
+ return u(z.numericProps), d(z.categoricalProps), f(z.commentProps), h(z.columnMeta), !b && z.defaultProp && g(z.defaultProp), v;
1621
1791
  });
1622
1792
  }, [t]);
1623
- const T = ee(
1624
- () => [...l, ...c, ...d],
1625
- [l, c, d]
1626
- ), I = ee(
1627
- () => o.map((v) => ({ holeId: v.holeId, label: v.holeId })).sort((v, N) => v.label.localeCompare(N.label)),
1628
- [o]
1629
- ), z = ee(() => {
1630
- const v = [...l, ...c, ...d];
1631
- return Array.from({ length: s }).map((N, D) => {
1632
- const F = E[D] || {}, L = r.find((fe) => (fe.id || fe.holeId) === F.holeId) || null, U = L ? v.filter((fe) => At(L, fe)) : v;
1633
- let B = F.property || b;
1634
- L && !U.includes(B) && (B = U[0] || B);
1635
- const $ = d.includes(B), q = !$ && c.includes(B), K = !$ && !q && B === "dip", ae = $ ? "comment" : K ? "tadpole" : q ? "categorical" : "numeric", be = K ? "tadpole" : F.chartType || ($ ? "comment" : q ? "categorical" : "markers+line"), me = F.holeId || (L == null ? void 0 : L.id) || (L == null ? void 0 : L.holeId) || "", Oe = K ? (L == null ? void 0 : L.points) || [] : $ ? Qt(L, B) : vt(L, B, q);
1793
+ const I = ee(
1794
+ () => [...l, ...c, ...m],
1795
+ [l, c, m]
1796
+ ), _ = ee(
1797
+ () => s.map((T) => ({ holeId: T.holeId, label: T.holeId })).sort((T, v) => T.label.localeCompare(v.label)),
1798
+ [s]
1799
+ ), R = ee(() => {
1800
+ const T = [...l, ...c, ...m];
1801
+ return Array.from({ length: r }).map((v, z) => {
1802
+ const F = A[z] || {}, C = o.find((fe) => (fe.id || fe.holeId) === F.holeId) || null, B = C ? T.filter((fe) => Tt(C, fe)) : T;
1803
+ let V = F.property || b;
1804
+ C && !B.includes(V) && (V = B[0] || V);
1805
+ const w = m.includes(V), q = !w && c.includes(V), X = !w && !q && V === "dip", ae = w ? "comment" : X ? "tadpole" : q ? "categorical" : "numeric", be = X ? "tadpole" : F.chartType || (w ? "comment" : q ? "categorical" : "markers+line"), me = F.holeId || (C == null ? void 0 : C.id) || (C == null ? void 0 : C.holeId) || "", Pe = X ? (C == null ? void 0 : C.points) || [] : w ? un(C, V) : It(C, V, q);
1636
1806
  return {
1637
- config: { holeId: me, property: B, chartType: be },
1638
- hole: L,
1639
- loading: R.includes(F.holeId),
1807
+ config: { holeId: me, property: V, chartType: be },
1808
+ hole: C,
1809
+ loading: D.includes(F.holeId),
1640
1810
  isCategorical: q,
1641
- isComment: $,
1642
- isTadpole: K,
1811
+ isComment: w,
1812
+ isTadpole: X,
1643
1813
  displayType: ae,
1644
- points: Oe,
1645
- propertyOptions: U,
1814
+ points: Pe,
1815
+ propertyOptions: B,
1646
1816
  label: me
1647
1817
  };
1648
1818
  });
1649
- }, [E, r, b, c, d, R, s, l]), w = (v, N) => {
1650
- A((D) => {
1651
- const F = [...D], U = { ...F[v] || {}, ...N };
1652
- return N.property && (U.chartType = Se({
1653
- property: N.property,
1654
- chartType: U.chartType,
1819
+ }, [A, o, b, c, m, D, r, l]), x = (T, v) => {
1820
+ P((z) => {
1821
+ const F = [...z], B = { ...F[T] || {}, ...v };
1822
+ return v.property && (B.chartType = Te({
1823
+ property: v.property,
1824
+ chartType: B.chartType,
1655
1825
  categoricalProps: c,
1656
- commentProps: d,
1826
+ commentProps: m,
1657
1827
  numericDefaultChartType: "markers+line"
1658
- })), F[v] = U, F;
1828
+ })), F[T] = B, F;
1659
1829
  });
1660
1830
  };
1661
1831
  return {
1662
- error: x,
1663
- focusedHoleId: O,
1664
- setFocusedHoleId: P,
1665
- setError: H,
1666
- holeCount: o.length,
1832
+ error: U,
1833
+ focusedHoleId: k,
1834
+ setFocusedHoleId: O,
1835
+ setError: $,
1836
+ holeCount: s.length,
1667
1837
  numericProps: l,
1668
1838
  categoricalProps: c,
1669
- commentProps: d,
1670
- columnMeta: g,
1671
- propertyOptions: T,
1672
- labeledHoleOptions: I,
1673
- traceGraphs: z,
1674
- handleConfigChange: w
1839
+ commentProps: m,
1840
+ columnMeta: y,
1841
+ propertyOptions: I,
1842
+ labeledHoleOptions: _,
1843
+ traceGraphs: R,
1844
+ handleConfigChange: x
1675
1845
  };
1676
1846
  }
1677
- function mt(e) {
1847
+ function ht(e) {
1678
1848
  return Array.isArray(e) ? e : [];
1679
1849
  }
1680
- function Re(e) {
1850
+ function De(e) {
1681
1851
  const n = Number(e);
1682
1852
  return Number.isFinite(n) ? n : void 0;
1683
1853
  }
1684
- function ft(e = {}) {
1854
+ function gt(e = {}) {
1685
1855
  return {
1686
1856
  ...e,
1687
- x: Re(e.x),
1688
- y: Re(e.y),
1689
- z: Re(e.z)
1857
+ x: De(e.x),
1858
+ y: De(e.y),
1859
+ z: De(e.z)
1690
1860
  };
1691
1861
  }
1692
- function en(e = [], n = [0, 0], t = 0) {
1693
- const [s, r] = n, i = Number(t) * Math.PI / 180, o = Math.cos(i), a = Math.sin(i);
1694
- return mt(e).map(ft).map((l) => {
1862
+ function dn(e = [], n = [0, 0], t = 0) {
1863
+ const [r, o] = n, i = Number(t) * Math.PI / 180, s = Math.cos(i), a = Math.sin(i);
1864
+ return ht(e).map(gt).map((l) => {
1695
1865
  if (!Number.isFinite(l.x) || !Number.isFinite(l.y)) return { ...l };
1696
- const u = l.x - s, c = l.y - r;
1866
+ const u = l.x - r, c = l.y - o;
1697
1867
  return {
1698
1868
  ...l,
1699
- along: u * a + c * o,
1700
- across: u * o - c * a
1869
+ along: u * a + c * s,
1870
+ across: u * s - c * a
1701
1871
  };
1702
1872
  });
1703
1873
  }
1704
- function tn(e = [], n = [0, 0], t = 0, s = 50) {
1705
- const r = en(e, n, t), i = 0.5 * Number(s || 0);
1706
- return !Number.isFinite(i) || i <= 0 ? r : r.filter((o) => Number.isFinite(o.across) && Math.abs(o.across) <= i);
1874
+ function mn(e = [], n = [0, 0], t = 0, r = 50) {
1875
+ const o = dn(e, n, t), i = 0.5 * Number(r || 0);
1876
+ return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
1707
1877
  }
1708
- function Zn(e = [], n = null, t = null) {
1709
- let s = mt(e).map(ft);
1878
+ function ar(e = [], n = null, t = null) {
1879
+ let r = ht(e).map(gt);
1710
1880
  if (Array.isArray(n) && n.length === 2) {
1711
- const [r, i] = n;
1712
- s = s.filter((o) => Number.isFinite(o.z) && o.z <= Number(r) && o.z >= Number(i));
1881
+ const [o, i] = n;
1882
+ r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
1713
1883
  }
1714
- return t && (s = s.map((r) => ({
1715
- ...r,
1716
- color_value: r == null ? void 0 : r[t]
1717
- }))), s;
1718
- }
1719
- function Jn(e = [], n = [0, 0], t = 0, s = 50, r = null) {
1720
- let i = tn(e, n, t, s);
1721
- return r && (i = i.map((o) => ({
1884
+ return t && (r = r.map((o) => ({
1722
1885
  ...o,
1723
- color_value: o == null ? void 0 : o[r]
1886
+ color_value: o == null ? void 0 : o[t]
1887
+ }))), r;
1888
+ }
1889
+ function lr(e = [], n = [0, 0], t = 0, r = 50, o = null) {
1890
+ let i = mn(e, n, t, r);
1891
+ return o && (i = i.map((s) => ({
1892
+ ...s,
1893
+ color_value: s == null ? void 0 : s[o]
1724
1894
  }))), i;
1725
1895
  }
1726
1896
  function He(e) {
1727
1897
  return Array.isArray(e) ? e : [];
1728
1898
  }
1729
- function Ue(e = {}) {
1899
+ function Ge(e = {}) {
1730
1900
  return e.hole_id ?? e.holeId ?? e.id;
1731
1901
  }
1732
1902
  function ue(e, n = void 0) {
1733
1903
  const t = Number(e);
1734
1904
  return Number.isFinite(t) ? t : n;
1735
1905
  }
1736
- function Qn(e = [], n = null) {
1906
+ function cr(e = [], n = null) {
1737
1907
  const t = /* @__PURE__ */ new Map();
1738
- He(e).forEach((r) => {
1739
- const i = Ue(r);
1908
+ He(e).forEach((o) => {
1909
+ const i = Ge(o);
1740
1910
  if (i == null || `${i}`.trim() === "") return;
1741
- const o = `${i}`;
1742
- t.has(o) || t.set(o, []), t.get(o).push(r);
1911
+ const s = `${i}`;
1912
+ t.has(s) || t.set(s, []), t.get(s).push(o);
1743
1913
  });
1744
- const s = [];
1745
- return t.forEach((r, i) => {
1746
- const o = [...r].sort((l, u) => ue(l.md, 0) - ue(u.md, 0)), a = {
1914
+ const r = [];
1915
+ return t.forEach((o, i) => {
1916
+ const s = [...o].sort((l, u) => ue(l.md, 0) - ue(u.md, 0)), a = {
1747
1917
  hole_id: i,
1748
- x: o.map((l) => ue(l.x, 0)),
1749
- y: o.map((l) => ue(l.y, 0)),
1750
- z: o.map((l) => ue(l.z, 0)),
1918
+ x: s.map((l) => ue(l.x, 0)),
1919
+ y: s.map((l) => ue(l.y, 0)),
1920
+ z: s.map((l) => ue(l.z, 0)),
1751
1921
  color: null
1752
1922
  };
1753
- n && (a.color = o.map((l) => l == null ? void 0 : l[n])), s.push(a);
1754
- }), s;
1755
- }
1756
- function es(e = [], n = 1, t = null) {
1757
- return He(e).map((s) => ({
1758
- hole_id: Ue(s),
1759
- from: s == null ? void 0 : s.from,
1760
- to: s == null ? void 0 : s.to,
1923
+ n && (a.color = s.map((l) => l == null ? void 0 : l[n])), r.push(a);
1924
+ }), r;
1925
+ }
1926
+ function ur(e = [], n = 1, t = null) {
1927
+ return He(e).map((r) => ({
1928
+ hole_id: Ge(r),
1929
+ from: r == null ? void 0 : r.from,
1930
+ to: r == null ? void 0 : r.to,
1761
1931
  radius: n,
1762
- color: t ? s == null ? void 0 : s[t] : null,
1763
- value: t ? s == null ? void 0 : s[t] : null
1932
+ color: t ? r == null ? void 0 : r[t] : null,
1933
+ value: t ? r == null ? void 0 : r[t] : null
1764
1934
  }));
1765
1935
  }
1766
- function ts(e = [], n = null) {
1936
+ function dr(e = [], n = null) {
1767
1937
  return n ? He(e).filter((t) => Object.prototype.hasOwnProperty.call(t || {}, n)).map((t) => ({
1768
- hole_id: Ue(t),
1938
+ hole_id: Ge(t),
1769
1939
  label: t == null ? void 0 : t[n],
1770
1940
  depth: 0.5 * (ue(t == null ? void 0 : t.from, 0) + ue(t == null ? void 0 : t.to, 0))
1771
1941
  })) : [];
1772
1942
  }
1773
- function ns({
1943
+ function mr({
1774
1944
  controlMode: e = "orbit",
1775
1945
  onToggleFly: n = () => {
1776
1946
  },
1777
1947
  onRecenter: t = () => {
1778
1948
  },
1779
- onLookDown: s = () => {
1949
+ onLookDown: r = () => {
1780
1950
  },
1781
- onFit: r = () => {
1951
+ onFit: o = () => {
1782
1952
  },
1783
1953
  darkBackground: i = !1,
1784
- onToggleDarkBackground: o = () => {
1954
+ onToggleDarkBackground: s = () => {
1785
1955
  }
1786
1956
  }) {
1787
- return /* @__PURE__ */ W("div", { className: "baselode-3d-controls", children: [
1788
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: t, children: "Recenter to (0,0,0)" }),
1789
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: s, children: "Look down" }),
1790
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: r, children: "Fit to scene" }),
1791
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: n, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" }),
1792
- /* @__PURE__ */ W("label", { className: "baselode-3d-controls-checkbox", children: [
1793
- /* @__PURE__ */ S(
1957
+ return /* @__PURE__ */ H("div", { className: "baselode-3d-controls", children: [
1958
+ /* @__PURE__ */ E("button", { type: "button", className: "ghost-button", onClick: t, children: "Recenter to (0,0,0)" }),
1959
+ /* @__PURE__ */ E("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
1960
+ /* @__PURE__ */ E("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
1961
+ /* @__PURE__ */ E("button", { type: "button", className: "ghost-button", onClick: n, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" }),
1962
+ /* @__PURE__ */ H("label", { className: "baselode-3d-controls-checkbox", children: [
1963
+ /* @__PURE__ */ E(
1794
1964
  "input",
1795
1965
  {
1796
1966
  type: "checkbox",
1797
1967
  checked: i,
1798
- onChange: o
1968
+ onChange: s
1799
1969
  }
1800
1970
  ),
1801
1971
  "Dark background"
1802
1972
  ] })
1803
1973
  ] });
1804
1974
  }
1805
- function ss({
1975
+ function fr({
1806
1976
  properties: e = [],
1807
1977
  selectedProperty: n = "",
1808
1978
  onPropertyChange: t = () => {
1809
1979
  },
1810
- opacity: s = 0.85,
1811
- onOpacityChange: r = () => {
1980
+ opacity: r = 0.85,
1981
+ onOpacityChange: o = () => {
1812
1982
  },
1813
1983
  propertyStats: i = null,
1814
- clickedBlock: o = null,
1984
+ clickedBlock: s = null,
1815
1985
  onPopupClose: a = () => {
1816
1986
  }
1817
1987
  }) {
1818
1988
  var l, u;
1819
- return /* @__PURE__ */ W("div", { className: "bm-widget", children: [
1820
- /* @__PURE__ */ S("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
1821
- /* @__PURE__ */ W(
1989
+ return /* @__PURE__ */ H("div", { className: "bm-widget", children: [
1990
+ /* @__PURE__ */ E("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
1991
+ /* @__PURE__ */ H(
1822
1992
  "select",
1823
1993
  {
1824
1994
  id: "bm-property-select",
@@ -1826,34 +1996,34 @@ function ss({
1826
1996
  value: n,
1827
1997
  onChange: (c) => t(c.target.value),
1828
1998
  children: [
1829
- e.length === 0 && /* @__PURE__ */ S("option", { value: "", children: "— no attributes —" }),
1830
- e.map((c) => /* @__PURE__ */ S("option", { value: c, children: c }, c))
1999
+ e.length === 0 && /* @__PURE__ */ E("option", { value: "", children: "— no attributes —" }),
2000
+ e.map((c) => /* @__PURE__ */ E("option", { value: c, children: c }, c))
1831
2001
  ]
1832
2002
  }
1833
2003
  ),
1834
- i && i.type === "numeric" && /* @__PURE__ */ W("div", { className: "bm-widget__scale", children: [
1835
- /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((l = i.min) == null ? void 0 : l.toFixed(2)) ?? "—" }),
1836
- /* @__PURE__ */ S("div", { className: "bm-widget__scale-bar" }),
1837
- /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((u = i.max) == null ? void 0 : u.toFixed(2)) ?? "—" })
2004
+ i && i.type === "numeric" && /* @__PURE__ */ H("div", { className: "bm-widget__scale", children: [
2005
+ /* @__PURE__ */ E("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((l = i.min) == null ? void 0 : l.toFixed(2)) ?? "—" }),
2006
+ /* @__PURE__ */ E("div", { className: "bm-widget__scale-bar" }),
2007
+ /* @__PURE__ */ E("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((u = i.max) == null ? void 0 : u.toFixed(2)) ?? "—" })
1838
2008
  ] }),
1839
- i && i.type === "categorical" && /* @__PURE__ */ S("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, m) => {
1840
- const d = Math.round(m / Math.max(i.categories.length, 1) * 360);
1841
- return /* @__PURE__ */ S(
2009
+ i && i.type === "categorical" && /* @__PURE__ */ E("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, d) => {
2010
+ const m = Math.round(d / Math.max(i.categories.length, 1) * 360);
2011
+ return /* @__PURE__ */ E(
1842
2012
  "span",
1843
2013
  {
1844
2014
  className: "bm-widget__category-chip",
1845
- style: { background: `hsl(${d},70%,50%)` },
2015
+ style: { background: `hsl(${m},70%,50%)` },
1846
2016
  children: c
1847
2017
  },
1848
2018
  c
1849
2019
  );
1850
2020
  }) }),
1851
- /* @__PURE__ */ W("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
2021
+ /* @__PURE__ */ H("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
1852
2022
  "Opacity (",
1853
- Math.round(s * 100),
2023
+ Math.round(r * 100),
1854
2024
  "%)"
1855
2025
  ] }),
1856
- /* @__PURE__ */ S(
2026
+ /* @__PURE__ */ E(
1857
2027
  "input",
1858
2028
  {
1859
2029
  id: "bm-opacity-slider",
@@ -1862,14 +2032,14 @@ function ss({
1862
2032
  min: "0",
1863
2033
  max: "1",
1864
2034
  step: "0.01",
1865
- value: s,
1866
- onChange: (c) => r(parseFloat(c.target.value))
2035
+ value: r,
2036
+ onChange: (c) => o(parseFloat(c.target.value))
1867
2037
  }
1868
2038
  ),
1869
- o && /* @__PURE__ */ W("div", { className: "bm-widget__popup", children: [
1870
- /* @__PURE__ */ W("div", { className: "bm-widget__popup-header", children: [
1871
- /* @__PURE__ */ S("span", { children: "Block attributes" }),
1872
- /* @__PURE__ */ S(
2039
+ s && /* @__PURE__ */ H("div", { className: "bm-widget__popup", children: [
2040
+ /* @__PURE__ */ H("div", { className: "bm-widget__popup-header", children: [
2041
+ /* @__PURE__ */ E("span", { children: "Block attributes" }),
2042
+ /* @__PURE__ */ E(
1873
2043
  "button",
1874
2044
  {
1875
2045
  type: "button",
@@ -1880,163 +2050,163 @@ function ss({
1880
2050
  }
1881
2051
  )
1882
2052
  ] }),
1883
- /* @__PURE__ */ S("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ S("tbody", { children: Object.entries(o).map(([c, m]) => /* @__PURE__ */ W("tr", { children: [
1884
- /* @__PURE__ */ S("th", { children: c }),
1885
- /* @__PURE__ */ S("td", { children: m == null ? "—" : String(m) })
2053
+ /* @__PURE__ */ E("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ E("tbody", { children: Object.entries(s).map(([c, d]) => /* @__PURE__ */ H("tr", { children: [
2054
+ /* @__PURE__ */ E("th", { children: c }),
2055
+ /* @__PURE__ */ E("td", { children: d == null ? "—" : String(d) })
1886
2056
  ] }, c)) }) })
1887
2057
  ] })
1888
2058
  ] });
1889
2059
  }
1890
- const nn = [
2060
+ const fn = [
1891
2061
  { minZoom: 0, lodKey: "thumb" },
1892
2062
  { minZoom: 4, lodKey: "medium" },
1893
2063
  { minZoom: 7, lodKey: "full" }
1894
- ], ht = 50;
1895
- function sn(e, n, t = nn) {
2064
+ ], yt = 50;
2065
+ function pn(e, n, t = fn) {
1896
2066
  var i;
1897
- const s = e.lod_urls;
1898
- if (!s || typeof s != "object" || Array.isArray(s))
2067
+ const r = e.lod_urls;
2068
+ if (!r || typeof r != "object" || Array.isArray(r))
1899
2069
  return e.image_url || "";
1900
- let r = ((i = t[0]) == null ? void 0 : i.lodKey) ?? "thumb";
1901
- for (const o of t)
1902
- n >= o.minZoom && (r = o.lodKey);
1903
- return s[r] || e.image_url || "";
2070
+ let o = ((i = t[0]) == null ? void 0 : i.lodKey) ?? "thumb";
2071
+ for (const s of t)
2072
+ n >= s.minZoom && (o = s.lodKey);
2073
+ return r[o] || e.image_url || "";
1904
2074
  }
1905
- function rn(e) {
2075
+ function hn(e) {
1906
2076
  return [...e].sort((n, t) => (n.from_depth ?? 0) - (t.from_depth ?? 0));
1907
2077
  }
1908
- function on(e) {
2078
+ function gn(e) {
1909
2079
  const n = {};
1910
2080
  for (const t of e) {
1911
- const s = t.photo_set != null && t.photo_set !== "" ? String(t.photo_set) : "default";
1912
- n[s] || (n[s] = []), n[s].push(t);
2081
+ const r = t.photo_set != null && t.photo_set !== "" ? String(t.photo_set) : "default";
2082
+ n[r] || (n[r] = []), n[r].push(t);
1913
2083
  }
1914
2084
  return n;
1915
2085
  }
1916
- function an(e, n, t = 10) {
1917
- const s = [];
1918
- if (e >= n || t <= 0) return s;
1919
- const r = Math.ceil(e / t) * t, i = t * 1e-9;
1920
- for (let o = r; o <= n + i; o += t) {
1921
- const a = Math.round(o * 1e6) / 1e6;
1922
- s.push({ depth: a, label: `${a} m` });
2086
+ function yn(e, n, t = 10) {
2087
+ const r = [];
2088
+ if (e >= n || t <= 0) return r;
2089
+ const o = Math.ceil(e / t) * t, i = t * 1e-9;
2090
+ for (let s = o; s <= n + i; s += t) {
2091
+ const a = Math.round(s * 1e6) / 1e6;
2092
+ r.push({ depth: a, label: `${a} m` });
1923
2093
  }
1924
- return s;
2094
+ return r;
1925
2095
  }
1926
- function ln(e) {
2096
+ function bn(e) {
1927
2097
  return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
1928
2098
  }
1929
- function pt(e) {
2099
+ function bt(e) {
1930
2100
  return `tray_${String(e).padStart(3, "0")}.jpg`;
1931
2101
  }
1932
- function cn(e, n, t, s, r = "Tray Images", i = pt) {
1933
- const o = (t ?? "").replace(/\/$/, ""), a = (s ?? "").replace(/\/$/, "");
2102
+ function _n(e, n, t, r, o = "Tray Images", i = bt) {
2103
+ const s = (t ?? "").replace(/\/$/, ""), a = (r ?? "").replace(/\/$/, "");
1934
2104
  return n.map((l, u) => {
1935
- const c = l.filename ?? i(u), m = l.photoSet ?? r;
2105
+ const c = l.filename ?? i(u), d = l.photoSet ?? o;
1936
2106
  return {
1937
2107
  hole_id: e,
1938
2108
  from_depth: l.fromDepth,
1939
2109
  to_depth: l.toDepth,
1940
- photo_set: m,
1941
- image_url: `${o}/${c}`,
2110
+ photo_set: d,
2111
+ image_url: `${s}/${c}`,
1942
2112
  lod_urls: {
1943
- thumb: `${o}/${c}`,
2113
+ thumb: `${s}/${c}`,
1944
2114
  full: `${a}/${c}`
1945
2115
  }
1946
2116
  };
1947
2117
  });
1948
2118
  }
1949
- function rs(e, n, t = ht) {
1950
- const s = n / 5;
1951
- return Math.max(1, Math.round(e * t * s));
2119
+ function pr(e, n, t = yt) {
2120
+ const r = n / 5;
2121
+ return Math.max(1, Math.round(e * t * r));
1952
2122
  }
1953
- const ze = 5, Je = 1.12, un = 0.05, dn = 40;
1954
- function mn({
2123
+ const Re = 5, Qe = 1.12, Nn = 0.05, vn = 40;
2124
+ function En({
1955
2125
  photos: e = [],
1956
2126
  holeId: n = "",
1957
2127
  initialZoom: t = 5,
1958
- transform: s,
1959
- onTransformChange: r
2128
+ transform: r,
2129
+ onTransformChange: o
1960
2130
  }) {
1961
- const [i, o] = X({ scale: 1, tx: 0, ty: 0 }), a = s ?? i, l = _e(a);
2131
+ const [i, s] = K({ scale: 1, tx: 0, ty: 0 }), a = r ?? i, l = _e(a);
1962
2132
  l.current = a;
1963
- const u = De(
2133
+ const u = Oe(
1964
2134
  (p) => {
1965
- const T = typeof p == "function" ? p(l.current) : p;
1966
- r ? r(T) : o(T);
2135
+ const I = typeof p == "function" ? p(l.current) : p;
2136
+ o ? o(I) : s(I);
1967
2137
  },
1968
- [r]
1969
- ), [c, m] = X(!1), d = _e(null), f = _e(null), g = ee(() => rn(e), [e]), y = ee(() => on(g), [g]), b = ee(() => {
2138
+ [o]
2139
+ ), [c, d] = K(!1), m = _e(null), f = _e(null), y = ee(() => hn(e), [e]), h = ee(() => gn(y), [y]), b = ee(() => {
1970
2140
  const p = /* @__PURE__ */ new Set();
1971
- for (const T of e) {
1972
- const I = T.photo_set != null && T.photo_set !== "" ? String(T.photo_set) : "default";
1973
- p.add(I);
2141
+ for (const I of e) {
2142
+ const _ = I.photo_set != null && I.photo_set !== "" ? String(I.photo_set) : "default";
2143
+ p.add(_);
1974
2144
  }
1975
2145
  return [...p];
1976
- }, [e]), { minDepth: h, maxDepth: E } = ee(() => {
1977
- if (!g.length) return { minDepth: 0, maxDepth: 0 };
1978
- const p = g.map((T) => T.to_depth ?? T.from_depth ?? 0);
2146
+ }, [e]), { minDepth: g, maxDepth: A } = ee(() => {
2147
+ if (!y.length) return { minDepth: 0, maxDepth: 0 };
2148
+ const p = y.map((I) => I.to_depth ?? I.from_depth ?? 0);
1979
2149
  return {
1980
- minDepth: g[0].from_depth ?? 0,
2150
+ minDepth: y[0].from_depth ?? 0,
1981
2151
  maxDepth: Math.max(...p)
1982
2152
  };
1983
- }, [g]), A = ht * ze / 5, x = ee(
1984
- () => Math.max(1, Math.round((E - h) * A)),
1985
- [h, E, A]
1986
- ), H = ee(() => {
1987
- const p = ln(ze);
1988
- return an(h, E, p);
1989
- }, [h, E]), O = 540 * ze / 5, P = ee(
2153
+ }, [y]), P = yt * Re / 5, U = ee(
2154
+ () => Math.max(1, Math.round((A - g) * P)),
2155
+ [g, A, P]
2156
+ ), $ = ee(() => {
2157
+ const p = bn(Re);
2158
+ return yn(g, A, p);
2159
+ }, [g, A]), k = 540 * Re / 5, O = ee(
1990
2160
  () => Math.max(1, Math.min(10, Math.round(t * a.scale))),
1991
2161
  [t, a.scale]
1992
- ), R = De((p) => {
2162
+ ), D = Oe((p) => {
1993
2163
  p.preventDefault();
1994
- const T = p.deltaY < 0 ? Je : 1 / Je, I = f.current.getBoundingClientRect(), z = p.clientX - I.left, w = p.clientY - I.top;
1995
- u((v) => {
1996
- const N = Math.max(un, Math.min(dn, v.scale * T)), D = N / v.scale;
2164
+ const I = p.deltaY < 0 ? Qe : 1 / Qe, _ = f.current.getBoundingClientRect(), R = p.clientX - _.left, x = p.clientY - _.top;
2165
+ u((T) => {
2166
+ const v = Math.max(Nn, Math.min(vn, T.scale * I)), z = v / T.scale;
1997
2167
  return {
1998
- scale: N,
1999
- tx: z - (z - v.tx) * D,
2000
- ty: w - (w - v.ty) * D
2168
+ scale: v,
2169
+ tx: R - (R - T.tx) * z,
2170
+ ty: x - (x - T.ty) * z
2001
2171
  };
2002
2172
  });
2003
2173
  }, [u]);
2004
2174
  ne(() => {
2005
2175
  const p = f.current;
2006
2176
  if (p)
2007
- return p.addEventListener("wheel", R, { passive: !1 }), () => p.removeEventListener("wheel", R);
2008
- }, [R]);
2009
- const V = De((p) => {
2010
- p.button === 0 && (p.preventDefault(), d.current = {
2177
+ return p.addEventListener("wheel", D, { passive: !1 }), () => p.removeEventListener("wheel", D);
2178
+ }, [D]);
2179
+ const S = Oe((p) => {
2180
+ p.button === 0 && (p.preventDefault(), m.current = {
2011
2181
  x: p.clientX,
2012
2182
  y: p.clientY,
2013
2183
  tx: l.current.tx,
2014
2184
  ty: l.current.ty
2015
- }, m(!0));
2185
+ }, d(!0));
2016
2186
  }, []);
2017
2187
  return ne(() => {
2018
- const p = (I) => {
2019
- if (!d.current) return;
2020
- const { tx: z, ty: w, x: v, y: N } = d.current;
2021
- u((D) => ({
2022
- ...D,
2023
- tx: z + (I.clientX - v),
2024
- ty: w + (I.clientY - N)
2188
+ const p = (_) => {
2189
+ if (!m.current) return;
2190
+ const { tx: R, ty: x, x: T, y: v } = m.current;
2191
+ u((z) => ({
2192
+ ...z,
2193
+ tx: R + (_.clientX - T),
2194
+ ty: x + (_.clientY - v)
2025
2195
  }));
2026
- }, T = () => {
2027
- d.current = null, m(!1);
2196
+ }, I = () => {
2197
+ m.current = null, d(!1);
2028
2198
  };
2029
- return window.addEventListener("mousemove", p), window.addEventListener("mouseup", T), () => {
2030
- window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", T);
2199
+ return window.addEventListener("mousemove", p), window.addEventListener("mouseup", I), () => {
2200
+ window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", I);
2031
2201
  };
2032
- }, [u]), /* @__PURE__ */ W("div", { className: "core-photo-table", children: [
2033
- /* @__PURE__ */ W("div", { className: "core-photo-controls", children: [
2034
- n && /* @__PURE__ */ S("span", { className: "core-photo-hole-id", children: n }),
2035
- /* @__PURE__ */ W("span", { className: "core-photo-zoom-label", children: [
2202
+ }, [u]), /* @__PURE__ */ H("div", { className: "core-photo-table", children: [
2203
+ /* @__PURE__ */ H("div", { className: "core-photo-controls", children: [
2204
+ n && /* @__PURE__ */ E("span", { className: "core-photo-hole-id", children: n }),
2205
+ /* @__PURE__ */ H("span", { className: "core-photo-zoom-label", children: [
2036
2206
  Math.round(a.scale * 100),
2037
2207
  "%"
2038
2208
  ] }),
2039
- /* @__PURE__ */ S(
2209
+ /* @__PURE__ */ E(
2040
2210
  "button",
2041
2211
  {
2042
2212
  className: "core-photo-zoom-btn",
@@ -2047,88 +2217,88 @@ function mn({
2047
2217
  }
2048
2218
  )
2049
2219
  ] }),
2050
- e.length > 0 && /* @__PURE__ */ W("div", { className: "core-photo-col-headers", children: [
2051
- /* @__PURE__ */ S("div", { className: "core-photo-ruler-spacer" }),
2052
- b.map((p) => /* @__PURE__ */ S(
2220
+ e.length > 0 && /* @__PURE__ */ H("div", { className: "core-photo-col-headers", children: [
2221
+ /* @__PURE__ */ E("div", { className: "core-photo-ruler-spacer" }),
2222
+ b.map((p) => /* @__PURE__ */ E(
2053
2223
  "div",
2054
2224
  {
2055
2225
  className: "core-photo-set-header",
2056
- style: { width: O },
2226
+ style: { width: k },
2057
2227
  children: p
2058
2228
  },
2059
2229
  p
2060
2230
  ))
2061
2231
  ] }),
2062
- e.length === 0 ? /* @__PURE__ */ S("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ S(
2232
+ e.length === 0 ? /* @__PURE__ */ E("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ E(
2063
2233
  "div",
2064
2234
  {
2065
2235
  className: `core-photo-scroll${c ? " is-dragging" : ""}`,
2066
2236
  ref: f,
2067
- onMouseDown: V,
2068
- children: /* @__PURE__ */ W(
2237
+ onMouseDown: S,
2238
+ children: /* @__PURE__ */ H(
2069
2239
  "div",
2070
2240
  {
2071
2241
  className: "core-photo-inner",
2072
2242
  style: {
2073
- height: x,
2243
+ height: U,
2074
2244
  transform: `translate(${a.tx}px, ${a.ty}px) scale(${a.scale})`,
2075
2245
  transformOrigin: "0 0"
2076
2246
  },
2077
2247
  children: [
2078
- /* @__PURE__ */ S(
2248
+ /* @__PURE__ */ E(
2079
2249
  "div",
2080
2250
  {
2081
2251
  className: "core-photo-depth-ruler",
2082
- style: { height: x },
2083
- children: H.map(({ depth: p, label: T }) => /* @__PURE__ */ S(
2252
+ style: { height: U },
2253
+ children: $.map(({ depth: p, label: I }) => /* @__PURE__ */ E(
2084
2254
  "div",
2085
2255
  {
2086
2256
  className: "core-photo-depth-marker",
2087
2257
  style: {
2088
- top: Math.round((p - h) * A)
2258
+ top: Math.round((p - g) * P)
2089
2259
  },
2090
- children: T
2260
+ children: I
2091
2261
  },
2092
2262
  p
2093
2263
  ))
2094
2264
  }
2095
2265
  ),
2096
- b.map((p) => /* @__PURE__ */ S(
2266
+ b.map((p) => /* @__PURE__ */ E(
2097
2267
  "div",
2098
2268
  {
2099
2269
  className: "core-photo-col-body",
2100
- style: { height: x, width: O },
2101
- children: y[p].map((T) => {
2102
- const I = T.from_depth ?? 0, z = T.to_depth ?? I, w = Math.round(
2103
- (I - h) * A
2104
- ), v = Math.max(
2270
+ style: { height: U, width: k },
2271
+ children: h[p].map((I) => {
2272
+ const _ = I.from_depth ?? 0, R = I.to_depth ?? _, x = Math.round(
2273
+ (_ - g) * P
2274
+ ), T = Math.max(
2105
2275
  2,
2106
- Math.round((z - I) * A)
2107
- ), N = sn(T, P);
2108
- return /* @__PURE__ */ W(
2276
+ Math.round((R - _) * P)
2277
+ ), v = pn(I, O);
2278
+ return /* @__PURE__ */ H(
2109
2279
  "div",
2110
2280
  {
2111
2281
  className: "core-photo-item",
2112
- style: { top: w, height: v, width: O },
2113
- title: `${I}–${z} m`,
2282
+ style: { top: x, height: T, width: k },
2283
+ title: `${_}–${R} m`,
2114
2284
  children: [
2115
- N ? /* @__PURE__ */ S(
2285
+ v ? /* @__PURE__ */ E(
2116
2286
  "img",
2117
2287
  {
2118
- src: N,
2119
- alt: `Core ${I}–${z} m`,
2288
+ src: v,
2289
+ alt: `Core ${_}–${R} m`,
2120
2290
  loading: "lazy"
2121
2291
  }
2122
- ) : /* @__PURE__ */ S("div", { className: "core-photo-no-image" }),
2123
- v >= 18 && /* @__PURE__ */ W("span", { className: "core-photo-item-label", children: [
2124
- I,
2292
+ ) : /* @__PURE__ */ E("div", { className: "core-photo-no-image" }),
2293
+ T >= 18 && /* @__PURE__ */ H("span", { className: "core-photo-item-label", children: [
2294
+ _,
2125
2295
  "–",
2126
- z,
2296
+ R,
2127
2297
  " m"
2128
2298
  ] })
2129
2299
  ]
2130
2300
  },
2131
- `${T.hole_id ?? ""}-${I}-${z}-${p}`
2301
+ `${I.hole_id ?? ""}-${_}-${R}-${p}`
2132
2302
  );
2133
2303
  })
2134
2304
  },
@@ -2141,33 +2311,33 @@ function mn({
2141
2311
  )
2142
2312
  ] });
2143
2313
  }
2144
- function os({
2314
+ function hr({
2145
2315
  holeId: e = "",
2146
2316
  trays: n = [],
2147
2317
  thumbBaseUrl: t = "",
2148
- fullBaseUrl: s = "",
2149
- photoSet: r = "Tray Images",
2150
- getFilename: i = pt,
2151
- initialZoom: o = 5,
2318
+ fullBaseUrl: r = "",
2319
+ photoSet: o = "Tray Images",
2320
+ getFilename: i = bt,
2321
+ initialZoom: s = 5,
2152
2322
  transform: a,
2153
2323
  onTransformChange: l
2154
2324
  }) {
2155
2325
  const u = ee(
2156
- () => cn(e, n, t, s, r, i),
2157
- [e, n, t, s, r, i]
2326
+ () => _n(e, n, t, r, o, i),
2327
+ [e, n, t, r, o, i]
2158
2328
  );
2159
- return /* @__PURE__ */ S(
2160
- mn,
2329
+ return /* @__PURE__ */ E(
2330
+ En,
2161
2331
  {
2162
2332
  photos: u,
2163
2333
  holeId: e,
2164
- initialZoom: o,
2334
+ initialZoom: s,
2165
2335
  transform: a,
2166
2336
  onTransformChange: l
2167
2337
  }
2168
2338
  );
2169
2339
  }
2170
- function is(e) {
2340
+ function gr(e) {
2171
2341
  const n = typeof e == "string" ? JSON.parse(e) : e;
2172
2342
  if (n.schema_version !== "1.0")
2173
2343
  throw new Error(
@@ -2175,18 +2345,18 @@ function is(e) {
2175
2345
  );
2176
2346
  if (!Array.isArray(n.blocks))
2177
2347
  throw new Error('"blocks" must be a JSON array.');
2178
- const t = n.blocks.map((s, r) => {
2179
- if (s.id == null) throw new Error(`Block at index ${r} is missing required field "id".`);
2180
- if (s.name == null) throw new Error(`Block "${s.id}" is missing required field "name".`);
2181
- if (!Array.isArray(s.vertices)) throw new Error(`Block "${s.id}" is missing required field "vertices".`);
2182
- if (!Array.isArray(s.triangles)) throw new Error(`Block "${s.id}" is missing required field "triangles".`);
2348
+ const t = n.blocks.map((r, o) => {
2349
+ if (r.id == null) throw new Error(`Block at index ${o} is missing required field "id".`);
2350
+ if (r.name == null) throw new Error(`Block "${r.id}" is missing required field "name".`);
2351
+ if (!Array.isArray(r.vertices)) throw new Error(`Block "${r.id}" is missing required field "vertices".`);
2352
+ if (!Array.isArray(r.triangles)) throw new Error(`Block "${r.id}" is missing required field "triangles".`);
2183
2353
  return {
2184
- id: s.id,
2185
- name: s.name,
2186
- vertices: s.vertices,
2187
- triangles: s.triangles,
2188
- attributes: s.attributes ?? {},
2189
- material: s.material ?? {}
2354
+ id: r.id,
2355
+ name: r.name,
2356
+ vertices: r.vertices,
2357
+ triangles: r.triangles,
2358
+ attributes: r.attributes ?? {},
2359
+ material: r.material ?? {}
2190
2360
  };
2191
2361
  });
2192
2362
  return {
@@ -2195,244 +2365,244 @@ function is(e) {
2195
2365
  blocks: t
2196
2366
  };
2197
2367
  }
2198
- function fn(e) {
2368
+ function An(e) {
2199
2369
  const n = new Q.BufferGeometry(), t = new Float32Array(e.vertices.length * 3);
2200
- e.vertices.forEach(([r, i, o], a) => {
2201
- t[a * 3] = r, t[a * 3 + 1] = i, t[a * 3 + 2] = o;
2370
+ e.vertices.forEach(([o, i, s], a) => {
2371
+ t[a * 3] = o, t[a * 3 + 1] = i, t[a * 3 + 2] = s;
2202
2372
  }), n.setAttribute("position", new Q.BufferAttribute(t, 3));
2203
- const s = new Uint32Array(e.triangles.length * 3);
2204
- return e.triangles.forEach(([r, i, o], a) => {
2205
- s[a * 3] = r, s[a * 3 + 1] = i, s[a * 3 + 2] = o;
2206
- }), n.setIndex(new Q.BufferAttribute(s, 1)), n;
2373
+ const r = new Uint32Array(e.triangles.length * 3);
2374
+ return e.triangles.forEach(([o, i, s], a) => {
2375
+ r[a * 3] = o, r[a * 3 + 1] = i, r[a * 3 + 2] = s;
2376
+ }), n.setIndex(new Q.BufferAttribute(r, 1)), n;
2207
2377
  }
2208
- function as(e, n, t = {}) {
2209
- const { defaultOpacity: s = 1 } = t, r = new Q.Group();
2378
+ function yr(e, n, t = {}) {
2379
+ const { defaultOpacity: r = 1 } = t, o = new Q.Group();
2210
2380
  return n.blocks.forEach((i) => {
2211
- var y, b;
2212
- const o = fn(i), a = ((y = i.material) == null ? void 0 : y.color) ?? "#888888", l = ((b = i.material) == null ? void 0 : b.opacity) ?? s, u = l < 1, c = new Q.MeshStandardMaterial({
2381
+ var h, b;
2382
+ const s = An(i), a = ((h = i.material) == null ? void 0 : h.color) ?? "#888888", l = ((b = i.material) == null ? void 0 : b.opacity) ?? r, u = l < 1, c = new Q.MeshStandardMaterial({
2213
2383
  color: new Q.Color(a),
2214
2384
  opacity: l,
2215
2385
  transparent: u,
2216
2386
  side: Q.DoubleSide,
2217
2387
  flatShading: !0
2218
- }), m = new Q.Mesh(o, c);
2219
- m.userData = {
2388
+ }), d = new Q.Mesh(s, c);
2389
+ d.userData = {
2220
2390
  id: i.id,
2221
2391
  attributes: i.attributes
2222
2392
  };
2223
- const d = new Q.EdgesGeometry(o, 15), f = new Q.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), g = new Q.LineSegments(d, f);
2224
- g.visible = !1, m.add(g), r.add(m);
2225
- }), e.add(r), r;
2393
+ const m = new Q.EdgesGeometry(s, 15), f = new Q.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), y = new Q.LineSegments(m, f);
2394
+ y.visible = !1, d.add(y), o.add(d);
2395
+ }), e.add(o), o;
2226
2396
  }
2227
2397
  export {
2228
- us as ALPHA,
2229
- ds as ASSAY_COLOR_PALETTE_10,
2230
- It as ASSAY_NON_VALUE_FIELDS,
2231
- j as AZIMUTH,
2232
- ms as BASELODE_COLORWAY,
2233
- fs as BASELODE_DARK,
2234
- hs as BASELODE_DARK_TEMPLATE,
2235
- ps as BASELODE_DARK_TEMPLATE_NAME,
2236
- ys as BASELODE_DATA_MODEL_DRILL_ASSAY,
2237
- gs as BASELODE_DATA_MODEL_DRILL_COLLAR,
2238
- _t as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
2239
- bs as BASELODE_DATA_MODEL_DRILL_SURVEY,
2240
- _s as BASELODE_DATA_MODEL_GEOPHYSICS,
2241
- Ns as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
2242
- Es as BASELODE_DATA_MODEL_SURFACE_SAMPLE,
2243
- As as BASELODE_LIGHT,
2244
- vs as BASELODE_LIGHT_TEMPLATE,
2245
- Is as BASELODE_LIGHT_TEMPLATE_NAME,
2246
- $e as BASELODE_TEMPLATE,
2247
- Ss as BASELODE_TEMPLATE_NAME,
2248
- ht as BASE_PIXELS_PER_METRE,
2249
- Ls as BETA,
2250
- Cs as BUILTIN_COLOUR_MAPS,
2251
- ns as Baselode3DControls,
2252
- Ts as Baselode3DScene,
2253
- ss as BlockModelWidget,
2254
- Ms as CHART_OPTIONS,
2255
- Os as COLLAR_ID,
2256
- Ps as COMMENTS,
2257
- Ds as COMMENT_COLUMN_NAMES,
2258
- xs as COMMODITY_COLOURS,
2259
- Rs as CRS,
2260
- mn as CorePhotoTable,
2261
- os as CorePhotoViewer,
2262
- zs as DATASOURCE,
2263
- Fs as DATASOURCE_HOLE_ID,
2264
- $s as DATASOURCE_SAMPLE_ID,
2265
- ks as DATASOURCE_SURFACE_SAMPLE_ID,
2266
- ws as DATE_END,
2267
- Hs as DATE_START,
2268
- Us as DEFAULT_COLUMN_MAP,
2269
- nn as DEFAULT_LOD_BREAKPOINTS,
2270
- G as DEPTH,
2271
- Y as DIP,
2272
- Be as DISPLAY_CATEGORICAL,
2273
- Pe as DISPLAY_COMMENT,
2274
- Bs as DISPLAY_HIDDEN,
2275
- Nt as DISPLAY_NUMERIC,
2276
- Ge as DISPLAY_TADPOLE,
2277
- pe as EASTING,
2278
- ve as ELEVATION,
2279
- Gs as ERROR_COLOR,
2280
- Vs as EXTRA,
2281
- js as FALLBACK_COLOUR,
2282
- Ys as FOV_MAX_DEG,
2283
- Ws as FOV_MIN_DEG,
2284
- C as FROM,
2398
+ Nr as ALPHA,
2399
+ vr as ASSAY_COLOR_PALETTE_10,
2400
+ Lt as ASSAY_NON_VALUE_FIELDS,
2401
+ Y as AZIMUTH,
2402
+ Er as BASELODE_COLORWAY,
2403
+ Ar as BASELODE_DARK,
2404
+ Sr as BASELODE_DARK_TEMPLATE,
2405
+ Tr as BASELODE_DARK_TEMPLATE_NAME,
2406
+ Ir as BASELODE_DATA_MODEL_DRILL_ASSAY,
2407
+ Cr as BASELODE_DATA_MODEL_DRILL_COLLAR,
2408
+ Et as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
2409
+ Lr as BASELODE_DATA_MODEL_DRILL_SURVEY,
2410
+ Mr as BASELODE_DATA_MODEL_GEOPHYSICS,
2411
+ Pr as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
2412
+ Or as BASELODE_DATA_MODEL_SURFACE_SAMPLE,
2413
+ xr as BASELODE_LIGHT,
2414
+ Dr as BASELODE_LIGHT_TEMPLATE,
2415
+ Rr as BASELODE_LIGHT_TEMPLATE_NAME,
2416
+ ke as BASELODE_TEMPLATE,
2417
+ zr as BASELODE_TEMPLATE_NAME,
2418
+ yt as BASE_PIXELS_PER_METRE,
2419
+ $r as BETA,
2420
+ kr as BUILTIN_COLOUR_MAPS,
2421
+ mr as Baselode3DControls,
2422
+ Fr as Baselode3DScene,
2423
+ fr as BlockModelWidget,
2424
+ wr as CHART_OPTIONS,
2425
+ Hr as COLLAR_ID,
2426
+ Gr as COMMENTS,
2427
+ Ur as COMMENT_COLUMN_NAMES,
2428
+ Br as COMMODITY_COLOURS,
2429
+ Vr as CRS,
2430
+ En as CorePhotoTable,
2431
+ hr as CorePhotoViewer,
2432
+ jr as DATASOURCE,
2433
+ Yr as DATASOURCE_HOLE_ID,
2434
+ Wr as DATASOURCE_SAMPLE_ID,
2435
+ qr as DATASOURCE_SURFACE_SAMPLE_ID,
2436
+ Xr as DATE_END,
2437
+ Kr as DATE_START,
2438
+ Zr as DEFAULT_COLUMN_MAP,
2439
+ fn as DEFAULT_LOD_BREAKPOINTS,
2440
+ j as DEPTH,
2441
+ W as DIP,
2442
+ Ue as DISPLAY_CATEGORICAL,
2443
+ ze as DISPLAY_COMMENT,
2444
+ Jr as DISPLAY_HIDDEN,
2445
+ At as DISPLAY_NUMERIC,
2446
+ tt as DISPLAY_TADPOLE,
2447
+ he as EASTING,
2448
+ Ae as ELEVATION,
2449
+ Qr as ERROR_COLOR,
2450
+ eo as EXTRA,
2451
+ to as FALLBACK_COLOUR,
2452
+ no as FOV_MAX_DEG,
2453
+ ro as FOV_MIN_DEG,
2454
+ L as FROM,
2285
2455
  le as GEOLOGY_CODE,
2286
2456
  ce as GEOLOGY_DESCRIPTION,
2287
- qs as GEOPHYSICS_NULL,
2288
- Qe as GEOPHYSICS_NULL_SENTINEL,
2289
- Ks as HIDDEN_COLUMNS,
2290
- _ as HOLE_ID,
2291
- Xs as HOLE_TYPE,
2292
- se as LATITUDE,
2293
- Zs as LITHOLOGY_COLOURS,
2294
- re as LONGITUDE,
2295
- Js as MAX_DEPTH,
2296
- Ee as MID,
2297
- ye as NORTHING,
2298
- Qs as NUMERIC_LINE_COLOR,
2299
- er as NUMERIC_MARKER_COLOR,
2457
+ oo as GEOPHYSICS_NULL,
2458
+ et as GEOPHYSICS_NULL_SENTINEL,
2459
+ so as HIDDEN_COLUMNS,
2460
+ N as HOLE_ID,
2461
+ io as HOLE_TYPE,
2462
+ re as LATITUDE,
2463
+ ao as LITHOLOGY_COLOURS,
2464
+ oe as LONGITUDE,
2465
+ lo as MAX_DEPTH,
2466
+ ve as MID,
2467
+ ge as NORTHING,
2468
+ co as NUMERIC_LINE_COLOR,
2469
+ uo as NUMERIC_MARKER_COLOR,
2300
2470
  de as PROJECT_ID,
2301
- tr as REPORT_NUMBER,
2302
- nr as SAMPLE_ID,
2303
- sr as STRIKE,
2304
- rr as STRIP_LOG_DEFAULT_COLOR,
2305
- or as STRIP_LOG_DEFAULT_LATERAL_OFFSET,
2306
- ir as STRIP_LOG_DEFAULT_PANEL_WIDTH,
2307
- ar as SURFACE_SAMPLE_ID,
2308
- lr as SURFACE_SAMPLE_TYPE,
2309
- cr as SURVEY_TYPE,
2471
+ mo as REPORT_NUMBER,
2472
+ fo as SAMPLE_ID,
2473
+ po as STRIKE,
2474
+ ho as STRIP_LOG_DEFAULT_COLOR,
2475
+ go as STRIP_LOG_DEFAULT_LATERAL_OFFSET,
2476
+ yo as STRIP_LOG_DEFAULT_PANEL_WIDTH,
2477
+ bo as SURFACE_SAMPLE_ID,
2478
+ _o as SURFACE_SAMPLE_TYPE,
2479
+ No as SURVEY_TYPE,
2310
2480
  M as TO,
2311
- Kn as TracePlot,
2312
- as as addGradeBlocksToScene,
2313
- ur as addRasterOverlay,
2314
- dr as alphaBetaToNormal,
2315
- ts as annotationsFromIntervals,
2316
- kn as assembleDataset,
2317
- Mn as attachAssayPositions,
2318
- Cn as balancedTangentialDesurvey,
2319
- xt as buildAssayState,
2320
- mr as buildCategoricalStripLogConfig,
2321
- Zt as buildCommentsConfig,
2322
- an as buildDepthMarkers,
2323
- fr as buildEqualRangeColorScale,
2324
- vt as buildIntervalPoints,
2325
- Et as buildPlotConfig,
2326
- qn as buildStrikeDipSymbol,
2327
- hr as buildStripLogGroup,
2328
- pr as buildStripLogLinePoints,
2329
- yr as buildStructuralDiscs,
2330
- Wn as buildStructuralStripConfig,
2331
- Xt as buildTadpoleConfig,
2332
- Tn as buildTraces,
2333
- cn as buildTrayPhotos,
2334
- gr as buildViewSignature,
2335
- br as calculateBlockVolume,
2336
- _r as calculatePropertyStats,
2337
- bt as classifyColumns,
2338
- Nr as clearRasterOverlays,
2339
- Er as clearStripLogs,
2340
- $n as coerceNumeric,
2341
- Ar as computeStructuralPositions,
2342
- vr as createRasterOverlay,
2343
- Ir as defaultChartType,
2344
- pt as defaultTrayFilename,
2345
- rs as depthIntervalToPixels,
2346
- ln as depthMarkerInterval,
2347
- Le as deriveAssayProps,
2348
- Sn as desurveyTraces,
2349
- Sr as dipAzimuthToNormal,
2350
- Lr as dolly,
2351
- Cr as emitViewChangeIfNeeded,
2352
- Tr as filterBlocks,
2353
- Fn as filterByProject,
2354
- Mr as fitCameraToBounds,
2355
- Or as focusOnLastBounds,
2356
- jn as geophysicsToStripLogs,
2357
- Pr as getBlockStats,
2358
- Dr as getCategoryHexColor,
2359
- et as getChartOptions,
2360
- xr as getColorForValue,
2361
- Rr as getColour,
2362
- zr as getEqualRangeBinIndex,
2363
- Fr as getEqualRangeColor,
2364
- $r as getHoleVerticalExtent,
2365
- kr as getRasterOverlay,
2366
- wr as getViewState,
2367
- fn as gradeBlockToThreeGeometry,
2368
- on as groupPhotosBySet,
2369
- Bt as groupRowsByHole,
2370
- At as holeHasData,
2371
- Hr as interpolateTrace,
2372
- es as intervalsAsTubes,
2373
- zn as joinAssaysToTraces,
2374
- Ur as listRasterOverlays,
2375
- vn as loadAssayFile,
2376
- Dt as loadAssayHole,
2377
- Pt as loadAssayMetadata,
2378
- xn as loadAssays,
2379
- Br as loadBlockModelMetadata,
2380
- Pn as loadCollars,
2381
- Rn as loadGeology,
2382
- is as loadGradeBlocksFromJson,
2383
- Dn as loadSurveys,
2481
+ sr as TracePlot,
2482
+ yr as addGradeBlocksToScene,
2483
+ vo as addRasterOverlay,
2484
+ Eo as alphaBetaToNormal,
2485
+ dr as annotationsFromIntervals,
2486
+ qn as assembleDataset,
2487
+ wn as attachAssayPositions,
2488
+ kn as balancedTangentialDesurvey,
2489
+ kt as buildAssayState,
2490
+ Ao as buildCategoricalStripLogConfig,
2491
+ nn as buildCommentsConfig,
2492
+ yn as buildDepthMarkers,
2493
+ So as buildEqualRangeColorScale,
2494
+ It as buildIntervalPoints,
2495
+ St as buildPlotConfig,
2496
+ or as buildStrikeDipSymbol,
2497
+ To as buildStripLogGroup,
2498
+ Io as buildStripLogLinePoints,
2499
+ Co as buildStructuralDiscs,
2500
+ rr as buildStructuralStripConfig,
2501
+ tn as buildTadpoleConfig,
2502
+ Fn as buildTraces,
2503
+ _n as buildTrayPhotos,
2504
+ Lo as buildViewSignature,
2505
+ Mo as calculateBlockVolume,
2506
+ Po as calculatePropertyStats,
2507
+ vt as classifyColumns,
2508
+ Oo as clearRasterOverlays,
2509
+ xo as clearStripLogs,
2510
+ Wn as coerceNumeric,
2511
+ Do as computeStructuralPositions,
2512
+ Ro as createRasterOverlay,
2513
+ zo as defaultChartType,
2514
+ bt as defaultTrayFilename,
2515
+ pr as depthIntervalToPixels,
2516
+ bn as depthMarkerInterval,
2517
+ Ie as deriveAssayProps,
2518
+ zn as desurveyTraces,
2519
+ $o as dipAzimuthToNormal,
2520
+ ko as dolly,
2521
+ Fo as emitViewChangeIfNeeded,
2522
+ wo as filterBlocks,
2523
+ Yn as filterByProject,
2524
+ Ho as fitCameraToBounds,
2525
+ Go as focusOnLastBounds,
2526
+ tr as geophysicsToStripLogs,
2527
+ Uo as getBlockStats,
2528
+ Bo as getCategoryHexColor,
2529
+ nt as getChartOptions,
2530
+ Vo as getColorForValue,
2531
+ jo as getColour,
2532
+ Yo as getEqualRangeBinIndex,
2533
+ Wo as getEqualRangeColor,
2534
+ qo as getHoleVerticalExtent,
2535
+ Xo as getRasterOverlay,
2536
+ Ko as getViewState,
2537
+ An as gradeBlockToThreeGeometry,
2538
+ gn as groupPhotosBySet,
2539
+ Yt as groupRowsByHole,
2540
+ Tt as holeHasData,
2541
+ Zo as interpolateTrace,
2542
+ ur as intervalsAsTubes,
2543
+ jn as joinAssaysToTraces,
2544
+ Jo as listRasterOverlays,
2545
+ Dn as loadAssayFile,
2546
+ $t as loadAssayHole,
2547
+ zt as loadAssayMetadata,
2548
+ Bn as loadAssays,
2549
+ Qo as loadBlockModelMetadata,
2550
+ Gn as loadCollars,
2551
+ Vn as loadGeology,
2552
+ gr as loadGradeBlocksFromJson,
2553
+ Un as loadSurveys,
2384
2554
  Me as loadTable,
2385
- Gr as logDataInfo,
2386
- Vr as logDataWarning,
2387
- jr as lookDown,
2388
- Ft as minimumCurvatureDesurvey,
2389
- Yr as normalizeBlockRow,
2390
- Wr as normalizeBounds,
2391
- En as normalizeCsvRow,
2392
- Ie as normalizeFieldName,
2393
- qr as normalizeStripLogOptions,
2394
- Kr as pan,
2395
- Vt as parseAssayCsvTextToHoles,
2396
- Tt as parseAssayHole,
2397
- Nn as parseAssayHoleIds,
2398
- Ct as parseAssayHoleIdsWithAssays,
2399
- Mt as parseAssaysCSV,
2400
- Xr as parseBlockModelCSV,
2401
- On as parseDrillholesCSV,
2402
- jt as parseGeologyCsvText,
2403
- Vn as parseGeophysicsCSV,
2404
- Yn as parseLasFile,
2405
- Gt as parseStructuralCSV,
2406
- Un as parseStructuralIntervalsCSV,
2407
- Hn as parseStructuralPointsCSV,
2408
- In as parseSurveyCSV,
2409
- Bn as parseUnifiedDataset,
2410
- An as pickFirstPresent,
2411
- Zn as planView,
2412
- en as projectTraceToSection,
2413
- Zr as recenterCameraToOrigin,
2414
- Jr as removeRasterOverlay,
2555
+ es as logDataInfo,
2556
+ ts as logDataWarning,
2557
+ ns as lookDown,
2558
+ Ht as minimumCurvatureDesurvey,
2559
+ rs as normalizeBlockRow,
2560
+ os as normalizeBounds,
2561
+ On as normalizeCsvRow,
2562
+ Se as normalizeFieldName,
2563
+ ss as normalizeStripLogOptions,
2564
+ is as pan,
2565
+ qt as parseAssayCsvTextToHoles,
2566
+ xt as parseAssayHole,
2567
+ Pn as parseAssayHoleIds,
2568
+ Ot as parseAssayHoleIdsWithAssays,
2569
+ Dt as parseAssaysCSV,
2570
+ as as parseBlockModelCSV,
2571
+ Hn as parseDrillholesCSV,
2572
+ Xt as parseGeologyCsvText,
2573
+ er as parseGeophysicsCSV,
2574
+ nr as parseLasFile,
2575
+ Wt as parseStructuralCSV,
2576
+ Zn as parseStructuralIntervalsCSV,
2577
+ Kn as parseStructuralPointsCSV,
2578
+ Rn as parseSurveyCSV,
2579
+ Jn as parseUnifiedDataset,
2580
+ xn as pickFirstPresent,
2581
+ ar as planView,
2582
+ dn as projectTraceToSection,
2583
+ ls as recenterCameraToOrigin,
2584
+ cs as removeRasterOverlay,
2415
2585
  st as reorderHoleIds,
2416
- Qr as resolveColourMap,
2417
- Jn as sectionView,
2418
- tn as sectionWindow,
2419
- sn as selectPhotoLodUrl,
2420
- eo as setControlMode,
2421
- to as setFov,
2422
- no as setRasterOverlayElevation,
2423
- so as setRasterOverlayOpacity,
2424
- ro as setRasterOverlayVisibility,
2425
- oo as setStripLogs,
2426
- io as setViewState,
2427
- Gn as significantIntercepts,
2428
- rn as sortPhotosByDepth,
2586
+ us as resolveColourMap,
2587
+ lr as sectionView,
2588
+ mn as sectionWindow,
2589
+ pn as selectPhotoLodUrl,
2590
+ ds as setControlMode,
2591
+ ms as setFov,
2592
+ fs as setRasterOverlayElevation,
2593
+ ps as setRasterOverlayOpacity,
2594
+ hs as setRasterOverlayVisibility,
2595
+ gs as setStripLogs,
2596
+ ys as setViewState,
2597
+ Qn as significantIntercepts,
2598
+ hn as sortPhotosByDepth,
2429
2599
  ie as standardizeColumns,
2430
- _n as standardizeRowArray,
2431
- Ln as tangentialDesurvey,
2432
- ao as toError,
2433
- Qn as tracesAsSegments,
2434
- Xn as useDrillholeTraceGrid,
2435
- wn as validateStructuralPoints,
2436
- k as withDataErrorContext
2600
+ Mn as standardizeRowArray,
2601
+ $n as tangentialDesurvey,
2602
+ bs as toError,
2603
+ cr as tracesAsSegments,
2604
+ ir as useDrillholeTraceGrid,
2605
+ Xn as validateStructuralPoints,
2606
+ G as withDataErrorContext
2437
2607
  };
2438
2608
  //# sourceMappingURL=baselode.js.map