baselode 0.1.23 → 0.1.25

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