baselode 0.1.22 → 0.1.24
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
|
|
2
|
-
import {
|
|
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
|
|
5
|
-
import { useRef as
|
|
6
|
-
import
|
|
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
|
|
8
|
+
function Te(e) {
|
|
9
9
|
return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const
|
|
11
|
+
function ae(e, r = null, t = null) {
|
|
12
|
+
const n = { ...Ot };
|
|
13
13
|
if (t) {
|
|
14
|
-
for (const [
|
|
15
|
-
if (
|
|
16
|
-
const a =
|
|
17
|
-
|
|
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
|
|
21
|
-
for (const [
|
|
22
|
-
const a =
|
|
23
|
-
|
|
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
|
|
25
|
+
return s;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
return e.map((
|
|
27
|
+
function Qn(e, r = null, t = null) {
|
|
28
|
+
return e.map((n) => ae(n, r, t));
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const wt = /* @__PURE__ */ new Set([
|
|
31
31
|
"hole_id",
|
|
32
32
|
"holeid",
|
|
33
33
|
"id",
|
|
@@ -59,84 +59,84 @@ const Mt = /* @__PURE__ */ new Set([
|
|
|
59
59
|
"todepth",
|
|
60
60
|
"comment",
|
|
61
61
|
"z"
|
|
62
|
-
]),
|
|
63
|
-
function
|
|
62
|
+
]), De = (e, r = null) => ae(e, null, r);
|
|
63
|
+
function Ht(e) {
|
|
64
64
|
return { holeId: e[N] };
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
const t = e[N],
|
|
68
|
-
if (!
|
|
69
|
-
const
|
|
70
|
-
return !Number.isFinite(
|
|
71
|
-
holeId:
|
|
72
|
-
project:
|
|
73
|
-
from:
|
|
74
|
-
to:
|
|
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
|
|
79
|
-
var
|
|
80
|
-
const t =
|
|
81
|
-
return t.forEach((
|
|
82
|
-
const { from:
|
|
83
|
-
z:
|
|
84
|
-
from:
|
|
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
86
|
[N]: e,
|
|
87
|
-
[
|
|
87
|
+
[fe]: l,
|
|
88
88
|
...u
|
|
89
89
|
};
|
|
90
|
-
|
|
91
|
-
}), { id: e, project: (
|
|
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
|
|
94
|
-
return new Promise((t,
|
|
95
|
-
const
|
|
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: (
|
|
101
|
-
const a =
|
|
102
|
-
a !== void 0 && `${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(
|
|
105
|
-
error: (
|
|
104
|
+
complete: () => t(Array.from(s)),
|
|
105
|
+
error: (o) => n(G("parseAssayHoleIds", o))
|
|
106
106
|
});
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return Object.entries(e || {}).some(([
|
|
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
|
|
113
|
-
return new Promise((t,
|
|
114
|
-
const
|
|
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: (
|
|
120
|
-
const
|
|
121
|
-
if (!
|
|
122
|
-
const l =
|
|
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
|
-
|
|
125
|
+
s.has(u) || s.set(u, {
|
|
126
126
|
holeId: u
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
-
complete: () => t(Array.from(
|
|
131
|
-
error: (
|
|
130
|
+
complete: () => t(Array.from(s.values())),
|
|
131
|
+
error: (o) => n(G("parseAssayHoleIdsWithAssays", o))
|
|
132
132
|
});
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
return new Promise((
|
|
137
|
-
const
|
|
138
|
-
if (!
|
|
139
|
-
|
|
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,421 +145,421 @@ function Dt(e, n, t = null, r = null) {
|
|
|
145
145
|
dynamicTyping: !0,
|
|
146
146
|
skipEmptyLines: !0,
|
|
147
147
|
step: (l) => {
|
|
148
|
-
const u =
|
|
149
|
-
c && `${c.holeId}`.trim() ===
|
|
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
|
-
|
|
153
|
+
s(null);
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
const l =
|
|
157
|
-
|
|
156
|
+
const l = dt(i, a);
|
|
157
|
+
s(l);
|
|
158
158
|
},
|
|
159
|
-
error: (l) =>
|
|
159
|
+
error: (l) => o(G("parseAssayHole", l))
|
|
160
160
|
});
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return new Promise((
|
|
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: (
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
const u =
|
|
173
|
-
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(
|
|
176
|
-
|
|
175
|
+
const a = Array.from(i.entries()).map(([l, u]) => dt(l, u));
|
|
176
|
+
n({ holes: a });
|
|
177
177
|
},
|
|
178
|
-
error: (
|
|
178
|
+
error: (o) => s(G("parseAssaysCSV", o))
|
|
179
179
|
});
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const
|
|
184
|
-
return Object.entries(e || {}).forEach(([t,
|
|
185
|
-
t && (
|
|
186
|
-
}),
|
|
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
|
|
189
|
-
for (const
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
return
|
|
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
|
|
197
|
-
function
|
|
196
|
+
const Vt = 4;
|
|
197
|
+
function ft(e = [], r = "") {
|
|
198
198
|
if (!e.length) return [];
|
|
199
|
-
if (!
|
|
200
|
-
const t = e.findIndex((
|
|
199
|
+
if (!r) return e;
|
|
200
|
+
const t = e.findIndex((o) => o === r);
|
|
201
201
|
if (t === -1) return e;
|
|
202
|
-
const
|
|
203
|
-
return [
|
|
202
|
+
const n = e[t], s = e.filter((o, i) => i !== t);
|
|
203
|
+
return [n, ...s];
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function xe({
|
|
206
206
|
property: e = "",
|
|
207
|
-
chartType:
|
|
207
|
+
chartType: r = "",
|
|
208
208
|
categoricalProps: t = [],
|
|
209
|
-
commentProps:
|
|
210
|
-
numericDefaultChartType:
|
|
209
|
+
commentProps: n = [],
|
|
210
|
+
numericDefaultChartType: s = "markers+line"
|
|
211
211
|
} = {}) {
|
|
212
|
-
return e ?
|
|
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
|
|
214
|
+
function mt({
|
|
215
215
|
holeIds: e = [],
|
|
216
|
-
focusedHoleId:
|
|
217
|
-
plotCount: t =
|
|
218
|
-
defaultProp:
|
|
219
|
-
categoricalProps:
|
|
220
|
-
commentProps:
|
|
221
|
-
numericDefaultChartType:
|
|
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 =
|
|
223
|
+
const a = ft(e, r);
|
|
224
224
|
return Array.from({ length: t }).map((l, u) => {
|
|
225
|
-
const c = a[u] || e[u] || "", d =
|
|
226
|
-
property:
|
|
225
|
+
const c = a[u] || e[u] || "", d = xe({
|
|
226
|
+
property: n,
|
|
227
227
|
chartType: "",
|
|
228
|
-
categoricalProps:
|
|
229
|
-
commentProps:
|
|
230
|
-
numericDefaultChartType:
|
|
228
|
+
categoricalProps: s,
|
|
229
|
+
commentProps: o,
|
|
230
|
+
numericDefaultChartType: i
|
|
231
231
|
});
|
|
232
232
|
return {
|
|
233
233
|
holeId: c,
|
|
234
|
-
property:
|
|
234
|
+
property: n,
|
|
235
235
|
chartType: d
|
|
236
236
|
};
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
const
|
|
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:
|
|
244
|
-
commentProps:
|
|
245
|
-
columnMeta:
|
|
246
|
-
defaultProp:
|
|
243
|
+
categoricalProps: n,
|
|
244
|
+
commentProps: s,
|
|
245
|
+
columnMeta: o,
|
|
246
|
+
defaultProp: i
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
-
async function
|
|
250
|
-
return await
|
|
249
|
+
async function Yt(e, r = null) {
|
|
250
|
+
return await Ut(e);
|
|
251
251
|
}
|
|
252
|
-
async function
|
|
253
|
-
return await
|
|
252
|
+
async function Wt(e, r, t = null) {
|
|
253
|
+
return await Gt(e, r);
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function qt(e = [], r = "") {
|
|
256
256
|
if (!e.length) return null;
|
|
257
|
-
const { numericProps: t, categoricalProps:
|
|
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:
|
|
259
|
+
focusedHoleId: r,
|
|
260
260
|
plotCount: 4,
|
|
261
|
-
defaultProp:
|
|
262
|
-
categoricalProps:
|
|
263
|
-
commentProps:
|
|
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:
|
|
270
|
-
commentProps:
|
|
271
|
-
columnMeta:
|
|
272
|
-
defaultProp:
|
|
269
|
+
categoricalProps: n,
|
|
270
|
+
commentProps: s,
|
|
271
|
+
columnMeta: o,
|
|
272
|
+
defaultProp: i,
|
|
273
273
|
traceConfigs: l
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
async function
|
|
277
|
-
const { holes:
|
|
278
|
-
if (!
|
|
279
|
-
return
|
|
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
|
|
282
|
-
return new Promise((t,
|
|
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: (
|
|
288
|
-
const
|
|
289
|
-
t(
|
|
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: (
|
|
291
|
+
error: (s) => n(G("parseSurveyCSV", s))
|
|
292
292
|
});
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
const t =
|
|
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
|
-
[N]:
|
|
300
|
-
[
|
|
301
|
-
[
|
|
302
|
-
[oe]:
|
|
303
|
-
[
|
|
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:
|
|
309
|
-
latitude:
|
|
310
|
-
longitude:
|
|
308
|
+
project_code: s,
|
|
309
|
+
latitude: o,
|
|
310
|
+
longitude: i,
|
|
311
311
|
surveydepth: a
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
|
-
const
|
|
315
|
-
const
|
|
316
|
-
return Number.isFinite(
|
|
314
|
+
const ge = (e) => {
|
|
315
|
+
const r = Number(e);
|
|
316
|
+
return Number.isFinite(r) ? r : void 0;
|
|
317
317
|
};
|
|
318
|
-
function
|
|
319
|
-
var u, c, d,
|
|
318
|
+
function or(e, r) {
|
|
319
|
+
var u, c, d, f;
|
|
320
320
|
const t = /* @__PURE__ */ new Map();
|
|
321
|
-
e.forEach((
|
|
322
|
-
const
|
|
323
|
-
if (!
|
|
324
|
-
const
|
|
325
|
-
t.has(
|
|
321
|
+
e.forEach((m) => {
|
|
322
|
+
const g = (m[N] || m.holeId || m.id || "").toString().trim();
|
|
323
|
+
if (!g) return;
|
|
324
|
+
const h = g.toLowerCase();
|
|
325
|
+
t.has(h) || t.set(h, m);
|
|
326
326
|
});
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
if (!
|
|
331
|
-
const
|
|
332
|
-
a.has(
|
|
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
|
+
if (!g) return;
|
|
331
|
+
const h = g.toLowerCase();
|
|
332
|
+
a.has(h) || a.set(h, []), a.get(h).push(m);
|
|
333
333
|
});
|
|
334
334
|
const l = [];
|
|
335
|
-
return a.forEach((
|
|
336
|
-
const
|
|
337
|
-
if (!
|
|
338
|
-
const
|
|
339
|
-
if (!
|
|
340
|
-
const
|
|
341
|
-
let
|
|
342
|
-
for (let A = 0; A <
|
|
343
|
-
const
|
|
344
|
-
if (!
|
|
345
|
-
|
|
346
|
-
x:
|
|
347
|
-
y:
|
|
335
|
+
return a.forEach((m, g) => {
|
|
336
|
+
const h = t.get(g);
|
|
337
|
+
if (!h) return;
|
|
338
|
+
const y = m.filter((A) => Number.isFinite(A[j] ?? A.surveydepth)).sort((A, C) => (A[j] ?? A.surveydepth) - (C[j] ?? C.surveydepth));
|
|
339
|
+
if (!y.length) return;
|
|
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:
|
|
350
|
-
azimuth:
|
|
351
|
-
dip:
|
|
349
|
+
md: v,
|
|
350
|
+
azimuth: _,
|
|
351
|
+
dip: D
|
|
352
352
|
});
|
|
353
353
|
continue;
|
|
354
354
|
}
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
const
|
|
358
|
-
Math.sin(
|
|
359
|
-
),
|
|
360
|
-
|
|
361
|
-
x:
|
|
362
|
-
y:
|
|
363
|
-
z: -
|
|
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
|
+
z: -b,
|
|
364
364
|
// render with z up; depth down
|
|
365
|
-
md:
|
|
366
|
-
azimuth:
|
|
367
|
-
dip:
|
|
365
|
+
md: v,
|
|
366
|
+
azimuth: _,
|
|
367
|
+
dip: D
|
|
368
368
|
});
|
|
369
369
|
}
|
|
370
|
-
const
|
|
370
|
+
const L = $.map((A) => ({
|
|
371
371
|
...A,
|
|
372
|
-
lat:
|
|
373
|
-
lng:
|
|
372
|
+
lat: p + A.y / x,
|
|
373
|
+
lng: E + A.x / F
|
|
374
374
|
}));
|
|
375
375
|
l.push({
|
|
376
|
-
id:
|
|
377
|
-
project:
|
|
378
|
-
points:
|
|
379
|
-
collar:
|
|
376
|
+
id: h[N] || h.holeId || g,
|
|
377
|
+
project: h[fe] || h.project_id || h.project || "",
|
|
378
|
+
points: L,
|
|
379
|
+
collar: h
|
|
380
380
|
});
|
|
381
381
|
}), l;
|
|
382
382
|
}
|
|
383
|
-
const
|
|
384
|
-
const
|
|
385
|
-
return
|
|
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,
|
|
387
|
+
function ne(e, r = void 0) {
|
|
388
388
|
const t = Number(e);
|
|
389
|
-
return Number.isFinite(t) ? t :
|
|
389
|
+
return Number.isFinite(t) ? t : r;
|
|
390
390
|
}
|
|
391
|
-
function
|
|
391
|
+
function Xe(e) {
|
|
392
392
|
return e == null ? "" : `${e}`.trim();
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
const t =
|
|
396
|
-
if (!
|
|
397
|
-
throw
|
|
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
|
+
throw G("canonicalizeHoleIdRows", new Error(`hole id column '${t}' not found`));
|
|
398
398
|
return {
|
|
399
|
-
aliasCol:
|
|
400
|
-
rows: e.map((
|
|
401
|
-
...
|
|
402
|
-
hole_id:
|
|
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
|
|
406
|
+
function Ke(e) {
|
|
407
407
|
return Number(e) * Math.PI / 180;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
const t =
|
|
411
|
-
return { ca:
|
|
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
|
|
414
|
-
const
|
|
415
|
-
if (
|
|
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 *
|
|
418
|
-
dy: e *
|
|
419
|
-
dz: e *
|
|
420
|
-
azimuth:
|
|
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 (
|
|
424
|
-
const d = 0.5 * (
|
|
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
|
-
dx: e *
|
|
427
|
-
dy: e *
|
|
428
|
-
dz: e *
|
|
426
|
+
dx: e * m.ca,
|
|
427
|
+
dy: e * m.cb,
|
|
428
|
+
dz: e * m.cc,
|
|
429
429
|
azimuth: d,
|
|
430
|
-
dip:
|
|
430
|
+
dip: f
|
|
431
431
|
};
|
|
432
432
|
}
|
|
433
|
-
const l =
|
|
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 * (
|
|
436
|
-
dy: 0.5 * e * (
|
|
437
|
-
dz: 0.5 * e * (
|
|
438
|
-
azimuth:
|
|
439
|
-
dip:
|
|
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
|
|
442
|
+
function Ge(e = [], r = [], t = {}) {
|
|
443
443
|
const {
|
|
444
|
-
step:
|
|
445
|
-
holeIdCol:
|
|
446
|
-
method:
|
|
447
|
-
} = t,
|
|
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
|
-
a.rows.forEach((
|
|
451
|
-
!
|
|
450
|
+
a.rows.forEach((f) => {
|
|
451
|
+
!f.hole_id || u.has(f.hole_id) || u.set(f.hole_id, f);
|
|
452
452
|
});
|
|
453
453
|
const c = /* @__PURE__ */ new Map();
|
|
454
|
-
l.rows.forEach((
|
|
455
|
-
|
|
454
|
+
l.rows.forEach((f) => {
|
|
455
|
+
f.hole_id && (c.has(f.hole_id) || c.set(f.hole_id, []), c.get(f.hole_id).push(f));
|
|
456
456
|
});
|
|
457
457
|
const d = [];
|
|
458
|
-
return c.forEach((
|
|
459
|
-
const
|
|
460
|
-
if (!
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
from: ne(
|
|
464
|
-
azimuth: ne(
|
|
465
|
-
dip: ne(
|
|
466
|
-
})).filter((
|
|
467
|
-
if (!
|
|
468
|
-
let
|
|
469
|
-
const
|
|
470
|
-
hole_id:
|
|
471
|
-
md:
|
|
472
|
-
x:
|
|
473
|
-
y:
|
|
474
|
-
z:
|
|
475
|
-
azimuth:
|
|
476
|
-
dip:
|
|
458
|
+
return c.forEach((f, m) => {
|
|
459
|
+
const g = u.get(m);
|
|
460
|
+
if (!g) return;
|
|
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
|
+
if (!h.length) return;
|
|
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
|
+
hole_id: m,
|
|
471
|
+
md: x,
|
|
472
|
+
x: y,
|
|
473
|
+
y: p,
|
|
474
|
+
z: E,
|
|
475
|
+
azimuth: F,
|
|
476
|
+
dip: w
|
|
477
477
|
};
|
|
478
|
-
a.aliasCol !== "hole_id" &&
|
|
479
|
-
for (let
|
|
480
|
-
const
|
|
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
481
|
if (A <= 0) continue;
|
|
482
|
-
const
|
|
483
|
-
for (let
|
|
484
|
-
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
const
|
|
488
|
-
hole_id:
|
|
489
|
-
md:
|
|
490
|
-
x:
|
|
491
|
-
y:
|
|
492
|
-
z:
|
|
493
|
-
azimuth:
|
|
494
|
-
dip:
|
|
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
|
+
hole_id: m,
|
|
489
|
+
md: x,
|
|
490
|
+
x: y,
|
|
491
|
+
y: p,
|
|
492
|
+
z: E,
|
|
493
|
+
azimuth: o === "minimum_curvature" ? D : O.azimuth,
|
|
494
|
+
dip: o === "minimum_curvature" ? z : O.dip
|
|
495
495
|
};
|
|
496
|
-
a.aliasCol !== "hole_id" &&
|
|
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
|
|
502
|
-
return
|
|
501
|
+
function Zt(e, r, t = {}) {
|
|
502
|
+
return Ge(e, r, { ...t, method: "minimum_curvature" });
|
|
503
503
|
}
|
|
504
|
-
function
|
|
505
|
-
return
|
|
504
|
+
function ir(e, r, t = {}) {
|
|
505
|
+
return Ge(e, r, { ...t, method: "tangential" });
|
|
506
506
|
}
|
|
507
|
-
function
|
|
508
|
-
return
|
|
507
|
+
function ar(e, r, t = {}) {
|
|
508
|
+
return Ge(e, r, { ...t, method: "balanced_tangential" });
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
return
|
|
510
|
+
function lr(e, r, t = {}) {
|
|
511
|
+
return Zt(e, r, t);
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
if (!e.length || !Number.isFinite(
|
|
515
|
-
let t = null,
|
|
516
|
-
for (let
|
|
517
|
-
const
|
|
518
|
-
if (!Number.isFinite(
|
|
519
|
-
const a = Math.abs(
|
|
520
|
-
a <
|
|
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
|
|
525
|
-
const
|
|
526
|
-
if (!
|
|
527
|
-
const
|
|
528
|
-
return
|
|
529
|
-
a.hole_id && (
|
|
530
|
-
}),
|
|
531
|
-
|
|
532
|
-
}),
|
|
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 =
|
|
535
|
+
const d = Jt(i.get(a.hole_id) || [], c);
|
|
536
536
|
if (!d) return { ...a };
|
|
537
|
-
const
|
|
538
|
-
return ["md", "x", "y", "z", "azimuth", "dip"].forEach((
|
|
539
|
-
d[
|
|
540
|
-
}),
|
|
537
|
+
const f = { ...a };
|
|
538
|
+
return ["md", "x", "y", "z", "azimuth", "dip"].forEach((m) => {
|
|
539
|
+
d[m] !== void 0 && (Object.prototype.hasOwnProperty.call(f, m) ? f[`${m}_trace`] = d[m] : f[m] = d[m]);
|
|
540
|
+
}), f;
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
return new Promise((t,
|
|
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: (
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
const u =
|
|
553
|
-
!d ||
|
|
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
|
-
order:
|
|
557
|
-
x: Number(
|
|
558
|
-
y: Number(
|
|
559
|
-
z: Number(
|
|
556
|
+
order: h,
|
|
557
|
+
x: Number(f) ?? 0,
|
|
558
|
+
y: Number(m) ?? 0,
|
|
559
|
+
z: Number(g) ?? 0
|
|
560
560
|
}));
|
|
561
561
|
});
|
|
562
|
-
const
|
|
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 Hn(e, n = null) {
|
|
|
568
568
|
z: Number(u.z) || 0
|
|
569
569
|
}))
|
|
570
570
|
}));
|
|
571
|
-
t({ holes:
|
|
571
|
+
t({ holes: i });
|
|
572
572
|
},
|
|
573
|
-
error: (
|
|
573
|
+
error: (s) => n(G("parseDrillholesCSV", s))
|
|
574
574
|
});
|
|
575
575
|
});
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function _e(e) {
|
|
578
578
|
return e ? Array.isArray(e) ? [...e] : [] : [];
|
|
579
579
|
}
|
|
580
580
|
function Z(e) {
|
|
581
|
-
const
|
|
582
|
-
return Number.isFinite(
|
|
581
|
+
const r = Number(e);
|
|
582
|
+
return Number.isFinite(r) ? r : void 0;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function Ee(e = [], r = []) {
|
|
585
585
|
const t = [...e];
|
|
586
|
-
return t.sort((
|
|
587
|
-
for (let
|
|
588
|
-
const
|
|
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
|
|
595
|
+
function Qt(e = [], r = "Intervals") {
|
|
596
596
|
if (!e.length) return;
|
|
597
|
-
const t =
|
|
598
|
-
t.forEach((
|
|
599
|
-
const
|
|
600
|
-
if (!
|
|
601
|
-
const l =
|
|
602
|
-
if (Number.isFinite(l) &&
|
|
603
|
-
throw
|
|
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
|
+
throw G(
|
|
604
604
|
"validateNoOverlappingIntervals",
|
|
605
|
-
new Error(`${
|
|
605
|
+
new Error(`${r} intervals overlap for hole '${o}': from=${i} is less than previous to=${l}`)
|
|
606
606
|
);
|
|
607
|
-
|
|
607
|
+
n.set(o, a);
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
return new Promise((t,
|
|
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
|
-
...
|
|
617
|
-
complete: (
|
|
618
|
-
error: (
|
|
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
|
|
623
|
-
return e.map((
|
|
622
|
+
function tn(e = [], r = null, t = null) {
|
|
623
|
+
return e.map((n) => ae(n, r, t));
|
|
624
624
|
}
|
|
625
|
-
async function
|
|
625
|
+
async function Pe(e, r = {}) {
|
|
626
626
|
const {
|
|
627
627
|
kind: t = "csv",
|
|
628
|
-
columnMap:
|
|
629
|
-
sourceColumnMap:
|
|
630
|
-
papaParseConfig:
|
|
631
|
-
} =
|
|
632
|
-
let
|
|
628
|
+
columnMap: n = null,
|
|
629
|
+
sourceColumnMap: s = null,
|
|
630
|
+
papaParseConfig: o = {}
|
|
631
|
+
} = r;
|
|
632
|
+
let i;
|
|
633
633
|
if (Array.isArray(e))
|
|
634
|
-
|
|
634
|
+
i = _e(e);
|
|
635
635
|
else if (t === "csv")
|
|
636
|
-
|
|
637
|
-
else throw t === "parquet" || t === "sql" ?
|
|
638
|
-
return
|
|
636
|
+
i = await en(e, o);
|
|
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 tn(i, n, s);
|
|
639
639
|
}
|
|
640
|
-
async function
|
|
640
|
+
async function dr(e, r = {}) {
|
|
641
641
|
const {
|
|
642
642
|
crs: t = null,
|
|
643
|
-
sourceColumnMap:
|
|
644
|
-
keepAll:
|
|
645
|
-
...
|
|
646
|
-
} =
|
|
647
|
-
if (!
|
|
648
|
-
throw
|
|
649
|
-
const l =
|
|
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
|
-
throw
|
|
652
|
-
const c =
|
|
653
|
-
const
|
|
654
|
-
if (N in
|
|
655
|
-
const
|
|
656
|
-
|
|
651
|
+
throw G("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
|
|
652
|
+
const c = i.map((f) => {
|
|
653
|
+
const m = { ...f };
|
|
654
|
+
if (N in m) {
|
|
655
|
+
const g = m[N];
|
|
656
|
+
m[N] = g == null ? "" : `${g}`.trim();
|
|
657
657
|
}
|
|
658
|
-
return
|
|
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((
|
|
661
|
-
throw
|
|
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
|
+
throw G("loadCollars", new Error("Collar table has missing required values"));
|
|
662
662
|
return c;
|
|
663
663
|
}
|
|
664
|
-
async function
|
|
664
|
+
async function fr(e, r = {}) {
|
|
665
665
|
const {
|
|
666
666
|
sourceColumnMap: t = null,
|
|
667
|
-
keepAll:
|
|
668
|
-
...
|
|
669
|
-
} =
|
|
670
|
-
for (const u of
|
|
671
|
-
if (!
|
|
672
|
-
throw
|
|
673
|
-
const a =
|
|
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
|
+
throw G("loadSurveys", new Error(`Survey table missing column: ${u}`));
|
|
673
|
+
const a = o.map((u) => {
|
|
674
674
|
const c = { ...u };
|
|
675
675
|
if (N in c) {
|
|
676
676
|
const d = c[N];
|
|
677
677
|
c[N] = d == null ? "" : `${d}`.trim();
|
|
678
678
|
}
|
|
679
|
-
return
|
|
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[N] || !Number.isFinite(u[
|
|
682
|
-
throw
|
|
683
|
-
return
|
|
681
|
+
if (!a.every((u) => !(!u[N] || !Number.isFinite(u[j]) || !Number.isFinite(u[Y]) || !Number.isFinite(u[W]))))
|
|
682
|
+
throw G("loadSurveys", new Error("Survey table has missing required values"));
|
|
683
|
+
return Ee(a, [N, j]);
|
|
684
684
|
}
|
|
685
|
-
async function
|
|
685
|
+
async function mr(e, r = {}) {
|
|
686
686
|
const {
|
|
687
687
|
sourceColumnMap: t = null,
|
|
688
|
-
keepAll:
|
|
689
|
-
...
|
|
690
|
-
} =
|
|
691
|
-
for (const u of
|
|
692
|
-
if (!
|
|
693
|
-
throw
|
|
694
|
-
const a =
|
|
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
|
+
throw G("loadAssays", new Error(`Assay table missing column: ${u}`));
|
|
694
|
+
const a = o.map((u) => {
|
|
695
695
|
const c = { ...u };
|
|
696
696
|
if (N in c) {
|
|
697
697
|
const d = c[N];
|
|
698
698
|
c[N] = d == null ? "" : `${d}`.trim();
|
|
699
699
|
}
|
|
700
|
-
return
|
|
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[N] || !Number.isFinite(u[
|
|
703
|
-
throw
|
|
704
|
-
return
|
|
702
|
+
if (!a.every((u) => !(!u[N] || !Number.isFinite(u[S]) || !Number.isFinite(u[M]) || !(u[M] > u[S]))))
|
|
703
|
+
throw G("loadAssays", new Error("Assay table has missing required values"));
|
|
704
|
+
return Ee(a, [N, S, M]);
|
|
705
705
|
}
|
|
706
|
-
async function
|
|
706
|
+
async function hr(e, r = {}) {
|
|
707
707
|
const {
|
|
708
708
|
sourceColumnMap: t = null,
|
|
709
|
-
keepAll:
|
|
710
|
-
...
|
|
711
|
-
} =
|
|
712
|
-
for (const c of
|
|
713
|
-
if (!
|
|
714
|
-
throw
|
|
715
|
-
const a =
|
|
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
|
+
throw G("loadGeology", new Error(`Geology table missing column: ${c}`));
|
|
715
|
+
const a = o.map((c) => {
|
|
716
716
|
const d = { ...c };
|
|
717
717
|
if (N in d) {
|
|
718
|
-
const
|
|
719
|
-
d[N] =
|
|
718
|
+
const g = d[N];
|
|
719
|
+
d[N] = g == null ? "" : `${g}`.trim();
|
|
720
720
|
}
|
|
721
|
-
|
|
722
|
-
const
|
|
723
|
-
return !
|
|
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[N] || !Number.isFinite(c[
|
|
726
|
-
throw
|
|
725
|
+
if (!a.every((c) => !(!c[N] || !Number.isFinite(c[S]) || !Number.isFinite(c[M]) || !(c[M] > c[S]))))
|
|
726
|
+
throw G("loadGeology", new Error("Geology table has missing or invalid interval values"));
|
|
727
727
|
if (!a.some((c) => {
|
|
728
|
-
const d = c[
|
|
729
|
-
return d != null && `${d}`.trim() !== "" ||
|
|
728
|
+
const d = c[ce], f = c[ue];
|
|
729
|
+
return d != null && `${d}`.trim() !== "" || f != null && `${f}`.trim() !== "";
|
|
730
730
|
}))
|
|
731
|
-
throw
|
|
732
|
-
if (
|
|
733
|
-
const c = new Set(Object.keys(
|
|
734
|
-
return
|
|
735
|
-
a.map((d) => Object.fromEntries(Object.entries(d).filter(([
|
|
736
|
-
[N,
|
|
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
|
+
a.map((d) => Object.fromEntries(Object.entries(d).filter(([f]) => c.has(f)))),
|
|
736
|
+
[N, S, M]
|
|
737
737
|
);
|
|
738
738
|
}
|
|
739
|
-
return
|
|
740
|
-
}
|
|
741
|
-
function
|
|
742
|
-
const
|
|
743
|
-
if (!
|
|
744
|
-
const
|
|
745
|
-
return
|
|
746
|
-
|
|
747
|
-
}), e.map((
|
|
748
|
-
const a =
|
|
749
|
-
if (!a) return { ...
|
|
750
|
-
const l = { ...
|
|
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
|
-
|
|
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
|
|
757
|
-
return
|
|
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
|
|
759
|
+
function br(e = [], r = []) {
|
|
760
760
|
return e.map((t) => {
|
|
761
|
-
const
|
|
762
|
-
return
|
|
763
|
-
if (!(
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
}),
|
|
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
|
|
769
|
+
function yr({
|
|
770
770
|
collars: e = [],
|
|
771
|
-
surveys:
|
|
771
|
+
surveys: r = [],
|
|
772
772
|
assays: t = [],
|
|
773
|
-
geology:
|
|
774
|
-
structures:
|
|
775
|
-
metadata:
|
|
773
|
+
geology: n = [],
|
|
774
|
+
structures: s = [],
|
|
775
|
+
metadata: o = {}
|
|
776
776
|
} = {}) {
|
|
777
777
|
return {
|
|
778
|
-
collars:
|
|
779
|
-
surveys:
|
|
780
|
-
assays:
|
|
781
|
-
geology:
|
|
782
|
-
structures:
|
|
783
|
-
metadata:
|
|
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
|
|
787
|
-
function
|
|
786
|
+
const je = (e, r = null) => ae(e, null, r);
|
|
787
|
+
function nn(e) {
|
|
788
788
|
if (!e.length) return null;
|
|
789
|
-
const
|
|
790
|
-
return t ? "interval" :
|
|
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
|
|
793
|
-
const
|
|
794
|
-
return Number.isFinite(
|
|
792
|
+
function ie(e) {
|
|
793
|
+
const r = Number(e);
|
|
794
|
+
return Number.isFinite(r) ? r : null;
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
const
|
|
798
|
-
if (!
|
|
799
|
-
const t =
|
|
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
|
-
[N]:
|
|
802
|
-
[
|
|
803
|
-
[W]:
|
|
804
|
-
[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
|
|
810
|
-
const
|
|
811
|
-
if (!
|
|
812
|
-
const t =
|
|
813
|
-
if (t === null ||
|
|
814
|
-
const
|
|
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
|
-
[N]:
|
|
817
|
-
[
|
|
818
|
-
[
|
|
819
|
-
mid:
|
|
820
|
-
[W]:
|
|
821
|
-
[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
|
|
828
|
-
const
|
|
829
|
-
for (const
|
|
830
|
-
const
|
|
831
|
-
|
|
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:
|
|
833
|
+
return { valid: r, errors: t };
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
return new Promise((t,
|
|
837
|
-
const
|
|
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: (
|
|
842
|
-
const
|
|
843
|
-
for (const a of
|
|
844
|
-
const l =
|
|
845
|
-
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(
|
|
847
|
+
t(i);
|
|
848
848
|
},
|
|
849
|
-
error: (
|
|
849
|
+
error: (o) => n(G("parseStructuralPointsCSV", o))
|
|
850
850
|
};
|
|
851
851
|
typeof e == "string" && !e.startsWith("data:") && e.includes(`
|
|
852
|
-
`) ? J.parse(e,
|
|
852
|
+
`) ? J.parse(e, s) : J.parse(e, s);
|
|
853
853
|
});
|
|
854
854
|
}
|
|
855
|
-
function
|
|
856
|
-
return new Promise((t,
|
|
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: (
|
|
862
|
-
const
|
|
863
|
-
for (const
|
|
864
|
-
const a =
|
|
865
|
-
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(
|
|
867
|
+
t(o);
|
|
868
868
|
},
|
|
869
|
-
error: (
|
|
869
|
+
error: (s) => n(G("parseStructuralIntervalsCSV", s))
|
|
870
870
|
});
|
|
871
871
|
});
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function rn(e, r = N) {
|
|
874
874
|
const t = /* @__PURE__ */ new Map();
|
|
875
|
-
for (const
|
|
876
|
-
const
|
|
877
|
-
|
|
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
|
|
882
|
-
return new Promise((t,
|
|
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: (
|
|
888
|
-
const
|
|
889
|
-
if (!
|
|
890
|
-
|
|
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
|
|
898
|
-
const u =
|
|
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:
|
|
901
|
+
t({ schema: i, rows: a });
|
|
902
902
|
},
|
|
903
|
-
error: (
|
|
903
|
+
error: (s) => n(G("parseStructuralCSV", s))
|
|
904
904
|
});
|
|
905
905
|
});
|
|
906
906
|
}
|
|
907
|
-
function
|
|
908
|
-
return new Promise((
|
|
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
|
|
915
|
-
for (const
|
|
916
|
-
const
|
|
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(
|
|
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]:
|
|
921
|
-
...
|
|
920
|
+
const c = (l + u) / 2, { [W]: d, [Y]: f, ...m } = i, g = {
|
|
921
|
+
...m,
|
|
922
922
|
[N]: a,
|
|
923
|
-
[
|
|
924
|
-
[
|
|
925
|
-
[
|
|
926
|
-
[
|
|
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
|
-
|
|
930
|
+
n.has(a) || n.set(a, []), n.get(a).push(g);
|
|
931
931
|
}
|
|
932
|
-
const
|
|
933
|
-
holeId:
|
|
934
|
-
points:
|
|
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
|
-
|
|
936
|
+
r(s);
|
|
937
937
|
}
|
|
938
938
|
});
|
|
939
939
|
});
|
|
940
940
|
}
|
|
941
|
-
function
|
|
942
|
-
return new Promise((
|
|
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
|
|
949
|
-
for (const
|
|
950
|
-
const
|
|
951
|
-
if (!
|
|
952
|
-
const a = Number(
|
|
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, ...
|
|
955
|
-
...
|
|
956
|
-
[N]:
|
|
957
|
-
[
|
|
958
|
-
[
|
|
959
|
-
[
|
|
960
|
-
[
|
|
954
|
+
const u = (a + l) / 2, { [W]: c, [Y]: d, ...f } = o, m = {
|
|
955
|
+
...f,
|
|
956
|
+
[N]: i,
|
|
957
|
+
[S]: a,
|
|
958
|
+
[M]: l,
|
|
959
|
+
[Ae]: u,
|
|
960
|
+
[j]: u,
|
|
961
961
|
_source: "geology"
|
|
962
962
|
};
|
|
963
|
-
|
|
963
|
+
n.has(i) || n.set(i, []), n.get(i).push(m);
|
|
964
964
|
}
|
|
965
|
-
|
|
966
|
-
holes: Array.from(
|
|
967
|
-
holeId:
|
|
968
|
-
points:
|
|
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
|
|
976
|
-
const [
|
|
977
|
-
e ?
|
|
978
|
-
|
|
979
|
-
({ rows: a }) =>
|
|
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 ?
|
|
982
|
-
]),
|
|
983
|
-
for (const a of [...
|
|
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 (
|
|
987
|
-
const u =
|
|
988
|
-
|
|
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
|
-
|
|
990
|
+
i.set(l, a);
|
|
991
991
|
}
|
|
992
|
-
return { holes: Array.from(
|
|
992
|
+
return { holes: Array.from(i.values()) };
|
|
993
993
|
}
|
|
994
|
-
function
|
|
995
|
-
const
|
|
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,177 +1001,619 @@ function er(e, n, t, r, o = {}) {
|
|
|
1001
1001
|
}
|
|
1002
1002
|
const u = [];
|
|
1003
1003
|
for (const [c, d] of Object.entries(l)) {
|
|
1004
|
-
const
|
|
1005
|
-
const
|
|
1006
|
-
return Number.isFinite(
|
|
1004
|
+
const m = [...d].sort((p, E) => Number(p[o]) - Number(E[o])).filter((p) => {
|
|
1005
|
+
const E = Number(p[r]);
|
|
1006
|
+
return Number.isFinite(E) && E >= t;
|
|
1007
1007
|
});
|
|
1008
|
-
if (!
|
|
1009
|
-
const
|
|
1010
|
-
let
|
|
1011
|
-
for (const
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1008
|
+
if (!m.length) continue;
|
|
1009
|
+
const g = [];
|
|
1010
|
+
let h = [], y = null;
|
|
1011
|
+
for (const p of m) {
|
|
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
|
-
|
|
1016
|
-
for (const
|
|
1017
|
-
const
|
|
1018
|
-
if (
|
|
1019
|
-
let
|
|
1020
|
-
for (const
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1015
|
+
h.length && g.push(h);
|
|
1016
|
+
for (const p of g) {
|
|
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
|
+
for (const b of p) {
|
|
1021
|
+
const L = Number(b[r]), A = Number(b[i]) - Number(b[o]);
|
|
1022
|
+
w += L * A, k += A;
|
|
1023
1023
|
}
|
|
1024
|
-
const
|
|
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:
|
|
1028
|
-
[
|
|
1029
|
-
[
|
|
1030
|
-
length:
|
|
1031
|
-
avg_grade:
|
|
1032
|
-
n_samples:
|
|
1033
|
-
label:
|
|
1027
|
+
assay_field: r,
|
|
1028
|
+
[o]: E,
|
|
1029
|
+
[i]: x,
|
|
1030
|
+
length: F,
|
|
1031
|
+
avg_grade: $,
|
|
1032
|
+
n_samples: P,
|
|
1033
|
+
label: H
|
|
1034
1034
|
});
|
|
1035
1035
|
}
|
|
1036
1036
|
}
|
|
1037
1037
|
return u;
|
|
1038
1038
|
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1039
|
+
function Be(e, r) {
|
|
1040
|
+
const t = /* @__PURE__ */ new Map();
|
|
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
|
+
}
|
|
1045
|
+
return t;
|
|
1046
|
+
}
|
|
1047
|
+
function Ar(e, { fromCol: r = S, toCol: t = M } = {}) {
|
|
1048
|
+
return e.map((n) => Number(n[t]) - Number(n[r]));
|
|
1049
|
+
}
|
|
1050
|
+
function Sr(e, { fromCol: r = S, toCol: t = M } = {}) {
|
|
1051
|
+
return e.map((n) => (Number(n[r]) + Number(n[t])) / 2);
|
|
1052
|
+
}
|
|
1053
|
+
function ln(e, { fromCol: r = S, toCol: t = M, holeCol: n = N, minGap: s = 0 } = {}) {
|
|
1054
|
+
if (!e || !e.length) return [];
|
|
1055
|
+
const o = [];
|
|
1056
|
+
for (const [i, a] of Be(e, n)) {
|
|
1057
|
+
const l = [...a].sort(
|
|
1058
|
+
(c, d) => Number(c[r]) - Number(d[r])
|
|
1059
|
+
);
|
|
1060
|
+
let u = null;
|
|
1061
|
+
for (const c of l) {
|
|
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
|
+
[t]: d,
|
|
1067
|
+
length: d - u
|
|
1068
|
+
}), (u === null || f > u) && (u = f);
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
return o;
|
|
1072
|
+
}
|
|
1073
|
+
function cn(e, { fromCol: r = S, toCol: t = M, holeCol: n = N } = {}) {
|
|
1074
|
+
if (!e || !e.length) return [];
|
|
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
|
+
}
|
|
1080
|
+
const i = [];
|
|
1081
|
+
for (const [a, l] of o) {
|
|
1082
|
+
const u = [...l].sort(
|
|
1083
|
+
(c, d) => Number(c.row[r]) - Number(d.row[r])
|
|
1084
|
+
);
|
|
1085
|
+
for (let c = 0; c < u.length; c += 1) {
|
|
1086
|
+
const d = Number(u[c].row[r]), f = Number(u[c].row[t]);
|
|
1087
|
+
for (let m = c + 1; m < u.length; m += 1) {
|
|
1088
|
+
const g = Number(u[m].row[r]);
|
|
1089
|
+
if (g >= f) break;
|
|
1090
|
+
const h = Number(u[m].row[t]), y = Math.max(d, g), p = Math.min(f, h);
|
|
1091
|
+
p > y && i.push({
|
|
1092
|
+
[n]: a,
|
|
1093
|
+
[r]: y,
|
|
1094
|
+
[t]: p,
|
|
1095
|
+
length: p - y,
|
|
1096
|
+
first_index: u[c].originalIndex,
|
|
1097
|
+
second_index: u[m].originalIndex
|
|
1098
|
+
});
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
return i;
|
|
1103
|
+
}
|
|
1104
|
+
function un(e, r) {
|
|
1105
|
+
if (e == null) return { byHole: /* @__PURE__ */ new Map(), all: [] };
|
|
1106
|
+
if (Array.isArray(e)) {
|
|
1107
|
+
const t = e[0];
|
|
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
|
+
}
|
|
1114
|
+
return { byHole: s, all: [] };
|
|
1115
|
+
}
|
|
1116
|
+
return { byHole: /* @__PURE__ */ new Map(), all: e.map(Number) };
|
|
1117
|
+
}
|
|
1118
|
+
if (typeof e == "number")
|
|
1119
|
+
return { byHole: /* @__PURE__ */ new Map(), all: [Number(e)] };
|
|
1120
|
+
if (e && typeof e == "object") {
|
|
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
|
+
}
|
|
1125
|
+
const t = /* @__PURE__ */ new Map();
|
|
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
|
+
}
|
|
1130
|
+
return { byHole: t, all: [] };
|
|
1131
|
+
}
|
|
1132
|
+
return { byHole: /* @__PURE__ */ new Map(), all: [] };
|
|
1133
|
+
}
|
|
1134
|
+
function Tr(e, r, { fromCol: t = S, toCol: n = M, holeCol: s = N } = {}) {
|
|
1135
|
+
if (!e || !e.length) return [];
|
|
1136
|
+
const { byHole: o, all: i } = un(r, s), a = [];
|
|
1137
|
+
for (const l of e) {
|
|
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
|
+
f.map(Number).filter((h) => h > c && h < d)
|
|
1140
|
+
)].sort((h, y) => h - y);
|
|
1141
|
+
if (!m.length) {
|
|
1142
|
+
a.push({ ...l });
|
|
1143
|
+
continue;
|
|
1144
|
+
}
|
|
1145
|
+
const g = [c, ...m, d];
|
|
1146
|
+
for (let h = 0; h < g.length - 1; h += 1)
|
|
1147
|
+
a.push({
|
|
1148
|
+
...l,
|
|
1149
|
+
[t]: g[h],
|
|
1150
|
+
[n]: g[h + 1]
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
return a;
|
|
1154
|
+
}
|
|
1155
|
+
function xr(e, r, t, { fromCol: n = S, toCol: s = M } = {}) {
|
|
1156
|
+
if (!e || !e.length) return [];
|
|
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
|
+
}
|
|
1164
|
+
if (t != null) {
|
|
1165
|
+
if (a >= t) continue;
|
|
1166
|
+
l > t && (l = t);
|
|
1167
|
+
}
|
|
1168
|
+
o.push({ ...i, [n]: a, [s]: l });
|
|
1169
|
+
}
|
|
1170
|
+
return o;
|
|
1171
|
+
}
|
|
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
|
+
return null;
|
|
1176
|
+
}
|
|
1177
|
+
function Lr(e, { fromCol: r = S, toCol: t = M, holeCol: n = N } = {}) {
|
|
1178
|
+
if (!e) return [];
|
|
1179
|
+
const s = Object.keys(e);
|
|
1180
|
+
if (!s.length) return [];
|
|
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
|
+
const u = [];
|
|
1187
|
+
for (const [c, d] of a) {
|
|
1188
|
+
const f = /* @__PURE__ */ new Set();
|
|
1189
|
+
let m = 1 / 0, g = -1 / 0;
|
|
1190
|
+
for (const y of d) {
|
|
1191
|
+
const p = Number(y[r]), E = Number(y[t]);
|
|
1192
|
+
f.add(p), f.add(E), p < m && (m = p), E > g && (g = E);
|
|
1193
|
+
}
|
|
1194
|
+
for (const y of s.slice(1)) {
|
|
1195
|
+
const p = l[y].get(c) || [];
|
|
1196
|
+
for (const E of p) {
|
|
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
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
const h = [...f].sort((y, p) => y - p);
|
|
1202
|
+
for (let y = 0; y < h.length - 1; y += 1) {
|
|
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
|
+
);
|
|
1212
|
+
for (const L of b)
|
|
1213
|
+
w[`${k}_${L}`] = P ? P[L] : null;
|
|
1214
|
+
}
|
|
1215
|
+
u.push(w);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
return u;
|
|
1219
|
+
}
|
|
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));
|
|
1044
1229
|
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
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));
|
|
1237
|
+
}
|
|
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
|
+
}));
|
|
1049
1274
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1275
|
+
return n;
|
|
1276
|
+
}
|
|
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;
|
|
1052
1312
|
}
|
|
1053
|
-
function
|
|
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) {
|
|
1054
1496
|
if (e.length === 0) return [];
|
|
1055
|
-
const
|
|
1056
|
-
return Object.keys(e[0]).filter((
|
|
1057
|
-
let
|
|
1058
|
-
for (const
|
|
1059
|
-
const
|
|
1060
|
-
Number.isFinite(
|
|
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++;
|
|
1061
1503
|
}
|
|
1062
|
-
return
|
|
1504
|
+
return s / e.length > 0.5;
|
|
1063
1505
|
});
|
|
1064
1506
|
}
|
|
1065
|
-
function
|
|
1066
|
-
const
|
|
1507
|
+
function kr(e, r = null) {
|
|
1508
|
+
const n = J.parse(e, {
|
|
1067
1509
|
header: !0,
|
|
1068
1510
|
skipEmptyLines: !0,
|
|
1069
1511
|
dynamicTyping: !1
|
|
1070
1512
|
}).data || [];
|
|
1071
|
-
if (
|
|
1072
|
-
const
|
|
1073
|
-
for (const l of
|
|
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) {
|
|
1074
1516
|
const u = l[N] != null ? `${l[N]}`.trim() : "";
|
|
1075
1517
|
if (!u) continue;
|
|
1076
|
-
const c =
|
|
1077
|
-
c === null || c < 0 || (
|
|
1518
|
+
const c = vn(l);
|
|
1519
|
+
c === null || c < 0 || (i.has(u) || i.set(u, []), i.get(u).push({ depth: c, row: l }));
|
|
1078
1520
|
}
|
|
1079
1521
|
const a = [];
|
|
1080
|
-
for (const [l, u] of
|
|
1081
|
-
u.sort((d,
|
|
1522
|
+
for (const [l, u] of i) {
|
|
1523
|
+
u.sort((d, f) => d.depth - f.depth);
|
|
1082
1524
|
const c = {};
|
|
1083
|
-
for (const d of
|
|
1084
|
-
const
|
|
1085
|
-
for (const { depth:
|
|
1086
|
-
const
|
|
1087
|
-
Number.isFinite(
|
|
1525
|
+
for (const d of o) {
|
|
1526
|
+
const f = [], m = [];
|
|
1527
|
+
for (const { depth: g, row: h } of u) {
|
|
1528
|
+
const y = Number(h[d]);
|
|
1529
|
+
Number.isFinite(y) && y !== at && (f.push(g), m.push(y));
|
|
1088
1530
|
}
|
|
1089
|
-
|
|
1531
|
+
f.length >= 2 && (c[d] = { depths: f, values: m });
|
|
1090
1532
|
}
|
|
1091
1533
|
Object.keys(c).length > 0 && a.push({ holeId: l, channels: c });
|
|
1092
1534
|
}
|
|
1093
1535
|
return a;
|
|
1094
1536
|
}
|
|
1095
|
-
function
|
|
1096
|
-
const
|
|
1097
|
-
for (const { holeId:
|
|
1098
|
-
const
|
|
1099
|
-
if (!
|
|
1100
|
-
const { depths: a, values: l } = i
|
|
1101
|
-
|
|
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 });
|
|
1102
1544
|
}
|
|
1103
|
-
return
|
|
1545
|
+
return n;
|
|
1104
1546
|
}
|
|
1105
|
-
function
|
|
1106
|
-
const
|
|
1107
|
-
if (
|
|
1108
|
-
const t = e.slice(0,
|
|
1109
|
-
return { mnem: t, unit:
|
|
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 };
|
|
1110
1552
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const
|
|
1553
|
+
function In(e) {
|
|
1554
|
+
const r = [];
|
|
1113
1555
|
let t = null;
|
|
1114
|
-
for (const
|
|
1115
|
-
const
|
|
1116
|
-
|
|
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);
|
|
1117
1559
|
}
|
|
1118
|
-
return
|
|
1560
|
+
return r;
|
|
1119
1561
|
}
|
|
1120
|
-
function
|
|
1121
|
-
const
|
|
1562
|
+
function Je(e = []) {
|
|
1563
|
+
const r = {};
|
|
1122
1564
|
for (const t of e) {
|
|
1123
|
-
const
|
|
1124
|
-
if (!
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1565
|
+
const n = t.trimStart();
|
|
1566
|
+
if (!n || n.startsWith("#")) continue;
|
|
1567
|
+
const s = Nt(t);
|
|
1568
|
+
s && (r[s.mnem] = s);
|
|
1127
1569
|
}
|
|
1128
|
-
return
|
|
1570
|
+
return r;
|
|
1129
1571
|
}
|
|
1130
|
-
function
|
|
1131
|
-
var
|
|
1132
|
-
const t =
|
|
1133
|
-
if (!
|
|
1134
|
-
const a =
|
|
1135
|
-
for (const
|
|
1136
|
-
const
|
|
1137
|
-
if (!
|
|
1138
|
-
const A =
|
|
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);
|
|
1139
1581
|
A && u.push(A);
|
|
1140
1582
|
}
|
|
1141
|
-
(((
|
|
1583
|
+
(((E = (p = a.WRAP) == null ? void 0 : p.value) == null ? void 0 : E.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
|
|
1142
1584
|
"parseLasFile: WRAP YES is not supported. Data rows may be read incorrectly."
|
|
1143
1585
|
);
|
|
1144
|
-
const d =
|
|
1145
|
-
let
|
|
1146
|
-
if ((
|
|
1147
|
-
const
|
|
1148
|
-
Number.isFinite(
|
|
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;
|
|
1588
|
+
if ((H = l.NULL) != null && H.value) {
|
|
1589
|
+
const b = Number(l.NULL.value);
|
|
1590
|
+
Number.isFinite(b) && (f = b);
|
|
1149
1591
|
}
|
|
1150
|
-
if (
|
|
1151
|
-
const
|
|
1152
|
-
for (const { mnem:
|
|
1153
|
-
b
|
|
1154
|
-
const
|
|
1155
|
-
for (const { mnem:
|
|
1156
|
-
|
|
1157
|
-
for (const
|
|
1158
|
-
const
|
|
1159
|
-
if (!
|
|
1160
|
-
const A =
|
|
1592
|
+
if (r.nullSentinel !== void 0 && (f = r.nullSentinel), u.length === 0) return [];
|
|
1593
|
+
const m = u.slice(1), g = {};
|
|
1594
|
+
for (const { mnem: b, unit: L } of m)
|
|
1595
|
+
g[b.toLowerCase()] = L;
|
|
1596
|
+
const h = {};
|
|
1597
|
+
for (const { mnem: b } of m)
|
|
1598
|
+
h[b.toLowerCase()] = { depths: [], values: [] };
|
|
1599
|
+
for (const b of i.lines) {
|
|
1600
|
+
const L = b.trimStart();
|
|
1601
|
+
if (!L || L.startsWith("#")) continue;
|
|
1602
|
+
const A = L.split(/\s+/);
|
|
1161
1603
|
if (A.length < 2) continue;
|
|
1162
|
-
const
|
|
1163
|
-
if (!(!Number.isFinite(
|
|
1164
|
-
for (let
|
|
1165
|
-
const
|
|
1166
|
-
Number.isFinite(
|
|
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(_));
|
|
1167
1609
|
}
|
|
1168
1610
|
}
|
|
1169
|
-
const
|
|
1170
|
-
for (const [
|
|
1171
|
-
|
|
1172
|
-
return Object.keys(
|
|
1611
|
+
const y = {};
|
|
1612
|
+
for (const [b, L] of Object.entries(h))
|
|
1613
|
+
L.depths.length >= 2 && (y[b] = L);
|
|
1614
|
+
return Object.keys(y).length === 0 ? [] : [{ holeId: d, units: g, channels: y }];
|
|
1173
1615
|
}
|
|
1174
|
-
const
|
|
1616
|
+
const vt = [
|
|
1175
1617
|
"#0f172a",
|
|
1176
1618
|
"#1e3a5f",
|
|
1177
1619
|
"#7c3aed",
|
|
@@ -1182,26 +1624,26 @@ const dt = [
|
|
|
1182
1624
|
"#db2777",
|
|
1183
1625
|
"#65a30d",
|
|
1184
1626
|
"#9333ea"
|
|
1185
|
-
],
|
|
1186
|
-
function
|
|
1627
|
+
], An = { l: 42, r: 4, t: 4, b: 36 }, Qe = 10, et = 11, Sn = 6;
|
|
1628
|
+
function Et(e = {}) {
|
|
1187
1629
|
return {
|
|
1188
1630
|
...e,
|
|
1189
|
-
margin:
|
|
1631
|
+
margin: An,
|
|
1190
1632
|
autosize: !0,
|
|
1191
1633
|
width: void 0,
|
|
1192
1634
|
xaxis: {
|
|
1193
1635
|
...e.xaxis || {},
|
|
1194
1636
|
tickfont: {
|
|
1195
1637
|
...e.xaxis && e.xaxis.tickfont || {},
|
|
1196
|
-
size:
|
|
1638
|
+
size: Qe
|
|
1197
1639
|
},
|
|
1198
1640
|
title: {
|
|
1199
1641
|
...e.xaxis && e.xaxis.title || {},
|
|
1200
1642
|
font: {
|
|
1201
1643
|
...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
|
|
1202
|
-
size:
|
|
1644
|
+
size: et
|
|
1203
1645
|
},
|
|
1204
|
-
standoff: (e.xaxis && e.xaxis.title && e.xaxis.title.standoff) ??
|
|
1646
|
+
standoff: (e.xaxis && e.xaxis.title && e.xaxis.title.standoff) ?? Sn
|
|
1205
1647
|
}
|
|
1206
1648
|
},
|
|
1207
1649
|
yaxis: {
|
|
@@ -1209,66 +1651,66 @@ function mt(e = {}) {
|
|
|
1209
1651
|
automargin: !0,
|
|
1210
1652
|
tickfont: {
|
|
1211
1653
|
...e.yaxis && e.yaxis.tickfont || {},
|
|
1212
|
-
size:
|
|
1654
|
+
size: Qe
|
|
1213
1655
|
},
|
|
1214
1656
|
title: {
|
|
1215
1657
|
...e.yaxis && e.yaxis.title || {},
|
|
1216
1658
|
font: {
|
|
1217
1659
|
...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
|
|
1218
|
-
size:
|
|
1660
|
+
size: et
|
|
1219
1661
|
}
|
|
1220
1662
|
}
|
|
1221
1663
|
}
|
|
1222
1664
|
};
|
|
1223
1665
|
}
|
|
1224
|
-
function
|
|
1225
|
-
tailScale:
|
|
1666
|
+
function Tn(e, {
|
|
1667
|
+
tailScale: r = 5,
|
|
1226
1668
|
colorBy: t = null,
|
|
1227
|
-
palette:
|
|
1228
|
-
depthCol:
|
|
1229
|
-
dipCol:
|
|
1230
|
-
azCol:
|
|
1669
|
+
palette: n = vt,
|
|
1670
|
+
depthCol: s = j,
|
|
1671
|
+
dipCol: o = W,
|
|
1672
|
+
azCol: i = Y,
|
|
1231
1673
|
template: a = void 0
|
|
1232
1674
|
} = {}) {
|
|
1233
1675
|
const l = e.filter(
|
|
1234
|
-
(
|
|
1676
|
+
(h) => h[s] != null && h[o] != null && h[i] != null
|
|
1235
1677
|
);
|
|
1236
1678
|
if (!l.length)
|
|
1237
1679
|
return { data: [], layout: {} };
|
|
1238
1680
|
const u = {};
|
|
1239
|
-
t && [...new Set(l.map((
|
|
1240
|
-
u[
|
|
1681
|
+
t && [...new Set(l.map((y) => y[t]).filter((y) => y != null))].sort().forEach((y, p) => {
|
|
1682
|
+
u[y] = n[p % n.length];
|
|
1241
1683
|
});
|
|
1242
1684
|
const c = /* @__PURE__ */ new Map(), d = [];
|
|
1243
|
-
for (const
|
|
1244
|
-
const
|
|
1245
|
-
c.has(
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
const
|
|
1685
|
+
for (const h of l) {
|
|
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);
|
|
1689
|
+
w.xs.push(p), w.ys.push(y), w.dips.push(p), w.azs.push(E);
|
|
1690
|
+
const k = E * Math.PI / 180, $ = r * (Math.abs(p) / 90), P = Math.sin(k) * $, H = Math.cos(k) * $;
|
|
1249
1691
|
d.push({
|
|
1250
1692
|
type: "line",
|
|
1251
|
-
x0:
|
|
1252
|
-
y0:
|
|
1253
|
-
x1:
|
|
1254
|
-
y1:
|
|
1255
|
-
line: { color:
|
|
1693
|
+
x0: p,
|
|
1694
|
+
y0: y,
|
|
1695
|
+
x1: p + P,
|
|
1696
|
+
y1: y + H,
|
|
1697
|
+
line: { color: F, width: 2 }
|
|
1256
1698
|
});
|
|
1257
1699
|
}
|
|
1258
|
-
const
|
|
1259
|
-
for (const [
|
|
1260
|
-
|
|
1700
|
+
const f = [], m = t && c.size > 1;
|
|
1701
|
+
for (const [h, y] of c.entries())
|
|
1702
|
+
f.push({
|
|
1261
1703
|
type: "scatter",
|
|
1262
|
-
x:
|
|
1263
|
-
y:
|
|
1704
|
+
x: y.xs,
|
|
1705
|
+
y: y.ys,
|
|
1264
1706
|
mode: "markers",
|
|
1265
|
-
name:
|
|
1266
|
-
marker: { size: 8, color:
|
|
1267
|
-
showlegend:
|
|
1268
|
-
customdata:
|
|
1707
|
+
name: h !== "_default" ? String(h) : void 0,
|
|
1708
|
+
marker: { size: 8, color: y.color },
|
|
1709
|
+
showlegend: m && h !== "_default",
|
|
1710
|
+
customdata: y.dips.map((p, E) => [p, y.azs[E]]),
|
|
1269
1711
|
hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
|
|
1270
1712
|
});
|
|
1271
|
-
return { data:
|
|
1713
|
+
return { data: f, layout: {
|
|
1272
1714
|
shapes: d,
|
|
1273
1715
|
height: 400,
|
|
1274
1716
|
margin: { l: 40, r: 10, t: 10, b: 40 },
|
|
@@ -1280,39 +1722,39 @@ function nn(e, {
|
|
|
1280
1722
|
tickvals: [-90, -60, -30, 0, 30, 60, 90]
|
|
1281
1723
|
},
|
|
1282
1724
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
1283
|
-
showlegend: !!
|
|
1284
|
-
template: a !== void 0 ? a :
|
|
1725
|
+
showlegend: !!m,
|
|
1726
|
+
template: a !== void 0 ? a : Ue
|
|
1285
1727
|
} };
|
|
1286
1728
|
}
|
|
1287
|
-
function
|
|
1288
|
-
labelCol:
|
|
1289
|
-
palette: t =
|
|
1290
|
-
fromCol:
|
|
1291
|
-
toCol:
|
|
1292
|
-
template:
|
|
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
|
|
1293
1735
|
} = {}) {
|
|
1294
|
-
const
|
|
1295
|
-
const
|
|
1296
|
-
if (
|
|
1297
|
-
const
|
|
1298
|
-
return
|
|
1299
|
-
}).map((
|
|
1300
|
-
if (!
|
|
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];
|
|
1738
|
+
if (m == null) return !1;
|
|
1739
|
+
const g = String(m).trim();
|
|
1740
|
+
return g !== "" && !/^(nan|null|none)$/i.test(g);
|
|
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)
|
|
1301
1743
|
return { data: [], layout: {} };
|
|
1302
1744
|
const a = [], l = [], u = [];
|
|
1303
|
-
return
|
|
1745
|
+
return i.forEach((f, m) => {
|
|
1304
1746
|
a.push({
|
|
1305
1747
|
type: "rect",
|
|
1306
1748
|
xref: "x",
|
|
1307
1749
|
yref: "y",
|
|
1308
1750
|
x0: 0,
|
|
1309
1751
|
x1: 1,
|
|
1310
|
-
y0:
|
|
1311
|
-
y1:
|
|
1312
|
-
fillcolor: t[
|
|
1752
|
+
y0: f.from,
|
|
1753
|
+
y1: f.to,
|
|
1754
|
+
fillcolor: t[m % t.length],
|
|
1313
1755
|
line: { width: 0 },
|
|
1314
1756
|
layer: "below"
|
|
1315
|
-
}), l.push(0.5 * (
|
|
1757
|
+
}), l.push(0.5 * (f.from + f.to)), u.push(f.label);
|
|
1316
1758
|
}), { data: [{
|
|
1317
1759
|
type: "scatter",
|
|
1318
1760
|
x: Array(u.length).fill(0.5),
|
|
@@ -1322,104 +1764,104 @@ function or(e, {
|
|
|
1322
1764
|
textposition: "middle center",
|
|
1323
1765
|
showlegend: !1,
|
|
1324
1766
|
hoverinfo: "text"
|
|
1325
|
-
}], layout:
|
|
1767
|
+
}], layout: Et({
|
|
1326
1768
|
shapes: a,
|
|
1327
1769
|
height: 400,
|
|
1328
1770
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
1329
1771
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
1330
1772
|
showlegend: !1,
|
|
1331
|
-
template:
|
|
1773
|
+
template: o !== void 0 ? o : Ue
|
|
1332
1774
|
}) };
|
|
1333
1775
|
}
|
|
1334
|
-
function
|
|
1776
|
+
function tt(e, r) {
|
|
1335
1777
|
if (!e) return "";
|
|
1336
|
-
const t = String(e).trim().split(/\s+/),
|
|
1337
|
-
let
|
|
1338
|
-
for (const
|
|
1339
|
-
|
|
1340
|
-
return
|
|
1341
|
-
}
|
|
1342
|
-
function
|
|
1343
|
-
commentCol:
|
|
1344
|
-
fromCol: t =
|
|
1345
|
-
toCol:
|
|
1346
|
-
bgColor:
|
|
1347
|
-
borderColor:
|
|
1348
|
-
textColor:
|
|
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",
|
|
1349
1791
|
charsPerLine: a = 18,
|
|
1350
1792
|
template: l = void 0
|
|
1351
1793
|
} = {}) {
|
|
1352
|
-
const u = e.filter((
|
|
1353
|
-
const
|
|
1354
|
-
return { from: Number(
|
|
1355
|
-
}).sort((
|
|
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 };
|
|
1797
|
+
}).sort((p, E) => p.from - E.from);
|
|
1356
1798
|
if (!u.length)
|
|
1357
1799
|
return { data: [], layout: {} };
|
|
1358
|
-
const c = [], d = [],
|
|
1359
|
-
for (const
|
|
1360
|
-
const
|
|
1800
|
+
const c = [], d = [], f = [], m = [], g = [];
|
|
1801
|
+
for (const p of u) {
|
|
1802
|
+
const E = 0.5 * (p.from + p.to), x = !!p.comment;
|
|
1361
1803
|
c.push({
|
|
1362
1804
|
type: "rect",
|
|
1363
1805
|
xref: "x",
|
|
1364
1806
|
yref: "y",
|
|
1365
1807
|
x0: 0,
|
|
1366
1808
|
x1: 1,
|
|
1367
|
-
y0:
|
|
1368
|
-
y1:
|
|
1369
|
-
fillcolor:
|
|
1370
|
-
line: { color:
|
|
1809
|
+
y0: p.from,
|
|
1810
|
+
y1: p.to,
|
|
1811
|
+
fillcolor: x ? s : "rgba(0,0,0,0)",
|
|
1812
|
+
line: { color: o, width: 1 },
|
|
1371
1813
|
layer: "below"
|
|
1372
|
-
}),
|
|
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)}`));
|
|
1373
1815
|
}
|
|
1374
1816
|
return { data: d.length ? [{
|
|
1375
1817
|
type: "scatter",
|
|
1376
1818
|
x: d,
|
|
1377
|
-
y:
|
|
1819
|
+
y: f,
|
|
1378
1820
|
mode: "text",
|
|
1379
|
-
text:
|
|
1821
|
+
text: m,
|
|
1380
1822
|
textposition: "middle center",
|
|
1381
|
-
textfont: { color:
|
|
1382
|
-
hovertext:
|
|
1823
|
+
textfont: { color: i, size: 10 },
|
|
1824
|
+
hovertext: g,
|
|
1383
1825
|
hoverinfo: "text",
|
|
1384
1826
|
showlegend: !1
|
|
1385
|
-
}] : [], layout:
|
|
1827
|
+
}] : [], layout: Et({
|
|
1386
1828
|
shapes: c,
|
|
1387
1829
|
height: 400,
|
|
1388
1830
|
xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
|
|
1389
1831
|
yaxis: { title: "Depth (m)", autorange: "reversed" },
|
|
1390
1832
|
showlegend: !1,
|
|
1391
|
-
template: l !== void 0 ? l :
|
|
1833
|
+
template: l !== void 0 ? l : Ue
|
|
1392
1834
|
}) };
|
|
1393
1835
|
}
|
|
1394
|
-
function
|
|
1395
|
-
symbolSize:
|
|
1836
|
+
function wr(e, {
|
|
1837
|
+
symbolSize: r = 10,
|
|
1396
1838
|
xCol: t = "easting",
|
|
1397
|
-
yCol:
|
|
1839
|
+
yCol: n = "northing"
|
|
1398
1840
|
} = {}) {
|
|
1399
|
-
const
|
|
1400
|
-
if (
|
|
1401
|
-
const l = (a - 90 + 360) % 360, u = l * Math.PI / 180, c = a * Math.PI / 180, d =
|
|
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);
|
|
1402
1844
|
return {
|
|
1403
1845
|
strike: l,
|
|
1404
|
-
dipValue:
|
|
1405
|
-
x:
|
|
1406
|
-
y:
|
|
1407
|
-
strikeX0:
|
|
1408
|
-
strikeY0:
|
|
1409
|
-
strikeX1:
|
|
1410
|
-
strikeY1:
|
|
1411
|
-
tickX1:
|
|
1412
|
-
tickY1:
|
|
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
|
|
1413
1855
|
};
|
|
1414
1856
|
}
|
|
1415
|
-
function
|
|
1857
|
+
function Ln({
|
|
1416
1858
|
holeId: e,
|
|
1417
|
-
hole:
|
|
1859
|
+
hole: r,
|
|
1418
1860
|
holeOptions: t,
|
|
1419
|
-
property:
|
|
1420
|
-
propertyOptions:
|
|
1421
|
-
displayType:
|
|
1422
|
-
points:
|
|
1861
|
+
property: n,
|
|
1862
|
+
propertyOptions: s,
|
|
1863
|
+
displayType: o,
|
|
1864
|
+
points: i,
|
|
1423
1865
|
renderError: a
|
|
1424
1866
|
}) {
|
|
1425
1867
|
if (a)
|
|
@@ -1427,80 +1869,80 @@ function on({
|
|
|
1427
1869
|
const l = t || [];
|
|
1428
1870
|
if (!e)
|
|
1429
1871
|
return l.length === 0 ? { kind: "placeholder", text: "No holes loaded" } : { kind: "placeholder", text: "Select a hole" };
|
|
1430
|
-
if (!
|
|
1872
|
+
if (!r)
|
|
1431
1873
|
return { kind: "placeholder", text: `Loading ${e}…` };
|
|
1432
|
-
const u =
|
|
1433
|
-
return
|
|
1434
|
-
}
|
|
1435
|
-
function
|
|
1436
|
-
if (typeof
|
|
1437
|
-
if (!(typeof
|
|
1438
|
-
return e[
|
|
1439
|
-
}
|
|
1440
|
-
function
|
|
1441
|
-
const t = [],
|
|
1442
|
-
for (const
|
|
1443
|
-
const
|
|
1444
|
-
|
|
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));
|
|
1445
1887
|
}
|
|
1446
1888
|
return t;
|
|
1447
1889
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return t == null || t === "" ? e || [] : (e || []).filter((
|
|
1890
|
+
function On(e, r, t) {
|
|
1891
|
+
return t == null || t === "" ? e || [] : (e || []).filter((n) => It(n, r) === t);
|
|
1450
1892
|
}
|
|
1451
|
-
function
|
|
1893
|
+
function Dn({
|
|
1452
1894
|
chartOptions: e,
|
|
1453
|
-
showHoleSelect:
|
|
1895
|
+
showHoleSelect: r,
|
|
1454
1896
|
showPropertySelect: t,
|
|
1455
|
-
showChartTypeSelect:
|
|
1897
|
+
showChartTypeSelect: n
|
|
1456
1898
|
}) {
|
|
1457
1899
|
return {
|
|
1458
|
-
hole:
|
|
1900
|
+
hole: r !== !1,
|
|
1459
1901
|
property: t !== !1,
|
|
1460
|
-
chartType:
|
|
1902
|
+
chartType: n !== !1 && (e || []).length > 1
|
|
1461
1903
|
};
|
|
1462
1904
|
}
|
|
1463
|
-
const
|
|
1464
|
-
function
|
|
1465
|
-
var
|
|
1466
|
-
const t =
|
|
1467
|
-
return t.some((
|
|
1468
|
-
}
|
|
1469
|
-
function
|
|
1470
|
-
const
|
|
1471
|
-
return [
|
|
1472
|
-
}
|
|
1473
|
-
function
|
|
1474
|
-
const
|
|
1475
|
-
return [
|
|
1476
|
-
}
|
|
1477
|
-
function
|
|
1478
|
-
const
|
|
1479
|
-
if (
|
|
1480
|
-
const
|
|
1481
|
-
return /* @__PURE__ */
|
|
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(
|
|
1482
1924
|
"select",
|
|
1483
1925
|
{
|
|
1484
1926
|
className: "plot-select plot-select--field",
|
|
1485
|
-
value:
|
|
1927
|
+
value: i,
|
|
1486
1928
|
onChange: (u) => e.onChange && e.onChange(u.target.value),
|
|
1487
1929
|
disabled: a.length === 0,
|
|
1488
1930
|
"aria-label": l,
|
|
1489
1931
|
children: [
|
|
1490
|
-
a.length === 0 && /* @__PURE__ */
|
|
1491
|
-
!
|
|
1932
|
+
a.length === 0 && /* @__PURE__ */ T("option", { value: "", children: "—" }),
|
|
1933
|
+
!i && a.length > 0 && /* @__PURE__ */ T("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
|
|
1492
1934
|
a.map((u) => {
|
|
1493
|
-
const [c, d] =
|
|
1494
|
-
return /* @__PURE__ */
|
|
1935
|
+
const [c, d] = rt(u);
|
|
1936
|
+
return /* @__PURE__ */ T("option", { value: c, children: d }, c);
|
|
1495
1937
|
})
|
|
1496
1938
|
]
|
|
1497
1939
|
}
|
|
1498
1940
|
);
|
|
1499
1941
|
}
|
|
1500
|
-
if (
|
|
1501
|
-
const
|
|
1502
|
-
return /* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
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(
|
|
1504
1946
|
"select",
|
|
1505
1947
|
{
|
|
1506
1948
|
className: "plot-select plot-select--group",
|
|
@@ -1509,554 +1951,554 @@ function un({ selector: e, holeOptions: n, selectedHoleId: t, onConfigChange: r
|
|
|
1509
1951
|
disabled: u.length === 0,
|
|
1510
1952
|
"aria-label": l,
|
|
1511
1953
|
children: [
|
|
1512
|
-
u.length === 0 && /* @__PURE__ */
|
|
1954
|
+
u.length === 0 && /* @__PURE__ */ U("option", { value: "", children: [
|
|
1513
1955
|
"No ",
|
|
1514
1956
|
l.toLowerCase(),
|
|
1515
1957
|
"s"
|
|
1516
1958
|
] }),
|
|
1517
|
-
!a && u.length > 0 && /* @__PURE__ */
|
|
1959
|
+
!a && u.length > 0 && /* @__PURE__ */ T("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
|
|
1518
1960
|
u.map((d) => {
|
|
1519
|
-
const [
|
|
1520
|
-
return /* @__PURE__ */
|
|
1961
|
+
const [f, m] = rt(d);
|
|
1962
|
+
return /* @__PURE__ */ T("option", { value: f, children: m }, f);
|
|
1521
1963
|
})
|
|
1522
1964
|
]
|
|
1523
1965
|
}
|
|
1524
1966
|
),
|
|
1525
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ U(
|
|
1526
1968
|
"select",
|
|
1527
1969
|
{
|
|
1528
1970
|
className: "plot-select plot-select--hole",
|
|
1529
1971
|
value: t,
|
|
1530
|
-
onChange: (d) =>
|
|
1972
|
+
onChange: (d) => n && n({ holeId: d.target.value }),
|
|
1531
1973
|
disabled: c.length === 0,
|
|
1532
1974
|
"aria-label": "Hole",
|
|
1533
1975
|
children: [
|
|
1534
|
-
c.length === 0 && /* @__PURE__ */
|
|
1535
|
-
!t && c.length > 0 && /* @__PURE__ */
|
|
1976
|
+
c.length === 0 && /* @__PURE__ */ T("option", { value: "", children: "No holes" }),
|
|
1977
|
+
!t && c.length > 0 && /* @__PURE__ */ T("option", { value: "", disabled: !0, hidden: !0, children: "Select a hole" }),
|
|
1536
1978
|
c.map((d) => {
|
|
1537
|
-
const [
|
|
1538
|
-
return /* @__PURE__ */
|
|
1979
|
+
const [f, m] = nt(d);
|
|
1980
|
+
return /* @__PURE__ */ T("option", { value: f, children: m }, f);
|
|
1539
1981
|
})
|
|
1540
1982
|
]
|
|
1541
1983
|
}
|
|
1542
1984
|
)
|
|
1543
1985
|
] });
|
|
1544
1986
|
}
|
|
1545
|
-
const
|
|
1546
|
-
return /* @__PURE__ */
|
|
1987
|
+
const o = r.length > 0;
|
|
1988
|
+
return /* @__PURE__ */ U(
|
|
1547
1989
|
"select",
|
|
1548
1990
|
{
|
|
1549
1991
|
className: "plot-select plot-select--hole",
|
|
1550
1992
|
value: t,
|
|
1551
|
-
onChange: (
|
|
1552
|
-
disabled: !
|
|
1993
|
+
onChange: (i) => n && n({ holeId: i.target.value }),
|
|
1994
|
+
disabled: !o,
|
|
1553
1995
|
"aria-label": "Hole",
|
|
1554
1996
|
children: [
|
|
1555
|
-
!
|
|
1556
|
-
!t &&
|
|
1557
|
-
|
|
1558
|
-
const [a, l] =
|
|
1559
|
-
return /* @__PURE__ */
|
|
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);
|
|
2001
|
+
return /* @__PURE__ */ T("option", { value: a, children: l }, a);
|
|
1560
2002
|
})
|
|
1561
2003
|
]
|
|
1562
2004
|
}
|
|
1563
2005
|
);
|
|
1564
2006
|
}
|
|
1565
|
-
function
|
|
2007
|
+
function Hr({
|
|
1566
2008
|
config: e,
|
|
1567
|
-
graph:
|
|
2009
|
+
graph: r,
|
|
1568
2010
|
holeOptions: t = [],
|
|
1569
|
-
propertyOptions:
|
|
1570
|
-
propertyMeta:
|
|
1571
|
-
onConfigChange:
|
|
1572
|
-
template:
|
|
2011
|
+
propertyOptions: n = [],
|
|
2012
|
+
propertyMeta: s,
|
|
2013
|
+
onConfigChange: o,
|
|
2014
|
+
template: i,
|
|
1573
2015
|
showHoleSelect: a = !0,
|
|
1574
2016
|
showPropertySelect: l = !0,
|
|
1575
2017
|
showChartTypeSelect: u = !0,
|
|
1576
2018
|
holeSelector: c
|
|
1577
2019
|
}) {
|
|
1578
|
-
const d =
|
|
1579
|
-
holeId:
|
|
1580
|
-
hole:
|
|
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({
|
|
2021
|
+
holeId: E,
|
|
2022
|
+
hole: m,
|
|
1581
2023
|
holeOptions: t,
|
|
1582
|
-
property:
|
|
1583
|
-
propertyOptions:
|
|
1584
|
-
displayType:
|
|
1585
|
-
points:
|
|
1586
|
-
renderError:
|
|
1587
|
-
}),
|
|
1588
|
-
chartOptions:
|
|
2024
|
+
property: h,
|
|
2025
|
+
propertyOptions: n,
|
|
2026
|
+
displayType: x,
|
|
2027
|
+
points: g,
|
|
2028
|
+
renderError: k
|
|
2029
|
+
}), L = b.kind !== "chart", A = Dn({
|
|
2030
|
+
chartOptions: F,
|
|
1589
2031
|
showHoleSelect: a,
|
|
1590
2032
|
showPropertySelect: l,
|
|
1591
2033
|
showChartTypeSelect: u
|
|
1592
|
-
}),
|
|
2034
|
+
}), C = n.length > 0;
|
|
1593
2035
|
return te(() => {
|
|
1594
|
-
const
|
|
1595
|
-
if (!
|
|
1596
|
-
let
|
|
1597
|
-
const
|
|
1598
|
-
|
|
1599
|
-
const
|
|
1600
|
-
|
|
2036
|
+
const I = d.current;
|
|
2037
|
+
if (!I || typeof ResizeObserver > "u") return;
|
|
2038
|
+
let v = 0;
|
|
2039
|
+
const _ = () => {
|
|
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 });
|
|
1601
2043
|
});
|
|
1602
2044
|
};
|
|
1603
|
-
|
|
1604
|
-
const
|
|
1605
|
-
return
|
|
1606
|
-
|
|
2045
|
+
_();
|
|
2046
|
+
const D = new ResizeObserver(_);
|
|
2047
|
+
return D.observe(I), () => {
|
|
2048
|
+
v && cancelAnimationFrame(v), D.disconnect();
|
|
1607
2049
|
};
|
|
1608
2050
|
}, []), te(() => {
|
|
1609
|
-
if (
|
|
1610
|
-
const
|
|
1611
|
-
if (!
|
|
1612
|
-
const
|
|
1613
|
-
let
|
|
2051
|
+
if (b.kind !== "chart") return;
|
|
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;
|
|
1614
2056
|
try {
|
|
1615
|
-
|
|
1616
|
-
points:
|
|
1617
|
-
isCategorical:
|
|
1618
|
-
property:
|
|
1619
|
-
chartType:
|
|
1620
|
-
template:
|
|
1621
|
-
meta:
|
|
2057
|
+
v ? D = xn(g, { commentCol: h, fromCol: "from", toCol: "to" }) : _ ? D = Tn(g) : D = $t({
|
|
2058
|
+
points: g,
|
|
2059
|
+
isCategorical: x === We,
|
|
2060
|
+
property: h,
|
|
2061
|
+
chartType: w,
|
|
2062
|
+
template: i,
|
|
2063
|
+
meta: y
|
|
1622
2064
|
});
|
|
1623
|
-
} catch (
|
|
1624
|
-
console.error("Plot build error",
|
|
2065
|
+
} catch (R) {
|
|
2066
|
+
console.error("Plot build error", R), $((R == null ? void 0 : R.message) || "Plot build error");
|
|
1625
2067
|
return;
|
|
1626
2068
|
}
|
|
1627
|
-
if ((!(
|
|
2069
|
+
if ((!(D != null && D.data) || D.data.length === 0) && !v)
|
|
1628
2070
|
return;
|
|
1629
|
-
const
|
|
2071
|
+
const z = {
|
|
1630
2072
|
displayModeBar: !0,
|
|
1631
2073
|
responsive: !1,
|
|
1632
2074
|
modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
|
|
1633
|
-
},
|
|
1634
|
-
...
|
|
2075
|
+
}, O = {
|
|
2076
|
+
...D.layout,
|
|
1635
2077
|
autosize: !1,
|
|
1636
|
-
width:
|
|
1637
|
-
height:
|
|
2078
|
+
width: P.width,
|
|
2079
|
+
height: P.height
|
|
1638
2080
|
};
|
|
1639
2081
|
try {
|
|
1640
|
-
|
|
1641
|
-
} catch (
|
|
1642
|
-
console.error("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");
|
|
1643
2085
|
}
|
|
1644
2086
|
return () => {
|
|
1645
|
-
if (
|
|
2087
|
+
if (I)
|
|
1646
2088
|
try {
|
|
1647
|
-
|
|
1648
|
-
} catch (
|
|
1649
|
-
console.warn("Plot purge error",
|
|
2089
|
+
ke.purge(I);
|
|
2090
|
+
} catch (R) {
|
|
2091
|
+
console.warn("Plot purge error", R);
|
|
1650
2092
|
}
|
|
1651
2093
|
};
|
|
1652
2094
|
}, [
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
2095
|
+
b.kind,
|
|
2096
|
+
m,
|
|
2097
|
+
h,
|
|
2098
|
+
y,
|
|
2099
|
+
w,
|
|
2100
|
+
x,
|
|
2101
|
+
g,
|
|
2102
|
+
i,
|
|
2103
|
+
P.width,
|
|
2104
|
+
P.height
|
|
1663
2105
|
]), te(() => {
|
|
1664
|
-
const
|
|
1665
|
-
if (!
|
|
1666
|
-
const
|
|
2106
|
+
const I = f.current;
|
|
2107
|
+
if (!I || typeof ResizeObserver > "u") return;
|
|
2108
|
+
const v = new ResizeObserver(() => {
|
|
1667
2109
|
try {
|
|
1668
|
-
if (
|
|
1669
|
-
const
|
|
1670
|
-
|
|
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 });
|
|
1671
2113
|
}
|
|
1672
|
-
} catch (
|
|
1673
|
-
console.warn("Plot resize error",
|
|
2114
|
+
} catch (_) {
|
|
2115
|
+
console.warn("Plot resize error", _);
|
|
1674
2116
|
}
|
|
1675
2117
|
});
|
|
1676
|
-
return
|
|
1677
|
-
}, [
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
A.hole && /* @__PURE__ */
|
|
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({
|
|
1680
2122
|
selector: c,
|
|
1681
2123
|
holeOptions: t,
|
|
1682
|
-
selectedHoleId:
|
|
1683
|
-
onConfigChange:
|
|
2124
|
+
selectedHoleId: E,
|
|
2125
|
+
onConfigChange: o
|
|
1684
2126
|
}) }),
|
|
1685
|
-
(A.property || A.chartType) && /* @__PURE__ */
|
|
1686
|
-
A.property && /* @__PURE__ */
|
|
2127
|
+
(A.property || A.chartType) && /* @__PURE__ */ U("div", { className: "plot-controls column", children: [
|
|
2128
|
+
A.property && /* @__PURE__ */ U(
|
|
1687
2129
|
"select",
|
|
1688
2130
|
{
|
|
1689
2131
|
className: "plot-select plot-select--property",
|
|
1690
|
-
value:
|
|
1691
|
-
onChange: (
|
|
1692
|
-
disabled: !
|
|
2132
|
+
value: h,
|
|
2133
|
+
onChange: (I) => o && o({ property: I.target.value }),
|
|
2134
|
+
disabled: !C,
|
|
1693
2135
|
"aria-label": "Property",
|
|
1694
2136
|
children: [
|
|
1695
|
-
!
|
|
1696
|
-
!
|
|
1697
|
-
|
|
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))
|
|
1698
2140
|
]
|
|
1699
2141
|
}
|
|
1700
2142
|
),
|
|
1701
|
-
A.chartType && /* @__PURE__ */
|
|
2143
|
+
A.chartType && /* @__PURE__ */ T(
|
|
1702
2144
|
"select",
|
|
1703
2145
|
{
|
|
1704
2146
|
className: "plot-select plot-select--chart-type",
|
|
1705
|
-
value:
|
|
1706
|
-
onChange: (
|
|
2147
|
+
value: w,
|
|
2148
|
+
onChange: (I) => o && o({ chartType: I.target.value }),
|
|
1707
2149
|
"aria-label": "Chart type",
|
|
1708
|
-
children:
|
|
2150
|
+
children: F.map((I) => /* @__PURE__ */ T("option", { value: I.value, children: I.label }, I.value))
|
|
1709
2151
|
}
|
|
1710
2152
|
)
|
|
1711
2153
|
] })
|
|
1712
2154
|
] }),
|
|
1713
|
-
/* @__PURE__ */
|
|
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 }) })
|
|
1714
2156
|
] });
|
|
1715
2157
|
}
|
|
1716
|
-
function
|
|
1717
|
-
if (!(
|
|
1718
|
-
const t = new Map(e.map((
|
|
1719
|
-
for (const
|
|
1720
|
-
const
|
|
1721
|
-
if (
|
|
1722
|
-
if (t.has(
|
|
1723
|
-
const
|
|
1724
|
-
t.set(
|
|
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 || []] });
|
|
1725
2167
|
} else
|
|
1726
|
-
t.set(
|
|
2168
|
+
t.set(s, n);
|
|
1727
2169
|
}
|
|
1728
2170
|
return Array.from(t.values());
|
|
1729
2171
|
}
|
|
1730
|
-
function
|
|
1731
|
-
if (!e || !
|
|
1732
|
-
const t = /* @__PURE__ */ new Set(),
|
|
1733
|
-
for (const
|
|
1734
|
-
const
|
|
1735
|
-
if (!Number.isFinite(
|
|
1736
|
-
const a = `${
|
|
1737
|
-
t.has(a) || (t.add(a),
|
|
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] ?? "" }));
|
|
1738
2180
|
}
|
|
1739
|
-
return
|
|
2181
|
+
return n;
|
|
1740
2182
|
}
|
|
1741
|
-
function
|
|
2183
|
+
function Br({
|
|
1742
2184
|
initialFocusedHoleId: e = "",
|
|
1743
|
-
sourceFile:
|
|
2185
|
+
sourceFile: r = null,
|
|
1744
2186
|
extraHoles: t = [],
|
|
1745
|
-
plotCount:
|
|
2187
|
+
plotCount: n = 4
|
|
1746
2188
|
} = {}) {
|
|
1747
|
-
const [
|
|
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);
|
|
1748
2190
|
te(() => {
|
|
1749
|
-
!
|
|
1750
|
-
if (!
|
|
1751
|
-
const
|
|
1752
|
-
a(
|
|
1753
|
-
holeIds:
|
|
1754
|
-
focusedHoleId:
|
|
1755
|
-
plotCount:
|
|
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,
|
|
1756
2198
|
defaultProp: "",
|
|
1757
2199
|
categoricalProps: c,
|
|
1758
|
-
commentProps:
|
|
2200
|
+
commentProps: f,
|
|
1759
2201
|
numericDefaultChartType: "markers+line"
|
|
1760
2202
|
}));
|
|
1761
|
-
}).catch((
|
|
1762
|
-
console.info("Assay metadata load skipped:",
|
|
2203
|
+
}).catch((v) => {
|
|
2204
|
+
console.info("Assay metadata load skipped:", v.message);
|
|
1763
2205
|
}));
|
|
1764
|
-
}, [
|
|
2206
|
+
}, [r, k, n, c, f]), te(() => {
|
|
1765
2207
|
if (!(t != null && t.length)) return;
|
|
1766
|
-
const
|
|
1767
|
-
a((
|
|
1768
|
-
const
|
|
1769
|
-
return
|
|
2208
|
+
const v = t.map((_) => ({ holeId: _.id || _.holeId })).filter((_) => _.holeId);
|
|
2209
|
+
a((_) => {
|
|
2210
|
+
const D = new Set(_.map((O) => O.holeId)), z = v.filter((O) => !D.has(O.holeId));
|
|
2211
|
+
return z.length ? [..._, ...z] : _;
|
|
1770
2212
|
});
|
|
1771
2213
|
}, [t]), te(() => {
|
|
1772
|
-
|
|
1773
|
-
}, [
|
|
1774
|
-
if (!
|
|
1775
|
-
|
|
2214
|
+
w((v) => v && v.startsWith("Loading ") && v.includes(" for hole ") ? v : "");
|
|
2215
|
+
}, [E]), te(() => {
|
|
2216
|
+
if (!i.length) {
|
|
2217
|
+
x([]);
|
|
1776
2218
|
return;
|
|
1777
2219
|
}
|
|
1778
|
-
const
|
|
1779
|
-
|
|
2220
|
+
const v = ft(i.map((_) => _.holeId), k);
|
|
2221
|
+
x((_) => Array.from({ length: n }).map((z, O) => {
|
|
1780
2222
|
var X;
|
|
1781
|
-
const
|
|
1782
|
-
property:
|
|
1783
|
-
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,
|
|
1784
2226
|
categoricalProps: c,
|
|
1785
|
-
commentProps:
|
|
2227
|
+
commentProps: f,
|
|
1786
2228
|
numericDefaultChartType: "markers+line"
|
|
1787
2229
|
});
|
|
1788
|
-
return { holeId:
|
|
2230
|
+
return { holeId: V, property: B, chartType: q };
|
|
1789
2231
|
}));
|
|
1790
|
-
}, [
|
|
1791
|
-
if (!
|
|
1792
|
-
|
|
1793
|
-
const
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
const
|
|
1797
|
-
[...
|
|
2232
|
+
}, [i, k, y, c, f, n]), te(() => {
|
|
2233
|
+
if (!r) return;
|
|
2234
|
+
E.map((_) => _.holeId).filter(Boolean).forEach((_) => {
|
|
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],
|
|
1798
2240
|
t
|
|
1799
|
-
),
|
|
1800
|
-
return u(
|
|
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) => ({
|
|
1801
2243
|
...X,
|
|
1802
|
-
property: X.property ||
|
|
1803
|
-
chartType:
|
|
1804
|
-
property: X.property ||
|
|
2244
|
+
property: X.property || B.defaultProp,
|
|
2245
|
+
chartType: xe({
|
|
2246
|
+
property: X.property || B.defaultProp,
|
|
1805
2247
|
chartType: X.chartType,
|
|
1806
|
-
categoricalProps:
|
|
1807
|
-
commentProps:
|
|
2248
|
+
categoricalProps: B.categoricalProps,
|
|
2249
|
+
commentProps: B.commentProps,
|
|
1808
2250
|
numericDefaultChartType: "markers+line"
|
|
1809
2251
|
})
|
|
1810
|
-
})))),
|
|
2252
|
+
})))), V;
|
|
1811
2253
|
});
|
|
1812
|
-
}).catch((
|
|
1813
|
-
console.error(
|
|
2254
|
+
}).catch((O) => {
|
|
2255
|
+
console.error(O), H((R) => R.filter((V) => V !== _)), w(O.message || `Error loading hole ${_}`);
|
|
1814
2256
|
}));
|
|
1815
2257
|
});
|
|
1816
|
-
}, [
|
|
1817
|
-
t != null && t.length &&
|
|
1818
|
-
if (!
|
|
1819
|
-
const
|
|
1820
|
-
return u(
|
|
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;
|
|
1821
2263
|
}
|
|
1822
|
-
const
|
|
1823
|
-
return u(
|
|
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), _;
|
|
1824
2266
|
});
|
|
1825
2267
|
}, [t]);
|
|
1826
|
-
const
|
|
1827
|
-
() => [...l, ...c, ...
|
|
1828
|
-
[l, c,
|
|
2268
|
+
const L = ee(
|
|
2269
|
+
() => [...l, ...c, ...f],
|
|
2270
|
+
[l, c, f]
|
|
1829
2271
|
), A = ee(
|
|
1830
|
-
() =>
|
|
1831
|
-
[
|
|
1832
|
-
),
|
|
1833
|
-
const
|
|
1834
|
-
return Array.from({ length:
|
|
1835
|
-
const
|
|
1836
|
-
let
|
|
1837
|
-
|
|
1838
|
-
const
|
|
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);
|
|
1839
2281
|
return {
|
|
1840
|
-
config: { holeId:
|
|
1841
|
-
hole:
|
|
1842
|
-
loading:
|
|
2282
|
+
config: { holeId: he, property: V, chartType: ve },
|
|
2283
|
+
hole: O,
|
|
2284
|
+
loading: P.includes(z.holeId),
|
|
1843
2285
|
isCategorical: q,
|
|
1844
|
-
isComment:
|
|
2286
|
+
isComment: B,
|
|
1845
2287
|
isTadpole: X,
|
|
1846
|
-
displayType:
|
|
1847
|
-
points:
|
|
1848
|
-
propertyOptions:
|
|
1849
|
-
label:
|
|
2288
|
+
displayType: le,
|
|
2289
|
+
points: Re,
|
|
2290
|
+
propertyOptions: R,
|
|
2291
|
+
label: he
|
|
1850
2292
|
};
|
|
1851
2293
|
});
|
|
1852
|
-
}, [
|
|
1853
|
-
|
|
1854
|
-
const
|
|
1855
|
-
return
|
|
1856
|
-
property:
|
|
1857
|
-
chartType:
|
|
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({
|
|
2298
|
+
property: _.property,
|
|
2299
|
+
chartType: R.chartType,
|
|
1858
2300
|
categoricalProps: c,
|
|
1859
|
-
commentProps:
|
|
2301
|
+
commentProps: f,
|
|
1860
2302
|
numericDefaultChartType: "markers+line"
|
|
1861
|
-
})),
|
|
2303
|
+
})), z[v] = R, z;
|
|
1862
2304
|
});
|
|
1863
2305
|
};
|
|
1864
2306
|
return {
|
|
1865
|
-
error:
|
|
1866
|
-
focusedHoleId:
|
|
1867
|
-
setFocusedHoleId:
|
|
1868
|
-
setError:
|
|
1869
|
-
holeCount:
|
|
2307
|
+
error: F,
|
|
2308
|
+
focusedHoleId: k,
|
|
2309
|
+
setFocusedHoleId: $,
|
|
2310
|
+
setError: w,
|
|
2311
|
+
holeCount: i.length,
|
|
1870
2312
|
numericProps: l,
|
|
1871
2313
|
categoricalProps: c,
|
|
1872
|
-
commentProps:
|
|
1873
|
-
columnMeta:
|
|
1874
|
-
propertyOptions:
|
|
2314
|
+
commentProps: f,
|
|
2315
|
+
columnMeta: g,
|
|
2316
|
+
propertyOptions: L,
|
|
1875
2317
|
labeledHoleOptions: A,
|
|
1876
|
-
traceGraphs:
|
|
1877
|
-
handleConfigChange:
|
|
2318
|
+
traceGraphs: C,
|
|
2319
|
+
handleConfigChange: I
|
|
1878
2320
|
};
|
|
1879
2321
|
}
|
|
1880
|
-
function
|
|
2322
|
+
function St(e) {
|
|
1881
2323
|
return Array.isArray(e) ? e : [];
|
|
1882
2324
|
}
|
|
1883
|
-
function
|
|
1884
|
-
const
|
|
1885
|
-
return Number.isFinite(
|
|
2325
|
+
function ze(e) {
|
|
2326
|
+
const r = Number(e);
|
|
2327
|
+
return Number.isFinite(r) ? r : void 0;
|
|
1886
2328
|
}
|
|
1887
|
-
function
|
|
2329
|
+
function Tt(e = {}) {
|
|
1888
2330
|
return {
|
|
1889
2331
|
...e,
|
|
1890
|
-
x:
|
|
1891
|
-
y:
|
|
1892
|
-
z:
|
|
2332
|
+
x: ze(e.x),
|
|
2333
|
+
y: ze(e.y),
|
|
2334
|
+
z: ze(e.z)
|
|
1893
2335
|
};
|
|
1894
2336
|
}
|
|
1895
|
-
function
|
|
1896
|
-
const [
|
|
1897
|
-
return
|
|
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) => {
|
|
1898
2340
|
if (!Number.isFinite(l.x) || !Number.isFinite(l.y)) return { ...l };
|
|
1899
|
-
const u = l.x -
|
|
2341
|
+
const u = l.x - n, c = l.y - s;
|
|
1900
2342
|
return {
|
|
1901
2343
|
...l,
|
|
1902
|
-
along: u * a + c *
|
|
1903
|
-
across: u *
|
|
2344
|
+
along: u * a + c * i,
|
|
2345
|
+
across: u * i - c * a
|
|
1904
2346
|
};
|
|
1905
2347
|
});
|
|
1906
2348
|
}
|
|
1907
|
-
function
|
|
1908
|
-
const
|
|
1909
|
-
return !Number.isFinite(
|
|
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);
|
|
1910
2352
|
}
|
|
1911
|
-
function
|
|
1912
|
-
let
|
|
1913
|
-
if (Array.isArray(
|
|
1914
|
-
const [
|
|
1915
|
-
|
|
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));
|
|
1916
2358
|
}
|
|
1917
|
-
return t && (
|
|
1918
|
-
...o,
|
|
1919
|
-
color_value: o == null ? void 0 : o[t]
|
|
1920
|
-
}))), r;
|
|
1921
|
-
}
|
|
1922
|
-
function cr(e = [], n = [0, 0], t = 0, r = 50, o = null) {
|
|
1923
|
-
let i = fn(e, n, t, r);
|
|
1924
|
-
return o && (i = i.map((s) => ({
|
|
2359
|
+
return t && (n = n.map((s) => ({
|
|
1925
2360
|
...s,
|
|
1926
|
-
color_value: s == null ? void 0 : s[
|
|
1927
|
-
}))),
|
|
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;
|
|
1928
2370
|
}
|
|
1929
|
-
function
|
|
2371
|
+
function Ve(e) {
|
|
1930
2372
|
return Array.isArray(e) ? e : [];
|
|
1931
2373
|
}
|
|
1932
|
-
function
|
|
2374
|
+
function Ye(e = {}) {
|
|
1933
2375
|
return e.hole_id ?? e.holeId ?? e.id;
|
|
1934
2376
|
}
|
|
1935
|
-
function
|
|
2377
|
+
function de(e, r = void 0) {
|
|
1936
2378
|
const t = Number(e);
|
|
1937
|
-
return Number.isFinite(t) ? t :
|
|
2379
|
+
return Number.isFinite(t) ? t : r;
|
|
1938
2380
|
}
|
|
1939
|
-
function
|
|
2381
|
+
function jr(e = [], r = null) {
|
|
1940
2382
|
const t = /* @__PURE__ */ new Map();
|
|
1941
|
-
|
|
1942
|
-
const
|
|
1943
|
-
if (
|
|
1944
|
-
const
|
|
1945
|
-
t.has(
|
|
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);
|
|
1946
2388
|
});
|
|
1947
|
-
const
|
|
1948
|
-
return t.forEach((
|
|
1949
|
-
const
|
|
1950
|
-
hole_id:
|
|
1951
|
-
x:
|
|
1952
|
-
y:
|
|
1953
|
-
z:
|
|
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)),
|
|
1954
2396
|
color: null
|
|
1955
2397
|
};
|
|
1956
|
-
|
|
1957
|
-
}),
|
|
2398
|
+
r && (a.color = i.map((l) => l == null ? void 0 : l[r])), n.push(a);
|
|
2399
|
+
}), n;
|
|
1958
2400
|
}
|
|
1959
|
-
function
|
|
1960
|
-
return
|
|
1961
|
-
hole_id:
|
|
1962
|
-
from:
|
|
1963
|
-
to:
|
|
1964
|
-
radius:
|
|
1965
|
-
color: t ?
|
|
1966
|
-
value: t ?
|
|
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
|
|
1967
2409
|
}));
|
|
1968
2410
|
}
|
|
1969
|
-
function
|
|
1970
|
-
return
|
|
1971
|
-
hole_id:
|
|
1972
|
-
label: t == null ? void 0 : t[
|
|
1973
|
-
depth: 0.5 * (
|
|
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))
|
|
1974
2416
|
})) : [];
|
|
1975
2417
|
}
|
|
1976
|
-
function
|
|
2418
|
+
function Wr({
|
|
1977
2419
|
controlMode: e = "orbit",
|
|
1978
|
-
onToggleFly:
|
|
2420
|
+
onToggleFly: r = () => {
|
|
1979
2421
|
},
|
|
1980
2422
|
onRecenter: t = () => {
|
|
1981
2423
|
},
|
|
1982
|
-
onLookDown:
|
|
2424
|
+
onLookDown: n = () => {
|
|
1983
2425
|
},
|
|
1984
|
-
onFit:
|
|
2426
|
+
onFit: s = () => {
|
|
1985
2427
|
},
|
|
1986
|
-
darkBackground:
|
|
1987
|
-
onToggleDarkBackground:
|
|
2428
|
+
darkBackground: o = !1,
|
|
2429
|
+
onToggleDarkBackground: i = () => {
|
|
1988
2430
|
}
|
|
1989
2431
|
}) {
|
|
1990
|
-
return /* @__PURE__ */
|
|
1991
|
-
/* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
1993
|
-
/* @__PURE__ */
|
|
1994
|
-
/* @__PURE__ */
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
2432
|
+
return /* @__PURE__ */ U("div", { className: "baselode-3d-controls", children: [
|
|
2433
|
+
/* @__PURE__ */ T("button", { type: "button", className: "ghost-button", onClick: t, children: "Recenter to (0,0,0)" }),
|
|
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: [
|
|
2438
|
+
/* @__PURE__ */ T(
|
|
1997
2439
|
"input",
|
|
1998
2440
|
{
|
|
1999
2441
|
type: "checkbox",
|
|
2000
|
-
checked:
|
|
2001
|
-
onChange:
|
|
2442
|
+
checked: o,
|
|
2443
|
+
onChange: i
|
|
2002
2444
|
}
|
|
2003
2445
|
),
|
|
2004
2446
|
"Dark background"
|
|
2005
2447
|
] })
|
|
2006
2448
|
] });
|
|
2007
2449
|
}
|
|
2008
|
-
function
|
|
2450
|
+
function qr({
|
|
2009
2451
|
properties: e = [],
|
|
2010
|
-
selectedProperty:
|
|
2452
|
+
selectedProperty: r = "",
|
|
2011
2453
|
onPropertyChange: t = () => {
|
|
2012
2454
|
},
|
|
2013
|
-
opacity:
|
|
2014
|
-
onOpacityChange:
|
|
2455
|
+
opacity: n = 0.85,
|
|
2456
|
+
onOpacityChange: s = () => {
|
|
2015
2457
|
},
|
|
2016
|
-
propertyStats:
|
|
2017
|
-
clickedBlock:
|
|
2458
|
+
propertyStats: o = null,
|
|
2459
|
+
clickedBlock: i = null,
|
|
2018
2460
|
onPopupClose: a = () => {
|
|
2019
2461
|
}
|
|
2020
2462
|
}) {
|
|
2021
2463
|
var l, u;
|
|
2022
|
-
return /* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */
|
|
2024
|
-
/* @__PURE__ */
|
|
2464
|
+
return /* @__PURE__ */ U("div", { className: "bm-widget", children: [
|
|
2465
|
+
/* @__PURE__ */ T("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
|
|
2466
|
+
/* @__PURE__ */ U(
|
|
2025
2467
|
"select",
|
|
2026
2468
|
{
|
|
2027
2469
|
id: "bm-property-select",
|
|
2028
2470
|
className: "bm-widget__select",
|
|
2029
|
-
value:
|
|
2471
|
+
value: r,
|
|
2030
2472
|
onChange: (c) => t(c.target.value),
|
|
2031
2473
|
children: [
|
|
2032
|
-
e.length === 0 && /* @__PURE__ */
|
|
2033
|
-
e.map((c) => /* @__PURE__ */
|
|
2474
|
+
e.length === 0 && /* @__PURE__ */ T("option", { value: "", children: "— no attributes —" }),
|
|
2475
|
+
e.map((c) => /* @__PURE__ */ T("option", { value: c, children: c }, c))
|
|
2034
2476
|
]
|
|
2035
2477
|
}
|
|
2036
2478
|
),
|
|
2037
|
-
|
|
2038
|
-
/* @__PURE__ */
|
|
2039
|
-
/* @__PURE__ */
|
|
2040
|
-
/* @__PURE__ */
|
|
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)) ?? "—" }),
|
|
2481
|
+
/* @__PURE__ */ T("div", { className: "bm-widget__scale-bar" }),
|
|
2482
|
+
/* @__PURE__ */ T("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((u = o.max) == null ? void 0 : u.toFixed(2)) ?? "—" })
|
|
2041
2483
|
] }),
|
|
2042
|
-
|
|
2043
|
-
const
|
|
2044
|
-
return /* @__PURE__ */
|
|
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);
|
|
2486
|
+
return /* @__PURE__ */ T(
|
|
2045
2487
|
"span",
|
|
2046
2488
|
{
|
|
2047
2489
|
className: "bm-widget__category-chip",
|
|
2048
|
-
style: { background: `hsl(${
|
|
2490
|
+
style: { background: `hsl(${f},70%,50%)` },
|
|
2049
2491
|
children: c
|
|
2050
2492
|
},
|
|
2051
2493
|
c
|
|
2052
2494
|
);
|
|
2053
2495
|
}) }),
|
|
2054
|
-
/* @__PURE__ */
|
|
2496
|
+
/* @__PURE__ */ U("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
|
|
2055
2497
|
"Opacity (",
|
|
2056
|
-
Math.round(
|
|
2498
|
+
Math.round(n * 100),
|
|
2057
2499
|
"%)"
|
|
2058
2500
|
] }),
|
|
2059
|
-
/* @__PURE__ */
|
|
2501
|
+
/* @__PURE__ */ T(
|
|
2060
2502
|
"input",
|
|
2061
2503
|
{
|
|
2062
2504
|
id: "bm-opacity-slider",
|
|
@@ -2065,14 +2507,14 @@ function hr({
|
|
|
2065
2507
|
min: "0",
|
|
2066
2508
|
max: "1",
|
|
2067
2509
|
step: "0.01",
|
|
2068
|
-
value:
|
|
2069
|
-
onChange: (c) =>
|
|
2510
|
+
value: n,
|
|
2511
|
+
onChange: (c) => s(parseFloat(c.target.value))
|
|
2070
2512
|
}
|
|
2071
2513
|
),
|
|
2072
|
-
|
|
2073
|
-
/* @__PURE__ */
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2514
|
+
i && /* @__PURE__ */ U("div", { className: "bm-widget__popup", children: [
|
|
2515
|
+
/* @__PURE__ */ U("div", { className: "bm-widget__popup-header", children: [
|
|
2516
|
+
/* @__PURE__ */ T("span", { children: "Block attributes" }),
|
|
2517
|
+
/* @__PURE__ */ T(
|
|
2076
2518
|
"button",
|
|
2077
2519
|
{
|
|
2078
2520
|
type: "button",
|
|
@@ -2083,163 +2525,163 @@ function hr({
|
|
|
2083
2525
|
}
|
|
2084
2526
|
)
|
|
2085
2527
|
] }),
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2088
|
-
/* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ T("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ T("tbody", { children: Object.entries(i).map(([c, d]) => /* @__PURE__ */ U("tr", { children: [
|
|
2529
|
+
/* @__PURE__ */ T("th", { children: c }),
|
|
2530
|
+
/* @__PURE__ */ T("td", { children: d == null ? "—" : String(d) })
|
|
2089
2531
|
] }, c)) }) })
|
|
2090
2532
|
] })
|
|
2091
2533
|
] });
|
|
2092
2534
|
}
|
|
2093
|
-
const
|
|
2535
|
+
const zn = [
|
|
2094
2536
|
{ minZoom: 0, lodKey: "thumb" },
|
|
2095
2537
|
{ minZoom: 4, lodKey: "medium" },
|
|
2096
2538
|
{ minZoom: 7, lodKey: "full" }
|
|
2097
|
-
],
|
|
2098
|
-
function
|
|
2099
|
-
var
|
|
2100
|
-
const
|
|
2101
|
-
if (!
|
|
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))
|
|
2102
2544
|
return e.image_url || "";
|
|
2103
|
-
let
|
|
2104
|
-
for (const
|
|
2105
|
-
|
|
2106
|
-
return
|
|
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 || "";
|
|
2107
2549
|
}
|
|
2108
|
-
function
|
|
2109
|
-
return [...e].sort((
|
|
2550
|
+
function wn(e) {
|
|
2551
|
+
return [...e].sort((r, t) => (r.from_depth ?? 0) - (t.from_depth ?? 0));
|
|
2110
2552
|
}
|
|
2111
|
-
function
|
|
2112
|
-
const
|
|
2553
|
+
function Hn(e) {
|
|
2554
|
+
const r = {};
|
|
2113
2555
|
for (const t of e) {
|
|
2114
|
-
const
|
|
2115
|
-
n
|
|
2556
|
+
const n = t.photo_set != null && t.photo_set !== "" ? String(t.photo_set) : "default";
|
|
2557
|
+
r[n] || (r[n] = []), r[n].push(t);
|
|
2116
2558
|
}
|
|
2117
|
-
return
|
|
2559
|
+
return r;
|
|
2118
2560
|
}
|
|
2119
|
-
function
|
|
2120
|
-
const
|
|
2121
|
-
if (e >=
|
|
2122
|
-
const
|
|
2123
|
-
for (let
|
|
2124
|
-
const a = Math.round(
|
|
2125
|
-
|
|
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` });
|
|
2126
2568
|
}
|
|
2127
|
-
return
|
|
2569
|
+
return n;
|
|
2128
2570
|
}
|
|
2129
|
-
function
|
|
2571
|
+
function Un(e) {
|
|
2130
2572
|
return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
|
|
2131
2573
|
}
|
|
2132
|
-
function
|
|
2574
|
+
function Lt(e) {
|
|
2133
2575
|
return `tray_${String(e).padStart(3, "0")}.jpg`;
|
|
2134
2576
|
}
|
|
2135
|
-
function
|
|
2136
|
-
const
|
|
2137
|
-
return
|
|
2138
|
-
const c = l.filename ??
|
|
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;
|
|
2139
2581
|
return {
|
|
2140
2582
|
hole_id: e,
|
|
2141
2583
|
from_depth: l.fromDepth,
|
|
2142
2584
|
to_depth: l.toDepth,
|
|
2143
2585
|
photo_set: d,
|
|
2144
|
-
image_url: `${
|
|
2586
|
+
image_url: `${i}/${c}`,
|
|
2145
2587
|
lod_urls: {
|
|
2146
|
-
thumb: `${
|
|
2588
|
+
thumb: `${i}/${c}`,
|
|
2147
2589
|
full: `${a}/${c}`
|
|
2148
2590
|
}
|
|
2149
2591
|
};
|
|
2150
2592
|
});
|
|
2151
2593
|
}
|
|
2152
|
-
function
|
|
2153
|
-
const
|
|
2154
|
-
return Math.max(1, Math.round(e * t *
|
|
2594
|
+
function Xr(e, r, t = xt) {
|
|
2595
|
+
const n = r / 5;
|
|
2596
|
+
return Math.max(1, Math.round(e * t * n));
|
|
2155
2597
|
}
|
|
2156
|
-
const
|
|
2157
|
-
function
|
|
2598
|
+
const Fe = 5, ot = 1.12, jn = 0.05, Vn = 40;
|
|
2599
|
+
function Yn({
|
|
2158
2600
|
photos: e = [],
|
|
2159
|
-
holeId:
|
|
2601
|
+
holeId: r = "",
|
|
2160
2602
|
initialZoom: t = 5,
|
|
2161
|
-
transform:
|
|
2162
|
-
onTransformChange:
|
|
2603
|
+
transform: n,
|
|
2604
|
+
onTransformChange: s
|
|
2163
2605
|
}) {
|
|
2164
|
-
const [
|
|
2606
|
+
const [o, i] = K({ scale: 1, tx: 0, ty: 0 }), a = n ?? o, l = Ne(a);
|
|
2165
2607
|
l.current = a;
|
|
2166
|
-
const u =
|
|
2167
|
-
(
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2608
|
+
const u = $e(
|
|
2609
|
+
(b) => {
|
|
2610
|
+
const L = typeof b == "function" ? b(l.current) : b;
|
|
2611
|
+
s ? s(L) : i(L);
|
|
2170
2612
|
},
|
|
2171
|
-
[
|
|
2172
|
-
), [c, d] = K(!1),
|
|
2173
|
-
const
|
|
2174
|
-
for (const
|
|
2175
|
-
const A =
|
|
2176
|
-
|
|
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(() => {
|
|
2615
|
+
const b = /* @__PURE__ */ new Set();
|
|
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);
|
|
2177
2619
|
}
|
|
2178
|
-
return [...
|
|
2179
|
-
}, [e]), { minDepth:
|
|
2180
|
-
if (!
|
|
2181
|
-
const
|
|
2620
|
+
return [...b];
|
|
2621
|
+
}, [e]), { minDepth: p, maxDepth: E } = ee(() => {
|
|
2622
|
+
if (!g.length) return { minDepth: 0, maxDepth: 0 };
|
|
2623
|
+
const b = g.map((L) => L.to_depth ?? L.from_depth ?? 0);
|
|
2182
2624
|
return {
|
|
2183
|
-
minDepth:
|
|
2184
|
-
maxDepth: Math.max(...
|
|
2625
|
+
minDepth: g[0].from_depth ?? 0,
|
|
2626
|
+
maxDepth: Math.max(...b)
|
|
2185
2627
|
};
|
|
2186
|
-
}, [
|
|
2187
|
-
() => Math.max(1, Math.round((
|
|
2188
|
-
[
|
|
2189
|
-
),
|
|
2190
|
-
const
|
|
2191
|
-
return
|
|
2192
|
-
}, [
|
|
2628
|
+
}, [g]), x = xt * Fe / 5, F = ee(
|
|
2629
|
+
() => Math.max(1, Math.round((E - p) * x)),
|
|
2630
|
+
[p, E, x]
|
|
2631
|
+
), w = ee(() => {
|
|
2632
|
+
const b = Un(Fe);
|
|
2633
|
+
return Bn(p, E, b);
|
|
2634
|
+
}, [p, E]), k = 540 * Fe / 5, $ = ee(
|
|
2193
2635
|
() => Math.max(1, Math.min(10, Math.round(t * a.scale))),
|
|
2194
2636
|
[t, a.scale]
|
|
2195
|
-
),
|
|
2196
|
-
|
|
2197
|
-
const
|
|
2198
|
-
u((
|
|
2199
|
-
const
|
|
2637
|
+
), P = $e((b) => {
|
|
2638
|
+
b.preventDefault();
|
|
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;
|
|
2200
2642
|
return {
|
|
2201
|
-
scale:
|
|
2202
|
-
tx:
|
|
2203
|
-
ty:
|
|
2643
|
+
scale: _,
|
|
2644
|
+
tx: C - (C - v.tx) * D,
|
|
2645
|
+
ty: I - (I - v.ty) * D
|
|
2204
2646
|
};
|
|
2205
2647
|
});
|
|
2206
2648
|
}, [u]);
|
|
2207
2649
|
te(() => {
|
|
2208
|
-
const
|
|
2209
|
-
if (
|
|
2210
|
-
return
|
|
2211
|
-
}, [
|
|
2212
|
-
const
|
|
2213
|
-
|
|
2214
|
-
x:
|
|
2215
|
-
y:
|
|
2650
|
+
const b = m.current;
|
|
2651
|
+
if (b)
|
|
2652
|
+
return b.addEventListener("wheel", P, { passive: !1 }), () => b.removeEventListener("wheel", P);
|
|
2653
|
+
}, [P]);
|
|
2654
|
+
const H = $e((b) => {
|
|
2655
|
+
b.button === 0 && (b.preventDefault(), f.current = {
|
|
2656
|
+
x: b.clientX,
|
|
2657
|
+
y: b.clientY,
|
|
2216
2658
|
tx: l.current.tx,
|
|
2217
2659
|
ty: l.current.ty
|
|
2218
2660
|
}, d(!0));
|
|
2219
2661
|
}, []);
|
|
2220
2662
|
return te(() => {
|
|
2221
|
-
const
|
|
2222
|
-
if (!
|
|
2223
|
-
const { tx:
|
|
2224
|
-
u((
|
|
2225
|
-
...
|
|
2226
|
-
tx:
|
|
2227
|
-
ty:
|
|
2663
|
+
const b = (A) => {
|
|
2664
|
+
if (!f.current) return;
|
|
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 - _)
|
|
2228
2670
|
}));
|
|
2229
|
-
},
|
|
2230
|
-
|
|
2671
|
+
}, L = () => {
|
|
2672
|
+
f.current = null, d(!1);
|
|
2231
2673
|
};
|
|
2232
|
-
return window.addEventListener("mousemove",
|
|
2233
|
-
window.removeEventListener("mousemove",
|
|
2674
|
+
return window.addEventListener("mousemove", b), window.addEventListener("mouseup", L), () => {
|
|
2675
|
+
window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", L);
|
|
2234
2676
|
};
|
|
2235
|
-
}, [u]), /* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
|
|
2238
|
-
/* @__PURE__ */
|
|
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: [
|
|
2239
2681
|
Math.round(a.scale * 100),
|
|
2240
2682
|
"%"
|
|
2241
2683
|
] }),
|
|
2242
|
-
/* @__PURE__ */
|
|
2684
|
+
/* @__PURE__ */ T(
|
|
2243
2685
|
"button",
|
|
2244
2686
|
{
|
|
2245
2687
|
className: "core-photo-zoom-btn",
|
|
@@ -2250,92 +2692,92 @@ function An({
|
|
|
2250
2692
|
}
|
|
2251
2693
|
)
|
|
2252
2694
|
] }),
|
|
2253
|
-
e.length > 0 && /* @__PURE__ */
|
|
2254
|
-
/* @__PURE__ */
|
|
2255
|
-
|
|
2695
|
+
e.length > 0 && /* @__PURE__ */ U("div", { className: "core-photo-col-headers", children: [
|
|
2696
|
+
/* @__PURE__ */ T("div", { className: "core-photo-ruler-spacer" }),
|
|
2697
|
+
y.map((b) => /* @__PURE__ */ T(
|
|
2256
2698
|
"div",
|
|
2257
2699
|
{
|
|
2258
2700
|
className: "core-photo-set-header",
|
|
2259
|
-
style: { width:
|
|
2260
|
-
children:
|
|
2701
|
+
style: { width: k },
|
|
2702
|
+
children: b
|
|
2261
2703
|
},
|
|
2262
|
-
|
|
2704
|
+
b
|
|
2263
2705
|
))
|
|
2264
2706
|
] }),
|
|
2265
|
-
e.length === 0 ? /* @__PURE__ */
|
|
2707
|
+
e.length === 0 ? /* @__PURE__ */ T("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ T(
|
|
2266
2708
|
"div",
|
|
2267
2709
|
{
|
|
2268
2710
|
className: `core-photo-scroll${c ? " is-dragging" : ""}`,
|
|
2269
|
-
ref:
|
|
2270
|
-
onMouseDown:
|
|
2271
|
-
children: /* @__PURE__ */
|
|
2711
|
+
ref: m,
|
|
2712
|
+
onMouseDown: H,
|
|
2713
|
+
children: /* @__PURE__ */ U(
|
|
2272
2714
|
"div",
|
|
2273
2715
|
{
|
|
2274
2716
|
className: "core-photo-inner",
|
|
2275
2717
|
style: {
|
|
2276
|
-
height:
|
|
2718
|
+
height: F,
|
|
2277
2719
|
transform: `translate(${a.tx}px, ${a.ty}px) scale(${a.scale})`,
|
|
2278
2720
|
transformOrigin: "0 0"
|
|
2279
2721
|
},
|
|
2280
2722
|
children: [
|
|
2281
|
-
/* @__PURE__ */
|
|
2723
|
+
/* @__PURE__ */ T(
|
|
2282
2724
|
"div",
|
|
2283
2725
|
{
|
|
2284
2726
|
className: "core-photo-depth-ruler",
|
|
2285
|
-
style: { height:
|
|
2286
|
-
children:
|
|
2727
|
+
style: { height: F },
|
|
2728
|
+
children: w.map(({ depth: b, label: L }) => /* @__PURE__ */ T(
|
|
2287
2729
|
"div",
|
|
2288
2730
|
{
|
|
2289
2731
|
className: "core-photo-depth-marker",
|
|
2290
2732
|
style: {
|
|
2291
|
-
top: Math.round((
|
|
2733
|
+
top: Math.round((b - p) * x)
|
|
2292
2734
|
},
|
|
2293
|
-
children:
|
|
2735
|
+
children: L
|
|
2294
2736
|
},
|
|
2295
|
-
|
|
2737
|
+
b
|
|
2296
2738
|
))
|
|
2297
2739
|
}
|
|
2298
2740
|
),
|
|
2299
|
-
|
|
2741
|
+
y.map((b) => /* @__PURE__ */ T(
|
|
2300
2742
|
"div",
|
|
2301
2743
|
{
|
|
2302
2744
|
className: "core-photo-col-body",
|
|
2303
|
-
style: { height:
|
|
2304
|
-
children:
|
|
2305
|
-
const A =
|
|
2306
|
-
(A -
|
|
2307
|
-
),
|
|
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(
|
|
2308
2750
|
2,
|
|
2309
|
-
Math.round((
|
|
2310
|
-
),
|
|
2311
|
-
return /* @__PURE__ */
|
|
2751
|
+
Math.round((C - A) * x)
|
|
2752
|
+
), _ = Fn(L, $);
|
|
2753
|
+
return /* @__PURE__ */ U(
|
|
2312
2754
|
"div",
|
|
2313
2755
|
{
|
|
2314
2756
|
className: "core-photo-item",
|
|
2315
|
-
style: { top:
|
|
2316
|
-
title: `${A}–${
|
|
2757
|
+
style: { top: I, height: v, width: k },
|
|
2758
|
+
title: `${A}–${C} m`,
|
|
2317
2759
|
children: [
|
|
2318
|
-
|
|
2760
|
+
_ ? /* @__PURE__ */ T(
|
|
2319
2761
|
"img",
|
|
2320
2762
|
{
|
|
2321
|
-
src:
|
|
2322
|
-
alt: `Core ${A}–${
|
|
2763
|
+
src: _,
|
|
2764
|
+
alt: `Core ${A}–${C} m`,
|
|
2323
2765
|
loading: "lazy"
|
|
2324
2766
|
}
|
|
2325
|
-
) : /* @__PURE__ */
|
|
2326
|
-
|
|
2767
|
+
) : /* @__PURE__ */ T("div", { className: "core-photo-no-image" }),
|
|
2768
|
+
v >= 18 && /* @__PURE__ */ U("span", { className: "core-photo-item-label", children: [
|
|
2327
2769
|
A,
|
|
2328
2770
|
"–",
|
|
2329
|
-
|
|
2771
|
+
C,
|
|
2330
2772
|
" m"
|
|
2331
2773
|
] })
|
|
2332
2774
|
]
|
|
2333
2775
|
},
|
|
2334
|
-
`${
|
|
2776
|
+
`${L.hole_id ?? ""}-${A}-${C}-${b}`
|
|
2335
2777
|
);
|
|
2336
2778
|
})
|
|
2337
2779
|
},
|
|
2338
|
-
|
|
2780
|
+
b
|
|
2339
2781
|
))
|
|
2340
2782
|
]
|
|
2341
2783
|
}
|
|
@@ -2344,303 +2786,319 @@ function An({
|
|
|
2344
2786
|
)
|
|
2345
2787
|
] });
|
|
2346
2788
|
}
|
|
2347
|
-
function
|
|
2789
|
+
function Kr({
|
|
2348
2790
|
holeId: e = "",
|
|
2349
|
-
trays:
|
|
2791
|
+
trays: r = [],
|
|
2350
2792
|
thumbBaseUrl: t = "",
|
|
2351
|
-
fullBaseUrl:
|
|
2352
|
-
photoSet:
|
|
2353
|
-
getFilename:
|
|
2354
|
-
initialZoom:
|
|
2793
|
+
fullBaseUrl: n = "",
|
|
2794
|
+
photoSet: s = "Tray Images",
|
|
2795
|
+
getFilename: o = Lt,
|
|
2796
|
+
initialZoom: i = 5,
|
|
2355
2797
|
transform: a,
|
|
2356
2798
|
onTransformChange: l
|
|
2357
2799
|
}) {
|
|
2358
2800
|
const u = ee(
|
|
2359
|
-
() =>
|
|
2360
|
-
[e,
|
|
2801
|
+
() => Gn(e, r, t, n, s, o),
|
|
2802
|
+
[e, r, t, n, s, o]
|
|
2361
2803
|
);
|
|
2362
|
-
return /* @__PURE__ */
|
|
2363
|
-
|
|
2804
|
+
return /* @__PURE__ */ T(
|
|
2805
|
+
Yn,
|
|
2364
2806
|
{
|
|
2365
2807
|
photos: u,
|
|
2366
2808
|
holeId: e,
|
|
2367
|
-
initialZoom:
|
|
2809
|
+
initialZoom: i,
|
|
2368
2810
|
transform: a,
|
|
2369
2811
|
onTransformChange: l
|
|
2370
2812
|
}
|
|
2371
2813
|
);
|
|
2372
2814
|
}
|
|
2373
|
-
function
|
|
2374
|
-
const
|
|
2375
|
-
if (
|
|
2815
|
+
function Zr(e) {
|
|
2816
|
+
const r = typeof e == "string" ? JSON.parse(e) : e;
|
|
2817
|
+
if (r.schema_version !== "1.0")
|
|
2376
2818
|
throw new Error(
|
|
2377
|
-
`Unsupported schema_version: ${JSON.stringify(
|
|
2819
|
+
`Unsupported schema_version: ${JSON.stringify(r.schema_version)}. Expected "1.0".`
|
|
2378
2820
|
);
|
|
2379
|
-
if (!Array.isArray(
|
|
2821
|
+
if (!Array.isArray(r.blocks))
|
|
2380
2822
|
throw new Error('"blocks" must be a JSON array.');
|
|
2381
|
-
const t =
|
|
2382
|
-
if (
|
|
2383
|
-
if (
|
|
2384
|
-
if (!Array.isArray(
|
|
2385
|
-
if (!Array.isArray(
|
|
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".`);
|
|
2386
2828
|
return {
|
|
2387
|
-
id:
|
|
2388
|
-
name:
|
|
2389
|
-
vertices:
|
|
2390
|
-
triangles:
|
|
2391
|
-
attributes:
|
|
2392
|
-
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 ?? {}
|
|
2393
2835
|
};
|
|
2394
2836
|
});
|
|
2395
2837
|
return {
|
|
2396
|
-
schema_version:
|
|
2397
|
-
units:
|
|
2838
|
+
schema_version: r.schema_version,
|
|
2839
|
+
units: r.units ?? "",
|
|
2398
2840
|
blocks: t
|
|
2399
2841
|
};
|
|
2400
2842
|
}
|
|
2401
|
-
function
|
|
2402
|
-
const
|
|
2403
|
-
e.vertices.forEach(([o, i
|
|
2404
|
-
t[a * 3] =
|
|
2405
|
-
}),
|
|
2406
|
-
const
|
|
2407
|
-
return e.triangles.forEach(([o, i
|
|
2408
|
-
|
|
2409
|
-
}),
|
|
2410
|
-
}
|
|
2411
|
-
function
|
|
2412
|
-
const { defaultOpacity:
|
|
2413
|
-
return
|
|
2414
|
-
var
|
|
2415
|
-
const
|
|
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) => {
|
|
2856
|
+
var h, y;
|
|
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({
|
|
2416
2858
|
color: new Q.Color(a),
|
|
2417
2859
|
opacity: l,
|
|
2418
2860
|
transparent: u,
|
|
2419
2861
|
side: Q.DoubleSide,
|
|
2420
2862
|
flatShading: !0
|
|
2421
|
-
}), d = new Q.Mesh(
|
|
2863
|
+
}), d = new Q.Mesh(i, c);
|
|
2422
2864
|
d.userData = {
|
|
2423
|
-
id:
|
|
2424
|
-
attributes:
|
|
2865
|
+
id: o.id,
|
|
2866
|
+
attributes: o.attributes
|
|
2425
2867
|
};
|
|
2426
|
-
const
|
|
2427
|
-
|
|
2428
|
-
}), e.add(
|
|
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;
|
|
2429
2871
|
}
|
|
2430
2872
|
export {
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2873
|
+
ts as ALPHA,
|
|
2874
|
+
ns as ASSAY_COLOR_PALETTE_10,
|
|
2875
|
+
wt as ASSAY_NON_VALUE_FIELDS,
|
|
2434
2876
|
Y as AZIMUTH,
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
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,
|
|
2476
2918
|
W as DIP,
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
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,
|
|
2495
2937
|
N as HOLE_ID,
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2938
|
+
Gs as HOLE_TYPE,
|
|
2939
|
+
se as LATITUDE,
|
|
2940
|
+
js as LITHOLOGY_COLOURS,
|
|
2499
2941
|
oe as LONGITUDE,
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
tr as
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
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,
|
|
3102
|
+
G as withDataErrorContext
|
|
2645
3103
|
};
|
|
2646
3104
|
//# sourceMappingURL=baselode.js.map
|